Posts

java - Android application launching from console -

is possible make console android app using android api? application must hidden in package manager. can give me examples? in c++/java. do mean want console in android can type in java commands? if so, no answer. android not have option use reflection. , reflection needed create virtual machine can execute commands.

ios - A big tableview from SQL with filter - what's the most efficient way? -

i've been trying sqlite tableviews, iam struggling find way work data - , don't seem find references online either. have database of postal codes (4582 rows) , need join other tables make proper use of it. iam not sure how properly, creating objects of rows take ages on device, , application becomes slow , unresponsive. at first thought instantiate 50-100 objects , load more scroll, backfire when try filter down list, or perhaps not? user able search row , text in table, not postal codes. any ideas, tips or examples on go here? use fmdatabse. use following link this http://www.icodeblog.com/2011/11/04/simple-sqlite-database-interaction-using-fmdb/ http://www.highoncoding.com/articles/836_persisting_ios_application_data_in_sqlite_database_using_fmdb.aspx

dynamic - Casting a C# DynamicObject to an arbitrary type -

i trying write nice consumer api convention-based config binder in c#. configmanager.getsection(...) returns object, want return dynamic object, when cast required type invokes mapper. is there way in c#4+ create dynamic class can handle invocation upon having explicit cast applied it? e.g. myconfig config = (myconfig)configurationmanager.getsection("some/section"); in case, dynamic object configurationmanager invoked cast perform config magic (i have solved bit) yes, dynamicobject has override-able tryconvert . when dynamicobject subclass cast (or implicitly converted assignment) tryconvert invoked, , can dynamic details invocation binder parameter before returning result. the binder.type property provides type object must converted. example, statement (string)sampleobject in c# (ctype(sampleobject, type) in visual basic), sampleobject instance of class derived dynamicobject class, binder.type returns string type. binder.explicit prope...

objective c - Subclassing UIView with IBOutlets -

i've been trying long time add iboutlets uiview. well, seems impossible. created class called "recesscell". file's owner's class "recesscell" , view object's class recesscell. created outlet called "betweenperiods" , seems work. then, tried show custom view in uiscrollview inside uitableviewcell: - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { recesscell *cell = [tableview dequeuereusablecellwithidentifier:@"recess"]; if(cell == nil) cell = (recesscell *)[[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:@"recess"]; uiscrollview *scrollview = [[uiscrollview alloc] initwithframe:cgrectmake(0, 1, 320, 50)]; scrollview.showshorizontalscrollindicator = no; scrollview.bounces = no; scrollview.pagingenabled = yes; scrollview.contentsize = cgsizemake(640, 50); [scrollview addsubview:[[[nsbundle mainbu...

What is .Net Unicode Encoding's equivalent in Objective-C? -

what equivalent in objective-c of .net's system.text.encoding.unicode ? have tried: nsunicodestringencoding nsutf8stringencoding nsutf16stringencoding none of above converted text correctly. according http://msdn.microsoft.com/de-de/library/system.text.encoding.unicode.aspx , system.text.encoding.unicode little-endian utf-16 encoding. equivalent nsstring encoding nsutf16littleendianstringencoding . nsutf16stringencoding almost same, prepends unicode byte-order marker (bom) ff fe data. (and strictly speaking, not documented nsutf16stringencoding uses little-endian, explicit nsutf16littleendianstringencoding should used anyway.)

c# - json.net deserialize string to class -

i created json file on server im using send data c# program through json.net deserialize. im im getting null object exception, can please show me how create classes. class here using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; using newtonsoft.json; namespace windowsformsapplication4 { public partial class form1 : form { public form1() { initializecomponent(); load(); } public void load() { label1.text = "state:\nloading..."; try { products pd = new products(); using (var webclient = new system.net.webclient()) { // download json url var json = webclient.downloadstring(url); // parse json.net products convert = jsonconvert.deserializeobject<products>(json) products; ...

Difference: Mongoose populate and Embedded document -

what ideal situation use mongoose populate , embedded document, why choose 1 on other? advantages , disadvantages. thanks! the answer depends! depends on use case , way system is. there couple of resources give insight on that. here 1 stackoverflow answer: mongodb relationships: embed or reference? there complete book, containing several use cases , discussing on same topic. may find read: http://www.amazon.com/mongodb-applied-design-patterns-copeland/dp/1449340040/ it contains several use cases of social networking site, cms, ecommerce, online gaming etc.