Posts

Showing posts from April, 2015

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 .

oracle - Table prompts are not working in OBI Answers 11g when i use union of two queries -

okay, 2 queries same subject area , show results when there no table prompt. drag column table prompt in view, shows data should have resulted if applied join. please help query wrapping have used solve issue, prompts working now.

What is best & Secure timer for online test application in asp.net C# Ajax timer or Jquery Timer? -

i creating new application in asp.net 4.0 contains online test module, , application supposed handle 10-20k students @ time. confusion should use here, should be: secure , don't want kids turn off javascript in browser , unlimited time test. which should not overhead network traffic. which have pause/start function try limits. should fire needed function on server side after time complete (e.g. redirect page via c# function) any , example code appreciated. regards alok sharma fyi: not experienced jquery. if security of timer critical should not rely on javascript code. recommend keep time when test started specific user on both sides, server , client. implement javascript timer periodically synchronizes web server. when user completes test , sends results server should check if timeout elapsed on server side. in additional add logic in order ban possibility open page , start test without javascript enabled.

objective c - How to disable auto refresh in a UITableView? -

i have table view in app, , when press navigation bar button, table iew moved 60px down see view, because want show information background color of table cells. my problem when press button @ first time, table view reloads , can't see other view. this code: - (ibaction)buttonpress:(id)sender { [uiview beginanimations:nil context:null]; [uiview setanimationduration:0.7]; self.tview.frame = cgrectmake(0, 60, self.view.frame.size.width, self.view.frame.size.height); [uiview commitanimations]; self.navigationitem.rightbarbuttonitem.enabled = no; [nstimer scheduledtimerwithtimeinterval:0.7 target:self selector:@selector(hiddenlabel) userinfo:nil repeats:no]; } -(void)hiddenlabel{ if (self.label.hidden){ self.label.hidden = no; [self.label settext:@"info...."]; } else self.label.hidden = yes; } i think problem when move table view i'm not sure. can me? thanks.

Rails get header response for a remote image -

i load in app facebook image of users (and performance load url of picture on db). when user change profile pic url must changed too. how can detect response of external server (e.g. when 404) know must refresh url pictures of user? you use rest-client , execute head request url , check response status.

php - MySQL won't connect to database,nighter create username and password -

hello have problem script won't create , connect database in anyform. here code : <?php $host="fdb4.biz.nf" $username="1373217_users"; $passowrd="1234"; $db_name="1373217_users"; // database name $tbl_name="members"; // table name mysql_connect("$host", "$username", "$passowrd") or die("database not connect"); mysql_select_db("$db_name") or die("database selected not found"); $sql="insert `members` ('user') values ('$_post[username]')"; $username=$_post['username']; $password=$_post['password']; $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $sql="select * $tbl_name username='$myusername' , password='$mypassword'"; $result=mysql_query($sql); $sql="i

deploying android ndk dependencies to maven repositories -

i have android project depends on third party, binary-only jni library. using ant, can drop .so in libs/ , headers in jni/ , done. however, rest of android projects use maven, , able integrate library existing maven-based projects other library (i.e. <dependency /> entry, library automatically downloaded company server). i have tried manually uploading .so files using mvn deploy:deploy-file -dpackaging=so , -dclassifier=armeabi , , uploaded headers in zip , deployed using -dpackaging=har . ndk still fails detect library , headers. my android.mk is local_path := $(call my-dir) include $(clear_vars) local_module := test local_ldlibs := -llog local_shared_libraries := my-dependency local_src_files := test.cpp include $(build_shared_library) and dependency in pom <dependency> <groupid>com.thirdparty.my-dependency</groupid> <artifactid>my-dependency</artifactid> <version>1.0</version> <classifier>armeab

ruby on rails - Include or extend a class/module from a gem (e.g. devise) -

i have written small module lib/encryption/encryption.rb module encryption def self.encrypt(value) ... end def self.decrypt(value) ... end end i want use/access module in these 2 files devise, namely: token_authenticatable.rb authenticatable.rb i have overwritten both of them creating 2 new files , putting them /config/initilaizers (copied original source code within them , modified them) /config/initializers/token_authenticable.rb /config/initializers/authenticatable.rb one file looks instance: require 'devise/strategies/token_authenticatable' require './lib/encryption/encryption.rb' #tried this, not work module devise module models # tokenauthenticatable module responsible generating authentication token , # validating authenticity of same while signing in. ... my modifications work, how can access lib/encryption.rb module within these files? modification approach best practice? if not, right approach?

properties - Strange C# property definition(indexer) -

how different normal property in c#? public new point3d this[int index] { { return base[index]; } set { base[index] = value; collectionmodified(); } this indexer ; instead of being used obj.foo , used obj[index] , i.e.: var oldval = obj[1]; obj[1] = newval; it "different" because: it has no explicit name it accepts parameter (or parameters) note indexer parameters not have integers; can sorts: dictionary<string, decimal> lookup = ... string employeekey = "000006"; decimal salary = lookup[employeekey];

AngularJS select directive not working with option -

this example seems simple enough, can't seem figure out why not working (i don't want use ng-options because doesn't work select2, plugin want use once figured out): html: <div ng-app="myapp"> <div ng-controller="myctrl"> selectednumber: {{selectednumber}} <select ng-model="selectednumber"> <option ng-repeat="number in numbers" value="{{number}}">{{number}}</option> </select> <div ng-repeat="number in numbers"> {{number}} </div> </div> </div> angularjs: var app = angular.module('myapp', []); app.controller('myctrl', function($scope) { $scope.numbers = [1, 2]; $scope.selectednumber = 2; }); when inspect element looks this: <select ng-model="selectednumber" class="ng-pristine ng-valid"> <option value="? numbe

html - Getting non-existing ids of textarea on each function of javascript? -

i have created user form dynamically in input , textarea controls getting created dynamically. here in below code, trying fetch ids of input , textarea of particular form , in case of input, getting right values getting wrong values textarea. $('#detailcontact input, textarea').each(function() { arr[i++] = this.id; }); only 1 textarea on form, function returns multiple non-existing ids of textarea. you need do: $('#detailcontact input, #detailcontact textarea').each(function() { arr[i++] = this.id; }); or use .find instead. $('#detailcontact').find('input,textarea').each(function() { arr[i++] = this.id; }); you with: $('input,textarea', '#detailcontact').each(function() { arr[i++] = this.id; });

Ruby: Getting salesforce oauth_token -

i have client_id , client_secret authenticate, need oauth_token . how token using ruby on rails? tried few option not work out. gem used : databasedotcom i tried below option not responding https://gist.github.com/undees/300175 require 'oauth' consumer_key = '...' # salesforce consumer_secret = '...' # salesforce oauth_options = { :site => 'https://login.salesforce.com', :scheme => :body, :request_token_path => '/_nc_external/system/security/oauth/requesttokenhandler', :authorize_path => '/setup/secur/remoteaccessauthorizationpage.apexp', :access_token_path => '/_nc_external/system/security/oauth/accesstokenhandler', } consumer = oauth::consumer.new consumer_key, consumer_secret, oauth_options # consumer.http.set_debug_output stderr # if you're curious request = consumer.get_request_token authorize_url = request.authorize_url :oauth_consumer_key => consum

c# - How to determine inherited class in an array of type? -

say have these class: class animal; class tiger: animal; class bear: animal; class giraffe: animal; and array: animal[] p = [new tiger(), new bear(), giraffe()] how determine that: (p[0] tiger) i got message p[0] animal, not tiger have tryed ? p[0].gettype() == typeof(tiger)

php - Passing formatted HTML code from SQL database to HTML page -

i have sql database passing data html page using method link here : downloadurl("phpsqlajax_genxml.php", function(data) { var xml = data.responsexml; var markers = xml.documentelement.getelementsbytagname("marker"); (var = 0; < markers.length; i++) { var name = markers[i].getattribute("name"); var address = markers[i].getattribute("address"); var type = markers[i].getattribute("type"); var point = new google.maps.latlng( parsefloat(markers[i].getattribute("lat")), parsefloat(markers[i].getattribute("lng"))); var html = "<b>" + name + "</b> <br/>" + address; var icon = customicons[type] || {}; var marker = new google.maps.marker({ map: map, position: point, icon: icon.icon, shadow: icon.shadow }); bindinfowindow(marker, map, infowindow, html); }`enter code here` }); editing html in part

c# - IIS server won't load web application -

i have web application in iis , locate in : c:\inetpub\wwwroot\blabla\test\web.aspx and have domain , browse web page this: www.mydomain.com/test/web.aspx and want able connect page without domain too: http://123.123.8.78/blabla/test/web.aspx when browse domain page when try ip address get: server error in '/' application. parser error description: error occurred during parsing of resource required service request. please review following specific parse error details , modify source file appropriately. parser error message: not load type 'app.web'. source error: line 1: <%@ page language="c#" autoeventwireup="true" codebehind="web.aspx.cs" inherits="app.web" %> source file: /blabla/test/web.aspx line: 1 any idea why can't page? blabla directory website pointed at, why /test/web.aspx works. need install virtual directory point @ blabla on default web site in order second url reques

python - Replacing Selections of HTML via the Command-Line -

edit: know how this. i'm not looking solution, i'm looking process or existing program recommendation before take time write myself in scripting language. i have html files in various directories have similar structure: <html> <head>...</head> <body> <nav>...</nav> <section>...</section> </body> </html> i'd programmatically replace html sections other sections (e.g. replace <nav> block different nav block [specified in file of choosing]) files specify. i think ideal solution sort of tool using lxml or similar in python, if there easy way *nixy tools, or existing program this, i'd happy instead of putting script. you might able use beautifulsoup python so. import beautifulsoup soup = beautifulsoup.beautifulsoup(htmldata) nav = soup.find("nav") nav.name = "new name" for example: import beautifulsoup html_data = "<nav>

c++ - Derived Class Constructor Syntax Wt -

hello fellow c++programmers, today tinkering around excellent wt framework wt - c++ library developing web applications: http://www.webtoolkit.eu/wt . slowly steadily i'm making progress. 1 thing made me curious (i'm pretty new c++) following expression in constructor of class derived basic wt::wcontainerwidget class: class foowidget : public wt::wcontainerwidget { public: foowidget(wt::wcontainerwidget *parent = 0); ... private: ... }; foowidget::foowidget(wt::wcontainerwidget *parent = 0) : wt::wcontainerwidget(parent) { ... }; note: in wt widgets placed in hierarchical tree optional parent argument specifies widget contain our "newborn" widget. what happening in ": wt::wcontainerwidget(parent)" part? know expressions behind ":" in constructor used initialize member variables doesn't seem make sense here because it's class name, not name of member ... missing important? many in advance , regards, julian

asp.net - How can i return value from Gridview-RowDataBound to use it in link. C# -

im trying delete gridview row on button click. want save clicked row's id variable. , use variable in hyperlink. here rowdatabound code protected void gridview1_rowdatabound(object sender, gridviewroweventargs e) { if (e.row.rowtype == datacontrolrowtype.datarow) { e.row.attributes.add("onmouseover", "this.style.cursor='pointer';this.style.backgroundcolor='yellow'"); e.row.rowindex.tostring())); string id = databinder.eval(e.row.dataitem, "productionorderid").tostring(); // somthing // return id ; } } here hyperlink need id of selected row <asp:hyperlink runat="server" navigateurl="~/producter/delete?id= id" id="hyperlink1"> delete</asp:hyperlink> firstly: add reference jquery head section of master page <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> secondly: add

Convert Java Number to BigDecimal : best way -

i looking best way convert number bigdecimal. is enough? number number; bigdecimal big = new bigdecimal(number.tostring()); can lose precision tostring() method ? this fine, remember using constructor of bigdecimal declare value can dangerous when it's not of type string. consider below... bigdecimal valdouble = new bigdecimal(0.35); system.out.println(valdouble); this not print 0.35, infact be... 0.34999999999999997779553950749686919152736663818359375 i'd solution safest because of that.

asp.net - Add external template to visual studio project -

i create project in visual studio , want add external template on how can add ? thanks for template of project, see msdn article . item templates, see msdn article . later, create configuration files defined in article, zip them up, create template @ following path: c:\users[username]\documents\visual studio 2010\templates\itemtemplates[language] replace bracketed items name , development language (visual c#, visual basic, etc.) have restart visual studio see it.

jsf 2 - JSF h:commandLink JavaScript error -

i using jsf 2.0 tag <h:commandlink> , i'm trying open window target _blank . in target trying populate document fetched server. while doing getting error in jsf.js (function name jsfcljs ) @ f.submit() . declaration follows: <h:commandlink id="viewdocument" value="#{template.orderbean.documentbean.documentname}" action="#{template.viewcustomdocument}" target="_blank" styleclass="textbold"> <f:param name="documentid" value="#{template.orderbean.documentbean.documentid}"/> </h:commandlink> the error got object doesn't support property. if use <h:commandbutton> instead able call server , fetch document. what can problem cause be?

qt - I need to connect a ComponetA Signal to a method of another ComponentB -

i need create componentc dynamically when button of componenta clicked , componentc must created in componentb not accessible through id componenta . so how realisable qml ? thanks. a signal can return object returned called slot: int b::slot() { return 12; } void a::test() { connect( this, signal(sig()), objectb, slot(slot()); int = emit sig(); // should equal 12 } but, don't know if it's expected behavior...

db2 - use sql to delete a person from a list with a conflicting field -

hi have table asks person yes/no answer, have said both yes , no i.e.: person--------------status 1-------------------yes 2-------------------yes 3-------------------yes 3-------------------no 4-------------------no 5-------------------yes 5-------------------no where persons 3 , 5 have 2 rows, 1 'yes' , 1 'no'. what want find people both answers, , delete row line says 'no'. end with: person--------------status 1-------------------yes 2-------------------yes 3-------------------yes 4-------------------no 5-------------------yes my logic failing me , can get: delete table status = 'no' , person in (select person table status = 'yes') but of course deletes both types. anyone have suggestions? the expression and where not sql. try this: delete table status = 'no' , person in (select person table status = 'yes') the logic looks correct me.

django - Celery Task the difference between these two tasks below -

what's difference between these 2 tasks below? the first 1 gives error, second 1 runs fine. both same, accept arguments , both called in same way. processrequests.delay(batch) **error object.__new__() takes no parameters** sendmessage.delay(message.pk, self.pk) **works!!!!** now, have been made aware of error means, confusion why 1 works , not other. tasks... 1) class processrequests(task): name = "request process" max_retries = 1 default_retry_delay = 3 def run(self, batch): #do 2) class sendmessage(task): name = "sending sms" max_retries = 10 default_retry_delay = 3 def run(self, message_id, gateway_id=none, **kwargs): #do full task code.... from celery.task import task celery.decorators import task import logging sms.models import message, gateway, batch contacts.models import contact accounts.models import transaction, account class sendmessage(task): name = "sending

javascript - Onmouseover cursor doesn't change in IE -

this js code: <script type="text/javascript"> function leftcur(elem) { elem.style.cursor = 'url("izgled/slike/right.png"), auto'; }; </script> and part of html code: <div class="mainleft" onmouseover="leftcur(this)"> when hover mouse on div, mouse pointer changes picture, works in chrome , ff doesn't in ie. thx. at least versions of internet explorer not support .png or .gif cursors. mdn has great reference here try using .cur cursor instead.

java - String.split() at a meta character + -

i'm making simple program deal equations string input of equation when run it, however, exception because of trying replace " +" " +" can split string @ spaces. how should go using the string replaceall method replace these special characters? below code exception in thread "main" java.util.regex.patternsyntaxexception: dangling meta character '+' near index 0 + ^ public static void parse(string x){ string z = "x^2+2=2x-1"; string[] lrside = z.split("=",4); system.out.println("left side: " + lrside[0] + " / right side: " + lrside[1]); string rightside = lrside[0]; string leftside = lrside[1]; rightside.replaceall("-", " -"); rightside.replaceall("+", " +"); leftside.replaceall("-", " -"); leftside.replaceall("+", " +"); list<string> rightt = arr

xml - Junit Ant Test report -

i'm using junit ant generate test report default junit-noframes format. since i'm testing several different classes in same package i'd see statistics on test results each class. in addition, i'd separate successfull tests in report. i've examinated xslt file, may allows me partially solve first problem. still in xml test report generated junit successfull cases regrouped. how can affect this? possible change way junit stocks informations in xml testresult? these datas concerning individual tests must somewhere, since i'm able see them junit plugin in eclipse.

vb.net - View PDF file without Acrobat Reader installed -

is possible view pdf file in vb.net without having acrobat reader installed? if yes, how? i haven't tested myself, this discussion should have many answers you. there many ways included in link show pdf answer question: "how can create own pdf viewer?". also, main problems might face during development handled, too. the 2 answers got there are: 1- try line: system.diagnostics.process.start("d:\test.pdf"); 2- using browser widget, explained briefly in link . that, should write line alongside others: mywebbrowser.navigate("d:\test.pdf")

doctrine2 - Multiple identity properties for authentication in ZF2 with Doctrine 2 -

i have login form input text fields: group name user name user password i have 2 tables groups id name users id name group_id i have mapping entities , associations. but user name not unique within table users , because different groups can include users equal names. therefore need: find group name in table groups find user name in table users condition where group_id=<group_id> how correctly in zend framework 2 using doctrine 2? official documentation , examples depict situation, identity property single column ( example ). sorry bad language. thanks. instead of making own implementation of doctrine's authentication services decide implement via form validation inside isvalid() method of authentication form. example: <?php namespace my\form\namespace; use zend\form\form; use zend\servicemanager\servicelocatorinterface; use zend\inputfilter\inputfilterproviderinterface; class auth extends form implement inputfilterp

java ee - How to access JNDI data source defined in weblogic 10.3.6 -

i have created jndi data-source using weblogic console not able access object web application. below details in weblogic 10.3.6, have given jndi name datasource : jdbc/mydb to db connection web application have written code in web application: context initcontext = new initialcontext(); datasource ds = (datasource)initcontext.lookup("java:/comp/env/jdbc/mydb"); jndiconnection = ds.getconnection(); earlier using tomcat server , able db connection when configured resource details in file tomcat/conf/server.xml , when using started using weblogic server getting below error: cannot establish db connection jndi:java:/comp/env/jdbc/mydb while trying /comp/env/jdbc/mydb in /app/webapp/sample.war/1811641702. caused by: javax.naming.namenotfoundexception: while trying /comp/env/jdbc/mydb in /app/webapp/sample.war/1811641702.; remaining name '/comp/env/jdbc/mydb' i have tried options mentioned in link : how lookup jndi resources on weblogic? still facing probl

Change height to odd rows using CSS & jQuery -

i have table 3 columns. second column needs have no styling. that, every other row needs no styling , height of 20px. i'd directly jquery. in jsfiddle example 2nd row height height want alternate rows (20px), can't without setting class height 0px , applying class directly tags. can please help? (i hope i'm being clear). thanks! my example in jsfiddle here. [http://jsfiddle.net/squirc77/g6gkq/] first off don't need add height styling rows interfere jquery styling rid of height: 85px; in #tbl_notice td { border: 1px solid #f2f2f2; width: 400px; height: 85px; vertical-align:middle; background: transparent url(images/fieldsetbglg.png) repeat-x; } you don't need line. #tbl_notice tr td.oddrow{height:0px;} just make sure rid of no break spaces (nbsp; in odd rows , in middle column prevents making rows , columns whatever height , width wish. after these changes jquery code should work fine. here jsfiddle changes made.

python - Avoiding reading out the blob -

i trying use data blob process data , send via email. of receiving following error - guess relates size of blob read memory, since happens bigger blobs: traceback (most recent call last): file "/python27_runtime/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1535, in __call__ rv = self.handle_exception(request, response, e) file "/python27_runtime/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1529, in __call__ rv = self.router.dispatch(request, response) file "/python27_runtime/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher return route.handler_adapter(request, response) file "/python27_runtime/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1102, in __call__ return handler.dispatch() file "/python27_runtime/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 572, in dispatch return self.handle_exception(e,

c# - The request was aborted: Could not create SSL/TLS secure channel Exception -

let me explain situation. i created self-signed certificate , installed in trusted root certification authorities section in mmc. i created 2 certificates using self-signed certificate: a certificate subject name "localhost" a certificate subject name "test.com" i installed both certificates personal certificates section in mmc. i deployed web service https (ssl accept client certificates) in iis. certificate used deploy web service 1 subject name "localhost". now, have client wants connect web service. added web reference service. code: clientservices web_service = new clientservices(); x509store store = new x509store(storename.my, storelocation.localmachine); store.open(openflags.readonly); x509certificate2collection col = store.certificates.find(x509findtype.findbysubjectname, "test.com", true); if (col.count == 1) { servicepointm

part of jQuery script doesn't run in Drupal 6.28 -

i wrote small jquery script runs in drupal site. site running jquery 1.7.1. works fine in jsfiddle, when run in drupal, part of script doesn't work. not sure if drupal thing or if have wrong code? this self-tests on educational site. content arranged in slide toggles on page. inside of slide toggles these self tests. don't write database, they're user. the objective here make self tests reset when slide toggle closed. here's jquery: $("h2.titletrigger").click(function(e){ e.preventdefault(); //toggle open/close drawer $(this).toggleclass("active").next().slidetoggle("fast"); //undo self test $('.selftestwrong').removeclass('answershown'); $('input:radio').prop('checked', false); $('.selftestanswer').slideup(300); return false; }); //self test $('input:radio').bind('change',function(e){ e.preventdefault(); var parentid = $(this).parents('.selftest').attr('id

java - Why to keep interface as reference? -

this question has answer here: type list vs type arraylist in java 14 answers i have observed in java programming language, code following: list mylist = new arraylist(); why should not use following instead of above one? arraylist mylist = new arraylist(); just avoid tight coupling . should in theory never tie implementation details, because might change, opposite interface contract, supposed stable. also, simplifies testing. you view interface overall contract implementing classes must obey . instead, implementation-specific details may vary, how data represented internally, accessed, etc. - information you'd never want rely on.

logging - Additional info for error TF26212: Team Foundation Server could not save your changes -

is there logging in tfs, explain in more detail, happened? microsoft.teamfoundation.workitemtracking.client.serverrejectedchangesexception: tf26212: team foundation server not save changes. there may problems work item type definition, or conflicting work item type definition change may require refresh on client. restart client applicationand try again, or contact team foundation server administrator. ---> system.web.services.protocols.soapexception: tf237165: team foundation not update work item because of validation error on server. may happen because work item type has been modified or destroyed, or not have permission update work item. @ microsoft.teamfoundation.workitemtracking.proxy.retryhandler.handlesoapexception(soapexception se) @ microsoft.teamfoundation.workitemtracking.proxy.workitemserver.update(string requestid, xmlelement package, xmlelement& result, metadatatablehaveentry[] metadatahave, string& dbstamp, imetadatarowsets& metadata) @ micros

delphi - TBitmap to TPngImage and Memory usage -

i have array of 11 white tbitmaps (32-bit 512x512 pixles = 1 mb) , want assign them tpngimage array reduce memory usage, expect 1 mb white bitmap become 1.76 kb png , memory usage drop dramatically monitored task manager , difference 0.824 mb why that? , best/fast way lossless compress tbitmaps in memory? := 0 10 begin bitmaps[i] := tbitmap.create; bitmaps[i].pixelformat := pf32bit; bitmaps[i].canvas.pen.color := clwhite; bitmaps[i].setsize(512,512); bitmaps[i].canvas.rectangle(0,0,512,512); end; for := 0 10 begin pngs[i] := tpngimage.create; pngs[i].assign(bitmaps[i]); bitmaps[i].free; end; update form @bummi research think best thing save pngs in memory stream array, makes difference 9.7 mb. := 0 10 begin png := tpngimage.create; png.assign(bitmaps[i]); streams[i] := tmemorystream.create; png.savetostream(streams[i]); bitmaps[i].free; png.free; end; when released tbitmap released 2 things: memory fastmm4 delphi heap manager

Wrong python binary virtualenv -

i installed virtualenv , virtualenvwrapper on mac work on django project. my problem when in virtualenv , enter python manage.py runserver, reason python binary used not 1 inside virtualenv. have mac book air os 10.8.3 when enter name_of_virtualenv/bin/python manage.py runserver works fine. when run python : /library/frameworks/python.framework/versions/2.7/bin/python how can change default python 1 ? i did not specify python version in requirements.txt. thanks help you haven't activated environment. either by: source ./bin/activate or virtualenvwrapper: workon <theenvname> note don't need of this. running django with ./bin/python manage.py runserver works fine. don't have activate virtualenv. never do.

javascript - If class other than my class is present -

i have dynamic list looks <li>item 1</li> <ii>item 2</li> <ii class="route2">item 2</li> <ii>item 3</li> <ii>item 4</li> and 2 buttons <button>route one</button> <button>route two</button> i can't work how show route 2 button if list items have route2 class. this should work: if ( $('li').not('.route2').length ){ $('button').hide(); }

eclipse - Getting Subclipse to ignore changes -

is there way tell subclipse ignore changes made particular file? i have config xml file exists in svn need tweak locally machine. 1 file, entire package marked little * icon telling me have changes in project, nuisance. there way tell subclipse version of "yeah, file's supposed out-of-synch repository, don't worry it"? once file versioned, cannot ignored. lot of people use template files, such file named foo.xml.in or foo.tmpl. version control file , use process create foo.xml file template. foo.xml file ignored can change @ will.

opencobol - Call function in COBOL more than once -

i have main calling 2 functions. second function called (decrypt) calls first function (encrypt) inside of it. here encrypt being called twice. once in main, , once inside of decrypt. the issue refuses work way. once encrypt gets used in main, can't use encrypt again anywhere~ in program. variables still in use , can't pass new ones. for example, if remove encrypt main function , call decrypt - works fine. can't figure out why. identification division. program-id. caeser-1-cipher. data division. procedure division call 'encrypt' using content inpute ciphere. call 'decrypt' using content inputd cipherd. stop run. identification division. program-id. encrypt. data division. procedure division blah blah blah blah compute end program encrypt. identification division. program-id. decrypt. data division. procedure division blah blah call 'encrypt' using content blah blah exit program. end program decrypt. i'm not sure follow questi

joomla3.0 - Joomla 3.0 on Gantry - bootstrap - duplicating the mainmenu for phone -

i working on new template using gantry base , need build menu in way handle mobile phone. problem having way modified default.php file in mod_menu in order duplicate menu mobile setup dups other menus in site ie. footer menu. is there way can build out main menu mobile friendly without messing footer menu? here link working example dealing with. notice footer menu acts same way mainmenu whe scale down phone size. http://www.mniac.com/spymaniac30/ <nav class="main <?php echo $class_sfx; ?>"<?php $tag = ''; if ($params->get('tag_id') != null) { $tag = $params->get('tag_id') . ''; echo ' id="' . $tag . '"'; } ?> role="navigation"> <ul> <?php if ($class_sfx === 'nav-list') : ?> <li></li> <li class="nav-header"><?php echo $module->title; ?></li> <?php endif; ?> <?php

jquery - How to reset selected radio buttons when closing slideToggle? -

i have simple slidetoggle setup opens div on page. of divs have self test in them. i'm having trouble figuring out how reset radio buttons when div closed. here jquery: $("h2.titletrigger").click(function(e){ e.preventdefault(); //toggle open/close div $(this).toggleclass("active").next().slidetoggle("fast"); return false; }); //self test $('input:radio').bind('change',function(e){ e.preventdefault(); var parentid = $(this).parents('.selftest').attr('id'); $('#'+parentid+' .selftestwrong').addclass('answershown'); $('#'+parentid+' .selftestanswer').slidedown(300); }); see working here: http://jsfiddle.net/3xbgu/ what best way reset self test it's un-selected state when user closes slidetoggle? you can this: $("h2.titletrigger").click(function (e) { e.preventdefault(); //toggle open/close div $(this).toggleclass("active")