Posts

Showing posts from January, 2014

ios - building xcode project from jenkins fails. when building in command line runs just fine. why? -

ios - building xcode project from jenkins fails. when building in command line runs just fine. why? - building xcode project jenkins fails. when building in command line runs fine. why? is error get: [beror]code sign error: no matching provisioning profile found: build settings specify provisioning profile uuid “_uuid_”, however, no such provisioning profile found. [beror]codesign error: code signing required product type 'application' in sdk 'ios 7.1' this command line used: xcodebuild -project projectname.xcodeproj/ -target targetname -configuration release -sdk iphoneos7.1 clean build ps: object censored question can appear online, there real info there before. are using login key-chain or did create different key-chain jenkins builds app signing? if using login key-chain create sure unlock key-chain during build. if using different key-chain create sure swap key-chains , unlock it. jenkins - xcode build works codesign fails - threa...

Sql statement JavaScript -

Sql statement JavaScript - i see statement in executesql below: addtodo: function (text) { app.db.transaction(function (tx) { var ts = new date(); tx.executesql("insert todo(todo, added_on) values (?,?)", [text, ts], app.onsuccess, app.onerror); }); }, my question is: " values (?,?) " mean? that's prepared statement, should utilize prevent sql injection attacks. e.g. var text = "foo"; var ts = "bar"; tx.executesql("insert todo(todo, added_on) values (?,?)", [text, ts]); is same as: tx.executesql("insert todo(todo, added_on) values ('foo','bar')"); javascript sql sqlite

Bash process substitution in Python with Popen -

Bash process substitution in Python with Popen - i'm attempting create looped video file calling ffmpeg python subprocess library. here's part that's giving me problems: import subprocess sp sp.popen(['ffmpeg', '-f', 'concat', '-i', "<(for f in ~/desktop/*.mp4; echo \"file \'$f\'\"; done)", "-c", "copy", "~/desktop/sample3.mp4"]) with above code i'm getting next error: <(for f in /home/delta/desktop/*.mp4; echo "file '$f'"; done): no such file or directory i did find phrased question here. i'm not sure how solution might apply solving issue. edit: help everyone! next advice in comments , looking elsewhere ended changing code this: sp.popen("ffmpeg -f concat -i <(for f in ~/desktop/*.mp4; echo \"file \'$f\'\"; done) -c re-create ~/desktop/sample3.mp4", shell=true, executable="/bin/bash") ...

c++ - Does boost offer make_zip_range? -

c++ - Does boost offer make_zip_range? - here: http://stackoverflow.com/a/20703588/1593077 comment suggests useful construct, similar make_zip_iterator , ranges: takes tuple of ranges , produces new range - begin() , end() iterators appropriate zip iterators. now, should not hard implement, wondering - isn't offered boost somehow? boost.range providing combine() function zip_iterator 's range. http://www.boost.org/doc/libs/1_56_0/libs/range/doc/html/range/reference/utilities/combine.html c++ boost iterator tuples commutativity

javascript - Weird behaviour with 'use strict' and read only properties -

javascript - Weird behaviour with 'use strict' and read only properties - on mdn strict mode reference page says any assignment silently fails in normal code (assignment non-writable property, assignment getter-only property, assignment new property on non-extensible object) throw in strict mode so, using example, doing next throws typeerror "use strict"; var obj1 = {}; object.defineproperty(obj1, "x", { value: 42, writable: false }); obj1.x = 9; // throws typeerror however ran illustration seems 'use strict' beingness little overzealous rule. here setup definelol.js object.defineproperty(object.prototype, 'lol', { value: 'wat' }) setlol.js 'use strict'; console.log('here 0'); var sugar = { lol: '123' } console.log('here 1'); var verbose = {}; verbose.lol = '123'; console.log('here 2'); console.log('sugar.lol:', sugar.lol); console.log(...

ios - UITableView in a Today Extension not receiving row taps -

ios - UITableView in a Today Extension not receiving row taps - i have ios 8 app today extension. extension has uitableview in , rendering correctly. however, didselectrowatindexpath doesn't seem called reliably. guessing because notification center uiscrollview , embedding uitableview in causes issues, not sure. does know might causing issue? workaround: set opacity 0.01 this: self.view.backgroundcolor = [uicolor colorwithwhite:1 alpha:0.01]; ios ios8-today-widget

Matlab, how to see the source code of the function mean()? -

Matlab, how to see the source code of the function mean()? - i know built-in functions cannot accessed in matlab, true functions simple ones? can see somewhere source code of predefined function mean(), , in case of complex numbers z^5 5 solutions complex number (because matlab displays 1 solution) ? type "edit mean" command window. matlab

Don't repeat a piece of code in a jQuery snippet -

Don't repeat a piece of code in a jQuery snippet - i have jquery code works nice (is uses typewatch plugin): $( "#codice" ).typewatch({ callback: function(value){ $.post("../ajax/key.php", { codice: value, id: $( "#id" ).val() }, function(data){ $( "#availability" ).html(data); } ); }, wait: 500, capturelength: 1 }).keypress(function(){ $( "#availability" ).html(''); }); but, next dry approach, i'd avoid double $( "#availability" ) repetition. tried several things none of them works: have got thought this, please? thanks you're quite right so, much improve in terms of performance too. store in variable , utilize that. var $availability = $("#availability"); $("#codice").typewatch({ callback: function(value){ $.post("../ajax/key....

c++ - Efficient Prime Factorization for large numbers -

c++ - Efficient Prime Factorization for large numbers - i've been working on little problem need compute 18-digit numbers respective prime factorization. compiles , runs fine, considering works, looking cut down run time of prime factorization. have implemented recursion , threading think might need help in understanding possible algorithms big number computation. every time run on 4 numbers have pre-made, takes 10 seconds. cut down perchance 0.06 seconds if there ideas out there. i noticed few algorithms sieve of eratosthenes , producing list of prime numbers prior computing. i'm wondering if elaborate on it. instance, i'm having issues understanding how implement sieve of eratosthenes programme or if idea. , pointers on how approach improve helpful! here code: #include <iostream> #include <thread> #include <vector> #include <chrono> using namespace std; using namespace std::chrono; vector<thread> threads; vector<long ...

ruby on rails - heroku application error, possibly devise -

ruby on rails - heroku application error, possibly devise - while trying open app in heroku next screen saying:  application error error occurred in application , page not served. please seek 1 time again in few moments. if application owner, check logs details. the logs error follow: 2014-10-14t13:43:20.222314+00:00 heroku[router]: at=error code=h10 desc="app crashed" method=get path="/" host=dry-reaches-7872.herokuapp.com request_id=5356a97b-0f65-4af0-947b-fe1c42418c1d fwd="74.118.24.162" dyno= connect= service= status=503 bytes= 2014-10-14t13:43:20.334555+00:00 heroku[router]: at=error code=h10 desc="app crashed" method=get path="/favicon.ico" host=dry-reaches-7872.herokuapp.com request_id=768945b5-b9b6-4a0b-ba4f-fa0e389d4a29 fwd="74.118.24.162" dyno= connect= service= status=503 bytes= 2014-10-14t13:47:16.518787+00:00 heroku[router]: at=error code=h10 desc="app crashed" ...

sql - Cannot find correct number of values in a table that are not in another table, though I can do otherwise -

sql - Cannot find correct number of values in a table that are not in another table, though I can do otherwise - i want retrieve course_id in table course not in table takes . table takes contains course_id of courses taken students. problem if have: select count (distinct course.course_id) course, takes course.course_id = (takes.course_id); the result 85 smaller total number of c ourse_id in table course , 200. result correct. but want find number of course_id not in table takes , , have: select count (distinct course.course_id) course, takes course.course_id != (takes.course_id); the result 200, equal number of course_id in table course . wrong code? this sql give count of course_id in table course of study aren't in table takes: select count (*) course of study c not exists (select * takes t c.course_id = t.course_id); you didn't specify dbms, however, sql pretty standard should work in popular db...

tablesorter - semantic ui table sorter not working -

tablesorter - semantic ui table sorter not working - im using wonderful semantic ui framework. i'm trying declare sortable table demonstrate here: http://semantic-ui.com/collections/table.html it says makes utilize of modified version of kylefox's tablesort plugin. im not absolutley sure mean that? plugin included or need include it? , need initialize plugin? i found in semantic source check if $.fn.tablesort() method exists , if phone call in on .sortable.table 's elements i dont see errors in console , when click table header doesnt anything. anyone can advise me on please? add js: http://semantic-ui.com/javascript/library/tablesort.js it provides script $.tablesort() mentioned and phone call $('table').tablesort() when document ready. tablesorter semantic-ui

rails & devise, route to home#show after login using after_sign_in_path_for -

rails & devise, route to home#show after login using after_sign_in_path_for - after sign-in, want route home#index, instead, generates /home/:id request , hence routed home#show. can help , see, possible me route index after clicking sign in button. thank much. rake routes prefix verb uri pattern controller#action new_user_session /users/sign_in(.:format) devise/sessions#new user_session post /users/sign_in(.:format) devise/sessions#create destroy_user_session delete /users/sign_out(.:format) devise/sessions#destroy user_password post /users/password(.:format) devise/passwords#create new_user_password /users/password/new(.:format) devise/passwords#new edit_user_password /users/password/edit(.:format) devise/passwords#edit patch /users/password(.:format) devise/passwords#update set /users/password(.:format) devise/p...

eclipse - Simple java-wx webservice using javaee tutorial -

eclipse - Simple java-wx webservice using javaee tutorial - im trying build simple webservice next tutorial unable access wsdl 1 time deploy code in tomcat - here steps followed - create dynamic web project in eclipse. created bundle , class..here below code package helloservice.endpoint; import javax.jws.webservice; import javax.jws.webmethod; @webservice public class hello { private string message = new string("hello, "); public void hello() { } @webmethod public string sayhello(string name) { homecoming message + name + "."; } } deployed code in tomcat , ran unable access wsdl. went tomcat manager , see "helloservice" application. **http://localhost:8080/helloservice/helloservice?wsdl** from document, helloservice after helloservice . class name? how can debug it? java eclipse web-services tomcat wsdl

weblogic - Jdeveloper Sql Server Connection Issue -

weblogic - Jdeveloper Sql Server Connection Issue - i want connect sqlserver on jdeveloper. installed suggested jar file followed steps on link pointed below. http://souviksoa.blogspot.com.tr/2013/07/setup-sqlservers-connection-in.html however, i'm writing connection info , after click test connection button, gives next error. error_message visual firewall closed on computer, don't have antivirus program, , i can connect database different ide's such visual studio. what problem, have ideas? operating scheme windows 8.1 thanks in advance. if sql server default instance have clear instance name box. for illustration if using localhost or "." connect sql server in visual studio. sql-server weblogic oracle-adf jdeveloper

android - Starting countdown timer in background on receiving push notification -

android - Starting countdown timer in background on receiving push notification - i want start countdown timer when force notification received. i can receive notification successfully. now want ask, possible start countdown timer in onreceive of broadcastreceiver when notification received , application in background or foreground? simply, should timer should start whether app in foreground or not. , when timer finished should send info server. , need show remaining time in text view app comes foreground during countdown. i adding code, please help me out. this code start timer , function called in onreceive. void startordercountdown() { countdowntimer ordercountdown = new countdowntimer(40000, 1000) { public void ontick(long millisuntilfinished) { constant.remainingtimeoforder = millisuntilfinished / 1000; log.v("timer", "time left: " + millisuntilfinished / 1000); } pub...

bash - Unix sh Script confusion -

bash - Unix sh Script confusion - i have script 1 of professors college gave modify cannot seem figure out does. can help me understand bit better? for grep $i; done from can gather greps value of variable i, file or directory. not familiar how command comes play. appreciate tips offer. look isn't command, it's first parameter grep . search word look in file named $i . ( grep not search folders unless pass in -r in grep -r $i .) the confusing bit for i comes in words specified, for in 1 2 three run commands between do , done 3 times: 1 time variable i = "one", 1 time i = "two", , 1 time i = "three". however, bash manual explains if in isn't specified: if ‘in words’ not present, command executes commands 1 time each positional parameter set, if ‘in "$@"’ had been specified [...]. so, in short, if script in file named foo.sh , calling foo.sh file1 file2 word look in files "file1"...

java - Two Element form of Unmarshaller.unmarshal() -

java - Two Element form of Unmarshaller.unmarshal() - i have seen next syntax in various stack overflow postings , in blog entries: jaxbelement<someclass> sc = unmarshaller.unmarshal(is, someclass.class); so why eclipse give me compilation error when seek utilize syntax? , why syntax not in api, can read at link? here compilation error: the method unmarshal(node, class<t>) in type unmarshaller not applicable arguments (fileinputstream, class<someclass>) here finish method utilize above syntax: public void unmarshal() throws filenotfoundexception{ unmarshaller unmarshaller; seek { jaxbcontext ctx = jaxbcontext.newinstance(objectfactory.class); unmarshaller = ctx.createunmarshaller(); fileinputstream = new fileinputstream("path/to/some.xml"); jaxbelement<someclass> sc = unmarshaller.unmarshal(is, someclass.class);//error here system.out.println("title is: "+sc....

windows - CMD Long beep (duration) -

windows - CMD Long beep (duration) - how can produce long beep (no 3rd tools) cmd? (only 1 cmd command) i know ^g - there isn´t duration. short beep. you can loop , repeat echo ^g (bell char) duration depend on hardware. and alternate calls color command have window flash well. also can create set of ascii file number of bells want , type on it. windows windows-7 cmd beep

How to parse category term from Wordpress ATOM feed in PHP? -

How to parse category term from Wordpress ATOM feed in PHP? - i have standard atom feed wordpress instance. in feed, next category items appear: <category scheme="http://alpha-s2new.simplescienceinc.com/blog" term="blog" /> <category scheme="http://alpha-s2new.simplescienceinc.com/blog" term="mobile" /> <category scheme="http://alpha-s2new.simplescienceinc.com/blog" term="websites" /> i'm using next code parse feed: foreach ($rss->getelementsbytagname('entry') $node) { $item = array( 'title' => $node->getelementsbytagname('title')->item(0)->nodevalue, 'desc' => $node->getelementsbytagname('content')->item(0)->nodevalue, 'link' => $node->getelementsbytagname('link')->item(0)->nodevalue, 'date' => $node->getelementsbytagname('updated')->...

java - Moxy's getValueByXPath returns null for all but root element -

java - Moxy's getValueByXPath returns null for all but root element - see sscce. looking @ examples, looks should able utilize moxy's getvaluebyxpath access kid element of umarshalled xml object. instead i'm returned null. attributes on root object accessible. when run illustration in this question's answer, works fine :/ here's i'm doing: xml: <?xml version="1.0" encoding="utf-8"?> <ota_hotelinvcountnotifrq xmlns="http://www.opentravel.org/ota/2003/05" altlangid="alt lang id fnord"> <inventories areaid="areaid_fnord"> <inventory> <uniqueid id="inventory unique id fnord"/> </inventory> </inventories> </ota_hotelinvcountnotifrq> java: import org.eclipse.persistence.jaxb.jaxbcontext; import org.eclipse.persistence.jaxb.jaxbcontextfactory; .... otahotelinvcountnotifrq rq = ... jaxbcontext ctx = (jaxbcontext)...

java - Modify SQL query generated behind Spring Data REST projections -

java - Modify SQL query generated behind Spring Data REST projections - edit : how maintain needed columns in select spring info rest projections? spring info rest projections getting subset of columns links generated, query gets generated in behind still has columns in it. how can projections created sql queries have columns in select in projection i think can utilize "nested projections", let's say. an example: resource a contains field bubi , resource b , has field foo , bar , zed . you should create projection b list fields want: @projection(name="reduced", types = b.class) public interface breduced { string foo; //exclude bar, instance int zed; } then utilize projection in a 's projection. @projection(name="reduced", types = a.class) public interface areduced { int bubi; breduced b; } have undestood well, or talking performance in sql query? java spring spring-data spring-dat...

java - Where is the implementation of the filter() method in the Stream interface ?? -

java - Where is the implementation of the filter() method in the Stream<T> interface ?? - good day dears i have below simple code class app { public static void main(string[] args) { arraylist<integer> mylist = new arraylist<>(); mylist.add(7); mylist.add(18); mylist.add(10); mylist.add(24); mylist.add(17); mylist.add(5); stream<integer> stream = mylist.stream(); stream = stream.filter(n -> n > 10); // returns stream of elements more 10 stream.foreach(n -> system.out.print(n + " ")); } } the function of code filters invoking stream , print elements more 10. test method in predicate .. ok .. implementation filter() method homecoming "stream" more 10 .. don't understand ... !! question in way applies foreach() method ..how iterate throw stream .. since filter() , foreach() methods abstract in interface stream , has no impl...

java - ArrayList to Object[][] -

java - ArrayList to Object[][] - i need convert array list object[][], have tried several different methods, , seem toss error or two. my latest seek this: object[][] array = datalist.toarray(new object[datalist.size()][]); this throws next error: class="lang-none prettyprint-override"> java.lang.arraystoreexception @ java.lang.system.arraycopy(native method) @ java.util.arraylist.toarray(unknown source) my array list populated classes made, class: class dataclass { int x; int y; int z; string string1; string string2; date date; int event; public dataclass(int x, int y, int z, string string1, string string2, date date, int event) { this.x = x; this.y = y; this.z = z; this.string1 = string1; this.string2 = string2; this.date = date; this.event = event; } } this how initialize array list: public static list<dataclass> datalist ...

python - urllib2.HTTPError: HTTP Error 404: Not Found for valid url -

python - urllib2.HTTPError: HTTP Error 404: Not Found for valid url - i'm using python opengraph library parse website's opengraph tags https://github.com/erikriver/opengraph. import opengraph url = 'http://www.foxnews.com/world/2014/10/20/uk-gun-owners-now-subject-to-warrantless-home-searches/' og = opengraph.opengraph(url=url) print og.to_json() when run script next error traceback (most recent phone call last): file "test.py", line 16, in <module> raw = urllib2.urlopen(url) file "/usr/lib/python2.7/urllib2.py", line 127, in urlopen homecoming _opener.open(url, data, timeout) file "/usr/lib/python2.7/urllib2.py", line 410, in open response = meth(req, response) file "/usr/lib/python2.7/urllib2.py", line 523, in http_response 'http', request, response, code, msg, hdrs) file "/usr/lib/python2.7/urllib2.py", line 448, in error homecoming self._call_chain(*args)...

php - Transform large XML using XSLT -

php - Transform large XML using XSLT - i trying transform big xml file (about 50mb) in php using next code: // load xml source $xml = new domdocument; $xml->load($dir . 'xml/vapproducts.xml'); $xsl = new domdocument; $xsl->load($dir . 'all_products.xsl'); // configure transformer $proc = new xsltprocessor; $proc->importstylesheet($xsl); // attach xsl rules $resulttxt= $proc->transformtoxml($xml); this works fine on local dev machine when upload hosting provider fails out of memory error. is there way create transfor more efficient or incrementally rather loading whole xml file memory? thanks, john php xml xslt large-files

image - Average Picture of float Pictures Python -

image - Average Picture of float Pictures Python - i want similar post: sample code how can alter given code work float images in "tiff"- format? this tried: import os, numpy, pil pil import image # access png files in directory os.chdir("c://users//student///desktop//bilder//" ) print "current working dir : %s" % os.getcwd() allfiles=os.listdir(os.getcwd()) imlist=[filename filename in allfiles if filename[-5:] in [".tiff",".tiff"]] #imlist=[filename filename in allfiles] # assuming images same size, dimensions of first image w,h=image.open(imlist[0]).size n=len(imlist) # create numpy array of floats store average (assume rgb images) arr=numpy.zeros((h,w,1),numpy.float) # build average pixel intensities, casting each image array of floats im in imlist: imarr=numpy.array(image.open(im),dtype=numpy.float) arr+=imarr/n # round values in array , cast 8-bit integer arr=numpy.array(numpy.round(arr),dtype=numpy.uin...

c# - linq join with groups -

c# - linq join with groups - hej, i've got problem linq expression. perform bring together groups of set. basicly need: var f = new ienumerable<someclass> { ... }; var rows = new ienumerable<someotherclass> { ... }; var makedgroups = rows.groupby(row => row.someid); var groupsjoined = (from row in makedgroups bring together allocquant in f on row.key.value equals allocquant.someid gj select gr => new { count = gr.count(), grouping = gj }); error is: error 202 type of 1 of expressions in bring together clause incorrect. type inference failed in phone call 'join'. how write look properly? i have included sample code doing trying do. adapted sample code utilize 2 classes rather static array of strings. the result yield ienumerable productcategory field, products field contains groupings of products based on category , lastly column count in grouping. from asked thought wanted. class product { public product(str...

R: How to calculate regressive without for-loop -

R: How to calculate regressive without for-loop - set.seed(1) n <- 100 ret <- rnorm(n, 0, 0.02) ret[1] <- 0 cost <- cumprod(1+ret)*100 maxi <- 0 drawdown <- rep(0, n) (i in 1 : n){ maxi <- max(price[1 : i]) drawdown[i] <- price[i] / maxi - 1 } hello, is possible speedup calculation? maybe remove for-loop? regards r has vectorised cummax function, , partition , add-on operations vectorised, can do: price/cummax(price) - 1 comparing efficiency when n <- 10000 : library(microbenchmark) microbenchmark( op= { drawdown <- rep(0, n) (i in 1 : n){ maxi <- max(price[1 : i]) drawdown[i] <- price[i] / maxi - 1 } }, me={ drawdown2 <- price/cummax(price) - 1 }, times=10) # unit: microseconds # expr min lq mean median uq max neval # op 456216.519 483387.361 536067.7521 550912.471 565453.555 663352.635 10 # me 98.075 102.067 ...

javascript - Handlebars, loading external template files -

javascript - Handlebars, loading external template files - my goal set handlebars templates in single folder, so: templates/products.hbs templates/comments.hbs i found snippet in few places via cursory google search, apparently load in handlebar templates in external files, makes much more sense putting bunch of templates in single index file. (function gettemplateajax(path) { var source; var template; $.ajax({ url: path, //ex. js/templates/mytemplate.handlebars cache: true, success: function(data) { source = data; template = handlebars.compile(source); $('#target').html(template); } }); })() the problem is, don't understand function or how utilize it. why whole function wrapped in parentheses , made function call? e.g. (function x() { ... })() don't know doing. and if i'm not mistaken, looks $('#target') hardcoded when shou...

Using "WHERE" twice with (Random) MySQL -

Using "WHERE" twice with (Random) MySQL - need help? this works $sql = " select * (select * $tabledir dir_ranking = '1' order rand() limit 16) x order dir_date_listed asc"; it selects random "$tabledir" ranking = 1 , limits 16 records but need filter out option. need filter "dir_approved = y" tried this $sql = " select * (select * $tabledir dir_ranking = '1' order rand() limit 16) dir_approved = 'y' x order dir_date_listed asc"; and this $sql = " select * (select * $tabledir dir_ranking = '1' , dir_approved = 'y' order rand() limit 16) x order dir_date_listed asc"; none of lastly 2 above resulted in data is there sequence or way working it...

security - How secure is a PublicKey in an Android Hardware-Backed keystore? -

security - How secure is a PublicKey in an Android Hardware-Backed keystore? - if generate public/private keypair in android keystore, publickey treated same level of security privatekey operating system? (irrespective of key in app) the public , private keys both stored in secure hardware. however, while there no way export private key, public key can extracted. assuming device isn't rooted or otherwise compromised, app can extract public key. if device compromised in way, private key won't leave secure hardware. android security android-keystore

java - [Android]How to extract in-app screenshots of available apps from Google PlayStore App pages? -

java - [Android]How to extract in-app screenshots of available apps from Google PlayStore App pages? - i want create android app can download available images of in-game screenshots posted on angry birds or app's google play store page. how can go it? i have tried using api (https://code.google.com/p/android-market-api/), hoping improve alternatives(the creator of api had warned each new release of google's sdk, api may not work properly). if there no api readily available, maybe broad guidelines? do utilize java based web page crawler , adapt android code or api javahtmleditor? in illustration (http://www.compiletimeerror.com/2013/08/java-downloadextract-all-images-from.html#.vfpe3_nf8wi) programme uses javahtmleditor pull images html webpage, i'm not sure work in google play store app pages. any kind of advice appreciated!! i'd go quite straight forwards solution. 1) load actual google play game webpage normal http request in application cod...

rdf - DBPedia local server giving strange results for different queries -

rdf - DBPedia local server giving strange results for different queries - i trying list of wikipedia people much features possible machine learning problem. i have setup local dbpedia server , increased limit various parameters somehow still unable desired results. the desired output csv fo next format: <person1>,<feature1>,<feature2>,<feature3> .......... , on <person2>,<feature1>,<feature2>,<feature3> .......... , on <person3>,<feature1>,<feature2>,<feature3> .......... , on ...and ...so ...on can direct me towards right way ? for example, when run queries, got blank result: query: select ?name ?birthdate { { select strafter(str(?person),"http://dbpedia.org/resource/") ?name, str(? birthdate) ?birthdate { ?person <http://dbpedia.org/ontology/person> . ?person dbpedia-owl:birthdate ?birthdate . } order asc(?name) } } offset 100000...

node.js - Zeromq REQ-REP pattern sync on nodejs -

node.js - Zeromq REQ-REP pattern sync on nodejs - i have 1 application ( written in nodejs, a ) should connect via zmq, application ( written in java akka framework, b ). b application replicated on multiple servers, , application a should create selection querying every b instance ( should inquire load application average ). i implement mechanism through req / rep pattern, slam on : zmq in nodejs a offers req / rep pattern event handling, without blocking strategies defined in zmq architecture. i have investigated other approaches ( switching axon, introducing socket on b application , making socket connection ), seek implement zeromq. any suggestions? you cannot you're looking req/rep, because pattern strictly only handles request/reply/request/reply messaging pattern, , want more requestb1/requestb2/replyb1/requestb3/replyb2/replyb3 (point being, requests , replies asynchronous rather in strict series). without digging deeply, looks might fit dealer/...

angularjs - ng-click inside cell template does not trigger function in controller -

angularjs - ng-click inside cell template does not trigger function in controller - i have created plunker here: http://plnkr.co/edit/zgqouwzxguef13lx48ip?p=preview when click in cell of ui-grid in day view nil happens. expected test function executed , alert shown text 'test' not case. what going on wrong here? thats html cell template of ui-grid 3.0 latest release: html <div ng-click="test()" ng-switch="row.entity[row.grid.columns.indexof(col)].isperiod"> <div ng-switch-when="true"> <tabset> <tab> <tab-heading> <i class="glyphicon glyphicon-book"></i> </tab-heading>period id: {{ row.entity[row.grid.columns.indexof(col)].id}} </tab> <tab select="alertme()"> <tab-heading> <i class="glyphic...

http post - How to pass Object like parameters with HttpPost -

http post - How to pass Object like parameters with HttpPost - i using restfull webservice method: @requestmapping(value = "/rest/secure/userprofile/{providerid}", method = requestmethod.post) @responsebody public list<userprofile> adduserprofile(@requestbody object[] socialaccounts, @pathvariable string providerid, httpservletrequest request, httpservletresponse response) { system.out.println("do something!!!"); } i want pass socialaccount object. string json = "{\"id\":\"26651480000\",\"selected\":true,\"category\":\"software\",\"perms\":[\"administer\",\"edit_profile\",\"create_content\",\"moderate_content\",\"create_ads\",\"basic_admin\"],\"provideruserid\":\"1475334273\",\"name\":\"eran\",\"useraccesstoken\":\"caabletmsjhgbanxahalaqxvn1tri5tq8gvu002ke8z...

python - How to achieve the same function of views.py through extention of clean method of forms? -

python - How to achieve the same function of views.py through extention of clean method of forms? - my views.py class createtaskview(loginrequiredmixin, mystaffuserrequiredmixin, generic.createview): model = task form_class = taskform template_name = 'tasks/form.html' def get_context_data(self, *args, **kwargs): ctx = super(createtaskview, self).get_context_data(*args, **kwargs) ctx['task_form'] = ctx.get('form') ctx['action'] = 'add' ctx['cancel_url'] = reverse('tasks.list') homecoming ctx def form_valid(self, form): form.save(self.request.user) messages.success(self.request, _('your task has been created.')) homecoming redirect('tasks.list') class updatetaskview(loginrequiredmixin, mystaffuserrequiredmixin, generic.updateview): model = task form_class = taskform template_name = 'tasks/form.html' def get_context_data(self, *args, **kwargs): ctx = super(u...

php - how to update quantiy by runnnig multiple queries? -

php - how to update quantiy by runnnig multiple queries? - how run these 2 query @ 1 time in tbl_purchase_return inserts new info , on otherhand updates quantiy tbl_product? $query= "insert tbl_purchase_return(product_id,supplier_id,quantity,date) values ($prd_id,$sup_id,$quantity,'$date')"; $query="update quantity , set quantity= getquantityfomproductid($id)- $quantity `tbl_product`.`id` = $id"; you first quantity of product fire first query , on success ( after getting lastly inserted id) of run sec query. php

jQuery Validate Credit Card Expiry Date in Rules addMethod Limit 20 Years in Future -

jQuery Validate Credit Card Expiry Date in Rules addMethod Limit 20 Years in Future - hi have code on jquery validate rules validator.addmethod allows input check future date on card expiry date i.e. 10/2015 valid, inquire there way add together limit of 20 years in future, @ nowadays come in card expiry date of 10/2099 or more. in advance! here code have, needs custom message. exceeds date range <input type="text" name="field_4" id="field_4" value=""> $.validator.addmethod( "future", function (value, element) { var today = new date(); var startdate = new date(today.getfullyear(),today.getmonth(),1,0,0,0,0); var expdate = value; var separatorindex = expdate.indexof('/'); expdate = expdate.substr( 0, separatorindex ) + '/1' + expdate.substr( separatorindex ); homecoming date.parse(startdate) <= date.parse(e...

osx - Applescript Folder Action not working -

osx - Applescript Folder Action not working - i wrote applescript monitor folder new input. on receiving new item, open itunes, create playlist , add together new files playlist. however, when attach script folder action via folder action setup , add together new item, nil happens. have placed script within /library/scripts/folder action scripts ~/library/scripts/folder action scripts still doesn't fire. here code below: global album_name global artist_album on adding folder items this_folder after receiving added_items --get name of added folder repeat x in added_items re-create name of x string playlist_name set applescript's text item delimeters "-" set delimited_playlist_name every text item of playlist_name set artist_name text item 1 of delimited_playlist_name set album_name text item 2 of delimited_playlist_name set applescript's text item delimeters "" end repeat tell "finder" activate "itunes...

matlab - How to customize files obtained from RTW -

matlab - How to customize files obtained from RTW - i utilize matlab r2008a , seek replace handmade c code code generate simulink model. i've reach result in file i've unnecessary function , generated initialize info construction : _initialize(). now, how can avoid generation of function? more in general, possible configure rtw generate 1 *.c , 1 *.h files (except rtwtypes.h) thanks suggestion below configuartion : matlab version 7.6 simulink version 7.1 real-time workshop version 7.1 real-time workshop embedded coder version 5.1 matlab simulink rtw

go - Golang marshal dynamic xml element name -

go - Golang marshal dynamic xml element name - the xml file consists of 2 elements. elements have same construction except 1 element name. tried set value xmlname property, didn't work. xml: <!-- first element --> <person> <elem1>...</elem1> <elem2>...</elem2> <elem3>...</elem3> <elem4>...</elem4> </person> <!-- sec element --> <sender> <elem1>...</elem1> <elem2>...</elem2> <elem3>...</elem3> <elem4>...</elem4> </sender> is possible define struct such element name dynamic? type person struct { xmlname string `xml:"???"` // how create dynamic? e1 string `xml:"elem1"` e2 string `xml:"elem2"` e3 string `xml:"elem3"` e4 string `xml:"elem4"` } in documentation, says xmlname field must of type xml.name . type person struct { xmlname xml....

Calling parent controller method from directives in AngularJS -

Calling parent controller method from directives in AngularJS - i have situation want phone call parent controller method directive on ng-change. phone call controller method never triggers, not sure wrong. help much appreciated. thanks sample code: <body ng-app="content-app" ng-controller="parentcontroller"> <div header-menu report-manager="model"></div> </body> report-manager model. header-menu directive: var $module = angular.module('content-app'); $module.directive('headermenu', function () { homecoming { restrict: 'ae', scope: { reportmanager: '=' }, templateurl: '/scripts/app/directives/header-menu.template.htm' }; }); header-menu.template.htm <div> <ul> <li ng-repeat="filter in filters" ng-controller="childcontroller" ng-change...

java - Cast extended view to view layoutinflater -

java - Cast extended view to view layoutinflater - what want able have own custom command have properties on it. i'm extending existing view (relativeview) , create own view. problem when seek relative view xml layout via inflater java lang class cast exeption. how can avoid ? myrelativeview command = (myrelativeview) layoutinflater.from(getcontext()).inflate(r.layout.something, null, false); myrelativeview extends relativelayout , inflated view relativelayout. why java.lang.classcastexception: android.widget.relativelayout cannot cast controls.myrelativeview your layout file should have custom view in it, view extends relativeview, relativeview not myrelativeview. should instead: <com.example.customviews.myrelativeview xmlns:android="http://schemas.android.com/apk/res/android" custom:showtext="true" custom:labelposition="left" android:layout_width="match_parent" android:layout_height=...

selenium - Robot: Backslash in EXECDIR, Windows path -

selenium - Robot: Backslash in EXECDIR, Windows path - underlying problem: want enable running robot tests using selenium 2 in portable firefox that's stored within execdir. ${firefox_binary}= evaluate sys.modules['selenium.webdriver.firefox.firefox_binary'].firefoxbinary('${execdir}${/}firefox${/}app${/}firefox${/}firefox.exe') sys, selenium.webdriver ${firefox_profile}= evaluate sys.modules['selenium.webdriver.firefox.firefox_profile'].firefoxprofile('${execdir}${/}lib${/}seleniumfirefoxprofile') sys, selenium.webdriver create webdriver firefox firefox_binary=${firefox_binary} firefox_profile=${firefox_profile} that works fine if, instead of ${execdir}, utilize actual path. execdir c:\users\bart.simpson\workspace\projectname here. issue backslash, when followed b, converted ascii backslash character. test log says: evaluating look 'sys.modules['selenium.webdriver.firefox.firefox_profile'].firefoxpr...

hadoop - Is there a way to sum two columns into another column in Hive HQL? -

hadoop - Is there a way to sum two columns into another column in Hive HQL? - i'm looking running daily, weekly, , monthly sum of number of messages sent out. there 500 different message types. i have next tables: table name: messages int message_type bigint num_sent string date table name: stats int message_type bigint num_sent_today bigint num_sent_week bigint num_sent_month table messages updated daily new rows today's date. there single hive query can run daily update stats table? note can't running counts querying messages table straight using where date >= 30 days ago because table big. have add/subtract daily values table stats instead. this: // pseudocode // table (call table b) table messages int message_type bigint num_sent_today bigint num_sent_seven_days_ago bigint num_sent_thirty_days_ago // bring together b table stats can // set stats.num_sent_today = b.num_sent_today // set stats.num_sent_week = stats.num_sent_week +...