Posts

Showing posts from May, 2015

django - int() argument must be a string or a number, not 'QueryDict' -

django - int() argument must be a string or a number, not 'QueryDict' - i'm rendering out 3 multiple select boxes on form. i'm filtering each box out have seperate type of day. when submit form error. int() argument must string or number, not 'querydict' what must save form? this i'm doing on forms.py file different filtering each select box. class contractform(forms.modelform): def __init__(self, project_id, *args, **kwargs): super(contractform, self).__init__(*args, **kwargs) self.fields['shoot_day'].queryset = day.objects.filter(type=shoot, project__id=project_id) self.fields['travel_day'].queryset = day.objects.filter(type=travel, project__id=project_id) self.fields['additional_day'].queryset = day.objects.filter(type=additional, project__id=project_id) i'm getting project_id so: def editcontract(request, contract_id, slug): context_dict = {} contract = get_...

.NET REST services, Entity Framework and loose coupling -

.NET REST services, Entity Framework and loose coupling - i'm working on web application project using asp.net mvc3 , database in sql server. there mobile application uses info same database via rest services. here of application's layers: model - ado.net info model, using entity framework data access layer - repositories queries retrive info database web application - mvc3 project, using repositories, loose coupling using construction map , di, database context gets disposed @ end of httprequest core - layer between dal , service layer, uses repositories , exposes info service layer. sort of business logic layer. service layer - rest services, knows core layer not dal. maps info dtos , exposes client the problem i've got such application architecture loose coupling on service layer. service layer has reference core layer. core layer has reference info access layer , uses repositories. repositories not have default constructor though. expect 1 pa...

Mysql + JDBC: return value of INSERT ON DUPLICATE KEY does not match Mysql documentation -

Mysql + JDBC: return value of INSERT ON DUPLICATE KEY does not match Mysql documentation - when execute insert on duplicate key update (iodku) in mysql command line interface, returns 2 rows updated, when insert hits duplicate key constraint. in jdbc returns 3 rows updated. has experienced similar? running mysql 5.1 mysql connector/j 5.1.14. bug report: http://bugs.mysql.com/61850 example query: insert session (tstamp, session_id, key1, key2, key3) values ('2011-07-13 10:08:01', 2, 21, 22, 23) on duplicate key update tstamp='2011-07-13 10:08:01' it bug in mysql. see bug reports http://bugs.mysql.com/bug.php?id=61850 , http://bugs.mysql.com/bug.php?id=46675. mysql jdbc

java - struts2 - How to get username on every page in my web application -

java - struts2 - How to get username on every page in my web application - i have used interceptors check if user valid & if send him action otherwise deny him doing action.i have added default-stack can occur on every action user invoking. working fine & getting desired results, issue want show username on header of every page. there way can send variable username interceptor every action invoking or straight jsp? you need persist in way each request can access authenticated object. way store user object in session or @ to the lowest degree store identifier username retrieve user object again. java struts2

objective c - Any solution for Cocoa push/pop of view controllers? -

objective c - Any solution for Cocoa push/pop of view controllers? - let me out of way: i'm used to uikit , can push/pop view controllers hearts content. doesn't work on mac. with twui , works extremely on mac. example, @ @joshaber 's push/pop illustration using twui. if twui stable , capable of embedding appkit controls within tuiview , ditch appkit completely. however, not can done in twui , , need retain appkit things. thus brings question. how can accomplished using appkit? there library has made easy? or need create ourselves? using replacesubview:withsubview: isn't enough, , isn't pushing/popping views. you're asking how push/pop nsviews? have illustration on github @ https://github.com/joshaber/reederdemo that. can take guts of ppnavigationcontroller twuipushpoptest , replace stuff animation in reederdemo. it'd still far complete, it'd @ to the lowest degree pushing , popping view controllers kinda-right animatio...

sql server - MSSQL schema problem - I renamed a table , now the database is referencing the old name -

sql server - MSSQL schema problem - I renamed a table , now the database is referencing the old name - here problem how prepare schema of renamed table manually. i have table called activecustomers renamed activecustomersold renamed 1 time again activecustomers ( original name) select * activecustomers work. if rename table activecustomerold select * activecustomers works. why? because sql schema mapping activecustomerold table name activecustomers. how alter schema of table mapp keywords. illustration select * should map table called c you consider using synonym if using sql server 2005 or greater (it's thought specify version using). should always utilize schema prefix when creating or referencing entities. sql-server sql-server-2000

How To Block Input in Java? -

How To Block Input in Java? - how can block input keyboard , mouse when java application running. block input in autoit blockinput(1) , want same in java. i can reply swing application. main frame should have this jframe frame = new jframe(); frame.setdefaultcloseoperation(jframe.do_nothing_on_close); //or if using awt frame frame = new frame(); frame.addwindowlistener(new windowadapter() { // handle window closing event here }); java

visual studio 2010 - VS2010 Express with Team Explorer -

visual studio 2010 - VS2010 Express with Team Explorer - i'm using vs2010 express edition , want connect codeplex. downloaded team explorer 2010, unable find team explorer view in vs. possible utilize team explorer vs2010 express? in this previous answer, says team explorer back upwards missing express edition. edit: that's 2008 believe holds true vs 2010 well. visual-studio-2010 codeplex team-explorer

c# - Host MVC web app without IIS -

c# - Host MVC web app without IIS - i have asp.net mvc 3 application want give user utilize without them having host in iis run. what have sort of executable click or service host application , can utilize browser on network. what options? have looked iis hostable web core? this feature allows host entire iis functionality within own process. gives powerfulness implement scenarios can customize exclusively functionality want "your web server" expose, command lifetime of without impacting other application running on site. c# asp.net-mvc iis

.net - How to configure TeamCity with private files? -

.net - How to configure TeamCity with private files? - i'm setting teamcity continuous integration , (hopefully) continuous deployment. of build steps involve private files, e.g. .snk files strong naming .net assemblies password/token files publishing artifacts (for illustration nuget or codeplex) since these files contain private info don't want set them (publicly accessible) source command system. i'm setting http://teamcity.codebetter.com autofixture don't have physical access server. hoping feature allow me upload such files, can't find of kind. what appropriate solution? teamcity supports multiple vcs roots, add together vcs root these private files. obviously require sec repository private - want way. having files in source command great thing. .net continuous-integration teamcity continuous-deployment

Solr grouping pagination -

Solr grouping pagination - i utilize solr 3.3 , seek grouping result on field "result". it works fine don't know how paginate results. parameter "numfound" contains number of result whithout grouping, parameters "row" , "start" not useful. is there solution ? thanks. i'm not sure understood question, here can see how grouping handled, , guess you'll have , seek group.ngroups, rows , start, have custom paginator if you're faceting want paginate, not possible solr pagination grouping

Why suddenly I got the error "Unable to resolve target 'android-9' "? -

Why suddenly I got the error "Unable to resolve target 'android-9' "? - i developing android application (android-2.1-updated) under ubuntu 10.04, eclipse ide. have set working environment couple of weeks ago, , developing (i can run app on connected device). but morning, after run ubuntu updates, restart pc, start eclipse, eclipse console throw error message : androidadaptiveui unable resolve target 'android-9' . very strange, running fine before restart pc. after restart, can not run android app on device. what error message means? should rid it? what tried restart adb server by: adb kill-server adb start-server adb devices but, got next new error: [2011-07-18 14:28:32 - devicemonitor]adb connection error:eof [2011-07-18 14:28:32 - devicemonitor]connection attempts: 1 [2011-07-18 14:28:33 - devicemonitor]connection attempts: 2 [2011-07-18 14:28:34 - devicemonitor]connection attempts: 3 anybody can help me please? androi...

How do i use sort and paginate the table in php -

How do i use sort and paginate the table in php - i have table list details database.i want sort whole table when user click on table name have found http://www.kryogenix.org/code/browser/sorttable/ has exact requirement. need utilize pagination here , if user clicks on second page click on table name sort , it should come 1 time again first page sorting result . can utilize ajax sort result , replace html of table.is there best way implement ? kindly help me on i found http://www.datatables.net/ php

java - CtClass.toClass throws an exception with message 'null' -

java - CtClass.toClass throws an exception with message 'null' - steps perform create dynamic class follows: seek { classloader = class.forname("org.yaddayadda.dynamicclass" + generictype.getname().tolowercase() + uniqueid); } grab (classnotfoundexception classnotfoundexception) { } if (classloader == null) { dynamicclass = pool.get("org.yaddayadda.dynamicclass"); dynamicclass.defrost(); dynamicclass.replaceclassname("org.yaddayadda.dynamicclass","org.yaddayadda.dynamicclass"+ generictype.getname().tolowercase() + uniqueid); dynamicclass.defrost(); ctmethod readobject = dynamicclass.getdeclaredmethod("method1"); ctmethod writeobject = dynamicclass.getdeclaredmethod("method2"); stringbuffer method1= new stringbuffer(); stringbuffer method2...

php - Syntax error using parse_ini_file() when file's value's contain exclamation points and equal signs -

php - Syntax error using parse_ini_file() when file's value's contain exclamation points and equal signs - the function below takes "test-backup.ini" file, parses , inputs values db via update_option() method. however, when ini file's values contain special characters exlamation points (!) , equal signs (=) (and others guess), throwing php syntax error @ parse_ini_file($file): syntax error, unexpected "!", etc... for example, given content test-backup.ini file... [settings] line1 = asc line2 = /*.blog ul li {margin-bottom:0 !important;}*/ line3 = true line4 = <meta name="google-site-verification" content="" /> i syntax errors on line2 "!" , on line 4 "=" how should filter $file before passing parse_ini_file() deal these characters preserved when passed update_option() call? all i've found far this: characters {}|&~![()" must not used anywhere in key , have special meaning i...

objective c - iPhone App Crashing - NSZombie Output Issue -

objective c - iPhone App Crashing - NSZombie Output Issue - my application crashing when utilize popviewcontroller. when using nszombie following: 2011-07-15 13:20:03.334 question[27412:207] *** -[cfstring release]: message sent deallocated instance 0x4c8a090 i'm not exclusively sure how interpret or how find instance beingness referred to... the app crashes when add together next line: -(void) finishquestionnaire:(id)sender{ //go main manual [self.navigationcontroller popviewcontrolleranimated:yes]; } i don't think problem, think whatever loading problem... it seems over releasing object(nsstring) ie., releasing released object. see if have released string somewhere already. iphone objective-c ios xcode nszombieenabled

java - Selenium IDE test try-catch -

java - Selenium IDE test try-catch - i'm recording selenium test selenium ide. if write test selenium in java native can insert try-catch statement. is possibile insert try-catch statement in html-like test format record selenium ide? thanks! tommaso no, cannot grab exceptions in selenium ide. need utilize selenium rc grab , handle exceptions. java testing selenium

mod rewrite - Beginner mod_rewrite question -

mod rewrite - Beginner mod_rewrite question - how rewrite in .htaccess: url.com/name url.com/view.php?=name i've tried couple of variations think might putting slash in wrong place. suggestions? rewriteengine on rewriterule ^(\w+)$ /view.php?somevar=$1 [l] you have set name value of variable. this illustration allows name word.. if want specific... replace \w+ whatever specific thing want. mod-rewrite

How can I transform some HTML fragment into XHTML using groovy? -

How can I transform some HTML fragment into XHTML using groovy? - i have input string containing html fragment next example i have enever thought <b>those infamous tags</b>, born in <abbr title="don't acronym">sgml</abbr> realm, create way web of objects experience. obviously, real 1 far more complex (including links, iamges, divs, , on), , write method having next prototype string toxhtml(string html) { // have write here ? } without description of input format, html-like stuff. parsing such mess gets ugly quickly. looks else did job already: #!/usr/bin/env groovy @grapes( @grab(group='jtidy', module='jtidy', version='4aug2000r7-dev') ) import org.w3c.tidy.* def tidy = new tidy() tidy.parse(system.in, system.out) use force, riduidel. html xhtml groovy

javascript - Working with jQuery index in a each function -

javascript - Working with jQuery index in a each function - i have 2 questions, first, want calculate percentage in html page , homecoming javascript appending it. works fine sets everywhere same value. think need 'this' can't find how work. each function doesn't remain within li, sets everywhere. another problem var getalfavconvert = parsefloat(getalfav.substring(1)); reason returns unusual value. var getalconvert = parsefloat(getal.substring(1)); on other hand works fine. think has link. another problem $(".thing-shot ul").prepend('<li class="hammer">10%</li>'); $('.things li .group').each(function(index) { // value page var getal = $('.current-user-view').text(); var getalfav = $('.fav.marked a').text(); // convert value float var getalconvert = parsefloat(getal.substring(1)); var getalfavconvert = parsefloat(getalfav.substring(1)); //make percen...

swing - Java efficient overlay over transparent components -

swing - Java efficient overlay over transparent components - i have custom jcomponent performs come complicated painting. set non-opaque background of parent shows through parts not paint. i need mouse overlay (a simple shape) follows mouse. shouldn't need repaint component below every time mouse moves. i'm thinking buffer jcomponent because it's non-opaque, calling .paint(buffer) not paint background of parent. any ideas? thanks in advance. i have custom jcomponent performs come complicated painting. maybe complication painting can done bufferedimage. component draws image don't have invoke complicated code every time. image recreated whenever properties affecting image changed. java swing overlay

java - Glassfish message security digital signature -

java - Glassfish message security digital signature - i working on getting glassfish soap message security digital signature running , have not had luck. running glassfish server open source edition 3.1 build 43 , testing soapui 3.6.1. the glassfish server running ssl on port 443 know keystore , x509 certificate correctly configured. soap message security configuration running xws_serverprovider default provider , xws_clientprovider default client provider. both providers setup utilize content authenticate source , have signature.key.alias set same certificate ssl. an illustration request soapui digital signature is: <soapenv:envelope xmlns:ser="http://testservice.com/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:header><wsse:security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><wsse:binarysecuritytoken encodingtype="http://docs.oasis-open....

c# - How not following the location in headers using Web Client class? -

c# - How not following the location in headers using Web Client class? - is possible on web client class? like mywebclient.allowautoredirect = false; (of httpwebrequest) you write custom web client , enable functionality: public class webclientex : webclient { protected override webrequest getwebrequest(uri address) { var request = (httpwebrequest)base.getwebrequest(address); request.allowautoredirect = false; homecoming request; } } and then: using (var client = new webclientex()) { console.writeline(client.downloadstring("http://google.com")); } c# .net header location webclient

c++ - Compiling using g++, yet still get undefined references to operator new -

c++ - Compiling using g++, yet still get undefined references to operator new - i'm compiling using g++, yet when goes compile files in depend file that's in same directory makefile, a undefined reference `operator new(unsigned int)' thanks. edit: you're right. how utilize g++ linker instead of ld in context of makefile. been searching couldn't figure out. the tags of question suggest using ld linking. don’t that; utilize g++ instead. cause c++stdlib static library linked. c++ g++ ld

php - MySQL One to many, pulling only selected record from many table -

php - MySQL One to many, pulling only selected record from many table - i quite new @ sql statements , have never been @ joins etc. having problem working out how following: i have 2 tables, 1 called music, 1 called reviews. 2 tables link on field called uid - records in music unique, there may many reviews each music record. reviews has field called thumbsup, set value 1 if user gives music thumbs up. otherwise, field zero. there may many thumbsup in reviews, 1 thumbsup, or no thumbsup. i trying display list of records in music, , if there corresponding review record contains thumbsup value of 1 - 1 record in reviews - display icon on list page. i have had around various similar questions nil quite comes up. have tried doctoring around similar kinds of joins, frankly how works beyond me. sorry beingness idiot. by way of evidence have @ to the lowest degree had go, far have come based on post: select m.*, r.thumbsup (select max(thumbsup) uid reviews grouping uid)...

html5 - Canvas getImageData() after drawing image from file:// URI - need workaround for all browsers -

html5 - Canvas getImageData() after drawing image from file:// URI - need workaround for all browsers - i'm developer of build 2, html5 game editor windows. it's @ http://www.scirra.com. recently i've been trying add together feature modify image transforming on canvas. it's pretty straightforward - draw image canvas , phone call getimagedata() pixels. when user clicks 'preview' in our application, files dumped temp file on disk , browser launched show it. uploading server not alternative previewing - games megabytes big. however browsers block using getimagedata() pixels of any image loaded disk @ all. i've tried putting necessary image files in subdirectories mdn suggests in description of file:// access policies. doesn't work either! chrome's --allow-file-access-from-files flag fixes it. however, need back upwards major browsers. there similar workaround @ to the lowest degree net explorer , firefox? have no thought...

php - Jquery get value of radio button -

php - Jquery get value of radio button - here's html mark up <span class="wpcf7-form-control-wrap radio-20"> <span class="wpcf7-radio radio-20" id="radio-20"> <span class="wpcf7-list-item"> <span class="wpcf7-list-item-label">yes</span> <input type="radio" value="yes" name="radio-20"> </span> <span class="wpcf7-list-item"> <span class="wpcf7-list-item-label">no</span> <input type="radio" value="no" name="radio-20"> </span> </span> </span> how know of "yes" radio button or "no" checked? i tried: jquery("span#radio-20 span input").val("yes").click(function (){ alert('bang!'); }); but alert when click "no"; can hel...

iphone - Layout buttons on UIScrollView -

iphone - Layout buttons on UIScrollView - i trying create page within app can scroll downwards , see more buttons. have uiscrollview , few uibuttons, have no thought how lay them out below length of page in ib (i hope making sense). basically, dont understand how on ib have size of app, in reality, can lay content on much longer page. thanks, , again, hope making sense. in ib, can specify size of uiscrollview, set height longer page, can set subviews wherever like. iphone xcode ios4 uiscrollview

PHP random DIV with css question -

PHP random DIV with css question - i tried utilize php create div random positions. can each 100px unit, type 1 little div 1*1 ,type 2 little div 1*2, type 3 little div 2*1. divs allow show in big div box 10*6. here code. <?php function div1() { $choose1 = array("0","100","200","300","400","500","600","700","800","900"); $choose = array("0","100","200","300","400","500"); $rand_keys = array_rand($choose, 1); $rand_keys1 = array_rand($choose1, 1); echo "<div style=\"position:absolute;top:".$choose[$rand_keys]."px;left:".$choose1[$rand_keys1]."px;width:100px;height:100px;background:#ff0 none;\"></div>"; } function div2() { $choose1 = array("0","100","200","300","400","500","60...

Problem in setting session attribute in jsp function -

Problem in setting session attribute in jsp function - i trying set session attribute in jsp function. function reads cell info table row , stores in variable array. suggest how can set array_variable session ? code below - function senddata(recordtosend) { var sessiondata = new array(); var table = document.getelementbyid("tblreport"); var rownum = parseint(recordtosend); var cells=table.rows[rownum].cells; for(var c=1;c<cells.length;c++) { sessiondata[c-1] = cells[c].innertext; } <% session.setattribute("tabledata",sessiondata);// problem here %> } thanks upcoming suggestions. java/jsp , javascript not run in sync you'd expect coding. java/jsp runs @ webserver upon http request , produces html/css/js code sent webbrowser http response. webbrowser retrieves bunch of html/css/js code without single line of java/jsp code. to point, need allow js (or html form) send http request desired request parameters webserver...

c++ - Acessing a file mapping with a other function -

c++ - Acessing a file mapping with a other function - hello have process1 correctly creates , mapped file(mmap windows). can correcty acces mmap en write info in it, other process can read data. there problem when want access mapped file other function of process1. i create mapped file this: tchar szname[]=text("global\\myfilemappingobject"); int mancontrol(void* pvbrick, handle hmutex); int main() { //handels , vars ipc handle hmapfile; lpctstr pbuf; char szmsg[256]; string datastr = ""; //create file mapping hmapfile = createfilemapping(invalid_handle_value, null, page_readwrite, 0, buf_size, szname); if (hmapfile == null) { printf("failed create mmap \n"); homecoming 1; } //map file(mapviewoffile) , homecoming pointer of mapped file(file view) pbuf = (lptstr) mapviewoffile(hmapfile, file_map_all_access, 0, 0, buf_size); if (pbuf == null) { printf(...

php - custom validator in symfony -

php - custom validator in symfony - i create custom validator symfony 1.4, illustration check length name. know exist, own. i create /myapp/lib/validator/sfvalidatorname.class.php must there: class sfvalidatorname extends sfvalidatorbase { protected function configure($options = array(), $messages = array()) { $this->addmessage('invalid', 'invalid name!'); } protected function doclean($value) { } } and how can add together function, example: if (count($letters) < 3) { homecoming 'too small'; } else if (count($letters) > 43) { homecoming 'too long'; } open /lib/validator/sfvalidatorstring.class.php model validator after one. php symfony1 validation symfony-1.4

android - Corona sdk physics precise collision between 2 round objects -

android - Corona sdk physics precise collision between 2 round objects - i working on start of golf game game ball rolls hole. have working, when ball touches border of hole, collision event makes drop in (disappear). want create more precision more realistic. advice appreciated. you start transition when observe collision hole. transition take time complete, eliminating "ball disappears" problem, , little math, reflect speed , direction of ball drop hole looks realistic. android sdk physics corona

ruby on rails - Cucumber is very slow when running tests [Tested on two different Fedora machines] -

ruby on rails - Cucumber is very slow when running tests [Tested on two different Fedora machines] - i new bdd. every time seek using cucumber, find pretty slow. have tried rails 3.0.9 & 3.1 on 2 different machines. 1 of machines old ibm thinkpad laptop 2 gb ram; , other 1 pc 4 gb ram [i can exact specifications if required]. both run fedora 14. even new application no scnerios cucumber take minutes. here how goes: $ cucumber using default profile... --- 2 minutes delay---- , says: 0 scenarios 0 steps 0m0.000s in contrast, rspec instant: rspec no examples found. finished in 0.00005 seconds 0 examples, 0 failures while cucumber says took 0m0.000s ; has taken 2 minutes in reality. and, rspec instant , shows time correctly well: 0.00005 seconds. is normal. need additional gems or settings create process faster. update: here more data: first cucumber: $time cucumber using default profile... 0 scenarios 0 steps 0m0.000s real 0m53.489s user 0m37.051...

c - Program terminating on receiving - signal SIG34, Real-time event 34 -

c - Program terminating on receiving - signal SIG34, Real-time event 34 - in application main function calls funciton - f2 spawns several threads , application works fine. trying add together new function f1 before f2 spawn new thread. new thread prints on screen , goes sleep in while loop. getting print 1 time , after time application terminates. on debugging same gdb got next message: (gdb) programme received signal sig34, real-time event 34.quit (gdb) bt #0 0x0fa97cc8 in __nanosleep_nocancel () /export/home/disk4/omsn/401.03022010/montavista/pro/devkit/ppc/82xx/target/lib/tls/libc.so.6 #1 0x0fa97a50 in __sleep (seconds=0) @ sleep.c:137 #2 0x10007098 in f2 (arg=0x204) @ main.c:152 #3 0x0fd2197c in start_thread (arg=0x204) @ pthread_create.c:256 #4 0x0fac853c in clone () @ ../sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.s:100 warning: previous frame inner frame (corrupt stack?) code snippet: main(){ f1(); /*new function added spawn new task*/ f2(); /...

Addthis like button doesn't work, but stop and refresh every time -

Addthis like button doesn't work, but stop and refresh every time - i have installed addthis share buttons fb button + count. when click on script load 1or2 seconds, destroy , before i've clicked. it's conflict or known issue?? thanks. i'm not sure if help here's did: get addthis code facebook button get facebook button code facebook copy facebook code , utilize replace button code in addthis code works me button facebook-like addthis

String input in C and C++ -

String input in C and C++ - i want write programme in c or c++ asks user come in string @ run time of different lengths @ different times given user (either space separated or non space separated) , store array. please give me sample code in c , c++ it. e.g. 1st run: come in string input: foo now char array[]="foo"; 2nd run: come in string input: pool of now char array[]="pool of"; i have tried: #include<iostream> using namespace std; int main() { int n; cout<<"enter no. of chars in string"; cin>>n; char *p=new char[n+1]; cout<<"enter string"<<endl; cin>>p; cout<<p<<endl; cout<<p; homecoming 0; } but it's not working when string space separated. i have tried too, it's not working either. #include <iostream> using namespace std; int main() { int n; cout<<"enter no. of chars in string...

Sorting an array of JavaScript objects -

Sorting an array of JavaScript objects - i read next objects using ajax , stored them in array: var homes = [ { "h_id": "3", "city": "dallas", "state": "tx", "zip": "75201", "price": "162500" }, { "h_id": "4", "city": "bevery hills", "state": "ca", "zip": "90210", "price": "319250" }, { "h_id": "5", "city": "new york", "state": "ny", "zip": "00010", "price": "962500" } ]; how create function sort objects price property in ascending , descending order using javascript? sort homes cost in ascending order: class="lang-js prettyprin...

what is hard reference in java? -

what is hard reference in java? - when studying permgen, came across term hard reference. don't know meant hard reference. can explain or give me tutorials please? here couple of tutorials of hard (aka strong) , weak references in java http://weblogs.java.net/blog/2006/05/04/understanding-weak-references http://www.coderanch.com/t/433742/java/java/weakreference-hard-reference-scope-jit found simple googling java

Javascript time helper? -Interesting problem! -

Javascript time helper? -Interesting problem! - i new world of javascript , trying google search has not helped me find looking for. so have come here in hope can point me in right direction. rule= must not click! can done tabbing! i have many text fields user input times have been recorded. e.g. event 1 happened @ 11:31am event 2 happened @ 11:59am i want create process easy possible user having textbox formatted in hours , seconds in 24hr format: so textbox value= 00:00 , when user selects text box can come in hours part. jump seconds part. any thought if there can if link me. if not give me thought of coding , if there easier alternatives. i have made pseudo code help understand implementation goal: for count = 0 , while count less 20, count++ { create texbox name time+count, set value ="00:00" } when user enters numbers go hr segment until completed script jumps cursor minutes segment if time+count+1 lesser thatn time+count message use...

multithreading - XNU Max thread count -

multithreading - XNU Max thread count - how know maximum thread count in darwin kernel space? unlimited? mean kernel_task pid 0. i utilize mac os x 10.6.5 $ uname -a darwin foo.bar 10.6.0 darwin kernel version 10.6.0: wed nov 10 18:13:17 pst 2010; root:xnu-1504.9.26~3/release_i386 i386 $ Видимо никто не знает... your best bet sysctl - kern.num_threads looking (typical value 10240). hope reply (a year or later) helps, tg multithreading osx process kernel

ruby - Generic method to get id's from either a single object or collection -

ruby - Generic method to get id's from either a single object or collection - i want create generic method take either single object or collection, , homecoming array of id's, , actual id take object/collection passed in parameter. example: a = [] << get_ids("car_id", some_object) << get_ids("user_id", some_collection) def self.get_ids(id_name, obj) # ?? end this needs metaprogramming know, how figure out if collection or not? send message check if "id_name" property? also, need type of functionality, thought of making generic can re-use it. have major performance implications? def self.get_ids(id_name, obj) if obj.is_a? enumerable obj.collect {|e| e.send(id_name) } else obj.send(id_name) end end alternatively, def self.get_ids(id_name, *objs) objs.collect {|e| e.send(id_name) } end ... << get_ids("car_id", some_object) << get_ids("user_id", *some_colle...

wcf authentication - WCF Type 'System.CodeDom.Compiler.GeneratedCodeAttribute' is not defined -

wcf authentication - WCF Type 'System.CodeDom.Compiler.GeneratedCodeAttribute' is not defined - i next tutorial shows how implement wcf authentication service. have done step step detailed. after adding proxy classes when seek build project, gives me 68 errors , few listed below. don't know doing wrong here. think missing imports in class or attribute in app.config file. may wrong. type 'system.codedom.compiler.generatedcodeattribute' not defined. type 'system.servicemodel.servicecontractattribute' not defined. type 'system.servicemodel.operationcontractattribute' not defined. type 'system.servicemodel.endpointaddress' not defined. all 3 application services(authentication, roles, profile services) compile appropriately shown in walkthrough article. trying build single-sign on mechanism through wcf authentication service. thanks in advance. have add together reference system.servicemodel? wcf wcf-authenticati...

oop - Notifying observers from nested structures -

oop - Notifying observers from nested structures - currently, trying dissect tight coupling between info model , ui in application introducing mvc pattern. basically, means making model aware of associated views in order have them informed whenever properties within model change. the info model represented nested structure: model - node - leaf - leaf - node - leaf each element inherits mutual abstract base of operations class (structurednode). the problem i've been thinking is: observers should able subscribe model (and model), each element should able emit alter notifications. achieved in 2 ways - either notifications routed hierarchy until reach model, pushed observers, or implementing notifications in base of operations class, static observers list, in example: class="lang-java prettyprint-override"> public abstract class base of operations { private static map<iobserver> observers; protected synchronized void internal...

php - Yii Conditional Validation -

php - Yii Conditional Validation - i have question yii validation. have dropdown options y , n. if user select y user must explain why chose y hence textarea box become required. my code rule looks @ follows. array('explain', 'check', 'trigger'=>'med_effects'), check function used validation public function check($attribute, $params) { if($this->$params['trigger'] == 0 && $this->$attribute == '') { $this->adderror($attribute, 'explain effects of medicine'); } } the value $this->$params['trigger'] not change. i'm assuming because saved value 0(y) , not alter if user take n. how supposed determine alternative user chose when sumbits form? thanks. create property within model: public $isdropdownchecked; in view, create dropdown wired new property created. and homecoming array of rules within method rules() this: public f...

java - Service Discovery Fail - Bluetooth Chat Connection using SPP -

java - Service Discovery Fail - Bluetooth Chat Connection using SPP - so have compiled , succesfully ran android bluetooth chat project on eclipse (api8). the issue is, when connect own embedded bluetooth device (http://www.sparkfun.com/products/582) says "service discovery fail" in debug mode. i searched, , found post: android bluetooth: service discovery failed exception how every compilation error. i have several quick fixes in eclipse. none of work. new java. thanks in experience, absolutely essential modification create bluetooth chat application enable connection spp profile of bluetooth device utilize spp uuid. alter my_uuid follows: private static final uuid my_uuid = uuid.fromstring("00001101-0000-1000-8000-00805f9b34fb"); with uuid find able connect big range of spp bluetooth modules. java android bluetooth serial-port

load - Speeding up page loading on Wordpress site -

load - Speeding up page loading on Wordpress site - i have site set on wordpress extremely slow load. at first blamed slideshow on homepage, closer can see basic pages slow load: http://www.marcusmcshane.com/bio/ can share tips on speeding up? i admit created theme when didn't know much wp, may excessively bulky. hosted godaddy. uses latest version of wp , of next plugins: astickypostorderer, category posts widget, nivo slider wordpress plugin, w3 total cache, widget logic thanks! godaddy known crappy, overloaded host. no amount of caching or utilize of cdn, etc., help over-shared servers , network latency. best find host. http://wordpress.org/hosting/ wordpress load wordpress-theming

xcode - Undefined symbols for architecture i386 -

xcode - Undefined symbols for architecture i386 - possible duplicate: symbol(s) not found architecture i386 i have app complete, , when start trying understand previous developer did (it done xcode 3 think) executing simulator, xcode 4 show me 25 issues: ld build/debug-iphonesimulator/radioplayer.app/radioplayer normal i386 cd /users/haithembenhammouda/desktop/sonvidéo setenv macosx_deployment_target 10.6 setenv path "/developer/platforms/iphonesimulator.platform/developer/usr/bin:/developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /developer/platforms/iphonesimulator.platform/developer/usr/bin/gcc-4.2 -arch i386 -isysroot /developer/platforms/iphonesimulator.platform/developer/sdks/iphonesimulator4.3.sdk -l/users/haithembenhammouda/desktop/sonvidéo/build/debug-iphonesimulator -l/users/haithembenhammouda/desktop/sonvidéo/classes/radiokitlib -l/users/haithembenhammouda/desktop/sonvidéo -f/users/haithembenhammouda/desktop/sonvidéo/build/debu...

What is Silverlight/C# equivalent for Java's AccessController.doPrivileged -

What is Silverlight/C# equivalent for Java's AccessController.doPrivileged - i'm trying filing silverlight , have access result javascript. done java applets through accesscontroller.doprivileged method, illustration can write methods such savetofile or readfromfile wrapped within accesscontroller.doprivileged method, , done. wanted know how can same thing silverlight, i.e., privileged stuff such file io therein. by design (for security reasons), silverlight code cannot access straight host's file system. file may accessed, in reading mode only, if selected way of file open dialog. limited capabilities writing files when silverlight application both ran in out-of-browser mode and in context of elevated trust. yet such access limited particular known directory locations (my documents, music etc.) isolated storage provides way silverlight applications create, write , read files, type of access "corralled"; again, silverlight code not have direc...

php - How to export an html table as a pdf or image? -

php - How to export an html table as a pdf or image? - i working on creating website allow users update table using javascript. what looking way allow user export table image (jpg, png etc.) or pdf 1 time has been modified. if there similar thread or topic please allow me know, don't know start here. if can recommend background reading great too. thanks! this not can done client side (without installing software on clients, of course). need generate pdf server-side. how depends on language , platform using. php html image table pdf

linux - Redirect all output to file -

linux - Redirect all output to file - i know in linux, redirect output screen file, can either utilize > or tee . however, i'm not sure why part of output still output screen , not written file. is there way redirect output file? that part written stderr, utilize 2> redirect it. example: foo > stdout.txt 2> stderr.txt or if want in same file: foo > allout.txt 2>&1 note: works in (ba)sh, check shell proper syntax linux bash io-redirection

.net - Strategies for implementing recovery mode -

.net - Strategies for implementing recovery mode - i have windows application if fails, default “recovery mode”, first time run after failing. i'm ok on flagging error , different things user recover, it's actual launching of recovery mode utility giving me headache. have had couple of ideas, hoping else might have come across improve method. 1) when main app loads first thing if check previous error , launch recovery mode utility. the problem if there wrong app, likely, not start @ all. 2) instead of main app have user start utility check previous error, either launch main app or go recovery mode. this solves problem first idea, target machines locked downwards , there deployment issues. are there other strategies implementing recover mode? thanks we solved similar situation follows : make "recovery mode utility" 1 started user the "recovery mode utility" check whether recovery (and if it) when either no recovery needed or ...

android - Behavior Tree versus State machine -

android - Behavior Tree versus State machine - i want implement complex branching logic android business application used marketing questionaire tool lots of questions , branching among them according user responds. i'm confused whether implement dialog logic fsm or behavior tree. authors have used trees implement state machines. illustration in artificial intelligence games ian millington et al, author suggests using decision tree fsm. however, think fsm can have closures, illustration having transition between "raise alarm" , "defend" create graph rather tree. first question difference between tree , state machine ? sec 1 implementation app, manage high level of branching complexity? i think definition, fsm have 1 entry point, while behavior trees can have multiple inputs. tree graph, graph not tree. tree acyclic graph leaves never have multiple parents. in regard, tree improve suited fsm. anyways, imagine type of simulation outside sco...

c# - Convert a 2D image to a 3D model -

c# - Convert a 2D image to a 3D model - is there way of converting 2d image captured normal web photographic camera converted 3d model? i'm using c# algorithm based in c# helpful. not without additional information. you might able project 2d image onto modelled 3d surface. note: funny '3d plane' plane typically 2d. c# augmented-reality

javascript - Defining selected tab by url in jQuery tab script -

javascript - Defining selected tab by url in jQuery tab script - i have jquery search script uses tabs user define search type want use. when user searches, url created #type/query/. if #type in url tab corresponds type appears selected. however, if query in url (#type/query/) tab isn't selected. code below, how can create ignore after /query/? hope can understand i'm trying describe. my jquery script is: $(document).ready(function () { $('[id^=type_]').click(function () { type = this.id.replace('type_', ''); $('[id^=type_]').removeclass('selected'); $('#type_' + type).addclass('selected'); homecoming false; }); if (window.location.hash != "") { url = window.location.hash.replace('#', ''); $('#type_' + url).click(); } else { $('#type_search').click(); } $('#query').keyup(function () ...

Can I save flash game and play it without being connected to the Internet? -

Can I save flash game and play it without being connected to the Internet? - not sure if question belongs on ... can play desktop tower defense without beingness connected internet? i can load page , disconnect net question if can download game , play time without connecting net. the short reply seems no, since has made .swf not produce game unless go website... ie if doesn't ping server if displays nag screen... pretty pitiful in sentiment not allow offline play fans since has earned ton of money off game (from 2007 onwards) oh well... might afraid of misuse of offline version on other websites, though have coded instead (it won't stop crackers , hackers of course)... think wants extort every penny out of games since has bothered create nice nag screen. (smileyface) so short reply seems no. flash

javascript - how to get attributes of a link using attachListener? -

javascript - how to get attributes of a link using attachListener? - i have tried both jquery , javascript, none able bring attribue of link. here code using- not printing in callme function's alert function callme() { var ll = this; var id1 = ll.getattribute('id'); alert('inside callme...'+id1); } function load() { var lnk = new array(); lnk = document.getelementsbytagname("a"); var len = lnk.length; (var i=5;i<len;i++){ var id = lnk[i].getattribute('data-id'); lnk[i].attachevent('onclick',callme); } } i tried using next jquery too $("a").click(function(){ alert(this.id); var shouldtrack = $(this).attr('id'); alert('inside callme...'+shouldtrack); }); > function callme() { > var ll = this; when using ms proprietary attachevent, called listener's this keyword not set element on listener called (as when w3c addeventlistener method or html intrinsic event hand...

ipad - How can I disable the main toolbar when displaying a popover using modalInPopover? -

ipad - How can I disable the main toolbar when displaying a popover using modalInPopover? - i'm displaying popover contained view controller having modalinview property set. need user come in response here before continuing. while disables of user interface controls, disable toolbar buttons on main app. don't want user interact application before selecting item in popover , closing it. am missing clever here - i.e. disable toolbar default? why remain active? there user interface guidelines require it? should set toolbar disallow user interaction, or messy? it seems ios adds bar "passthrough view" popover, when nowadays uibarbuttonitem. just set nil passthroughviews property of uipopovercontroller after presenting it, this: [self.mypopover presentpopoverfrombarbuttonitem:some_item permittedarrowdirections:uipopoverarrowdirectionany animated:yes]; dispatch_async(dispatch_get_main_queue(), ^{ self.mypopover.passthroughviews = nil; }); ipad...

c# - Fire up event from Image Button in a User Control inside a Data List -

c# - Fire up event from Image Button in a User Control inside a Data List - : this first post here, beg forgive mistkaes :d problem i'm facing following: i'm trying grab event 'imagebutton' within info list experiencing problems. i need grab button fired action (so need identify it). button within user command contained 'datalist', placed within user control, load page (that has master page also). can see nested order here : page->user-control->datalist->user control->imagebutton i have web application built using web forms mvp pattern pages (not controls) have presenter manages logic , send info bind web forms, load needed controls. members.aspx ....... <%@ register src="~/controls/datacontrol.ascx" tagname="databox" tagprefix="dtc" %> ....... <dtc:databox id="databoxcontrol" runat="server" /> members.aspx.cs protected void page_load(object sender, even...

mapping - Map a JSON field that can have different types with Jackson? -

mapping - Map a JSON field that can have different types with Jackson? - i json web service , can not influence json format. json code below illustration illustrate problem. field cars can either object containing car objects or can empty string. if alter web service, i'd alter empty string empty object "cars" : {} instead of "cars" : "" . when trying map json java object: public class person { public int id; public string name; public map<string, car> cars; } this works: { "id" : "1234", "name" : "john doe", "cars" : { "tesla model s" : { "color" : "silver", "buying_date" : "2012-06-01" }, "toyota yaris" : { "color" : "blue", "buying_date" : "2005-01-01" } } } and fai...