Posts

python rq - How to clear Django RQ jobs from a queue? -

i feel bit stupid asking, doesn't appear in documentation rq . have 'failed' queue thousands of items in , want clear using django admin interface. admin interface lists them , allows me delete , re-queue them individually can't believe have dive django shell in bulk. what have missed? the queue class has empty() method can accessed like: import django_rq q = django_rq.get_failed_queue() q.empty() however, in tests, cleared failed list key in redis, not job keys itself. thousands of jobs still occupy redis memory. prevent happening, must remove jobs individually: import django_rq q = django_rq.get_failed_queue() while true: job = q.dequeue() if not job: break job.delete() # delete key redis as having button in admin interface, you'd have change django-rq/templates/django-rq/jobs.html template, extends admin/base_site.html , , doesn't seem give room customizing.

Memory management scenario with MongoDB & Node.JS -

i'm implementing medium scale marketing e-commerce affiliation site, has following estimates, total size of data: 5 - 10 gb indexes on data: 1 gb approx (which wanted in memory) disk size (fast i/o): 20-25 gb memory: 2 gb app development: node.js working set estimation of query: average 1-2 kb, maximum 20-30 kb of text base article i'm trying understand whether mongodb right choice database or not. index going downsize of memory have noticed after querying mongodb, has occupied memory (size of result set) caching query. in 8 hours i'm expecting queries' depth cover 95% of data, in scenario how mongodb manage limited memory scenario app instance of node.js running on same server. would mongodb right choice scenario or should go other json based no-sql databases.

XML dynamic validation with Java -

infrastructure: i'm using java 1.5 , mandatory. can load external lib no problem. problem: i have xml file recived via "an external channel" , can use inputstream if need same, use: inputstream = new fileinputstream(file); i need validate xml against xsd has neasted xsd <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:body="urn:cbi:xsd:cbibdysddreq.00.00.06" xmlns:htrt="urn:cbi:xsd:cbihdrtrt.001.07" xmlns:he2e="urn:cbi:xsd:cbihdrsrv.001.07" xmlns:sgnt="urn:cbi:xsd:cbisgninf.001.04" xmlns:lmsg="urn:cbi:xsd:cbisddreqlogmsg.00.00.06" xmlns="urn:cbi:xsd:cbisddreqphymsg.00.00.06" targetnamespace="urn:cbi:xsd:cbisddreqphymsg.00.00.06" elementformdefault="qualified"> <xs:import namespace=...

linq - OrderBy multiple properties in Razor and Umbraco 4.11.8 -

during update of our website umbraco, upgraded 4.7.2 4.11.8. in cshtml-file had code: foreach(var item in model.ancestororself("master") .items.first() .publicationfolder.first() .children.where("visible") .orderby("publicationtype, date desc")) it worked fine , sorted collection first publicationtype , newest date . in new version (4.11.8) doesn't work anymore. gives me exception: at least 1 object must implement icomparable. and if write .orderby("publicationtype", "date desc") , doesn't affect collection. so bug or doing wrong? there workaround? i found solution need cast collection list<dynamicnode> works. foreach (var item in ((list<dynamicnode>)@model.ancestororself("master") .items.first() .publicationfolder.first() .children.where("visible").items) ...

xslt 1.0 - Sorting from multiple nodes by alphanumeric format -

<?xml version="1.0" encoding="utf-8"?> <accountlist> <previousaccount> <account> <lastname>nash</lastname> <accountstatus>removed</accountstatus> <accno>8d</accno> </account> <account> <lastname>adoga</lastname> <accountstatus>removed</accountstatus> <accno>8a</accno> </account> <account> <lastname>lucas</lastname> <accountstatus>hold</accountstatus> <accno>9a</accno> </account> <account> <lastname>donald</lastname> <accountstatus>hold</accountstatus> <accno>10d</accno> </account> <account> <accountstatus>hol...

mongodb - Retrieving document from collection by id -

my object have in collection: type room struct { id bson.objectid `json:"id" bson:"_id"` name string `json:"name" bson:"name"` } inserting collection: room = &room{id: bson.newobjectid(), name: "test"} roomcollection.insert(room) retrieving collection (any): roomx := &room{} if err := roomcollection.find(bson.m{}).one(roomx); err != nil { panic(err) } fmt.printf("roomx %s:\n%+v\n\n", roomx.id, roomx) this outputs: roomx objectidhex("52024f457a7ea6334d000001"): &{id:objectidhex("52024f457a7ea6334d000001") name:test} retrieving collection (by id): roomz := &room{} if err := roomcollection.find(bson.m{"_id": room.id}).one(roomz); err != nil { panic(err) // throws "not found" } this throws "not found" , can't figure out why. the different key-value tags fi...

visual studio - Using c# property DHCPLeaseLifetime -

i looking way find out , use how lifetime left in dhcp lease , ms has documentation here, guess not sure how use property. haven't been able find much. here's link you might want consider the msdn example . illustrates how lease lifetime. the (condensed) version of example future reference: each adapter in net.networkinformation.networkinterface.getallnetworkinterfaces() each uni in adapter.getipproperties().unicastaddresses console.writeline(" unicast address ......................... : {0}", uni.address) console.writeline(" dhcp leased life time ................ : {0}", uni.dhcpleaselifetime) next uni next adapter