Posts

android intent has other flags -

i new android developing , looking @ code of guy worked here before. check connect server. works great (see d/connectivitychecker(29802): isonline=true). create new intent , set flag (public static int online_flag = 1) can see in intent.setflags 1. send intent via sendbroadcast connectionchangereceiver. and if read out intents flag not 1 17! this code of connectionchangereceiver: /** * receives notifications connectivity changes */ private broadcastreceiver connectionchangereceiver = new broadcastreceiver() { @override public void onreceive(context context, intent intent) { log.d("connectionchangereceiver","intent.flags(): '" + intent.getflags() + "' icm.online_flag: '" + internetconnectionmanager.online_flag+"'"); setonlinemode(intent.getflags() == icm.online_flag); } }; this logcat: 05-08 14:28:05.615: v/icm(29802): checkconnectivity 05-08 14:28:05.615: v/icm(29802): connectivityche...

Alter database design with JPA -

i working on database jpa , curios altering database design. lets have table , want add/remove column in table. i have tried re-deploying technique did not work me. using jpa 2.0 so, want know there standard way alter database tables or manually add/remove table's design? possible change primary key of table ? any highly appreciated. thanks :) for non-production dbs can use persistence.xml properties either create, drop-create or update existing db schema (example hibernate): <persistence ...> <persistence-unit ...> <property name="hibernate.hbm2ddl.auto" value="create-drop" /> for eclipselink, property name different , available options: <property name="eclipselink.ddl-generation" value="create-tables"/> <property name="eclipselink.ddl-generation.output-mode" value="database"/> for production dbs stick manual changes have careful details , timing.

xaml - LongListSelector in WP8 -

i trying create first wp8 application. have experience on silverlight & wpf not cake me expected :(. making create employ form in user entered different information of employ. need show country list combobox. noticed in wp8, have use longlistselector confused how display other textboxes etc control form. longlistselector work on full page want show combobox in simple window form application. know basic question appreciate help. you cant use combobox in wp8 ... you can use listpicker new control introduced in wp8 toolkit... in if list contains less 5 members show dropdown otherwise show list on different page.

Twitter Bootstrap - Button Width in Drop-down menu -

fairly new bootstrap-- have button , drop down menu composed of unordered list containing buttons. how make button widths same-- or off base code: here code: <div class="btn-group" style="margin-bottom: 5px"> <a class="btn btn-large dropdown-toggle" data-toggle="dropdown" href="#"> <i class="icon-wrench"> </i>admin actions <span class="caret"></span></a> <ul class="dropdown-menu"> <li> <button class="btn btn-large"> <i class="icon-plus"></i>create content</button> </li> <li> <button class="btn btn-large"> <i class="icon-wrench"></i>edit page</button></li> <li><button class="btn btn-large"> <i cla...

c# - What is the best practice to define consistently from access layer to listitems -

i quite new asp.net / webforms , might sound basic question, if defining client class in webforms asp.net hold clientid, clientname , type of client (proposed, fullclient, dead) not sure of best way make consistent access layer/database, hold type of 'p' - proposed f - fullclient , 'd' dead definition of client class through creating listitem setting client in html of possible choices requires option , description believe class uses enum? if point me simple great. thanks in advance. just use enum , can store things in shared project other projects have references too, yourproject.utilities. here's enum : public enum clienttype { [description("proposed")] proposed = 1, [description("dead")] dead = 2, [description("full client")] fullclient = 3 }

linux - Why doesn't this call to `poll` block correctly on a sysfs device attribute file? -

i have simple sysfs device attribute shows under sysfs directory, , on call read returns value of kernelspace variable. want call poll on attribute allow userspace thread block until value shown attribute changes. my problem poll doesn't seem block on attribute -- keeps returning pollpri though value shown attribute not change. in fact, have no calls @ sysfs_notify in kernel module, yet userspace call poll still not block. perhaps should checking return value of other pollpri -- according documentation in linux kernel, sysfs_poll should return pollerr|pollpri : /* ... when content changes (assuming * manager kobject supports notification), poll * return pollerr|pollpri ... */ is there i'm forgetting poll ? the device attribute located at: /sys/class/vilhelm/foo/blah . i load kernel module called foo registers device, , creates class , device attribute. the userspace application called bar spawns thread calls poll on device attribute, checkin...

java - Indenting TextView Text in android -

i have textview text let's say • asking question stackoverflow how can make textview show like • asking question stackoverflow string facil = accomodation.facilities; facil = facil.replace("<>", "%"); spanned sp = html.fromhtml(facil); facil = sp.tostring(); string[] items = facil.split("%"); charsequence allfacil = ""; (int = 0; < items.length; i++) { string text = items[i]; spannablestring s = new spannablestring("• " + text + "\n"); s.setspan(new bulletspan(bulletspan.standard_gap_width), 0, text.length(), 0); allfacil = textutils.concat(allfacil, s); } facilities.settext(allfacil.tostring()); i have done this... string[] items = new string[] { "item 1", "item 2", "item 3" }; charsequence alltext = ""; (int = 0; < items.length; i++) { string text = items[i]; spannablestring s = new spannablestr...