Posts

Showing posts from July, 2013

python - Arelle Xbrl validation - unable to start web service - socket error 10013 -

Image
i'm using arelle project implement validation of xbrl files. http://arelle.org/documentation/api-web-services/ when try start webserver can call code receive following error. been looking how fix , points disabling antivirus. got disabled , still error. arelle python project this should start webservice can reach on www.localhost:8082/rest/xbrl appearently issue previous release of project. i installed latest version 2013-07-25 , no longer had socket error

BGI Error in opening C++ program with DOSBox -

i have program in c++ uses graphic.h want open dos-box when try error dos-box: bgi error: graphics not initialized (use 'initgraph') have used initgraph in program in way: gd=detect; initgraph(&gd,&gm,""); check initgraph(), should like initgraph(&gd,&gm,"c:\tc\bgi"); if doesnot work try giving slash like: initgraph(&gd,&gm,"c:\\tc\\bgi"); if again doesnot not work check environmental variables also. you may refer existing post in bgi error, how resolve it?

bash - unix: renaming batch of files - how do I add numbers from 1 to 4000 to the filenames of 4000 files? -

i have 4000 files, , need add nrs 1 4000 @ beginning of filenames. for example: file_a.cel file_c.cel file_g.cel file_x.cel ... other_file.cel should become: 1_file_a.cel 2_file_c.cel 3_file_g.cel 4_file_x.cel ... 4000_other_file.cel it important underscore after number gets added. filenames totally different (there no system filenames), , doesn't matter in order numbered. there easy way using bash? many in advance! using a for loop , mv should give desired effect. it's not particularly interesting solution, it's simple. count=1 file in ./*; mv "$file" "${count}_$file" let count++ done

android - cast a class to an activity -

i'm trying create listview wich enable open 2 other activities created before. i've got problem intent. i'm quite sure understand lactivity activity wich exists. explain me why? thank you!! public listmenu extends activity { private listview malistview; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.list); // create list of elements list<elementofconstruction> liste = new arraylist<elementofconstruction>(); string columns = null; class<?> calculcolumns = null; elementofconstruction columns = new elementofconstruction(columns, 0, r.drawable.columns, calculcolumns, 100); liste.add(columns); string beam1 = null; class<?> calculbeam = null; elementofconstruction beam1 = new elementofconstruction(beam1, 0, r.drawable.beam1, calculbeam, 200); //récupération de la listview créée dans le fichier main.xml malistview = (

apache - Moving a file from a remote server using CGI script -

this need i have local server hosting cgi shell scripts. have file in remote server. want cgi script copy file remote server local server. this tried to avoid entering password every time, created key file using ssh-keygen command , copied public key file remote server /root/.ssh/authorised_keys file , worked. whenever execute scp user@remotehost:/root/ . intended file copied local server without manual authentication , works perfect. now, want same thing apache user triggeres cgi script. used below command generate key file apache user sudo -u _apache ssh-keygen -t rsa and system response enter file in save key (/library/webserver/.ssh/id_rsa) normally .ssh keys stored in location /root/.ssh , why system command defaulting /library/webserver ? can have 2 .ssh files? is there other solution trying? thank you every user in system should have his/her own ~/.ssh directory. when ssh runs, .ssh directory in user's home directory. can check user's

selenium webdriver - Where the assert message will be displayed -

i tried code package base; import org.testng.assert; import org.testng.annotations.test; public class assertcheck { @test public void check() { assert.asserttrue(true, "testing string true"); } } and code succeeds message "testing string true" not displayed. checked in console output , in testng results. just information, message parameter executed if assert condition false. message appear in console. but in case assert condition passed, message part not executed, not see message in case. if want see message in both cases, should use try-catch statement like try{ assert.asserttrue(true, "testing string true"); //print message case assert pass and/or perform other event }catch (exception e){ //print message case assert fails and/or perform other event loggerobj.debug("assert failed "+e.getmessage()); }

apache - How to route specific URL segments to separate web root directories? -

my yii project has following structure: webapp ----frontend --------www ------------index.php ----backend --------www ------------index.php ----api --------www ------------index.php https://github.com/tonydspaniard/yiinitializr-advanced apache 2.2 each www directory has own .htaccess file. example "webapp/frontend/www/.htaccess": options +followsymlinks rewriteengine on rewritebase / rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^([^/].*)$ /index.php/$1 [l] for separate parts of application use subdomains "api.webapp.com","admin.webapp.com" (symlinks in public_html folder): webapp.com -> webapp/frontend/www api.webapp.com -> webapp/api/www admin.webapp.com -> webapp/backend/www but have problems cross domain ajax requests api, , want this: http://webapp.com -> webapp/frontend/www/index.php http://webapp.com/api/ -> webapp/api/www/index.php

dll - Compile a C++/SDL with static library? -

in windows system need keep .dll files in same .exe ? wish merge files in 1 single .exe , there way how? i linux , windows user, in linux use terminal, in windows use codeblocks ! dlls in windows .so in linux, made separate. if want merge library, don't use dll, use static library instead (.lib) edit: if not writing library (somebody gave dll), take @ this

jQuery autocomplete filtering incorrectly -

i have input field has auto complete jquery field. <input id="peoplerolecodeauto" type="text" size="50"/> that when type "a" see "atpl" value listed. when type "at" disappears, when type "atp" shows again. have limited jquery exposure , wondered if had suggestions. jquery('#peoplerolecodeauto').icisautocomplete({ source: rolecodes, localjson: true, mustmatch: true, linkedfields: ['peoplerolecode', 'peoplerolecodedescription'], select: function(event, ui){ jquery('#peoplerolecode').val(ui.item.id); jquery('#peoplerolecodedescription').val(ui.item.desc); }, change: function(event, ui){ jquery('#peoplerolecode').val(ui.item.id); jquery('#peoplerolecodedescription').val(ui.item.desc); } }) function icisautocomplete(param

rounding error - Matlab: finding position of last nonzero digit of a number -

i have column vector pp filled numbers, instance: 23.234000 3.1237340 4.4359000 i want find number of places right of decimal smallest nonzero digit in vector occupies, in case 6 , because of 4 in 3.123734 . want multiply every number in vector 10^6, rid of decimals in vector. want eliminate rounding errors. what's best way done? the actual value may different being displayed matlab. instance, consider following example: >> x = 1.4 - [0.1; 0.09999999] x = 1.3000 1.3000 matlab shows both values 1.3, in fact, none of them is: >> x - 1.3 ans = -2.2204e-16 1.0000e-08 my suggestion therefore decide on fixed accuracy (say, 6 digits), , multiply corresponding power of 10.

ruby on rails - Many to Many association with Single table inheritance -

i looking many-to-many association within child models. below. can please guide what's best way it. parent class < activerecord::base end child1 class b < has_many :bc has_many :c ,through: :bc end child2 class c < has_many :bc has_many :b, through: :bc end if don't need columns, use has_and_belongs_to_many can read http://guides.rubyonrails.org/association_basics.html

sql server - Read XML child node attributes using SQL query -

i have 1 xml column (criteria) in table (qualifications) contains different xml: <training id="173"><badge id="10027" /><badge id="10028" /></training> <book category="hobbies , interests" propertyname="c#" categoryid="44" /> <sport category="hobbies , interests" propertyname="cricket" categoryid="46" /> <education id="450" school="jai ambe vidyalaya"></education> i want read "badge" node "id" attributes nodes under "training" node. can help? ids of badge elements inside training only select t.c.value('.', 'int') id qualifications q cross apply q.criteria.nodes('//training[badge]/badge[@id]/@id') t(c) ids of badge elements anywhere (not inside training ) select t.c.value('.', 'int') id qualifications q cross apply q.criteria.n

Remove a programatically added <li> tag using jQuery -

good day, i have been struggling particular piece of code while now. have read , have tried jquery stackoverflow. main problem answers (well find) address generated html or static pages. my delete code (below), both commented , uncommented, works on page created static html list. $(function () { //$(".deletebutton").click(function () { // //$(this).closest("li").remove(); // jquery(this).closest('li').fadeout(400, function () { $(this).remove(); }); //}); $('.deletebutton').on({ click: function () { jquery(this).closest('li').fadeout(400, function () { $(this).remove(); }); } }); }); however use jquery add "li" tag, delete button deletes text within delete button leaving "li" on page. here code use add "li" function updatepage() { $.ajax({ type: 'get', url: "newadditions", contenttype: "application/json&

autocomplete - Twitter Bootstrap Typeahead only populating letter "a" -

so i'm trying populate list of countries using bootstrap typeahead. want person start typing in text field country live in , show options choose from. initially, had data-source set variable huge array of countries strings. getting 1 singular "a" show when type in "a" itself. literally letter a. then changed source directly hold array , array held inside of 2 single quotes. when hit key comes results, literally when put "a" text box, result is: a a a a a or sort... weird. here code: in jsp here portion inside of "head": <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>disti tool wireframe</title> <script type="text/javascript" src="${pagecontext.request.contextpath}/js/disti.js"></script> <link rel="stylesheet" href="${pagecontext.request.contextpath}/css/style.css" /> <

tornadoweb Access-Control-Allow-Origin jquery POST -

Image
i want enable cors request via jquery using post request handler. below tornado request , jquery class basehandler(tornado.web.requesthandler): def set_default_headers(self): self.set_header('access-control-allow-origin', '*') self.set_header('access-control-allow-methods', 'post, get, options') self.set_header('access-control-max-age', 1000) #self.set_header('access-control-allow-headers', 'origin, x-csrftoken, content-type, accept') self.set_header('access-control-allow-headers', '*') self.set_header('content-type', 'application/json') but after calling: $.ajax({ type: 'post', url: _url, /* beforesend : function(x) { if (x && x.overridemimetype) x.overridemimetype("application/j-son;charset=utf-8"); },*/

php - call function from multiple options -

i using php call database print 3 different dropdown menus. works. problem calling function , passing dropdown selections function , displaying records after submit button pressed. function build query taking account if 1 of dropwdowns selected or 3. the function in same page the form. here form: <form action="edit.php" method="post"> <select> <?php $getgroup = mysql_query("select distinct resgroup restable order resgroup"); while($viewallgroups = mysql_fetch_array($getgroup)){ ?> <option id="<?php echo $viewallgroups['resgroup']; ?>"><?php echo $viewallgroups['resgroup']; ?></option><?php } ?> </select> <select> <?php $gettype = mysql_query("select distinct restype restable order restype"); while($viewalltypes = mysql_fetch_array($gettype)){ ?> <option id="<?php echo

c# - Async/Await with a WinForms ProgressBar -

i've gotten type of thing working in past backgroundworker, want use new async/await approach of .net 4.5. may barking wrong tree. please advise. goal : create component long-running work , show modal form progress bar it's doing work. component handle window block interaction while it's executing long-running work. status : see code below. thought doing until tried interacting windows. if leave things alone (i.e. don't touch!), runs "perfectly", if click on either window program hangs after long-running work ends. actual interactions (dragging) ignored though ui thread blocked. questions : can code fixed easily? if so, how? or, should using different approach (e.g. backgroundworker)? code (form1 standard form progressbar , public method, updateprogress, sets progressbar's value): using system; using system.diagnostics; using system.threading; using system.threading.tasks; using system.windows.forms; namespace consoleapplication1 { class pr

getelementsbyclassname - getelementbyclassname instead of getelementbyid is not working -

i have read many times can getelementsbyclassname. below works fine if replace classname id, using word classname not work. know why? (i tried on chrome , firefox) <script type="text/javascript"> function makedisable(){ var x=document.getelementsbyclassname("myselect"); x.disabled=true } function makeenable(){ var x=document.getelementsbyclassname("myselect"); x.disabled=false } </script> <form> <select class="myselect" id="myselect"> <option>apple</option> <option>banana</option> <option>orange</option> </select> <input type="button" onclick="makedisable()" value="disable list"> <input type="button" onclick="makeenable()" value="enable list"> </fo

asp.net - View all data from a GROUP BY statement -

i demonstrate simple example of issue instead of viewing long sql query project. my example like: select deliveryaddressid, pickupdate, totalweight, count(deliveryaddressid) packages deliverydb date1 >= '10-12-2013' , date2 <= '15-12-2013' group pickupdate, deliveryaddressid my result like: http://prntscr.com/1iksoe what want achieve deliveryaddressid 4 packages still keep total numbers. this. what want expected result: http://prntscr.com/1iksr7 the reason want because in way able track barcode each package , able track more details. cheers :-) in databases, can using window functions: select deliveryaddressid, pickupdate, totalweight, count(deliveryaddressid) on (partition pickupdate, deliveryaddressid) packages deliverydb date1 >= '10-12-2013' , date2 <= '15-12-2013'; this return total on 4 lines. edit: you can handle totalweight (which not part of original question) same way: select deliver

oracle - SQL: Concatenate sequential integer values -

i have column this: id -------- 1 2 3 4 5 7 10 and want following resultset: id -------- 1-5 7 10 is there way achieve (oracle) sql only? yes: select (case when min(id) < max(id) cast(min(id) varchar2(255)) || '-' || cast(max(id) varchar2(255)) else cast(min(id) varchar2(255)) end) (select id, id - rownum grp t order id ) t group grp order min(id); here sql fiddle demonstrating it. the idea behind query subtracting rownum sequence of numbers results in constant. can use constant grouping.

java socket file transfer output path -

i'm working on java project transfers files between server , client , i've managed send file desired output location, problem have include full file name in output path save successfully. program runs in way: first gets path of file transferred input console, , gets output path, again input console. here codes of corresponding file name import , exports(i think problem somewhere here , posting part sufficed) server side .... string in_filepath = null; system.out.print("enter file name: "); in_filepath = sc.nextline(); file myfile = new file( in_filepath ); system.out.println("the file chosen being sent..."); byte[] mybytearray = new byte[(int) myfile.length()]; fileinputstream fis = null; try { fis = new fileinputstream(myfile); sc.close(); } catch (filenotfoundexception ex) { ex.printstacktrace(); } client side ..... int buffersize = clientsocket.getreceivebuffersize(

Creating an Oracle Stored Procedure and Executing it from .sql file -

i have 2 .sql files both oracle stored procedures both take in input parameters. first connect remote oracle database using sqlplus in command line , want first use both files create respective stored procedures see them under procedures connection in oracle sql developer. after have 2 more .sql files , designed take input parameters , execute stored procedures. 1 of files meant execute stored procedure "report". declare name varchar2(200); version varchar2(200); startdate date; enddate date; begin name := '&1'; version := '&2'; startdate := '&3'; enddate := '&4'; exec report(name, version, startdate, enddate); exception when others raise_application_error(-20101,sqlerrm); end; / in command prompt first try create stored procedure in database by: c:\users\desktop>sqlplus username/password @report_setup.sql when try output empty lines numbered , beginning @ number 1

c# - RavenDB DocumentStore in Class Library -

i following tutorial on how use ravendb asp.net, , says put creation of document store in global.asax, created once on application load. i wanted make asp.net application can use database, had planned move data access layer class library. problem don't know how should access ravendb. i know can't create new instance each time, how it? realise can pass in instance of ravendb, doing mean ravendb still within application itself, had hoped avoid. any suggestions? you have reference ravendb class library, can't go around that. may find following article insightful, though: http://novuscraft.com/blog/ravendb-and-the-repository-pattern

c# - Can not add a new reference from an new project in my solution -

i did thousand time doesn't work. added new project current solution. added reference new project existing one. error when trying build: error 2 type or namespace name 'accessclass' not found (are missing using directive or assembly reference?) i tried different things, cleanup solution, rebuild, etc. without success. solution under source control (tfs). should not problem, isn't it?? any suggestions solve issue? thanks, tro check on configuration manager of solution in vs2012. might not building new project in case there no dll or exe reference.

swing - java GUI trying to get multiple inputs from multiple text fields -

how multiple inputs multiple textfields have created? want 1 text field port number, file location. once user enter int , string, can use these inputs program. i new this, when tried implement this, enter port number, , ui seems "freeze" , can't enter file location. constructor frame public tcpservercomparecsv () { setlayout(new flowlayout()); // "this" frame sets layout flowlayout, arranges components // left-to-right, , flow next row top-to-bottom. lblport = new label("port"); // construct label add(lblport); // "this" frame adds label tfport = new textfield("0", 10); // construct textfield tfport.seteditable(true); //edit text add(tfport); // "this" frame adds tfcount tfport.addactionlistener(this); // event-handling lbllocation = new label("csv file location");

Android Google Drive Integration Not Working For Some Users -

we have android app integrating google drive upload , download files google drive. able upload files , download files successfully. , tested in different phones/tablets 2.3.x, 3.1.x, 4.1.x , 4.2.x. think configuration , setup may ok. users (we know of them use 4.1.x , 4.2.x) keep getting following error. cannot figure out problem is. please help. 07-30 20:45:00.467: w/system.err(24622): com.google.api.client.googleapis.json.googlejsonresponseexception: 403 forbidden 07-30 20:45:00.467: w/system.err(24622): { 07-30 20:45:00.467: w/system.err(24622): "code": 403, 07-30 20:45:00.467: w/system.err(24622): "errors": [ 07-30 20:45:00.467: w/system.err(24622): { 07-30 20:45:00.467: w/system.err(24622): "domain": "usagelimits", 07-30 20:45:00.467: w/system.err(24622): "message": "access not configured", 07-30 20:45:00.467: w/system.err(24622): "reason": "accessnotconfigured" 07-30 20

java - How to close input stream of FTP inbound endpoint in Mule when streaming is used -

i have simple configuration copies file ftp server file outbound. using streaming file transfer because of huge file sizes. config: <ftp:connector name="ftpconnector" streaming="true" pollingfrequency="360000"/> <flow name="copyftptofile"> <ftp:inbound-endpoint name="ftp" connector-ref="ftpconnector" host="ftp" port="21" user="test" password="test" path="/testenv" /> <file:outbound-endpoint path="/vendor/in" /> </flow> i not sure how close input-stream files deleted ftp server once copied. since payload inputstream , following code of file outbound endpoint dispatcher executed: inputstream = event.transformmessage(datatypefactory.create(inputstream.class)); ioutils.copylarge(is, fos); is.close(); so stream should automatically closed you.

php - Laravel 4 Validation - Nested Indexed Arrays? -

i have array of various things... $foo = []; $foo['stuff']['item'][0]['title' => 'flying_lotus']; $foo['stuff']['item'][1]['title' => 'various_cheeses']; $foo['stuff']['item'][2]['title' => 'the_career_of_vanilla_ice']; $foo['stuff']['item'][3]['title' => 'welsh_cats']; how validate 'title' key, using validator method in laravel 4? here's have far... $validator = validator::make($foo, ['stuff.item.???.title' => 'required']); i'm totally flummoxed indexed array. great . the following answer laravel <= 5.1. laravel 5.2 introduced built-in array validation . at time, validator class isn't meant iterate on array data. while can traverse through nested array find specific value, expects value single (typically string ) value. the way see it, have few options: 1: create rules array

docusignapi - SOAP API- This Account lacks sufficient permissions -

i getting below error while accessing docusign soap service using soap ui tool. tried using integration key in username [integration key]userguid format got same exception. can please me resolve issue. ok i've found out option is, , have enabled option on account. should able export authoritative copies account now. reference sake, option enabled member setting called can export authoritative copies? please note, though, since setting have enable on docusign's side, means might enterprise or workgroup level feature. on demo account enable whatever can test things out, when ready move production , purchase corresponding production account uses api, you'll need make sure purchase account allows feature. can find out more account manager.

amazon web services - Access a second EC2 instance in AWS VPC -

i've been looking around, haven't been able find much. seems assume i'm trying access single ec2 instance under vpc. the scenario: have 1 ec2 medium under vpc hosting several websites (running windows), , need launch linux ec2 under same vpc run forum 1 of sites. it's going run @ domain.com/forum domain.com hosted on windows server. i'm going try using reverse proxy in iis forum, need access first. nat instance i'm looking for? any ideas? you don't need nat. need nat if had 1 server in public subnet, , other servers behind private subnet. have 1 server serving websites, can assume have vpc either public subnet or public subnet + private subnet. for more info, see http://docs.aws.amazon.com/amazonvpc/latest/userguide/vpc_nat_instance.html anyway, launch linux instance , make sure configure httpd (apache virtualhost or nginx location) respond requests addressed domain subfolder correctly.

ios - drawing over a view shades the view? -

Image
i creating custom view display month , date, , looks like: however, want add small triangle point down beneath blue month label on top. added following code in drawrect - (void)drawrect:(cgrect)rect { [super drawrect:rect]; cgcontextref context = uigraphicsgetcurrentcontext(); cgcontextbeginpath(context); cgcontextmovetopoint(context, 30 - 5.0, 20); cgcontextaddlinetopoint(context, 30 + 5.0, 20); cgcontextaddlinetopoint(context, 30, 20 + 4.0); cgcontextaddlinetopoint(context, 30 - 5.0, 20); cgcontextsetrgbfillcolor(context, 0, 118/255.0, 166/255.0, 1.0); cgcontextfillpath(context); } this drawing on white date label add small triangle custom view, , work. has unexpected side effect of shading date label itself. effect following: also if zoom in image can see round corners filled in black color. looks layer properties messed maybe? happening? thank much!

php - Set Select query results as array -

i have query returns array, how output array thomas, james. want store in format within variable can call later. foreach? thanks $stmt = $conn->prepare("select admin_name adminuser_tbl"); if ($stmt->execute()) { while ($row = $stmt->fetch()) { print_r($row); } } this outputs: array ( [admin_name] => thomas [0] => thomas ) array ( [admin_name] => james [0] => james ) instead of print_r($row); how about... $name = join(", ", $row); or concatenate results array of names $stmt = $conn->prepare("select admin_name adminuser_tbl"); $names = array(); if ($stmt->execute()) { while ($row = $stmt->fetch()) { $names[] = join(", ", $row); } }

extjs - List items are not shown because of undefined height -

i have list item populated store. once store loads, list not seem resize proper height. height in fact zero. guys have recommendations on having list re-calculate height after loading store? my view: xtype: 'fieldset', cls: 'damage-list-fieldset', margin: '', itemid: 'damagefieldset', flex: 1, layout: { type: 'fit' }, items: [ { xtype: 'list', action: 'shownotes', cls: 'damage-list', itemcls: 'x-list-item-label', itemid: 'damagelist', disableselection: true, height: 'auto', emptytext: 'no damage has been reported', itemtpl: [ '<table border="0&qu

haskell - What does [a] stand for exactly? -

i'm doing exercises "real world haskell". 1 design safe version of init :: [a] -> [a] . i'm supposed start safeinit :: [a] -> maybe [a] this have @ moment. safeinit :: [a] -> maybe [a] safeinit [] = nothing safeinit [a] = if length [a] <= 1 nothing else (take (length [a] -1) [a]) in gchi, when testing safeinit [1,2] error message * exception: ch4exercise.hs:(21,1)-(24,44): non-exhaustive patterns in function safeinit i under impression [a] stands list (of size) of a 's. doing wrong? as type, [a] stand "a list of size of a s". pattern however, [a] stands "a list containing 1 element, shall henceforth known name a ". [a,b] mean "a list containing 2 elements, first of shall known a , second of shall known b " , so. [] , seem know, stands "a list containing 0 elements". this analogous how you'd write list literals expressions. i.e. if write mylist = [] , mylist empty

Javascript .click() not firing in safari -

i have file upload input in application , i'm using link , javascript open dialog. <a class="uploadlink" style="cursor:pointer" onclick="document.getelementbyid('file').click()">open</a> <input type="file" name="file" id="file" style="display:none" onchange="document.getelementbyid('txt').value = this.value"/> my code working in browsers , devices except safari , apple devices. when click link , check link console doesn'teven register error. can suggest solution? since had display:none in safari not not rendered not referenced. have changed code follows. jquery solution <a class="uploadlink" style="cursor:pointer" onclick="$('#file').trigger('click');">open</a> <input type="file" name="file" id="file" style="opacity:0" onchange="document.g

javascript - low cost page transitions -

this question has answer here: how show ajax requests in url? 7 answers i'm relatively new web development odd question. want part of site load new page. significant part doen't need change. load content div. $('#rightdiv').load("about.html"); the downside address doesn't change, believe there solution don't know how. have tried googleing can't find on it. love see both solution , how sollution called (hope know mean). thank time , effort. browsers supporting html5's pushstate let change path: $('#rightdiv').load("about.html", function pushstate(){ if(history && history.pushstate){ history.pushstate('','','about.html'); } });

java - Oval with expression language -

i using oval http://oval.sourceforge.net/ java bean validations , i'm getting exception when using expression language features. my code looks this: @notnull(errorcode = "paymentcard.number.invalid", message = "required", when = "_this.cardtype != null") private string cardnumber; and outcome warning: cannot determine constraint when formula based on annotation $proxy10 java.lang.arrayindexoutofboundsexception: 1 @ net.sf.oval.abstractcheck.setwhen(abstractcheck.java:276) @ net.sf.oval.configuration.annotation.abstractannotationcheck.configure(abstractannotationcheck.java:183) @ net.sf.oval.configuration.annotation.annotationsconfigurer.initializecheck(annotationsconfigurer.java:323) @ net.sf.oval.configuration.annotation.annotationsconfigurer.configurefieldchecks(annotationsconfigurer.java:143) @ net.sf.oval.configuration.annotation.annotationsconfigurer.getclassconfiguration(annotationsconfigurer.java:294) @ org.eclip

Java- double variable issue -

here's simple equations counter.now counts equations 2 variables.it's based on trying many combinations (4 milion or 16 milion) of a , b variables.so code works , counts exact.but since tried change variable b double, things go wrong.i've expected line b=b+0.1 secures setting variable b each 10th time 1.0.but imidiately after start way more decimal numbers appear each b .so use wrong datatype? or should raise variable b different value?(i tried changing variables double).thank suggestions! import java.io.bufferedreader; import java.io.ioexception; import java.io.inputstreamreader; public class buffer{ static int a; static double b; static bufferedreader reader; static string query; static int range; static int result; public static void main(string[] args)throws ioexception{ reader=new bufferedreader(new inputstreamreader(system.in)); system.out.print("choose speed of test(fast or slow):"); query=reader.readline(); if(query.equals(&

java - Get single ScrollableResults row -

i trying extract count(*) matching predicates. every time use createsqlquery , find myself having write code along lines of, // skipped code query q = session.createsqlquery("select count(*) id=1"); scrollable results = q.scroll(); while ( results.next() ) { object[] row = object[] results.get(); // assign string str = row[0]; //set , persist } i have many such queries unioned on single transaction. how single result here? missing something? you can use method instead: object[] row = (object[]) query.uniqueresult(); if query returns more 1 result, method throw exception edit: on top of that, use resulttransformer convert object[] integer . remove need result array , extract it's first entry. see example more info

jsf - Primefaces separator is displayed as a row element in panelgrid -

Image
how use separator tag in primefaces effectively? for following output, separator displayed 1 of element in next row. ideally separator in single row , display other input elements. have attached screen shot of how separator displayed, displayed 5th element in second row. any highly appreciable. jsf code <p:panelgrid columns="4" id="mypanel"> <f:facet name="header"> projects </f:facet> <p:outputlabel value="project: "> <p:inputtext required="true" readonly="true"> </p:inputtext> </p:outputlabel> <p:outputlabel value="project title: " > <p:inputtext readonly="true"> </p:inputtext> </p:outputlabel> <p:outputlabel value="is selected " > <p:selectbooleancheckbox value="" /> </p:outputlabel> <p:outputlabel value="is approved" > <p:selectbooleancheckbox valu

scripting - Bash - output of command seems to be an integer but "[" complains -

i checking see if process on remote server has been killed. code i'm using is: if [ `ssh -t -t -i id_dsa headless@remoteserver.com "ps -auxwww |grep pipeline| wc -l" | sed -e 's/^[ \t]*//'` -lt 3 ] echo "pipeline stopped successfully" exit 0 else echo "pipeline not stopped successfully" exit 1 fi however when execute get: : integer expression expected pipeline not stopped 1 the actual value returned "1" no whitespace. checked by: vim <(ssh -t -t -i id_dsa headless@remoteserver.com "ps -auxwww |grep pipeline| wc -l" | sed -e 's/^[ \t]*//') and ":set list" showed integer , line feed returned value. i'm @ loss here why not working. if output of ssh command integer preceded optional tabs, shouldn't need sed command; shell strip leading and/or trailing whitespace unnecessary before using operand -lt operator. if [ $(ssh -tti id_dsa headless@remoteserver.c

c# - Changing HeaderTemplate in a treeview on IsSelected with multiple hierarchicaldatatemplates for different types -

i have treeview want add 2 different node types to, each type having own hierachicaldatatemplate . have working (code below) what when node in tree selected, want template change node, different template boolnode nodes , different template comparenodes. have found examples using styles , trigger s treeview , nodes share same template. treeview xaml: <treeview name="m_ktest"> <treeview.resources> <hierarchicaldatatemplate datatype="{x:type self:boolnode}" itemssource="{binding children}"> <stackpanel orientation="horizontal"> <textblock text="{binding optext}"/> </stackpanel> </hierarchicaldatatemplate> <hierarchicaldatatemplate datatype="{x:type self:comparenode}"> <stackpanel orientation="horizontal"> <textblock t

MySQL error no. 150 when trying to create foreign key -

i have 2 tables. 1 'subcategory' id auto-incrementing primary key. from second table, 'product_subcategory' want have field category use 'subcategory.id' foreign key. when using alter table product_subcategory add constraint fk_subcategory_product foreign key (subcategory) references subcategory(id); i receive error no. 150. having looked error found this question answer states these conditions can lead error no 150: 1. 2 tables must engine=innodb. (can others: engine=myisam works too) 2. 2 tables must have same charset. 3. pk column(s) in parent table , fk column(s) must same data type. 4. pk column(s) in parent table , fk column(s), if have define collation type, must have same collation type; 5. if there data in foreign key table, fk column value(s) must match values in parent table pk columns. 6. , child table cannot temporary table. so used show table status confirm tables suitable: | name | engine | version | row_forma