Posts

Why are consistently balanced trees hard to implement and use in the "real world"? -

i'm taking algorithms , data structures course , 1 the slides informs "consistently balanced trees hard implement" , quotes following phrase: “the difficulty of implementing balanced trees restricts use; balanced trees implemented except part of programming assignment in data structures class.” -- w. pugh is true these data structures implemented in real world? using , applying balanced trees doesn't seem hard - missing? i know examples of difficulties can experienced in real applications make balanced trees hard implement. balanced trees hard right if don't have lot of experience in designing data structures, or can't details in text book. people never implement trees scratch. despite that, balanced trees popular, because programming environments can find library implements them. languages have them in standard library.

Android Studio : How to uninstall APK (or execute adb command) automatically before Run or Debug? -

now need uninstall app every time before run/ debug in android studio. because need re-create database before run \debug app. know can run command "adb uninstall [package_name]" in terminal clear files under /data/data/[package_name]. it's not convenient way if have execute command every time. hope "adb uninstall" command can executed automatically when click "run" \ "debug" button. adb uninstall <package_name> can used uninstall app via pc. if want happen automatically every time launch app via android studio, can this: in android studio, click drop down list left of run button, , select edit configurations... click on app under android application, , in general tab, find heading 'before launch' click + button, select run external tool, click + button in popup window. give name (eg adb uninstall) , description, , type adb in program: , uninstall <your-package-name> in parameters:. make sure new ite...

Closure multiplate call function im javascript -

example write down myfunc('asdas') it's console.log me 'asdas' then after write down myfunc('as')('ds')('ko')....('other') function must console.log me "as ds ko .... other" i tried realize have many problems it. function me (str){ //var temp = str; return function mes(val) { val += ' '+ str; console.log(val); //return mes; } } how correctly realize function? well, bit funny, works: concat = function(x, val) { val = (val || "") + x; var p = function(y) { return concat(y, val) }; p.tostring = function() { return val }; return p } x = concat('a')('b')('c')('d'); document.write(x)

asp.net - dynamics CRM 2011 show form in aspx page / portal -

i wonder if there way show crm 2011 forms (like information form of contact entity) on aspx page? i want build customer portal (asp.net) shows fields configured in crm itself. any suggestions? cheers you have few options: put iframe aspx page , point crm form url. url has following format: http://myhost.com/orgname/main.aspx?etn={entityname}&pagetype=entityrecord&id={entityguid} use crm database views (or crm webservice ) directly application. configure datasource crm database downside of first solution users asked credentials (you want introduce sso ) , if crm running on different domain bit difficult ensure javascript communication between page , iframe. however, not impossible - http://easyxdm.net/wp/ . advantage it's pretty easy build. the second solution more work on other hand have under control.

java - how to fix this jpa/hibernate oracle error -

i use following code build query in jpa hibernate 4.1.9.final implementation: if (!stringutils.isblank(filtertext)) { string search = "%" + request.getpaging().getfilter().getfiltertext().trim().tolowercase() + "%"; string datesearch = search; try { datesearch = "%" + datetimeformatutils.formatdateonlyfordb(filtertext) + "%"; } catch (illegalargumentexception exception) { // no-op, it's okay if filtertext not date } predicate textpredicate = criteriabuilder.or( buildlikepredicate(criteriabuilder, deposit, deposit_.id, search), buildlikepredicate(criteriabuilder, deposit, deposit_.date, datesearch), buildlikepredicate(criteriabuilder, deposit, deposit_.bankaccountnumber, search), buildlikepredicate(criteriabuilder, deposit, deposit_.amount, search), buildlikepredicate(criteriabuilder, mer...

ssl - Twisted Python and TLS - what does the client code need for handshaking? (I thought just public key!) -

forgive me here - despite best efforts rather non-precise way of asking precise question! i pointed towards following website on generating server side key/cert (pem file) twisted python tls server: https://twistedmatrix.com/trac/browser/trunk/twisted/test/server.pem as can see, code here generates pem file contains python source (subsequently removed!) , certificate, , private key. from here, used following generate public key (since pyopenssl apparently has no way of exporting it) openssl x509 -pubkey -noout -in server.pem > public.key i used server.pem file generated above in "starttls_server.py" sample found here: https://twistedmatrix.com/documents/14.0.0/core/howto/ssl.html however, corresponding starttls_client.py example seems want use same "server.pem" file. surely wrong? (limited!) understand of tls client given copy of public key, , used handshaking. nontheless tried it, , wasn't overly surprised when didn't work: failure: tw...

plot - How to reshape data for a stacked barchart using R lattice -

Image
this question has answer here: reshaping data.frame wide long format 4 answers i have bunch of data in table (imported csv) in following format: date classes score 9/1/11 french 34 9/1/11 english 34 9/1/11 french 34 9/1/11 spanish 34 9/2/11 french 34 9/2/11 english 34 9/3/11 spanish 34 9/3/11 spanish 34 9/5/11 spanish 34 9/5/11 english 34 9/5/11 french 34 9/5/11 english 34 ignore score column, it's not important. i need tally of total number of students taking english or spanish or french class based on date, ie. need first group date , divide each day further blocks based on language , plot stacked bar chart looks following. each bar represents date , each cross section o...