Posts

windows 7 - php mysqldump and zip 7z -

i have line of php backing databases, work's charm (windows 7): $exec_str = "{$real_path}bin\mysqldump -h {$mysql_db_host} -u {$mysql_db_user} -p{$mysql_db_pasw} {$db_name} > {$backupdir}\\{$db_name}.sql"; but rather prefer have .sql files compressed 7zip (as 7z) this 1 not work (path 7za.exe correct) instead generates empty 7z files: $exec_str = "{$real_path}bin\mysqldump -h {$mysql_db_host} -u {$mysql_db_user} -p{$mysql_db_pasw} {$db_name} | {$real_path}7za > {$backupdir}\\{$db_name}.sql.7z"; what doing wrong? i used 7z compress output mysqldump (windows server 2008 r2), used command line batch files , automated tasks instead. also, used 7z.exe, not 7za. note following commands executed windows command terminal, i.e start->run-> cmd i created batch file automated task run contents: mysqldump -u<mysqlusername> -p<mysqlpassword> <schemaname>|7z.exe -si<nameinzip> <zippedpathandname.7z> thi...

input - iOS - dispatcherTimer blocking touches events? -

i using dispatcher source timer update view @ different frame rates. (8, 12 or 24 fps) here code initializes dispatchertimer , function used create timer. (this function directly taken apple doc in subsection "creating timer": http://developer.apple.com/library/mac/#documentation/general/conceptual/concurrencyprogrammingguide/gcdworkqueues/gcdworkqueues.html ) call: self.dispatchtimer = [self createdispatchtimerwithinterval:self.project.frameduration * nsec_per_sec leeway:0.0 * nsec_per_sec queue:dispatch_get_main_queue() block:displayframe]; function: - (dispatch_source_t)createdispatchtimerwithinterval:(uint64_t)interval leeway:(uint64_t)leeway queue:(dispatch_queue_t)queue block:(dispatch_block_t)block { dispatch_source_t timer = dispatch_source_create(dispatch_source_type_timer, ...

Can I get the C++ preprocessor to send output during compilation? -

i have been debugging particularly insidious bug believe caused unexpected changes stem different behavior when different headers included (or not). this not structure of code let's take @ scenario: #include "newly_created_header_which_accidentally_undefines_some_define.h" // ... #ifdef some_define code_which_i_believe_i_am_always_running(); #else code_which_fails_which_i_have_forgotten_about(); // runtime error stack traces here, don't know this... or maybe it's strange linker error #endif i search through git commits , narrow down cause of bug, compiling , running code countless times, find after several hours difference required causing bug inclusion of appears benign , unrelated header. perhaps great argument why preprocessor sucks. but it. preprocessor cool because lets make shortcuts. it's of these shortcuts, when not used carefully, bite in butt pretty hard. so @ juncture have helped if use directive #echo "running old cr...

objective c - object mapping using introspection restkit -

i'm trying parse soap response using restkit. i'm able convert soap xml response objects if define mappings , relationships myself. but, wondering if it's possible use introspection (or else) automatically convert soap xml response objective-c object. sample xml: <return> <userid xsi:type="xsd:int">1113050187</userid> <location xsi:type="ns1:location"> <city xsi:type="xsd:string">san francisco</city> <state xsi:type="xsd:string">california</state> </location> </return> i convert xml object: @interface return : nsobject @property (strong, nonatomic) nsinteger userid; // attribute @property (strong, nonatomic) location *location; // relation @end the closest thing come using introspection on return class properties , using each attribute: [mapping addattributemapping:[rkobjectattributemapping mappingfromkeypath:@"userid.text...

iphone - Adding objects in Core Data -

i trying familiar core data , had xcode create subclasses of nsmanagedobject me. 1 addressannotation has information location street, zip, address, etc. other is: map : nsmanagedobject @property (nonatomic, retain) nsstring * name; @property (nonatomic, retain) nsset *locations; - (void)addlocationsobject:(addressannotation *)value; - (void)removelocationsobject:(addressannotation *)value; - (void)addlocations:(nsset *)values; - (void)removelocations:(nsset *)values; when want add location map, do: - (void)insertlocationintomap:(map *)map { [map addlocationsobject:self.address]; i nslogged map object , address object , both have values in it. when try adding object existing map object, not seem added. output of map logged is: <map: 0x7087480> (entity: map; id: 0x7084ff0 <x-coredata://8d6d7849-e7ec-48a3-ba95-c082d09e5d6d/map/p1> ; data: { locations = "<relationship fault: 0x768e4e0 'locations'>"; name = asdf; }) if cr...

c# - Dynamic data for JQuery in ASP.NET pages -

problem i have pages need dynamic data website generate output users. a simple solution aspx(php, ...) page generate data , create html page serving gui retrieving data first page , showing users. in method can call gui page example form1.aspx , data page form1.json.aspx. although method, not suitable when creating components it. another method i'm using using same gui page call querystring retrieve data. page should check query string , if exists, generate data , remove else page. example method if call page form1.aspx, retrieve data, need call form1.aspx?json here example of i'm doing: protected void page_load(object sender, eventargs e) { if (request.querystring.tostring().indexof("json") == 0){ this.controls.clear(); response.clear(); // send pure data client } else { // render page gui } } however method becomes messy if add master page and/or inherit page template page. master pages can removed in page_p...

PHP: Evaluating variable in string, and then changing value of variable -

i have string such following: $s1 = "apples"; $s2 = "$s1 great"; echo $s2; my understanding of php double-quotes in second line cause $s1 evaluated within string, , output be apples great however, if wanted keep $s2 "template" change $s1's value , re-evaluate new string? possible? example: $s1 = "apples"; $s2 = "$s1 great"; echo $s2 . "\n"; $s1 = "bananas"; $s3 = "$s2"; echo $s3 . "\n"; i find output following is: apples great apples great what hoping more like: apples great bananas great is such thing possible php can keep "template" string same, change input variables, , reevaluate new string? or not possible php? well, this: (just quick mashup). $template = "{key} great"; $s1 = "apples"; $s2 = "bananas"; echo str_replace('{key}',$s1,$template) . "\n"; echo str_replace('{key}',$s2,$tem...