Posts

css - Animated cube-like (only two faces) effect with CSS3 -

i reproduce jsfiddle prepared based on this awesome tutorial (please check the demo ). don't want keys functionality, on hover. http://jsfiddle.net/b5rmw/5/ but uses 2 faces (front , back). i tried, this: #cube { position: relative; margin: 100px auto 0; height: 300px; width: 300px; -webkit-transition: -webkit-transform .5s linear; -webkit-transform-style: preserve-3d; -moz-transition: -moz-transform .5s linear; -moz-transform-style: preserve-3d; } .face { position: absolute; height: 300px; width: 300px; padding: 0px; background-color: rgba(50, 50, 50, 1); font-size: 27px; line-height: 1em; color: #fff; border: 1px solid #555; border-radius: 3px; } #cube .one { -webkit-transform: rotatex(90deg) translatez(150px); -moz-transform: rotatex(90deg) translatez(150px); background:red; } #cube .two { -webkit-transf...

java - Android Manifest- intent filter and activity -

could explain following lines in manifest - <activity android:name=".aboutus" android:label="@string/app_name"> <intent-filter > <action android:name="com.example.app1.about" /> <category android:name="android.intent.category.default"/> </intent-filter> </activity> how fields in activity , intent filter important , when used/referred ? sorry, tried read documentation still couldnt figure out. thank you android:name=".aboutus" this name of activity class, dot @ front shorthand notation package. stands com.your.package.name.aboutus means java file represents activity called aboutus.java android:label="@string/app_name" label string gets shown in launcher(if activity listed in launcher) , @ top of window when activity open. <intent-filter > ... </intent-filter> intent filter defines in...

android - How to ensure all events have been fired before moving forwarded -

how ensure ontouch, onclick, etc listeners have been fired in ui thread before moving forward test code? in other words, have spinner on have registered both ontouchlistener , onitemselectedlistener. want ensure both these functions called activity before move on testing. there way can achieved in roboelectric?

asp.net mvc - how to set default value HTML.TextBoxFor() -

i have view consisting of form , textboxes. how can set default value in each box strings , int values? i want page load each box's value don't need type values. i'm not able change in model. @model mydb.production.productionmaterial @{ viewbag.title = "creatematerial"; } @using (html.beginform()) { @html.validationsummary(true) <fieldset> <legend>productionordermaterial</legend> <div class="editor-label"> @html.labelfor(model => model.position) </div> <div class="editor-field"> //something @html.textboxfor(model => model.position, or 5 ) @html.validationmessagefor(model => model.position) </div> <div class="editor-label"> @html.labelfor(model => model.articleid) </div> <div class="editor-field"> //something @html.textboxfor(mo...

Android java JSON parsing 'null' as output -

we have been using this code in our application fetch data online database, whatever tried, keeps saying "null" output album , duration. small detail, since beginning developers, don't know lot json. has got suggestions? package com.example.androidhive; import java.util.arraylist; import java.util.list; import org.apache.http.namevaluepair; import org.apache.http.message.basicnamevaluepair; import org.json.jsonarray; import org.json.jsonexception; import org.json.jsonobject; import android.app.activity; import android.app.progressdialog; import android.content.intent; import android.os.asynctask; import android.os.bundle; import android.text.html; import android.util.log; import android.widget.textview; import com.example.androidhive.helper.alertdialogmanager; import com.example.androidhive.helper.connectiondetector; import com.example.androidhive.helper.jsonparser; public class singletrackactivity extends activity { // connection detector connectionde...

python - Possible to use caret and lookahead in set? -

i've read docs , looked on other questions haven't found answer. is possible use lookahead within set, or have lookahead complement within set? i want create set matches every character except dash preceded space. however, if there space not followed dash should match. i thinking work, has not: r'[^\s(?=\-)]' do lookaheads not work inside of set? if not, how go solving problem? edited provide examples: i have been trying find more accurate alternative to r'([^\-]*)\-(.*)' which intended read line , separate artists titles. applying re.match(r'([^\-]*)\-(.*)', "artist - title") should yield: group(1) = "artist" group(2) = "title" however if artist name includes dash wrong parts of string captured. example: re.match(r'([^\-]*)\-(.*)', "jay-z - title") would yield: group(1) = "jay" group(2) = "z - title" i want capture group capture spaces , dashes, no...

html - GET request to same page- jQuery form -

i building small search engine, using form like form action="" method="get" id="searchform"> <input type="search" name="search" id="searchquery" value="<?php echo $_get['search']; ?>" /> </form> i passing search query same page. want prevent submitting form if text box value null. so, added event handler form $('#searchform').submit(function() { alert('handler .submit() called.'); if($('#searchquery').val()==null) { return false; } }); but doesnt seem work, when try using form action ="#" works fine. can suggest workaround? instead of checking against null, trim value , check against empty string. $('#searchform').submit(function(event) { if($('#searchquery').val().trim()=="") { return false; } }); note: using trim() ensures form doesn't submit if whitespace in input text box.