Posts

Showing posts from January, 2012

How to hide the Delphi compiler messages that aren't related to warnings and hints? -

i using delphi xe4 problem should happens in earlier version of delphi ide. when compile project group contain more 100+ projects, messages window show this: checking project dependencies... building sql.alpha.resource.core.dproj (debug, win32) building sql.alpha.resource.datamap.dproj (debug, win32) building sql.alpha.resource.db.dproj (debug, win32) building sql.alpha.resource.module.dproj (debug, win32) building sql.alpha.resource.styles.dproj (debug, win32) building sql.alpha.resource.images.dproj (debug, win32) building sql.alpha.resource.script.dproj (debug, win32) building sql.alpha.resource.report.fastreport.dproj (debug, win32) building sql.alpha.resource.report.reportbuilder.dproj (debug, win32) building sqlalpha.dproj (debug, win32) [dcc32 hint] sqlalpha.dpr(10): h2164 variable 'k' declared never used in 'sqlalpha' success elapsed time: 00:00:02.0 it getting harder identify hints , warnings windows when list growing. building... messages show when...

iphone - White page when loading while using jQuery Mobile -

we're using jquery mobile 1.3.2 mobile html5 app @ www.tekiki.com . (check iphone, or check www.tekiki.com/dandy/dandy desktop.) upon loading, jqm shows white page between loading screen , first page of app. there settings in jqm repress loading screen? closest found $.mobile.loading() , pertains loading text. want whole white screen vanish, meaning app should go directly loading screen first page. the white screen talking results class declared in jqm css: /*fouc*/ .ui-mobile-rendering > * { visibility: hidden; } the class added when jqm begins initalize // add mobile, initial load "rendering" classes docel $html.addclass( "ui-mobile ui-mobile-rendering" ); and removed on first pageshow . the whole procedure necessary, because otherwise see pre-enhanced markup until jqm done rendering it. if want "remove" it, declare: .ui-mobile-rendering > * { visibility: visible; } but see source code being touched jquery mobile. ...

algorithm - weight sum for path between two nodes in a tree -

you given tree n vertices. every node has integer weight associated it. there huge number of queries(~n^2) on given tree. query (a, b), a, b 2 vertices of tree, need calculate sum of weights of nodes on unique path b, including , b. i can dfs/bfs individual queries going take o(n^3) ~n^2 possible queries.. can suggest better takes less o(n) per query? thanks.. if tree not rooted, make arbitrary node root of tree. we'll denote weight of node x w[x] , sum of weights of nodes root node x c[x]. now let's assume there's query like, u, v : we've find lowest common ancestor of node u , v. let's assume lca of u , v p. result query (u,v) c[u]-c[p]+c[v]-c[p]+w[p]

android - textview separated in each row of listview -

i have 7 textview represents date ex. august 1,august 2,august 3...this 7 textview showed in each row of listview,the problem when click button textview showed in last item of listview. this im trying achieve http://img818.imageshack.us/img818/416/q39d.png listitem0 august 1 listitem1 august 2 .... here code in getview public view getview(int position, view convertview, viewgroup parent) { //august1 calendar mcalendar = new gregoriancalendar(); mcalendar.set(calendar.day_of_week, calendar.monday); simpledateformat mdf = new simpledateformat("dd mmmm"); string fdate = mdf.format(mcalendar.gettime()); //august2 mcalendar.add(calendar.day_of_month, 1); string secdate = mdf.format(mcalendar.gettime()); mcalendar.add(calendar.day_of_month, 1); string tdate = mdf.format(mcalendar.gettime()); mcalendar.add(calendar.day_of_month, 1); string fourthdate = mdf.format(mcalendar.gettime()); layoutinflater inflater...

jsf ajax viewcope reloads whole page -

when perform ajax call with: <h:form id="showentriesform"> <h:commandbutton value="einträge anzeigen" onclick="javascript:this.disabled=true;" id="showentryb"> <f:ajax event="click" execute="@form" render=":main :showentriesbutton" listener="#{bean.showentries}"/> </h:commandbutton> </h:form> it executes @prerender commands again , seems reloads whole page. thought ajax reload parts tell reload? or prerender executed? need else prerender fetch get-variables once when view created? regards @prerender event gets fired before given view gets rendered, means annotated methods should called if of components belonging view need updated. not sure methods do, maybe should try @init annotation.

listview - Needed help to build caml Query with multiple <And> -

i getting query list view view.query got following <query><groupby collapse="true" grouplimit="100"><fieldref name="alertgrp" /></groupby> <orderby><fieldref name="prioritynolink" ascending="false" /><fieldref name="match_time" ascending="false" /></orderby><where><and><and><and> <neq><fieldref name="category" /><value type="text">ach alert</value></neq> <neq><fieldref name="category" /><value type="text">check fraud</value></neq> </and> <isnull><fieldref name="close_x0020_reason" /></isnull></and> <eq><fieldref name="alerttype" /><value type="text">alert</value></eq> </and> </where></query> i want add 1 more condition <g...

How to reuse an instantiated module in verilog with updated inputs -

i have module : module abc( input in1, input in2, output in3 ); instantiating module in main module: abc name_abc(in1, in2, out); now in1 changed based on other signal. understand, instantiation have created block of logic, want use block created different inputs or updated inputs. there way in verilog? what want : abc name_abc(in1_updated, in2, out); inputs continuous time signals. module instantiation not method call executing logic, therefore change in in1 value passed directly instance name_abc . if mean use same module (hardware) being able switch between 2 data streams, imply mux in front of it. wire connect_to_abc_in; assign connect_to_abc_in = (select) ? in1 : in1_alternative ;

html - Is it standard to use Hyperlink(a tag) within label tag? -

is standard use hyperlink(a tag) within label tag ? <label for="contentplaceholder1"><a href="~/address">link text , label name</a></label> it valid have anchor inside label — in html 4.01 html5. you can try out w3c markup validator check if markup valid. whether makes sense question. ok have link alongside non-link-text inside label, label consisting of single link won't great user experience.

android - How to call onItemSelected programaticly? -

after made call of notifydatasetchanged, references onitemselected outofdate. e.g gallery.setonitemselectedlistener(new onitemselectedlistener() { @override public void onitemselected(adapterview<?> parent, view view, int position, long id) { onfront1 = (imageview) view; } @override public void onnothingselected(adapterview<?> arg0) { // todo auto-generated method stub } }); getview public view getview(final int position, view convertview, viewgroup parent) { imview = new imageview(this.mycontext); imview.setlayoutparams(new gallery.layoutparams( layoutparams.fill_parent, layoutparams.fill_parent)); imview.setontouchlistener(new ontouchlistener() { public boolean ontouch(view v, motionevent event) { imageview view = ...

javascript - How to set intersection point of x and y axis -

i using d3.js scatter plot,i want plot x , y axis such intersect @ point(100,75).how this? using svg.append("g") .attr("class", "axis") .attr("transform", "translate(0," + (padding+223) + ")") .call(xaxis2); //create y2 axis svg.append("g") .attr("class", "axis") .attr("transform", "translate(" + (padding+200) + ",0)") .call(yaxis2); but not change according scale,and have used variable scale. please let me know if need more information. you need offset axes respective amount, can determine using scales of axes, i.e. svg.append("g") .attr("class", "axis") .attr("transform", "translate(0," + yscale(75) + ")") .call(xaxis2); and y axis. may have tweak offset account other offsets, labels etc.

jquery - Event listener for mmenu counter -

i using mmenu plugin building app page. (link - http://mmenu.frebsite.nl/ ) on advanced page, ( http://mmenu.frebsite.nl/mmenu-3.0.2/docs/examples/advanced.html ), if add li option work colleagues , hide using inline style display:none , counter still increases one, isn't ideal. is there event listener / events can allow this, programatically updating menus , keep correct count. the plugin count lis (visible or not) not have 1 of these classes: mm-label mm-subtitle mm-noresults mm-noresult the first 3 used plugin visual purposes, fourth (mm-noresult) used hide search results. instead of adding display: none, should add class="mm-noresult". to update counters, trigger "count" custom event: $("#menu em").trigger( "count" ); regards, fred

java - How to stretch a list view to the full screen in Android -

supose have layout oriented vertically 1 button in top, list view in middle, , button in bottom: ------ button listview listview listview ------ i make whole layout scrollable, able see full list when scrolling down it: ------ listview listview listview button ------ i think found it, here's solution you, without using scrollview (which not needed): <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <button android:id="@+id/btn1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="0"/> <listview android:id="@android:id/list1" android:layout_height="0dip" android:layout_width="match_parent" android:layout_weight="1" /> <listview android:i...

javascript - jquery remove based on before content -

is possible write jquery function remove specific :before content. here example statement give show me code: remove elements in document have :before pseudo element content set "delete me" mhh, can try this: var sheets = document.stylesheets; var len = sheets.length; var ba = /:before|:after/; // loop throught stylesheets (var = 0; < len; i++) { // work out method css rules var sheet = sheets[i], rules = sheet.cssrules || sheet.rules; // loop through rules (var r = 0, rule; rule = rules[r++];) { // if rule uses 1 of test selectors if (rule.selectortext.match(ba)) { if (rule.style.content.indexof('delete me') !== -1) { var elems = document.queryselectorall(rule.selectortext.split(':')[0]); (var e = 0, elem; elem = elems[e++];) { // remove node document.body.removechild(elem); } ...

Clarity in providing multiple parameters to the function in Javascript -

i provide multiple parameters javascript function, , having clarity regarding passed parameters, having function var callme = function (param1, param2, param3) { console.log(param1 + ", " + param2 + ", " + param3) } i call method callme() this, having in mind value of parameter initialization value itself: callme(param1 = 1, param2 = 2, param3 = 3) my goal have clarity when providing multiple parameters avoid confusion. are there negative effects in example above, or may i'm trying reinvent wheel? if you're not declaring params ahead of time var , you're introducing global variables crazy. , can imagine it'd very, sloppy quickly. instead of doing that, use configuration object argument. though has own drawbacks, doing same thing while wrapping args in way doesn't (as say) reinvent wheel. so.. var f = function (config) { console.log(config.param1 + ", " + config.param2 + ", " + config.param3); }...

objective c - NSOperationQueue addOperationWithBlock with return in iOS -

i have written method -(void) getstatus:(nsstring*) url return type, -(nsstring) getstatus:(nsstring*) statusurl { nsurl *urlobj = [nsurl urlwithstring:[statusurl stringbyaddingpercentescapesusingencoding:nsutf8stringencoding]]; nserror *err; nsstring *response = [nsstring stringwithcontentsofurl: urlobj encoding: nsutf8stringencoding error:&err]; return response; } but stringwithcontentsofurl performing operation in main thread, while calling method application struck second. so need perform stringwithcontentsofurl function in background thread , after getting response want return response. my current code: -(nsstring) getstatus:(nsstring*) statusurl { nsurl *urlobj = [nsurl urlwithstring:[statusurl stringbyaddingpercentescapesusingencoding:nsutf8stringencoding]]; nserror *err; nsoperationqueue *rbqueue = [[[nsoperationqueue alloc] init] autorelease]; [rbqueue addoperationwithblock:^{ nsstring *response = [nsstring str...

python - Capturing logentry history in post_save signal django -

i have written post_save signal : def send_something(sender, instance, **kwargs): user = logentry.objects.get( content_type_id = contenttype.objects.get_for_model(instance).pk, object_id = instance.pk, action_flag = 1 ).user post_save.connect(send_something, sender=classname) but doesnotexist logentry matching query not exist when try add classname object admin. why happen ? why history not available @ time of post_save ? isn't object saved yet ? self.pk seems problem, try replacing instance.pk

java - Invoke a secured CA https SOAP service with a CXF client -

i'm trying invoke soap service published on secured server (apache/tomcat ssl , ca configured) the service expect .p12 (pkcs#12) certificate handle authorization. my test using soapui works ( service invoked , returned correct result ) i guess i'v deal keytool load certificate within keystore i'm not able figure ou correctly. in addition that, soapui running on top of jvm, , no need load certificate within jre keystore (as need point on p12 certificate), think there's way "load" certificate on demande @ invokation time ? after investigations, seems there's cxf configurations ( documentation ) code : github repository vm arguments : -djavax.net.ssl.keystoretype=pkcs12 -djavax.net.ssl.keystore=c:/job/cdbxxx-xxxxx.p12 -djavax.net.ssl.keystorepassword=****** logs (more here ): main, send tlsv1 alert: fatal, description = certificate_unknown main, write: tlsv1 alert, length = 2 main, called closesocket() main, handling exception: j...

javascript - jQuery dropdown select event -

is there specific event when user selects item in dropdown box? creating large form uses multiple dropdown boxes. on load first disabled, user selects first option options in second box change using ajax , want remove attribute disabled. $('#site_id').on('change', function(event) { $('#access_type_id').removeattr('disabled'); }); the trouble having .change() seems fired when options in dropdown change making following dropdown boxes enabled before want them be. there alternative event can use in place of change "enable" form field once user has made selection in previous dropdown? update i managed solve not using change event @ , placing removeattr in success section of ajax call. example below. allowed me make "next" dropdown enabled @ time populating options. $('#access_speed_id').on('select2-blur', function(event){ $.ajax({ async: true, data: $('#access_speed_id').seria...

javascript - Socket.io how to get room id -

i have problem, want only room id i know io.sockets.manager.rooms returns object :/ in code (i send list of rooms client , checks id) io.sockets.on('connection', function(socket) { socket.join('main'); socket.emit('start',io.sockets.manager.roomclients[socket.id]); }); and client: var socket = io.connect('http://localhost:3250'); socket.on('start', function(data) { panel.innerhtml = data; } the solution is: var keys = function( object ) { if ( !(object && typeof object === 'object') ) { return null; } var result = []; (var key in object) { if (object.hasownproperty(key)) { result.push(key) } } return result; } var obiekt = io.sockets.manager.rooms; socket.emit('rooms', keys(obiekt)) i'm not 100% sure need here. want return array of room names? if so, can keys objec...

c# - My inputcommand keybinding to main window does not work when child window is focussed(same wpf window)? -

i facing 1 problem input command key binding. here explain situation... have binded input command key binding below, <window x:class="defaultbehavior_keybinding.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" height="350" width="525"> <window.inputbindings> <keybinding key="f2" command="{binding testcommand}"/> </window.inputbindings> <grid> <button content="add" width="100" height="35" grid.row="0" name="emptybutton" click="emptybutton_click"/> </grid> it works fine. opened new wpf child window in button click event below, public partial class mainwindow : window { public icommand testcommand { get; private set; } public mainwindow() { this.testcommand ...

Perl regex matching is working weired -

i'm trying extract each language's information mfc's *.rc file. so, i've found " language lang_([\s\s]*?)#endif(.*)\n/{1,} " working following texts @ http://regexpal.com/ : language lang_language1, sublang_xxx #pragma code_page() : end #endif // language1 resources ///////////////////////////////////////////////////////////////////////////// : language lang_language2, sublang_xxxx #pragma code_page() : end #endif // language2 resources ///////////////////////////////////////////////////////////////////////////// : and also, i've programmed regex finding through perl this. $rc_file = read_file($argv[0]); @lang = ($rc_file =~ /language lang_([\s\s]*?)#endif(.*)\n\/{1,}/g); and expected every @lang element forms following texts. language lang_language1, sublang_xxx #pragma code_page() : end #endif // language1 resources ///////////////////////////////////////////////////////////////////////////// but, i'm receiving these 2 type...

android - Fragments, how to start Dialog from fragment? -

i read dialogfragment , , make 1 in 1 this. import android.app.alertdialog; import android.app.dialog; import android.content.dialoginterface; import android.os.bundle; import android.support.v4.app.dialogfragment; public class mydialogfragment extends dialogfragment { public static mydialogfragment newinstance(int title) { mydialogfragment frag = new mydialogfragment(); bundle args = new bundle(); args.putint("title", title); frag.setarguments(args); return frag; } @override public dialog oncreatedialog(bundle savedinstancestate) { int title = getarguments().getint("title"); return new alertdialog.builder(getactivity()) .seticon(r.drawable.plus_icon) .settitle(title) .setpositivebutton("ok", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int whichbutton) { addexercisefragment.dopositivecli...

objective c - What is the ?: operator -

in example of objective-c code found operator self.itemviews[@(0)] ?: [self.datasource slidingviewstack:self viewforitematindex:0 reusingview:[self dequeueitemview]]; the code compile under apple llvm 4.2. the thing came across in being vector operator, don't think objective-c, , matter c, has vector operators. can please give reference , or documentation of operator. ?: c conditional operator . a ? b : c yields b value if a different 0 , c if a equal 0 . a gnu extension ( conditional omitted operand ) allows use no second operand: x ? : y is equivalent to x ? x : y

ruby on rails - Will_paginate inside POST form with nested attributes -

i have 2 models: self-assessment , score, self-assesment has_many :scores , accepts_nested_attributes_for :scores . new self assessment form may have 60 nested scores. implement pagination nested attributes fields inside form. i tried implement no luck. controller def new @self_assessment = selfassessment.new @scores = @self_assessment.scores.paginate(:page => params[:page], :per_page => 10, :total_entries=> @self_assessment.scores.size) end view <%= form_for @self_assessment |f| %> <h2>at home...</h2> <% category.where(at_home: true).each |category| %> <h3><%= category.title %></h3> <% act.where(category_id: category.id).each |act| %> <%= f.fields_for :scores, score.new |builder| %> <%= builder.hidden_field :self_assessment_id, value: @self_assessment.id %> <%= builder.select(:rank, scales_for_select(act), prompt: "-select-...

solr4 - solr - defined stored="true" and required="true" and the fields are not displayed in * search -

i simple query follows http://....:8983/solr/vault/select?q=*:* i dont see fields declared stored="true" , required="true" for insance, have defined following filed not displayed in results: <field name="comments" type="text_en" indexed="true" stored="true" required="true"/> (i can see in http://...:8983/solr/#/vault/schema and see weas loaded in sql profiler) why that? fields displayed defined 'fl' parameter , can configured against searchhandler in solrconfig.xml. if want see field values after hitting url, append '&fl=*' url. http://....:8983/solr/vault/select?q=*:*&fl=* if want specify fields default, update solrconfig.xml file. refer sample config file @ example solr config <requesthandler name="/select" class="solr.searchhandler"> <lst name="defaults"> <str name="echoparams">expli...

playframework 2.0 - How to serve XHTML 5 from Play 2? -

is there special have do? adding xmlns attribute template not sufficient. for scala, in controller(s), add: import play.api.http.contenttypeof import play.api.templates.html implicit val xhtml = contenttypeof[html](some("application/xhtml+xml")) in templates, ensure have: <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> and html (including generated html passed template) well-formed xml.

sql server - SSIS DelayValidation randomly not working (Flatfile Connection Manager with Expression) -

have ever had weird behavior in ssis 2008, delayvalidation on flatfile connection manager randomly not working? here scenario struggeling on ssis 2008 (non r2): my package covers import of 30 different *.csv flat files database csv files delivered each day dynamically created folder (d:\datadelivery\deliveryid_<generateddeliveryid>) (e.g. "d:\datadelivery\deliveryid_73\", "d:\datadelivery\deliveryid_74\", ..) ==> here csv files imported via ssis the delivery id current import determined stored proc @ beginning of ssis package (stored ssis variable "ideliveryid") based on determined delivery id build complete import path using variable called "simportpath" expression (evaluateasexpression=true): "d:\datadelivery\deliveryid_"+ (dt_wstr, 1252)@[user::ideliveryid] +"\" .. the generated import path used in expression connection property of each flatfile connection manager, e.g.: @[user::simport...

getResource("xmlfile.xml") throws java.lang.NullPointerException -

i have xmlfile.xml in /webcontent/web-inf folder of web project. i'm trying path of file using; url url = this.getclass().getclassloader().getresource("xmlfile.xml"); string filepath = url.getfile(); but it's throwing java.lang.nullpointerexception in second line of code. what reason this? file available webcontent/web-inf/xmlfile.xml you should use servletcontext : servletcontext context = .... // context here inputstream resourcecontent = context.getresourceasstream("/web-inf/xmlfile.xml"); or real path : string realpath = context.getrealpath("/web-inf/xmlfile.xml"); remember, java ee webapp single (war) file, , therefore file system access components within war not guaranteed. can access objects using standard java class loader mechanism, won't give access paths of war aren't in war's class path ( web-inf/classes , web-inf/lib jars ). hence fails in case.

jquery - How to load a html file's content into javascript variable in django? -

i'd insert contents of abc.html after div when event fires. i tried var content = {% include "path/to/abc.html" %}; $(".mydiv").click(function() { $("#anotherdiv").insertafter(content); }); however, seems `{% include %} fails because of sort of parsing error. (abc.html multi-line) abc.html contains django filters/tags. any thoughts? one alternative approach put contents hidden div, , click function unhide it.

Linux scp command not working with a specified port -

i'm using scp -r -p 10122 -i /home/gndp/.ssh/openssh.puk gndp@localserver.com:~/folder/subfolder gndp@192.168.1.197:/home/gndp/ it says: ssh: connect host "localhost" port 22: connection refused 192.168.1.197 connects remote website am missing something? i've tried scp -r -p10122 -i /home/gndp/.ssh/openssh.puk gndp@localserver.com:~/folder/subfolder gndp@192.168.1.197:/home/gndp/ with same error actually solved problem removing "gndp@localhost.com:" , running command as: scp -r -p 10122 -i /home/gndp/.ssh/openssh.puk ~/folder/subfolder gndp@192.168.1.197:/home/gndp/

android - How to use sensors rotation matrix in min3d to rotate parsed object -

i want rotate objects parsed .obj file in min3d. need use rotation matrix got sensors. know how in pure opengl can't figure out use (min3d.core.renderer probably?) , how in min3d. min3d , parses .obj files nicely don't want abandon , use pure opengl. know can use rotate() method uses eulers angles , need use rotation matrix. here's code: public class hurleyloading extends rendereractivity implements sensoreventlistener{ private object3dcontainer hurleymodel; private sensormanager sensormanager; private sensor sensoracc; private sensor sensormagnetic; private float[] acceldata = new float[3]; private float[] magnetdata = new float[3]; private final float[] rotationmatrix = new float[16]; float[] orientation = new float[3]; @override public void oncreate(bundle b){ super.oncreate(b); setrequestedorientation(activityinfo.screen_orientation_portrait); sensormanager = (sensormanager)getsystemservice(sensor_service); sensoracc = sensormanager.getdef...

php - Skip some columns when doing a select -

i building ajax web application , displaying chain select in jquery selecting behind scenes , saves me lots of time writing new routes , views.however,i know if there way reduce work further not writing new models. i have controller <?php class tools extends ci_controller { public function message($to = 'world') { echo "hello {$to}!".php_eol; } public function boom(){ echo "boom".php_eol; } public function q(){ $sql = "select * members member_id = ? , member_club_id = ? , membership_year = ?"; $count = $this->db->query($sql, array(null, 1, null)); foreach ($count->result() $row) { echo $row->member_name . php_eol; } } } ?> which attempt skip column , display other. this sql equivalent select * members member_id = null , member_club_id = 1 , membership_year = null; they both don't display anything.is there way can skip column of choosing?. ...

android - Facebook SDk Errors -

i down latest facebook sdk here , gives me zip extract it. dont find jar file number of samples , facebook.apk , html , css files . import these project found bunch of errors in each samples code. clean , fix properties of project there liberaryy project facebooksdk add in samples. , ron first sample booleanosgame, hellofacebook, sampleloginproject these projects not running , giving error on console. appreriated 1-facebooksdk.apk not found. 2-class not found "com.facebook.loginactivity" 3- etc you need import jar eclipse. please have @ step 3 here - howtoaddjar

php - set language in html dom parser -

i scrpping data site, default in french , have english version well. problem when scrap data it, return html in french, there not paramter set english in url, can add that. have tried in html tag <html xmlns="http://www.w3.org/tr/html5/" lang="en" itemscope="" itemtype="http://schema.org/localbusiness"> and <body id="lang-en" class="site-duproprio prov-qc"> but no luck. here website want scrap data. http://duproprio.com/search/?hash=/g-re=13/s-filter=forsale/pa-ge=1/ any appreciated :) this site keeps language in session. before want scrape data in english must visit http://duproprio.com/gotoen if use curl relevant question curl - cookies , sessions .

jquery checkbox check not working -

i have small script,with straight function. if checkbox not checked, if user clicked on show div otherwise hide div when user clicks in it. script (its inside php code ): echo '<script> $(document).ready(function(){ if($("#chk_id'.$bank_name.'").is(":checked")) { $("#chk_id'.$bank_name.'").click(function(){ $("#form_show'.$bank_name.'").hide(300); }); } else { $("#chk_id'.$bank_name.'").click(function(){ //alert("ddd"); $("#form_show'.$bank_name.'").show(300); }); } }); </script>'; but problem although show div working, unable hide div ! whats wrong? javascript library : <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> try this: $(document).ready(function(){ $('body').on('click', "#chk_id'.$bank_name.'",...

android - Can't find whats wrong in the syntax to delete a row in sqlite -

im trying delete row table given name value in row using following line of code: db.delete(table, column_name+"="+ col_value, null); created table using: db.execsql("create table"+ table+"("+column_name+" text," +id+" integer primary key)"); logcat shows npe @ line of deleting row. whats wrong there in it? logcat: 07-31 18:00:13.267: e/androidruntime(1264): java.lang.illegalstateexception: not execute method of activity 07-31 18:00:13.267: e/androidruntime(1264): @ android.view.view$1.onclick(view.java:2072) 07-31 18:00:13.267: e/androidruntime(1264): @ android.view.view.performclick(view.java:2408) 07-31 18:00:13.267: e/androidruntime(1264): @ android.view.view$performclick.run(view.java:8816) 07-31 18:00:13.267: e/androidruntime(1264): @ android.os.handler.handlecallback(handler.java:587) 07-31 18:00:13.267: e/androidruntime(1264): @ android.os.handler.dispatchmessage(handler.java:92) 07-31 18:00:13...

facebook graph feed some fields by some users a missing -

very strange. feed group valid token. users 1 or more fields missing. field "picture" sometime field status. in normal view of group shown. is bug fields in graph feed missing? can't explain myself. thanks help!

java - Create Excel Chart within Excel File -

i exporting data system. want visualize these datasets in excel chart. have found , old, closed question, solution missing. charts should redraw when change datafield, excel standard, guess. i think may work way: export data create manually chart ms-excel save , load template in other future exports do know how poi using java? import of chart template? till apache poi limitation saying "you can not create charts. can create chart in excel, modify chart data values using hssf , write new spreadsheet out. possible because poi attempts keep existing records intact far possible". however in case, have created chart manually on excel sheet using named ranges, , using java, updating named ranges per requirement. since chart based on named ranges updated. for updation please check here

android - AsyncTask not show progress dialog immediate -

i used suggestion in this have same problem yet. friend suggestion using asynctask not worked me. what? code : dbasynctask dba = new dbasynctask(this, xmlcommand); dba.inprocess = true; dba.execute(""); while (dba.inprocess) { try { thread.sleep(200); println("wwwwait"); } catch (interruptedexception e) { // todo auto-generated catch block e.printstacktrace(); } } public class dbasynctask extends asynctask<string, void, string> { public boolean inprocess; public dbasynctask(exircommandrunner commandrunner,xmlnode xmlcommand) { this.commandrunner = commandrunner; this.xmlcommand = xmlcommand; } @override protected void onpostexecute(string result) { exirdebugger.println("onpostexecute"); } @override protected void onpreexecute() { showprogress(); } @override protected stri...

ruby 1.9.3 - Rspec test issue not producing proper response -

i receive following response when try run rspec tests. user.respond_to?(:name) should "true" following error instead (added) **nameerror: undefined local variable or method `user' main:object (irb):2 /users/mwsage/.rvm/gems/ruby-1.9.3-p429@rails3tutorial2nded/gems/railties-3.2.13/lib/rails/commands/console.rb:47:in `start' /users/mwsage/.rvm/gems/ruby-1.9.3-p429@rails3tutorial2nded/gems/railties-3.2.13/lib/rails/commands/console.rb:8:in `start' /users/mwsage/.rvm/gems/ruby-1.9.3-p429@rails3tutorial2nded/gems/railties-3.2.13/lib/rails/commands.rb:41:in `<top (required)>' script/rails:6:in `require' script/rails:6:in `<main>' instead of receiving "true" or "false" response. ideas? from gemfile gem 'rails', '3.2.13' gem 'rspec-rails', '2.11.0' ruby '1.9.3' here exact test , erro hartl tutorial 6.2.2 validating presence user = user.new(name: ...

objective c - Error while running ios device from xcode -

this question has answer here: the identity 'iphone developer' doesn't match valid, non-expired certificate/private key pair in keychains 1 answer i creating app in ios cordova(2.1.0) framework. when build app device selected in xcode, gives me following error: **the identity 'iphone developer: balh-blah (xxxxxxxx)' doesn't match valid, non-expired certificate/private key pair in keychains.** can me on urgently becoming bottleneck. have tried deleting derived data project, doesn't solve issue. also, provisioning profile select in build settings has not expired. in advance. the same issue discussed under following post: xcode - iphone - profile doesn't match valid certificate-/private-key pair in default keychain must point out of may 1st application submitted app store cordova version less 2.5.0 rejected( http://phonegap...

amazon ec2 - Syntax issue with sending email via mutt on EC2 -

i'm trying send email amazon ec2 node using mutt , i'm getting error i'm assuming syntax can't see i'm doing wrong. i'm trying send email txt attachment echo "sending test" | mutt -a test.txt -s "test email" name@emaildomain.com however following errors: can't stat name@emaildomain.com: no such file or directory name@emaildomain.com: unable attach file it trying attach file name of email don't understand why. appreciated in recent versions of mutt -a option designed allow multiple arguments can -a *.txt attach number of files match pattern. because of must last option used , separated recipients -- : echo sending test | mutt -s "test email" -a test.txt -- name@example.com

c# - How do I check if WebClient download is completed before I execute a function? -

i trying json files different urls. how make sure both files downloaded before try execute else. my code looks this: webclient url1 = new webclient(); url1.downloadstringcompleted += new downloadstringcompletedeventhandler(url1_downloadstringcompleted); url1.downloadstringasync(new uri("http://example.com")); webclient url2 = new webclient(); url2.downloadstringcompleted += new downloadstringcompletedeventhandler(url2_downloadstringcompleted); url2.downloadstringasync(new uri("http://anotherexample.com")); dosomethingwithjson(); void url1_downloadstringcompleted(object sender, downloadstringcompletedeventargs e) { if (e.error != null) return; json1 = jobject.parse(e.result); } void url2_downloadstringcompleted(object sender, downloadstringcompletedeventargs e) { if (e.error != null) return; json2 = jobject.parse(e.result); } right now, happens json1 , json2 returns null values whenever try display them in messagebox i...

Cross platform mobile framework -

i looking building intranet based app can support different mobile platforms. i have looked phonegap, sencha touch , jquery mobile. confused how business logic can incorporated on client side ? input appreciated. phonegap web browser has access native apis. can use more or less technology normal web browser can interpret. with in mind, business logic have general options: 1) create api somewhere on server , make ajax calls application and/or 2) use javascript. language can used business logic inside phonegap (beside native java, objective-c , etc).

java - How to attach() and detach() instead of add() and remove() to save fragment view -

i have following code actionbar : private class mytablistener implements actionbar.tablistener { private fragment mfragment; private final activity mactivity; private final string mfrag; public mytablistener( activity activity, string fragname ) { mactivity = activity; mfrag = fragname; } @override public void ontabreselected( tab tab, fragmenttransaction ft ) { // todo auto-generated method stub } @override public void ontabselected( tab tab, fragmenttransaction ft ) { mfragment = fragment.instantiate( mactivity, mfrag ); ft.add( android.r.id.content, mfragment ); } @override public void ontabunselected( tab tab, fragmenttransaction ft ) { ft.remove( mfragment ); mfragment = null; } } i have textboxes within tab fragments , switching between tabs forces app lose data added textbox. instead of add , remove , use attach , detach saves fragment ...

C (cpp) extension in Python works on one machine but does not on the other -

sorry if question bit vague, , might not appropriate @ stackoverflow, giving shot, maybe have clue reason or give ways test, problem is. i have c (cpp?) extension works fine on 13.04 lubuntu gcc 4.7.3, python 2.7.4, numpy 1.7.1 not work in 12.04 ubuntu gcc 4.6.3, python 2.7.3, numpy 1.6.1 on machine. seems build/install fine, when try run thing, gives me error: typeerror: array type 7 didn't match expected type -1 i not want spam build codes, include 2 codes, think main. first cpp file #define py_array_unique_symbol j_sad_pyarray #include "common/jassert.h" #include "python.h" #include "numpy/arrayobject.h" #include "common/jpythoncommon.h" extern "c" pyobject *sad_correlation(pyobject *self, pyobject *args) { // inputs pyarrayobject *a, *b; // list of coordinates input polygons (2d double numpy array) // parse input arrays *args if (!pyarg_parsetuple(ar...

performance - Heroku web dynos often slowing down but never getting more than 20% load? -

Image
a couple of times day see response time of 1 of our heroku web dynos increase tremendously. have been analyzing little success far. one strange thing see, however, following. @ "instances running" graph new relic: you see we've played around number of web dyno's, majority of time have had 2 dynos 4 unicorn processes each. never ever these instances seem "full load". how should interpret this? @ time sum of cpu usage of instances never exceeds approx. 20%? , if so, seems we're underutilizing our dynos. can optimize here? for clarity: average memory usage constant between 110mb , 120mb, not seem bottleneck. have seen http://news.rapgenius.com/james-somers-herokus-ugly-secret-lyrics ? heroku has worked on addressing this, you'll need talk them further recommendations.

null - "Value does not fall within the expected range" on C# for adding a bug on HPQC -

this function supposed add new defect on hpqc. gives "value not fall within expected range" when null in .additem(). know might problem? public static void addbug() { string qcurl = "link hpqc"; string qcdomain = "domain"; string qcproject = "project"; string qcloginname = "name"; string qcpassword = "pass"; tdconnection connection = new tdconnection(); connection.initconnectionex(qcurl); connection.connectprojectex(qcdomain, qcproject, qcloginname, qcpassword); bugfactory bugfactory = connection.bugfactory; bug bug = bugfactory.additem(null); bug.status = "new"; bug.project = "qcintegration"; bug.summary = "short description of bug"; bug.detectedby = "aaron evans"; bug.assignedto = "nobody";...

php - combine rows from fgetcsv arrays -

basically have csv file order information on it, ordered website, containing invoice number, name, address, etc. i've used php turn invoices. looks pretty i'm stuck on 1 bit. here's opening bit using fgetcsv; <?php $file_handle = fopen("orders.csv", "r"); while (!feof($file_handle) ) { $csvline = fgetcsv($file_handle, 1024); ?> in csv file, if has ordered more 1 item appears on new row same invoice number row before, doesn't show product in first row of invoice number: 100001,bradley manning,email1@address.com,address,product a, 100002,mr snowden,email2@address.com,address,product a, 100003,dr dre,email3@address.com,address,,, 100003,,,,,,,,,,"product a", 100003,,,,,,,,,,"product b", 100003,,,,,,,,,"product c", the php takes these values (eg. $csvline[0] invoice number) , puts them in nice printable html file. need able rows beginning same invoice number onto same html table (in cell below first order...

testing - how to use jacoco.exec report -

i generated code coverage report jacoco, jacoco.exec . don't know how use ... the way generated through command line: java -javaagent:/path/to/jacocoagent.jar=include=some.package.*,output=file org.junit.runner.junitcore some.package.classtest then got jacoco.exec report. need number of percentage, , using command line only. there way convert report readable txt file? thanks all per this thread can't use generated jacoco.exec directly produce report. can download jacoco's sample build.xml , use produce report, instead. you'll need make these changes build.xml: set the paths to your downloaded jacocoant.jar your jacoco.exec your project source code your compiled project class files i changed default target "report". run typing "ant" , reports generated.

How to convert money to decimal in SQL Server stored procedure -

i have stored procedure want convert money type decimal type. @money = 513.9010 type money i want convert decimal - how that? select convert(decimal(7,4),@money)

Filter out similar data SQL Server 2008 -

i using sql server 2008 , navicat . need filter search results in next way: 1. data - id 2. 24 - 1 3. 24 - 3 4. 50 - 5 5. 50 - 8 i need leave 1 data max id value (distinct inside query doesn't work because data i'm looking not unique), result should be: 1. data - id 3. 24 - 3 5. 50 8 all rest similar data values should filtered out. in advance! select data,max(id) tablename group data

objective c - NSDate timeIntervalSinceNow and local timezone? -

i'm doing calculation find nstimeinterval between known futuredate (which in gmt/utc) , current time (and timezone) device resides. nstimeinterval approachinterval = [futuredate timeintervalsincenow]; i know nsdate not store timezone specific data, rather being calculated when date needs displaying on device. my question initial tests (i'm in gmt+0001) seems nstimeinterval returned not account local timezone. have manually calculate timezone offset , remove interval, , best way of doing given can't supply nsdate correct timezone (using timeintervalsincedate: example) nsdate represents single point in time. not have (and not need!!) time zone. "a known futuredate (which in gmt/utc)" or "i can't supply nsdate correct timezone" not make sense. [futuredate timeintervalsincenow] returns time interval between futuredate , current date , time , independent of time zones. if not expected result, perhaps calculation of future...