Posts

html - Jquery select by class alternatives -

i have 2 html elements(span , input) represent same user property. in jquery script want select both elements. way found specify different ids , execute 2 queries $("#span\\.firstname") $("#input\\.firstname"). at moment looking solution. want use class attribute (specify class firstname on span , input , perform $(".firstname") ), css aren't ready , don't know classes required, can't use it. know, if exists other solution perform selection, class attribute. <td> <div> <span id="span.firstname">${user.firstname}</span> <span id="span.lastname">${user.lastname}</span> </div> <div> <span>first name</span><input id="input.firstname" value="${user.firstname}"/> <span>last name</span><input id="input.lastname" value="${user.lastname}"/> </div> </td> ...

osx - Python SQLite Wrapper apsw-3.7.16.2 failed to install in mac os x (10.7.5) -

failed install sqlite wrapper. installation helpful. downloaded installed sqlite3.version '2.6.0' please find error log below- sudo python setup.py install test running install running build running build_ext sqlite: using system sqlite include/libraries running install_lib running install_egg_info removing /library/python/2.7/site-packages/apsw-3.7.16.2_r1-py2.7.egg-info writing /library/python/2.7/site-packages/apsw-3.7.16.2_r1-py2.7.egg-info running test traceback (most recent call last): file "setup.py", line 857, in <module> 'win64hackvars': win64hackvars} file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup dist.run_commands() file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/dis...

c# - How to capture logoff cancelled in windows server 2003 -

i'm working on terminal services based system running on windows 2003. consists of desktop replacement application user starts programs. has logoff-button. when user logs off 2 things must happen. first off, logged out of windows. stored procedure called cleaning users database state. works fine, 1 situation, , when user cancels logoff event. typical scenario: 1- user logs in, starts ms word, edits document, not save. 2 - user presses logoff button. 3- ms word reacts asking user save changes. 4 - user presses cancel. at point desktop application might have called stored procedure cleaning database state. how catch behaviour in desktop application? there message saying end session operation cancelled? does question make sense @ all? oh, of applications written in delphi 7, work in c, c++ , c# well, answers in languages appreciated well. if user state logic inside shell replacement think of application redesign: decouple custom shell session management. for e...

Is the toString() method in java.util.Date locale independent? -

try { simpledateformat strtemp = new simpledateformat("ddmmmyy", locale.us); date reasult = strtemp.parse(input); string checkdate = reasult.tostring().substring(8, 10) + reasult.tostring().substring(4, 7) + reasult.tostring().substring(26); if (!checkdate.touppercase().equals(input)) return false; else return true; } catch (exception ex) { return false; } as api tells me java.util.date.tostring() format "dow mon dd hh:mm:ss zzz yyyy", want know if content format of tostring() change while windows locale changed? such "russian","english", suggest input same, checkdate value same? help. date.tostring() locale independent. significant change can ever observe timezone, depends on timezone settings of computer. by design . converts date object string of form: dow mon dd hh:mm:ss zzz yyyy where: dow day of week ...

string - c++ character comparison between a number char and a letter char -

i have string variable named tablolar , in case it's value "tablo2" , according intension can not enter in if statement enters , couldn't find out why. for(int z=0;z<tablolar.size();){ if((tablolar[z]==',')||(tablolar[z]=='a')||(tablolar[z]=='b') ||(tablolar[z]=='c')||(tablolar[z]=='d')||(tablolar[z]=='e') ||(tablolar[z]=='f')||(tablolar[z]=='g')||(tablolar[z]=='h') ||(tablolar[z]=='i')||(tablolar[z]=='j')||(tablolar[z]=='k') ||(tablolar[z]=='l')||(tablolar[z]=='m')||(tablolar[z]=='n') ||(tablolar[z]=='o')||(tablolar[z]=='p')||(tablolar[z]=='q') ||(tablolar[z]=='r')||(tablolar[z]=='s')||(tablolar[z]=='t') ||(tablolar[z]=='u')||(tablolar[z]=='v')||(tablolar[z]=='w') ||(tablolar[z]=='x')||(tablolar[z]=='y')||(tabl...

javascript - submit form inside div, not working with IE8 when submitting with ENTER -

i have form ( login, registration, whatever ) inside div. the div has visibility: hidden , gets visibility:visible through javascript. in ie8 , when user completes form ( username, password ) , uses enter key press submit it, won't work ( work if presses login button ). html: <body onload="show_login();"> <div id="login" class="login_div"> <form id="form_login" method="post" action="index.php"> <input name="email" id="email" type="text" maxlength="100" size="30" /> <input name="password" id="password" type="password" maxlength="100" size="30" /> <input name="fromsubmit" id="fromsubmit" type="hidden" value="fromsubmit"/> <button id="blogin" type="submit"><span id="slogin">log in</span><...

javascript - Angular.JS: views sharing same controller, model data resets when changing view -

i'm getting started angular.js. i have number of views share same controller. each view step in collecting data stored in controller: $routeprovider.when('/', { templateurl: 'partials/text.html', controller: 'itemsubmitter' }); $routeprovider.when('/nextthing', { templateurl: 'partials/nextthing.html', controller: 'itemsubmitter' }); the itemsubmitter controller: $scope.newitem = { text: null } here's first view: <textarea ng-model="newitem.text" placeholder="enter text"></textarea> <p>your text is: {{ newitem.text }}</p> this works, live updating 'your text is:' paragraph. however when next view loaded, {{ newitem.text }} reset default value. how can make values stored in controller instance persist across views? controllers disposed when changing routes. behavior since should not rely on controllers carry data between views. it's be...

ios - Tap outside UICollectionViewCell -

i have uicollectionview series of uicollectionviewcell s in uicollectionviewflowlayout . each cell contains uiimageview that, depending on indexpath bigger cell itself. cell doesn't clip content, can see whole image. but can't make touches outside cell's frame, inside image, act normal touches , fire selection of cell. i tried overriding methods hittest:withevent , pointinside:withevent of uicollectionviewcell makes no change. - (uiview *)hittest:(cgpoint)point withevent:(uievent *)event { if (cgrectcontainspoint(self.imageview.frame, point)) { nslog(@"contains: %d", cellindex); return self; } nslog(@"doesn't contain: %d", cellindex); return [super hittest:point withevent:event]; } - (bool)pointinside:(cgpoint)point withevent:(uievent *)event { if (cgrectcontainspoint(self.imageview.frame, point)) { nslog(@"inside: %d", cellindex); return yes; } nslog(@"...

java - Calling remote ESB client error -

i trying send , esb message remote client, getting error: org.jboss.soa.esb.listeners.message.messagedeliverexception: org.apache.ws.scout.transport.transportexception: java.lang.reflect.invocationtargetexception @ org.jboss.soa.esb.client.serviceinvoker.loadserviceclusterinfo(serviceinvoker.java:545) @ org.jboss.soa.esb.client.serviceinvoker.<init>(serviceinvoker.java:174) @ org.jboss.soa.esb.client.serviceinvoker.<init>(serviceinvoker.java:155) @ org.jboss.soa.esb.client.serviceinvoker.<init>(serviceinvoker.java:197) @ cz.certicon.esb.test.senderesb.sendamessage(senderesb.java:24) @ cz.certicon.esb.test.manager.sendesbmessage(manager.java:94) @ cz.certicon.esb.test.myframe.actionperformed(myframe.java:122) @ javax.swing.abstractbutton.fireactionperformed(unknown source) @ javax.swing.abstractbutton$handler.actionperformed(unknown source) @ javax.swing.defaultbuttonmodel.fireactionperformed(unknown source) @ javax.swi...

How to Rename a jar file from java program ?or any other way from Command promt? -

i working on application downloading jars web server rmtcmark.jar,rmproduct.jar,rmlatency.jar,all rm named jars.these jars getting stored in directory .but these rm named files not workable me, i want file name i.e rm should removed name of file instance if file name rmtcmark.jar ---->tcmark.jar rmproduct.jar---->product.jar,in way is there way out in java rename such jar files? also ,my second question ,there similar files named rtpostmark.jar,rtlatency getting downloaded web server ,all of size 1 kb, i want rt named jars should deleted directory getting stored. if not possible java,cn command promt ?? you can rename file using java refer links below http://www.mkyong.com/java/how-to-rename-file-in-java/ rename file using java the logic should work parse files , if file starting name "rm" new file name, have exclude name rm , create file object suggested in links

javascript - Add selected in option using jquery -

i trying have 1 of values in list selected. have hidden field have match values in option of selection. if finds 1 has selected. this code have.hidden field html code. <input type="hidden" id="supp" name="supp" value="<?php echo $_post['suppliers'];?>" /> my js: <script type="text/javascript"> $(document).ready(function() { var addselected = $('#supp').val(); $("#suppliers option[value='" + addselected + "']").attr("selected","selected"); console.log(addselected); }); </script> the code above not working. here's jsfiddle shows better way this: http://jsfiddle.net/atjvv/ you can call .val on <select> itself.

c++ - How to plot a 3D graph (surfaceplot) from a Mat type of OpenCV using qwtplot3D? -

i have 2d mat data/image using opencv. plot 3d graph it, row x-axis, column y-axis & pixel values on each coordinate(row,column) z-axis. plot graph similar surf function in matlab. tried use bool loadfromdata (double **data, unsigned int columns, unsigned int rows, double minx, double maxx, double miny, double maxy) function program crashed when debugged till line. new in using qwtplot3d & qt4, please me see go wrong. what did copying pixel values array, try make 2d array made of rows , columns , pass loadfromdata below: //abs_outcorr mat type of opencv int rows= abs_outcorr.rows; int columns= abs_outcorr.cols * abs_outcorr.channels(); double frommat[columns*rows]; (int j=0; j<rows; j++) { double* data= abs_outcorr.ptr<double>(j); //access pixel value mat (int i=0; i<columns; i++) { frommat[i] = data[i]; } } double** x = new double * [rows]; for(int i=0; i<columns; i++) x[i] = new double[rows]; for(int i=0; i<rows; i++) for(int j=0; j<columns; j...

sql server - How to order by date when the column is not date formatted? -

the database i'm querying has user table column containing date user registered website. the date entered varchar column without proper date formatting this: apr 18 2013 12:27pm when select max (datecolumn) value half way across range of dates. i've considered using substrings grab year, month, date , order them in sequence. problem dates days starting 0 shortened 1 character this: may 1 2013 12:27pm is there simple way find highest date, without altering database structure? try select max(convert(datetime, datecolumn, 109)) further information on converting between datatypes in sqlserver (including date formats) here .