Posts

Python Set Comprehensions -

this question has answer here: set changes element order? 6 answers how return value of set function organized? 2 answers i'm starting out learning python set comprehensions. why { 2**x x in {0,1,2,3,4} } return {8, 1, 2, 4, 16} instead of ordered {1, 2, 4, 8, 16} ? mathematically speaking, sets not have order. when displaying or iterating on set, python needs provide particular order, order arbitrary , not relied on. order is, however, fixed particular set; iterating on same, unmodified set produce same order each time.

c# - EF Codefirst Migrations new database -

i'm confused in situation i've gotten myself into. i've recreated database after issue. when run project, codefirst creates database ef model. site works fine. but come add migration, says i've got explicit migrations pending on database. these pending migrations existing migrations. it appears db has been created recent model. without model/revision data attached. how go populating migration data ef knows db date? i have ask, how did go resolving issue had? idea of migrations can go backwards , forwards through them, allowing revert changes. that said, are. in instance have agree @sq33g , remove existing migrations, , fix current database. haven't provided comprehensive account of problem suggest data elsewhere imported current database if required sql queries.

c# - Converting JSON string to lisp(aml) readable string for evaluation using regular expressions -

i'm trying convert json string stringformat can use evaluate in lisp (aml). i want convert f.eks.: {"id": 1, "name": "foo", "price": 123, "tags": ["bar","eek"], "stock": {"warehouse": 300, "retail": 20} } to: (json-object (json-object-property "id" <1>) (json-object-property "name" <"foo">) (json-object-property "price" <123>) (json-object-property "tags"(json-array (list "bar" "eek")) (json-object-property "stock"(json-object (json-object-property "warehouse" <300>) (json-object-property "retail" <20>))))) i'm trying first use c# , regex it, , "translate" lisp/aml. question really: how using regular expression in c#? have tried lot, ends struggling strings inculdes not-word-characters, or few "(". i have ...

Rails 4 assets not found in production (digest path is OK) -

i have problem assets in production. i can't load stylesheets, javascripts or images. when try access something, shows me error - not found when try access -digest, it's ok. i have assets precompiled, deployed via capistrano manifest -> assets_manifest.json thanks log: stylesheet error (stylesheet loaded themes_for_rails gem) when try access /assets/default/stylesheets/application-ec9a310f792c60f2f77810cfcd9b903f.css , ok i, [2013-07-17t14:38:45.120183 #31938] info -- : started "/assets/default/stylesheets/application.css?locale=cs" 90.181.17.25 @ 2013-07-17 14:38:45 +0200 i, [2013-07-17t14:38:45.123007 #31938] info -- : processing themesforrails::assetscontroller#stylesheets css i, [2013-07-17t14:38:45.123429 #31938] info -- : parameters: {"locale"=>"cs", "theme"=>"navarsi", "asset"=>"application"} i, [2013-07-17t14:38:45.124912 #31938] info -- : rendered text template (0....

exception handling - How to determine if the Android Application was force closed? -

i need determine, if application force closed, crashed, or terminated normally. question is: how such thing in android environment. handling exceptions easy, need replace thread.setdefaultexceptionhandler. hard part is: how can distinguish force close shut down "normal" (like press, or home button + lots of time, etc)? the reason is: can synchronize content of local database, server. , have reasons allow operation, in state 1, of main activity, , not in state 2. however, if user finds db related semantic error in program, in state 2 of main activity, or can stuck there. we're prepared incoming call interruption, , other configuration changes, so, if application gets stuck in state 2, force closing app, reopening it, still leave user in stage 2, instead of stage 1. so want leave way, user, after force closed stuck go stage 1, , able synchronize database, majority of or work can saved. unfortunately there no way. when user or system force stops applicatio...

caching - Symfony : Error 500, cache clear on production? -

i can't access module on website, giving me error 500 , don't know why (i don't have access error log). working earlier. i thought have been because of file replaced earlier on ftp server, retransfered previous versions of files related module onto ftp server again. module still giving me error 500 @ moment. i thinking clearing cache on production fix problem. think? i working on copy of original website on wamp , therefore can't delete production cache command line. deleting content of /cache/ folder ftp server same thing? risks represent? clearing cache manually ftp won't harm unless developed specific stores important files in folder.

java.io.IOException: Posted content length of 1130270 exceeds limit of 1048576 -

this question has answer here: form large exception 15 answers while uploading file more 1 mb getting error. java.io.ioexception: posted content length of 1130270 exceeds limit of 1048576 com.oreilly.servlet.multipart.multipartparser.<init>(multipartparser.java:172) com.oreilly.servlet.multipartrequest.<init>(multipartrequest.java:222) com.oreilly.servlet.multipartrequest.<init>(multipartrequest.java:109) com.oreilly.servlet.multipartrequest.<init>(multipartrequest.java:89) org.apache.jsp.jsp.test_jsp._jspservice(test_jsp.java:211) org.apache.jasper.runtime.httpjspbase.service(httpjspbase.java:94) javax.servlet.http.httpservlet.service(httpservlet.java:802) org.apache.jasper.servlet.jspservletwrapper.service(jspservletwrapper.java:324) org.apache.jasper.servlet.jspservlet.servicejspfile(jspservlet.java:292...