Posts

php - RSS Feed "Updating Too Often" -

this may or may not silly question know little of mysterious ways of rss feeds, can put me straight! i have website rss feed of news items. user has complained feed updating crazily frequently, without change in top 5 news items displayed. i'm ashamed don't use rss feeds personally, don't know implies 1 "updating often" - can see how annoying, if keep checking "updated feed" find no new content, or worse if receiving continual alerts of non-existent updates. say, don't have clear picture of how rss feed consumption works. the next question is, if way our site generating rss feed problem, can it? top news items aren't changing incredibly frequently. it's possible, not certain, automated scripts updating items in database related news items, though still, can't imagine how happening "crazily frequently". rss feeds, how work? re-generation of top news items count update everyone's rss readers, if top news items ...

java - starting a new activity in onCreate works only with delay -

i have simple activity shows 2 buttons, , load activity 1 finished loading. @override public void oncreate(bundle savedinstancestate) { dbg("starting on create"); super.oncreate(savedinstancestate); dbg("stting content view"); setcontentview(r.layout.main); createdrpopup(); } private void createdrpopup(){ dbg( "created new activity"); startactivityforresult(new intent(this, drpopup.class), dr_popup_activity_id); } i don't errors code, new activity doesn't load properly. way blanc screen. but if call new activity delay, works fine. @override public void oncreate(bundle savedinstancestate) { dbg("starting on create"); super.oncreate(savedinstancestate); dbg("stting content view"); setcontentview(r.layout.main); thread splashtread = new thread() { @override public void run() { try { sleep(500); ...

java - while(Matcher.find()) is looping infinitely -

i modified following code oracle's java tutorials : import java.util.regex.pattern; import java.util.regex.matcher; public class regextestharness { public static void main(string[] args){ while (true) { pattern pattern = pattern.compile("foo"); matcher matcher = pattern.matcher("foo foo foo"); boolean found = false; while (matcher.find()) { system.out.format("i found text \"%s\" starting @ " + "index %d , ending @ index %d.%n", matcher.group(), matcher.start(), matcher.end()); found = true; } if(!found){ system.out.format("no match found.%n"); } } } } i trying learn how use regular expressions in java. (i feel pretty confident regex's, not java's classes using them.) using eclipse, not incredibly familar with. not figure out how console not initialized null (as tutorial warned), removed , using static ...

c# - Get a successful Ajax action to open another popup -

right i'm trying have ajax window open window on completion. basically, first window asks if user wants , second tells them successful. first needs yes or no , second needs ok. how tell ajax actionlink open 1 when done? i'm working in mvc 3 c#. right actionlink is: @ajax.actionlink("reset user password", "resetuserpw", "admin", new { username = model.username }, new ajaxoptions { confirm = "reset password?", httpmethod = "httpget" }) this works fine (i know there no onsuccess bit, fact mentioned later). executes logic fine , resets user's password. can't figure out how open window. here's controller action: public actionresult resetuserpw(string username) { string newexcept; membershipuser user = membership.getuser(username); if (user != null) { try { string newpassword = membership.generatepassword(8, 2); if...

.net - Async Queue Processing With Reactive Extensions -

there couple of articles on this, , have working...but want know how set max number of task threads observable subscriptions @ once. i have following parallelize async saving of log entries: private blockingcollection<ilogentry> logentryqueue; and logentryqueue = new blockingcollection<ilogentry>(); logentryqueue.getconsumingenumerable().toobservable(scheduler.taskpool).subscribe(savelogentry); to schedule saving...but how specify max threads scheduler use @ once? this not function of observable, function of scheduler. observable defines what , scheduler defines where . you'd need pass in custom scheduler. simple way subclass taskscheduler , override "maximumconcurrencylevel" property. http://msdn.microsoft.com/en-us/library/system.threading.tasks.taskscheduler.maximumconcurrencylevel.aspx i found sample of on msdn: http://msdn.microsoft.com/en-us/library/ee789351.aspx edit: asked how go taskscheduler ischeduler. develope...

java - How to call a servlet from a batch program? -

i have situation have series of similar jsps, each of called servlet based upon option entered user. however, adjust these jsps can additionally called in batch program runs hourly on server, , write jsp output text file. can tell me how might done @ all? i thinking along lines of: url url = new java.net.url("http://127.0.0.1/myservlet"); urlconnection con = url.openconnection(); or there better way? ok: must doing foolish here because doesn't appear work: have batch program runs every hour , contains following code: try { url url = new java.net.url("http://127.0.0.1:8084//myapp//myservletmapping?par=parvalue"); urlconnection connection = url.openconnection(); connection.setrequestproperty("accept-charset", "utf-8"); connection.setdoinput(true); inputstream response = connection.getinputstream(); } catch (exception ex) { logger.error("error calling servlet in batch...

date - Java SimpleDateFormat parsing issue -

i'm trying parse date string got out of website in java using simpledateformat class, goes wrong , can't figure out why. the date strings come in following syntax: "13:37 - tue 28-jun-2011" so tried doing following: simpledateformat dateformat = new simpledateformat("hh:mm - eee dd-mmm-yyyy"); parseposition pos = new parseposition(0); date d = dateformat.parse("13:37 - tue 28-jun-2011", pos); as said before, doesn't work; when print system.out.println(pos.geterrorindex()); it prints "8", assume means error somewhere around eee part. i've tried different permutations nothing worked. doing wrong? thanks bompf if trying parse date work. dont know trying parseposition simpledateformat dateformat = new simpledateformat("hh:mm - eee dd-mmm-yyyy"); date d = dateformat.parse("13:37 - tue 28-jun-2011"); system.out.println(d);