Posts

c# - Download images using web browser control -

in web browser app windows phone 7, able see images, want download images web pages(using context menu) , save media library. web browser control named browsers . can me? in advance help? there errors in below codes- in "uri" , in "e" . private void menuitem_click(object sender, routedeventargs e) { httpwebrequest webrequest = httpwebrequest.createhttp(uri);>>>error in "uri" webrequest.begingetresponse((asynccallback) => { try { medialibrary library = new medialibrary(); library.savepicture(imagename, webrequest.endgetresponse(asynccallback).getresponsestream()); } catch (exception e)>>>>>error in "e" {} }, webrequest); } public string imagename { get; set; } tab , hold on image in browser control ... geta context menu saving image ?

Need answers to few javascript questions? -

https://stackoverflow.com/questions/1684917/what-questions-should-a-javascript-programmer-be-able-to-answer i need few answers questions posted here?. i'm iterating through array defined, has 3 elements in it.. numbers 1 2 , 3.. why on earth jack showing up? object.prototype.jack = {}; var = [1,2,3]; ( var number in ) { alert( number ) } why alert undefined when declared jack variable 'jack'? <script> (function() { var jack = 'jack'; })(); alert(typeof jack) </script> why object , not array? how detect if array? array = [1,2]; alert( typeof array ) i have 2 strings, second evaluation doesn't become true. potential bug? how come it's not true? alert( [typeof 'hi' === 'string', typeof new string('hi') === 'string' ] ) for first question, for-in construct in javascript intended iterate on object properties. since have added jack prototype of objects, appear. ...

named entity recognition - to tag NE on multiple files using Stanford NER -

i want use stanford ner tag name entity in multiple files. in documentation said can use option -testfiles list of test files separated commas not work in case like: java -cp stanford-ner.jar edu.stanford.nlp.ie.crf.crfclassifier -loadclassifier ner-model.ser.gz -testfiles test_file1.tsv,test_file2.tsv but works when input 1 file. does system have inline evaluation (for p, r) multiple files? wonder how works in case of multiple files. thanks in advance. khadaka

c# - Get all User-Created Classes in AppDomain.CurrentDomain -

i want loop on classes have added in project assembly[] foo = appdomain.currentdomain.getassemblies(); foreach(assembly in foo) { foreach(type t in a.gettypes()) { } } this tried want exclude assemblies provided .net, example "mscorlib" one common solution filter assemblies name, if of assemblies have common prefix (if have more or less unique prefix). var foo = appdomain.currentdomain.getassemblies() .where(a=>a.fullname.startswith("myproject.")); if interested in specific types, consider using attributes classes, or add 1 @ assembly level. example: create attribute: [attributeusage(attributetargets.assembly)] public class myassemblyattribute : attribute { } add following assemblyinfo.cs: [assembly: myassemblyattribute()] and filter assemblies looking at: var foo = appdomain.currentdomain .getassemblies() .where(a => a.getcu...

preg replace - PHP preg_replace regexp for dash -

i trying replace in string not letter, number, or dash "-". how modify line include dash? $link = preg_replace('/[^a-z0-9]/', "", strtolower($_post['link_name'])); do insert in there? $link = preg_replace('/[^a-z0-9-]/', "", strtolower($_post['link_name'])); you have escape - since it's special character regexes: $link = preg_replace('/[^a-z0-9\-]/', '', strtolower($_post['link_name']));

java - Caliper: why not use an annotation to define a benchmark? -

just found out caliper, , going through documentation - looks great tool (thanks kevin , gang @ google opensourcing it). question. why isn't there annotation-based mechanism define benchmarks common use cases? seems like: public class foo { // foo's actual code, followed by... @benchmark static int timefoobar(int reps) { foo foo = new foo(); (int = 0; < reps; ++i) foo.bar(); } } would save few lines of code , enhance readability. we decided use timefoo(int reps) rather @time foo(int reps) few reasons: we still have lot of junit 3.8 tests , consistency testfoo() scheme. no need import com.google.caliper.time we'll end reporting benchmark name time foo foo . easy, it's methodname.substring(4) . if used annotations we'd end more complicated machinery handle names @time timefoo(int reps) , @time benchmarkfoo(int reps) , @time foo(int reps) . that said, we're reconsidering caliper 1.0.

android - Is it possible to reuse an activity without destroying it? -

is possible reuse activity without destroying it? example, after press button, activity disappear , app returns previous activity. disappeared activity still in memory , can fast displayed without re-creating it. this reason why have such idea: use activity written others. found there memory leaks couldn't find them because have no source code. want find workaround. its possible if don't kill activity: open 1, 2, 3 activities 1 > 2 > 3 #2 // call startactivity 2, don't call finish() in 3 1 > 2 open #4 activity 1 > 2 > 4 #2 1 > 2 restore #3 activity // call startactivity 3 intent intent.setflags(intent.flag_activity_reorder_to_front); 1 > 2 > 3 here copy of activity 3 left it.