Posts

Showing posts from May, 2012

c++ - Alternative for std::set without memory reallocation? -

in application generate lot of subproblems exhaustively , solve them using "std::set" operations. need " insert " , " find " elements , " iterate " on sorted list. the problem each of millions of subproblems "std::set" implementation allocates new memory each time insert element in set makes whole application slow: { // allocate non-value node _nodeptr _pnode = this->_getal().allocate(1); // <- bottleneck of program is there stl-structure allows me to above operations in "o(log(n))" while not reallocating memory? using custom allocator seems way reduce amount of time spent building , releasing std::set<...> . below complete demo of simple allocator program profiling resulting times. #include <algorithm> #include <chrono> #include <cstdlib> #include <iostream> #include <iterator> #include <memory> #include <set> #include <vector> // --------

python - django-avatar: cant save thumbnail -

i'm use django-avatar app , can't make save thumbnails. original image save in media dir. using step execution showed error occurred here image.save(thumb, settings.avatar_thumb_format, quality=quality) i found line in create_thumbnail: def create_thumbnail(self, size, quality=none): # invalidate cache of thumbnail given size first invalidate_cache(self.user, size) try: orig = self.avatar.storage.open(self.avatar.name, 'rb') image = image.open(orig) quality = quality or settings.avatar_thumb_quality w, h = image.size if w != size or h != size: if w > h: diff = int((w - h) / 2) image = image.crop((diff, 0, w - diff, h)) else: diff = int((h - w) / 2) image = image.crop((0, diff, w, h - diff)) if image.mode != "rgb": image = image.convert("rgb") image = image.re

html - Center a Rhombus created by transform rotate -

i created rhombus using transform css propriety seems center point of rhombus on right side instead of being in middle. knows how fix ? here code : http://jsfiddle.net/2m2j9/ .rhombus{ width:100px; height:100px; background:black; margin:0 auto; -webkit-transform: rotate(-45deg); -moz-transform: rotate(-45deg); -ms-transform: rotate(-45deg); -o-transform: rotate(-45deg); transform: rotate(-45deg); -webkit-transform-origin: 0 100%; -moz-transform-origin: 0 100%; -ms-transform-origin: 0 100%; -o-transform-origin: 0 100%; transform-origin: 0 100%; } demo use transform-origin: center; css .rhombus{ width:100px; height:100px; background:black; margin:0 auto; -webkit-transform: rotate(-45deg); -moz-transform: rotate(-45deg); -ms-transform: rotate(-45deg); -o-transform: rotate(-45deg); transform: rotate(-45deg); -webkit-transform-origin: center; -moz-transform-origin: center; -ms-transform-o

RESOLVED: JQuery - variable is not passing correctly -

resolved, see note in comments below i'm learning javascript , jquery having problem in code below. have list of players in master list , when double clicked on master list should add team least amount of players. appendto clause not seem work. misusing variable inside of or pointing incorrectly somehow dom? when hard code value team work. i'm using alert see value currentteam passed correctly point , is. doesn't work when in appendto clause. note tried create jsfiddle didn't run correctly. tried copying actual sortable jquery example site. again didn't run. in example have list of players drafted various teams. have not got checking in place. add later. right want able drag or double click players move across. i'm not sure why when double click player won't move list if have currentteam in appendto clause if hard code team3 instance, double clicking add player spot. don't want hard code value. if need better editing i'd appreciate th

javascript - DartObject not unwrapped when passed into JsObject.callMethod -

i'm writing dart wrapper js library, hitting on problem: i'm calling js method mediastream (dart)object parameter. problem is, inside js lib, parameter dartobject , , causes error because it's not mediastream anymore. jsobject.jsify works on maps , lists, there way jsify object js usage? after few time think problem, solution mirror api. it's possible create jsobject, approach has been create "binding" object make interface between js , dart. mirror api able analyze object instance create dynamicly binding. hope usefull the dart file : import 'dart:js'; import 'dart:mirrors'; typedef dynamic oncall(list); class varargsfunction extends function { oncall _oncall; varargsfunction(this._oncall); call() => _oncall([]); nosuchmethod(invocation invocation) { final arguments = invocation.positionalarguments; return _oncall(arguments); } } jsobject tojsobject(var inst) { instancemirror im = reflect(in

spring security jdbc throws null pointer -

i trying use spring-security 4.0.0.m1 spring-boot 1.0.2.release h2 , spring-data-jpa.1.5.2. able create user in securityconfig.configure method, when extract out own class, nullpointer exception. step jdbcdaosupport.java , see getjdbctemplate() returns null jdbctemplate. here config: @configuration @enablewebmvcsecurity @enableglobalmethodsecurity(prepostenabled = false) public class securityconfig extends websecurityconfigureradapter { @autowired private datasource datasource; @autowired userservice userservice; @override protected void configure(httpsecurity http) throws exception { http .authorizerequests() .antmatchers( "/resources/**" ).permitall() .antmatchers( "/css/**" ).permitall(); http .formlogin().failureurl( "/login?error" ) .defaultsuccessurl( "/" ) .loginpage( "/login" )

Grails ${appName} Parameter substitution -

my problem simple - ${appname} property substitution in config.groovy not appear working me. i have config item called path.to.resources = ${appname}/videos , when read controller using grailsapplication.config.path.to.resources , i ${appname}/videos instead of myappname/videos . i'm using grails 2.0.4 , sts try this path.to.resources = "${appname}/videos"

express - How to implement simple audio playback in Node.js? -

i'm developing simple node.js chat application socket.io , express , play short audio file on button click event. relevant setup follows: var app = require('express')(); var http = require('http').server(app); var io = require('socket.io')(http); app.get('/', function(req, res) { res.sendfile('index.html'); }); http.listen(process.env.port || 5000, function() { console.log("server running on port 5000"); }); and relevenat index.html code: <button onclick="document.getelementbyid('mytune').play()">play music</button> <audio id="mytune"> <source src="sound.mp3"> </audio> this works fine on basic html file when run in browser not when run in node. have feeling there's special set required node/express able access sound file i'm not sure exactly. appreciated. from server code not clear how make mp3 file available browser. try serving st

option - Scala case class update value -

i have case class 2 string members. update second member later, first create instance string , none , later load data class , update second member value. how can it? define case class second member var : case class stuff(name: string, var value: option[string]) now can create instance of stuff , modify second value: val s = stuff("bashan", none) s.value = some("hello") however, making case classes mutable not idea. should prefer working immutable data structures. instead of creating mutable case class, make immutable, , use copy method create new instance modified values. example: // immutable stuff case class stuff(name: string, value: option[string]) val s1 = stuff("bashan", none) val s2 = s1.copy(value = some("hello")) // s2 now: stuff("bashan", some("hello"))

statistics - How to know one system is siginficantly better than another one? -

i studying lexical semantics. have 65 pairs of synonyms sense relatedness. dataset derived paper: rubenstein, herbert, , john b. goodenough. "contextual correlates of synonymy." communications of acm 8.10 (1965): 627-633. i extract sentences containing synonyms, transfer neighbouring words appearing in sentences vectors, calculate cosine distance between different vectors, , pearson correlation between distances calculate , sense relatedness given rubenstein , goodenough i pearson correlation method 1 0.79, , method 2 0.78, example. how measure method 1 better method 2 or not? well strictly not programming question, since question unanswered in others stackexchange sites, i'll tell approach take. i there other benchmarks check approaches on similar tasks. can check how method performs on benchmarks , analyze results. methods may capture similarity more while others relatedness , both. this link wordvec demo automatically scores vectors , provides

Timer Issue in Java - Time not Stopping when setRepeat(false) is set -

i'm hoping me fix issue i'm having timers. when timer.start() run, timer starts. however, seems repeat endlessly. i need timer execute once. how can achieve if timer.setrepeats(false) not working? actionlistener updatepane = new actionlistener() { public void actionperformed(actionevent ae) { try { msgpanedoc.insertstring(msgpanedoc.getlength(), "click", msgpanedoc.getstyle("bold_style")); } catch (badlocationexception ex) { }}}; timer timer = new timer(3000,updatepane); timer.start(); timer.setrepeats(false); you have call inside the event dispatch thread . try swingutilities.invokelater() or eventqueue.invokelater() sample code: swingutilities.invokelater(new runnable() { @override public void run() { actionlistener actionlistener = new actionlistener() { public void actionperformed(actionevent ae)

c# - Passing string between form using property doesnt work -

i know there's lot of posts here explaining how pass string between form using property method, can't make work. have form1 , form2, in form1, open bitmap, , want pass path form2, can access bitmap later. if change property value inside form1, it's ok, when load form2 , try access information, null. don't know doing wrong, if take , find mistake, apreciate. here code form1 public partial class form1 : form { public form1() { initializecomponent(); } string teste; public string filepath // property { { return teste; } set { teste = value; } } private void openmap_click(object sender, eventargs e) // opens bitmap { try { openfiledialog open = new openfiledialog(); if (open.showdialog() == dialogresult.ok) { bitmap bit = new bitmap(open.filename); picturebox2.image = bi

types - calculator error in C -

i'm trying make calculator program in c. i've done of think...just output incorrect. output supposed come out doesn't. below code calculator program!. #include <stdio.h> #include <string.h> #include <stdlib.h> void add(double num1,double num2); void del(double num1,double num2); void mul(double num1,double num2); void divide(double num1,double num2); main(){ file *fp; char sym; float num1, num2; int ret; fp = fopen("input.txt","r"); if(fp==null){ exit(1); } while(fscanf(fp,"%f%c%f", &num1,&sym,&num2)!=eof){ switch(sym){ case '+': add(num1,num2); break; case '-': del(num1,num2); break; case '*': mul(num1,num2); break; case '/': divide(num1,num2); break; default: printf("%f%c%f", num1

asp.net mvc - Calls for files are made in the wrong file path -

hi trying build angular app , have following situation in asp.net mvc. have created app folder in root directory of project contains following: styles folder scripts folder images folder index.html file then instead of returning view in homecontroller index action returned following: public actionresult index() { return file(server.mappath("/app/index.html"), "text/html"); } the index.html has following style added: <link rel="stylesheet" href="styles/main.css"> when run app index.html gets retrieved error inside of retrieving style file: http://localhost:57826/styles/main.css for reason instead of looking in the following path http://localhost:57826/app/styles/main.css looks in path mentioned above. i tryed intercept calls , files correct path creating custom router this: routes.maproute( name: "style", url: "styles/{*path}", defaults: new { co

java - What is involved for storing data in cloud? -

i'm not sure ask please suggest if should move stackexchange site what technologie(s) sites such www.jsfiddle.net using in order store data in cloud ? ability store code snippet , retrieve later via url. there public generic api available functionality ? i've researched cloud offerings such https://developers.google.com/appengine/docs/java/googlestorage/ since jsfiddle free doubt using such service ? via jsfiddle page : jsfiddle’s hosting kindly provided digitalocean. there no such thing free lunch: has pay storage. in case, it's paid third party, not jsfiddle developers. as using store data, it's unclear (though can ask developers: names , websites listed on page), choice 1 of following: run distributed file system on vms rented cloud provider, or use managed solution, such google cloud storage pointed to, api either way, incur costs.

Github pages and custom tk domain -

i'm trying make github page redirect custom tk domain far nothing works i made cname file in master branch can see in link below https://github.com/lambdaclose/lambdaclose.github.io/tree/master and on tk panel added domain fowarding github page you need make or cname record points github pages' server. url forwarding not work.

php - Divide a foreach loops of 23 entries into two divs -

i have array 23 objects in them loop through , generate checkboxes form. using laravel, came this: {{ form::open(['url' => 'panel/update/games', 'id' => 'ajax']) }} <div class="row"> <div class="col-sm-6"> @foreach($data['stats'] $stats => $stat) {{ form::checkbox('stats', $stat->field) }} {{ $stat->field }} <br> @endforeach </div> </div> {{ form::button('update statistics', ['type' => 'submit', 'class' => 'btn btn-info btn-block', 'data-after' => 'updated statistics|check']) }} {{ form::close() }} this works well; generates 23 different checkboxes however, divide these results 2 columns using bootstrap 3's responsive grid. data should this: <div class="row"> <div class="col-sm-6> <inpu

javascript - How to improve the performance of the Jasmine-Blanket SpecRunner.html? -

i have created test suites backbone.js application using jasmine.js framework. have 50 specs , backbone.js application has remote service calls. whenever running spec runner takes around 10 15 mins show results. same application working fast in different machine. using apache -tomcat server , eclipe ide. is there wrong application or else? how improve performance of jasmine-blanket specrunner.html? jasmine spec runner execute @ greater speed, if using memcached / memcache . jasmine spec runner speed depends on application performance. try use memcached or memcache application. i hope did not run memcached speed application. javascript frameworks uses more .js files develop mobile (web) applications. in case, if run memcached application, system execute @ speed. your alternate system might use (32 bit or 64 bit) memcached application. better check alternate system(mac).

html - Find year high and year low in mysql php -

i have database many records (major columns date, company names, closing price. want achieve use php display unique company names in first column, recent price in 2nd (using date), highest price of unique companies in database in 3rd column , lowest price of unique companies in database. please, how can achieve this? $query = "select date, company, min(close), max (close) pricelist group company"; $result = mysql_query($query); $num_rows = mysql_num_rows($result); ($i=0;$i<$num_rows;$i++){ $id = mysql_result($result,$i,"id"); $date = mysql_result($result,$i,"date"); $company = mysql_result($result,$i,"company"); $close = mysql_result($result,$i,"close"); echo "<tr bgcolor=\"#d7dde3\"><td align=right class=no_text>".$company."</td><td align=right class=norm_text>".number_format($close, 2, '.', '

c++ - Specializing single method in a big template class -

in c++ if want partially specialize single method in template class have specialize whole class (as stated example in template specialization of single method templated class multiple template parameters ) this becomes tiresome in bigger template classes multiple template parameters, when each of them influences single function. n parameters need specialize class 2^n times! however, c++11 think there might more elegant solution, not sure how approach it. perhaps somehow enable_if ? ideas? in addition inheritance-based solution proposed torsten, use std::enable_if , default function template parameters enable/disable specializations of function. for example: template<typename t> struct comparer { template<typename u = t , typename std::enable_if<std::is_floating_point<u>::value>::type* = nullptr> bool operator()( u lhs , u rhs ) { return /* floating-point precision aware comparison */; } template<typename

Source control enablement for Java Code in Domino Projects -

i using git integrated domino designer(version 9.0.1). have associated .nsf project on-disk project. have synced on-disk project source control repository. seems way of doing things. on-disk project doesn't have java classes , packages had in .nsf project under "local" directory. how possibly sync these files , packages also? the "local" directory doesn't stored in on-disk project. used domino designer internally e.g. create java classes xpages. classes build , updated automatically during project build there no need save them in on-disk project source control reasons. store java classes , packages somewhere else in .nsf. classic way (compatible 8.5.x versions) put them design code element "java" folder "code/java" or "src" (java classes), "res" (resources/property files) , "webcontent/web-inf/bin" (jar files). since version 9 can put jar files design code element "jars".

html5 canvas - Why kineticJS cannot move workings with touch or mouse? -

Image
i need move "box" group while touching or mousemoving inside white-part of screen. <script defer="defer"> var stage = new kinetic.stage({ container: 'fullscreendiv', width: 1180, height: 664 }); var layer = new kinetic.layer(); var gamepart = new kinetic.rect({ x: 0, y: 0, width: 1180, height: 500, stroke: 'black', strokewidth: 4 }); var statuspart = new kinetic.rect({ x: 0, y: 500, width: 1180, height: 164, fill: 'blue', stroke: 'black', strokewidth: 4 }); var group = new kinetic.group({ draggable: true, dragboundfunc: function(pos) { return { x: pos.x, y: this.getabsoluteposition().y } } }); window.addeventlistener('keydown', function(e) { if (e.keyc

How to get the Paragraph style from w:sdtContent in word XML -

i need style of paragraph have assigned tag value ( contentcontrol ). have added contentcontrol (ie) tag value paragraph in word,i can able text of corresponding paragraph have assigned tag value, case "documentformat.openxml.wordprocessing.sdtblock": sdtblock p1 = (sdtblock)docelement; string content1 = p1.innertext; if (!string.isnullorempty(content1)) dt.rows.add(content1); break; and adding para table , need style of para ,when saved word document in xml format these codes <w:sdtcontent> <w:p w:rsidr="00d57d79" w:rsidrdefault="00176023"> <w:ppr> <w:pstyle w:val="heading1"/> <w:rpr> <w:rfonts w:eastasia="times new roman"/> <w:shd w:val="clear" w:color="auto" w:fill="auto"/> <w:lang w:val="en-us"/>

Bones Wordpress Framework -

i've installed bones locally, renamed directory etc, installed winless, there no less files in theme library. can't figure out, theme working perfectly, can't find less files edit. pointers? version 1.3 removed less, , version 1.4 put less in. don't see in change log located here been removed again, appears current version, 1.7, not have less files in theme. you can less code here: https://github.com/eddiemachado/bones/commit/2593f647aea6bc84c1bcc52d12f2a54087e26dce , add them in yourself, or switch scss or use basic css.

jax ws - How is wsdl file generated in jaxws -

i have webservice interface , implementation class. export app war , deploy tomcat. how , when wsdl file generated services??? inreface: @webservice(name = "storesurveyauth") public interface surveyauthorization { @webmethod @webresult(name="authorizationresponse") public authorizationresponse getauthorizationdetails(surveyauthrequest surveyauthrequest); impl class: @webservice(servicename = "authservice", endpointinterface = "com.test.surveyauthorization") public class surveyauthorizationimpl implements surveyauthorization { } i have provided url in web.xml , endpoint defined in sun-jaxws.xml. wsdl not generated when deplot in tomcat.

salesforce - SOQL Get Name from nested SELECT statement -

i have soql query grabbing information opportunity in salesforce , grabbing contactid of related contact role. displaying opportunities have different child object of type. extract , display name of contact role in table. suggestions? select id, name, (select contactid opportunitycontactroles isprimary = true) opportunity id in (select opportunity_id opportunity_child opportunity_child_picklist = 'specific item') i 'name' field contactid found opp. contact roles table , display opportunity id well. you can follow contact relationship in subquery, e.g. select id, name, (select contactid, contact.name opportunitycontactroles isprimary = true) opportunity id in (select opportunity_id opportunity_child opportunity_child_picklist = 'specific item')

python - Custom domain routing to Flask server with custom domain always showing in address bar -

i have small home-server running flask set @ ip a.b.c.d . have domain name xyz.com . now when going xyz.com , user served content a.b.c.d , xyz.com still showing in address bar. similarly, when going xyz.com/foo content a.b.c.d/foo should shown, xyz.com/foo showing in address bar. i have path forwarding activated @ domain name provider, xyz.com/foo correctly forwarded a.b.c.d/foo , when going there a.b.c.d/foo shown in address bar. i'm running tornado, can switch server if necessary. is possible set kind of solution? or option buy kind of hosting? i managed solve myself, i'll add answer since evidently thought worthwhile question. it turns out me did not understand how dns works , difference between dns , domain forwarding is. @ domain hosts can configure "domain forwarding", sounds precisely need not. rather, simple usecase above, went dns zone records in options , created dns zone record type pointed xyz.com a.b.c.d . change not seem ha

Pack/unpack binary string in Perl -

i attempting understand fragment of perl code. think purpose make binary string input integer, in reversed bit order (low bit on left, high bit on right). not understand pack/unpack doing input values however; appears incorrect. consider test code: for (my $i = 0; $i < 16; $i++) { (my $j = 0; $j < 16; $j++) { $x = $i * 16 + $j; $x = unpack("b8", pack("u", $x)); printf $x; print " "; } print "\n"; } this produces: 00000000 10000000 01000000 11000000 00100000 10100000 01100000 11100000 00010000 10010000 01010000 11010000 00110000 10110000 01110000 11110000 00001000 10001000 01001000 11001000 00101000 10101000 01101000 11101000 00011000 10011000 01011000 11011000 00111000 10111000 01111000 11111000 00000100 10000100 01000100 11000100 00100100 10100100 01100100 11100100 00010100 10010100 01010100 11010100 00110100 10110100 01110100 11110100 00001100 10001100 01001100 11001100 00101100 1

Elegant way of turning Dictionary or Generator or Sequence in Swift into an Array? -

is there elegant way convert dictionary (or sequence or generator) array. know can convert looping through sequence follows. var d = ["foo" : 1, "bar" : 2] var g: dictionarygenerator<string, int> = d.generate() var = array<(string, int)>() while let item = g.next() { += item } i hoping there similar python's easy conversion: >>> q = range(10) >>> = iter(q) >>> <listiterator object @ 0x1082b2090> >>> z = list(i) >>> z [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> the + operator array accept sequence, can write var d = ["foo" : 1, "bar" : 2] var = [] + d i don't think similar possible generators though

playframework - Install postgresql with play! framework (Driver not found: [org.postgresql.Driver]) -

i'm new play! framework , postgresql , i'm trying make work. i read lot of questions asked on stackoverflow , searched lot on google didn't manage make work. here error play! gives me : driver not found: [org.postgresql.driver] my questions : 1) know easy tutorial (i.e. explains beginning) shows how configure play! make postgresql work? read lot of thing didn't find detailed tutorial. 2) if not, here configuration : i added in application.conf : db.default.driver=org.postgresql.driver db.default.url="jdbc:postgresql://127.0.0.1/postgres" db.default.user=postgres db.default.password=root and in built.sbt : librarydependencies ++= seq( jdbc, anorm, cache, ) what doing wrong? as documenation says, have add driver dependencies: librarydependencies += "postgresql" % "postgresql" % "9.1-901-1.jdbc4" use appropriate version of driver postgres installation. http://www.playframework.com/d

github - Sync AND Pull in a Git Repo -

my interest this: i'd set single homework repository share students. repository contains templates, specifications, , unit tests. students derive repository, complete homework, , push changes grading. this past year did using bitbucket. created public git repository containing files. created private forks. worked well. my problem this: whenever make changes files (i.e., fix bug in unit tests), students must actively sync original repo. many students not , not see updated files. know @ shell can execute git remote add skeleton git@bitbucket.org:prof/profrepo.git git pull skeleton master but i'd use in eclipse , in cs classes, technological intimidation issue , utility scripts not feasible. if tools set correctly, students still forget grab changes repository. is there way can integrate pulling original repo three-step pull-code-push workflow? git support this?

r - unexpected ddply() output. Not grouping -

when calculate mean of numeric column using ddply output not expect: ddply(df, .(df[,1]) summarize, sales = mean(df[,5])) the output is: df1[, 4] sales 1 x01.01.2012 49761.36 2 x01.02.2012 49761.36 3 x01.03.2012 49761.36 4 x01.04.2012 49761.36 5 x01.05.2012 49761.36 6 x01.06.2012 49761.36 i not understand why mean same, though sorted date. not expected output given each date sales different. calculates mean of whole column. the second argument should .(variable name) . df[,1] refers values in column, not name of variable. same thing when use mean() here's short example fake data, since did not supply any. > df <- data.frame(val1 = 1:5, val2 = 6:10) > library(plyr) ## correct mean > ddply(df, .(val1, val2), summarize, mean = mean(c(val1, val2))) val1 val2 mean 1 1 6 3.5 2 2 7 4.5 3 3 8 5.5 4 4 9 6.5 5 5 10 7.5 ## incorrect mean > ddply(df, .(df[,1], df[,2]), summarize, mean = mean(c(df[,1], df[,2])))

ruby - How to parse multiple XML files -

i trying parse multiple xml files nokogiri. in following format: <?xml version="1.0" encoding="utf-8"?> <crdoc>[congressional record volume<volume>141</volume>, number<number>213</number>(<weekday>sunday</weekday>,<month>december</month> <day>31</day>,<year>1995</year>)] [<chamber>senate</chamber>] [page<pages>s19323</pages>]<congress>104</congress> <session>1</session> <document_title>unanimous-consent request--house message on s. 1508</document_title> <speaker name="mr. daschle">mr. daschle</speaker>.<speaking name="mr. daschle">mr. president, said on floor yesterday afternoon, , repeat afternoon. know distinguished majority leader wants agreement as do, , not hold him responsible fact not able overcome impasse. commend him efforts @ trying again today.</speaking&

ios - UICollectionView shows two line but I only want one line -

Image
i meet strange mistake when use uicollectionview, @ pic below: the third cell seems somehow show under second, , place third cell turns out empty. when scroll view away , back(or reload view) , turns right: here code used: #pragma mark - uicollectionview datasource - (nsinteger)collectionview:(uicollectionview *)view numberofitemsinsection:(nsinteger)section { return datas.count; } - (nsinteger)numberofsectionsincollectionview:(uicollectionview *)collectionview { return 1; } - (uicollectionviewcell *)collectionview:(uicollectionview *)cv cellforitematindexpath: (nsindexpath *)indexpath { static nsstring *cellid = @"floorcell"; floorcollectionviewcell *cell = [cv dequeuereusablecellwithreuseidentifier:cellid forindexpath:indexpath]; nsdictionary *dic = [datas objectatindex:indexpath.row]; cell.goodimageview.imageurl = [nsurl urlwithstring:[dic objectforkey:@"img"]]; cell.goodlabel.text = [dic objectforkey:@"

testing - Can we run tests in robot framework with comma separated tags? -

i have tagged test cases feature name. i have tags like, rest-apis, ui-tests, mysql-tests. i have enabled jenkins job such can select tags using checkboxes. can run tests below command? pybot -l trace -i rest-apis,ui-tests /tests/test01.txt will work? comma can not used separator tags on command line. 2 options have are: repeating -i option: -i rest-apis -i ui-tests using or operator: -i rest-apisorui-tests on second option, not there no space , or has upper case. note "tags free text, normalized converted lowercase , spaces removed".

twitter bootstrap - Multiple UI Frameworks detected - Intel XDK -

i using bootstrap framework mobile application in intel xdk. however, have included jquery ui feature list view inside it. giving me sort of warning : multiple ui frameworks detected in document is should worried of jquery feature working fine. update: jquery listview not appear in intel emulator. appears in design view are using jquerymobile? (as opposed jquery ui, different). when app designer opens document tries figure out ui framework being used can display right toolset user. in case discovering multiple ui frameworks. guess is seeing bootstrap , jquerymobile, , warning. jquerymobile performs lot of operations in background , pretty assumes rules roost once introduced project. not takes on widgets dom node, take on whole document. jqm isn't elected lightly, can't date her, have marry her. suspect why listview isn't working in emulator - normal jqm setup absent. one original goal appdesigner support multiple simultaneous frameworks, goal

domain driven design - How can CQRS contribute to more scalable applications -

lately i've been reading lot on cqrs architecture. 1 of foremost points stated on why 1 should use cqrs scalability. now don't quite understand how can work. let's have typical cqrs application design. two datastores one command side one query side when command has been processed event send update second datastore it's stated having datastore querying , 1 handling commands make application more scalable. how can work if second datastore stores event data needs respond query requests , needs update iteself based on incoming events ? why not have 1 datastore commands stored , query side can re-use stored data fetching it's result data ? you might find interesting read old blog post greg young himself, explains cqrs is. cqrs not having 2 different stores, but, stated on greg's article: cqrs creation of 2 objects there one. separation occurs based upon whether methods command or query what describe here more event sourci

Getting an syntax error, unexpected T_STRING in select option in html,php -

hi have small project give news past 4,6,10 weeks using select option in html. getting syntax error, unexpected t_string in select option tag. understand error cant use php inside open php tag. dont know how can solve error. help.thanks. here code: <?php $page['doctype'] = true; $param = array_merge($_get, $_post); $return = array(); if($param['aktion'] == 'edit-news') { $page['register-edit-news'] = array( 1 => array( 'edit-news','aktiv',$page['script'],'',''), ); if(isset($_post['btnsubmit'])) { if(($_post['news'])==4){ $sql=" select distinct ad_news_texte.headline, ad_news.datum_archiv ad_news_texte inner join ad_news_oe on ad_news_texte.news_id = ad_news_oe.id_ad_news inner join ad_news on ad_news_oe.id_ad_news = ad_news.id ad_news.datum_archiv between curdate( ) - interval dayofweek( curdate( ) ) +28 day , curdate( ) "; $sql_select=mysql_quer

how to decode encoded json data from php in phonegap android -

i want store table data server android local storage. issue table data might content special character '<' or '>' both. when ajax call made ways sqllite error code 13 while inserting data server. , if try store simple localstorage server working perfectly. tried encode data in php , send data android app in json form.but know blank data in ajax data. here php code encode data: $select_table = 'select * users'; $resulttabledata = $conn->query($select_table); while ($row1 = $resulttabledata->fetch()) { $temporarydata[] = htmlentities(utf8_encode($row1),ent_quotes); } $data[$row] = $temporarydata; mysql_close($con); require_once('json.php'); $json = new services_json(); echo ($json->encode($data)); here ajax code in phonegap android: $.ajax({ url: urlserver + 'getdynamicformdata.php', contenttype: 'application/json', beforesend: function() { $.mobile.loading('show'); }, com

java - Exclude javax.servlet package from com.google.gwt dependency on pom.xml -

i use vaadin 7, , vaadin have default package javax.servlet , need com.google.gwt in dependencies contains javax.servlet . when run application got error : severe: allocate exception servlet vaadin application servlet java.lang.classcastexception: com.vaadin.server.vaadinservlet cannot cast javax.servlet.servlet now want exclude javax.servlet dependency, , here tried far : <dependency> <groupid>com.google.gwt</groupid> <artifactid>gwt-user</artifactid> <version>2.6.1</version> <exclusions> <exclusion> <!-- declare exclusion here --> <groupid>javax.servlet</groupid> <artifactid>servlet-api</artifactid> </exclusion> </exclusions> </dependency> and : <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-shade-plugin</artifactid> <version>2.3</ver

php - INR to USD convert values in opencart -

how convert inr rupees usd dollars in opencart. have tried below code... $json_from = number_format($item_total, 2, '.', ''); $url = "http://rate-exchange.appspot.com/currency?from='.$json_from.'&to=usd"; $jsons = @file_get_contents($url); $json_data = json_decode($jsons, true); $to_cur = $json_data['results'][0]; $data['paymentrequest_0_itemamt'] = $to_curr; $data['paymentrequest_0_amt'] = $to_curr; your url call api incorrect need call like, $url = "http://rate-exchange.appspot.com/currency?from=inr&to=usd"; from there conversion rate convert inr usd if giving 0.0168728 , multiple amount expected result. side note: can pass third parameter &q=4300 directly converted value api. example demo .

c# - Tcp/IP listener parsing xml string output advice(code provided just not working as it should) -

i advice on how fix code. it's tcp/ip listener requestcount = requestcount + 1; networkstream networkstream = clientsocket.getstream(); byte[] bytesfrom = new byte[1000025]; networkstream.read(bytesfrom, 0, (int)clientsocket.receivebuffersize); string datafromclient = system.text.encoding.ascii.getstring(bytesfrom); datafromclient = datafromclient.substring(0, datafromclient.indexof("$")); var rap= xdocument.parse(datafromclient) .descendants("gag") .select(n => new { re= n.element("re").value, we= n.element("we").value }).tostring(); console.writeline(" >> data client : " + rap); string serverresponse = "last message client :" + datafromclient; byte[] sendbytes = encoding.ascii.getbytes(serverresponse); networkstream.write(sendbytes, 0, sendbytes.length); networkstream.flush(); console.writeline(" >> " + serverresponse); that listens string <?xml version=

php - redis json sql style query -

i have bunch of json store in redis { "foo": "37", "bar": "alex", "baz": "tom", "type": "test", "date": "12/12/2012 12:12:12 } but coming sql background, i'm not sure best way go doing: select * table "foo" = "37" , "baz" = "test" order date desc i've looked @ hashes, i'm unclear if redis able perform queries 1 above? the way go redis build indices. example, consider following flow "insert" data hash key , build proper indices: hmset somekeyname foo "37" bar "alex" baz "tom" type "test" date "12/12/2012 12:12:12" sadd foo_index:37 somekeyname sadd baz_index:test somekeyname this create key called somekeyname of type hash relevant data in it. additionally, create/update 2 sets we'll use indices. now, keys match sql select statement, l

python - Batch insertion neo4j - best option? -

i've been trying import relatively large dataset neo4j...approximately 50 million nodes relationships. i first experimented cypher via py2neo -> work, becomes slow if need use create unique or merge. i'm looking @ other batch import methods, , i'm wondering if there recommendations of these approaches best general workflow , speed: the neo4j docs mention batch insertion facility appears java , part of neo4j distribution; there batch inserter michael hunger on @ github, not sure how similar or different 1 included in distribution; then there load2neo , i'm testing; and there load csv functionality part of neo v2's cypher, though not sure if convenience factor , if performance similar executing cypher queries in batches of, say, 40 000 via cypher transaction. i appreciate comments on functionality, workflow, , speed differences between these options. if can use latest version of neo4j recommended way use new load csv statement in cypher

http - Using HttpWebRequest, Keep-alive not working for many similar requests to localhost -

i'm using httpwebrequest send many sync requests same http url on localhost, , need re-use tcp connections prevent ephemeral port depletion. but don't seem able keep-alive working. here's code make http request: var request = (httpwebrequest) webrequest.create(url); httpwebresponse response = null; request.method = "get"; request.keepalive = true; try { response = (httpwebresponse) request.getresponse(); // ... } catch (exception e) { // ... } { if (response != null) { response.close(); } } i call above code many times in loop. requests successful, , return ok status code (200), running netstat -ano reveals there many many connections in time_wait state, expect re-use single connection. i tried calling both iis express server on localhost (default asp.net mvc application) , weblogic application, same result. i tried httpclient .net 4.5. this results in running out of ephemeral ports. is there wrong i'

r - .html plotGoogleMap does not load in shiny App when deployed on shinyapps.io -

i trying embed plotgooglemap in shiny app online. locally app works perfectly, when uploading via shinyapps shinyapps.io .html map not load. any ideas how solve issue? see code below. ui.r library('markdown') library('shiny') shinyui(navbarpage("plotgoolemaps in shinyapps", mainpanel(uioutput('mymap')) ) ) server.r library('shiny') library('plotgooglemaps') shinyserver(function(input, output){ output$mymap <- renderui({ data(meuse) coordinates(meuse) = ~x+y proj4string(meuse) <- crs("+init=epsg:28992") m <- plotgooglemaps(meuse, filename = 'mymap1.html', openmap = f) tags$iframe( srcdoc = paste(readlines('mymap1.html'), collapse = '\n'), width = "900px", height = "500px" ) }) }) deploy app with shinyapps library('shinyapps') setwd("~/working di