Jan 14, 2010 by: Colin objectivec, Open Source
Objective C Quick Methods
This post will be updated the more I use Objective C.
Read the rest of this entry »
Jan 14, 2010 by: Colin objectivec, Open Source
This post will be updated the more I use Objective C.
Read the rest of this entry »
Jan 6, 2010 by: Colin objectivec, Tutorial
For the past month or so I've been involved with creating 2 iPhone applications at work. I was the sole developer on the first but worked with one other developer on the latter. Seeing as this was our first experiences with xCode and Objective C, there's a few good techniques I'd like to note when it comes to organization.
Read the rest of this entry »
Dec 20, 2009 by: Colin AS3, Open Source
A "Find and Replace" method is always handy when trying to avoid repetition in code (especially when replacing variables in XML Strings) and so here's a quick script everyone should know:
public static function replaceWord (searchString:String, find:String, replace:String) : String { var wordLength = searchString.length; var result:String = ''; for (var i = 0; i < wordLength; i++) { if (searchString.substr (i, find.length) == find) { result = searchString.substr (0, i) + replace + searchString.substr (i + find.length, wordLength); } } if (result == '') result = searchString; // didn't replace anything return result; }
Nov 13, 2009 by: Colin iPhone, Multitouch, Physics
Nov 9, 2009 by: Colin AS3, Open Source, Trigonometry
I've recently been working on a physics/trigonometry project at home using Processing and memo's amazing MSARemote. In short, I realized I haven't posted anything on Tomorrow Evening in ages, I have a lot of cool things up my sleeve right now, just trying to find time to get all these ideas out. I'll be taking all of Thanksgiving week off to take a break from work and do some fun experiments. If I weren't a web developer I'd turn my internet off for a few weeks, I keep finding such great developers/art online that I start something new every other day and never finish what I was working on the day before! That needs to end soon :P. I know I said I was doing a Processing experiment and this code is in AS3 but I have a good reason why! My wordpress doesn't know how to format processing code and since it's only a few lines, I converted it to AS3.
function findDistance(x1:Number, y1:Number, x2:Number, y2:Number) : Number{ var xd:Number = x1 - x2; var yd:Number = y1 - y2; var td:Number = Math.sqrt(xd * xd + yd * yd); return td; } function findAngle(x1:Number, y1:Number, x2:Number, y2:Number) : Number{ var xd:Number = x1 - x2; var yd:Number = y1 - y2; var t:Number = Math.atan2(yd,xd); var a:Number = 180 + (-(180 * t) / Math.PI); return a; }