Posts

python - Django runserver, and s3boto backend -

django's "manage.py runserver" has wonderful ability magically gather altered css, js, , image files it's running. makes save changes-reload cycle incredibly fast when doing front-end development (css especially). it's wonderful. however, we've moved heroku recently, , installed django-storages s3boto handle static files. works wonderfully too. however, "manage.py runserver" no longer automatically showing updated files. have run "manage.py collectstatic" -- works, adds step, , slows down development while wait collectstatic step upload files s3. is there way old behavior of runserver back, while keeping django-storages?

MySql localhost vs Amazon RDS instance -

i have surprise of mysql performance. when run simple query 'select 1;' on local host (mysql 5.6.x) using workbench, execute in 0.000s, same query ran on amazon rds (medium mysql 5.5.x) tooks 0.094s. i can not understand behavior of mysql. the query select 1 requires no parsing , no table access execution quick. remote servers there's time transmit request , shared resources rds not real-time resources, might take millisecond or 2 task executed. if there's no bigger difference ignore little time.

ios - Why tiny memory leak in this func related to UIGraphicsBeginImageContext? -

i have simple function create uiimage special size : - (uiimage*)imagewithsize:(cgsize) imsize { uigraphicsbeginimagecontext( imsize ); float r = 0.5f; float g = 0.5f; float b = 0.5f; cgcontextref cxt = uigraphicsgetcurrentcontext(); cgcontextsetrgbstrokecolor(cxt, r, g, b, 1.0); cgcontextsetrgbfillcolor(cxt, r,g,b, 1.0); cgcontextfillrect(cxt, cgrectmake(0.0, 0.0, imsize.width, imsize.height)); uiimage* retimg = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); return retimg; } and call many times in way (i'm using arc): for(int i=0;i<3000;i++) { uiimage* im = [self imagewithsize:cgsizemake(256,192)]; } it receive memory warning several times, crash on iphone4 ;( wrong simple function? this typical when using large loops no have local autorelease pools. since function not return control main loop, hence giving os chance drain pool of autoreleased objects, memory occupation keeps ...

database - Hibernate - my table is not mapped -

i want make simple query getvaluebylabel method: here code: public config getvaluebylabel(string label) throws entitypersistexception{ try { query query = em.createquery("select id config config_label=:label",long.class); query.setparameter("label", label); list<long> config = query.getresultlist(); return em.getreference(config.class, config.get(0)); } ... when want start method get: org.hibernate.hql.internal.ast.querysyntaxexception: config not mapped [select id config config_label=:label] any ideas how fix that? update i using: hibernate 4.0.1.final , postgresql db 1.16.1 syntax of hql case sensitive. please see if table/entity , column/instance variable names used in query same of object.

java - Tomcat's webdav repeated 401 when it's deployed on Mac OS X -

i have deployed tomcat 7.0.39 on mac os x 10.7 java 1.7.0_04-b21, , turned on webdav shipped tomcat. try connect finder using either basic or digest authentication, connection fails , tomcat's access log repeatedly reports 401 (propfind /webdav/ http/1.1 401 951) if stop connection. when deploy same tomcat on linux machine using java 1.6, works fine mac's finder. , if connect webdav deployed on mac os x browser or linux's nautilus, works fine. edit: repeated 401 messages seems infinite redirects. edit2: when connect webdav running on mac os x openoffice, it's fine too. weird. edit3: in previous situation, used localhost connect webdav servlet. changed localhost ip, such 192.168.2.103, same machine localhost, finder correctly made connection. it's weird. maybe cache interferes finder, since i've changed webdav's configurations of same url several times. could help? thanks. problem solved. the reason unclear me, it's possible credentia...

html - Pair programming application for two or more people -

i'm teaching web development basics free , i'd give kind of live interactive tutorials. i'd find app can connect server's ftp defined folder , let users edit files live other can see or can edit , can see it. should have chat can talk them , tell them what. want editor simple possible. it's html, css, php , javascript. it should immidiettely save files whenever edited user's can see difference while have opened page. example, have opened myserver.com/tutorial/index.html , everytime edit file, see difference. sorry if question doesn't fits here don't know else ask. thank you. what cloud9 ide ? doesn't use ftp, can (and freely) put code on 1 or more github projects, , let users hack them in c9.

algorithm - My puzzle on Project Euler # 25 about java.lang.NullPointerException -

i working on project euler #25. intending save fibonacci number in biginteger array. however, there throws nullpointerexception, don't know why , how avoid it. know there more simple algorithm solve question. want know mistake, thank much! here question states: fibonacci sequence defined recurrence relation: fn = fn−1 + fn−2, f1 = 1 , f2 = 1. hence first 12 terms be: f1 = 1 f2 = 1 f3 = 2 f4 = 3 f5 = 5 f6 = 8 f7 = 13 f8 = 21 f9 = 34 f10 = 55 f11 = 89 f12 = 144 12th term, f12, first term contain 3 digits. what first term in fibonacci sequence contain 1000 digits? my code below: private static biginteger[] fibonacci; public static void main(string[] args) { for(int = 0; fibonacci[fibonacci.length-1].tostring().length() < 1000; i++){ if(i == 0) fibonacci[i] = biginteger.zero; if(i < 3) fibonacci[i] = biginteger.valueof(1); else fibonacci[i] = fibonacci[i - 1].add(fibona...