<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Random ranting about tech and media and stuff</description><title>Tony Million's Stuff</title><generator>Tumblr (3.0; @tonymillion)</generator><link>http://www.tonymillion.com/</link><item><title>If we can do this with Lemons then we can make Cave...</title><description>&lt;iframe width="400" height="299" src="http://www.youtube.com/embed/vZp_q_7IExA?wmode=transparent&amp;autohide=1&amp;egm=0&amp;hd=1&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;showinfo=0&amp;showsearch=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;If we can do this with Lemons then we can make Cave Johnson’s dream a reality!&lt;/p&gt;</description><link>http://www.tonymillion.com/post/23786314955</link><guid>http://www.tonymillion.com/post/23786314955</guid><pubDate>Sat, 26 May 2012 09:08:57 +0100</pubDate></item><item><title>Why Instagram is so fast and has a million naughty photos</title><description>&lt;p&gt;Remember that post that did the rounds a month ago or whatever that detailed the instagram photo upload process? If not, &lt;a href="https://speakerdeck.com/u/mikeyk/p/secrets-to-lightning-fast-mobile-design?slide=82" target="_blank"&gt;heres the slide&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For some reason it suddenly occurred to me this morning, since the upload starts before the user has actually hit the save button, I wonder how many people have taken photos of their genitals, or a lewd act, then just seen what the Instagram filters make it look like?&lt;/p&gt;
&lt;p&gt;With the way they opportunistically upload the photo before you&amp;#8217;ve pressed save, they may well have received your dirty picture before you hit the cancel button!&lt;/p&gt;</description><link>http://www.tonymillion.com/post/23783834876</link><guid>http://www.tonymillion.com/post/23783834876</guid><pubDate>Sat, 26 May 2012 07:33:12 +0100</pubDate></item><item><title>Grabbing a Random Document in Mongo</title><description>&lt;p&gt;Recently with ZummZumm I had a requirement to grab a random document from a collection, A bit of googling ended up &lt;a href="https://jira.mongodb.org/browse/SERVER-533" target="_blank"&gt;here&lt;/a&gt;, the &lt;a href="https://jira.mongodb.org/browse/SERVER-533" target="_blank"&gt;jira for mongodb&lt;/a&gt; which is essentially marked &amp;#8217; will not do &amp;#8216;.&lt;/p&gt;
&lt;p&gt;A bit more googling resulted in people suggesting something like:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;db.collection.all()-&amp;gt;skip((rand()/RANDMAX)*documentcount)-&amp;gt;limit(1)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;which is horribly inefficient. It basically makes mongo load all the indexes of all the documents iterate over them to skip to the relevant document and return that, problem is it takes linear time to skip all those documents till it hits the index you want.&lt;/p&gt;

&lt;p&gt;Buried in the comments is a link to &lt;a href="http://cookbook.mongodb.org/patterns/random-attribute/" target="_blank"&gt;this site&lt;/a&gt;, where the author basically advocates embedding a random number in the document then doing a find where you look for the next number higher than the return from Math.Random(). Now that works, but for sparsely populated data it often returns the same document, for example:&lt;/p&gt;
&lt;p&gt;Imagine you have the following data:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;[0.0, 0.1, 0.11, 0.2, 0.7, 0.8, 0.9]&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;for any value greater than 0.2 and less than 0.7 it will return the document at 0.7. Obviously not a good solution for sparse data sets.&lt;/p&gt;
&lt;p&gt;Then I stumbled across an interesting idea, that is to use Mongo&amp;#8217;s geo-spacial extensions to provide a random document, heres how:&lt;/p&gt;

&lt;p&gt;In your document add a field like so:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;{randomizer:[Math.Random(), 0]}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;add an index:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;db.collection.ensureIndex({randomizer:{'2d', min:0.0, max:1.0}})&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;now, to select a random document you simple use a $near search to find the nearest document:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;db.collection.findOne({randomizer:{$near:[Math.Random(),0]}})&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Because I&amp;#8217;m using Shanty Mongo to abstract the mongo stuff, I simply popped the code into a base class derived all my real classes from that, and boom, instant easy random document retrieval!&lt;/p&gt;</description><link>http://www.tonymillion.com/post/19732513056</link><guid>http://www.tonymillion.com/post/19732513056</guid><pubDate>Thu, 22 Mar 2012 14:55:51 +0000</pubDate><category>mongodb</category><category>random</category><category>document</category><category>code</category><category>zummzumm</category></item><item><title>The spam of satan??</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_m1aiu2sqJK1qzzwrqo1_250.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;The spam of satan??&lt;/p&gt;</description><link>http://www.tonymillion.com/post/19731852599</link><guid>http://www.tonymillion.com/post/19731852599</guid><pubDate>Thu, 22 Mar 2012 14:27:38 +0000</pubDate></item><item><title>Do what you love, or stop doing it.</title><description>&lt;p&gt;So, ZummZumm has been out a little while, and it has a decent user-base for an un-promoted, un-TechChrunched app/service, and you know what, every day working on it is a day filled with Joy.&lt;/p&gt;
&lt;p&gt;Every time I see the comment count on the stats page jump up I feel a sense of deep satisfaction. Satisfaction that I&amp;#8217;ve developed something that someone has found the software useful or joyful enough to use. I literally shake with excitement when I think of a cool new way of doing something, or something brilliant I can add behind the scenes that I hope people are going to, if not love, at least find cool.&lt;/p&gt;
&lt;p&gt;Its still incredibly early days, and I&amp;#8217;m glad of this time, with the friendly people using the service right now, and I love that they are finding worth in the software. The discussions it has brought up are amazingly &lt;a href="http://post.zummzumm.com/4f5e50c3304fbe0f4d000004" target="_blank"&gt;deep&lt;/a&gt; &lt;a href="http://post.zummzumm.com/4f6581c2304fbe1d7f000000" target="_blank"&gt;and&lt;/a&gt; &lt;a href="http://post.zummzumm.com/4f66f90e304fbe4b15000003" target="_blank"&gt;poignant&lt;/a&gt; considering no one knows who each other are.&lt;/p&gt;
&lt;hr&gt;&lt;p&gt;Which brings me onto the reason for this post, to my last gig at Bababoo.&lt;/p&gt;
&lt;p&gt;Now, Bababoo was an amazing idea, a seamless easy way to bypass the carrier when making calls. It was an great piece of technology and for the most part when it worked, it worked really well. I still get good feedback from people about it to this day.&lt;/p&gt;
&lt;p&gt;But I never got any joy from it, and any complements I get about it these days sting.&lt;/p&gt;
&lt;p&gt;It took over a year to develop, it shouldn&amp;#8217;t have done, but it did and by the time it hit the market, I had been through the mill, pulled this way and that during the development process, hindered in my work, and generally exhausted by the whole process.&lt;/p&gt;
&lt;p&gt;So when I saw we got several hundred users in a day, it didn&amp;#8217;t fill me with joy that these people might be finding it a useful part of their lives, I simply felt despair at the fact it was several hundred more people I&amp;#8217;d have to support.&lt;/p&gt;
&lt;p&gt;I was embittered by my own software… And that felt awful.&lt;/p&gt;
&lt;p&gt;I seemed to be constantly angry, moody and easily upset. Why the hell was I working so hard on this, slogging my guts out and getting no real satisfaction, emotionally or monetarily, in return? Looking back, I was probably not a nice person to be around at that point in time.&lt;/p&gt;
&lt;p&gt;Then something crazy happened. Its been spun a number of ways, but to cut to the chase: &lt;strong&gt;I was fired&lt;/strong&gt;. I was fired from a company based on software I made by someone who wasn&amp;#8217;t even involved until well after the time it was out.&lt;/p&gt;
&lt;p&gt;I didn&amp;#8217;t feel any of the emotions I expected to feel, I wasn&amp;#8217;t sad, I didn&amp;#8217;t feel lost. I felt a sense of relief about the whole thing, because suddenly I didn&amp;#8217;t have to give a shit any more. I was finally divorced from this marriage:&lt;/p&gt;
&lt;p&gt;I realise I had no love for Bababoo.&lt;/p&gt;</description><link>http://www.tonymillion.com/post/19592549488</link><guid>http://www.tonymillion.com/post/19592549488</guid><pubDate>Mon, 19 Mar 2012 22:22:00 +0000</pubDate><category>joy</category><category>development</category><category>startup</category><category>life</category></item><item><title>How to *really* reduce the size of your iOS app.</title><description>&lt;p&gt;I recently read &lt;a href="http://david-smith.org/blog/2012/03/05/techniques-for-shrinking-app-bundle-size/" target="_blank"&gt;this&lt;/a&gt; article via @_DavidSmith on twitter. While noble, it does miss a fairly big optimisation technique. That is reducing the bit depth of your PNGs from 32bit(16 million colours) to 8bit (256 colours).&lt;/p&gt;
&lt;p&gt;I hear many of you crying out in pain right now, but stay with me.&lt;/p&gt;
&lt;p&gt;Really, unless you&amp;#8217;re using a huge colour gamut, or using alpha channel effects you may get away with using 256colour PNGs and save yourself 3/4 of the file size… yes thats right a 75% reduction in file size!&lt;/p&gt;
&lt;p&gt;Here is an example of the splash screen for one of my apps one is 32bit the other is 8bit:&lt;/p&gt;
&lt;p&gt;&lt;img alt="8bit" height="960" src="http://tonymillion.com/default8bit.png" width="640"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://tonymillion.com/default32bit.png"/&gt;&lt;/p&gt;
&lt;p&gt;Can you tell the difference? Perceptially maybe not, but in terms of file size, the 32bit PNG is 999k and the 8bit PNG is 378k. Thats quite a saving eh? So how do you achieve this amazing saving?&lt;/p&gt;
&lt;p&gt;Well if you use photoshop to generate your UI elements, quite simply: you use the &amp;#8216;Save for web and devices&amp;#8221; &lt;/p&gt;
&lt;p&gt;&lt;img height="398" src="http://tonymillion.com/saveforweb.png" width="328"/&gt;&lt;/p&gt;
&lt;p&gt;This will bring up a funky UI allowing you to do a side by side comparison of the original image versus the one you are going to save. Up in the top right of this UI is a drop down where you can change the format of the saved file (I&amp;#8217;ve highlighted it in the image below). Select PNG-8 from here, then set the dither to Diffusion. &lt;/p&gt;
&lt;p&gt;The dithering is important! Why? Well printers have been doing dithering for years, you might not have noticed as the PPI of printers was so high, but they do it. Guess what… your iPhone 4/4S has a PPI as high as the &amp;#8216;base&amp;#8217; of a laser printer, so dithering is a very real option for graphics now.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://tonymillion.com/funkyui.png"/&gt;&lt;/p&gt;
&lt;p&gt;From here you can save out the final image.&lt;/p&gt;
&lt;p&gt;While this isn&amp;#8217;t perfect for every UI component, e.g. places where you use a wide colour gamut, or places where you need alpha translucency, it is a sure fire way to reduce the size of your application.&lt;/p&gt;
&lt;p&gt;And while I can already hear complaints of &amp;#8216;but its 256 colours&amp;#8217;, yes that individual element is, but that doesn&amp;#8217;t stop it being composited at the full 32Bit colour of the iDevice&amp;#8217;s screen, so if you&amp;#8217;re clever with how your UI is layered you can create a full-colour UI from a whole bunch of 256colour PNGs each with their own palette.&lt;/p&gt;
&lt;p&gt;So stop and ask yourself (or your graphics guy) do you &lt;strong&gt;really&lt;/strong&gt; need that 32bit PNG for your nav bar or can you get away with a 256 colour one. &lt;/p&gt;
&lt;p&gt;Case in point: using this technique I reduced the size of the ZummZumm .ipa file from about 8 Megabytes down to the current size of 2.6Megs!&lt;/p&gt;</description><link>http://www.tonymillion.com/post/18844582999</link><guid>http://www.tonymillion.com/post/18844582999</guid><pubDate>Tue, 06 Mar 2012 12:28:21 +0000</pubDate><category>ios</category><category>color</category><category>bitdepth</category><category>resource</category><category>size</category></item><item><title>Finished!</title><description>&lt;p&gt;We finished the new app we were working on and submitted it to the app store earlier this week. Wether it gets approved before the AppStore-Haitus on the 22nd is another matter entirely.&lt;/p&gt;
&lt;p&gt;The service uses a whole bunch of &amp;#8216;modern&amp;#8217; technology like MongoDB and such. So there was a learning curve involved too, but the app took less than 30 days to do from conception to delivery, really a lot less as I had to spend a week visiting my dad who was in hospital.&lt;/p&gt;
&lt;p&gt;We wanted to launch with Audio recording, Video, and a whole bunch of other post types but it was obvious half way through development that those were going to add weeks of work to the development schedule, so we&amp;#8217;d completely blow christmas and new year.&lt;/p&gt;
&lt;p&gt;So I made a decision - &amp;#8220;lets do them next revision&amp;#8221; - after the pressure is off and we&amp;#8217;ve had a moment to reflect. Too many times I&amp;#8217;ve seen the situation where too few people are trying to do too much work.  We simply didn&amp;#8217;t have the bandwidth to deliver on all those things right now, and having too many balls in the air at once means we&amp;#8217;d have dropped a few.&lt;/p&gt;
&lt;p&gt;And this is the crux of this post, I took the decision to release an app that does a few things really well than to release an app that does a lot of things badly. We can, in subsequent revisions add another &amp;#8216;thing&amp;#8217; that the app does really well. Until, at some distant point in the future, the app does a lot of things really, really, well.&lt;/p&gt;
&lt;p&gt;The fact that I had complete control to make that decision is like a breath of fresh air, there are no management to worry about focus groups, no one to cast down a dictate of &amp;#8216;well if it doesn&amp;#8217;t do &amp;lt;minor feature that very few people will use&amp;gt; then we can&amp;#8217;t release&amp;#8217;.&lt;/p&gt;
&lt;p&gt;So, while its not perfect (yet) and theres absolutely no guarantee that it&amp;#8217;ll change the world, it cost about $2000 to make (yes thats right two thousand dollars). Since I&amp;#8217;ve bootstrapped my startup with $100,000 we can make another 50 of these before we run out of cash.&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;</description><link>http://www.tonymillion.com/post/14556526934</link><guid>http://www.tonymillion.com/post/14556526934</guid><pubDate>Wed, 21 Dec 2011 09:01:47 +0000</pubDate></item><item><title>Loved Sync (by Max Hattler) (via Boxee) </title><description>&lt;a href="http://b0x.ee/uCC5UN"&gt;Loved Sync (by Max Hattler) (via Boxee) &lt;/a&gt;</description><link>http://www.tonymillion.com/post/13977340582</link><guid>http://www.tonymillion.com/post/13977340582</guid><pubDate>Fri, 09 Dec 2011 19:42:24 +0000</pubDate></item><item><title>"if all you have is a hammer, everything looks like a nail"</title><description>&lt;p&gt;Tescos seem to think everything is a tomato….&lt;/p&gt;
&lt;p&gt;&lt;img height="480" src="http://tonymillion.com/media/tomatoes/1.JPG"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="480" src="http://tonymillion.com/media/tomatoes/2.JPG"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="480" src="http://tonymillion.com/media/tomatoes/3.JPG"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="480" src="http://tonymillion.com/media/tomatoes/4.JPG"/&gt;&lt;/p&gt;
&lt;p&gt;Except these which are not carrots&amp;#8230;&lt;/p&gt;
&lt;p&gt;&lt;img height="480" src="http://tonymillion.com/media/tomatoes/5.JPG"/&gt;&lt;/p&gt;</description><link>http://www.tonymillion.com/post/12927339508</link><guid>http://www.tonymillion.com/post/12927339508</guid><pubDate>Thu, 17 Nov 2011 16:05:00 +0000</pubDate></item><item><title>I'm back baby!</title><description>&lt;p&gt;And as a first post I&amp;#8217;d like to point you to a new project of mine over on github called &lt;a href="https://github.com/tonymillion/Reachability" title="Reachability on Github" target="_blank"&gt;Reachability&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Its basically a &amp;#8216;drop in&amp;#8217; replacement for the old Apple reachability, however it takes advantage of Grand Central Dispatch and Blocks to make your life a heckuvalot easier!&lt;/p&gt;
&lt;p&gt;using it couldn&amp;#8217;t be easier, see the example below:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// allocate a reachability object
Reachability* reach = [Reachability reachabilityWithHostname:@"www.google.com"];

// set the blocks 
reach.reachableBlock = ^(Reachability*reach)
{
    NSLog(@"REACHABLE!");
};

reach.unreachableBlock = ^(Reachability*reach)
{
    NSLog(@"UNREACHABLE!");
};

// start the notifier which will cause the reachability object to retain itself!
[reach startNotifier];&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In addition your old code that uses NSNotificationCenter will continue to work too!&lt;/p&gt;</description><link>http://www.tonymillion.com/post/12736685700</link><guid>http://www.tonymillion.com/post/12736685700</guid><pubDate>Sun, 13 Nov 2011 13:54:00 +0000</pubDate><category>objective-c</category><category>github</category><category>code</category><category>frist post</category><category>GCD</category><category>Blocks</category></item><item><title>The project (Taken with instagram)</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_lu793yDALp1qzzwrqo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;The project (Taken with &lt;a href="http://instagr.am" target="_blank"&gt;instagram&lt;/a&gt;)&lt;/p&gt;</description><link>http://www.tonymillion.com/post/12377949623</link><guid>http://www.tonymillion.com/post/12377949623</guid><pubDate>Sat, 05 Nov 2011 18:09:34 +0000</pubDate></item><item><title>Blogtacular!</title><description>tonymillion: its a blog site &lt;br /&gt;&#13;
tonymillion: but it integrates image/audio/chat/etc into it&lt;br /&gt;&#13;
tonymillion: so you can blog anything&lt;br /&gt;&#13;
shift: if you are a blogtacular twat&lt;br /&gt;&#13;
shift: ^__^&lt;br /&gt;&#13;
</description><link>http://www.tonymillion.com/post/90318380</link><guid>http://www.tonymillion.com/post/90318380</guid><pubDate>Fri, 27 Mar 2009 11:39:00 +0000</pubDate></item></channel></rss>

