Posts

android - Bring task to front on widget click -

i sent task (activity) with: @override protected void onactivityresult(int requestcode, int resultcode, intent data) { super.onactivityresult(requestcode, resultcode, data); movetasktoback(true); } but need bring front setonclickpendingintent in widget. just start main (root) activity of application this: intent intent = new intent(context, mainactivity.class); intent.addflags(intent.flag_activity_new_task); context.startactivity(intent); if activity running in task, bring task foreground (without creating new instances of activity). if activity not running, start new task activity @ root.

Empty order_by field from jqgrid causes failure in tastypie api -

i'm using jqgrid access tastypie api. i've changed sidx "order_by" match default tastypie api. jqgrid passes order_by (formerly sidx) parameter regardless of whether it's ordering or not. if not sorting, passes empty string sort critiera. tastypie freaks out @ empty string saying "there no field named '' " the way see it, there's 2 options solve: have jqgrid stop sending order_by param unless needs to have tastypie ignore empty order_by string... any suggestions on how either of 2 things? i not sure, full understand problem. first of rename sidx order_by 1 can use prmnames: {sort: "order_by"} if never sidx or order_by send can use prmnames: {sort: null} you can implement scenarios in changing prmnames.sort dynamically. can use jqgrid callbacks or events . one more way control list of parameters sent server serializegriddata callback. example serializegriddata: function (postdata) { var mypostdata = $.extend(...

asp.net mvc - MVC Entity Framework Annotation -

say have following code: truck truck = new truck(); truck.id = '12323' return view(truck); note entity truck has number of fields associated such color, note, etc. for note, add annotation maxlength. how go adding , annotation. know done in class in case, not have class getting truck directly entity framework. you want make partial class (aka buddy class) entity class , give metadatatype attribute. check out example validation attributes. section labeled using data annotation validators entity framework . http://www.asp.net/mvc/tutorials/older-versions/models-(data)/validation-with-the-data-annotation-validators-cs

jquery - Animation delay for this snippet? -

i read on jquery delaying, can't seem delay animation mouseover call: $("div#test").mouseover(function () { $("div#test").delay(1000).animate({width:100}, {queue:false}); $("div#test").delay(1000).animate({height:100}, {queue:false}); }); what doing wrong here? the problem queue: false boolean, has effect of starting animation (from api page animate() ): queue : boolean indicating whether place animation in effects queue. if false , animation begin immediately. removing that, , combining effects 1 animate() call seems make things work expected: $("div#test").mouseover(function () { $(this) .delay(1000) .animate({width:100, height: 100}); });รข€‹ js fiddle demo . references: animate() . delay() .

java - Running hadoop job: Class not found - org.apache.tools.ant.launch.AntMain -

i have locally installed hadoop on debian linux distribution in vmware , having difficulties running test jobs. i can build create package intellij idea, mrunit tests pass expected. once try run job, following exception: exception in thread "main" java.lang.noclassdeffounderror: org/apache/tools/ant/launch/antmain @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclass(classloader.java:791) @ java.security.secureclassloader.defineclass(secureclassloader.java:142) @ java.net.urlclassloader.defineclass(urlclassloader.java:449) @ java.net.urlclassloader.access$100(urlclassloader.java:71) @ java.net.urlclassloader$1.run(urlclassloader.java:361) @ java.net.urlclassloader$1.run(urlclassloader.java:355) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(urlclassloader.java:354) @ java.lang.classloader.loadclass(classloader.java:423) @ java.lang.classloader.loadclass(classloader.java:356) @ java.lang.cl...

django - How to iterate over list of dictionary in python? -

i have list of dictionary in python i.e. listofobs = [{'timestamp': datetime.datetime(2012, 7, 6, 12, 39, 52), 'ip': u'1.4.128.0', 'user': u'lovestone'}, {'timestamp': datetime.datetime(2012, 7, 6, 12, 40, 32), 'ip': u'192.168.21.45', 'user': u'b'}] i want use of keys , value of listofobs variable in django-template. example: for first iteration: timestamp = 7 july 2012, 12:39 ip = 1.4.128.0 user = lovestone and second iteration : timestamp = 7 july 2012, 12:40 ip = 192.168.21.45 user = b and on .. for in listofobs: print str( a['timestamp'] ), a['ip'], a['user'] will iterate on list of dict's, use them in template wrap in needed django syntax , quite similar regular python.

html - Placeholder text in an input field with CSS only (no JavaScript) -

instead of labeling each field in form, preferable (from design standpoint) have placeholder text in each field. example, instead of having this: ---------------------------------- full name: | | ---------------------------------- you have this: ---------------------------------- | full name | ---------------------------------- the when click in field, text disappears , can write whatever want. if skip on field without entering text, placeholder reappears. i've seen done many ways, methods involve javascript. example, twitter decent job on signup page if javascript disabled end typing name on word 'full name'. i'm looking css-only method work javascript disabled. potential solution i've come set background of <input> tag image of desired text , use input:focus pseudo-class clear background image when clicks on text box. seems work nice not have use images. does know of resource on how this? this preferred method, , works in current browsers: ...