Posts

Showing posts from June, 2013

html - Sort table with unknown number of headers using jQuery Table Sort, then only sort on 2 headers -

the scenario i have table on web page dynamically generated using jsp. number of columns/headers variable (could 6 or 40+). i'm using jquery tablesorter sort table. table should sort on header elements 5 , 6 moment. the question using tablesorter allows set header elements false , disabling them sort options. since number of headers variable need way of inverting options can set sorter option true , rest disabled default. either that, or need way total number of header elements , run through loop set them false. the syntax little tricky me i'm not sure how loop through following: $(document).ready(function() { $("table").tablesorter({ headers: { 0: { sorter: false }, 1: { sorter: false } . . . } }); }); so 2 want sort on in example "primary di

c# - Hosting a Form's content inside of another Form? -

i need host windows form inside form, iframe in html. however, using multi-document interface causes form's window controls rendered well. need only content of form rendered. how this? i have application this. for contained form, set .toplevel = false, formborderstyle none , set dock property fill. in parent form, have split panel , add contained form the panel want in. i don't remember why didn't want go usercontrols more, years ago. seem recall having reason though. of contained forms use usercontrols.

webkit - webkitgtk how to control resource loading depends on the type of the resource? -

i want control resource downloading depending on type of resource css, script, img, etc. i testing thing loads html loacl , manipulate dom webkitgtk. load html local file via webkitgtk. but know, there resource download img, css or script. don't want download @ all. img , script, setting webkitwebsettings ( of webkitgtk ). but there not way block css in webkitwebsettings. tried hooking "resource-request-starting" signal. static void loadstatuscb(webkitwebview *web_view, gparamspec *pspec, void* context); i block network requests hooking. don't want block resource downloading. want block depends on type ( css, script, img, ... ) for example, if test_file request came <link type="text/css" rel="stylesheet" href="http://test.com/test_file"> i block. because css. but from <script type="text/javascript" src="http://test.com/test_file"></script> i not block. i tried information

asynchronous - Async.TryCancelled doesn't work with Async.RunSynchronously -

i try create agent updates ui based on user interaction. if user clicks on button, gui should refreshed. preparation of model takes long time, desirable if user clicks on other button, preparation cancelled , new 1 started. what have far: open system.threading type private refreshmsg = | refreshmsg of asyncreplychannel<cancellationtokensource> type refresheragent() = let mutable cancel : cancellationtokensource = null let dosomemodelcomputation = async { printfn "start %a" do! async.sleep(1000) printfn "middle %a" do! async.sleep(1000) printfn "end %a" } let mbox = mailboxprocessor.start(fun mbx -> let rec loop () = async { let! msg = mbx.receive() match msg | refreshmsg(chnl) -> let cancelsrc = new cancellationtokensource() chnl.reply(cancels

linux - Custom stdin for Node.js child process -

is possible execute child process in node.js custom stdin under linux? the documention refers stdinstream internal use only: there several internal options. in particular stdinstream, stdoutstream, stderrstream. internal use only. undocumented apis in node, should not used. why it's internal use only? tried give custom readablestream it, yielded nasty v8 exception. no surprise after using internal api... some background: need execute git commit after node.js process has closed stdin (this cannot workaround currently). issue git gets angry @ if try commit closed stdin . update: issue originates a node.js bug , i'll keep question here since think i'm not 1 wondering this. rather using stdinstream , think should use customfds instead. same documentation: there deprecated option called customfds allows 1 specify specific file descriptors stdio of child process. api not portable platforms , therefore removed. customfds possible hook new

c# - datatable as an itemsource for datagrid in wpf -

how can set datagrid control values datatable ? i use source public static readonly dependencyproperty objdatatabledefaultviewproperty = dependencyproperty.register("objdatatabledefaultview", typeof(system.data.dataview), typeof(window1), new frameworkpropertymetadata()); public system.data.dataview objdatatabledefaultview { { return (system.data.dataview)getvalue(objdatatabledefaultviewproperty); } set { setvalue(objdatatabledefaultviewproperty, value); } } private void createobjdatatable() { try { objdatatabledefaultview = table.defaultview; } catch (exception ex) { messagebox.show(ex.message); } } but has got error message , program stops, a first chance exception of type 'system.windows.markup.xamlparseexception' occurred in presentationframework.dll additional information: cannot create instance of 'window1' define

html - How to randomly assign a color on hover effect -

i've never seen hover effect before, , i'm trying understand how it's achieved. you'll notice in example, when user hovers on link, color link turns can any 1 one of 5 colors assigned within style sheet (see below) @ random. how create hover effect? can done purely css? a:hover { color:#1ace84; text-decoration: none; padding-bottom: 2px; border: 0; background-image: none; } a.green:hover { color: #1ace84; } a.purple:hover { color: #a262c0; } a.teal:hover { color: #4ac0aa; } a.violet:hover { color: #8c78ba; } a.pink:hover { color: #d529cd; } since random factor introduced, don't think there's way of doing purely css. here's simple approach problem, using jquery. you can see working example here: http://jsfiddle.net/gngjz/1/ $(document).ready(function() { $("a").hover(function(e) { var randomclass = getrandomclass(); $(e.target).attr("class", randomclass); }); }); function ge

c# - DataFormatValue issue in GridView -

how can format currency value of column in gridview ? i tryied following code, doesn't work, still unformatted. <asp:gridview id="grddetalhepropostaexpirada" width="100%" runat="server" autogeneratecolumns="false" datasourceid="dsgridexpira"> <columns> <asp:boundfield headertext="valor" datafield="valorproposta" dataformatstring="{0:c}" /> </columns> </asp:gridview> you have set htmlencode false: <columns> <asp:boundfield headertext="valor" datafield="valorproposta" htmlencode="false" dataformatstring="{0:c}" /> </columns> msdn : in versions of asp.net earlier 3.5, must set htmlencode property false in order format fields not string data types. otherwise, field value converted string default conversion method before format string stored in dataformatstring property a

c# - DataContractJsonSerializer throws exception Expecting state 'Element'.. Encountered 'Text' with name '', namespace '' -

i need serialize piece of json. i response rest service, service returning json. after want map request class. i'm using datacontractjsonserializer, can't work. when data serialize following exception thrown: "expecting state 'element'.. encountered 'text' name '', namespace ''. " here code: httpwebresponse response = (httpwebresponse)webrequest.getresponse(); stream responsestreamm = response.getresponsestream(); streamreader reader = new streamreader(responsestreamm); string streamasstring = reader.readtoend(); memorystream memorystream = new memorystream(encoding.unicode.getbytes(streamasstring)) {position = 0}; datacontractjsonserializer serializer = new datacontractjsonserializer(typeof(list<myclass>)); list<myclass> myclass = (list<myclass>)serializer.readobject(memorystream); and here myclass: [datacontract] public class myclass { [datamember] public string rawdata { get; set; }

algorithm - What are possible methods for creating a physical engine -

this general question comes answer issue interests me general knowledge , not answer specific problem. i wondering available ways implement physical engine objects interact each other , outside forces. example can @ angry birds, or games tim . there objects "fly" through air, collide , interact each other, , affected potential of environment gravity, winds , other "forces". the model have thought each object has object (as object of class) , thread relate it. each time slot thread "advances" object in space small dt. in case have "environment" object can position in space , give equivalent force applied environment potential. can't how objects interact each other? also, close in direction? there other solutions , models problems, , better? things i'm missing (i must missing things)? the implementation typically nothing describe, way expensive. instead, reduced matrix transformations. points lists of coordinates operat

jquery - Loop through DataTables table to get all cells content -

i using jquery datatables generate paginated table on site. need run process grabs of data out of particular column. : $('.testlink').click(function(){ var cells = new array(); $('#mytable tr td').each(function(){ cells.push($(this).html()); }); console.log(cells); }); that example grabs need information 1 column of tds. guess adding class of tds in row sure there better way. bonus question.. but want know how work datatables? because script hides of table put in pagination function grabs cells visible. played around fngetdata not getting it. ideas? to access rows, can do: var rows = $("#mytable").datatable().fngetnodes(); in case, should work: $('.testlink').click(function(){ var cells = []; var rows = $("#mytable").datatable().fngetnodes(); for(var i=0;i<rows.length;i++) { // html of 3rd

javascript - How can I change the form on clicking "Save", and then submit the final version of the form? -

i have form variable number of textboxes, , when click save (the submit button), want remove empty ones , save form without empty boxes. but it's half-working. when click save, empty boxes visually removed. moreover, there's validation error when boxes left empty, removeemptyboxes() there no validation error know boxes somehow removed before submit. when page refreshes, empty boxes reappear. on other hand, if divide 2 buttons , use 1 button removeemptyboxes() , click other button save, works fine , deleted boxes stay deleted. i'm sure can round in different way, it's frustrating doesn't work way want to. there way this? my form made using ajax.beginform. button looks this: <input name="xisubmit" type="submit" value="save" onclick="removeemptyboxes()" /> function removeemptyboxes() { $('div.box').each(function () { var content = $(this).find('.box-content').val(); if (content

wpf - Adjusting Button Visiblity with MouseOver -

i want display button when user puts mouse on location, once mouse leaves area, button should go being hidden. here code buttons. <stackpanel name="buttonoptions" orientation="horizontal" dockpanel.dock="bottom" background="darkblue" height="50" width="auto"> <!--<stackpanel.resources> <style targettype="button"> <style.triggers> <trigger property="ismouseover" value="true"> <setter property="visibility" value="visible"/> </trigger> </style.triggers> </style> </stackpanel.resources>--> <button name="loginbutton" fontsize="12" click="loginbutton_click" content="log in" width="100" height="31" margin="50,0,0,0" fontfamily

performance - cakephp website confusing load times -

i have website uses cakephp 1.3.10. cakephp app it's pretty big, not in amount of models or controllers (like 5 of each), in amount of plugins. use plugins places of website users can access (or can't access) depending on if have logged in or not (well there's more reasons, it's not important now, it's how works). use global auth component in app_controller.php my issue following: i've noticed website getting slow when trying access of pages of plugin (when accessing "home" page - not in plugin - good). the thing going run performance tests figure out what's going on. decided create website, 1 described, difference removed plugins exception of one. amazingly (for me), when access 1 of pages of plugin didn't delete, goes super fast, should go. so question is: number of plugins have direct impact on loading times of page inside plugins? there way "fix" this? or coincidence , else going on missed? thanks in advance advise!

javascript - Populate table with variable created from ajax response -

i have table populated data need use run second query. using jquery datatables , functions see allow me grab content table. example grabbing integer out of fourth column , using number run query json response : var cells = []; var rows = otable.fngetnodes(); for( var i=0;i<rows.length;i++) { var grabsku = $j(rows[i]).find('td:eq(3)').text(); grabsku = grabsku.substring(0, 6) + "-0" + grabsku.substring(7, grabsku.length - 4); s7url = 'http://jsonquery.com/' + grabsku + '?req=exists,json'; $j.ajax({ url: s7url, datatype: 'jsonp' }); } then ajax request json returns either 1 or 0 can form correct info depending on returned. function s7jsonresponse(response) { var s7img = sku; s7img = '<img src="http://imageserver.com/is/image/' + s7img.substring(0, 6) + "-0" + s7img.substring(7, s7img.length -

Operator overloading in C? -

is possible operator overloading or similar (inline function?) in c? know c not support class , make operator struct ? i cannot find online, because google ignore '+' if try google c++ results. no, can't in c. use c++ if want overload operators. you can put function pointers inside structure if want sort of c++ object-like behaviour.

Finding the Java Date of the next Monday 6:00, for example -

i trying create code in java can determine date of next recurring time of week specified. hard explain i'll give example. march 1st (a thursday) , user wants know when next saturday 5:00 code should output march 3rd, 5:00 date variable , if march 4th, program should output march 10th , on... the user however, can specify time of week want. done long value offsets time of week thursday 0:00 in milliseconds. i'm having trouble wrapping head around got far: public static long findnexttimeoftheweek(long offset) { return system.currenttimemillis() - ((system.currenttimemillis() - offset) % 604800000) + 604800000; } if help, appreciated. , if more clarification needed, ask. p.s. 604800000 number of milliseconds in week. i suggest use calendar class, can manipulate , date object using calendar#gettime . see example below, want: import java.util.calendar; import java.util.locale; import java.util.scanner; public class main { public static int dayofweeki

c++ - How can I get consistent program behavior when using floats? -

i writing simulation program proceeds in discrete steps. simulation consists of many nodes, each of has floating-point value associated re-calculated on every step. result can positive, negative or zero. in case result 0 or less happens. far seems straightforward - can each node: if (value <= 0.0f) something_happens(); a problem has arisen, however, after recent changes made program in re-arranged order in calculations done. in perfect world values still come out same after re-arrangement, because of imprecision of floating point representation come out different. since calculations each step depend on results of previous step, these slight variations in results can accumulate larger variations simulation proceeds. here's simple example program demonstrates phenomena i'm describing: float f1 = 0.000001f, f2 = 0.000002f; f1 += 0.000004f; // part happens first here f1 += (f2 * 0.000003f); printf("%.16f\n", f1); f1 = 0.000001f, f2 = 0.000002f; f1 += (f2

asp.net mvc - RenderPartial Views with CheckBoxes. -

for each each item available render partial view, in partial view have checkbox. purpose the user can select multiple items @ once, when hit delete items selected deleted. checkbox in partial view not within form like: <%= html.checkbox("isselected", model.isselected)%> so displays correctly, nothing. i asked question binding value model checkbox , worked fine. did: <%= html.checkbox("["+itemx+"].isselected", x.isselected) %> but have create partial view wondering how tie , values partial view? thanks. @felipe: answer not wrong, small performance improvement not call html.partial in loop. instead, call html.partial ones , pass in ienumerable model , loop through items in partial view. more info on topic: http://channel9.msdn.com/series/mvcconf/mvcconf-2-steven-smith-improving-aspnet-mvc-application-performance

facebook login to website with only javascript -

is possible? what i'm doing using this code wherein after line 37 intend setup cookie of own indicating logged in , redirect browser page. think that's not secure since user can javascript , mess cookie. isn't fb js sdk must doing behind scene, setting cookie? how can securely log in user website(i maintaining db table of fb ids)? you no need set separate cookie when using fb login authentication , data(fb uid). but still bit confused u ve do. far understood, if login u want redirect user other page else show him login button is correct?? then this: 1) have custom login button instead of fbml login button(make invisible first). 2) in setup() method if " response.status " connected redirect else show login button - onclick of button call fb.login() http://developers.facebook.com/docs/reference/javascript/fb.login/ login , authentication of ur site. 3) subscribe " auth.statuschange " instead " auth.login " http://

javascript - window.open(....) getting blocked in some browsers -

i have script opens window online application after executing other scripts. window.open() not called on click. getting called in script , browser prevents new window appearing. how overcome this? here code.. window.open('/search/applyonline?jobid=".$jobdetails->getidjob()."', 'applyurljob', 'height=550,\ width=800,\ toolbar=no,\ directories=no,\ status=no,\ menubar=no,\ scrollbars=yes,\ resizable=yes,\ left=200,\ top=250') popup blockers block windows being opened not in response click event. therefore can: ask users turn off popup blocker (not nice). change scripts work in response link or button click. use fake windows such jquery ui dialog .

xml parsing - Android: How to traslate "http://www.google.com/ig/api?weather="+cityName xml to get weather in other language? -

i can't traslate informations weather in other language. if change url "http://www.google.com/ig/api?weather="+cityname in "http://www.google.com/ig/api?hl=it&weather="+cityname to read information in italian following error: org.apache.harmony.xml.expatparser$parseexception: @ line 1, column 537: not well-formed (invalid token) i don't understand why... tokens , nodes equal english ones (try both urls). the code use here -> http://www.anddev.org/viewtopic.php?t=361 thank much... u need replace "&" "&amp," like : querystring.replace("&", "&amp,"); , = ;

c++ - How to declare an accessor to a member? -

in of classes accessors declared getname1 , in others getname2 . usage perspective, looks identical. there performance benefit of 1 on other in decent compiler? there cases should use 1 of two? class myclass { public: myclass(const string& name_):_name(name_) { } string getname1() const { return _name; } const string& getname2() const { return _name; } private: string _name; }; int main() { myclass c("bala"); string s1 = c.getname1(); const string& s2 = c.getname1(); string s3 = c.getname2(); const string& s4 = c.getname2(); return 0; } returning reference potentially faster, because no copy needs made (although in many circumstances return-value optimization applies. however, increases coupling. consider happens if want change internal implementation of class store name in different way (i.e. no longer in string ). there no longer return reference, need change public interf

Android: layout with imageView re-sizing buttons wrongly -

i have layout problem, want image in middle of 2 buttons. created 2 buttons , defined weightsum of 1. set weight of 2 buttons .40 , image .20 image small logo in middle of 2 buttons. problem image stretched out , buttons pushed aside. <button android:id="@+id/buttonclear" style="@style/buttontext" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_weight=".40" android:background="@drawable/custombuttonred" android:text="@string/clear" android:textsize="50sp" /> <imageview android:id="@+id/myimage" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight=".20" android:src="@drawable/imageid" /> <button android:id="@+id/buttonbackspace" style="@style/buttontext" android:layout_wid

case - SQL - Creating A Conditional Where Clause For This Simple Query -

i've been trying create conditional clause query below keep seeing many alternatives i'm not sure use in case. what need along lines of this: (though of course code wrong) where cascasetype='m' , cascurrentworkflowid=990 , cmsdatecreated between @fromdate , @todate case @wfstatus when @wfstatus=1 eveworkflowid<100 when @wfstatus=2 eveworkflowid<200 when @wfstatus=3 eveworkflowid<300 when @wfstatus=4 eveworkflowid<400 else 0 end so when choose wfstatus parameter 1, automatically engage section of clause bringing out results eveworkflowid less 100. any appreciated! thanks where cascasetype='m' , cascurrentworkflowid=990 , cmsdatecreated between @fromdate , @todate , eveworkflowid < case @wfstatus when 1 100 when 2 200 when 3 300 when 4 400 else 0 end

c# - Can't get Heads to show with only one record -

i pulling down records have count of 0 or more 1. query works , pulls down , looks great in sql results. looping through results , creating header , grouping them based on country , listing name of users country. this sql: select * ( select u.contactname ,cu.[user id] ,c.name ,c.id ,cu.[foreign table] ,count(*) on (partition c.id) user_in_this_country dbo.country c inner join dbo.countryuser cu on c.id = cu.[foreign id] inner join dbo.usercolder u on cu.[user id] = u.id exists ( select * countryuser cu2 cu2.[foreign id] = cu.[foreign id] , cu2.[user id] <> cu.[user id] , cu2.[foreign table] = 'country') ) t user_in_this_country > 1 or user_in_this_country = 0 order name asc this pull down data like: justin united states 2 bob united states 2 then method loop through , add headers/group is: string lastvalue = ""; protected string addgroupingheader(string value)

Android gps unit testing -

i developing android gps-based application. i have activity implements locationlistener , have implemented logic in onlocationchanged method. i want make unit test tests activity. want loop array of locations , send them activity onlocationchanged should fire. i have read couple of answers none of them provided complete solution. i happy if can explain me how it. regards, petar you use https://play.google.com/store/apps/details?id=ru.gavrikov.mocklocations&hl=en mock location data. can have "mock location" application ruining in background , make sure set fastest interval appropriately in application location updates periodically.

svn - How to version control a Flex/Flash Builder application's release build files using Subclipse? -

i need store release build of flash builder (flex) application in subversion. when try add version control via subclipse warning telling me have asked version control 1 or more resources otherwise have been ignored. know why happening, , how can around it? i've gotten around 1 time in past adding build release's directory repository using subversion client, i.e. outside of eclipse/flash builder, when rebuilt release later unable subclipse see changes between base/head revisions , new local versions of build release files. i realize i'm doing non-standard , suspect there default svn:ignore settings someplace causing happen, can't figure out these in order modify/bypass them. or maybe there's else going on? thanks in advance insight and/or issue. this eclipse-specific feature. eclipse has feature files produced compilers or generates inside eclipse can marked in eclipse "derived" resources. eclipse team providers supposed ignore these

javascript - Removing a variable's value without losing its children methods -

i'm trying remove value of array, without removing methods. consider following code: var project = function () { //the array data stored before sent.. this.data = []; // ... along function send data other source ... this.data.send = function () { } //here data altered ... //send data ... this.data.send(); //remove data, don't want when sending next time ... this.data = []; // ... (obviously) results in removal of send() function ... :-( } which remove function .send() , not behavior i'm looking for. what's smoothest , proper way dodge problem? thanks! sirko's suggestion should work, issue points design flaw, in opinion. why not expose array object, methods never changes, has internal array can manipulate @ will. var data = { items: [], push: function(item) { this.items.push(item); }, send: function() { // send items this.items = []; } } data.push('abc'); data.send()

internet explorer - How to debug issue on different browser with different versions at same time -

currently testing web ui interface , have test on different browser , different version. there way have 1 browser open multiple tabs on different versions , testing on 1 tab reflects on , if there issues highlights accordingly. applies iexplorer, firefox, chrome etc. its because faced 1 issue specific firefox 3.6.27 , issue not exists on ff 9 , 10 , 11. note: have found tool ietester – multiple internet explorer versions on same pc useful in case internet explorer. need thing similar firefox chrome. try spoon.net. allows run multiple versions of browsers @ same time such ie, firefox, chrome, safari, opera, etc,. it's not expensive.

php - Inaccuracies with Sperical Law of Cosines...specifically along latitude? -

i have strange problem using cosine formula in php application.. function calculatedistancecosine($deca, $decb) { $lon1 = $deca[0]; //this equal point a's longitude, , on.. $lat1 = $deca[1]; $lon2 = $decb[0]; $lat2 = $decb[1]; //echo $lon1." ".$lat1."<br/>"; //echo $lon2." ".$lat2."<br/>"; $distance = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($lon2-$lon1)); $distance = acos($distance); $distance = rad2deg($distance); $distance = $distance * 60 * 1.1515; $distance = round($distance, 4); return $distance; } my input this: 45.468055555556 -73.741388888889 //- coordinates montreal international airport 28.428888888889 -81.315833333333 //- orlando international airport however, upon using it, wild mistakes.. i.e, "the distance montreal orlando 576 km -- wrong." what's interesting is accura

ruby on rails - HAML app layout not being picked up? -

i'm working on 1st ruby on rails app. have set haml formatter , rendering views fine. however, have views/layouts/application.html.haml file basic layout, not being picked @ all. see on page may view's html. make fail picked up? make sure controller extends applicationcontroller , not actioncontroller::base . class somecontroller < applicationcontroller

python - Wiki markup language with excellent table support -

i'm developing wiki python/django, partly educational purposes. i'm still missing right markup language. tried quite view, including creole , markdown, worked except table support. common wiki markup languages seem support rudimentary tables, i.e. single line per cell or no complex markups within cells. users of wiki want able create tables bigger formatet text , lists within cells. have problems finding markup language can this. i've gazed upon mediawiki markup language seems support think using overkill. rest of markup can quite simple focus on easy-writability of markup (i find mediawiki markup ugly sometimes). furthermore, there must python module translating markup html can use in webapp. i'm still looking 1 mediawiki markup. another alternative dump wiki markup languages @ , instead allow set of defined html tags markup. makes harder write wiki articles, since html not invented such use. , finding , escaping forbidden html quite tricky. rather have nice ma

java - Garbage Collector taking too much CPU Time -

i've developed web application process huge amount of data , takes lot of time complete? so doing profiling of application , noticed 1 bad thing gc. when full gc occurred stops process 30 - 40 secs. i wonder if there way improve this. don't want waist cpu's time in gc. below details can useful: i using java 1.6.0.23 my application takes 20 gb max memory. a full gc occur after every 14 minutes. memory before gc 20 gb , after gc 7.8 gb memory used in cpu (i.e. shown in task manager) 41 gb. after process completed(jvm still running) used memory 5 gb , free memory 15 gb. the fewer things new , fewer things need collected. suppose have class a. can include in reference instance of class a. way can make "free list" of instances of a. whenever need a, pop 1 off free list. if free list empty, new one. when no longer need it, push on free list. this can save lot of time.

c# - Twitter API Safe Authentication -

i'm using c# twitterizer in wpf application authenticate users twitter can publish tweets stream. (but that's irrelevant because question api itself). i not wish create new login interface, want use twitter's login page embedded in webbrowser control. twitter support same authentication style facebook user logs in regular fb login page , access token sent in callback url ? or sending username , password way access token (in twitter)?! yes, twitter seupports same authentication style facebook called oauth. facebook uses oauth 2 , twitter uses oauth 1.0a take spring.net social twitter : http://springframework.net/social-twitter/ provides samples trying do.

mysql - Stored procedure - Update Query -

i not familiar sql stored procedure. i have 1 table called customer , has 1 feild called accountno. want update customer table new accountno , accountno should increment 1000. i want update customers in table , accountno 100,1001,1002..... thanks in advance, nimmy this update every customer in table update customer set accountnumber = accountnumber+1000 that's based on fact said "the customer table has 1 field - accountnumber". however, suspect table has key represents customerid (if not, should!!!) in case want update one specific customer's account number update customer set accountnumber = accountnumber+1000 customerid = 123

drupal - How to work with push notification module in drupal7? and how to store device token? -

i using push notifications module. 1 of friend did app iphone. gave me apns-development.pem file , stored in drupal/pushnotification/certificates folder. have give him url or web service , using web-service can give device_token parameter , devicetoken should stored in database sending push message particular device. pls me i'm author of push notifications module drupal. wrote brief tutorial registering device token using services here: http://www.danielhanold.com/story/drupal-7-push-notifications-how-to-register-a-device-token-using-services .

python - Can I use a parallel port for RS-232 on linux? -

the rs232 (db9) ports on machine full, write lcd scoreboard using parallel port. making cable correct pinout not problem. need interface device using python. here like: api similar pyserial, can set baud rate, , send string scoreboard. scoreboard has no requirements handshake or stop-bit, , supposed auto-detect. need write device, there no need read port. i aware of pyparallel, has used similar application? appears designed parallel (lpt) protocol. scoreboard support rs232, rs422, rs485, or 20ma current loop. have done fair bit of programming rs232 devices, technical knowledge of serial communications if limited. appreciated. http://pythonic-wisdom.blogspot.com/2008/11/accessing-parallel-port-on-linux-from.html in short, yes can, there limits on achievable baudrate, maximum via inb/outb, usable through python gpio module, around 300,000 operations second, @ 300kbaud if write port. using linux /dev/parport @ least twice slower. if need 9600 baud example, qui

Has anyone ever created a way to provide a user the ability to toggle permissions within an Android app? -

i creating android app has many newtorking capabilites, want provide them option toggle these permissions on , off. far in manfest have these permissions: <uses-permission android:name="android.permission.send_sms" /> <uses-permission android:name="android.permission.receive_sms" /> <uses-permission android:name="android.permission.call_phone"/> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.read_contacts" /> i want create preferences activity users can select check box allow each permission, possible? know permissions once added, set, way user have control whether permission can added or not added @ time. i way user have control whether permission can added or not added @ time. implement code requires additional permissions plugins, distributed separate apk files. way, user can install or uninstall plugin to, in effec

django - message publishing using kombu - TypeError 'str' object is not callable -

after encoding message payload json, i'm attempting publish broker with: connection = establish_connection() producer = producer(channel=connection, exchange="inbound", routing_key="apisubmit") producer.publish(body=pl,headers={"api_access_key": "xxxx", "client_id": 4, "object_type": "location", "action": "c"}) django returning following: traceback: file "/usr/local/pythonenv/openblock/lib/python2.6/site-packages/django-1.3.1-py2.6.egg/django/core/handlers/base.py" in get_response 111. response = callback(request, *callback_args, **callback_kwargs) file "/usr/local/pythonenv/openblock/src/myblock/myblock/barz/views.py" in testtwo 19. msg=publish_kombu() file "/usr/local/pythonenv/openblock/src/myblock/myblock/barz/messaging.py" in publish_kombu 99. ro

ruby on rails - rails3, simple_form, twitter bootstrap: radio buttons break onto differnet lines -

my rails 3.1.3 app using simple_form 2.0.1 , twitter_bootstrap_rails 2.0.3. all form elements looks fine except when use radio collection = f.collection_radio_buttons :my_fieldname, [['x1', 'foo'], ['x2', 'bar'], ['x3', 'foobar'], ['', 'none']], :first, :last the radio buttons , labels displayed vertically this: () foo () bar () foobar () none instead of this: () foo () bar () foobar () none i have "form-horizontal" class assigned simple_form_for, , other form elements fine. do need special class attached f.collection_radio_buttons? try this <%= f.input :save_it, :collection => [['yes',true] ,['no', false]], :as => :radio_buttons, :item_wrapper_class => 'inline', :label => 'save now?' %>

python - Interpolation of large 2d masked array -

i have numpy masked matrix. , wanted interpolation in masked regions. tried rectbivariatespline didn't recognize masked regions masked , used points interpolate. tried bisplrep after creating x,y,z 1d vectors. each of length 45900. took lot of time calculate bsplines. , gave segmentation fault while running bisplev . 2d matrix of size 270x170. is there way make rectbivariatespline not include masked regions in interpolation? or there other method? bisplrep slow. thanking you, indiajoe update : when grid small scipy.interpolate.rbf 'linear' function doing reasonable job. gives error when array large. is there other function allow me interpolate , smooth matrix? i have concluded following. correct me if wrong. 1) rectbivariatespline requires perfect filled matrix , hence masked matrices cannot used. very late, but... i have problem similar yours, , getting segmentation fault bisplines, , memory error rbf (in "thin_plate" function works g

Nginx rejects custom HTTP Methods if not all upper-case -

if http method not upper-case, nginx rejects request , sends 400 response along internal 400 html error page. no details shown on "error_log info" example: link, link, search, verb, etc ... upper-case versions of work, jut mixed case. from http 1.1 rfc ; the method token indicates method performed on resource identified request-uri. the method case-sensitive . as far can tell, nginx doing right thing according specification. if disagree, you'll have explain think it's doing wrong more clearly. edit: yes, agree answer @julianreschke, should return 501 status code, not 400, catch.

android - View show's error in List View -

i have prolblem list view.i have placed edittext in listview entering data list of items in list view.i have took data edittext row row listview.\ i can see 5 row in listview , next reows need scroll list view. the problem arise here can took data listview upto 5 rows view means of took valuse form edittext in list. but when comes 6th row shows null pointer exception plced identify edittext.(textview decatered_load = (textview) vlvtopup.findviewbyid(r.id.etconfirmdecaterednumber);) point of error arise @ here. (int = 0; < lvconfirmdecater.getadapter().getcount(); i++) { hashmap result = (hashmap) lvconfirmdecater.getitematposition(i); view vlvtopup; vlvtopup = lvconfirmdecater.getchildat(i); textview decatered_load = (textview) vlvtopup .findviewbyid(r.id.etconfirmdecaterednumber); textview decatered_reason = (textview) vlvtopup .find