Posts

Showing posts from August, 2014

How to make android activity run in parallel -

How to make android activity run in parallel - i have 2 class, 1 activity can handle chronometer, handle locationlistener.i want run them utilize stopwatch , changed location. anyone have samples or suggestions ? thanks addition: sorry confuse question. need know how create chronometer run while keeping location changed. well, utilize locationlistener add together location array every time changed maintain track of location. example: public class myclass implements locationlistener{ private static list<location> locationlist = new arraylist<location>(); @override onlocationchanged(location location){ locationlist.add(location); } } then utilize system.gettimemillis() (or akin) when want start time, , same method when want end time. subtract 2 time difference , how long took. android android-activity parallel-processing chronometer

python - Adding two IDs to my urls dispatcher -

python - Adding two IDs to my urls dispatcher - i'm relatively new python/django. i'm having issue sending ids through urls.py. i trying add together admin business profile page in project. my views.py: @login_required def make_admin(request, bus_id, user_id): user = request.user u = get_object_or_404(user, pk = user_id) b = get_object_or_404(business, pk = bus_id) b.admin.add(u) followcount = b.followers.count() photo = businesslogo.objects.all().filter(business_link = bus_id)[:1] homecoming render_to_response('business/followers.html', {'user':user, 'b':b, 'followcount':followcount, 'photo':photo, 'u':u}, context_instance=requestcontext(request)) in template trying pass bus_id user_id maintain getting syntax error, assuming related urls. my template: ... {% if follow in b.admin.all %} [<a href="{% url remove_admin b.id u.id %}">remove admin</a>] {% else %} [<...

django - Modeling hierarchical location data -

django - Modeling hierarchical location data - i've struggled problem time now, researched dozens of places, tried multiple methods i'm still struggling elegant , efficient solution. i'm model mastermind can me on track. i'm trying model location info in using django 1.3. example, states have cities, cities have buildings, buildings, have rooms , rooms have devices/hardware. have working solution i'm running (n+1) number of query problem traversing relationships. in views, want specify state , increment through of cities in state, building, rooms , devices. number of queries increment number of buildings, rooms, devices. currently, if want see of buildings, rooms, devices in state, perform query cities in state , utilize _set method follow foriegn keys backwards, looping city, looping buildings, looping rooms etc. models.py class city(models.model): ...

CSS Sticky footer issue -

CSS Sticky footer issue - i trying implement css sticky footer on next page: http://www.tuhdoo.com/test/index.htm as can see works point there 20px overhang @ bottom of screen causes scrolling (firefox). can help please? i next tutorial: http://css-tricks.com/snippets/css/sticky-footer/ i think issue caused padding-top:20px on body element. seek moving body > #container > header element instead. css sticky-footer

python - Open the file in universal-newline mode using the CSV Django module -

python - Open the file in universal-newline mode using the CSV Django module - i trying access model.filefield in django parse csv file in python using csv module. it's working on windows, on mac gave me this: exception type: error exception value: new-line character seen in unquoted field - need open file in universal-newline mode? this code: myfile = customerbulk.objects.all()[0].fileup mydata = csv.reader(myfile) email,mobile,name,civilid in mydata: print email,mobile,name,civilid i found solution: mypath = customerbulk.objects.get(pk=1).fileup.path o = open(mypath,'ru') mydata = csv.reader(o) python django osx csv newline

.net - Why I got System.OutOfMemoryException when using this code? -

.net - Why I got System.OutOfMemoryException when using this code? - dim output1 = system.io.file.readalllines(file).tostring the file size 1 gb. page file 128 gb. why out of memory? it's 64bit system. because there many different factors go oom exceptions. start "out of memory" not refer physical memory. an "out of memory" error never happens because there’s not plenty storage available... rather, "out of memory" error happens because process unable find big plenty section of contiguous unused pages in virtual address space requested mapping. you should read clr within out - investigating memory issues. the process can run out of virtual space if virtual memory overly fragmented. so not @ file size verses pagefile, need examine else application doing , other processes running on system. .net vb.net memory out-of-memory

c# - A control with ID could not be found for the trigger in UpdatePanel -

c# - A control with ID could not be found for the trigger in UpdatePanel - i have update panel has updatemode of conditional , childrenastriggers set false. want few controls cause asynchronous postback: <asp:updatepanel id="updpnlmain" runat="server" updatemode="conditional" childrenastriggers="false"> <contenttemplate> // ... <asp:repeater id="rptlistdata" runat="server"> <itemtemplate> <asp:button id="btnaddsomething" runat="server" onclick="btnaddsomething_click" /> </itemtemplate> </asp:repeater> // ... </contenttemplate> <triggers> <asp:asyncpostbacktrigger controlid="btnaddsomething" eventname="click" /> </triggers> </asp:updatepanel> i getting next error when seek , load page: a command id 'btnaddsomething' not f...

facebook - Is it Possible to FQL list of friends who own specific phone ?(query from wallpost source) -

facebook - Is it Possible to FQL list of friends who own specific phone ?(query from wallpost source) - i've notice each wall post mobile phone have like "44 minutes ago via blackberry" "3 hours ago via iphone" , if click on word "blackberry" or "iphone" it'll redirect to http://www.facebook.com/mobile/?v=6628568379 (for iphone) or http://www.facebook.com/mobile/?v=2254487659 (for blackberry) is there anyway can fql user's friends specific phone(or access "v" value) using these source above ? thanks. there's no way query 'friends utilize device', via news feed can determine users check out 'stream' fql table: https://developers.facebook.com/docs/reference/fql/stream/ with access_token read_stream permission 1 of users can go through posts in news feed , check app_id column see app used post story. surface devices users who've posted visible in app user's feed, it's start ...

c++ - crash on 64bt platform -

c++ - crash on 64bt platform - i think found simliar thread here, not understand much unfortunately related c++. prob seems occure while trying increment something. incrementing `static int` causes sigsegv segv_accerr after looking @ above link,(as have feeling similar) segmentation fault doesn't seem occur always, occurrence pretty rare. dump seems happen in function , when find called. seems seek give hashtbl::find key 0. tries dereference , fails. add together printing key std::out , check keys using. c++ ia64 itanium

c# - Creating a ribbon button to open a browser link -

c# - Creating a ribbon button to open a browser link - i'm looking create ribbon button ol2k10 add-in opens specific website. i've seen references creating button using commandbars, different i'd accomplish. ideas welcome usual. i think here can do: in ribbon button click event function, write next code allow launch web browser accessing given url, e.g. http://stackoverflow.com string myurl = "http://stackoverflow.com"; system.diagnostics.process.start(myurl); okay, guess that's pretty much need. :) c# outlook outlook-addin

node.js - how to list rooms on socket.io nodejs server -

node.js - how to list rooms on socket.io nodejs server - after progress on question how create socket.io multicast groups, found making rooms great way needed. however, great know rooms, without data-structure. is possible list of rooms on server server socket? the short answer: io.sockets.adapter.rooms i analysed io : i got next output: { server: { stack: [ [object], [object], [object], [object], [object], [object] ], connections: 3, allowhalfopen: true, watcher: { host: [circular], callback: [function] }, _events: { request: [function], connection: [function: connectionlistener], listening: [object], upgrade: [object] }, httpallowhalfopen: false, cache: {}, settings: { home: '/', env: 'development', hints: true }, redirects: {}, iscallbacks: {}, _locals: { settings: [object], app: [circular] }, dynamicview...

google app engine - How do I find out whether a Python module is run on GAE? -

google app engine - How do I find out whether a Python module is run on GAE? - i have module uses lxml. since cannot imported on gae, i'd utilize suitable substitute default. along lines of: if not on_gae: import lxml else: import beautifulsoup how can determine i'm on gae? there os variable of sorts? update: there modules not run on gae (like sockets ). rather having multiple blocks of try ... except importerror , i'd know start code blocks needs alternative implementation. you can utilize this: on_app_engine = os.environ.get('server_software', '').startswith('google') then like: if on_app_engine: import lxml else: import bla python google-app-engine

android - How to create datePicker and timePicker dialogs in fragment class? -

android - How to create datePicker and timePicker dialogs in fragment class? - i want know there way create datepicker in fragment? creating 1 regular activity may , gives me syntax error. right way this? you need utilize dialogfragment. found info here: show dialog fragment? and big help here: https://github.com/commonsguy/cw-advandroid/blob/master/honeycomb/feedfragments/src/com/commonsware/android/feedfrags/addfeeddialogfragment.java this should help on way, doing thing now. though within illustration code don't utilize builder , instead return: return new datepickerdialog(getactivity(), mdatesetlistener, myear, mmonth, mday); this seems work... though cannot figure out yet how update text on fragment calls dialogfragment. thought work , doesn't: public void updatedisplay() { //update our button text calling fragment, isn't quite working //doesn't crash doesn't update...must missing something. view v=getactiv...

database - Counting no. of records from multiple tables; Oracle DB -

database - Counting no. of records from multiple tables; Oracle DB - i know need utilize query list of tables schema: select table_name all_tables owner='schema' i know next query counts record in table: select count(*) schema.table there 2400+ tables in schema. question how count number of records tables using 1 step? the table all_tables contains column num_rows . (you can description of table next sql statement: describe all_tables; ) the next statement shows number of records every table: select table_name, num_rows all_tables owner='schema'; to number of records in tables of schema, use: select sum(num_rows) all_tables owner='schema'; database oracle

python - Twisted application without twistd -

python - Twisted application without twistd - i've wrote nice app myself using twisted framework. launch using command like: twistd -y myapp.py --pidfile=/var/run/myapp.pid --logfile=/var/run/myapp.log it works great =) to launch app wrote script command because i'm lazy^^ since launch app same twistd option, , tink script shell solution ugly, how can same within app? i'd launch app doing ./myapp , without shell work around. i've tried search in twisted documentation , reading twisted source don't understand since it's first app in python (wonderful language btw!) thanks in advance anyhelp. you need import twistd script module twisted , invoke it. simplest solution this, using existing command-line, import sys module replace argv command line how want twistd run, , run it. here's simple illustration script take existing command-line , run python script instead of shell script: #!/usr/bin/python twisted.scripts.twistd impo...

How to make Hibernate not drop tables -

How to make Hibernate not drop tables - i using hibernate , whenever seek add together record, drops table , adds it. never uses existing table , create changes on that. this relevant part of hibernate.cfg.xml: <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">org.apache.derby.jdbc.clientdriver</property> <property name="hibernate.connection.url">jdbc:derby://localhost:1527/sample</property> <property name="hibernate.connection.username">user</property> <property name="hibernate.connection.password">password</property> <property name="hibernate.connection.pool_size">10</property> <property name="show_sql">true</property> <property name="dialect">org.hibernate.dialect.derbydialect</property> <property name="hibernate.hbm2ddl.auto">upda...

Manipulate Rebex.MailMessage Html String -

Manipulate Rebex.MailMessage Html String - i working on message watcher service have , task embed message details message body. i have tried using string builder have found message body html based string. i'm wanting know if there way can add together values want add together @ point in html string? below section of html string want manipulate. text needs inserted straight after body tag. <body lang=en-gb link=blue vlink=purple> <div class=wordsection1> <p class=msonormal> <span style='font-size:10.0pt;font-family:"century gothic","sans-serif";color:black'>another test appendline();<o:p></o:p> </span> </p> here how trying it: stringbuilder sb = new stringbuilder(); sb.append("from: "); sb.append(message.from.tostring()); sb.appendline(); sb.append("sent: "); sb.append(message....

css - IE fix for png not working -

css - IE fix for png not working - does know why code below not working? utilize method opposed of javascript method(s). tried absolute path no luck. .test { width: 500px; /* must specify width */ height: 176px; filter:progid:dximagetransform.microsoft.alphaimageloader(sizingmethod=scale, src='../images/test-bg.png'); } i think sizingmethod=scale needs sizingmethod="scale" css xhtml internet-explorer-6

How to return PHP array and receive it with Java -

How to return PHP array and receive it with Java - i have on webservice: function listar($username) { $result = mysql_query("select name apks tipo=0"); //$registo = mysql_fetch_array($result); $numero = 0; while($registo = mysql_fetch_array($result)) { $regs[$numero] = $registo['name']; $numero++; } homecoming $regs; //return mysql_fetch_array($result); } in java, after soap phone call (not relevant now) read way: object response = envelope.getresponse(); string x = response.tostring(); i need access 1 of fields (selected database) thought, why not split array strings? i tried 2 methods: string[] arr=x.split(&quot; &quot;); system.out.println(&quot;array :&quot;+arr.length); for(int i=0;i&lt;arr.length;i++) { .. } stringtokenizer starr=new stringtokenizer(x,&quot; &quot;); while(starr.hasmoretokens()) ...

extjs - Format date on Grid Panel not works, strange ..! -

extjs - Format date on Grid Panel not works, strange ..! - i have gridpanel cellediting plugins .. ! i utilize datefield renderer : ext.util.format.daterenderer('y/m/d') format dysplay , when model grid , have format ... my datefield definition : header : 'start date', dataindex : 'start_date', id : 'start_dategridid', flex : 2, //renderer: formatdate, renderer: ext.util.format.daterenderer('y/m/d'), field : { xtype : 'datefield', anchor : '20%', itemid: 'start_date', disableddays : [0,6], altformats: 'y/m/d', format : 'y/m/d', editable: false, value : '""', allowblank : true } when retrieve model : var model = mystore.getat(0); model.get('start_date'); // have "wed jul 20 2...

facebook - How can i store and access flash symbols in a database? -

facebook - How can i store and access flash symbols in a database? - just facebook game, see playing facebook social game, still have downloading when click on item first time, or doing new. people can split flash many parts , connect them when need? yes, it, can utilize dynamic loading of info (images, text, binary data, xml other .swf's (flash files)) load things use/require them. it's done programs utilize daily, when open textfile, movie, webpage etc. for now, start simple, loading image flash. this actionscript 2. it's big tutorial, @ to the lowest degree spells out. http://flashexplained.com/actionscript/loading-external-jpgs-into-your-main-swf-movie/ and if want research little bit more: http://www.google.com/search?rlz=1c1chny_srrs374rs374&sourceid=chrome&ie=utf-8&q=flash+dynamic+loading add in "image" or "text" or "xml" or "swf" or whatever behind search term find more tutorials on th...

how to get log in ISA server 2006 C++ SDK without memory leak -

how to get log in ISA server 2006 C++ SDK without memory leak - i wrote method session log info isa server 2006 sdk the main code below , have utilize code in do-while() sessions info line create leak memory . at end released pointer of fpclib::ifpclogentryptr mem leak still exist . :( please help me problem . fpclib::ifpclogentryptr = fpclib::ifpclogcontentptr::item(index) . . // reading informationsuch ip, url , byte send , .... . fpclib::ifpclogentryptr.release(); hr = logfilter.createinstance("fpc.fpcfilterexpressions"); hr = logfilter->put_filtertype(fpclib::fpcfiltertype::fpcnofiltertype); fpclogviewer = fpcarray->logviewer; logcontent = fpclogviewer->getlogcontentonline(); logcontent->executequery(logfilter,executerowcount); fpclib::ifpcl...

jQuery/Javascript function to clear all the fields of a form -

jQuery/Javascript function to clear all the fields of a form - this question has reply here: resetting multi-stage form jquery 29 answers i looking jquery function clear fields of form after having submitted form. i not have html code show, need generic. can help? thanks! you can utilize javascript's native reset() method reset entire form default state. example provided ryan: $('#myform')[0].reset(); note: may not reset fields, such type="hidden" . update as noted ilyadoroshin same thing can accomplished using jquery's trigger() : $('#myform').trigger("reset"); update if need more reset form default state, should review answers resetting multi-stage form jquery. javascript jquery

c++ - How does overloaded template function selection (pattern matching) work in std::vector insert? -

c++ - How does overloaded template function selection (pattern matching) work in std::vector insert? - consider next declarations of std::vector (taken cplusplus - eastl has same declarations) iterator insert ( iterator position, const t& x ); void insert ( iterator position, size_type n, const t& x ); template <class inputiterator> void insert ( iterator position, inputiterator first, inputiterator lastly ); if type somevector.insert(somevector.begin(), 10, 90); how not confused (by compiler) lastly overload, 10 , 90 int s , inputiterator 's type taken int instead of alternative take 10 size_type , 20 const int& ? now "not" because implementing vector container (learning purposes) , in case above mentioned call, 3rd overload selected compiler rather sec overload , consequently fails compile. if remove 3rd overload things seem fine. does have lastly overload calling (overloaded functions iterator traits)? if ...

Having trouble assigning to a generic delegate in C# -

Having trouble assigning to a generic delegate in C# - my problem follows: public abstract class {} public class b : { public static ilist<b> mymethod(){ homecoming new list<b>();} } public delegate ilist<t> mydelegate<t>() t : a; ... public static void calledmethod<t>() t : a{ mydelegate<t> del = b.mymethod; // doesn't work } can explain best way work? thanks help. edited prepare example. here's why not work public class c: {} calledmethod<c>(); this means del of type mydelegate<c> not work b.mymethod because c not b . c#

asp.net - How to find nested controls within nested user controls -

asp.net - How to find nested controls within nested user controls - i have user command (control1) has placeholder may contain several additional user controls (of same type - see below) added dynamically. how navigate user command hierarchy find values of nested sets of controls when button located in command 1 clicked? control 1: <%@ command language="c#" autoeventwireup="true" codebehind="control1.ascx.cs" inherits="control1" %> <%@ reference control="control2.ascx" %> <div id="div1"> <div id="divph"><asp:placeholder id="phcontrols" runat="server" /></div> <div id="divcontinue"><asp:button id="btncontinue" text="continue" onclick="submit_click" runat="server" /></div> </div> code behind control1.aspx: protected void submit_click(object sender, eventargs e) { /...

Android: strange thing about loading contact info -

Android: strange thing about loading contact info - i created app. working on htc want hd, when tested on zte blade, unusual problem appeared. in app when user selects contact name spinner menu appears. in menu user can send sms user, phone call him/her or @ his/her contact info. on htc want hd, working fine. on zte there seems exasperating problem contact info button: in cases when user selects contact , wants see contact info, other contact's info shown. select pete spinner dave's contact info. in other cases select tom spinner , tom's contact info. problem not existing on htc. couldn't figure out causes problem. way, contact list on htc populated gmail , facebook , app still working fine, while contact list of zte has never seen gmail or facebook accounts (i not exclusively sure this). this code using contact info: infobtn.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { ...

Active record joins in rails 3.1 -

Active record joins in rails 3.1 - trying homecoming comments associated articles written particular user. next code gives me error: undefined method `joins' #<user:0x000001042c8bc0> under rails 3.1 class user has_many :articles def comments self.joins(:articles => :comments) end end you want has_many :through here. class user has_many :articles has_many :comments, :through => :articles end ruby-on-rails ruby-on-rails-3 activerecord join

JQuery: Accordion style menu toggle -

JQuery: Accordion style menu toggle - i'm trying create simple accordion style menu using divs: <div class="subdomainlevel"> subdomain <a href="#" class="pagetoggle">open/close</a> <div class="pagelevel">page level <a href="#" class="messagetoggle">open/close</a> <div class="pagemessage">message</div> </div> </div> <div class="subdomainlevel"> subdomain <a href="#" class="pagetoggle">open/close</a> <div class="pagelevel">page level <a href="#" class="messagetoggle">open/close</a> <div class="pagemessage">message</div> </div> </div> my jquery follows: var page = $(".subdomainlevel").children(".pagelevel"); $(".pagetoggle").click(function (...

Search & Highlight using JQuery -

Search & Highlight using JQuery - i need highlight searched text when page loaded , whole words match specific word highlighted . i know can utilize id of div & accordingly highlight field . the issue here have complex construction of div have found on google works on "p:" var str = "test"; $(function(){ $('p:contains('+str+')'). each(function(){ var regex = new regexp(str, "g"); $(this).html( $(this).html(). replace( regex , "<span class='highlight'>"+str+"</span>" ) ); }); }); i have tried mess code loop on div instead , couldn't reach solution i have found reply solution here . jquery

php - how to i take added data's id? (mysql) -

php - how to i take added data's id? (mysql) - (my first language not english) i'm inserting new info mysql want take added data's id in same page. for example: (im using auto increment) $sql = "insert illustration (name) values ('$name')"; $query = mysql_query($sql,connectdb()); if ($query) { homecoming /*added info id*/; } how do? just phone call mysql_insert_id() homecoming created id. if ($query) { echo mysql_insert_id(); } php mysql sql

javascript - Youtube api - stop video -

javascript - Youtube api - stop video - i need help youtube api , embeded videos. want stop video when clicked on element (div,link,td etc.). trying work 1 video now, final function of script should stop videos loaded on current page. have read thru yt api documentation im beginner in js still quite hard understand me. <html> <head> <script type="text/javascript" src="swfobject.js"></script> </head> <body> <a href="javascript:ytplayer.stopvideo()">play</a> <br/> <iframe id="ytplayer" src="http://www.youtube.com/embed/8ax-dar3abs?rel=0&iv_load_policy=3&showinfo=0&enablejsapi=1&version=3&playerapiid=ytplayer" type="application/x-shockwave-flash" frameborder="0" allowscriptaccess="always"></iframe> </body> </html> thanks in advance advices you can't command if embed iframe. have utili...

java - Can ModelAttribute be primitive? -

java - Can ModelAttribute be primitive? - i having unusual problem modelattribute in spring mvc 3.0. when deploy app @ localhost, works fine. when deploy app on remote server, fails everytime user access specific action, errors: error: my.package.application.web.filter.exceptionfilter - long.<init>() java.lang.nosuchmethodexception: long.<init>() @ java.lang.class.getconstructor0(class.java:2706) @ java.lang.class.getdeclaredconstructor(class.java:1985) @ org.springframework.beans.beanutils.instantiateclass(beanutils.java:104) @ org.springframework.web.bind.annotation.support.handlermethodinvoker.resolvemodelattribute(handlermethodinvoker.java:762) @ org.springframework.web.bind.annotation.support.handlermethodinvoker.resolvehandlerarguments(handlermethodinvoker.java:356) @ org.springframework.web.bind.annotation.support.handlermethodinvoker.invokehandlermethod(handlermethodinvoker.java:153) @ org.springframew...

android - Change the language from app? -

android - Change the language from app? - how can alter language phone android app? can give me example? thanks in advance. phone-level language command typically done using restricted interfaces: far aware there no direct command app part of public android interface. your best bet utilize intent open language picker. intent filter is: <intent-filter> <action android:name="android.intent.action.main" /> <action android:name="android.settings.locale_settings" /> <category android:name="android.intent.category.default" /> <category android:name="android.intent.category.voice_launch" /> </intent-filter> so should work: intent = new intent(); i.setaction(android.provider.settings.action_locale_settings); i.addcategory(intent.category_default); i.startactivity(); and user can pick language there. an...

php - how to create a new page when someone adds a database entry? -

php - how to create a new page when someone adds a database entry? - how create new webpage user submitted database entry? i've read question have not quite understood yet. maybe can offer little help? basically, have frame has main menu , links side. refreshing links side, know have page newly added when database entry added still confuses heck out of me. is there other way explain little me? if new php, there frameworks can help that. yii framework can generate crud (create read update delete) pages database construction have. watch screencasts here: http://www.yiiframework.com/screencasts/ php mysql html

asp.net - How can I do a validation if user back/forward in IE -

asp.net - How can I do a validation if user back/forward in IE - i have website needs login before viewing main page, , here 2 cases user login , redirect main page, , click "back" button login page, click "forward" button go main page user login , redirect main page, , types other website "www.google.com" in addressbar visit google, utilize "back" button go main page how can avoid these 2 cases happening? thank you add code in page_init in home page response.cache.setcacheability(httpcacheability.nocache); response.cache.setexpires(datetime.now); and in home page protected void page_load(object sender, eventargs e) { if (!ispostback) { if (session["userid"] == null) response.redirect("loginpage.aspx"); else session["userid"] = null; } } asp.net validation

Performing "Optimized" set Operations on java.util.ArrayList or in SQL -

Performing "Optimized" set Operations on java.util.ArrayList or in SQL - this first time need inquire question query solved before today previous threads able solve queries. scenario: have 2 tables(lets & b) in database same rows , different rows. point note both tables have millions of rows or @ to the lowest degree more million. now have perform set operations on them no. of same rows (intersection) , no. of new rows(a-b) , no. of old rows (b-a). i have 2 choices: 1) can perform set operations query it-self on database. 2) or can fetch records , perform operations on java.util.arraylist in memory. but in both cases taking long around 5 10 mins best(optimized) approach this. please help. first of all, union , minus , etc. not operations on tables, on select statement results. in case scanning huge tables, create huge result sets , compare each of results. slow. have optimize in way indices can used. second, loading results db java, , process...

best fit curve - LabView cos fitting -

best fit curve - LabView cos fitting - i working on programme needs fit numerous cosine waves in order determine 1 of parameters function. equation using y = y_0 + acos((4*pi*l)/x + pi) l value trying obtain best fit line. i know possible correctly hand each set of data, best way automate process? reading in info text files, , running loop initial paramiters changing until have array of paramater values have amplitude similar data, check percent difference between points on center peak , 2 end peaks seek pick best one. in consistently picking lower values when fitting hand (almost 1 phase off). there way improve method, or method works better? edit: labview version has cos fitting vi using, problem when seek automate fitting changing initial parameters using loop, cant figure out how programme pick same best fit line human pick. why not utilize fast fourier transform? should way faster fitting cosine. in result vector of complex numbers largest peak of in totals....

php - How to user predis for publish more than one time -

php - How to user predis for publish more than one time - how can publish info between clients more once? mean when publish info 1 user other, receives , backwards, once. because when 1 user send other, beingness loaded , receiving stops, how can create way clients receives forever, not once? how pub/sub works channel, set 1 side , same other side. so publisher info received when there subscriber it. use pubsub context , subscribe channel "x" , side, maintain taking info , user, , publish using publish command every time same channel. subscriber: $redis = new predis\client(// set setting here, if req); $pubsub = $redis->pubsub(); $pubsub->subscribe($channel1); foreach ($pubsub $message) { switch ($message->kind) { case 'subscribe': echo "subscribed {$message->channel}\n"; break; case 'message': // break; } } publisher: while(1) /...

javascript - can you bind .click() so that it fires prior to onclick? -

javascript - can you bind .click() so that it fires prior to onclick? - i'm writing jquery app that's beingness build in jsf. jsf components using lot of own js doing whatever jsf , utilize lot of onclick attributes handle all. is there valid/proper way bind own click event element , ensure event fires prior default onclick event? appears default jquery click function fired after inline onclick function calls. in jquery events triggered strictly in order in registered. you can circumvent inline dom0 onclick style handlers iterating on whole dom, removing onclick properties, , registering own handler then invokes defined function. something like: $('[onclick]').each(function() { var handler = $(this).prop('onclick'); $(this).removeprop('onclick'); $(this).click(handler); }); see http://jsfiddle.net/alnitak/2sctk/ so, register own handlers first jquery, invoke code above remove original inline onclick handlers , r...

wolfram mathematica - How to improve sensietivity of EventHandler to MouseDragged and MouseClicked events -

wolfram mathematica - How to improve sensietivity of EventHandler to MouseDragged and MouseClicked events - using eventhandler, notice thinks dragging mouse, though clicking it. here simple example eventhandler[graphics[circle[{0, 0}, 1]], "mouseclicked" :> print["mouse clicked"], "mousedragged" :> print["mouse beingness dragged"] ] when start clicking, though create sure mouse fixed , not moving, , maintain clicking, , looking @ print messages, 1 time in while see dragging message come out. i understand can sensitive mouse (but have mouse), may mouse pad, os, , slight motion hand, might cause this. i wanted inquire if seek , see if notice problem well, , if knows setting can in mathematica minimize this. looking alternative eventhandler set time or delay when decides mouse beingness dragged, see nothing. here illustration output of on scheme when clicking after running above code mouse beingness dragge...

Javascript: How can a popup close itself? -

Javascript: How can a popup close itself? - i have page open in popup , open normally. how can create link closes page if it's in popup? use javascript: window.close(); or in link: <a href="javascript: window.close();">close me</a> javascript popup

ajax - How do I get a reference to "Microsoft.Web.Preview" to resolve? -

ajax - How do I get a reference to "Microsoft.Web.Preview" to resolve? - i'm trying include validator on form launched modalpopupextender command found in ajax toolkit. asp.net 2.0 web application. several articles show how this, include reference: <asp:scriptreference assembly="microsoft.web.preview"name="previewscript.js" /> this article i've based page on testing. http://usefulaspnet.blogspot.com/2007/03/modal-popup-with-textbox-and-validator.html the problem i'm running file cannot found when page tryies open. is there improve way want where can find file? it turns out #1 right answer. all had create sure validators in popup in same validation group. ajax modalpopupextender validation

perl - Sys::Info - Question -

perl - Sys::Info - Question - from sys::info::device: if device_id has value of available, names of available devices returned. why $info->device('available'); homecoming no devices when there @ to the lowest degree cpu-device? #!/usr/local/bin/perl utilize warnings; utilize 5.014; utilize sys::info; $info = sys::info->new; @available = $info->device('available'); 'available devices: ', scalar @available; $cpu = $info->device( 'cpu' ); 'number of cores: ', $cpu->count; output: available devices: 0 number of cores: 2 i same output running on mac os x box. might contact developer. perl device

c# - Synchronization accross threads / atomic checks? -

c# - Synchronization accross threads / atomic checks? - i need create method invoker thread (thread b illustration sake) can call, execute on main executing thread (thead a) @ specific given point in execution. example usage follows: static invoker invoker = new invoker(); static void threada() { new thread(threadb).start(); thread.sleep(...); // hypothetic alpha invoker.invoke(delegate { console.writeline("action"); }, true); console.writeline("done"); console.readline(); } static void threadb() { thread.sleep(...); // hypothetic beta invoker.execute(); } the invoker class looks this: public class invoker { private queue<action> actions { get; set; } public invoker() { this.actions = new queue<action>(); } public void execute() { while (this.actions.count > 0) { this.actions.dequeue()(); } } public void invoke(action acti...

oop - Ruby class associations -

oop - Ruby class associations - i'm having problem creating class association in ruby, since it's dynamic typed language. in java, write this: public class foo { ... } public class bar { public foo foo; ... } how can write similar in ruby? class foo end class bar attr_accessor :foo def initialize (foo) @foo = foo end end foo = foo.new bar = bar.new(foo) puts bar.foo for say, seems need kind of type safety. can accomplish doing def initialize (foo) raise argumenterror, "you must provide valid foo instance" unless foo.instace_of?(foo) @foo = foo end ruby oop associations

android - what is the meaning of suggestions in a Content Provider Uri? -

android - what is the meaning of suggestions in a Content Provider Uri? - i've got uri below: content://com.android.contacts/contacts/#/suggestions info return? what's meaning of 'suggestions' here? thanks in advance! the contacts api references contactscontract helper classes dealing contacts. "suggestions" string identifying aggregationsuggestions sub-table (note constant called content_directory), used provide info how rawcontacts appear describe same person aggregated single contact. android android-contacts android-contentprovider

How to block jquery on an element -

How to block jquery on an element - i work rather complicated web ui includes lot of javascript, much of implemented using jquery. it's job override default javascript , effort create customers happy minor customizations here , there. sometimes there bits of javascript know in ui, , need override, can take me long time track them down. 1 time i've tracked them down, haven't yet come way of blocking default jquery events might set selection. is there easy way utilize jquery create selection , define own actions it, or block jquery on selection completely? for example, default ui seems define onclick event links, preventing me doing seemingly simple task of adding target="_blank" link. "seems" because haven't been able find javascript doing this, need can create minor customization. check our jquery's stopimmediatepropagation() . prevents other event handlers beingness called. jquery

Python: What's wrong with my xpath expression? -

Python: What's wrong with my xpath expression? - i have this: <div class="down_butt_pad1" style="" id="downloadlink"><a href="http://www.link.com" class="down_butt1" onclick="javascript:window.open('http://s.spam.com','popunder','width=800,height=800,scrollbars=yes,status=no,resizable=yes, toolbar=no'); window.focus();"></a></div> i'm trying xpath("//div[@id == 'downloadlink']") error ("lxml.etree.xpathevalerror: invalid expression"). what's wrong doing , how can search div id has downloadlink instead then? you have utilize single = in xpath. you're looking is "//div[@id='downloadlink']" however, there nil interesting div. why stop there? perhaps want extract url: "//div[@id='downloadlink']/a/@href" i recommend using deep dive extract want, rather stopping @ contain...

asp.net - Dynamic radiobutton -

asp.net - Dynamic radiobutton - this aspx page have datalist in datalist radio buttons there. radio button comning dynamicly want check radio buttons checked or not through javascript please help me <asp:datalist id="tf_datalist" runat="server" repeatdirection="vertical" onitemcreated="tf_datalist_itemcreated"> <itemtemplate> <table style="text-align:left;"> <tr> <td valign="top" align="left" nowrap="nowrap"> <asp:radiobutton id="lbtrue" runat="server" groupname="ans" text="t" onclick="radcheck();"/> <asp:radiobutton id="lbfalse" runat="server" groupname="ans" text="f" onclick="radcheck();"/> </td> <td>&nbsp;&nbsp;</td> <td r...

jquery prevent multiple selection of radiobutton -

jquery prevent multiple selection of radiobutton - i have multiple forms each radiobutton grouping want allow user select 1 of options once. in case allow selection of yes once you can see behaviour in link below select yes alternative on first row (remains @ no - want) select no alternative on sec row select yes alternative on first row (allowed because no other yes selected) select yes alternative sec row (switches selection no on first row instead of remaining @ no) seems ignore selection in line of jquery code $('input:radio[name=$(tmp)]]')[1].checked = true; running example you : $("input[name*='records']").click(function(e) { var inputs = $("form input[type=radio][value=y]:checked"); if (inputs.length > 1){ e.preventdefault(); } }); fiddle here: http://jsfiddle.net/6eqhe/5/ jquery

Emacs: Org-mode spreadsheet: targeting via hline -

Emacs: Org-mode spreadsheet: targeting via hline - i'm trying log hours in org mode: ** bob johnson, bob's seo | subject | time | minutes | total hours | |-----------------------------------------------+---------------------------+---------+-------------| | optimization study | 2011/07/11 8-10:00 pm pst | 120 | 2 | | phonecall dicuss study , plan of action | 2011/07/13 5:41 pm | 43 | 0.71666667 | |-----------------------------------------------+---------------------------+---------+-------------| | | | 249 | 4.15 | #+tblfm: $4=@0$-1/60::@6$3=vsum(@i..@ii) the main problem look above sums total hours: @6$3=vsum(@i..@ii) should like: @||+1$3=vsum(@i..@ii) so spread sheet grows lastly item in sec lastly column sum total. doesn't work when set way (and +ii ,...

internet explorer - IE Select control drop down arrow image -

internet explorer - IE Select control drop down arrow image - i'm not sure if create sense there way tell arrow image used ie dropdown? i've never had issue chrome or firefox, in ie there different images. depending on version or os beingness used, arrow has different image. if using windows 7 high graphics mode or whatever, it'll styled arrow button, if turn off or utilize la legacy mode, looks chrome , firefox. i think best way accurately specify how arrow image of dropdown utilize javascript/jquery style it, consistent browsers in different os. have @ link http://www.queness.com/post/204/25-jquery-plugins-that-enhance-and-beautify-html-form-elements#1 internet-explorer select

.net - C# Regex Issue Getting URLs -

.net - C# Regex Issue Getting URLs - to explain briefly, i'm trying search google keyword, urls of top 10 results , save them. this stripped downwards command line version of code. should homecoming 1 result @ least. if works that, can apply total version of code , results. basically code have right now, fails if seek entire source of google. if include random section of code google's html source, works fine. me, means regex has error somewhere. if there improve way aside regex, please allow me know. urls between <h3 class="r"><a href=" , " class=l onmousedown="return clk(this.href i got regex code generator, it's hard me understand regex, since nil i've read explains clearly. if pick out what's wrong , explain why, i'd appreciate it. thanks, kevin using system; using system.text.regularexpressions; using system.net; namespace consoleapplication1 { class programme { static void main(string...

java - SpringSourceToolSuite windows 7 32 bit installer is pointing to wrong JRE -

java - SpringSourceToolSuite windows 7 32 bit installer is pointing to wrong JRE - i trying install springsourcetoolsuite on windows7 32 bit machine , having issue springsource tool suite installer .exe file looking old jre , not new jdk, how can create installer point new jdk instead of old jre? here error message getting: the registry refers non existent java runtime environment installatio or runtime corrupt. scheme cannot find path specified. any suggestions? go window>preferences select java list on left, installed jres click add... select standard vm point jre directory (ex. c:\program files\java\jdk1.6.0_20) , give name , click finish. find sts.ini file in root directory, seek adding first line in file, create sure points jdk, need set -vm , path on different lines. -vm c:\program files\java\jdk1.6.0_20\bin\javaw.exe you can seek using zip installer instead of .msi installer. java windows eclipse sts-springsourcetoolsuite

javascript - how do I add multiple events to a collapsible list? -

javascript - how do I add multiple events to a collapsible list? - i'm working on modification backend of shopping cart. need list product categories in collapsible nested list. i've been able code jochen: $(function() { $('li > ul').each(function(i) { var parent_li = $(this).parent('li'); parent_li.addclass('folder'); var sub_ul = $(this).detach(); parent_li.find('a').click(function() { sub_ul.toggle(); }); parent_li.append(sub_ul); }); $('ul ul').hide(); }); but need able display products in given category when category clicked. want event cause page mysql phone call @ point , list products in div right of collapsible tree. i'm self taught, , while i've gotten pretty @ php, has been years since did extensive in plain old javascript, , i'm afraid i'm in on head ajax , jquery. help appreciated. i tried implement much appreciated solution posed vinceh, in spite of sev...

classnotfoundexception - ClassNotFound on running (no compilation errors in eclipse) -

classnotfoundexception - ClassNotFound on running (no compilation errors in eclipse) - as have described in title have simple java project in eclipse. in project have 2 packages: com.tester.beta.api , com.tester.beta.sample the api bundle has classes, , sample project has 1 class main function: package com.tester.beta.sample; import java.io.bufferedinputstream; import java.io.datainputstream; import java.io.file; import java.io.fileinputstream; import java.io.ioexception; import java.io.inputstream; import com.tester.beta.api.analyzer; public class illustration { /** * @param args */ public static void main(string[] args) { //i load files hdd analyzer analyzer = new analyzer(); } } i have no compilation errors in eclipse - seems working fine. when run project , when goes line analyzer analyzer = new analyzer(); classnotfound exception... i have tried cleaning, rebuilding, refreshing project. restarting eclipse, pc, everything. tried adding...

javascript - jQuery syntax problem -

javascript - jQuery syntax problem - this simple function , have <p>this paragraph 1.</p> like function not working? wrong here? function select(){ $('p')[0].innerhtml="helooo!!"; } html: <p>this paragraph 1.</p> <p>this paragraph 2.</p> <p>this paragraph 3.</p> <p>this paragraph 4.</p> <p>this paragraph 5.</p> <p>this paragraph 6.</p> jquery: $('p:eq(0)').html("helooo!!"); i suggest this, because easy alter apply more elements, if necessary later. javascript jquery

c - How to map .so files to source files in gdb -

c - How to map .so files to source files in gdb - i have core dump file. when seek open in gdb. able see backtrace (with address , corresponding functions) corresponding function in mapped .so files not source. bt looks this #0 0xf611b39c in xxfun () /lib/libxx.so.0 $file /lib/libtxx.so.0 /lib/libtxx.so.0: elf 32-bit lsb shared object, intel 80386, version 1 (sysv), not stripped able display symbols using nm! queries:- 1) how can map .so files source files 2) not able display info locals/args. how can these data? when seek display #info locals no symbol table info available. #info args no symbol table info available. please allow me know if need more info. exactly "n.m." commented, need libxx.so built debug info (usualy -g switch @ compile time). that provide both address source mapping, , info locals , args , etc. c debugging gdb

pipeline - Alias for "| foreach { "$_" }" in PowerShell -

pipeline - Alias for "| foreach { "$_" }" in PowerShell - i utilize next code emulate unix "find" behavior: ls directory -recurse -include pattern | foreach { "$_" } in fact, there couple of other commands i'd append | foreach { "$_" } to. i'm trying find way create easier type. tried stuff this: function xfind { ls $args | foreach { "$_" } } and invoked so: xfind directory -recurse -include pattern but seemed wrong thing... consider utilize -name switch of get-childitem (aka ls , dir ): ls directory -recurse -include pattern -name this way native, clean, , effective. powershell pipeline

Problem to view SWF in android emulator -

Problem to view SWF in android emulator - hello expert have create 1 application (name "aaa")in have load swf file assets folder.i have install "adobe flash player 10.1" command "adb -e install -r adobe flsh player 10.1.apk" command line. problem when click on application(aaa), not aable view swf file in emulator. please help me. thanks. first thing : adobe flash player play background services give flash effect. sec thing : have seek in device. 3rd thing : if need load in emulator utilize adobeair emulator.it ready play flash content android android-emulator

java - servlet life cycle while loadOnStartup -

java - servlet life cycle while loadOnStartup - when mention servlet loadonstartup in web.xml init method called sure. wanted confirm service , destroy methods called or not? if not when called? another question mentioned every init method called once. mean when servlet gets request first time, init method called , service called. but destroy not called. when sec request phone call service method 1 time again not init method. understanding correct? when container decides phone call destroy method? loadonstartup means servlet loaded (and init(..) method called during container startup. otherwise, suspect, loaded when first request comes containers have 1 instance of each servlet. when create it, phone call init(..) . when context undeployed (for illustration - container stopped), destroy() called java servlets

Performance difference between int4 and int8 in PostgreSQL on 64 bit server -

Performance difference between int4 and int8 in PostgreSQL on 64 bit server - assuming postgresql running on 64 bit server, performance difference between int4 (32 bit) , int8 (64 bit) column? manual states int4 more efficient int8, if underlying server 64 bit, there practical performance difference (in terms of (1) cpu, (2) memory , (3) storage)? in terms of (1) cpu, (2) memory , (3) storage put bluntly: 64 bits twice big 32 bits. 64 bits twice big 32 bits. 64 bits twice big 32 bits. i recall thread in wp-hackers did few benchmarks. create table, fill in 1000000 rows. find, add, group, join, etc. don't recall specifics, indeed slower using int8 int4. test=# create table int4_test (id int primary key); create table test=# create table int8_test (id bigint primary key); create table test=# insert int4_test select generate_series(1,1000000) i; insert 0 1000000 test=# insert int8_test select generate_series(1,1000000) i; insert 0 1000000 test=# vacuum...