Posts

Showing posts from January, 2010

matlab - fdatool Fc choosing and the relation between bins and radians -

matlab - fdatool Fc choosing and the relation between bins and radians - generally, have difficulties on deciding fs, fc , others. instance, want have pi/2 cut-off frequency , in fdatool, default, programme chose fs = 48000. so, value should take fc have pi/2 cut-off frequency. looking @ monitor without having ideas on next. problem occurs on many occasions that. ways should follow convert values between bins , radians or frequencies? have no thought whether said wanted inquire hope did.thanks patience matlab

vb.net - How to connect rdlc report to Access db without dataset object? -

vb.net - How to connect rdlc report to Access db without dataset object? - i want create rdlc study don't want create dataset object or external objects need programmatically: connect study access db 2010 select records table printed show report vb.net report rdlc

jquery - Incomplete XHR responses from IIS with compression -

jquery - Incomplete XHR responses from IIS with compression - i'm loading scripts jquery ajax. here's snip loader code, it's worth. var resources = ['knockout-3.2.0.js', 'fonts/fontawesome-webfont.eot', ... ]; var retrycount = 0; load(0); function load(i) { if (i == resources.length) { $("#progbar").width("100%"); $("#progcaption").text("executing app/main...") var requirescript = document.createelement('script'); requirescript.setattribute("type", "text/javascript"); requirescript.setattribute("src", "scripts/require.js"); requirescript.setattribute("data-main", "app/main"); head[0].appendchild(requirescript); } else { $("#progbar").width(100 * / resources.length + "%"); var r = resources[i]; switch (r.substring(r.lastindexof('.'))) { case ".js": ...

gradle - copy release aar file after succeful build -

gradle - copy release aar file after succeful build - when building aar file using gradle, how can re-create created release aar other directory ? (i not want alter default output dir re-create release file ) assuming not using flavors, , not changing aar name, can utilize next task: task copyaar(type: copy) { from('build/outputs/aar') into('/path/to/desired/output/dir') include(project.name + '-release.aar') } if changed aar name, replace 'project.name' name. gradle android-gradle build.gradle aar

vba - Using variables in pivot data source -

vba - Using variables in pivot data source - i replace: c:\users\test_h\downloads\new folder\[book1.xlsm] , sheet1 variable code below: activesheet.pivottables("pivottable1").changepivotcache activeworkbook. _ pivotcaches.create(sourcetype:=xldatabase, sourcedata:= _ "c:\users\test_h\downloads\new folder\[book1.xlsm]sheet1!r1c1:r30c14", version _ :=xlpivottableversion14) i've tried, cannot work: sub test(sht string, path_name string) activesheet.pivottables("pivottable1").changepivotcache activeworkbook. _ pivotcaches.create(sourcetype:=xldatabase, sourcedata:= _ path_name & sht & !r1c1:r30c14", version _ :=xlpivottableversion14) end sub you having syntax issues: missing quotation , breaking lines within object reference. these errors caught compiler before run of code. also, utilize cells() reference instead of r1c1 address reference. plus, combining string reference workbook , worksh...

sql server - Is there any option to set global variable in SQL? -

sql server - Is there any option to set global variable in SQL? - i need utilize values (table values ex: studentid) in many stored procedures. need query value in every stored procedure. in mvc able store value in webconfig. in sql how can that? is there alternative store value globally refer in stored procedure? if need configuration values in database, can create new table , phone call configurationparameters , query whenever need value it. if can't that, create storedprocedure or function returns value need. sql sql-server stored-procedures

python - Extending django admin custom view for user -

python - Extending django admin custom view for user - i have database of businesses around city, , want allow individual businesses submit info database, under respective business names. business table looks this: id, business_name, business_address, business_city, business_state, so on , fourth. there other tables in database, tied id field of model. want utilize admin console confine usernames business_id's, businesses can login , submit info respective business. can accomplished using django admin console? have looked st django-guardian ? github: https://github.com/lukaszb/django-guardian pypi: https://pypi.python.org/pypi/django-guardian python django

ruby on rails - How do I set up my model associations for an conference registration app? -

ruby on rails - How do I set up my model associations for an conference registration app? - i've been playing around writing ror 4.2 app allow next behaviors: admin users create list of conference courses include topic, description, etc conference attendees can register website , select conference courses they'd attend. conference attendees should not able create conference courses, select list of courses listed in database , select them attend. must way associate many users same course. when user selects course, seating capacity course of study should decremented (the details of aspect of solution secondary requirement @ time) for sake of discussion, let's using devise user roles figured out , configured. have 1 user.rb model/table. created model/table called course.rb. created bring together model/table called course_selection.rb. i configured these tables using has_many through associations bring together table belonging each so: class user < activ...

different behavior in Opengl ES android -

different behavior in Opengl ES android - .renderer performance reasons drawing 1 time background, utilize glscissors draw parts , simplified code : public class mygame extends glsurfaceview implements renderer { private boolean firsttime; public mygame(context context) { super(context); // todo auto-generated constructor stub firsttime=true; this.setrenderer(this); this.setrendermode(rendermode_continuously); } @override public void onsurfacecreated(gl10 gl, eglconfig config) { // todo auto-generated method stub } @override public void onsurfacechanged(gl10 gl, int width, int height) { // todo auto-generated method stub gl.glmatrixmode(gl10.gl_projection); gl.glviewport(0, 0, width, height); gl.glorthof(0, width, 0, height, 1, -1); //select bluish color gl.glclearcolor(0, 0, 1f, 1); } @override public void ondrawframe(gl10 gl) ...

SPARQL Filter not working -

SPARQL Filter not working - i'm running next sparql query on de.dbpedia select distinct * { { ?name dcterms:subject category-de:haus_liechtenstein. ?name rdf:type foaf:person. optional {?name <http://de.dbpedia.org/ontology/deathdate> ?deathdate} minus {?name dbpedia-owl:deathdate ?d} } union{ service silent <http://dbpedia.org/sparql>{ ?name dcterms:subject category-en:princely_family_of_liechtenstein. ?name rdf:type foaf:person. optional {?name <http://dbpedia.org/ontology/deathdate> ?deathdate} } minus {?name dbpedia-owl:deathdate ?d} } } for "de-results", minus-filter works fine, "en-results" i'm getting persons deathdate. can explain me why filter doesn't apply here? thank , best regards fobi look @ bracketting in query: minus in "right hand side" of union has service form, , minus, minus outside of service form: union{ service silent <http://dbpedia.org/sparql>{ ...

jquery - Unable to access session variable in php script called using ajax -

jquery - Unable to access session variable in php script called using ajax - consider next scenario. have 3 php files, file1.php, file2.php , file3.php located on server. file1.php starts session , sets session variable say,var. able access var using $_session['var'] in file2.php. file3.php called using jquery ajax functionality, im unable access $_session['var'] in file3.php. if gettype($_session['var']) in file3.php returns null. problem here ? please help give thanks you from tests should work. happening if not have sessions set utilize cookies , beingness appended url, need pass session hash via get, using proper name set in php.ini, uploadify script. but there bunch of inconsistencies, in pastie, not have rename every part of code, need post relevant sections. php jquery ajax

sql - Select where count of other query of same table -

sql - Select where count of other query of same table - i have got table "members" fields id,userid,groupid , select groupids count of members more 1 each members, this: id userid groupid 1 1 1 /* selecting groups guy id 1, here 3 people */ 2 2 1 3 3 1 4 1 2 /* here guy lone in group, ignore him! */ 5 1 3 /* select 1 guy 1, because #members>1 */ 6 2 3 performing grouping select guy id 1 including there must atleast 2 people in same group, return: 1, 3 but have no thought how in sql, this, but, doesn't work: select groupid members userid=1 , count( select userid members groupid=**currently iterated group** )>1; is somehow possible? if understand correctly, want groups @ to the lowest degree 2 members, 1 of has userid = 1 . next query finds these groups using group by , having : select m.groupid members m grouping m.groupid having count(*) > 1 , ...

html - Center a stack of div's CSS -

html - Center a stack of div's CSS - i trying stack div on top of div , center 2 div s horizontally in page. class="lang-css prettyprint-override"> .sandbox{ position:relative; } .product-image, .option-image{ position:absolute; margin-left:auto; margin-right:auto; } .product-image{ z-index:-1; } class="lang-html prettyprint-override"> <div class="sandbox"> <div class="product-image"> <img src="main-product-image.jpg" width="1440" height="560" alt=""/> </div> <div class="option-image"> <img src="overlay.png" width="1440" height="560" alt=""/> </div> </div> this stack part works fine can not seem them centered no mater try. this should create them centered. .product-image, .option-image{ position:absolute; margin-left:auto; margin-rig...

ios - Image view makes app slower -

ios - Image view makes app slower - in ios app have image view in tableviewcell. before adding imageview app performing smooth. slow on devices. the image saved in database base of operations 64 encode string , decoded image , loaded imageview. decoding done in background thread. if(info.image !=nil) { uiimage *image = [_imagecache objectforkey:info.threadid]; if (image) { // if have cachedimage sitting in memory already, utilize cell.alignimageview.image = image; } else { uiactivityindicatorview *spinner=[[uiactivityindicatorview alloc] initwithactivityindicatorstyle:uiactivityindicatorviewstylegray]; spinner.center=cell.alignimageview.center; spinner.hideswhenstopped=yes; [cell.alignimageview addsubview:spinner]; [spinner startanimating]; // image in background [self.queue addoperationwithblock:^{ ...

c# - Can someone share a small code example to write NFC tag "block wise" using WP8? -

c# - Can someone share a small code example to write NFC tag "block wise" using WP8? - i have been using acr reader write mifare cards blocks. have tried researching on web same using wp8. able read , write info not block wise hence don't know info getting written. also, tried reading card written using wp8 on acr reader card simple doesn't read on acr 1 time written using wp8. 1 help me crack issue. appreciate if can share 1 line code helps write blockwise in wp8? c# windows-phone-8

C# How can i swap the first with the last character from a string -

C# How can i swap the first with the last character from a string - id create method: public static string frontback(string str) {} this method should exchange first char lastly char. for illustration : console.writeline(frontback("code")); so in case i'd replace char "c" "e" , result should eodc. public static string frontback(string str) { int len = str.length; homecoming str[len-1] + str.substring(1,len-2) + str[0]; } c# string

c++11 - how does the below code output 3? (how does the below code read?) -

c++11 - how does the below code output 3? (how does the below code read?) - the specific part not understand how -a in if statement changes -3 3. can explain how -a changes a = -3 a = 3 ? #include <iostream> int main(){ signed = -3; if (a < 0){ std::cout << -a << std::endl; } else { std::cout << << std::endl; } system("pause"); homecoming 0; } it's illustration of unary negative, when a=-3 (which less 0 , code enters if block) -a -(-3) 3 . c++11 if-statement int signed

sql server - error while creating table in mysql for generating auto serial number -

sql server - error while creating table in mysql for generating auto serial number - i want create serial number table not view example: table confirmationnumber: serialno -------------- 00000001 00000002 00000003 and on (the serial number increment each time execute query). for when creating table in sql as: create table confirm ( confirmationid int, name varchar(10), sequencenumber right('0000000' + convert(varchar, confirmationid), 8) ) it's giving error: error 1064 (42000): have error in sql syntax; check manual corresponds mysql server version right syntax utilize near 'as right('0000000' + convert(int, confirmationid), 8) )' @ line 9 can body help me? remove sql-server tags. put desired code in insert statements, or utilize trigger. you can utilize zerofill attribute 0s automatically displayed. mysql sql-server create-table

xml - How to recursively get XPath of a node using SQL Server? -

xml - How to recursively get XPath of a node using SQL Server? - i'm tired of looking @ perchance ugliest sql statement i've ever built , need help. searching through xml document various elements , want see xpaths. query below works brute force, cannot come way create function or cte back upwards n levels. declare @article xml = '<article> <front> <article-meta> <title-group> <article-title>update on ...</article-title> </title-group> </article-meta> </front> <back> <ref-list> <ref id="r1"> <citation citation-type="journal"> <article-title>retrospective study of ...</article-title> </citation> </ref> </ref-list> </back> </article>' select cast(t.r.query('local-name(parent::*/parent::*/parent::*/parent::*/parent::*/parent::*)...

Javascript onclick event declation with if-else -

Javascript onclick event declation with if-else - i m newer javascript, getting started javascript. here link(run example): http://www.w3schools.com/js/tryit.asp?filename=tryjs_intro_lightbulb here, have raised 1 doubt, if (image.src.match("bulbon")) { //do stuff } may know, "bulbon" why have use? and tried 1 example, here code: <img width="300px" height="300px" src="dim-bulb.jpg" id="bulb" onclick="changebulb()" alt=bulb"/> <script> function changebulb() { var image=document.getelementbyid("bulb"); if(image.src.match("bulbon")) { image.src="dim-bulb.jpg"; } else { image.src="bright.jpg"; } } when run code, works partially , when click, becomes bright, 1 time again click didn't show dim.. may know mistake? thanks in advance. in if condition if(image.src.match("bulbon")) you trying match bulbon in g...

inheritance - C++ virtual function override -

inheritance - C++ virtual function override - i have class contains next virtual method: struct point { template<typename t> virtual typename std::enable_if<std::is_base_of<point, t>::value, double>::type distto(t &other) const = 0; }; the above doesn't work because: error: templates may not ‘virtual’ the plan specialize class making more specific instances of point2d , point3d . however, want function work types of same class. if point2d inherit class, method distto should take parameter of type point2d . how can accomplish this? this had tried before did above: virtual double distto(point& other) = 0; but when override method in point2d class , seek replace parameter 1 of type point2d , run compiler errors. thanks time i think requirements create no sense static typed language such c++. think how able utilize virtual function: point2d p1, p2; point3d p3; point &p = p1; p.distto(p2); //ok? p.dist...

c - non-blocking connect() and select() with zero timeout is returning 0 -

c - non-blocking connect() and select() with zero timeout is returning 0 - i'm writing single-threaded app handless several connected tcp sockets in loop. here's part initiates connection: // set connecting socket wire[wi].skt=socket(af_inet,sock_stream | sock_nonblock,ipproto_tcp); if (wire[wi].skt==-1) homecoming tec_sock_err; wire[wi].sai.sin_family=af_inet; memmove(&wire[wi].sai.sin_addr,&rconf.txaddr,sizeof(struct in_addr)); wire[wi].sai.sin_port=htons(rconf.txport); // initiate connection int cres = connect(wire[wi].skt,(struct sockaddr *)&wire[wi].sai,sizeof(struct sockaddr_in)); // comprehend results if (cres==0) { // connect established wire[wi].state=connected; homecoming 0; }; if (cres==-1) // socket error meaning depends on errno switch (errno) { // ok non-blocking sockets case einprogress : { // connect initiated wire[wi].state=connecting; hom...

java - SSL Error: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number error when disabling ssl and enabling TLS -

java - SSL Error: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number error when disabling ssl and enabling TLS - i trying disable ssl on tomcat , trying send request app on tls port getting next error: failure in posting request manager: [ssl error: error:1408f10b:ssl routines:ssl3_get_record:wrong version number] configuration using in server.xml is: <connector port="18443" protocol="http/1.1" sslenabled="true" maxthreads="150" scheme="https" secure="true" clientauth="false" sslprotocols="tlsv1,tlsv1.1,tlsv1.2" keystorefile="/opt/certs/server.keystore" keystorepass="123456" truststorefile="/opt/certs/server.truststore" truststorepass="123456"/> can please tell me how should run on tls? the post request ulrencoded , after decoding https://:port//datamanager?a='1'?b='4' the prob...

Scala pattern matching confusion with Option[Any] -

Scala pattern matching confusion with Option[Any] - i have next scala code. import scala.actors.actor object alice extends actor { this.start def act{ loop{ react { case "hello" => sender ! "hi" case i:int => sender ! 0 } } } } object test { def test = { (alice !? (100, "hello")) match { case i:some[int] => println ("int received "+i) case s:some[string] => println ("string received "+s) case _ => } (alice !? (100, 1)) match { case i:some[int] => println ("int received "+i) case s:some[string] => println ("string received "+s) case _ => } } } after doing test.test , output: scala> test.test int received some(hi) int received some(0) i expecting output string received some(hi) int received some(0) what explanation? as sec question, unchecked warnings above follows: ...

Does function overloading have runtime overhead in Delphi? -

Does function overloading have runtime overhead in Delphi? - is there additional runtime overhead in calling overloaded functions? (i inquire delphi, in case reply isn't same compiled languages) i think not should resolved during compile time, can never sure can you? of course of study can sure, because documented. compiler resolves @ compile time, there's no additional overhead on calling overloaded functions in delphi. [edit] i did little test you: var j: integer; st: string; procedure donothing(i: integer); overload; begin j := i; end; procedure donothing(s: string); overload; begin st := s; end; procedure donothingi(i: integer); begin j := i; end; procedure tform2.button1click(sender: tobject); const maxiterations = 10000000; var starttick, endtick: cardinal; i: integer; begin starttick := gettickcount; := 0 maxiterations - 1 donothing(i); endtick := gettickcount; label1.caption := format('overlaod ellapsed tic...

excel - If Date Exceeds Certain Date Then -

excel - If Date Exceeds Certain Date Then - how set formula or vba around this? if date listed in column + (7 days) exceed 5th of upcoming month something. its 5th of each month deadline. if column = 30th march 2015 +(7days)left = 6th apr 2015 column b = "holycrap" else "you're safe" i appreciate help on this. let's seek formula: =if(and(day(a1+7)>5,day(a1+7)<13),"screwed","safe") the date in a1 in either date or number format. right number format after pressing ctrl+;. please test , allow me know if date not homecoming right result. excel date excel-formula worksheet-function deadlines

java - Elasticsearch memory probles -

java - Elasticsearch memory probles - when i'm trying start elasticsearch in ubuntu startup script gives me next error: java hotspot(tm) client vm warning: info: os::commit_memory(0x74800000, 201326592, 0) failed; error='cannot allocate memory' (errno=12) # # there insufficient memory java runtime environment continue. # native memory allocation (malloc) failed allocate 201326592 bytes committing reserved memory. i seek search , couldn't find solution this. if restart machine work day , elasticsearch goes downwards , appear error. i setup property bootstrap.mlockall: true in elasticsearch.yml file, , properties in default elasticsearch file: es_heap_size=512 (i have 1gb of ram) max_locked_memory=unlimited someone know need do? thanks java ubuntu memory elasticsearch

jsf 2.2 - JSF Bean-Validation throws javax.validation.ConstraintDeclarationException: HV000141 -

jsf 2.2 - JSF Bean-Validation throws javax.validation.ConstraintDeclarationException: HV000141 - i'm using bean-validation within jsf-project , want utilize 'method constraint' first time. method composite constraint called facelet throws a: javax.validation.constraintdeclarationexception: hv000141: constraint com.jpa.validator.customnotemptystringvalidator used constrainttarget#implicit target cannot inferred. @ org.hibernate.validator.internal.metadata.descriptor.constraintdescriptorimpl.determineconstrainttype(constraintdescriptorimpl.java:422) @ org.hibernate.validator.internal.metadata.descriptor.constraintdescriptorimpl.<init>(constraintdescriptorimpl.java:187) @ org.hibernate.validator.internal.metadata.descriptor.constraintdescriptorimpl.<init>(constraintdescriptorimpl.java:212) @ org.hibernate.validator.internal.metadata.provider.annotationmetadataprovider.buildconstraintdescriptor(annotationmetadataprovider.java:604) @ org.hibernate.validator....

Fragment back stack, android? -

Fragment back stack, android? - my activity consists of navigation drawer , have 5 options in left menu. opens in fragment. i looking way maintain stack of fragments when user presses button moves previous fragment. like- activity consists of drawer menu have 5 options menu1, menu2, menu3, menu4, menu5 having corresponding fragments f1, f2, f3, f4, f5. user presses menu1 forwarded f1 presses menu2, , menu4. when user @ f4 , presses should moved f2 rather exiting activity or app. how can implemented , illustration or sample code preferred. i utilize code not help me out fragmentmanager fragmentmanager = getsupportfragmentmanager(); fragmentmanager.begintransaction() .replace(r.id.frame_container, fragment) .addtobackstack(null) .commit(); i found workaround query : override onbackpressed() in code use methods related backstack maintained contains fragment transactions public void onbackpressed(){ fragmentmanager fm = getfragme...

ios - Swift - Shake Motion to do prepareforsegue -

ios - Swift - Shake Motion to do prepareforsegue - my intention empty values within 2 arrays - force[] & stiffness[], class prepareforsegue, when user perform shake gesture. below codes , error encountering. springviewcontroller1 var springnum : nsinteger = 0 class springviewcontroller1 : uitableviewcontroller, uitableviewdatasource { var forcefulness = [float]() var stiffness = [float] () } springviewcontroller2 class springviewcontroller2 : uitableviewcontroller , uitableviewdelegate, uitableviewdatasource { var forceview2 = [float]() var stiffview2 = [float]() override func canbecomefirstresponder() -> bool { homecoming true } override func motionended(motion: uieventsubtype, withevent event: uievent) { if(event.subtype == uieventsubtype.motionshake){ println("shaken") self.performseguewithidentifier("reset", sender: self) } } override func prepareforsegue(segue: uistoryboardsegue, sender: any...

apache kafka - spark submit failed with spark streaming workdcount python code -

apache kafka - spark submit failed with spark streaming workdcount python code - i copied spark streaming wodcount python code, , utilize spark-submit run wordcount python code in spark cluster, shows next errors: py4j.protocol.py4jjavaerror: error occurred while calling o23.loadclass. : java.lang.classnotfoundexception: org.apache.spark.streaming.kafka.kafkautilspythonhelper @ java.net.urlclassloader$1.run(urlclassloader.java:366) @ java.net.urlclassloader$1.run(urlclassloader.java:355) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(urlclassloader.java:354) i did build jar spark-streaming-kafka-assembly_2.10-1.4.0-snapshot.jar. , used next script submit: bin/spark-submit /data/spark-1.3.0-bin-hadoop2.4/wordcount.py --master spark://192.168.100.6:7077 --jars /data/spark-1.3.0-bin-hadoop2.4/kafka-assembly/target/spark-streaming-kafka-assembly_*.jar. thanks in advance! actually realized have included --jars after sc...

c - How to convert insertion sort to an O(n logn) algorithm? -

c - How to convert insertion sort to an O(n logn) algorithm? - i wrote next function counts repeating instances of strings while creating sorted sequence of strings. slow, realized o(n^2). create o(n logn) don't know how proceed. there known methods converting such n^2 algorithm nlogn? how should 1 convert it? void insert (struct listnode **ptr, char *value) { struct listnode *newptr; int cmp; // find place instert node ll while(*ptr){ // comparision observe & remove duplicates nodes cmp = strcmp(value, (*ptr)->data); // duplicate if(cmp == 0){ (*ptr)->occurrence++; return; } // point need add together node if(cmp < 0) break; ptr = &(*ptr)->next; } // here *ptr points pointer want alter // can null, if @ end of ll newptr = malloc(sizeof *newptr); if(!newptr) return; newptr->data = strdup(value...

java - Unable to import wsdl in Soapui -

java - Unable to import wsdl in Soapui - i have cobertura instrumented war file , deployed in tomcat when trying import wsdl file soapui same getting weird error. error:type "lightclassmaplistener@http://coveragedata.cobertura.sourceforge.net" not found. i using cobertura version 2.0.3.i have checked cobertura jar nowadays in application web-inf\lib folder. please suggest solution. java tomcat wsdl soapui cobertura

python - Search for a field in a compound object -

python - Search for a field in a compound object - i'm new python, , creating programme tracks rfid badges used students in school district. in programme have class named badge creates badge object 6 public named variables (rfid, studentid, status, dateactivated, datedeactivated, reason). have class named badgetable holds badges. what want see if specific rfid or studentid exists in of badges. know can loops, can take while (i'm reading in 450 csv files, each of contains 2000 14000 badges, , adding badge badgetable if hasn't been added). edit: expand on above, badge info lastly 3 years has been manually entered spreadsheet has logic identify duplicate rfid or studentid numbers, exported each day csv file badge reader software. first year of our bus badge programme each day's csv file contained active badges; naively assumed if stopped sending inactive badges rejected badge reader. when discovered wrong, started including inactive badges knew in...

Return ID of inserted record from MS SQL Server Query in PHP -

Return ID of inserted record from MS SQL Server Query in PHP - i trying homecoming id result query using "output inserted.id". in sql server management studio id of newly inserted row. need homecoming result. i trying this, know connection working , because making insert table. $value still returns 0. public function insert($newsql) { $value = '0'; $params = array(array($value,sqlsrv_param_out)); $stmt = sqlsrv_query($this->conn, $newsql, $params); homecoming $value; } the parameter newsql = "insert test (col1) output inserted.id values ('somevalues')"; for reason $value still returning 0. figured out. public function insert($incomingsql) { //append select scope_identity incomingsql $sql = $incomingsql.'; select scope_identity();'; $result = sqlsrv_query($conn,$sql); sqlsrv_next_result($result); sqlsrv_fetch($result); homecoming sqlsrv_get_field($result, 0); } then phone call ...

perl - How can I fetch a hash ref from array of hashes by one of its values? -

perl - How can I fetch a hash ref from array of hashes by one of its values? - i have array of hashes, each hash containing same keys values unique. on basis of particular value, need store hash ref. see below illustration understand properly: my @aoaoh = ( { => 1, b => 2 }, { => 3, b => 4 }, { => 101, b => 102 }, { => 103, b => 104 }, ); now check if hash key a contains value 101 . if yes need store whole hash ref. how that? my $key = "a"; ($ref) = grep { $_->{$key} == 101 } @aoaoh; or using list::util 's first() : use list::util 'first'; $ref = first { $_->{$key} == 101 } @aoaoh; arrays perl hash reference perl-data-structures

c# - Help with mapping ActionLinks to Methods in Controllers (ASP.NET MVC2) -

c# - Help with mapping ActionLinks to Methods in Controllers (ASP.NET MVC2) - i'm on first mvc project , still haven't got finish hang of it. ran issue: i have in view (home/index.aspx) <% using (html.beginform()) { %> <fieldset> <p> <%: html.textbox("a")%> <%: html.textbox("b") %> <%: html.actionlink("submit", "create", "home")%> </p> </fieldset> <% } %> i have in controller (controllers/homecontroller.cs) [acceptverbs(httpverbs.post)] public actionresult create(formcollection formvalues) { homecoming view("index"); } i haven't changed default routes in global.asx when nail submit, "the resource cannot found error". however, if alter actionlink to <input type="submit" value="save" /> and method in controller to: [acceptverbs(httpverbs.post)] public actionresult index(for...

Mysql select min in group of rows where userid=? -

Mysql select min in group of rows where userid=? - this table stores info bought book , when. want know books bought first userid #1. sql fiddle that result in userid bookid date_purchase 1 2 2014-03-22 (purchased userid #1) 1 5 2014-03-29 (purchased before userid #2) 1 6 2014-03-28 (purchased before userid #3) 1 7 2014-03-26 (purchased before userid #3) it doesn't show bookid #3 because book purchased first userid #2. please note table may consist tens of thousands of rows need efficient solution. if had manually this: 1. check books did userid #1 purchase 2. go through rows books (bookid) , check min(date_purchase) each row 3. write out rows userid = #1 you want filter group-wise minimum, formulated using self-join (in order find date of first purchase of books bought desired user, irrespective of purchaser): select * docs natural bring together ( select bookid, min(d2.date_purchase) date_...

javafx 8 - Size of TableView in a VBox -

javafx 8 - Size of TableView in a VBox - i want layout resizable chart @ top , fixed size table @ bottom. tried using vbox chart , tableview , vbox.setvgrow ensure resizing goes on chart. know in advance have 3 rows in table. however, table firstly shows more rows have, , secondly, resizes when resize main window. i using jdk8, update 31, on windows 8.1/64-bit. i'm setting stage this public void start(stage primarystage) { linechart<number, number> chart = new linechart<>(new numberaxis(), new numberaxis()); node table = maketable(); vbox.setvgrow(chart, priority.always); vbox.setvgrow(table, priority.never); vbox root = new vbox( chart, table); scene scene = new scene(root, 300, 250); primarystage.setscene(scene); primarystage.show(); } and table initialised (note: stuff color have info set in table) private static node maketable() { tableview<color> table = new tableview<>(fxcollections.obse...

c# - How to call Invalidate not for the whole panel from another event/class -

c# - How to call Invalidate not for the whole panel from another event/class - i have paint event looks this: private void panel1_paint(object sender, painteventargs e) { rectangle rec = new rectangle(2, 2, 820, 620); pen pi = new pen(color.black, 2); e.graphics.drawrectangle(pi, rec); rectangle rec2 = new rectangle(convert.toint32((410 + 2500 * globalevariablen.istwerte[0])), convert.toint32(310 + 1875 * globalevariablen.istwerte[1]), 2, 2); e.graphics.drawrectangle(pi,rec2); } i have datastream serialport, , everytime receive info want invalidate rec2 not whole form. able invalidate whole form within datareceived event with: panel1.invalidate(); however not know how can create happen invalidate rec2, because if invalidate whole form time datastream blinks crazy , not good. invalidate() has overload version rectangle want invalidate: panel1.invalidate(getrect2()); where getrect2() (please pick improve name) like: static rect...

java - using an attribute of an arraylist in my jsp with struts-bean.tld -

java - using an attribute of an arraylist in my jsp with struts-bean.tld - i have issue using attribute of arraylist in jsp. arraylist in actionform : private arraylist<account> accounts = new arraylist<account>(); the class declaration of business relationship object in arraylist : public class business relationship implements serializable, cloneable { private string bic; public string getbic() { homecoming bic; } public void setbic(final string newbic) { bic = newbic; } } the phone call in jsp : <bean:write name="bankaccountsactionform" property="accounts.get(0).bic" /> the console error : javax.servlet.jsp.jspexception: no getter method property accounts.get(0).bic of bean bankaccountsactionform do have solution or way this? i have terrible alternative using property accountbic1 straight in form. induces lots of work behind re impact temporar...

html - Solid and Responsiv in an wrapper wich has an Responisv width -

html - Solid and Responsiv in an wrapper wich has an Responisv width - i working on responsiv app , need search bar parts responisv width , not(like search icon). i tried doing this class="snippet-code-css lang-css prettyprint-override"> .wrapper{ width:80%; height:auto; border-bottom:solid 5px red; } .solid{ width:50px; height:50px; background-color:green; } .responsiv{ width:100%; height:50px; background-color:yellow; } class="snippet-code-html lang-html prettyprint-override"> <div class="wrapper"> <div class="solid"></div> <div class="responsiv"></div> </div> but want responsiv. class="snippet-code-css lang-css prettyprint-override"> .wrapperwant{ width:912px; height:auto; border-bottom:solid 5px red; } .solidwant{ width:50px; height:50px; backgrou...

objective c - iOS8, how to know when UIView autorotation is complete? -

objective c - iOS8, how to know when UIView autorotation is complete? - i'm working storyboard project using size classes , autolayout. however, there couple instances in code i'm adding "old school" menus , components on screen. these components drawn correctly until view autorotates. i'm trying prepare autorotation issues controls added uiview programmatically in ios8. how determine when uiview autorotation has completed , view has new bounds? there's method called before rotation completed, , view still has old size, , subviews cannot redraw themselves. not see along lines of didtransition -(void)viewwilltransitiontosize:(cgsize)size withtransitioncoordinator:(id<uiviewcontrollertransitioncoordinator>)coordinator { //this not seem work - uses old size instead of new 1 [introductionview setneedsdisplay]; [super viewwilltransitiontosize:size withtransitioncoordinator:coordinator]; } the method called viewwilltransitiont...

php - How to redirected to current page after processing the code and its result on other page? -

php - How to redirected to current page after processing the code and its result on other page? - i have email newsletter on mutual footer file whch displayed ove site, have email newsletter section in footer. now want newsletter input email processed , and homecoming same page news letter has been subscribed. not have permission redirect form footer.php. please suggest thought create happen if understand correctly have footer on every page link this: (correct me if i'm wrong) <div id="footer"> <a href="/newsletter/subscribe.php">subscribe newsletter</a> </div> let's you're on page url /article/20100924 and want go page after processing /newsletter/subscribe.php as usual there several possible answers this. if configured correctly there should $_server['http_referer'] variable in server array pointing page click originated utilize that, , after processing form set header('lo...

iis - Perl application move causing my head to explode...please help -

iis - Perl application move causing my head to explode...please help - i'm attempting move web app have (written in perl) iis6 server iis7.5 server. everything seems parsing correctly, i'm having issues getting app work. the app couple forms. fill first 1 out, click submit, presents form based on checkboxes selected (using includes , such). i can past first form once... after stops working , pops generated error message. after looking code , such, states there aren't checkboxes selected. i know app writes info .dat files... (at point, i'm not sure yet), don't see beingness created. i've looked @ file/directory permissions , seemingly have more permissions on new server did on last. user/group files/dirs different though... would have it? why pass me on next form, displaying right "modules" checked first time , not other time after that? (it seems reset after while) i know complicated if have questions me, please inquire , i'll...

javascript - creating an inline update field using jquery -

javascript - creating an inline update field using jquery - i've gotten stuck(again) i have table , 1 of columns value want able click, turn input field, click 1 time again alter text. i've gotten first step done. turns input field link click , uses value in td. however, in writing function update value , remove input, can't fire @ all. i've tried copying out input field , hard coding first step page , when fire click function. (i haven't finished writing step wanted function fire first. below code. help overwhelmingly appreciated! html: <table> <tr id="1"><td class="qty" set="0" >2</td></tr> <tr id="2"><td class="qty" set="0" >2</td></tr> <tr id="3"><td class="qty" set="0" >2</td></tr> </table> jquery: $(".qty").click(function(){ var value = $(this).text()...

android - Error: Unable to open class file R.java -

android - Error: Unable to open class file R.java - this question has reply here: developing android in eclipse: r.java not regenerating 63 answers did fresh install of eclipse, jdk , android-sdk. i receiving error when creating new project [2010-09-26 16:07:56 - test] error: unable open class file c:\workspace\test\gen\com\example\test\r.java: no such file or directory what's reason , how prepare it? eclipse helios 32 bit java version "1.6.0_21" android sdk api 8 p.s. i'm new android development. edit: tried of solutions, nil worked. started using friend's install of eclipse ganymede. i have had same issue, needed do, create project , restart eclipse. //edit: finish collapsing of "package" tree works well. java android eclipse r.java-file

memcached - shake failover of consistent hashing -

memcached - shake failover of consistent hashing - i review memcached client's code. i have uncertainty failover policy: if keya @ servera , servera down. next time access keya located serverx. after little time pice. servera up. so, keya hash servera again, if so, info corresponding keya on servera maybe old , incorrect? memcached consistent-hashing

php - Symfony 1.x MVC concept/terms are different from main trend MVC terms -

php - Symfony 1.x MVC concept/terms are different from main trend MVC terms - i found in symfony 1.x, terms utilize describe mvc different many other php frameworks. example, the front-end , back-end in other frameworks might called 'group' or 'module', while symfony calls 'app' 'controllers' called 'modules' in symfony, , controller.class.php called action.class.php. confusing, phone call 'controller' 'action', , what's name of action method within each action.class.php file?? anyone help explain mvc term differences in symfony , other frameworks? php model-view-controller symfony1

java - How can I get a typed entity from a SearchService result entry? -

java - How can I get a typed entity from a SearchService result entry? - i new ibm sbt sdk search api implementation class "searchservice". how can typed entity community or forum or forumtopic search result entry type result? the java type result general, xml returned connections contains relevant info seems. there kind of "conversion" or "cast" available? java ibmsbt

javascript - How to set a message to a p:messages component through jQuery? -

javascript - How to set a message to a p:messages component through jQuery? - i have next p:messages component: <p:messages id="messageid" autoupdate="true" closable="true" redisplay="false" /> i need show message in using jquery this: jquery(#messageid).val("error message"); is possible? $('messageid').append('<div class="ui-messages-error ui-corner-all"><span class="ui-messages-error-icon"></span><ul></ul></div>').children('ul').append('<li><span class="ui-messages-error-summary">' + summary + '</span><span class="ui-messages-error-detail">' + detail + '</span></li>') assuming client id of messages component messageid. javascript jquery jsf primefaces

Issue with Python multiprocessing pool limit -

Issue with Python multiprocessing pool limit - i trying write python script launch number of kid processes of finite element simulation code. have been able python spawn of kid processes, problem process pool limit seems ignored. if seek spawn 9 processes set pool = mp.pool(processes=2) , 9 processes still start @ once. becomes problem if number of processes exceeds number of lsdyna licenses or number of processors on computer. have read lot multiprocessing package, still first time have tried utilize it. doing wrong here? import os import multiprocessing mp import subprocess import glob import platform def run_lsdyna(individual_sim_dir, model_name, solver_path): # set lsdyna environment variables os.environ['lstc_license'] = 'network' os.environ['lstc_license_server'] = 'xxx.xx.xx.xx' # phone call cmd prompt lsdyna command line if platform.system() == 'windows': subprocess.call('start "...

c# - Passing data to DataGridViews -

c# - Passing data to DataGridViews - i have text boxes on sec form , send button in code shown below. private void button1_click(object sender, eventargs e) { form1 f1 = new form1(); f1.passname = richtextbox1.text; f1.passlastname = richtextbox2.text; f1.passage = combobox1.text; f1.passgender = richtextbox3.text; f1.showdialog(); } and datagridview on form 1 code public partial class form1 : form { private string name; private string lastname; private string age; private string gender; public string passname { { homecoming name; } set { name = value; } } public string passlastname { { homecoming lastname; } set { lastname = value; } } public string passage { { homecoming age; } set { age = value; } } public string passgender { { homecoming gender; } set { gender = value; } } public form1() { in...

jquery - MVC anchor tag and bootstrap model delete -

jquery - MVC anchor tag and bootstrap model delete - i'm developing mvc 5 web application. within 1 of razor views have table spits outs several rows of data. beside each row of info delete button. when user clicks delete button want have bootstrap modal popup , inquire user confirm deletion. <table> <tr> <th> @html.displayname("country") </th> </tr> @foreach (var item in model) { <tr> <td> @html.displayfor(modelitem => item.country) </td> <td> @html.actionlink("edit", "edit", new { id = item.contactid }) | <a class="btn btn-danger btn-xs" data-id="@item.contactid" data-toggle="modal" data-target="#mymodal" id="delete"><i class="glyphicon glyphicon-trash"></i></a> ...