Posts

Showing posts from August, 2012

c++ - Lots of: 'Apple Mach-O Linker Errors' -

i have made iphone app in xcode uses dropbox api. have got 23 errors named apple mach-o linker errors. have linked binary dropbox library as: systemconfiguration, quartzcore, security, cfnetwork, coregraphics, uikit , foundation. not using of frameworks dropbox told me must import of them, , using rest. what should do? here 1 of errors: ld /users/zach/library/developer/xcode/deriveddata/snapdrop-fwhwffwawcnkfwbxvokogcjaaahb/build/products/debug-iphoneos/snapdrop.app/snapdrop normal armv7 cd /users/zach/desktop/snapdrop setenv iphoneos_deployment_target 7.0 setenv path "/applications/xcode5-dp3.app/contents/developer/platforms/iphoneos.platform/developer/usr/bin:/applications/xcode5-dp3.app/contents/developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /applications/xcode5-dp3.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /applications/xcode5-dp3.app/contents/developer/platforms/iphoneos.platform/developer/s

Drupal themes don't work -

i installed drupal on localhost. can login , post things on website, whenever try new template nothing changes. whole page color white , links blue. themes show no effect. doing wrong? thanks. clear caches . on /admin/config/development/performance click "clear caches" button. if have installed admin_menu module can easier link under top left icon title "flush caches".

sml - SMLNJ if statement error -

i'm trying learn sml , wrote small game resembling 1 in zed shaw's book 'learn ruby hard way'. code below works fine in repl , compiles mlton. however, results in else statement ("error!"). if try debug print(valof(response)) in place of if statements, returns whatever string type (an empty string if don't type anything). don't think inputline function, not let statement not return stdin, , should not comparison op. fun first_room () = (print "you're in dark, mottled room.\n"; print "which 1 choose? left or right?\n"; print "> "; let val response = (textio.inputline textio.stdin) in if response = none print "you stay.\n" else if valof(response) = "left" print "you go left.\n" else if valof(response) = "right" print "you go right.\n" else print "error!\n" end) fun main () = first_room (

c# - Parsing Error while using Regex -

let me explain actual problem facing. when searchstring c+, setup of regular expression below works fine. when searchstring c++, throws me error stating -- parsing "c++" - nested quantifier +. can let me know how past error? regexp = new regex(search_str.replace(" ", "|").trim(), regexoptions.ignorecase); first of all, believe you'll learn more looking @ regex tutorials instead of asking here @ current stage. to answer question, point out + quantifier in regexp, , means 1 or more times previous character (or group), c+ match @ least 1 c , meaning c match, cc match, ccc match , on. search c+ matching c ! c++ in regex give error, @ least in c#. won't other regex flavours, including jgsoft, java , pcre ( ++ possessive quantifier in flavours). so, do? need escape + character search literal + character. 1 easy way add backslash before + : \+ . way put + in square brackets. this said, can use: c\+\+ or...

tcl - missing entries in tclIndex for snit types -

i'm using tcl 8.6 included snit (active state tcl). snit types held in different files. when generating index auto_mkindex relevant stuff snit types missing in tclindex . that means: when try create object of snit type (for example ' mytype create objectsname ... ), interpreter writes message invalid command name .... if complete tclindex manually set auto_index(rpcskeleton) [list source [file join $dir rpc2.tcl]] everything runs fine! do wrong? bug in snit package (or in add on module auto_mkindex )? i wouldn't advise using auto_mkindex @ all; whole thing setting automatically-loaded code rather ill-advised in first place in real application. it's far better either: assemble code package can package require . package definition file require package provide call in it, , you'll want (at least first time) use pkg_mkindex create package index file. package index files simple enough you'll able maintain them hand; don

leap motion - Getting Yaw of hand unstable -

i making puppet app leap motion. whenever try , yaw of hand seems wrong (ie: hand flat says @ 45 degrees or hand flat , says @ -30 degrees, unreliable , jumpy). use hand hand = frame.hands().get(0); palm1position = hand.palmposition(); normal = hand1.palmnormal(); direction = hand1.direction(); palmroll = math.todegrees(normal1.roll()); palmyaw = math.todegrees(direction1.yaw()); to roll , yaw of hand. roll works yaw horrible. problem because marionettes rely heavily on yaw. idea why happening , how can fix it? i'm in javascript , don't think have yet, java docs should have this float pitch = hand.direction().pitch(); float yaw = hand.direction().yaw(); float roll = hand.palmnormal().roll(); see https://developer.leapmotion.com/documentation/languages/java/guides/leap_tracking.html

c++ - why this code can't open the file for read data -

i have problem in code. why can not code open file? thanks ofstream out("a.text"); while (i != 6) { out << b[i] << ' ' ; i++ ; } out.close(); = 0 ; ( ; < 6 ; i++) { b[i] = 0 ; } ifstream in("a.txt"); // problem in line if(!in) { cout << "error" ; cin.get(); exit(0); } export code : error you doing output file named a.text , try open a.txt

minecraft - How can I set/get a HashMap in a YAML configuration file? -

i making first bukkit plugin. programmatically create yaml file represents hashmap . how can set , data structure? the hashmap parameters <signature, location> , signature class stores 4 integers, , location org.bukkit.location i think yaml file this, not sure if structure best: myplugin: listofdata: - signature: [1,2,3,4] # unique set of 4 integers location: [122,64,254] # non-unique set of 3 integers - signature: [4,2,1,2] location: [91,62,101] - signature: [3,3,1,3] location: [190,64,321] signature can modified necessary, , can create wrapper location if necessary. thanks! this suggested solution. don't know if best way...:) may want consider yaml structure: myplugin: listofdata: '[1,2,3,4]': '[122,64,254]' '[4,2,1,2]': '[91,62,101]' '[3,3,1,3]': '[190,64,321]' anothersignature:anotherlocation

javascript - Canvas translate values are mysteriously doubling themselves - some things drawing in the wrong place but not others -

i'm making little canvas game , adding in power ups player can collect. here's use make them appear: thepowerups.foreach ( function(t) { c.beginpath(); c.save(); c.translate(t.x,t.y); c.fillstyle = t.fill; c.moveto(t.x - 15, t.y - 15); c.lineto(t.x + 15, t.y - 15); c.lineto(t.x + 15, t.y + 15); c.lineto(t.x - 15, t.y + 15); c.lineto(t.x - 15, t.y - 15); c.fill(); c.restore(); c.closepath(); }); so i'm cycling through power ups array drawing each one. in test case t.x , t.y both 200. code draws power @ location 400, 400. console logged power ups array, returned 200 x , y. if move player character on coordinates 200,200, power up, drawn @ 400,400 disappears , code power executes. so functional purposes, it's in right place. doesn't appear there. yet player, bad guy , bullets in correct coordinates. i've tried doing this; c.beginpath(); c.save(); c.translate(150,150); c.fillstyle = 

Pytables time performance -

i'm working on project related text detection in natural images. have train classifier , i'm using pytables store information. have: 62 classes (a-z,a-z,0-9) each class has between 100 , 600 tables each table has 1 single column store 32bit float each column has between 2^2 , 2^8 rows (depending on parameters) my problem after train classifier, takes lot of time read information in test. example: 1 database has 27900 tables (62 classes * 450 tables per class) , there 4 rows per table , took aprox 4hs read , retrieve information need. test program read each table 390 times (for classes a-z, a-z) , 150 times classes 0-9 info need. normal? tried use index option unique column , dont see performance. work on virtualmachine 2gb ram on hp pavillion dv6 (4gb ram ddr3, core2 duo). this because column lookup on tables 1 of slower operations can , of information lives. have 2 basic options increase performance tables many columns , few rows: pivot structure su

java - What happens to the rest of an ArrayList once an object has been deleted within it? -

in java, when this: alist[0].remove(); what happens rest of array list. of objects move 1 or stay same , there empty index @ [0]? if not, there efficient way of moving each object's index closer down one? to clarify mean more effecient: you remove first index , iterate through arraylist , delete each object , re-assign new index, seems ineffecient , seems there should way have looked through @ javadoc page arraylist class , not see accomplish trying do. assuming meant ask alist.remove(0) ... as documented oracle : public e remove(int index) removes element @ specified position in list. shifts subsequent elements left (subtracts 1 indices). so remove require. however, may not consider implementation efficient since requires time proportional number of elements remaining in list. example, if have list 1 million items in , remove item @ index 0, remaining 999,999 items need moved in memory.

asp.net - Database relations query -

Image
i have 2 database tables this sample database of ticketing system. figure 1: sample table of air ticket. figure 2: sample table of tax. requirement: when ticket made interface, has multiple taxes of different names every time. how can store information i.e. 'n' number of taxes each ticket different names every time. i have tried make many many relationship problem is: each ticket if tax not setup, need add tax first. any optimal solution this? "the problem is: each ticket if tax not setup, need add tax first." this not real-life problem. in real life governments declare taxes in advance of collecting them, gives organizations sufficient time amend systems need handle taxes. tax never surprise. "but tiring solution end user.... make bunch of tax setup each ticket" this sort of thing reference data, , duty of system developer (hint: that's you) populate reference data tables. or @ least provide screen user ca

jquery - How to make content scroll smoothly in fixed div with page scroll -

i trying create fixed top nav has menu change scroll down page. when scroll past y-point menu scroll scroll down page show second menu become sticky. have implemented rough version here: http://jsfiddle.net/hsplq/ i have 2 main issues 1) content not scroll smoothly. if scroll notice content not move smoothly. 2) not sure best way implement type of animation/effect. code rough, wondering if there better/more optimal way accomplish this. thanks here code rough prototype (same jsfiddle link) <html lang="en"> <head> <style type="text/css"> body{ height: 2000px; } .container { position: fixed; top: 0px; left: 0px; width: 100%; background-color: #ccc; height: 80px; overflow: hidden; } .content1, .content2 { height: 40px;

python: iterate through two objects in a list at once -

have call sql db via python returns output in paired dictionaries within list: [{'something1a':num1a}, {'something1b':num1b}, {'something2a':num2a} ...] i want iterate through list pull 2 dictionaries @ same time. i know for obj1, obj2 in <list> isn't right way this, is? you can using zip iterator on list: >>> dicts = [{'1a': 1}, {'1b': 2}, {'2a': 3}, {'2b': 4}] >>> obj1, obj2 in zip(*[iter(dicts)]*2): print obj1, obj2 {'1a': 1} {'1b': 2} {'2a': 3} {'2b': 4}

algorithm - LU decomposing a square matrix matlab gauss elimination -

i'm trying create program takes square (n-by-n) matrix input, , if invertible, lu decompose matrix using gaussian elimination. here problem: in class learned better change rows pivot largest number (in absolute value) in column. example, if matrix a = [1,2;3,4] switching rows [3,4;1,2] , can proceed gaussian elimination. my code works matrices don't require row changes, ones do, not. code: function newgauss(a) [rows,columns]=size(a); p=eye(rows,columns); %p permutation matrix if(det(a)==0) %% determinante 0 means no single solution disp('no solutions or infinite number of solutions') return; end u=a; l=eye(rows,columns); pivot=1; while(pivot<rows) max=abs(u(pivot,pivot)); maxi=0;%%find maximum abs value in column pivot i=pivot+1:rows if(abs(u(i,pivot))>max) max=abs(u(i,pivot)); maxi=i; end end %%if needed switch

Android - get INSTALL_NON_MARKET_APPS boolean -

i trying around install_non_market_apps option has 2 different versions. pre-17 api level , 17+. null pointer exception when run this: boolean unknownsource = false; if (build.version.sdk_int < 17) { unknownsource = settings.secure.getint(null, settings.secure.install_non_market_apps, 0) == 1; } else { unknownsource = settings.global.getint(null, settings.global.install_non_market_apps, 0) == 1; } i believe api level 3 settings.system variable depreciated , changed on settings.secure , in api level 17 changed on settings.global . also, believe method call requires context content resolver. boolean unknownsource = false; if (build.version.sdk_int < 3) { unknownsource = settings.system.getint(getcontentresolver(), settings.system.install_non_market_apps, 0) == 1; } else if (build.version.sdk_int < 17) { unknownsource = settings.secure.getint(getcontentresolver(), settings.secure.install_non_market_apps, 0) == 1; } else { unknownsource = s

ios - UIDatePicker first value set is not default to read -

i have set initial date in datepicker in application. if change value , select picks up, when selecting value without changing spinner value shows todays date. i have been trying use [uidatepicker setdate:] method, having problems it, wont set. code 'selecting' date (action assigned button): - (ibaction)backtomap:(id)sender { uistoryboard *storyboard = [uistoryboard storyboardwithname:@"mainstoryboard" bundle:nil]; firstviewcontroller *fvc = [storyboard instantiateviewcontrollerwithidentifier:@"firstviewcontroller"]; fvc.modaltransitionstyle = uimodaltransitionstylecoververtical; datepicked = [datepicker date]; self.firstviewdata = fvc; fvc.passeddata = datepicked; // if ispickertype = 1 date , time // if ispickertype = 2 date fvc.datepicker = ispickertype; [self presentviewcontroller:fvc animated:yes completion:nil]; } when do: firstviewcontroller *fvc = [storyboard instantiateviewcontrollerwi

ruby - Rails bundle install - failed to build gem native extension for JSON -

i trying fix strange problem in rails resorted uninstalling gems (using command found here: http://geekystuff.net/2009/01/14/remove-all-ruby-gems/ ) , running bundle install . the removal successful, when ran bundle install , got following error: installing activeresource (3.2.13) using bundler (1.3.5) installing rack-ssl (1.3.3) installing json (1.8.0) gem::installer::extensionbuilderror: error: failed build gem native extension . c:/railsinstaller/ruby1.9.3/bin/ruby.exe extconf.rb creating makefile make generating generator-i386-mingw32.def compiling generator.c linking shared-object json/ext/generator.so make install /usr/bin/install -c -m 0755 generator.so c:/railsinstaller/ruby1.9.3/lib/ruby/ge ms/1.9.1/gems/json-1.8.0/lib/json/ext /usr/bin/install: cannot remove `c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1 /gems/json-1.8.0/lib/json/ext/generator.so': permission denied make: *** [c:/rails

3d models -> JSON for WebGL/Three JS -

so have tried use three.js editor convert .obj file json. when click export geometry, though, doesn't anything... http://mrdoob.github.io/three.js/editor/ when export scene, though, whole bunch of numbers so: "2,1615,1614,1671,1672,1615,3683,3563,3682,3684,3567,57,1615,1672,1673,1616,1615,1672,1673,1616,3685,3567,3684,3686,3570,57,1616,1673,1674,1617,1616,1673,1674,1617,3687,3570,3686,3688,3573,57,1617,1674,1675,1618,1617,1674,1675,1618,3689,3573,3688,3690,3575,57,1618,1675,1676,1619,1618,1675,1676,1619,3691,3575,3690,3692,3577,57,1619,1676,1677,1620,1619,1676,1677,1620,3693,3577,3692,3694,3579,57,1620,1677,1678,1621,1620,1677,1678,1621,3695,3579,3694,3696,3581,57,1624,1679,1680,1625,1624,1679,1680,1625,3697,3587,3698,3698,3587,57,1625,1680,1681,1626,1625,1680,1681,1626,3699,3589,3700,3701,3590,57,1626,1681,1682,1627,1626,1681,1682,1627,3702,3590,3701,3703,3592,57,1627,1682,1683,1628,1627,1682,1683,1628,3704,3592,3703,3705,3594,57,1628,1683,1684,1629,1628,1683,1684,1

image - jQuery not displaying span iteration properly -

so i've created erb block gets coordinates each image tag, in want display tag each image @ said coordinates. however, single tag being displayed, not every tag in iteration. idea why? have .each()? <% if @new_manual.present? %> <% @new_manual.steps.each |step| %> <% i_connection = contact.find(step.input_contact) %> <span class="i_connection" data-pos-x="<%= i_connection.pos_x %>" data-pos-y="<%= i_connection.pos_y %>" data-pos-width="<%= i_connection.pos_width %>" data-pos-height="<%= i_connection.pos_height %>"> </span> <br> <div class='image_panel'> <%= image_tag(i_connection.image.image.url(:large)) %> <div class='planetmap'></div> <% end %> <% end %> </div> <script type="text/javascript"> $(document).ready(function(){ $("span.i_connection").each(function() { var pos

Ajax form does not work -

im trying create login page use form: <form method="post" id="foo" action="http://******/auth/signin"> <input type="text" name="username" /> <input type="password" name="password" /> <input type="checkbox" name="rememberme" /> <input name="submit" type="submit" value="submit"> </form> this work fine, redirects next page want avoid take use of ajax: $(function() { $('#foo').submit(function() { $.ajax({ type: $(this).attr('method'), url: "http://******/auth/signin", data: $(this).serialize(), success: function(responsetext) { $('#result').html(responsetext); alert("hey"); } }); return false; // important: prevent form submitting }); }); now have removed action part form tag in ht

iphone - App just shows a black screen -

i'm trying make multiview application. started creating 'empty application' thought easiest. have 3 .xib files, first being mainview.xib has view controller linked switch class, , has tool bar switch between 2 views, , have selected .xib 'main interface' thought meant should loaded first. other blue redview.xib , blueview.xib. i've heard method in appdelegate.m can cause problems, here mine... - (void)applicationdidfinishlaunching:(uiapplication *)application { //add switchclasses view main window [window addsubview:switchobject.view]; [window makekeyandvisible]; } i don't know whether have missed because started empty application, or if i've messed along way. thank help. do this: window.rootviewcontroller = switchobject;

javascript - Iframe Scroll to top of page on load with tabs -

i have i-frame of "design own uniform" app within page. design own uniform app consists of 4 tabs (select product, select colours, insert details, receive quote). each time go new tab page stays @ same horizontal position previous tab. there way can make page load @ top of i-frame tab tab? i've seen done js, i've never seen specific example tabs involved. any appreciated. thanks, bigscreentv you should use scrollto function html <a href='#id'>btn</a> <div id='id'></div> $('a').click(function() { var elementclicked = $(this).attr("href"); var destination = $(elementclicked).offset().top; $("html:not(:animated),body:not(:animated)").animate({ scrolltop: destination-15}, 500 ); return false; });

java - What is the best way to make a Jetty server do something before shutting down? -

i have jetty server being initialized , started this: server server = new server(50001); myhandler myhandler = new myhandler(); server.sethandler(myhandler); // attempt run server try { server.start(); server.join(); } catch (exception e) { logger.warning(e.getmessage()); system.exit(2); } the class myhandler has method called shutdown waits tasks complete. myhandler.shutdown() invoked before server shutdown. i have considered using runtime.getruntime().addshutdownhook() , not sure of best way pass myhandler it, , suspect there must cleaner way this. i looking best way this. thanks! follow handler chain down , you'll see runs abstractlifecycle defines methods called dostart() , dostop(). can override these plug lifecycle of server instance since adding handler server. works either extends abstractlifecycle or implements lifecycle, making handy mechanism register start , stop type behaviors.

c++ - How should you implement STL features for custom classes? -

i'm implementing tuple-like class, call mytuple , , have stl features, namely tuple_element , tuple_size , , get . should implement tuple_element , tuple_size specializations in namespace std ? if not how should implement them? since i'm not allowed overload stl get function, mean must provide separate get function in own namespace, thereby forcing users write using std::get; ? recall there ain't no such thing partial specialization of function templates. can't partially specialize std::tuple_element et al class. normally, define free-standing functions logically part of class' interface in same namespace class itself. can rely on argument-dependent lookup find them. std::get found same mechanism - users of library not in fact forced write using std::get .

sql - What is the proper way to deal with non-unique rows that will become unique -

i'm building database archery tournament shoots. 1 of tables holds work shifts volunteers working it. it looks this: +-------+---------+--------+---------+-------+-----+ | jobid | shiftid | userid | eventid | hours | day | +-------+---------+--------+---------+-------+-----+ | 10 | 9 | 1125 | 6 | null | 1 | | 11 | 9 | 0 | 6 | null | 1 | +-------+---------+--------+---------+-------+-----+ jobid links jobs i.e. registration, kitchen. shiftid links hours of shift i.e. 7-9 (hours there @ request of event owner shift may run long). userid links volunteer... eventid links specific event. day day of event, events span multiple days. the entries populated events, , users added. allows unique constraint placed on concatenated columns (jobid, shiftid, userid, eventid). however, event owner wants able have multiple shifts in event @ same time. entries unique after user has been registered. what proper way deal this? these sol

extjs - ASP.NET Generic Handler not getting called after .NET 3.5 to .NET 4.0 upgrade -

Image
this old title describes visible issue, new title describes root cause issue little better. i'm still not sure why ashx isn't getting called, i'm still looking answer. have workaround hard coding api descriptor (ext.app.remoting_api variable). got json object (ext.app.remoting_api variable) directproxy "provider" returned variable, original code running .net 3.5. used online javascript beautifier make beautiful (so can read it, instead of being on single line). old title: extjs 3 ext.direct proxy error: uncaught typeerror: cannot read property 'events' of undefined i upgraded extdirect4dotnet project .net 3.5 .net 4.0. project , sample project can found here https://code.google.com/p/extdirect4dotnet/ . when did this, had temporarily copy web.config file when changed project version. fixed parameter list of 2 override methods due inheriting class in json.net found @ http://json.codeplex.com/sourcecontrol/latest#readme.txt . fixed way dll re

java - scheduleWithFixedDelay with concurrent overlapping tasks -

i looking variant of scheduledexecutor allows task run @ specific interval without waiting previous task complete. given code below, there 12 different lines of output @ intervals of 5000ms. given execution interval of 50ms , thread pool size of 10, looking solution has 10 output lines in first 550ms, followed pause until threads freed , can reused. scheduledexecutorservice pollingexecutorservice = executors.newscheduledthreadpool(10); final runnable pollingtask = new runnable() { public void run() { system.out.println("running poller " + datetime.now().tostring()); try { thread.sleep(5000); } catch (interruptedexception e) { e.printstacktrace(); //to change body of catch statement use file | settings | file templates. } system.out.println("5000 passed"); } }; scheduledfuture<?> pollinghandler = pollingexecutorser

In JSF,how to get parameter values form my sql to jsf the page? -

i first made sql, zdsql, project: create table zdsql( id integer primary key, filter varchar(12), value varchar(12), descri varchar(12), standard_number integer, language varchar(12) ); insert zdsql values(1,'zdlj','1','1.rid',1,'en'); insert zdsql values(2,'zdlj','2','2.ria',1,'en'); next, made jsf, following codes maining of xhtml: <h:outputlabel value="#{msgs.zdlj}" style="font-weight:bold" /> <p:selectonemenu id="zdlj1" value="#{zsjbean.zdlj}"> <f:selectitems value="#{zdsqlbean.zdsqls}" var="bll1" itemlabel="#{bll1.descri}" itemvalue="#{bll1.value}" /> </p:selectonemenu> the follwing codes maining of zdsqlbean: package bean; import java.util.list; import java.util.logging.level; import javax.persistence.typedquery; import model.zdsql; import util.dbdao

c# - how to display image directly from httpwebresponse stream in asp.net? -

i want display image recieved webresponse browser directly without saving file.i have used below code save image file want display in browser directly.the website provides captcha image in webresponse want display.please me. public void captcha(string id, string pass) { httpwebrequest req; httpwebresponse response; string strnewvalue,ckuser,ckpass; system.drawing.image returnval; ckuser = id; ckpass = pass; this.req = (httpwebrequest)webrequest.create("http://site2sms.com/security/captcha.asp"); servicepointmanager.expect100continue = false; this.req.cookiecontainer = new cookiecontainer(); this.req.allowautoredirect = false; this.req.useragent = "mozilla/5.0 (windows nt 6.1; rv:8.0) gecko/20100101 firefox/8.0"; this.req.accept = "*/*"; this.req.method = "post"; this.req.cookiecontainer = cookiecntr; this.req.contenttype = "application/x-www-form-urlencoded"; this.req

tsql - "create if not exist" and "create table like" sql server query -

how can create table if table not exist. in case, want create table query : select * b that table in db , table b in db b. help? if not exists (select [name] sys.tables [name] = 'a') select * a.dbo.a b.dbo.b you can try .. simple one.

c# - How to refresh page without incrementing the hit counter? -

i need refresh page on button click don't want increment hit counter. basically, page have few grids want refresh grid data when click refresh button don't want increase hit counter on refresh. use ajax refresh grid data

What is an API in basics? -

i want know, api means? , meant for? please give me clear explanation examples? note: basics of api first timer. thanks manikandan api interface (set of methods , fields buound rules how use them) of application or library. standardised way of using application programatically. an analogy real world house furnace. use every day heating (just use application, let's music player playing songs). when want change in furnace, reprogram it, set temperatures given period, need use interface (gauges, buttons, valves , on) in proper way (you need know change , in order). can loosely considered furnace's "api".

plpgsql - How can I control a PostgreSQL function is running in a long period of time -

a program developed using postgresql. program running plpgsql function taking long time(hours or days). want sure function running during long time. how can know that? don't want use "raise notice" in loop in function because extend running time. you can see if it's running examining pg_stat_activity process. however, won't tell if function progressing . you can check see whether backend blocked on locks joining pg_stat_activity against pg_locks see if there open ( granted = false ) locks table. again, won't tell if it's progressing, if isn't it's not stuck on lock. if want monitor function's progress need emit log messages or use 1 of other hacks monitoring progress. can (ab)use notify payload listen progress messages. alternately, create sequence call nextval on each time process item in procedure; can select * the_sequence_name; in transaction see approximate progress. in general i'd recommend setting client_

c# - Why is killing the Excel process a bad thing? -

i've seen lot of articles , questions how sure excel quits when want , process doesn't stay alive. here knowledge base article describing problem , microsoft's recommended solution. essentially: 'close files 'quit excel xlapp.quit() 'release , collect garbage system.runtime.interopservices.marshal.finalreleasecomobject(xlapp) gc.collect() gc.waitforpendingfinalizers() many people don't recommend killing process; see how clean excel interop objects , understanding garbage collection in .net on other hand many people don't recommend using gc.collect. see what's wrong using gc.collect()? in experience killing process fastest , easiest way sure excel gone. code kills exact process starts, no other. make sure close open workbooks, quit application , release xlapp object. check see if process still alive , if kill it. <system.runtime.interopservices.dllimport("user32.dll", setlasterror:=true)> _ private shared function

Python: Why isn't my default arguments used when calling the method without declaring their values -

this question has answer here: “least astonishment” , mutable default argument 29 answers i thought had learn python , parameters/arguments (which correct term?) local variables within method , if not declared in method call take defined default values. example shows i'm wrong: this code def example(foo=[]): print foo bar = 'hello world' foo.append(bar) return foo print example() print example() prints out this [] ['hello world'] ['hello world'] ['hello world', 'hello world'] i have expected print out: [] ['hello world'] [] ['hello world'] why doesn't happen _ ? i know print example([]) print example([]) prints expect. kinda miss point of having default values.. bonus info: using python 2.7.3 , ipython default values arguments created once per method, @