Tuesday, February 25, 2014

Introducing Comic Cover Muzei

If you own an Android phone you should know about the wonderful new live wallpaper app, Muzei coded by Roman Nurik. I was hooked on it from day one. You see Muzei automatically downloads and sets a new wallpaper image for you every day. By default the app will download art curated by Roman's fiancée. The first image it showed was van Gogh "The Starry Night" which is one of my favourite paintings and I'm getting a chance to see it at MOMA this summer but I digress.

After I downloaded the app I was reminded of a blog post by my buddy Raymond Camden. In the post on the Marvel Comic's API, Ray shows how to query the Marvel database and display covers. So I decided to combine chocolate and peanut butter into one awesome combination.

The Muzei app provides a way to write an extension to provide a new data source. So what I've done is to create an extension that randomly picks a Marvel Comic book cover and sets it as your wallpaper. It's called Comic Cover Muzei.


Select the data source


Set your options


Enjoy your art

Right now you can set an option to only download the images over wifi if you are worried about bandwidth usage and you can set the refresh interval from 3 to 24 hours. I've got plans to add more options to allow you to pick the character or series to pull the images from. 

Also, right now the app only uses Marvel Comic covers but I'd love to add other companies like DC, Image, etc.



Thursday, February 6, 2014

Anna Has Been Pulled From the Play Store

Back in September of 2012 I posted up my sample app called Anna which highlighted the power of doing speech recognition on mobile devices using PhoneGap. Today I've had to pull the app from the Play Store because of this infringement notice from Wolfram Alpha.



I don't have the strength, time nor money to fight this so I just going to rolled over pulled the app. I attempted to discuss it with Wolfram Alpha but they insisted I 1) pay for an commercial deployment license, 2) remove the Wolfram Alpha functionality or 3) pull the app. I can't afford the rates they charge for a commercial deployment license. Still they can't do anything about the source code for the app which is still available at: https://github.com/macdonst/anna

I'm not even mad, just a bit puzzled as there is no way my sample app is in any way a threat to the Wolfram Alpha app in the Play Store. I guess they don't want to have a precedent where they don't aggressively enforce their terms of service.

It's rather silly as I don't even ship an API key with the app. If you want to use Anna you have to sign up with Wolfram Alpha so they won't be getting the, albeit small, exposure that my app provides. Also, I doubt I'll ever recommend them to any of my developer friends ever again.

Saturday, November 30, 2013

Books I've Read This Week

Remote: Office Not Required by Jason Fried and David Heinemeier Hansson is a good book for folks who are looking to take the leaving into working remotely. As someone who worked remotely for 3+ years I didn't find anything in the book that I would disagree with. Unfortunately, I also didn't find anything in it that would convince you boss to let you telecommute. So if you are looking for a book to feed your confirmation bias this is it but you may want to just get it from the library.
Raising Steam by Terry Pratchett is the latest book in the always hilarious Discworld series. This time around the main protagonists are Moist von Lipwig as he has been tasked by Lord Vetinari to take charge of this new fangled steam engine that has been brought to Ankh-Morpork.

The book gives Pratchett the opportunity to look back on how the invention and subsequent rollout of steam engine powered railroad. He's able to show how the discovery of this new technology brings people closer together by reducing the physical impediments that were once in place to separate the different races. You can draw a parallel with our own world where the internet is connecting people all over the place.

Sadly, this is not Pratchett's best effort. There is a long period in the middle where not too much happens and it could have probably been edited away. As well I'm not quite sure who the antagonist was in the novel. Certainly there was some conflict between the Grags and the rest of the dwarves but that didn't seem to gel quite right for me.

Although, I did enjoy the novel. Like most of Pratchett's books there are laugh out loud moments and I really thought the bit where the main steam engine was compared to a goddess of the earth as it embodied all four elements coal = earth, steam = water/air and fire to burn the coal and generate the steam from the water. 

Monday, November 25, 2013

Doctor Who Speculation on the 13th Doctor and Beyond

First off if you haven't watched the 50th anniversary special that aired this past Saturday don't read this post as it will spoil major plot points.

Alright, if you are still reading then you must want to hear this. An established part of Dr Who cannon is that Gallifreyan's can regenerate their bodies 12 times which effectively gives them 13 bodies in total. A fact which has been confirmed by Steven Moffat. This was a plot device originally dreamed up in 60's in order to allow the second Doctor, Patrick Troughton, to replace the first played by William Hartnell.

Looking back the following actors have played the Doctor:
  1. William Hartnell
  2. Patrick Troughton
  3. Jon Pertwee
  4. Tom Baker
  5. Peter Davison
  6. Colin Baker
  7. Sylvester McCoy
  8. Paul McGann
  9. Christopher Eccleston
  10. David Tennant
  11. Matt Smith
But as we now know there was a Doctor between McGann and Eccleston, the War Doctor played by John Hurt. Plus it has already been announced that Matt Smith is leaving the show and Peter Capaldi will be taking over. So the list actually looks like:
  1. William Hartnell
  2. Patrick Troughton
  3. Jon Pertwee
  4. Tom Baker
  5. Peter Davison
  6. Colin Baker
  7. Sylvester McCoy
  8. Paul McGann
  9. John Hurt
  10. Christopher Eccleston
  11. David Tennant
  12. Matt Smith
  13. Peter Capaldi
Oh no, we're at 13 Doctor's now. That must mean that Peter Capaldi will be the last actor to ever play the Doctor. Well of course not, they are going to keep making this show until it stops being profitable. During the 50th anniversary show we see John Hurt's Doctor beginning his regeneration but we never see him fully transforming into Christopher Eccleston. Perhaps this is because Christopher Eccleston was unable or unwilling to participate in the special or maybe it's something a little more timey wimey.

Since we had three Doctor's in the same time and space and they were actively messing around with their own timeline (yes, I know they hand wavey explained this away) I'm surmising that an alternative timeline has been created. Now when Doctor number 9 regenerates he doesn't become Christopher Eccleston but instead Peter Capaldi. This means that Capaldi could be Doctor number 10 and they've been able to stave off the question of a 13th Doctor for at least 3 more actors. 

8) Paul McGann
9) John Hurt
10) Peter Capaldi
11) ?
12) ??
13) ???

But wait, what about Matt Smith's Doctor what happens to him? Well, I believe that he is the 13th Doctor. You see David Tennant actually regenerated twice. Once in Journey's End and then again in his last show The End of Time. So that would make his list:

8) Paul McGann
9) John Hurt
10) Christopher Eccleston
11) David Tennant
12) David Tennant
13) Matt Smith

So in closing you probably had to be a real Whovian in order to read this post to the end but I believe we'll see a reboot of the Doctor Who franchise with Peter Capaldi stepping in as the new 10th Doctor and Eccleston, Tennant and Smith's Doctors being relegated to an alternative time line.

Sunday, November 24, 2013

Books I've Read This Week

The Shambling Guide to New York City by Mur Lafferty is a witty book that I quite enjoyed reading. The premise is an out of work writer ends up working for a small publishing company that is populated by vampires, zombies, death goddesses, etc. Initially Zoe is a skeptical of the varicosity of her co-workers claims but she is soon thrown head first into the monstrous underbelly of NYC. An innocent mistake from her previous job comes back to make trouble for her as well.
Fortunately, The Milk by Neil Gaiman is a book I'm very much looking forward to re-reading with my daughter. In it a father pops out to get milk for his kids breakfast cereal and he takes a very long time. When he gets back he regales his kids with a tale of dinosaurs, pirates, aliens and vampires.

It seem to me to be exactly the sort of story a father would come up with. It actually reminds me of the time my daughter was worried about dragons setting our house on fire to which I quickly replied that she didn't need to worry as we had dragon scale shingles on the house and obviously dragon scale shingles are impervious to dragon fire as it would be silly for a dragon not to be immune to their own breath. Well that story worked as she went to sleep. It wasn't until a few years later where I had to dance around that when we were getting our roof re-shingled.

Three Things That Tripped Me Up This Week

I've had a pretty productive week at work but here are three things that tripped me up this week. I'm putting them down in blog post format so that I'll remember them and maybe they'll help you as well.

1) Concurrent Modification Exception

So I was working on some code where I needed to loop through a collection of users and remove one when it meets a certain criteria. Which I coded up as:

        List users = um.getUsers();
        
        for (User user : users) {
            if (user.isAnAss()) {
                users.remove(user);
            }            
        }

Do you see the problem? No, neither did I as I wasn't thinking and luckily enough for most of my test runs the user who isAnAss was at the end of the List so the exception wasn't throw. When the isAnAss user was in the middle of the list BOOM! ConcurrentModificationException.

To get around this problem I ended up doing an old school iteration through the list.

        List users = um.getUsers();
        
        User user = null;
        for (int i = 0; i < users.size(); i++) {
            user = users.get(i);
            if (user.isAnAss()) {
                users.remove(user);
            }            
        }

2) Relative Layouts in Android are Slow for Complex Layout

I've been working on a lot of complex layouts for an Android app I'm working on and I was using the RelativeLayout judiciously. One of my dialogs was taking quite awhile to load and doing some profiling I determined it to be the measure method for the RelativeLayout was being called many, many times. Switching to a LinearLayout helped reduce these calls.

Romain Guy recently posted a slide deck on how RelativeLayout's are getting better in Android 4.4 and here is a video or Romain and Adam Powell talking about writing custom Android views.




3) Android's Handling of Images Sucks

It just sucks so hard. I was doing some performance tuning of one of our dialogs and found that about 90% of the time it was taking before being show was loading the three images it was using. Cache those images folks, doesn't matter how small they are.

Monday, November 18, 2013

Books I Read This Week

Year Zero by Rob Reid is a hilarious look at the recording industry and our insane patent and copyright laws through the lens of alien visitors to our fair planet. The elevator pitch is such, apparently aliens have been listening to our radio and TV broadcasts illegally since the 70's and have racked up so much in fines that the combined wealth of the entire universe is not enough to pay off the debt. Their solution is to blow up the Earth to avoid paying the fine. Now it is up to low level entertainment lawyer, Nick Carter (no not the Backstreet Boy) to save the world along with two alien reality TV stars.

I really enjoyed this book. It is a super funny work of satire.

Wait, is that it? Don't I usually put up two book reviews every week? Well yeah, I do but...well Attack on Titan is all I can say. I got super hooked on that anime this week and it has been eating up all of my spare leisure time. It's not even like I can watch it while doing something else as it is English sub-titles only.