Posts

NSTimer IOS setting text of layer but text disappears once timer is destroyed -

NSTimer IOS setting text of layer but text disappears once timer is destroyed - i'm using nstimer write text catextlayer text displays split second. i set first timer this: -(void) startsentanceanimation{ float firsttime = [[sentancearray objectatindex:0][@"time"]floatvalue]; [nstimer scheduledtimerwithtimeinterval:firsttime target:self selector:@selector(timedsentances:) userinfo:sentancearray repeats:no]; } it calls method changes text , creates new timer. -(void)timedsentances:(nstimer *)timer{ nsarray *userinfo = timer.userinfo; timer = nil; nsstring *sentance = [userinfo objectatindex:sentancecount][@"sentance"]; [self nextline:sentance]; //textlayer.string = sentance; float intervallength = [[userinfo objectatindex:sentancecount][@"time"]floatvalue]; [nstimer scheduledtimerwithtimeinterval:intervallength target:self selector:@selector(timedsentances:) userinfo:userinfo repeats:no]; sen...

php - How to get the right max id and min id from a function? -

php - How to get the right max id and min id from a function? - i had big table 3 1000000 rows before, split 6 tables 500.000 rows each, i'm trying connect them, want read 1 table 1 not 6 tables @ same time, i'm trying utilize website pagination select table needs read , max id , min id. i made function: $content['data']['max_table'] = 6; $content['data']['min_table'] = 1; $content['data']['limit_page'] = 100; function tables( $start_num, $end_num ) { global $content; if($end_num <= 500000) { $table_number = $content['data']['max_table']; } else if($end_num > 500000) { $calc = intval($end_num/500000); $table_number = $content['data']['max_table']-$calc; } $array = array(); $array['table_number'] = $table_number; $array['max_id'] = ($table_number*500000)-$end_num; $array['...

ios - Xcode wont play sound in this folder? -

ios - Xcode wont play sound in this folder? - hi simple app play sound when button pressed. imported frameworks , folder whole host of sounds, when set path wont play sound , nse exception error when click on button play sound. took sound file out of folder though folder in project , magically plays? ideas? or code must add together in order play folder? #import <avfoundation/avaudioplayer.h> #import "viewcontroller.h" @interface viewcontroller () @end @implementation viewcontroller avaudioplayer *theaudio; - (ibaction)yes:(id)sender { nsurl *url = [nsurl fileurlwithpath:[[nsbundle mainbundle] pathforresource:@"yes" oftype:@"mp3"]]; theaudio = [[avaudioplayer alloc] initwithcontentsofurl:url error:null]; [theaudio play]; } @end this chance larn both exceptions , bundles/files: first, exceptions: nsexception root class of exceptions, , not useful way describe h...

sbt - How to execute task that calls clean on subprojects without using aggregation? -

sbt - How to execute task that calls clean on subprojects without using aggregation? - i want create take cleanall executes clean task on number of subprojects. don't want utilize aggregation sake of clean . we've run issues play's asset routes when we've been using submodules. it's documented how create new task, how phone call task on subproject? based on illustration jacek laskowski i've come next plugin should placed in /project folder: import sbt._ import sbt.autoplugin import sbt.keys._ import sbt.plugins.jvmplugin object cleanallplugin extends autoplugin { val cleanall = taskkey[unit]("cleans projects in build, regardless of dependencies") override def requires = jvmplugin override def projectsettings = seq( cleanalltask ) def cleanalltask = cleanall := def.taskdyn { val allprojects = scopefilter(inanyproject) clean.all(allprojects) }.value } the plugin can added root project usage: v...

c# - Entity Framework, Stored Procedures and everything -

c# - Entity Framework, Stored Procedures and everything - so, promised see if help friend little asp mvc application. i've started regret though since haven't touched entity framework many years. have mssql database users can post , list own info (only). don't want have individual db users, users logon using oauth external providers, working good. need prepare crus , match useridentity own posts. our discussions there's 3 paths ahead. handling crud in webapp-code, lot of examples , seem work nice. friend kind of db-centric though , open database list info using crystal or excel scares him. handling in views, kind of little webapp guess result in slow joins if there lot of posts in end. handling crud stored procedures, old style i haven't used entity framework since brand new i'm not aware of it's features today. advice or resources on why take 1 on other welcome best regards! c# asp.net entity-framework

c++ - what is the proper method of using resource files in MFC project? -

c++ - what is the proper method of using resource files in MFC project? - i have made mfc-based game , project includes images , sounds. want create installer setup in order distribute it. i have used resources providing exact path in e.g img->load(l"c:\\users\\ad33l's\\desktop\\block mania\\block mania\\res\\db.png"); mciwndcreate(null, null,ws_popup|mciwndf_noplaybar|mciwndf_nomenu,l"c:\\users\\ad33l's\\desktop\\block mania\\block mania\\res\\tick.wav"); 1.can tell me way avoid hard-coding actual resource path these resource files not nowadays @ same exact path in other computers ? 2.also guide me handle these resource files during creation of standalone setup (i using advance installer ) (as actual answer). do not utilize absolute path, utilize relative path; relative exe file 1 solution. the exe path can found using getmodulefilename. char apppath[maxfilenamelen]; getmodulefilename(null, apppath, maxfilenamelen); ...

one mysql query getting, per each row, the average of the previous three rows -

one mysql query getting, per each row, the average of the previous three rows - i have this: id | value --------------- 201311 | 10 201312 | 15 201401 | 20 201402 | 5 201403 | 17 and need result this: 201311 | null or 0 201312 | 3.3 // 10/3 201401 | 8.3 // (15+10)/3 201402 | 15 // (20+15+10)/3 201403 | 13.3 // (5+20+15)/3 so far, got point can avg of lastly 3 previous rows this: select avg(c.value) (select b.value table b b.id < 201401 order b.id desc limit 3) c passing id manually. i'm not able each id. any ideas much appreciated! thanks lot. regards i think you'll have write stored procedure, utilize cursor, iterate through table , populate new table using values calculated in cursor loop. if need help writing out cursor loop, drop comment , can example. mysql