Posts

Showing posts from September, 2014

php - Cannot connect html5 forms to my sql database? -

i have html5 document requesting input user form(saved employee.php). also have created php document (sqlconnectionprocess.php) connecting forms local database. using xampp , phpmyadmin. employee.php: <html> <body> <form name="employeedatabase" action="sqlconnectionprocess.php" method="post"> <link rel="stylesheet" href="css.css"> <h1>employee database</h1> employe card no: <input type="text" name="cardno" ><br><br> employee no: <input type="text" name="employeeno" ><br><br> employee name: <input type="text" name="employeename"><br><br> nationality: <input type="text" name="nationality"><br><br> profession: <input type="text" name="profession"><br><br> dob: <input type="text" name="d

java - camel : Unable to read BODYSTRUCTURE -

i using apache camel mail read emails account. particular mail, stuck on there , throws exception "unable read bodystructure" . not mark mail read. mail received after not read camel service. 317422 [camel (emailtoewscontext) thread #0 - imaps://outlook.office365.com] warn org.apache.camel.component.mail.mailconsumer - caused by: [org.apache.camel.runtimecamelexception - failed extract body due to: unable load bodystructure. exchange: exchange[][mailmessage@0x55f69873]. message: com.sun.mail.imap.imapmessage@7a97bfa9] org.apache.camel.runtimecamelexception: failed extract body due to: unable load bodystructure. exchange: exchange[][mailmessage@0x55f69873]. message: com.sun.mail.imap.imapmessage@7a97bfa9 @ org.apache.camel.component.mail.mailbinding.extractbodyfrommail(mailbinding.java:275)

ruby on rails - Cheapest solution for external postgresql hosting -

i running several websites on heroku postgresql databases. of them smaller websites few visitors still need more 10.000 rows, makes quite costly $9/month per website. for of them there not load or lot of data. don't have high demands on availibility either. low price, simple usage, 10.000+ rows storage, , external access demands. i have no experience in installing databases , not wish maintain database. need store data , leave @ that. is $9 / month @ heroku cheapest solution can find this? php websites mysql-databases free quite suprised how pricy store data rails. although discouraged heroku, can share same instance of postgres db between many apps. have do, environment variables app , set them other ones. please check post .

order - Django TypeError unsupported operand type(s) for +: 'dict' and 'int' -

i created through model can add order field m2m field having problems auto incrementing order field via def number() below. when add object, typeerror unsupported operand type(s) +: 'dict' , 'int' , i'm not sure why. ideas? models.py: class playlist(models.model): user = models.foreignkey(settings.auth_user_model, default=1) name = models.charfield(max_length=50) tracks = models.manytomanyfield(track, through='playlisttrack') def __str__(self): return self.name class playlisttrack(models.model): def number(): last_order = playlisttrack.objects.all().aggregate(max('order')) if last_order == none: return 1 else: return last_order + 1 track = models.foreignkey(track) playlist = models.foreignkey(playlist) order = models.positiveintegerfield(default=number) class meta: ordering = ['order'] as mentioned in docs, aggregate()

c++ - Visual Studio 2015: is a set of const pointers allowed? -

we upgrading vs2015 soon, , found in breaking changes list: const elements the c++ standard has forbidden containers of const elements (such vector or set). visual c++ 2013 , earlier accepted such containers. in current version, such containers fail compile. source i wondering if knows if applies set. know map can still contain const pointers keys, since const anyway. an example: std::set<const qobject*> can still this? think not, according post on site of microsoft. const qobject* pointer to a const qobject . pointer still modifiable. const qobject* const make pointer const . since microsoft article talks const objects, const qobject* not , example fine.

SWIG - float array in struct to c# - SWIGTYPE_p_float -

i have question. i'm trying use swig wrap native dll, contains struct looking this: typedef struct { int x; float y[const1]; float z[const2]; } mystruct; and c# representation y , z not array, swigtype_p_float. there way tell swig interpret float y[const1] array, , not swigtype_p_float? have tried "memberin" , "typemap", no success. thanx in advanced...

jquery - How to bind to localStorage change event on different pages of the same site? -

i know how bind change event localstorage if same page opened in 2 tabs ( this topic ) , need similar effect, if had 2 pages of 1 site opened in different tabs. ideas? make example you, check want? http://www.yoursite.com/page1.html <html> <head> <title>page 1</title> </head> <body> <input type="text" id="value"/> <button id="save">save</button> </body> <script> function $id(id){ return document.getelementbyid(id); } function addhandler(ele,trigger,handler){ if(window.addeventlistener){ ele.addeventlistener(trigger,handler,false); return false; } window.attachevent(trigger,handler); } function savetostorage(){ var value = $id('value').value; window.localstorage.setitem('key',value); } addhandler($id('save'),"click",savetostorage

Union 50+ tables with different number of columns using SQL Server -

i have on 50 different tables combine 1 big table. tables have different number of columns. currently, union tables together, writing individual select statement each of tables, , inserting null column if column doesn't exist in table. using union union them together. for example: ( select col1 , null col2 , col3 table1 union select col1 , col2 , null col table2 ) although works, manual , time consuming. there better, more efficient way union these tables one? on 50 tables, going have thousands of lines of code. thank you! you can query sql server metadata, , result dynamically construct sql statement. can done in programming language, including t-sql itself. here's rough example; execute query, copy/paste result query window, , execute that. if 50 tables have similar names (e.g. start foo ), can replace exhaustive table list ( where table_name in ('table1', 'table2', 'table3') in exampl

javascript - Making a div on the top push all other content down -

i'm programming firefox plugin shows div on top page , pushes other content down. tried put before head tag doesn't seem work. my code: var alldivs = document.getelementsbytagname('div'); var headtag = document.getelementsbytagname('head')[0]; if (alldivs.mainplugindiv) { alert("!!! plugin llibrowser running !!!"); } else { var div = document.createelement('div'); div.id='mainplugindiv'; div.style.position = 'absolute'; div.style.zindex = '100'; div.style.width = '100%'; div.style.height = '150px'; div.style.background = '#313192'; div.style.color = 'white'; div.innerhtml="<script type=\"text/javascript\" src="+self.options.angularlib+"></script>"+ "<script type=\"text/javascript\" src="+self.options.angularapp+"></script>"+ "<form style=\"margin: 0 auto; left:

Raspberry pi modbus on rj45 -

hi there (i apologize english, not native lang) have sort of "blackbox" send me data trought rj45 port, in modbus format , want read data raspberry pi 2. searched lot on google, solutions listening modbus put card on top of rpi2, using rx/tx ports, dont want... if have solution, ! so, project over, "black box" prototype didn't send electric output, , project on now. closing :)

c# - Accessing different Masterpages from Base Class -

i have application uses 2 master pages. 1 main pages , 1 popup pages. these both inherit masterpages public partial class mainmasterpage : system.web.ui.masterpage { userbo objuser = null; public userbo getcurrentuser() { userbo userbo = new userbo(); ..... ..... return userbo; } } public partial class popupmasterpage : system.web.ui.masterpage { userbo objuser = null; public userbo getcurrentuser() { userbo userbo = new userbo(); ..... ..... return userbo; } } so far good. content pages inherit base class. base class has method calls getcurrentuser base class. public class basepage : page { //..... protected userbo getcurrentuserfrommasterpage() { this.master elsa.masterpages.mainmasterpage master = (elsa.masterpages.mainmasterpage )this.master; return master.getcurrentuser(); } } so here can see base page casts masterpage , calls getcurrent

coffeescript - grunt-contrib-coffee one-to-one compile -

i have several files named: jquery.a.b.coffee jquery.a.c.coffee jquery.a.d.coffee and compiled 1 jquery.js file in output directory. although guess behavior might nice in cases, have them compile different files jquery.a.b.js , jquery.a.c.js , on. how can tell grunt-contrib-coffeescript so? my gruntfile.js looks this: module.exports = function (grunt) { grunt.initconfig({ coffee: { dist: { files: [{ expand: true, flatten: true, cwd: 'app/webroot/coffee', src: ['{,*/}*.coffee'], dest: 'app/webroot/js', ext: '.js' }] } } }); grunt.loadnpmtasks('grunt-contrib-coffee'); }; thanks help! the problem lies on filenames having multiple dots. if jquery-a-b.coffee , jquery-a-c.coffee etc, have seen expected output. it known issue (extension after last period only) ,

I am trying to send an email using Python, when I pass the last field as variable it does not send anything in the email -

# web scraping import urllib import smtplib urllib.request import urlopen bs4 import beautifulsoup def make_soup(url): thepage= urllib.request.urlopen(url) soupdata = beautifulsoup(thepage, "html.parser") return soupdata soup = make_soup("http://www.met.gov.kw/?lang=eng") record in soup.select('#newforecast'): information = record.text content = information[48:440] msg = content here part of code having problems when transfer information stored in content message , pass sendmail() function body message supposed go email shows empty can tell me going wrong? server = smtplib.smtp('smtp.gmail.com', 587) server.starttls() server.login("youremail", "yourpassword") server.sendmail("placeholder", "placeholder", msg) server.quit() your variable msg raw string of content. content of email must use mime type ( multipurpose internet mail extensions ). in python c

(JAVA battleships) button/image grid works fine but when I add a second grid next to it they both get messed up -

i'm creating battleships program java. using gridlayout want have player board in west panel , npc board in east panel (as other info , means of input in centre panel , south panel). i started adding players board follows (full code can found @ bottom of post well): public void placeplyrgrids() { plyrboard.add(cornergridlabel); //add empty grid top left for(n = 0; n < 10; n++) plyrboard.add(lettergridlabels[n]); //the first row first 10 letters of alphabet (y = 1; y < 11; y++) //for every (y) row... { (x = 0; x < 11; x++) //...add ten (x) grids make columns { if (x == 0) //to start of each row, add number (image jlabel) { plyrboard.add(numbergridlabels[numbercounter]); numbercounter++; } else //for rest of each row, add buttons { plyrboard.add(buttongrids[y-1][x-1]); } } } } this worked fine

sqlite - Assign ID numbers according to groups -

button blue can add blue item, red button adding red button, etc. 1 button can clicked more once, hence there can more 1 blue or red item. the table below item id details size blue cheap small blue expensive big blue cheap small red cheap small red ok average how can assign id each of them table below item id details size blue 1 cheap small blue 2 expensive big blue 3 cheap small red 1 cheap small red 2 ok average just largest id item (use 0 if none exists yet), , add one: select ifnull(max(id), 0) + 1 mytable item = ?;

c# - How to configure dependency injection to allow only one instance of a class? -

during interview asked this. we use in our project unity container dependency injection. gets initialized in globals.asax using bootstrapper.initialise(); my di public class bootstrapper { public static iunitycontainer initialise() { var container = buildunitycontainer(); dependencyresolver.setresolver(new unitydependencyresolver(container)); return container; } private static iunitycontainer buildunitycontainer() { iunitycontainer container = new unitycontainer(); registerservice(container); return container; } public static void registerservice(iunitycontainer container) { container.registertype<ilibraryservice, libraryservice>(); } } there 2 questions . how many times di initialized through out project ? how configure dependency injection allow 1 instance of class? this pretty basic question, g

javascript - Why it is not saving values? -

hello have made app, in of radio button state saved in local storage. of radio buttons have values, once send saved radio button values, receive 0, instead of radio button values. if press @ least 1 radio button, of values normal. have written scrip if radio button checked, element receive value. script works fine. came conclusion, jquery code isn't working properly. here jquery code, save radio button state. $(function() { $('input[type=radio]').each(function() { var state = json.parse( localstorage.getitem('radio_' + $(this).attr('id')) ); if (state) this.checked = state.checked; }); }); $(window).bind('unload', function() { $('input[type=radio]').each(function() { localstorage.setitem( 'radio_' + $(this).attr('id'), json.stringify({checked: this.checked}) ); }); }); (i saw fixed it, i'll still post suggestion because simplifies code.) s

ruby - whenever gem is not working for every 2 seconds -

i have implemented whenever gem backend crons jobs working when try like every 2.seconds rake "my:rake:task" end i error `parse_time': time must in minutes or higher (argumenterror) i want run task after every few seconds how can this. you cannot whenever gem. under hood, whenever gem creates cron job . these can configured @ minimum granularity of per- minute . what could instead write shell script infinite loop runs task, , sleeps 2 seconds. however, advise against - running feels wrong. there's cleaner approach, e.g. running code after_save hook?

c - Getting error: expected '=', ',', ';', 'asm' or '__attribute__' before 'SolvePrecondMatrix' -

when try compile .c file in putty, throws me error : expected '=', ',', ';', 'asm' or ' attribute ' before 'solveprecondmatrix'. i don't know how solve it. checked twice in code , didn't miss ";" don't know why then. can me pls. #include<math.h> #include<stdio.h> #include<stdlib.h> #include<mpi.h> #define epsilon 1.0e-20 #define max_iterations 10000 /******************************************************************************/ void getpreconditionmatrix(double **bloc_precond_matrix, int noofrows_bloc, int noofcols) { /*... preconditional martix identity matrix .......*/ int bloc_matrixsize; int irow, icol, index; double *precond_matrix; bloc_matrixsize = noofrows_bloc*noofcols; precond_matrix = (double *) malloc(bloc_matrixsize * sizeof(double)); index = 0; for(irow=0; irow<noofrows_bloc; ir

javascript - Quran Recitation with related verse highlighted script -

i have requirement have play specific verses quran (mp3) , on other hand highlight same verse in actual quran. similar http://www.quranexplorer.com/quran/ . they break each chapter of holy quran n number of verses , play each verse , highlight same span or div tag. holy quran has 6236 verses mean need create 6236 mp3 files. is there software or script can create auto script or best way solution. solution can jquery based requirement .net project you need use html audio dom refrence work. using html dom refrence can manage audio player , playing audio. can play audio, stop audio, load audio , add event. create example @ bottom. when click on button, player start playing of first sound , highlight first word. when first sound ended, player start playing of next sound , highlight next word. var audioindex = 0; var audioaddress = [ "http://audiomicro-dev.s3.amazonaws.com/preview/1030/caca5b5fcde48f9", "http://audiomicro-dev.s3.amazon

qt - Building NPAPI plugin without X11 in QTWebkit? -

all, possible build npapi plugin without x11 in qtwebkit. have built qtwebkit directfb backend (without x11) , renders fine in platform. our next requirement build plugin qtwebkit. seems npapi plugin not supported in non x11 windows system. have tried ? , there alternative approach available develop plugin on qtwebwit without x11. cheers!

jms - Weblogic Deployment Unable to Resolve Local Queue -

we have spring-based application failing deploy on weblogic 10.3 container. upon deployment, application attempts 2 local jms queues within weblogic container's jms module and, when deployment takes place, application locates 1 local queue okay not other. both queues configured same except names different. why application locate 1 queue okay not other??? i've checked queue names jndi names many times on , can't see spelling errors or that. i have turned trace logging on , can see connection factory used both queues same, spring jms configuration same both queues yet 1 finds other not. i don't know else check establish problem might be... ideas? this error when fails 1 of queues in weblogic jndi tree: caused by: javax.naming.namenotfoundexception: unable resolve 'queue_name'. resolved ''; remaining name 'queue_name' @ weblogic.jndi.internal.basicnamingnode.newnamenotfoundexception(basicnamingnode.java:1139) ps: both queu

elasticsearch - How do I insert data into solr through my application which is in c++ -

i want insert data solr through application, using elasticsearch store data, insert data in elasticsearch using following request incloding data in index "16-03-2016-sslindex" : "post http://192.168.0.164:9200/_bulk http/1.1 host: 192.168.0.164:9200 user-agent: mozilla/4.0 (compatible; msie 6.0; windows nt 5.0;) pragma: no-cache content-type: application/x-www-form-urlencoded content-length: 196" "{"index":{"_index": "16-03-2016-sslindex","_type":"session"}} {"uniqueid":"2016-3-16-10-45-19-1-1","time":"2016-3-16t10:45:19","srcip":"192.168.0.180","srcport":1123,"dstip":"74.125.68.113","dstport":443,"interfaceid":"1","locationid":2,"size":0,"snortname":"p_snort.log.123","dummy1":"","dummy2":0}" i want use solr in

Matlab - Summing from control variable in loop to end of matrix and from beginning of matrix to control variable -

as part of bigger script, have matrix 1738 * 2 (1738 rows - 2 columns) , want loop through first column (so 1738 times). dependent on iteration of loop sum the second column start value (control variable - 1) , control variable end of second column. how try start loop through first column - cog_ton 1738 x 2 matrix (the number of rows dependent on input-data). my idea this: for ik = cog_ton (:,1) tonnes(ik) = sum (cog_ton (1:ik-1, 2)) tonnes2(ik) = sum(cog_ton (ik:end,2)) end does have idea how can implement in matlab ? the code you've written quite similar in matlab code, minor changes, see below: for ik = 1:size(cog_ton,1) length of column 1 in x tonnes(ik) = sum (cog_ton (1:ik-1, 2)); tonnes2(ik) = sum(cog_ton (ik:end,2)); end note syntax in for-statement. ik goes 1 size(cog_ton,1), i.e. length of column 1, 1738 in example.

Scala Spark dataframe : Task not serilizable exception even with Broadcast variables -

this works (df : dataframe) val filteredrdd = df.rdd.zipwithindex.collect { case (r, i) if >= 10 => r } this doesn't val start=10 val filteredrdd = df.rdd.zipwithindex.collect { case (r, i) if >= start => r } i tried using broadcast variables , didn't work val start=sc.broadcast(1) val filteredrdd = df.rdd.zipwithindex.collect { case (r, i) if >= start.value => r } i getting task not serializable exception. can explain why fails broadcast variables. org.apache.spark.sparkexception: task not serializable @ org.apache.spark.util.closurecleaner$.ensureserializable(closurecleaner.scala:304) @ org.apache.spark.util.closurecleaner$.org$apache$spark$util$closurecleaner$$clean(closurecleaner.scala:294) @ org.apache.spark.util.closurecleaner$.clean(closurecleaner.scala:122) @ org.apache.spark.sparkcontext.clean(sparkcontext.scala:2055) @ org.apache.spark.rdd.rdd$$anonfun$collect$2.apply(rdd.scala:959) @ org.apache.spark.rdd.rdd$$anonfun$collect$2.ap

xamarin - How to change a textview in NavigationView app:headerLayout? -

<android.support.design.widget.navigationview android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start" android:id="@+id/nav_view" app:headerlayout="@layout/drawer_header" app:menu="@menu/navmenu" /> drawer_header <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="120dp" android:background="#ffffff"> <linearlayout android:layout_width="match_parent" android:layout_height="60dp" android:orientation="horizontal" android:layout_alignparentbottom="true" android:layout_alignparentleft="true" android:layout_alignparentstart="true">

asp.net - How to remove url segment via web.config? -

how remove url segments via web.config rerwrite rules? scenarios removing en example 1 domain.com/en/blog/article1 redirect domain.com/blog/article1 removing fr example 2 domain.com/fr/blog/article2 redirect domain.com/blog/article2 i'm trying both in 1 redirect rule. equivalent remove part of url

sql server - convert certain column names with comma separated string from sql table with conditions -

for example , have table different column names , boolean value below it, case1 case2 case3 case4 1 0 1 0 what want retrieve,only column names 1 value. so, desired results query should case1,case3 desired output : case1,case3 there 1 row fetch sql query is there way? if understand correctly, use big case statement: select stuff(( (case when case1 = 1 ',case1' else '' end) + (case when case2 = 1 ',case2' else '' end) + (case when case3 = 1 ',case3' else '' end) + (case when case4 = 1 ',case4' else '' end) ), 1, 1, '') columns

Using mutiple datasources in myBatis and Spring -

i have application uses spring+mybatis , have mapper interface hold sql queries. mapper.java package it.helloworld.mybatis; import it.helloworld.dao.model.numbers; import java.util.list; import org.apache.ibatis.annotations.select; public interface mapper { @select("select * numbers") list<numbers> getnumbers(); } i have used mapperscannerconfigurer use mapper follows: <bean class="org.mybatis.spring.mapper.mapperscannerconfigurer"> <property name="basepackage" value="it.helloworld.ibatis" /> <property name="sqlsessionfactorybeanname" value="sqlsessionfactory1" /> </bean> i have used name 'sqlsessionfactory1' because have mutiple datasources in application. my question is: i change interface xml file. meaning want store sql query in xml instead of interface. can configure mapperscannerconfigurer read sql xml instead of interface.? if yes, how.?

ios - How calculate "pure" moving distance in Swift? -

i write application calculates total traveled distance. want value more less accurate. my problem when not move, location manager updates location , adds total distance ~ 1...2 meters every second horizontal accuracy 10.0 . , if stay / walk / stay, distance increasing on 60...100 meters each " standing" minute. bad me. i can stop updating location using core motion framework , detect changing x, y, z axis cmmotionmanager. work example when walk. when driving car device not change x, y, z axis. how calculate "pure" moving distance? declare property pedomter @property (nonatomic, strong) cmpedometer *pedometer; initialize these function supported in devices iphone 5s , above contain motion sensor chips if ([cmpedometer isstepcountingavailable]) { self.pedometer = [[cmpedometer alloc] init]; } else { uialertview * alertview=[[uialertview alloc] initwithtitle:@"alert" message:@"distance

ios - Flush edges when setting NSBackgroundColorAttributeName for attributed string -

Image
i have nsattributedstring , part of highlighted using nsbackgroundcolorattributename property. but final output looks i want color flush sides of page there's no white space before when text starts , after ends. you try below... if attributed string you'd using then, set background color of ui object(uilabel, uibutton...). but beleive you're using more 1 attributed strings merged, in case you prefix , suffix string new line character "\n". disclaimer: this comprise new line @ top , bottom along attributed string.

javascript - variable turns to undefined inside a for loop -

i'm battling javascript function i'm working on. inside loop i'm iterating elements class "visible", inside loop i'm preforming 2 actions. elements[i].removeattribute("class"); elements[i].setattribute("class", "hidden"); for reason 1 valid. 2 produces error saying: uncaught typeerror: cannot call method 'setattribute' of undefined even when log elements[i] using console.log; after first console.log call element exists, on second console.log elements[i] 'undefined' what hell missing here, driving me crazy, if laptop wasn't expensive have been broken now. :( here's function: function hide_visable_elements() { // remove body eventlistener var body = document.getelementsbytagname("body"); body[0].removeeventlistener("click", hide_visable_elements, true); var elements = document.getelementsbyclassname("visible"); (var = 0; < element

asp.net - Create Controller and add Views to another project -

visual studio 2015 + updates. asp .net web application (mvc). i start off adding few class libraries , separating asp .net wa layers i.e. dataaccess, business logic , web project itself. once separated add relevant references , working expect (i.e. application functions did before separated layers). in bl (controllers found here). don't have option add controller, when right clicking controllers folder in default project, add below line <projecttypeguids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</projecttypeguids> to csproj file class library , add controller option appears. create controller throws error due not having web.config file - add file , works (although nice have library working without web.config file). the problem i've hit is, when controller created adds view template within class library views folder located in web project. have done wrong? there workaround when controller created, creates views co

php - 301 redirect code to new folder structure URLs -

i use redirect on old site: rewritecond %{http_host} ^(www\.)?oldsite\.com$ [nc,or] rewritecond %{http_host} ^www\. [nc] rewriterule ^oldfolder(/.*)?$ http://newsite.com/newfolder$1 [l,r=301,nc,ne] rewritecond %{http_host} ^(www\.)?oldsite\.com$ [nc,or] rewritecond %{http_host} ^www\. [nc] rewriterule ^(.*)$ http://newsite.com/$1 [l,r=301,ne] this redirect code me: first,to redirect www non www on new site second,to redirect oldsite urls oldfolder newsite urls newfolder the problem old urls have index.php on structure , redirection wrong. example: oldsite.com/index.php/oldfolder/.... redirect to newsite.com/index.php/oldfolder/.... but right redirection should to newsite.com/index.php/newfolder/.... or newsite.com/newfolder/.... how can change redirect code make right redirections newfolder structure urls? you can use following rule redirect oldsite/ newsite : rewritecond %{http_host} ^(www\.)?oldsite\.com$ [nc] rewriterule ^oldfolder/(.*

c# - SpecFlow test with Gherkin table also trying column name in tests -

i have specflow feature: given have cooldata <a> , <b> , <c> , <d>: | | b | c | d | | cool data | | 1.3 | cool notes | | cool data | 1.4 | | cool notes | | cool data | 1.3 | 1.3 | cool notes | | cool data | 1.3 | 1.3 | cool notes | for have method: [given(@"given have cooldata (.*) , (.*) , (.*) , (.*) :")] public void givenihavecooldatawithand(string p0, string p1, string p2, string p3, table table) { var cool = new cooldata { a= p0, b= decimal.parse(p1), c= decimal.parse(p2), d= p3, }; } my problem: when run test, p0 , p1 , p2 , p3 mapped strings literally "<a>" , "<b>" , "<c>" , "<d>" , instead of values in tables. doing wrong? i'm trying repeat unit test

c - Interleave two 64-bit NEON vectors? -

i'm working on port of sse2 neon. sse code performs following: int64x2_t a, b, c, d; ... = interleave_high64(b, interleave_low64(c, d)); and performs following in place of _mm_unpackhi_epi64 , _mm_unpacklo_epi64 : static inline int64x2_t interleave_low64(int64x2_t a, int64x2_t b) { const int64x2x2_t result = vzip_s64(vget_low_s64(a), vget_low_s64(b)); return vcombine_s64(result.val[0], result.val[1]); } static inline int64x2_t interleave_high64(int64x2_t a, int64x2_t b) { const int64x2x2_t result = vzip_s64(vget_high_s64(a), vget_high_s64(b)); return vcombine_s64(result.val[0], result.val[1]); } my first, immediate question is, why vzip_s64 missing (though vzip_s32 , vzip_s16 are available ). or maybe, should use in stead? i'm guessing there's bigger pattern @ hand, , might use vstr.2 inteleaved store. second question is, should doing instead of 3 or 4 neon intrinsics?

smartgwt - ListGrid put focus in the FilterEditor -

i have listgrid defined this: listgrid lgrid = new listgrid(); listgridfield first = new listgridfield("first",first"); listgridfield second = new listgridfield("second ",second "); lgrid.setfields(first, second); lgrid.setshowfiltereditor(true); ¿how can put keyboard focus in first filter editor field after call show() in layout? thxs in advance. depending on use case (which useful provide more focused answer), solution posted might not need, because if scroll on listgrid, trigger new data fetch (if there more records show), , move cursor filter editor result (if user editing records @ point, cursor moving filter row not want happen!!). in such case, want call grid.focusinfiltereditor("fieldtofocus") after listgrid.show() statement or in clickhandler of button use fetch data, etc. anyway, don't need timer either. works: listgrid.adddataarrivedhandler(new dataarrivedhandler() { @override public void onda

java - RabbitListener multiple queues behavior -

what behavior when using following construct (latest version of spring). i'm unable find in documentation. @rabbitlistener(queues = {"q1", "q2", "q3"}) public class mylistener { in order messages 3 queues processed? it indeterminate - 3 basicconsume operations performed on consumer channel (if increase concurrentconsumers it's 3 per consumer). basicconsume operations performed in order queues defined (in cases unless 1 or more of queues temporarily "missing"). the broker send messages each queue prefetchcount ( basicqos ) each queue (default 1). i don't know actual algorithm used broker in scenario should assume indeterminate - spring amqp deliver them listener(s) in order received broker. edit i ran test (2 queues each 2 existing messages) , delivered round-robin - q1m1, q2m1, q1m2, q2m2 when prefetch 1. with prefetch set 4, see q1m1, q1m2, q2m1, q2m2. of course, when queues empty, messages arrive in

exception - org.openqa.selenium.WebDriverException: unknown error: cannot focus element on trying to upload a file in selenium -

i trying upload file in webpage through selenium webdriver, , have written below code driver.findelement(by.cssselector("#collapsedocuments > div > button.button.ng-isolatescope")).sendkeys("c:\\users\\siva.247588\\desktop\\clarient+aml+questionnaire.docx"); the css selector of browse button. i getting below error whwn run this: exception in thread "main" org.openqa.selenium.webdriverexception: unknown error: cannot focus element what wrong code? 1 advise? when try upload file, control shifted our local machine website writing scripts. so normal click method , select method won't work. can use robot method browse , upload file local machine websites. hope you.. see below link help: http://www.seleniumeasy.com/selenium-tutorials/webdriver-file-upload-using-robots i've used somewhere , hope can relate this: robot rb = new robot(); rb.keypress(keyevent.vk_a); rb.keyrelease(keyevent.vk_a); rb.keypre

VBScript : How to iterate dynamically to subnodes of xml file using vbscript -

this question has answer here: recurse xml file using vbscript 2 answers i have xml file root node has child node , child node may have it's own child node in turn have other child node , on. child1 child of parent , child2 child of child1 , on structure follows <parent> <child1> <child2> <child3> </child3> </child2> </child1> </parent> the problem don't know level of nesting of nodes i.e. number of child nodes within 1 child node want dynamically read nodes xml file currently using vbscript code set x=xmldoc.documentelement msgbox "nodename: " & x.nodename & vbnewline set y=x.childnodes i=0 y.length-1 msgbox "nodename: " & y(i).nodename & vbnewline z=0 y(i).childnodes.length-1 msgbox "nodename: " &a

javascript - Displaying some text on States on Map using D3.js and GeoJson -

i have been working storm , redis, , visualize data fetching redis, need render map (india) , place data according state. have rendered map correctly have no idea how display text within respective state boundaries. appreciated. thanks. <!doctype html> <html lang="en"> <head> <title>visualization demo</title> <script type="text/javascript" src="d3.min.js"></script> <script type="text/javascript" src="d3.geo.min.js"></script> <link type="text/css" rel="stylesheet" href="color-scheme.css"/> <style type="text/css"> svg { background: #282828; } body { background: #282828; } h1 { color:#999999; } #india { fill: #99ffcc; opacity: .9; stroke: white; stroke-width: 1.0; } #chart { margin-left:150px; } </style> </head> <body> <h1><center>visualization</center><

javascript - Double quote makes JS program works incorrectly -

for following code, hope print span1: span:"dd" where type in dd in textbox, in end, appears span1: span:"dd every thing after dd disappeared! <html> <head> <script> function check(){ var txt=document.getelementbyid("hello").value; document.getelementbyid("sp").innerhtml=txt; } </script> </head> <body> <input type="text" id="hello"/><br/> span1:<span id="sp1"/><br/> span:&quot;<span id="sp"/>&quot; <br/> <input type="submit" onclick="check()"/><br/> </body> </html>

c# - Multiselect listview with background change not working for iOS -

i have custom control perform multiselect on listview. viewcell code: using system; using system.collections.generic; using system.componentmodel; using system.globalization; using system.linq; using system.reflection.emit; using system.text; using xamarin.forms; namespace ____ { public class selectmultiplebasepage<t> : contentpage { public class wrappedselection<t> : inotifypropertychanged { public t item { get; set; } bool isselected = false; public bool isselected { { return isselected; } set { if (isselected != value) { isselected = value; propertychanged(this, new propertychangedeventargs("isselected")); // propertychanged (this, new propertychangedev