Posts

c++ - How to distinguish between movie and image -

is there "good" way distinguish between movie file , image file? know "std::wstring filepath" - movie, or image. therefore, go further strong assurance working known file type. in other words, have 2 classes myimage , mymovie both need path file in constructors. verify path file somehow before creating 1 of classes. bool ismovie(const std::wstring & filepath); bool isimage(const std::wstring & filepath); of course thought file extensions, i'm not sure , not prone errors solution. use file extension or other feasible solution possible.? thanks in advance you can use libmagic detect kind of file is. pass file path in , it'll give textual description or mime type file.

c# - WCF Service: MaxReceivedMessageSize (async) -

i ran exception because message size and/or array-length of data i'm transmitting wcf server client exceeds maximum size. topic occurs quite often, solutions changing maxreceivedmessagesize of service binding. var binding = new wshttpbinding { maxreceivedmessagesize = int.maxvalue }; binding.readerquotas.maxarraylength = int.maxvalue; host.addserviceendpoint(typeof(ieditor), binding, uri); but i’m interested how can resolved in different way. consider following method. might result in large byte array. tried converting image base64string. [servicecontract] public interface ieditor { [operationcontract] byte[] getimage(); } is there common pattern use beginread/endread streaming byte array in smaller chunks client? how in code? according microsoft (see this link ) contract has adjusted , end-point configuration well. <system.servicemodel> … <bindings> <basichttpbinding> <binding name="exampl...

swing - ComboBox, Automatic filling. Java -

i have shopping cart records how many orders have been made using : int ordernumber , just ++ when ever new order made, want add edit function click on edit button , open new frame select order want edit via combobox, problem need combobox fill 1,2,3 etc... depending on how many orders made. had go @ achieving method below errors. ordernumberslist = new string[ordernumber]; (int = 1; <= ordernumber; i++) { ordernumberslist[i] = "" + i; } jcombobox ordernumberbox = new jcombobox(ordernumberslist); arrays 0 based. replace for (int = 1; <= ordernumber; i++) { ordernumberslist[i] = "" + i; } with for (int = 0; < ordernumber; i++) { ordernumberslist[i] = integer.tostring(i + 1); } notice assigned value i adjusted

iphone - Insert Special character in sqlite -

i try code. query = [nsstring stringwithformat:@"insert bookmark(names,details) values('%@','%@')", delegate.str, delegate.str1]; nslog(@"%@",query); sqlite3_stmt *compiledstatement; if (sqlite3_open([databasepath utf8string],&database) == sqlite_ok) { if(sqlite3_prepare_v2(database,[query utf8string], -1, &compiledstatement, null) == sqlite_ok) { if(sqlite_done != sqlite3_step(compiledstatement)) nslog( @"error while inserting data: '%s'", sqlite3_errmsg(database)); else nslog(@"new data inserted"); sqlite3_reset(compiledstatement); }else { nslog( @"error while inserting '%s'", sqlite3_errmsg(database)); } sqlite3_finalize(compiledstatement); } this want store sqlite insert bookmark(details) values('let's take example, 23...

XML AND RSS Feed issues -

Image
ie states cant display feed while gc displays - refer image attached what lacking in displaying feed?(i using localhost) i told cant use localhost, ideas on how make rss feed function? you appear have prefixed rss feed html document. don't that. do validate markup.

c# - Can we apply lock to window phone from app -

i developing app in window phone 8, , need functionality of lockscreen in it. so question: is there way set lock screen through app without pressing power button of phone? unfortunately, there no way lock screen via code in windows phone 7.x or 8.

Nullpointerexception in displaying image from json url Android -

so here's code i'm working on: public class mainactivity extends listactivity { // url make request private static string url = "http://alyssayango.x10.mx/"; private static final string tag_type = "movie_type"; private static final string tag_name = "movie_name"; private static final string tag_length = "movie_length"; private static final string tag_schedules = "movie_schedules"; private static final string tag_cinema = "movie_cinema_number"; private static final string tag_url = "movie_image_url"; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); mytask task = new mytask(mainactivity.this); task.execute(url); } public string readmovieschedules(string url) { stringbuilder builder = new stringbuilder(); httpclient client = new defaulthttpclient(); httpget httpget = new httpget(url...