One Game A Month

I’m going to work on finishing projects this year with the help of motivation by joining the community over at OneGameAMonth.com (#1GAM). I don’t know if I’ll write anything more than the initial post so I setup a new tumblr just for this event. Assuming things go well, I’ll repost the articles over here.

I hope to finally start blogging again about development in conjunction with attempting to finish developing one project each month. The first will be Star Command assuming we at least submit it this month, and while there will be continued work on it throughout this year, once it’s finally out I plan to devote a bit more time to blogging and #1GAM projects.

I wrote an initial entry and will follow up with one more “overview” or “brainstorm” type post soon.

Background Music Queue with AVPlayer and iOS4

Update 2010-Nov-11: Apple has come out with AVQueuePlayer in iOS 4.1, and presumably most people are going to move to the latest version now that it performs well even on the 3G, but the AVPlayer can still be used to manually create a queuing of items, but if you want all the hard work to be done for you, with only a few limitations, then use AVQueuePlayer instead.

Update 2010-Oct-19: Apple has been updating their documentation slightly, and it has more information now with regard to setting up an asset. This is more specifically for video, but it might help fill in the blanks for just audio. AVPlayer Playback Guide

The iOS 4.0 framework introduced AVPlayer which allows playing a MP3s from the iTunes Music Library in the background without using the iPod music player.  This has a couple benefits over the MPMusicPlayerController in that you can add new items, stop, or play music in the background. Also, a custom icon can represent your app in the multitasking menu where the ipod controls are located. If you stick with [MPMusicPlayerController iPodMusicPlayer] you can play music in the background through the ipod player, but once an app goes into the background, it no longer has control over the playback of the music.
Continue reading

How To Securely Manage Your Online Identity

Today we use hundreds of websites on a daily or weekly basis. Many of these require us to create and login with a password. Over time managing all of your identities is a serious challenge. I have decided to give an initial look at the problems and some solutions that you are likely already using to help in this regard.

Problem with Passwords

We’re Human

Dilbert.com

People use simple passwords that are common words, names, or are patterns of keys such as ‘qwerty’ or ‘asdfasdf’ because they are easier to remember. Many people also use a small number of passwords to login to hundreds of websites that they visit each day. I would also guess that many people use the save password feature with their browser in order to save from typing their passwords in each time they visit a site that requires it. Anyone can walk up to your computer and login to any website for which you have a saved password. So we use simple passwords,  and reuse them, and store them in our browsers. How can we prevent ourselves from this inherently insecure behavior?

How secure is your password? Find out.

Continue reading

Random Selection without Repeat (aka Shuffle)

While writing Naval Fight I wanted to have the easy computer opponent select a random position on the board grid every turn.

The initial naive solution I implemented initially for testing was to have the computer choose a grid position at random checking to make sure it is a valid position, valid meaning that it had not been used before.

do {
position = gridPositions [ random() * N ];
} while ( ! valid(position) );

After testing on the iPhone device it became apparent that this was terribly inefficient, and it was possible this loop could continue indefinitely. The next iteration I used an array of all possible positions that would be randomly selected from, but after a selection was used it was removed from this array.

validPositions = gridPositions.clone();

// selection
position = validPositions[random() * validPositions.length];
validPositions.removeElement(position);

This solution was adequate, but there can always be improvements, and now that I am storing information in a second array, how can it be used more efficiently. Thinking about the problem further it became apparent that this was akin to listening to a playlist on shuffle. Which then gives the light bulb moment that instead of thinking about random selection with no repeats I should just shuffle the array of positions, just like having a deck of cards and removing a card for each turn, noting it’s value (ie: grid position). After a little searching I came across the Fisher-Yates shuffle algorithm, and found an efficient and unbiased implementation:

// setup
int currentPosition = 0;

for (int i = gridPositions.length; i > 1; i--) {
  // Pick a random element to swap with the i-th element.
  int j = random() * i;
  // Swap elements.
  int tmp = gridPositions[j];
  gridPositions[j] = items[i-1];
  gridPositions[i-1] = tmp;
}

// selection on each turn
position = gridPositions[currentPosition++];

This solution generates an array of possible positions which are then shuffled, and finally an index into the array is stored where the next position can be read. Each time the position is accessed from the array this counter increases to always point at the next position. There are other solutions that would work, but this seems to be a good final solution for my problem.

</steve>

Listen to Your Passion

What’s your passion? What do you find interesting? Funny? Inspiring? There is very likely an audio or video show out there with your specific interests in mind. Podcasts – as they are usually referred to – can be found by searching the iTunes Store, Zune Social, Miro Guide, or just a generic search on your favorite trusty search engine. You can then download and listen (or watch) these shows on your commute, while working out, or traveling. I mostly enjoy learning about my trade – technology and programming – but also enjoy keeping up with sports, news, and the economy, as well as having a good laugh or two. I find it difficult to choose which podcasts to listen to since there’s only so much time in the day, and while it’s great to constantly learn, at some point you have to make your own contribution using the knowledge gained from listening and apply it to your own projects and life.

The following is a list of many of the shows that I tune into. Some I listen to weekly, but most of them I only listen to the episodes that interest me. I find podcasts are especially beneficial for when I’m working out and traveling, and if you have a long commute I’d imagine they’re a lifesaver.
Continue reading

iPad – It’s Just A Big iPhone

The Larger Screen Matters

iPad
Ever since watching the first Harry Potter movie, I’ve been fascinated with the idea of having newspapers with video and continually updated content. I have always hoped that someday we would have the same experience, and the iPad is the first gadget to finally succeed in bringing us this reality. After using the iPad for a few months now, I think that it is still a luxury consumption device that could definitely fit between the laptop and phone markets. It really is just a larger iPhone, and with similar resolution to the new iPhone 4 Retina Display ™, but it’s amazing how having a larger form factor makes apps and games so much more enjoyable to use. While it is currently meant for consuming content, the addition of a bluetooth keyboard and more powerful apps will allow for creating content such as drawing, composing music, documents, presentations, and writing screenplays as just a few examples.

While it can replace the Amazon Kindle for most people, I still enjoy reading on the Kindle due to it being very light to hold, and it’s excellent for reading in bright sunlight. But, if you only want to buy or carry around a single reading device, then the iPad is definitely the device to have. It is a great replacement for reading books, magazines, newspapers, and cookbooks. It works very well as a PDF reader, especially with the new support in the Apple’s official e-reader app iBooks. It can also be used for playing games, watching movies, viewing photos, browsing the internet, looking at maps, and much more.

Continue reading

Startup Weekend Boulder 2010

Back in April I ventured to Boulder to participate in a event called Startup Weekend, founded in 2007 by Andrew Hyde. The idea is for people with different backgrounds to gather together to form a startup company with the hope of having a working prototype to present by Sunday evening. The focus of the event is to pitch ideas, then form one or more startup groups and create a product or service based on the selected ideas. However, it also gives people an opportunity to network with other locals who share a similar interest in entrepreneurship, as well as with a few venture capitalists or other mentors and sponsors who are willing to share their expertise and experience, as well as ideas and comments on the various projects.
Continue reading

Delivering Happiness with Tony Hsieh

Having been given a complementary advanced reading copy of the book Delivering Happiness: A Path to Profits, Passion, and Purpose, it is only fitting that I return the favor by giving an honest review of a personal, humorous, and informative narrative told by the CEO of Zappos himself, Tony Hsieh.

The book gives you an insight into the life of Tony Hsieh, whom many have only heard about through the recent acquisition of Zappos by Amazon. He discusses his adventures in entrepreneurship – from worm farms, through building a customer service enterprise – in his pursuit of delivering happiness to the world. Along the way Hsieh dabbles in the art of making and selling buttons through a mail-order catalog, running a pizza business during college, building Link Exchange and selling to Microsoft for $275 million, and finally, through the survival of Zappos during a period where they were walking within inches of financial bankruptcy.

Just the story of Tony’s life is an interesting read in and of itself. You learn of why he acquires a love for the peace-love-unity-respect (PLUR) culture after attending a rave for the first time, why he sold his million dollar loft after throwing a massive birthday bash, why he left a stable well-paying job at Oracle, and of course, the journey from an initial investment in ShoeSite.com to what we know today as Zappos.com.

Our Brand, Culture, and Pipeline are the only competitive advantages that we will have in the long run. Everything else can and will eventually be copied. – Tony Hsieh

Continue reading

It’s not a Phone! It’s not a Computer! It’s an iPad!

This has been discussed to death, but I have decided to weigh in a few thoughts. If you love to customize your PC, run Linux, or would give up your netbook only from your cold dead hands, then this post is not for you. If, on the other hand, you think that the iPad is actually a bit more than just a large coaster, feel free to continue reading.

The main thing to keep in mind is that the iPad hasn’t been released, has only had a limited hands-on time for a handful of people, there will be a version 2, and most of my thoughts could be somewhat translated to another appliance-like tablet device.

That Really Is The Name. No Joke.

There have already been hundreds of jokes and parodies about the name, some recent, a few in the past. Will we continue to mock it 6 months from now? Probably not, as either it will have failed as a product, or the name will fade into the background as almost every name does (think Microsoft, Bing, even Google for that matter). Sure this name may sound the most ridiculous right now, and there is merit to women being upset that it wasn’t thought out even a little.  But over time it will just be the name and in six months it won’t matter anymore.

Hyper-Hyped Up Beyond Imagination

Is it even possible that Apple’s reveal could have lived up to most of the hype showering the internet? I don’t think so. It may have been short of many reasonable expectations, but the hype was definitely an impossible goal to be reached (especially since Jobs did claim the device to be magical). I think I can safely say that the version they showed off at the event was not magical, and really was just a larger iPhone. That said, I think Apple delivered a product very similar to the first iPod, something that initially is a letdown, but with lots of potential.

Continue reading

Five reasons I’m a Browser

The next decade will see the continued rise of the browser as the platform, and I’m ready to ride the wave. Here’s a look into five reasons why I enjoy the web and all that it offers us.

Install Not Required

Open a brand new computer, start the browser, access a website, and finally close the browser. No more 5-hour reformat process, only to then have to install ten or more applications which can each take quite a while. Now you just access the application by URL and login. That’s it, nothing to install, no keys to enter – just register, pay if required, and login. Now you are not tied to a single machine, but instead can use any computer device that has a browser. Also, beyond just not needing to install anything, you also always have access to the latest and greatest version of the application, even if this does allow companies like Google to keep their apps in perpetual beta.

Continue reading