Date Archives

November 2010

Gemfile syntax highlight in TextMate

Quick tip that I found when searching to find out how to get syntax highlighting in your Gemfile if you are using TextMate Ruby on Rails bundle.

In Textmate, select the Bundles menu => Bundles editor

Select languages instead of show all.

Select the Ruby on Rails language within the Ruby on rails bundle

Change this line:

fileTypes = ( 'rb', 'rxml', 'builder' );

to this:

fileTypes = ( 'rb', 'rxml', 'builder', 'Gemfile' );

Go to Bundles => Bundles Editior => Reload Bundles.

Reopen your Gemfile and you should now be getting the syntax highlighting.

Taking a deep breath and let your brain do it’s job

As software developers we are geard toward solving problems. I personally love putting the puzzle together and seeing things working as they should. As simple as it sounds the fact that we can write one line of code and render an image to the browser is just cool if you think about it. The reason it’s cool is, it works. I know what the code is going to do when I write it and there is always something satisfying about that.

If you have been in the development field for a while then you, like all of use, you surly have run into the issue at the end of the day that you can’t make work, get the defect fixed or whatever the case may be. Either it is lack of experience with the problem at hand or the stress of meeting a deadline just gets to you, or usually it’s a combination of both.

No matter how may times I run into this type of situation I always seem to forget what gets me through it 95% of the time. Settle down, take a deep breath and walk away for a while. Yes the problem is there and it will not magically fix itself but sometimes your brain needs time to work. It’s as simple as that.

More often than not I will get off work, sit on my front porch and enjoy a beer or glass of wine. If you love software development as much as I do, my brain is constantly working and thinking about it. When I have an issue that I can’t figure out I tend to walk through the code in my brain line by line without even really noticing that I am doing it. I have even had dreams where I see the solution.

In my opinion when we relax this is when the power of the human brain kind of takes over. We sometimes have to get out of our own way and let our natural problem solving self figure out, and complete the problem on it’s own. I encourage everyone, not just developers. If you have a problem to solve and the stress or deadline is getting to you, “walk away”. I promise that more often than not your brian just needs some time to process.

HTML5 = Buzz word. Flash, Flex, HTML5 talk.

With all the debate about Flash and HTML5 it’s hard to find all the facts sometimes, or at least an opinion that is not slanted in one direction or the other. As Flash developers, it’s not a secret. We love using Flash. As responsable developers and experts we are expected to use the correct technology and know when one is better to use over the other.

I found this talk by Lee Brimelow to be very good and he does a great job explaining the facts in my opinion. As a developer mainly on the flash platform I am really looking forward to seeing HTML adding more and more features and seeing the standards getting better. The truth is … there is always a tool suited for what you are trying to accomplish and you have to make the best choice for you, your clients and the end user.

“Flying Space Rocks” progress – fix for addBody after collision event in CoronaSDK

I have been building a simple Astroid clone as some of you know. Well I found a bug that really stopped me in my tracks. My understanding is that it’s a bug with the Box2d logic that Corona uses for it’s physics engine.

During a collision event you basically crash the application if you try to set any properties on any of the bodies that are being updated by the physics engine. I was able to get a crash by trying to call addBody and also by trying to do something simple like setting X and Y properties on a body that the physics engine was trying to update during the collision.

The fix really is pretty simple and I consider more of a “hack” than anything. You basically have to create an enterframe event and call your logic with in the enterframe function. This basically allows the physics update to complete and then you can act on the objects within the physics engine on the next frame. As you will see I create a local function with in the collision event that runs and then also removes the enterframe that we create as soon as we are done running our logic.

If anyone has a better solution please feel free to post in the comments.

The things that where crashing the app that are now fixed where the following. When a missel collides with a rock I wanted to create smaller rocks and then move the missel that was just used off screen so that it does not collied with any more objects till it is shot from the spaceship again.

Jumpstart Your iOS App Business

Was reading the following article and the second paragraph below pretty much says it all.

Some of the things that I did to jumpstart my own iPhone app business seemed bold and spectacular at the time: I flew out  to WWDC in San Fran to learn the tools, cut my work hours to 50%,  turned down a promotion and I went ahead and created a “business entity” so I could do business in the best way.

However, none of those things are what made me successful: what did the trick was struggling to learn Objective-C, Cocoa-Touch and then spending sometimes 15 hours each day writing and rewriting code until it worked.  Really, success comes down to consistant and hard work.  In comparision, the “idea” of my product was trival compared to the sheer amount of time spent on implementing (luckily implementing is the fun part!).

Particle Candy for Corona SDK by Xpressive Games

Well I figured it was only a matter of time before some developers started building and releasing some pretty awesome tools for the Corona SDK. Enter “Particle Candy”. I personally have not used it yet but I plan too. Something like this should be perfect for the exploding astroids in the game I am building

See more at


Progress on “flying space rocks” using CoronaSDK

Just wanted to post my progress on the mobile development I have been doing with CoronaSDK. I started out building this game in Flixel in the Flash Player. Development was pretty easy and I got most everything ported over but there are of course some differences when it comes to working with the physics in Corona. (thanks Matthew Pringle for the help )

The problem I was running into was how to get the Rocks to fly around randomly and also detect when they move off screen in order to place them on the other side of the screen just like in the classic game. The forums on the ansca site proved to be very helpful after some tweaking on my end.

I am not sure if I am detecting the objects going off screen in a very good manner as there is more than likely a more optimized way of doing it. I am basically using an enterFrame event to check all the x and y locations and then preforming some checks to place the object where it needs to be if it goes off screen. Below is the code for applying the phisics and also my enter frame function that I am using.