Posts

javascript - jQuery wrap multiple div elements on same class -

hello use jquery wrap sets of class elements in div can't find solution html: <div class="view-content"> <div class="first">content</div> <div class="first">content</div> <div class="second">content</div> <div class="third">content</div> <div class="third">content</div> </div> desired result: <div class="view-content"> <div class="column"> <div class="first">content</div> <div class="first">content</div> </div> <div class="column"> <div class="second">content</div> </div> <div class="column"> <div class="third">content</div> <div class="third">content</div> </div> ...

java - How to switch Off / Turn Off Android Tablet through coding? -

i having micromax fun book android version 4.0.3 , want turn off tablet through android code. actually want turn off tablet application exits. may need hardware permission. not sure it. you can reboot device using powermanager api. may need have reboot permission in manifest though. http://developer.android.com/reference/android/os/powermanager.html#reboot(java.lang.string ) http://developer.android.com/reference/android/manifest.permission.html#reboot

java - Can I ensure that one of my Spring ApplicationListeners gets executed last? -

i have several services listening spring events make changes underlying data model. these work implementing applicationlistener<foo> . once of foo listeners modify underlying data model, user interface needs refresh reflect changes (think firetabledatachanged() ). is there way ensure specific listener foo last? or there way call function when other listeners done? i'm using annotation based wiring , java config, if matters. all beans implementing applicationlistener should implement ordered , provide reasonable order value. lower value, sooner listener invoked: class firstlistener implements applicationlistener<foo>, ordered { public int getorder() { return 10; } //... } class secondlistener implements applicationlistener<foo>, ordered { public int getorder() { return 20; } //... } class lastlistener implements applicationlistener<foo>, ordered { public int getorder() { return low...

vb6 - VBScript: Assigning an array(2) via createobject -

i'm having problem converting vb6 code vbscript. i'm calling out com object create array emailaddresstype. here working vb6 code: 'assign to: addresses dim toadresses(2) new emailaddresstype toadresses(0).emailaddress = "someone@whocares.com" toadresses(0).routingtype = "smtp" toadresses(1).emailaddress = "someoneelse@whocares.com" toadresses(1).routingtype = "smtp" email.torecipients = toadresses i can't seem figure out how convert vbscript. i've tried following type mismatch error once email.torecipients = toadresses 'assign to: addresses dim toadresses(2) set toadresses(0) = createobject("ews.ewswebsvc.emailaddresstype") set toadresses(1) = createobject("ews.ewswebsvc.emailaddresstype") toadresses(0).emailaddress = "someone@whocares.com" toadresses(0).routingtype = "smtp" toadresses(1).emailaddress = "someoneelse@whocares.com" toadres...

Exit python properly -

i knew sys.exit() raises exit exception, when run knew wouldn't exit: in [25]: try: ....: sys.exit() ....: except: ....: print "oops" ....: oops but thought os._exit() meant exit using c call, it's causing exception: in [28]: try: ....: os._exit() ....: except: ....: print "oops" ....: oops is there way of doing without killing pid? don't use except without exception class, sys.exit work fine without triggering exception handling: >>> import sys >>> try: ... sys.exit() ... except exception: ... print 'oops' ... $ there other exceptions triggered plain except clause (and in general shouldn't), keyboardinterrupt .

javascript - Move div element from one parent div to another -

so let's assume have set of nested divs: <div id="likelytobecalled"> <div id="likelyoddheader" class="row"> <div id="likelyodda" class="left" name="test1">test1</div> <div id="likelyoddb" class="middle"><img src="image002.png"/></div> <div id="timezone" class="right">west</div> </div> and further down page: <div id="unlikelytobecalled"> <div id="likelyoddheader" class="row"> <div id="likelyodda" class="left">test2</div> <div id="likelyoddb" class="middle"><img src="image002.png"/></div> <div id="timezone" class="right">west</div> </div> how move test1 "unlikelytobecalled"....

oauth - Getting user information when using OAuth2 - is the following reasonable? -

i creating api (restlet, gae) , implemented openid authentication , oauth2 protect access api. when testing client web app built, fine. when user hits part of web app wants access api, user asked login via openid , asked grant access web app grab resources api. however, noticed web app doesn't know user (!). web app has auth token. thus, web app can't "hello, username", since doesn't know user is. with restlet technology, authentication essentially: // authentication code openidverifier verifier = new openidverifier(openidverifier.provider_yahoo); verifier.addrequiredattribute(attributeexchange.email); authenticator au = new myredirectauthenticator(getcontext(), verifier, null); while following handles both authentication , oauth2 authorization: // authentication + oauth code: oauthparameters params = new oauthparameters("2345678901", "secret2", "http://localhost:8888/v3/", roles); oauthpro...