Posts

php - Server-side script for checking database in the background -

i writing "forum-like" website our class, works faq, our class can post answers. want implement system, 1 student (class president) can upload these questions (question asked teachers, , become test-questions) , select user has answer question. now want write system reminds (email) user after amount of time question hasn't been answered, , should answer it. so, need check database every ~30 minutes , see if "answertime" has run out, , send user email. i don't think can achieve php-script unless there way run script in background. thought writing external program check database, don't using program, fail without me noticing it. so wanted ask, what's best way this? you can set cron job on server side run php script every x minutes linux. for windows can set scheduled task run script every x minutes

facebook - iPhone New Facebbok SDK . post to wall not coming -

my code running in simulator(evn after implementing new facebook sdk). but when checked in device, code running, but post wall not coming. please help. i had problem , solved it, if use using method: [nsurlconnection sendsynchronousrequest:request returningresponse:&response error:&err];" in fbgraph.m file. then before calling method declare following variables nil nsurlresponse *response = nil; nserror *err =nil;

AutoIT Testing Help -

hi trying n excel file on web save automatically using autoit. the following code not working: #include <ie.au3> $oie = _iecreate ("http://127.0.0.1/my_site") _ienavigate ($oie, "http://databases.about.com/library/samples/address.xls") winwait("file download","do want open or save file?") controlclick("file download","do want open or save file","button2") winwait("save as","save &in:") trying using ie not right way. have tried using inetget function? local $sfilename = filesavedialog("save excel file...", @mydocumentsdir, "excel spreadsheet (*.xls)|all files (*.*)", 18, "address.xls") if @error exit ; user cancelled dialog local $ibytes = inetget("http://databases.about.com/library/samples/address.xls", $sfilename, 8) msgbox(0, "worked :)", "file downloaded. " & $ibytes & " downloaded.") ...

parsing - Read Arabic lettering in html into csv using Perl -

i working html has arabic lettering in it. trying parse lettering csv file opens default in excel. i using perl script parse lettering out thought using use feature 'unicode_strings'; in perl allow csv store arabic lettering not. is there way round this? use autodie qw(:all); use web::query qw(wq); use text::csv_xs qw(); $csv = text::csv_xs->new({binary => 1}) or die "cannot use csv: ".text::csv_xs->error_diag; open $fh, '>:encoding(utf-8)', 'm.csv'; $csv->print($fh, [wq( '<!doctype html> <html><head><title></title></head><body>&#x645;&#x643;&#x629; &#x623;&#x648; &#x645;&#x643;&#x629; &#x627;&#x644;&#x645;&#x643;&#x631;&#x645;&#x629; &#x647;&#x64a; &#x645;&#x62f;&#x64a;&#x646;&#x629; &#x645;&#x642;&#x62f;&#x633;&#x629; &#x644;&#x62...

python - Why does put() not work when used with indexed element in Query? -

i have issue put() not appear work if access model class indexed member of query directly; however, when explicitly extract class query seems work fine. why this? this code works: class record: field = db.stringproperty() rs = record.all().filter('name = ', name_str) if rs.count() == 1: # assume 1 record in return... r = rs[0] r.field = some_value r.put() and code doesn't (and not raise errors) class record: field = db.stringproperty() rs = record.all().filter('name = ', name_str) if rs.count() == 1: # assume 1 record in return... rs[0].field = some_value rs[0].put() every time index query this, performs query on again, fetches relevant result, decodes it, , returns you. in second snippet, modify 1 instance of entity, discard it, fetch , store (unmodified) second copy. generally, should avoid indexing queries - call .get() or .fetch() instead. for same reason, should avoid using .count() possible, since req...

c++ - Cmake multi-library scenario -

we organize c++ project this: project/ lib1/ (first library) cmakelist.txt src/ lib1.c foo1.h build/ test/ (tests) cmakelist.txt test1.c test2.c lib2/ (second library) cmakelist.txt src/ cmakelist.txt os/ (os dependent code) cmakelist.txt win32/ xxx.c (win32 implementation) linux/ xxx.c (linux implementation) lib2.c foo2.h build/ include/ (shared/public headers) lib1/ lib.h (shared library header included apps) lib2/ lib.h (shared library header -"-) please, how write cmakelists.txt when lib2 should use link1 , when e.g. lib2 should portable (at least win32, linux...)? correction : if cmakelist.txt files not on places, pl...

c# - Correct way to initialize Enums inside a class constructor -

i looking @ enums in wrong way want make sure have right theory in how use them. say have enum called colour. enum colour { red, green, blue }; red green , blue represented there 0-255 values. i'm trying initialize enum inside class shape , i'm not sure how go it. public class shape { colour colour; public shape(colour c) { //some attempts @ initialization. //treating object this.colour = c{ 255,255,255 }; //again this.colour.red = c.red this.colour.blue = c.blue this.colour.green = c.green colour.red = c.red? } } } i'm way off in terms of how i'm thinking enums. can give me pointers? in case, might want colour struct instead of enum. in c#, enums single-valued constructs, have 3 values (red, green, , blue). here's might instead: public struct colour { private byte red; private byte green...