Posts

javascript - I'm making an rss reader and would like to display pictures from an article if there are any. How do I go about getting those pictures? -

i'm new web development , have started using jsonp , google's feed api rss articles using client side javascript. if must gather photos server that's alright doing on client side preferable. have absolutely no idea how relevant photo article. hope not bad having download web page's html , looking gif , png links. any helps appreciated! if i'm not mistaken images might returned in rss feed itself, , have run through feed looking images paste out. if don't include images in feed going have download page , links images.

java - read file, convert string to double, store in 2d array -

i need read list of numbers in file , store 2d array. have far. how go achieving goal? //this part of code public class rainfall { double[][] precip; public rainfall() { precip = new double [5][12]; } public void readfile(bufferedreader infile) throws ioexception { fileinputstream infile = new fileinputstream("numbers.dat"); bufferedreader br = new bufferedreader(new inputstreamreader(infile)); string[][] myarray = new string[5][12]; while (infile.readline() != null) { (int j = 0; j < 5; j++) { (int = 0; < 12; i++) { myarray[j][i] = infile.readline(); } } } infile.close(); } numbers.dat 60 lines of: 1.01 0.03 2.14 0.47 //is each number on new line? you're close, added few lines below. public class rainfall { double[][] precip; ...

iphone - Help me to automate the app store submission process -

please let me know, there api available automate app-store submission process? my requirement is, have app binary, app-store screens, app details in hand. possible submit app store programmatically of api without use of itunes connect? thanks help. there no apple supported api interacting itunesconnect. don't know if there third-party tools screen scraping interaction or not. one solution if need spam large amount of apps hire virtual assistant in india , have them enter of information manually.

php - PCRE regular expressions using named pattern subroutines -

i experimenting named subpattern/'subroutine' regex features in php's pcre , i'm hoping can explain following strange output: $re = "/ (?(define) (?<a> ) ) ^(?&a)$ /x"; var_dump(preg_match($re, 'a', $match)); // (int) 1 expected var_dump($match); // array( [0] => 'a' ) <-- why? i can't understand why named group "a" not in result (with contents "a"). changing preg_match preg_match_all puts "a" , "1" in match data both contain empty string. i idea of writing regular expressions way, can make them incredibly powerful whilst keeping them maintainable (see this answer example of this), if subpatterns not available in match data it's not use really. am missing here or should mourn have been , move on? it makes perfect sense these subpatterns not capture group - main purpose used more once, can't capture them all. in addition, if default capture subpat...

php - Problems trying to find the root category based on category id -

i trying figure out root level category_id of category based on it's parent_id. in function below $this->cat_arr array of categories , parent_id's. if parent_id set 0 assumed root node. wish loop through array until find parent_id of passed $cat_id . function getroot($cat_id) { foreach ($this->cat_arr $row) { if ($row->cat_id == $cat_id && $row->parent_id == 0) { return $row->cat_id; break; } else { $this->getroot($row->parent_id); } } } in application call function when know $cat_id not @ root level (because parent_id greater 0), when try run gets stuck in infinite loop. is logic flawed, or missing simple? try this: function getroot($cat_id) { foreach ($this->cat_arr $row) { if ($row->cat_id == $cat_id && $row->parent_id == 0) { return $row->cat_id; } } return $this->getroot($row->parent_id...

android - SharedPreferences for serialization? -

i'm rather new android development, , trying learn bit of hobby project. app has relatively small amount of state needs stored main activity in order app resume properly. moreover, since app syncs webapp, have json-based serialization logic included state might want save. use of sharedpreferences store relatively small (~ few kib) strings serialize objects? better use internal storage , write out text file? advice! shared prefs way save kind of data. don't know better using file in internal storage. (if lot of data, i'd consider using file on sdcard.)

sql server - How to send regular in-line SQL in entity framework -

now don't go getting huffy yet. specific situation. rather asking why ever want send in-line string sql through ef, let's try stay on topic of "how". do need old-fashioned route using regular old ado.net or ef provide me way execute straight sql select/nonquery? thanks in advance. have investigated entity sql ? entity framework q&a : string city = "london"; using (entities entities = new entities()) { objectquery<customers> query = entities.createquery<customers>( "select value c customers c c.address.city = @city", new objectparameter("city", city) ); foreach (customers c in query) console.writeline(c.companyname); } since entity sql lacks dml constructs, not possible issue insert, update, or delete commands using entity sql , object services