Posts

Showing posts from April, 2011

javascript - modal keep open during validation -

i'm doing record modal boostrap laravel performing validation. sending data via jquery ajax realize it. problem have pressing submit button closes modal. how keep open modal until end of validacion ?? thank you modal: <!--- register modal --> <div class="modal fade" id="register" role="dialog"> <div class="modal-dialog"> <!-- modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">registro</h4> </div> <div class="modal-body"> <form class="form" role="form" id="new-user" data-token="{{ session::token() }}" method=&qu

mysql - Get data from table by County in a single row -

Image
i want data table in single row single county. right shown in images shows different rows single county kalamazoo. should show single both records in single row. i using following query select county, virus, sumofpositivetests statewisedata state = 'michigan' i want results shown following county virus sumofpositivetests --------------------------------------------- kalamazoo h3n2,h3n8 3 total sum of both h3n2 , h3n8 use mysql group_concat the following mysql statement return list of comma(,) separated 'virus's each group of 'county' statewisedata table select county,group_concat(virus),sum(sumofpositivetests) statewisedata state='michigan' group county

linux - Set up Git incorrectly and committed to Github -

i've made typo when setting git. used incorrect setup commit github. latter, realized github not recording commits (not showing profile picture on commit , of course didn't count these commits) question is, there way tell fix issue? github knows committed me?. github matches commit author email, ensure that: your email added github profile your email set in local git config if want change author email exiting commits, follow this instruction . (you can use git commit --amend single commit or git filter-branch multiple commits. see details in this question .)

Update Django postgresql database in Digital Ocean Droplet? -

this question might out of site's context, please redirect me right site if that's case. anyway, have django installed in digital ocean droplet, moved apps filezilla server, setup correct static folders , working fine except database. now, have created postgresql database on computer , i've added data, have no idea how can move them server database. don't know databases, i'm not ever sure database located. there way of automatic database deployment, or perhaps way find , move filezilla server? use ssh connect droplet, proceed postgresql-server installation. @ install guides done. your database located in droplet, you'll configure django settings.py connect local database @ 127.0.0.1 . you can have @ guide ubuntu on digitalocean. all have configuring db using django , migrating app. django provides easy way export/import db data : python manage.py dumpdata generate output, on linux redirect > fixture.json . on offline installatio

.htaccess - Rewrite rule in php -

i have url http://example.com/test.php?pid=105701 i need remove .php in url.i have tried lot url has going this http://example.com/test/?pid=105701 in above url go directory structure. not able access test.php file this .htaccess file rewriteengine on rewritecond %{request_filename}.php -f rewritecond %{request_uri} !/$ rewriterule ^(.*)$ $1\.php help me on in advance you have make corrections, should exclude cases contains .php also: rewriteengine on # rewrite filename.php rewriterule ^([^.?]+)$ %{request_uri}.php [l] # return 404 if original request filename.php rewritecond %{the_request} "^[^ ]* .*?\.php[? ].*$" rewriterule .* - [l,r=404]

Parsing php requires -

this easy can't seem able figure out now. lets assume have 2 sets of .php files: set 1, contains files named page1.php, page2.php, ... pagen.php. set 2, contains files named module1, module2.php, ... modulen.php. files "set 1" contain non-php code should treated text, , using <?php require("somefilefromset2.php");?> to include respective contents files on set 2. files set 1 never php "required" other file. also, files "set 2" can required 1 or more files "set 1", can "require" other files, "set 2" only. if somefilefromset2.php getting "required" anotherset2file.php, first cannot require file 's been required (the latter), mean there not circular issues. (i explain (better?) using more sets of files, tried stick 2 simplicity). files set 2 contain non-php code treated text again. there no other php code in none of files of either set, except <?php require("somefilefro

linux - how to store result of tail command in variable? -

i developing application in mean stack. want create script of image resizing & cropping background process when new image uploads server. script watches new image uploads in folder , crop it. i preferred way of linux shell scripting daemon. i have used following idea accomplished tasks. - new image uploads on server writes in photolog.txt file, can grab images line line. - read photolog.txt in watch.sh shell scripting file. - iterates through line line, until reaches eol. - again new file arrives append @ eol. - manage updated file tail command, , latest add file display in command-line. upto code works charm. now grab image list of newly added file on server. main issue fails store output of tail command in variable, , must me because whatever output full path of filename , use in imagemagick crop command. imagemagick center crop scale image. convert -define file-type :size= widthxheight original_filename -thumbnail 120x120^ -gravity center -ext

javascript - Response whose "body" is locked cannot be used to respond to a request -

i trying service workers in google chrome. stumbled upon error. googling error gives 1 single result @ moment seems in google chrome sourcecode . i not convinced error bug. when try in firefox, corrupted content error screen. occurs when handling fetch event project root: self.addeventlistener('fetch', function(event) { // nice url var requesturl = new url(event.request.url); console.log("request for: ", requesturl.href); // network, cache, fallback event.respondwith( // try download fetch(event.request) .then(function(x) { console.log(" "+requesturl.href+" >> ",x); // if failed x not ok if(x && x.ok) { // if result ok save cache cache.put(event.request, x); return x; } else // try fetch cached version if request failed return cache.match(event.request); }) // in case of error return 404 page

Example Flex Box layout for Android 6 (stock browser - WebView) -

i need way make flex box work in android webview stock browser, able achieve proper layouts on older android devices running android 4.4, when use on android 6, page renders blank. <!doctype html> <html> <head> <meta charset="utf-8"> <title>test flex layout</title> <style> html, body, .container { height: 100vh; /*setting 100% here doesn't either, , makes android 4.4 render blank page*/ margin: 0px; } .container { display: flex; overflow: hidden; -ms-flex-direction: column; -webkit-flex-direction: column; flex-direction: column; } .container > * { -ms-flex: 0 0 auto; -webkit-flex: 0 0 auto; flex: 0 0 auto; overflow: scroll; } .container > .header, .container > .footer { height: 50px; background: grey; color: white;

html - How to have internal links for sections get redirected from another page -

i'm trying make webstite , it's going great, on 1 of pages, has multiple sections such about us , contact us , have internal links sorted extent go section page, drop down menu items highlighted. what did first give headers id exampe <h3 id="aboutus"> , in menu item, did #aboutus worked when on page not when wasn't, changed menu item included url page www.website.co.uk/about-us/#aboutus causes drop down menu items highlighted. how change have if i'm on, lets say, home page , click on about us , directs me section without whole drop down menu being highlighted? edit the menus , drop down menus provided in plugin in wordpress edit 2 the code have in about page <h3 id=aboutus>about us</h3> , menus automatically given part of plugin on wordpress.

php - find Prestashop shop available languages within a module -

good day all. i'm doing prestashop module, , i'm using logic in .tpl file: {foreach $languages $lang} ... {/foreach} i'd move kind of logic module php, , not .tpl file, because logic becoming little complex , don't templates logic in them. the problem have can't find way languages within module (i'm not considering db queries @ stage, i'd switch brutal fetch in case didn't solve in more smooth way). actually, can retrieve actual language using: $this->context->language->id it's cool isn't enough, need is: all current languages of shop all shops all languages of gives shop point 1 important, point 2 , 3 considered because i'd scale solution in multishop environments. does have clue on whre should start search? does can answer point 1? you can language class through static methods. languages of current shop: language::getlanguages(true, $this->context->shop->id); languages of shops lang

python - Error Virtual environment Loading psycopg2 module when deploying using apache wsgi module -

i deploying django using apache wsgi module , stuck @ following improperlyconfigured error: improperlyconfigured: error loading psycopg2 module: /home/uadmin/django/apache2/htdocs/virtualenv/lib/python2.7/site-packages/psycopg2-2.6.1-py2.7-linux-x86_64.egg/psycopg2/_psycopg.so: undefined symbol: pyunicodeucs4_asutf8string django manage.py shell says: >>> import django >>> django.version (1, 8, 1, 'final', 0) >>> import django.db.backends.postgresql_psycopg2 >>> settings.py has: databases = { 'default': { 'name': 'db', 'engine': 'django.db.backends.postgresql_psycopg2', 'user': '<user>', 'password': '<pass>' }, 'anotherdatabase': { 'host':'<ip>', 'name': '<db_name>', 'engine': 'django.db.backends.mysql',

java - how to find i of a token in an array[i] -

so, i've found word in document , print line in word present this: say example file contains : "the quick brown fox jumps on lazy dog.jackdaws love big sphinx of quartz." fileinputstream fstream = new fileinputstream(file); bufferedreader br = new bufferedreader(new inputstreamreader(fstream)); string strline; //read file line line while((strline = br.readline()) != null){ //check see whether testword occurs @ least once in line of text check = strline.tolowercase().contains(testword.tolowercase()); if(check){ //get line, , parse words string array string[] linewords = strline.split("\\s+"); for(int i=0;i<linewords.length;i++){ system.out.print(linewords[i]+ ' '); } and if search 'fox' , linewords[] contain tokens first sentence. , lin

How do I view the Ruby method #lcm in the source code? -

i'm trying understand how #lcm works. belongs in integer class, seen on docs . i've looked @ ruby's github page don't know how navigate it. thanks. personally, prefer read rubinius's source code on reading yarv's. rubinius better structured, better factored, and, above all, of written in language ruby programmers know well, namely ruby: def lcm(other) raise typeerror, "expected integer got #{other.class}" unless other.kind_of?(integer) if self.zero? or other.zero? 0 else (self.div(self.gcd(other)) * other).abs end end ironruby's source code structured, unfortunately no longer maintained: [rubymethod("lcm")] public static object/*!*/ lcm(int self, int other) { return lcm(self, other, signedgcd(self, other)); } [rubymethod("lcm")] public static object/*!*/ lcm(biginteger/*!*/ self, biginteger/*!*/ other) { return lcm(self, other, signedgcd(self, other)); } [rubymethod("lcm&q

javascript - jQuery onclick call function -

i've found script converts json file quiz using jquery. i playing it's code day , can't come wanted have. functions quiz().init(); , quiz().bindsubmit(); called when page loaded. what want start button must clicked first load quiz. $("#start").click(function(){ currentquestion = 0; questioncount = 0; answerarray = []; infomode = false; gotdata = false; inmemorydata = []; quiz().init(); quiz().bindsubmit(); }); html: <button type="button" id="start">start</button> <div id="quiz-content"></div> it works @ first click of start button in next clicks, reset quiz , goes #1. but problem after first click of start button , quiz won't work when submitting quiz. quiz began stucked in #1. for better understanding, jsfiddle here . edited: when user click start button more once,the quiz gets started beginning ,but didn't next question(gets stuck on 1st

How do I set traditional/braindead mode in octave 4 -

before octave 4.x run octave cli octave --traditional, gui mode default when running octave start octave shortcut (i'm using os x yosemite ) is there command or can put on .octaverc switch traditional mode you need set number of variables octacerc: ps1 = ">> " ps2 = "" beep_on_error = true confirm_recursive_rmdir = false crash_dumps_octave_core = false disable_diagonal_matrix = true disable_permutation_matrix = true disable_range = true fixed_point_format = true history_timestamp_format_string = "%%-- %d %i:%m %p --%%" page_screen_output = false print_empty_dimensions = false save_default_options = "-mat-binary" struct_levels_to_print = 0 warning('off', 'octave:abbreviated-property-match') warning('off', 'octave:fopen-f

Which IntelliJ config files should I save in my dotfiles? -

i keep intellij config files in dotfiles repo ~/.intellijidea2016.1 folder weights > 1.3g :( ~/.intellijidea2016.1/config/ still weights > 215m... ~/.intellijidea2016.1/config/plugins/ contains lots of binaries... not best candidates dotfiles :( anyone tried save intellij config without export/import settings menu option? no need store intellij config file, use ide settings sync plugin. see post: better synchronization of settings across devices

javascript - how to detect whether file download successfully from client side in mean/angular js -

i have created chat application in have kept file sending functionality on chat windows. want remove files server end when clients download them. i'm using mean stack. router.post("/postchatfilesend",ensureauthenticatedforpost,function(req,res) { if (req.body.filename) { var filepath = __dirname + '/../public/chatfile/'+req.body.filename; fs.unlink(filepath, function (err) { }) }; return res.json({"status": true,"messages":"messages read sucessfully"}); }) router.get('/downloadchatfile/:filename',ensureauthenticatedforpost, function(req, res) { var file = __dirname + '/../public/chatfile/'+req.params.filename; res.download(file); }); you can use jquery file download plugin purpose, it's simple example can use in client manage downloaded file: $.filedownload('urlforyourfile') .done(function () { alert('file download suc

ajax - How to delay Primefaces AjaxStatus on JSF? -

how add delay (300ms example) on when primefaces' ajaxstatus show. right shows when there's ajax request pending. troublesome example on "onkeyup" events when each key stroke brings loading dialog split second. here's ajaxstatus loading indicator component: <p:ajaxstatus id="startajax" onstart="pf('start').show();" oncomplete="pf('start').hide();" > </p:ajaxstatus> <p:dialog widgetvar="start" showheader="false" resizable="false"> <h:graphicimage value="#{resource['/images/loading.gif']}"></h:graphicimage> </p:dialog> you need wrap pf('start').start() function call delay. also, oncomplete handler should check if have pending status show , cancel them. avoid case ajax finished before status displayed. code should (not tested) <p:ajaxstatus id = "startajax" onstart = "starthandler();"

jquery - How to use text of option to find value of the same -

i have multiple select option id name test , has 1 option b. $('#test').find('option[text="b"]').val(); here if use getting correct result i.e. value of option. problem in jquery don't have b instead of have variable has value b.please tell me guys how can use variable in place of b in jquery. i tried using this var x=myvariable $('#test').find('option[text=x]').val(); thanks you can concatenate variables this, try: $('#test').find('option[text="'+x+'"]').val()

angularjs - select list box of type mutiple unable to set selectidex to zero or first element -

Image
i using simple angular js select listbox multiple selection, used add elements select clicking add button, dynamically add server name in listbox, select multiple type, can multi select , remove item clicking on remove button. the problem cannot set selected index 0 or first element upon removing items... cannot able select items after that.. in simple after remove elements need set selected index "no selection" or first element. serverping.jsp <!doctype html> <%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <html> <head> <meta charset="utf-8"> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> &l

objective c - iOS Swift: UIPageViewController & API Calls in ContentViewControllers -

i've implemented uipageviewcontroller contains variable number of uiviewcontrollers each call api in viewdidload method. i'm having few problems due "known issue" of viewcontrollerbeforeviewcontroller , viewcontrollerafterviewcontroller data source methods being called twice. e.g when swiping right, next , 1 after next view controllers initialised. in turn means each initialised view controller's api calls made. i want next view controller initialised , hence 1 api call made. had thought moving api call viewwillappear although prefer if next view controller initialised. is there way ensure data source methods called once? thanks :) func pageviewcontroller(pageviewcontroller: uipageviewcontroller, viewcontrollerafterviewcontroller viewcontroller: uiviewcontroller) -> uiviewcontroller? { let currentindex = self.pages.indexof(viewcontroller as! locationviewcontroller)! if currentindex == self.pages.count-1 { return nil }

java - how to send html email in android? -

Image
hi making app in sending email specific address this email html email table , images , all... is have tried add html.fromhtml() keeps saying type mismatch needed string found spanned.... if need of code please comment please suggest tutorial if have in mind edit forgot mention sending mail using javax.mail library not using intents tried use html.tohtml(spanned text) giving message of type mismatch cant convert string spannedtext i have no idea whats happening i receiving html data in mail if go it update fetching content string resource , getting result $message = ' support enquiry@makeintern.comcontact form enquiry ! name: :'.$name.'email: :'.$email.'contact: :'.$mobile.'message: :'.$message.'date-time: :'.$current_date.' thanks , regards makeintern team account manager - makeintern cell www.makeintern.com enquiry@makeintern.com if query please call on : 011-45544188  www.makeintern.com |

python - Pandas Dataframe exists outside of method. Why -

lets presume have simple dataframe df , simple method dataframe def alterdf(df): df1['new column'] = df['some column'] + x return df1 in above method modify entire column x , save new variable name...inside method! however, when inspect original dataframe (i.e. df) see has new column added it... i aware original dataframe created exists outside of method. expect alterations occur inside method, should remain there, unless save changes via return block in method. however, know wrong...the changes applied within method, occur outside of method. how can be? why so? probably because have line this df1 = df # doing copy reference if want copy dataframe use df1 = df.copy() instead

seo - Googlebot and other crawlers are clicking on javascript links -

we running vue.js on 1 of our applications, , generating anchor tags it. google crawling this, can see search results. however, crawling bot has javascript disabled, , encounters links following: <a href="/electronica/{{ auction.main_image_big }}"></a> this generating errors in our laravel application, because come our webserver as: /electronica/%7b%7b%20auction.main_image_big%20%7d%7d what best approach prevent crawler without javascript enabled click on these links. redirect them page? keep in mind still want googlebot crawl these links when javascript enabled, because these links lead of our products. use v-bind instead: <a v-bind:href="'/electronica/' + auction.main_image_big"></a> or v-bind short version , es6 string templates: <a :href="`/electronica/${auction.main_image_big}`"></a> as won't turned href attribute without javascript enabled, bot skip those. it's futu

java - String value not showing in output.setText -

Image
im trying show day name along date in app , text defined " text " shows fine , integer values show fine, not show text variable, have: calendar = calendar.getinstance(); textview output3 = (textview) findviewbyid(r.id.output3); int dayno = now.get(calendar.day_of_week); string dayname = new string();// tried string dayname = ""; same results if (dayno == 1) dayname = "sun"; if (dayno == 1) dayname = "mon"; if (dayno == 1) dayname = "tue"; if (dayno == 1) dayname = "wed"; if (dayno == 1) dayname = "thu"; if (dayno == 1) dayname = "fri"; if (dayno == 1) dayname = "sat"; also tried this: if (dayno == 1) {dayname = "sun";} if (dayno == 1) {dayname = "mon";} if (dayno == 1) {dayname = "tue";} if (dayno == 1) {dayname = "wed";} if (dayno == 1) {dayname = "thu";} if (dayno == 1) {dayname = "fri";} if (dayno == 1) {dayname = "sat&

javascript - Element removal via ng-if is delayed when using ngAnimate -

element removal dom ng-if or ng-show delayed when nganimate injected app, not occur otherwise. plunkr: https://plnkr.co/edit/rptjsdccggpg6xfs0ivp var app = angular.module('app', ['nganimate']); why happening, , how fix it? this kind of workaround hack make work, if wrap buttons in <div></div> ng-if on wrapper load. https://plnkr.co/edit/pgzgrkzzho7gsckwfp23?p=preview

excel vba - VBA Array issues -

i trying generate random variable 0-1 5000 times. , then, put them ranges e.g. 0-0.05, 0.05-0.1.... count frequency of each range. however, seems code doesnt work. on it? appreciated!!!! option explicit option base 1 sub mna() dim iteration long, long iteration = 5000 redim ai1(iteration) double = 1 iteration: cells(4, 3) = ai1(i) = randomnumber next call hist1(iteration, 20, 0, 1, ai1) end sub function randomnumber() randomize randomnumber = rnd() end function sub hist1(n variant, m long, start double, right double, arr() double) dim long, j long, find long dim length double redim breaks(m) single redim freq(m) single = 1 m freq(i) = 0 next length = (right - start) / m = 1 m breaks(i) = start + length * (i) next = 1 n if (arr(i) <= breaks(1)) freq(1) = freq(1) + 1 if (arr(i) >= breaks(m - 1)) freq(m) = freq(m) + 1 j = 2 -1 if (arr(i) > breaks(j - 1) , arr(i) <= breaks(j)) freq(j) =

c++ - Undefined WIN32 messages -

i getting strange input in windows message callback. besides normal messages, wm_size , work fine, there messages not appear in table, this one . , not defined error codes , either. the messages are: (decimal / hex) 356 / 0164 (wparam: 0, lparam: 5760884) 49291 / c08b (wparam: 4294967292 or 0, lparam: 0) 49348 / c0c4 (wparam: 0, lparam: 0) does know mean, or why gettting them? per win32 documentation: the following ranges of message numbers. range meaning 0 through wm_user–1 messages reserved use system. wm_user through 0x7fff integer messages use private window classes. wm_app (0x8000) through 0xbfff messages available use applications. 0xc000 through 0xffff string messages use applications. greater 0xffff reserved system. message numbers in first range (0 through wm_user –1) defined system. values in range not explicitly defined reserved system. message numbers in seco

java - Creating Gradle file for REST-Web Service -

i pretty new gradle , want create buildfile rest-service. after read introduction on gradle homepage , other pages started new project using command gradle init --type=java-project because service java based. structure of project created , wanted insert .class files directories. first problem: don´t know proper structure kind of project. after focused on dependencies, added. want build project, error occurs has usage of jersey technology. if compile service eclipse, works fine, code works. so 2 questions are: how create proper file structure ? how fix issue servlet/war-compilation here structure of project in eclipse: restwebservice |--java resources | |--src | |--com.name.restproject.rest | | |--webcontroller.java //contains jersey rest service | |--com.name.restproject.service | |--serviceutil.java //contains util methods |--libraries | |--apache tomcat v7 | |--asm-3.3.1.jar | |--ear libraries | |--gson-2.5.jar | |--jersey

angularjs - Only use ng-if the first time the data loads -

hi have table populated using ng-repeat. each row of table has few inputs saved database. my api passes view model json angular, if there value object want display value in column without input. this table <table class="table table-responsive"> <thead> <tr> <th></th> <th>result value</th> <th>statement / instructions</th> </tr> </thead> <tbody> <tr data-ng-repeat="c in mydata.items"> <td>{{ c.name }}</td> <td ng-if="c.numericvalue">{{c.numericvalue}}</td> <td ng-if="!c.numericvalue"> <input type="text" name="value" data-ng-model="c.numericvalue" data-ng-trim="false"> </td> <td ng-if="c.statement">{{c.statement}}</td> <td ng-if="!c.statement">

sublimetext - What is line endings in Sublime Text? -

this question has answer here: difference between \n , \r? 8 answers i new sublime text , saw there's setting of line endings allows me change 'windows','unix' , 'mac os'. can explain me? thx~ before there computers, people wrote text on typewriters. new line on paper, need feed line (scroll paper 1 line up) , carriage return (put pointer on beginning of line). new technologies adapted these techniques. on unix-like systems, native editors not set carriage-return (cr) flag, line-feed (lf). in windows, line endings denoted both cr , lf. mac os setting refers classic mac os (pre-os x), used cr. modern mac os (os x , macos) uses lf, unix-based. the wikipedia article on newline has overview. if working windows only, leave is. if need swap files between unix-like , windows systems, set editor on windows use utf-8 encoding files ,

javascript - Add delete botton image from gallery js -

i want add x delete image gallery users. search , see code : link code he add delete span when user hover @ image, want same process when click "delete" or icon form: <form class='form-horizontal' role='form' method='post' action='/servicegallery.php'> <button class='bot-ico' type='submit' value='" . $images['id'] ."' name='imageid'><img src='/images/trash-ico.png'> </button> <input type='hidden' name='mill_act' value='gallery_action_delete' /> </form>"; can me ?

go - unrecognized import path "google/protobuf" -

i'm trying setup chaincode environment , start learning develop chaincode, followed setup steps here , tested setup environment mentioned here when i'm trying add hyperledger shim environment (as explained here ), i'm getting following error : package google/protobuf: unrecognized import path "google/protobuf" i've protobuf installed. protoc --version command gives me libprotoc 2.6.1 output. can tell me i'm going wrong. the instructions establishing development environment cited in original question pretty clear go 1.6 or above prerequisite . upgrading 1.6.2, per @jimb comment above resolved issue.

c++ - cout a class object using conversion operator -

#include <iostream> #include <cmath> using namespace std; class complex { private: double real; double imag; public: // default constructor complex(double r = 0.0, double = 0.0) : real(r), imag(i) {} // magnitude : usual function style double mag() { return getmag(); } // magnitude : conversion operator operator int () { return getmag(); } private: // class helper magnitude double getmag() { return sqrt(real * real + imag * imag); } }; int main() { // complex object complex com(3.0, 4.0); // print magnitude cout << com.mag() << endl; // same can done cout << com << endl; } i don't understand how compiler resolving call conversion operator cout << com << endl; . i can have more 1 conversion operator in same class. how resolution done in case? you have declared conversion operator int . since opera

architecture - CometD: publish from external server -

Image
i trying understand use cases / architecture of typical users of cometd see if on right track. here diagram describing our intended use. we have cometd server more of event pub/sub our web services, no content pass through cometd, event data. web services can publish events clients based on action process or can happen long running process / scheduled process. my questions based on java client: is appropriate use of cometd java client? documentation seems java client used short term life applications desktop apps. given java client cometd, should have single instance or pool of clients handle sending events cometd web service instance? the client code seems elaborate enough handle batching messages , multiple threads calling , seems establishing client expensive on fly when needed publish 1 message, correct? thank time! yes, appropriate use of cometd java client. you can have single instance of cometd java client, safe multi-threaded usage, or can have 1 co

java - Better way to organize read/write actions in my project -

my code contains following read/write methods write data database read methods like public byte[]readfile(arg1) public byte[] readfile(arg1, arg2) public inputstream readfile(arg1, arg2) public mystream readfile(arg1, arg2) public byte[] readfile(arg1, arg2, arg3) write methods like public string[] writefile(arg1) public string[] writefile(arg1, arg2) public mystream writefile(arg1, arg2) -> file written outputted stream public string[] writefile(arg1, arg2, arg3) various classed access these methods read , write purpose. kindly provide me better way organize in better way. i have centralized part read/write happen. someone please me choosing appropriate pattern organize well. you this: interface databaseservices { ... listing methods want "combine" class databaseservicesimpl implements databaseservices { ... implementing methods enum databaseservicesprovider implements databaseservices { instance; private final databasese

ios - Estimote SDK Ignoring file... file was built for unsupported file format -

i having trouble estimote indoor location sdk in xcode 7.3.1. error receiving follows: ld: symbol(s) not found architecture x86_64 clang: error: linker command failed exit code 1 (use -v see invocation) at end. have added estimotesdk.framework , estimote indoor location sdk (two separate items, latter extension of former) project in supporting files folder in xcode project. have tried numerous solutions fix issue, including: enable modules in build settings, add framework embedded binaries, add -lc++ flag other linker flags ; update framework/header search paths, add missing files directly project, add/remove architectures build settings ; add double quotes library search path ; change tests host application target ; make sure frameworks not double compiled ; as deleting derived data , cleaning project often. new xcode of yesterday, solution may obvious , not me. seems issue library not correctly built architecture need? full error receiving included here.

node.js - Atuthentication with socket io in android for chatting app -

i developing 1 one chatting app socket.io in android. can send & receive messages single chat room. following this tutorial . apps chat module looks that . now, want sent & receive message single user. during development, observed each , every socket connection , socket.io gives client new id looks : /#iyq7lakzlclf7g3daaaa for reasons can't track specific user send message. qs 1. have connect database storing user credential send message specific user & send offline message him/her? chatting feature additional function in android app. app uses token based authentication. i novice in node js & socket.io. give me architectural guideline how solve this. tia. my app.js code : var express = require('express'); var app = express(); var server = require('http').createserver(app); var io = require('socket.io')(server); var port = process.env.port || 3000; server.listen(port, function () { console.log('server listening @

extjs4 - Extjs filtering is not Working properly -

Image
i new extjs. have written code applying filtering in grid, not working properly. attaching code snippet have written applying filtering. without filters, grid displayed @ panel. ext.create('ext.data.store', { storeid: 'userdetailsstore', fields: ['username', 'firstname', 'lastname', 'role', 'activeuser'], data: {'items': [ {"username": 'user1', "user1-firstname": "firstname", "lastname": "user1-lastname", "role": 'admin', "activeuser": 'y'}, {"username": 'user2', "firstname": "user2-firstname", "lastname": "user2-lastname", "role": 'type1', "activeuser": 'y'}, {"username": 'user3', "firstname