Posts

OSGI Bundle using Android API is showing "java.lang.RuntimeException: Stub! at android.util.Log.d" -

in eclipse plugin project, trying use android api. showing message on logcat. in addition adding android.jar class path, prepared android.jar bundle follwing this link. did following: 1- writing manifest.txt contains following: manifest-version: 1.0 created-by: myself bundle-manifestversion: 2 bundle-name: android bundle-description: package android in osgi bundle bundle-version: 4.4.0 bundle-classpath: .,android.jar bundle-symbolicname: android export-package: android.util 2- creating bundle jar file running following command: jar cvfm android-bundle.jar manifest.txt android.jar 3- have bundle android-bundle.jar , open in eclipse file-> new -> project...-> plug-in development -> "plug-in existing jar archives" next, create bundle use android api. below activator class has log message: package osgi_android_bundle; import org.osgi.framework.bundleactivator; import org.osgi.framework.bundlecontext; import android.util.log; public class a...

visual studio - XAML editor won't render the controls in my WPF window -

Image
as of visual c# 2012's xaml editor won't render controls. don't error messages or warnings , can still select controls. don't see them. here's looks in editor: the source code of xaml file can found here . oddly enough other xaml files displaying normally. @ runtime, controls in faulty xaml file render normally. can see in screenshot, error list empty. why isn't xaml file rendering in editor? removing opacity="0" window root tag makes controls show in visual studio. i tried switch opacity on in case if code running in designer this: public nfywindow() { initializecomponent(); if (system.componentmodel.designerproperties.getisindesignmode(this)) this.opacity = 1; } —but seems ignored visual studio 2010. however reverse trick helps: can remove opacity setting xaml , put constructor. worked me, visual studio version/sp may different. you may try cleaner way: public nfywindow() { initializecomponent(); ...

html - Changing one item from float to fixed positioning, CSS -

i designing basic website , wanting change how navigation bar on left hand side acts, want remain want have fixed positioning can scroll remaining there. my question is, there anyway of changing it's position fixed without moving around , messing work in getting else positioned correctly, link image of website , included html , css. as question, can tell me why website looks different when run html through different browsers, using google chrome. thought using px values got rid of problem. edit 2 here screenshots different browsers on 2 different screens. webpage designed google chrome on laptop has resolution of 1600x900. computer comparing has resolution of 1440x900. adjustments window cause problems, never aginwill zoom. link goes gallery 8 images. http://postimg.org/gallery/908tlytw/ html code <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso10646"/> <meta http-equi...

jquery - retrieve ajax posted values in servlet? -

var schedule = []; var data = { 'user_id' : '12', 'day_of_week' : 'monday', 'when' : 'start', 'modified' : 'true' } schedule.push(data); var data = { 'user_id' : '13', 'day_of_week' : 'tuesday', 'when' : 'end', 'modified' : 'false' } schedule.push(data); // schedule have 2 objects in i posting array servlet using jquery ajax post request below . data : {'mydata':schedule}, url :"./mycontroller", now how can array of objects , literate values? each array object has string, long , boolean type values. how can values iterating? one strategy use json pass kind of data , forth server , client. on client side, convert array of schedule json string using stringify function. send via ajax: e.g. var jsondata = json.stringify(schedule); your ajax object following: $.ajax({ url: ...

immutability - Make immutable Java object -

my goal make java object immutable. have class student . coded in following way achieve immutability: public final class student { private string name; private string age; public student(string name, string age) { this.name = name; this.age = age; } public string getname() { return name; } public string getage() { return age; } } my question is, best way achieve immutability student class? your class not immutable strictly speaking, immutable. make immutable, need use final : private final string name; private final string age; although difference might seem subtle, it can make significant difference in multi-threaded context . immutable class inherently thread-safe, immutable class thread safe if safely published.

java - How to avoid if/else when using multple suppliers? -

is there way avoid using if/else statements when data can queried multiple locations , should returned on first non null instance? i'm trying load preferences user 3 different locations (user preferences, group preferences , system preferences). example: preference getpreference(user user, preference.type type) { preference preference = getuserpreferencefor(user, type); if (preference != null) { return preference; } preference = getgrouppreferencefor(user, type); if (preference != null) { return preference; } return getsystempreferencefor(user, type); } i avoid using these if checks , chain these methods behavior remain same code wouldn't have ugly duplication. i have thought of few solutions non of these strike elegant one. example, 1 way to have each of these methods provide default scatter if statements. preference getpreference(user user, preference.type type) { preference preference = getuserpreferencefo...

java - iphone like voicemail listbox in android -

i'm looking iphone voicemail listview in android. possible have similar listvew.? in android have have view inflated in getview of customadapter class. in phone play button visible when users selects listview item. is possible in android if yes ideas/pointers.