NSMutableArray initWithCapacity nuances

Matt Gallagher has written a pretty informative article on Cocoa’s collection classes, along with a couple of benchmarks (with & without initWithCapacity:, as well as cross class comparisons) http://cocoawithlove.com/2008/08/nsarray-or-nsset-nsdictionary-or.html His test (source available) for an NSMutableArray of length 1,000,000 took 0.582256sec without capacity and just 0.572139sec with capacity. Test | Time [NSMutableArray array] | 0.582256 … Read more

Calculating usage of localStorage space

You may be able to get an approximate idea by using the JSON methods to turn the whole localStorage object to a JSON string: JSON.stringify(localStorage).length I don’t know how byte-accurate it would be, especially with the few bytes of added markup if you’re using additional objects – but I figure it’s better than thinking you’re … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)