Posts

How to create an Overflow menu and combine it with an option menu ? "android" -

hi guys new in android development want ask how can create overflow menu 2 items , how can combine option menu did looks this public class mainactivity extends activity { @override public boolean oncreateoptionsmenu(android.view.menu menu) { super.oncreateoptionsmenu(menu); menuinflater blabla = getmenuinflater(); blabla.inflate(r.menu.options_menu ,menu); return true; } @override public boolean onoptionsitemselected(menuitem item) { switch(item.getitemid()){ case r.id.oursponsors: intent = new intent("com.--.------.------"); startactivity(i); break; case r.id.exit: finish(); break; } return false; } xml <item android:title="our sponsors" android:id="@+id/oursponsors" android:icon="@drawable/image" /> <item android:title="exit" android:id="@+id/exit" android:icon="@dra...

wordpress - Javascript Inline and External Script difference -

i need help, porting internal scripts on website single js file speed website according google , yahoo page speed recommendations. i have following script in page footer.php (i using wordpress) <script> (function ($) { jquery(function () { var $container = $('#container'); $container.imagesloaded(function () { $container.masonry({ itemselector: '.box', columnwidth: 100 }); }); $container.infinitescroll({ navselector: '.post-nav', nextselector: '.previous a', itemselector: '.box', loading: { finishedmsg: 'no more pages load.', img: '/wp-content/themes/images/ajax-loader.gif' } }, function (newelements) { var $newelems = $(newelements).css({ opacity: 0 }); $newelems.imagesloaded(function () { $newelems.animate({ opacity: 1 ...

android - Why i can't connect to mysql database in java? -

i found code in tutorial isn't working when debug try connection , isn't throw exception go block without line of code under drivermanager.getconnection(). why? has idea? connection con = null; statement st = null; resultset rs = null; string url = "jdbc:mysql://host/databasename"; string user = "user"; string password = "pass"; try { class.forname("com.mysql.jdbc.driver"); } catch (classnotfoundexception e1) { // todo auto-generated catch block e1.printstacktrace(); } try { con = (connection) drivermanager.getconnection(url, user, password); st = (statement) con.createstatement(); rs = st.executequery("select * message"); if (rs.next()) { system.out.println(rs.getstring...

css3 - Centering issue when using flexbox where the content is larger than the container -

i'm trying center element (both horizontally , vertically) following conditions: element's display inline-block, since want width/height calculated depending on content. when container larger element everything fine . however, problem starts when element larger container, , the element gets width of container , not content . thanks in advance, oren just in case jsfiddle down, here's code snippets: <div class="working_area"> <div class="image_container"> <img src="http://eofdreams.com/data_images/dreams/bear/bear-05.jpg"/> </div> </div> and .working_area { background: yellow; position: absolute; width: 600px; height: 600px; display: -webkit-flex; -webkit-justify-content: center; -webkit-align-items: center; } .image_container { display: inline-block; /*shrink bit*/ -webkit-transform: scale(0.7); /*-webkit-transform-origin: center center;*/ } ...

Does SDK 2.0 work outside of Rally? -

i'm trying migrate rally app sdk version 1.32 version 2.0p. i know in order run app outside of rally in 1.32, prepend direct server url. however, in 2.0p documentation, seems show examples of running apps within custom html app in rally. can apps in sdk v2.0p run outside of rally? thanks. the current version 2.0rc1. supports running apps outside of rally full url : <script type="text/javascript" src="https://rally1.rallydev.com/apps/2.0rc1/sdk.js"></script>

cocos2d-x android compile ERROR -

i can run code in vc2012. need compile code android use linux system run ./build_native.sh . terminal turn out this staticlibrary : libchipmunk.a compile thumb : cpufeatures <= cpu-features.c staticlibrary : libcpufeatures.a sharedlibrary : libgame.so /mydata/data/java/adt-bundle-linux-x86_64-20130717/android-ndk-r8e/toolchains/arm-linux- androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux- androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/game_shared/__/__/classes/appdelegate.o: in function appdelegate::applicationdidfinishlaunching():jni/../../classes/appdelegate.cpp:29: error: undefined reference 'cpwscene::createscene()' collect2: ld returned 1 exit status make: *** [obj/local/armeabi/libgame.so] error 1 make: leaving directory `/mydata/workspace/c++/cocos2d-2.1rc0-x-2.1.3/workspace/classdesgin/proj.android' you have add cpwscene.cpp file android.mk file compiler can compile file. android.mk fil...

Accessing a Javascript prototype function -

i have prototype function such event. prototype func("input_element_id").event("keyup",function(){ alert("works on keyup in input!"); } func.prototype= { keyup: function(func){ //adding event listener , callback using func }, event: function(e,func) { //what here call function "keyup" } }; the prototype name in variable e . how can call function using variable name? i doing this, passing "keyup keydown" add keyup , keydown listeners, better calling each prototype function individually. thanks. var func = function(element){ this.element = element; }; func.prototype = { keyup: function(handler){ this.element.onkeyup = handler; }, event: function(e,handler){ switch(e){ case 'keyup': return this.keyup(handler); break; } } } http://jsfiddle.net/ydekw/