Archive for the 'Code' Category

Photo Hack Day NYC 2011 And My Hack: AllPaper

This past weekend I participated in my first NYC hackathon. The New York Hackathon is a mythical beast. They’ve been written about quite extensively, but you really need to just show up to one to know what it’s all about.

This particular hackathon (Photo Hack Day) was organized by Aviary, with sponsorships by Bing, Pepsi, PBR and others. There was plenty of food so that hackers didn’t have an excuse to leave, ever. I still ended up going home to get some sleep on Saturday night before the demo on Sunday.

I really think I picked a good first hackathon to attend, as the prizes were pretty insane. First place got $5000 and the cash prizes for second and third place were quite good as well. On top of those, there were prizes for best use of certain APIs. Face.com’s API stood out as a popular one; 500px had quite a few users as well.

I ended up working on a project I had wanted to build for a while: a custom collage creator for your iPhone wallpaper. I called it “AllPaper.” It seemed pretty catchy and I don’t think there’s a product with that name yet. I integrated Instagram into it first, then threw support for 500px, PicPlz and Facebook before calling it a hack. I also integrated the Sincerely Ship Library which lets you turn your collage into a real postcard. I’m really looking forward to trying that out!

Overall I’m pretty happy with how the hack turned out. I can probably turn it into a real app fairly easily with some tweaking here and there. As this was my first hackathon, I noticed a few interesting things about the top hacks. There was some grumbling about how many of them seemed “hardcoded.” I wonder if presentation really counts more than actual hack-worthiness these days. You could spend your time actually coding something, or you could create the facade of something that looks even better, but is not really that worthy of being called a “hack.” It seems that the presentation wins over the true hack-worthiness, as one of the cooler ones, a jailbroken iPhone that took MMS messages and uploaded them to a web service, won nothing.

Coming away empty-handed was a little damaging to the ego, especially after winning something in my last hackathon, but my ego’s not too bruised. I hate to sound like I’m complaining! Almost all of the presentations were well done, and the winners certainly did deserve to win. I’m hoping to participate in something similar again soon, as the atmosphere was really enjoyable.

Delayed Gratification in Engineering and Entrepreneurship

I read a blog post about Engineers and Delayed Gratification a while ago from ex-Googler and ex-Microsoftie Ninane Wang that made me think. She says that new engineers (like straight from school) have a hard time adjusting to the real world because they expect to be rewarded immediately for their work. In the real world, you don’t see rewards for your work for months, or even years! Her solution is to have managers provide instant feedback to their reports so they get at least some acknowledgment of their work.

Since quitting Microsoft and setting out on my own (and even before that), I’ve had to trust that the stuff I am working on is meaningful and worthwhile. This is hard sometimes, especially if the thing I’m working on seems like a gamble. Having done the whole independent hacking thing for a while, I think I’ve built up the rolling reward cycle that Niniane mentions. Some days I’ll feel like I’m underachieving or working on something that no one will find useful. Then I’ll get a donation from someone for Instascriber (this actually happened!!!) or see another 5 star review for my Threadless app and get re-encouraged.

At the end of the day, I think what really separates the employees from the entrepreneurs is the willingness to be unsure about something and still do it. The uncertainty is much greater when you’re working on an unproven idea, business model, or whatever, but then so are the potential rewards, too. And even if you end up failing, you learn something and are better for it.

In some ways, delaying gratification even sort of makes sense. If you immediately were rewarded for doing something innovative, you might lose the passion (like Rocky did) and stop innovating so you can enjoy your riches. While I can’t say that delaying gratification indefinitely would be a good idea, accepting that there will be a delay is probably healthy.

Mapskrieg iPhone/iPad App Launch!

It’s been about 4 years since I announced the launch of Mapskrieg, my Google Maps and craigslist mashup web app. Since then, I’ve gone to school (again), worked for Microsoft and quit, and made a few apps. Today, I’m happy to announce the launch of my newest app, Mapskrieg for iOS!

I’ve been working on this app for a few weeks, and I think it’s ready for public consumption. It’s basically Mapskrieg, but developed natively for the iPhone and iPad. In the past, I’ve taken a sort of iterative approach of releasing fairly minimal apps and improving on them. For example, I released Threadless as an iPhone only app and later added the iPad support. I wanted to release Mapskrieg on both platforms so the launch would have a little more bang. Plus I think the iPad app is the better of the two, and I really wanted that one to stand out for the release. I’ve been getting much more comfortable with mobile development, and I’m very happy with the rate at which I was able to conceive and release this app.

That’s not to say I didn’t struggle or learn anything new with it. While a lot of the concepts are borrowed from my Threadless iPad app, I had to do a lot of stuff I hadn’t done before. For example, since Mapskrieg is going to rely on iAds to make money, I decided that both the iPad and iPhone versions would support iAd. Apple, in their infinite wisdom, made the split view controller a very useful and now, standard, design paradigm. Unfortunately, they don’t provide any support for using it with iAd at all. What the fucking fuck, Apple!? So I had to basically recreate the Split View (well, the landscape mode at least) in order to support iAds. It’ll be well worth it if I can rake in some iAd dough, though!

This post also comes almost 1 year after I quit my job at Microsoft. That milestone probably deserves its own post, but I’ll just say that I have not yet regretted my decision in the very least so far. This is as fun as it gets, folks!

Edit: Oh, I forgot to link to a demo video that I recorded for a contest. Check it out in case you don’t have an iOS device:

♥s Threadless for iPad Release!

About a week ago I thought about working some more on ♥s Threadless, my fan made iPhone app. I originally designed it for the small iOS devices like the iPhone and iPod touch, and figured I would do the proper iPad version later. I got the itch, so I got to work figuring out what an app on the bigger screen would look like.

I knew that I wanted a grid-y layout as opposed to the list-y one of the iPhone/iPod, which was partly the reason why I hadn’t done the iPad version yet. Lists on iOS are easy because they’re given to you for free. Grids are a whole other beast. Luckily, I ran into a framework (AQGridView) on GitHub that does grid layouts in a tableview-y sort of paradigm. The framework was still a little beta (or alpha) as I had to go in and change a few things that were crashing, but it did succeed in making my job a lot easier overall. I’d like to try contributing to that code to improve it, but I guess that’s another post altogether.

After getting the grid stuff working, I decided to use a modal pop up view to display the images and sharing options all in one view. Since the iPad has much more screen real estate, it’s easy to design things without running into space issues. You don’t, however, want to just stick a billion buttons in because you can. I think this design does a good job of showing enough stuff to the user, but not too much stuff too soon.

I still have some bugs to fix, mainly with memory management due to the grid view stuff. If you have any suggestions, feel free to comment on this blog!

Hopefully the iPad app continues the mission of the iPhone app, which is to provide a really easy and fun way to browse and share awesome Threadless designs! I may have been an early iPad doubter, but I really believe that it’s a great device for consuming content. Even on my iPad 1, the designs and colors just pop on the app. At least I think so. But you don’t have to take my word for it!

Get the app if you don’t have it already!

Note to Myself about UISplitViewController and Auto-Rotation

In order to prevent my future self from wasting like, 2 hours fucking around with UISplitViewController getting it to auto-rotate its subviews, here’s a little post!

Most of the time, UISplitViewController doesn’t want to rotate because you didn’t set it as the root subview of the Window. This is pretty well documented on StackOverflow, etc. I thought this was why my splitviewblahblahblah wasn’t rotating. It turns out that, according to Apple’s documentation,

A split view controller relies on its two view controllers to determine whether interface orientation changes should be made. If one or both of the view controllers do not support the new orientation, no change is made. This is true even in portrait mode, where the first view controller is not displayed. Therefore, you must override the shouldAutorotateToInterfaceOrientation: method for both view controllers and return YES for all supported orientations.

The key here is that the view controller wasn’t autorotating because the subviews did not answer “YES!!!” (exclamation points added by me) to shouldAutoRotateToInterfaceOrientation. I was fucking around with the Split View Controller in Interface Builder (and later programmatically) to no avail. Adding the stupid autorotate thing to yes in the subviews made it work (shouldn’t it default to YES!?!??!).

Okay, lesson learned. Just don’t forget this next time, Hung!

Books

Hung Truong's  book recommendations, reviews, favorite quotes, book clubs, book trivia, book lists

Capitalism!