Posts

Showing posts from February, 2012

android - EditText in Header of ListView is uneditable -

i have edittext in header of listview along spinner , button. reason, edittext not allowing me type within it. soft keyboard pops , cursor appears in box onclick, , keyboard recognizes typing, nothing appears in box. here's java oncreate handles making header. public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.keyvalue); m_items = utils.gettrackercursor(this, 0, ""); m_items.getcount(); startmanagingcursor(m_items); string[] columns = new string[] {"name","value","result"}; int[] = new int[] {r.id.txtkeyvalue_rowtitle, r.id.txtkeyvalue_rowvalue, r.id.txtkeyvalue_rowresult}; m_adapter = new trackeradapter(this, r.layout.keyvalue_row, m_items, columns, to); button btnrollall = new button(this); btnrollall.settext("roll all"); final spinner spintrackergroups = new spinner(m_context); m_trackergroups = utils.gettrackergroups(m_context); string[] spinvals = trimap.getarray(m_...

iphone - rightbarbuttonitem not showing up? -

note: can work switching leftbarbuttonitem rightbarbutton item in barbutton , barbutton2 methods. i'm curious know why won't work normally! for strange reason, leftbarbuttonitem showing, rightbarbuttonitem never pops up! here's code -(void)barbutton { image = [uiimage imagenamed:@"bbut.png"]; uibutton *button = [uibutton buttonwithtype:uibuttontypecustom]; [button setbackgroundimage: [image stretchableimagewithleftcapwidth:7.0 topcapheight:0.0] forstate:uicontrolstatenormal]; [button setbackgroundimage: [[uiimage imagenamed: @"bbut.png"] stretchableimagewithleftcapwidth:7.0 topcapheight:0.0] forstate:uicontrolstatehighlighted]; [button addtarget:self action:@selector(showlocations:) forcontrolevents:uicontroleventtouchupinside]; button.frame= cgrectmake(3.0, 0.0, image.size.width+1, image.size.height+0); uiview *v=[[uiview alloc] initwithframe:cgrectmake(3.0, 0.0, image.size.width+1, image.size.height) ]; [v addsubview:button]; uibarbuttonitem *modal...

velocity - Upgrade VelocityTools 2.0 new tools.xml doesn't load -

Image
i'm switching velocitytools 2.0 new tools.xml doesn't load. replaced toolbox.xml , use tools.xml when run server get: "xmltoolboxmanager:100: xmltoolboxmanager has been deprecated. please use org.apache.velocity.tools.toolboxfactory instead. servlettoolboxmanager:131: servlettoolboxmanager has been deprecated. please use org.apache.velocity.tools.toolboxfactory instead." how can use toolboxfactory? xmltoolboxmanager or servlettoolboxmanager not referenced anywhere in code can't replace classes. when use toolbox.xml velocitytools 2.0 works fine, need new xml syntax work in tools.xml my bean definition in velocity.xml looks this: <bean id="viewresolver" class="org.springframework.web.servlet.view.velocity.velocitylayoutviewresolver"> <property name="viewclass"> <value>org.springframework.web.servlet.view.velocity.velocitylayoutview</value> </property> <property name="contenttype"> ...

sql - PHP - Execute PHP Script On Page Load? -

i want php script counts how many times item has been bought, increasing counter 1 every time php script (of purchase) has been executed, , showing in page database. let's say, when user redirected site via paypal load page thankyou.php on load, increases database value (of counter) in table one. i couldn't find examples i'm hoping kind guys here me out. php server side language executed on sever side before page loads. in case have make ajax call trigger php code. update: mysql_query("update table_name set id = id + 1 id = '$id'");

nlp - Sentence segmentation tools to use when input sentence has no punctuation (is normalized) -

suppose there sentence "find me jazz music , play it", text normalized , there no punctuation marks (output of speech recognition library). what online/offline tools can used "sentence segmentation" other naive approach of splitting on conjunctions ? input: find me jazz music , play output: find me jazz music play it you can use semantic role tagger mate tools etc... this. extract predicates , related arguments in prop bank style.

Can't write into a .txt file in netbeans -

i have file called save.txt . in same package class k . problem can't write in .txt file using following code inside k : file savebutton = new file ("save.txt"); bufferedwriter output = new bufferedwriter (new filewriter (savebutton)); output.write("something"); output.close(); can me this? bw = new bufferedwriter(new filewriter("filepath",true)); bw.write("hello world!"); bw.write("\n"); bw.write("hello world 2 !\n"); bw.write("hello world 3 !" + "\n"); bw.close(); try this? did try easy this: filewriter f = new filewriter("test.txt"); f.write("hello"); f.close();

eclipse - Add new item in Visual Studio -

in eclipse add new class wizard lets specify sorts of options, such modifiers class has, interfaces implements, parent class(es) is, package resides in, etc. comparatively default add new item wizard in visual studio while offering large selection of templates not offer such options. is there way eclipse functionality in visual studio through setting or extension? visual studio has different way of handling things. add class , use refactor menu add interfaces, etc. right click on class name -> refactor, or can use refactor menu.

jquery - Using ajax for form submission with multiple forms generated by php on page -

i have page multiple forms same thing, acting like button each post in page, , right next number of likes inside div named "likes".$id, can identify write likes count after ajax call. trying use jquery ajax function, couldn't set div write results of function. $.ajax({ type:'post', url: 'likepost.php', data:$('#like').serialize(), success: function(response) { $('#like').find('#likediv').html(response); } }); and how access data on likepost.php? terrible javascript, hope me , explain how jquery function works, because i've been copying , pasting without knowing doing. would work? $(function () { $("#likebutton").click(function () { var id = $('input[name=id]'); // me trying form value $.ajax({ type: "post", url: "likepost.php", data: $("#like"+id).serialize(), // form called like+id e.g. like12 success: function(data){ $("#likes"+id).html(data); // write results e....

python - CSV remove field value wrap quotes -

i'm attempting write list csv, when wrapper quotes around field values: number1,number2 "1234,2345" "1235.7890" "2345.5687" using code: with open('c:\\temp\\test.csv', 'wb') out_file: ... csv_writer = csv.writer(out_file, delimiter=',') ... csv_writer.writerow(('number1','number2')) ... f in mylist: ... csv_writer.writerow(f) after further research, found can remove writing of quotes using: quotechar='', quoting=csv.quote_none** when apply code error: traceback (most recent call last): file "", line 4, in error: need escape, no escapechar set with open('c:\\temp\\test.csv', 'wb') out_file: ... csv_writer = csv.writer(out_file, delimiter=',',quotechar='', quoting=csv.quote_none) csv_writer.writerow(('number1','number2')) ... f in mylist: ... csv_writer.writerow(f) how remove these quotes? edit mylist looks like: [['1234,2345...

php - Major Issue with Session and Login -

ok ive been having major problem site. whats going on i'm going page page not maintaining session. here couple source codes on same directory. ok have index modal box contains iframe login.php , logout.php. logs me in once go different page doesn't carry session , when click login says im logged in , has session. how can add cookies website find confusing. just snippets: part of header.php goes on every page <?php session_start(); if($_session["username"]) { ?> <div style="display: inline-block; font-size: 14px; padding-left: 20px;">hello <?php echo $_session['username']; ?> login.php <?php session_start(); require_once('connections/main.php'); if($_session['username']) { echo '<div class="error_message">attention! you, '.$_session['username'].' logged in.</div>'; echo "<br />"; echo "go <a target='top' href='index.php'>...

asp.net - Preloader while generating PDF using response object -

i generating pdf using response object. code renders html pdf. pdf generation time not fixed, want show preloader process (processing/loading) during time using ajax. when start pdf generation process on button click, start preloader process, after completion of pdf getting generated, preloader process not getting stopped. also, suppose want clear data in textboxes on page, not getting cleared. what need solve these problems. here code: dim response system.web.httpresponse = system.web.httpcontext.current.response response.clear() response.clearheaders() response.clearcontent() response.contenttype = "application/pdf" response.appendheader("content-disposition", "attachment; filename=" + me.txtreportsetpdfname.text.replace(" ", "_") + ".pdf") response.appendheader("content-length", filelen(sfilepath).tostring) response.writefile(sfilepath) are using response.end(); if yes, need textbox clearing , stopping...

c++ - confusion in union concept -

#include<stdio.h> union node { int i; char c[2]; }; main() { union node n; n.c[0] = 0; n.c[1] = 2; printf("%d\n", n.i); return 0; } i think gives 512 output becouse c[0] value stores in first byte , c[1] value stores in second byte, gives 1965097472 . why ?. compiled program in codeblocks in windows. your union allocates 4 bytes, starting off as: [????] [????] [????] [????] you set least 2 significant bytes: [????] [????] [0x02] [0x00] you print out 4 bytes integer. you're not going 512 , necessarily, because can in significant 2 bytes. in case, had: [0x75] [0x21] [0x02] [0x00]

jqgrid - What's the difference between 2 lines in PHP? -

i have found in jqgrid server side php example next line $start = $limit*$page - $limit; // not put $limit*($page - 1) what's difference between $start = $limit*$page - $limit; and $start = $limit*($page - 1); why authors not recommend second way ? i suspect numerical math issue. suppose $page huge, in 6.02e231 . ($page - 1) = 6.02e231 (the exact same floating point representation), $limit*($page - 1) = $limit*$page from point of view of processor. compare $limit*$page = [some huge value] $limit*$page - $limit = [subtraction of 2 huge values] which yield different result, more accurate "minus one" notation. so although in perfect world of mathematics, 2 notations equal, in non-perfect world of computing, first 1 more prone 'catastrophic cancellation' (wiki that) second.

sql - how to use replace function with in clause in mysql -

i want sql query gives output concat string sql query select group_concat(nm) xyz xyz.id in (replace(abc,"|",',')) where abc string 1|2|3|4 ids of xyz table above query gives nm of 1st id in abc.i thing creates query like select group_concat(nm) xyz xyz.id in ("1,2,3,4") so (") may creates problem can help. you can use like , (but not going use indexs) select group_concat(nm) xyz concat('|', abc, '|') concat('%|', xyz.id, '|%');

objective c - Restkit: Post Json Array and Map response to Managed Objects -

Image
here setup, post list of objects in json server , got updated results mapped core data , updated. -- post boday -- { "memberid": "1000000", "contacts": [ { "phonenumber": "+12233333333", "firstname": "john", "lastname": "h" }, { "phonenumber": "+12244444444", "firstname": "mary", "lastname": "k" } ] } -- post response -- { "contacts": [ { "phonenumber": "+12233333333", "firstname": "john", "lastname": "k", "ismember": "yes" }, { "phonenumber": "+12244444444", "firstname": "mary", "lastname": "k", "ismember": "no" } ] } i found thread discusses similar case. restkit: how 1 post array of objects? this setup. -- shcontact.h -- @interface shcontact : nsmanagedobject ...