Sunday, September 05, 2010

DONT BUY CHEAP SSL CERTIFICATES FROM GODADDY!! [Updated]

Update 6/09/2010

Well looks like i was wrong. The actual problem was that the intermediate certificate had not been installed on the remote server. Sorry, Go Daddy. I would like to thank vincent who suggested this, and the GoDaddy representative on twitter @godaddy.

In my defense (Read: covering my ass) i didn't setup up the server, so i assumed that it had been done correctly.

On the upside it's working now :)

Synopsis
Don't buy cheap SSL certificates from GoDaddy if you plan to use them with the iPhone (read DON'T BUY THEM EVA). GoDaddy doesn't use a Root Certificate Authority that is validated by iOS.

How i found this out
For my latest iOS app i was working with in collaboration with some other developers that were building the server backend for the app. Like all good programmers we agreed that communications between the devices and the remote servers should be performed over SSL.

After shipping a beta to my clients, the backend team reported that they didn't have any traces of my app in their server logs. This was strange as i was using my favourite ASIHTTPRequest library. I've used it countless times, so i was fairly sure that i wasn't making a mistake, but logs don't lie.

When stuff like this happens, my first instinct is to grab wireshark, and see whats happening on the wire. Now any 12 year old hacker will tell that you can't sniff SSL traffic, so i made my requests over plain old HTTP. I confirmed that the requests reached the server, were processed and a 200 response was returned. I reported my findings to the backend team, and shipped them a new beta with logging enabled so they could see that i wasn't a complete retard...

And this is where if got strange, they responded that they saw my application report the requests and their failure, but stranger still their log messages where blank. Usually an Apache log entry contains the URL requested, along with a user agent, not this time, there was only a timestamp. After enabling Debug mode on the server, it reported that the connection had been aborted partway through the SSL handshake (1st Clue)

With that obvious clue, i completely ignored that, and used NSURLConnection to make my request instead of ASIHTTPRequest. However my requests over SSL where still failing, returning a nil NSURLResponse object.

The answer (as always) lay embedded in the [NSError localizedDescription]

The certificate for this server is invalid. You might be connecting to a server that is pretending to be “REDACTED.com” which could put your confidential information at risk., NSUnderlyingError=0x2f8c30

So i checked the certificate ... It was of course valid for another year. Ok that was weird. So i googled the error number "NSURLError 1202". It led me to a page on the Facebook developer forums

This error code is know in the iOS world as

NSURLErrorServerCertificateUntrusted

On the page, they mention the phase "trusted root certificate authority", something that i've learnt about from Steve Gibson & Leo Laporte on Security Now.

So i decided to find out the name of the servers root authority, it was a company called valicert.com.
The great folks (you guys better approve this app!!) at Apple have published a list of trusted root certificates and guess what ladies and gents (Drum roll) valicert.com is not there.

Sure enough visiting the URL in the browser presented me a dialog asking me if i wanted to proceed with a untrusted certificate. Now while i can press yes, any user using my application would have to do the same thing, Not a good user experience anyway you swing it.  Hence the headline. The solution is to  splash the cash, and use a more widely recognised authority.

On the flip side this is a massive win for Apple, as it means you gotta use most of the money (that you don't share with me) you've been stealing from peoples accounts using that botnet to purchase your certificate, and fake business address. But seriously hats off to Apple, this should help keep the amount of spoofing on the iPhone to a minimum, well if they fix all the buffer overflows first ...

Hopefully i've saved someones nightmare.
Jonathan

Thursday, August 12, 2010

So i got bored and made a web app part one

So i woke up this morning knowing that i had to ship a beta to a client tomorrow. Now you can't have a beta without a bug a tracker, so i started to looking around. One of my clients uses mantis, which is ok, but i'm not really a fan. It's a little ugly.

I also looked at lighthouse app and some of the others and thought to myself, these are relatively expensive for what i need, plus i can see this scaling to a large number of users in short order.

And lets not forget most importantly i wanted to stroke my own ego ...

My goals are to make a simple tracking app, with support for multiple projects and maybe even some github support :) Also i want to play around with CakePHP's ARO support for Happy Not Happy, so it's a double edge sword.

Monday, July 26, 2010

Application wide Fonts

So you get your nice shiny PSD's from the designer and your ready to tear though the new UI for your fantastic Application. However their is one problem. While the designs look great, the designer has chosen to use non default fonts. 

AFAIK there is no way to change the global default font for your app. So this means that have UILabel, and UITextField, and UITextView instance that you create needs to have it's font configured.

Configure each might take a while but what will take longer is if they decide to change their mind! While i'm relatively young, i've had this happened enough times that i know you should always plan for it.

so ....

This category provides you with some simply methods modelled on the existing UIFont class methods. Now if you couple this category with categories on the other text rendering classes, you have a nice short hand way to quickly render text in the font you want.



So as an example you could create a category on UILabel, and create a class method called labelWithAppSettings. This method would do the following
  1. Allocate and instantiate a UILabel
  2. Set it's font using one of the methods from UIFont+Additions
  3. Return a Autoreleased object
This would allow us to create (Outside of IB) UILabel's across our application with the default settings by calling [UILabel labelWithAppSettings].

Now if you want to use IB (and you should, cause it's awesome, seriously), you either swizzle or use a category to override the awakeFromNib  on the text rendering classes and set font there.

While the above is very cool, i generally dislike using swizzling, or overriding methods via categories in production code. This generally causes your fellow programmers to swear at you while your not there.

Happy Coding



Saturday, July 24, 2010

BBC News app, It's alrite

Now usually i don't blog about anything, but the BBC's new app provoked me. Fortunately not because it's bad but because it's really good.
Now what would make me stand up and take notice of this app. Well there are a couple of things.

Cross Platform design
I've never seen this grid like layout in a new app on the iPhone. While it works fairly well on this size device it really excels on the larger screen of the iPad. However the fact that both versions of the app share this is fantastic, and i think lends it's self well to the branding of the application.

UITableView
Well i first started making iPhone Apps i found the interface for the UITableViewDataSource annoying. Fast forward a couple of years and i love it. What amazes me even further is how versatile the UITableView class is. As far as i can tell that scrolling pane and it's content is all part of UITableView, with each row of cells being a custom UITableViewCell with a UIScrollView embedded within it, Pretty nifty if you ask me!

For all i know they could be using the mythical AQGridView, however i doubt this because of the nature of the "non-grid" content below the "fold".

Now because i'm the only iPhone developer in the world without an iPhone, i have performance issues on my iPod touch 2 gen. However while the app is a little slow i can still appreciate it.

In closing i think the folks at the beeb did a bang up job, well done

Thursday, July 22, 2010

Upgrade your iPhone Simulator to v4

If your building an app your pretty much guaranteed to have to use the iPhone Simulator. However in all the excitement it seems that Apple have forgotten to update the simulator graphics to reflect the fantastic new design.

So i had a little peak in to the iPhone Simulator.app bundle... and then i opened photoshop ... and i ended up with this



Initially the main take away, is that you can upgrade the appearance of your simulator to reflect the device of your choice, however realistically you could replace the image with anything you like.

Incase you want to do this for yourself, follow these steps

1. go to where you have installed xcode, usually /Developer
2. From there goto /Platforms/iPhoneSimulator.platform/Developer/Applications/
3. Control/Right click on the iPhone Simulator.app and select show package contents
4. Open and edit the frame.png image to your hearts content.

For the image above, i used the iOS4 UI mockup PSD from Geoff Teehan

Getting Annoyed so you don't have too

So your starting a new project, and you want to use some of the fantastic features of the three20 framework. Then you get hit with this

Ok, simple fix to this "there is no SDK with the name or path 'iphoneos3.0'" problem, you obviously forgot to set the SDK to iOS4 ... oh, but it's already set ...

Fortunately i'm here to save you some time and pain. What you actually need to do is navigate to the three20/src folder, and open each and every one of the three20 components and set project base SDK to iOS 4.0 and the deployment target to 3.0/3.1.

Once you do this to all the "dependencies", you should find that the project will compile and run just fine. There are few forks on github where peeps have done this for you, however i like to always pull from the main trunk where possible, so i'd rather do it myself.


Happy coding


Monday, May 17, 2010

IPhone OS 4: The multi-tasking myth

I have nothing against apple, from their overpriced consumer electronics to there world class software. But once in a while they really grind my gears, to quote Peter Griffin.

Recently i had a prospective client who wanted to take advantage of iPhone OS 4 new "multitasking" feature. I had to break the bad news to them that there is no true multi tasking,just apis to allow specific things to be done in the background.

And that is the key phase "multitasking api", real multitasking doesn't require an api it just happens. Sure you might need some events to determine focus, but beyond that you just write code as if your app was the only one in existence.

So heres a quick run down of mulitasking on the iPhone. If your application adheres to any of the following use cases then checkout the new 4.0 sdk

Always on VOIP client 
Receive device location updates
Play music in the background
Send messages to be received after a predetermined interval.
Operate for an addition 5-10 seconds after termination.

For everything else the solution is push notifications, Yay!

Thursday, April 01, 2010

You had me going for a sec!

So i'm the Leeds boss, i've just won the Johnstone Paints trophy, and won the league 24 points clear, i then get this message

So i click accept, my chairman is ken bates after all so it's not impossible!

Well apparently it is. Not sure how i'm going to explain that £100 million pound bid for messi. Football's coming home you know!

Tuesday, March 30, 2010

Trends in iPhone app design

I spend so much time developing iPhone apps that I rarely get time to
appreciate design changes in other developers app. However due to my
recent brush with RSI I suddenly have some more time. So here is list
of my favourites.


Finanical times
I love the fade transition that they use when you change the device
orientation. I mean really love it. And from a development point of
view it has a couple of major wins. Namely that unlike the standard
rotation animation, you have a nice delay between the switching of the
views. Ideal if you want to load some Additional content or an
additional view. Granted you would have to do this quickly as you
don't want you user staring at a blank screen while you parse so e XML
or execute a network operation.

Also I assume it's just a case if Animating the properties of the ui
to change the super view opacity to get the desired effect.

Yahoo finance
Loving the charts btw. The Apple UIG generally tells devs to stay away
from displaying multiple types of content. However this app does a
nice job of making it work. This design should also scale nicely to
the iPad.

I have a fetish for finance apps not only because of my forays into
the markets, but unlike most apps they need to deliver a lot content/
information to their users.

The other neat thing about this app is that it give the user control
over the size of the widgets that are display for each security. You
can also swap the arranged ment of the items. Now I guessing this is a
hell of a lot of interface code. On top of the code they are using to
generate the graphs. But awesome ui.

Sunday, March 28, 2010

Mocking Core Location

One of my current project is a location aware iPhone App. It requires the device to "unlock" a location when the user/device is close enough (a couple of hundred meters).

One of the problems with iPhone development is that there is no way to simulate moving around with the device, or to feed it pre made coordinate data.

Anyone that has worked with the iPhone SDK and Core Location knows that CLLocationManager is the primary class that you need to interact with in order to get location updates.

What i wanted to do was to create a Mock Core Location Manager, that would allow me to create a text file full of coordinates, set a update delay, and then call my Core Location delegate methods, so i can manipulate my app as i please.

If your like me you would think that this should be as simple as creating a CLLocationManger category, and overloading some methods, namely startUpdatingLocation/Heading & stopUpdatingLocation/Heading. 

Now this works for most applications, however it doesn't work with the Iphone's native MapKit's MapView. For that we need to use a different callback then the publicly documented method.

There is a little app called Class Dump that generates header files from compiled binaries. Now thanks to the big drive by hackers to develop for jail broken iphones, you can find copies of the headers without having to generate them yourself.

MKMapView uses a class called MKLocationManager as it's CoreLocation Delegate. You notice that it adheres to the CLLocationMangerDelegate as you would suspect, but along with the public callback method 

locationManager:didUpdateToLocation:fromLocation: 

is also has a very similar method called

locationManager:didUpdateToLocation:fromLocation:usingSupportInfo: 

This is the winner. MKLocationManger will not respond to the former, but will respond to the later. I don't yet know what the usingSupportInfo parameter does. But my assumption is that it is a NSDictionary, however in the example i've posted i simply pass it nil.

So time for some code ...



This is fresh out of the oven, i plan to add a timer and exec the sendUpdate method after a set delay and read the locations from a text file. I'll post it up on git hub if i ever get it done


Update 29/03/10
Since writing this post i've put up a working version of the code on GitHub, Fork away

Monday, March 22, 2010

SVG Graphics on the iPhone

A new project came across my desk. The client want to import vector graphics, manipulate them and export vector graphics. No problem i thought.

Well the problem is that there is no native support for SVG graphics. Not one iota! So as a developer you have two choices. Building a JS interface and loading it in a UIWebView or implementing your own SVG parser, and loading the loading the objects as native paths using Core Graphics/ Quartz 2D.

Most smart programmers would go for the former method of course, however if you have complex SVG's you might have a performance problem, as illustrated by this video


Yeah, that performance sucks.



My problem is two fold, my client wants to export the data as a vector. Common sense wil tell you, that importing multiple vectors and then trying to export them again as a vector, in raster/bitmap based container isn't going to work.


So it looks like me and the SVG spec are going to get really cosy. The only blessing here is that SVG's that my client wants to use are fairly simple, so i should need to implement the entire spec.

Sunday, March 21, 2010

Non Global Singletons in Obj-C

Everyone seems to hate singletons. Personally i find them really convenient, but then i'm a lazy programmer. On my latest client app i decided to take a swing at making a hybrid singleton.

Generally speaking, Cocoa coventions (at least in all the documentation i've read), recommendation for sharing object instances across multiple controllers is to make it part of the application delegate. Personally i hate this, as it leads to a congested app delegate full of random iVars. Now it could be argued that if you find yourself in this place your doing it wrong, and in all truth you probably are. But considering that apple themselves suggest placing the CoreData ObjectContext in the app delegate, i think we're in good company.

My solution takes advantage of one of objective-c's many unique features, categories. Categories allow you to add methods to a class without modifing or subclassing. To most non cocoa programmers i just blew your mind, just wait to you find out about Swizzling!

Essentially i define a category on the class that i want to use as a singleton. In my scenario i wanted to have a single CLLocationManager In my entire app. This is because i need to access the devices location on a regular basis, and i want a global accuracy configuration ... and i just wanna try out some stuff :).

Code time


What i have done is simulated the typical method that you would expect to see for a singleton instance, but behind the scenes this method calls a property on the app delegate to get the shared instance variable.

In my eyes the positives to this approach are:
No global variable for the instance.
The Share instance is where you would expect it to me, and if required can be serialized on app exit.
Accessing the instance is as easy as [CLLocationManager sharedInstance] vs [[[[UIApplication sharedApplication] delegate] locationManager]


Lastly, if the internets tell me that this is a wacky idea i can refractor this to classic singleton, without making mass changes to my app. Thoughts and opinions.

Friday, March 12, 2010

Reverse Engineering: Youtube & h.264 for the masses

So a client asked me if he could get a youtube video in their new iPhone app. I replied it should be possbile ... Hence this post

Like any sensible mac user i signed up to the youtube beta as soon as i heard about it. My beloved 2007 macbook is starting to show it's age, and while it can handle 1080p videos without melting (it's sweats a fair bit!), flash videos truly bring it to its knees.

So first thing i did was select a random youtube video, this one happened to be a short about the upcoming indian premier league (i personally hate cricket, but anyways...).

I was immediately disheartened, it wasn't going to be as easy as simply reformatting the link ...


This format is new and exclusive to the HTML 5 beta, from my research the h.264 content delivered to the iphone has a different format, and is served from a different domain.

Domains/SubDomains
Also a quick glance shows that a different series of subdomains are used, and while i haven't tested, i'm guessing these are a series of load balance servers, so there is no guarantee that the video will be on the same server.

Signature(s)
Even more bad news the signature param appears to change on every request, suggesting that it's generated for each session. I tested this, my using the same account to watch the same video, but once in safari and once in chrome, checking the signatures each time.

Signature A
25BF3979A2386835A59AE3DA23076950B6323FB1.670A622C94E87A9192D1CD62885B2589D6EC9A1F


Signature B
B2F0121150A88F697711D19D2F1F8B18EBFC3058.9FE89BCC68B319D255A83A613C84A2040CAF3B2B


Beyond the signature nothing else seems to change. My guess is that youtube will have to open this up when they start to provide video embed tags instead or in addition to the standard object/embed mashup.
Retardation, tells me those are 2 SHA1 hashes separated by a dot, the age old question is whats the plain text?

Conclusion
I'm not kevin Mitnick (Holla at me Kevin ;) ). My minimal security knowledge tells me that the plain text includes a variable that is changing. My assumption is that it user session key, but with no know access to it. (Unless the people aka google are dumb uninformed, which is highly unlikely i assume they encrypt their session cookie).

So for now the h.264 videos are safe :(

Monday, February 22, 2010

CakePHP & User Uploads

The first time i tackled this problem i did the obvious thing, and placed the uploaded files in the webroot folder inside of the app folder. However the key problem with this is that you lose the ability to quickly move the app folder around without fear. This is important for me, as sometimes i'm working with bargin basement hosting, so "cap depoly" isn't always an option. Leaving the quickest way to deploy to simply replace the entire app folder via FTP. (We all have to start somewhere!)

Thankfully cakes media views allow you to specify a folder anywhere on the webserver!

What i decided to do was to make a simple controller called media and route all of my USG images through it.



class MediaController extends AppController {
/**
 *
 * @var string
 * @access public
 */
var $name = 'Media';

var $uses = array();

/**
 * Index action.
 *
 * @access public
 */
function index( $file = null, $size = 's'  ) {

$this->view = 'Media';

$components = split('\.',$file);

$params = array(
'id'=> $components[0],
'name'=> $components[0],
'extension'=> $components[1],
'path' => ROOT . DS. 'media' . DS .'filter'. DS . $size .DS . 'transfer' . DS . 'gen' . DS
);


$this->set($params);

}

}


So the controller looks a little something like this in it's raw form. I'm using the Media plugin, hence the addition folder paths. The key thing to note is the 'Path' key/val pair in the $params array. Notice you can pass an absolute file path! so in theory you could even mount another drive, and serve your media from there, pretty awesome.

This way, i can use a url like this

example.com/media/filename.jpg/l


To get a large image, and

example.com/media/filename.jpg/s


And this to get a small image.

Quite handy!

Sunday, February 21, 2010

Its 2010, Time to blog

For one reason or another i haven't done any blogging in ages. While i was at MWC the other week i decided that i ought to change that. While i don't really have time to be airing my thoughts into the ether, i feel as if i really ought too.

I've had an online property called Russian Space Station since late 2001, If for history's sake alone, The show must go on!

Monday, February 15, 2010

MWC 2010

Is huge. While I have little to sell and even less to buy it's been
interesting so far, and a overal good experience. Sadly none of the
folks that I know personally are here. But this is a different type of
event than what I'm used to going to. I mainly went because the ticket
was free, when yo get a 700 euro ticket for free you don't really
complain. So thanks to the folks from vodaphone.

The scale of this thing is crazy, my legs are knackered and I've only
been here for an hour and a half.

Jonathan

Wednesday, October 21, 2009

Riding down the river

10 tourists are riding down the Yangtze river on a boat. One says to
the other ...

Ok maybe I'll skip the comedy. China is a beautiful country I've seem
so much but I know i've seen so little. I'm not quite sure where this
boat is taking me but part of me doesn't care. In the last few weeks
I've begun to appreciate the romance of traveling the world.

I love work, I especially love my work, and in this day and age of
technology who is to say that I can't pack up my MacBook get on a
plane and become a nomadic programmer sucking down torrents when the
opportunity strikes, war driving in foreign lands...

It's a dream, just like my house in andorra and my grey Aston martin.
However as I'm learning from this trip dreams can come true. Hopefully
I won't wake from this one to find the world doesn't agree with my
plans.

Quote of the week
Tanya "how many Mosquitos are there here?"
Me "12..."

Tuesday, October 20, 2009

Dreams do come true

At the moment I'm on a train to Shenzhen. The clued up among you will
know that this city borders hong kong.

I've had a fasination with hong kong since I was about 7. The concept
of a far flung British enclave full of skyscrapers amazed me.

I remember watching the hand over ceremony in 97 thinking, I would
love to be there.

More importantly I was watching it with my grandfather. I always told
I wanted to go, and perhaps even live there. While the latter hasn't
happened I would like to think that he is proud of me for achieving my
dream.

Jonathan

Thursday, July 09, 2009

Hei se ren zai zhongguo!!

I was thinking to myself yesterday that i haven't blogged about my trip to centre of all of things chinese, china.

I had wanted to blog about my experiences while i was there, but a combination factors, namely i was having to much fun, stopped me from doing so.

My trip lasted 21 days, in that time my perspective and views on the world changed dramatically.

The motif i left China with was:
"Ignorance is dead, long live ignorance". I went to China thinking that i was a fairly open minded person, dismissing all but the most absurd things.

I should preface this by saying that i realise that the china i saw was the watered down westernized version. Any cultured battered by a foreign civilization(US/west) over several decades is going to experience some level of change.

Politics
China (mainland) is very different from anything i've experienced before. First people who call the country a developing nation/3rd world country are misled. Sure there are undeveloped parts of the country, they are called villages. The cities are bigger than anything the west has offer, and in some ways better.

China isn't a developing nation, its developed! It is the new superpower, financially, and strategically. I've admired how the government conducts itself outside of its borders. Slowly buying up resources around the world, in deals that could considered slightly unfair, but are deals not invasions (iraq) backed with questionable events(9/11). This is how the British empire started many moons ago. On the basis of (one-sided) trade, and a mighty navy to protect that trade. The US 'empire' also started like this, and guess who has the biggest naval fleet now?

Having read the above you might think i disagree with this practice. Not really, its the cycle of life, the strong prey on the weak ... The Eagle and the Mouse.

The food
Thanks to china, a new mime emerged in my life, "noodle time". This is basically when my craving for noodles gets to much and i have to statisfy it, with ... Noodles!! Rice noodles, eggs noodles, whatever!

The food is amazing, i would marry a chinese woman, just to get that (the food) on a regular basis. One of my favourites is jian bing which is crepe made with eggs, fried dough (this is the magic), hot sauce, spring onions and some other magic. Best breakfast in the world.

Next up is stir fried noodles, simple, quick and very tasty. If i had to rate the rood, i would give it 10 stars out of 5, i ate like pig.

Shopping
Ever heard of a factory direct store, think of china as one great big one. All of your favourite brands at one tenth of the price if not less. Sadly this doesn't extend to electronics. Well not if you want ones that work, more on that later.

People
Chinese people are really friendly and in general extremely welcoming to westerners. While i was there i was consantly being asked to take pictures with people, and i mean 'with' not 'of'.

Language
i speak chinese right, so that means i should have had no problem communicating right? Not quite, it helped but at first it was awful. The problem with my chinese was that i had a decent vocaburary, but very poor pronouncation. The other problem was that my listening skills were poor, this was highlighted when i conversed with the locals, and they (assuming i was fluent) would reel off something at me! In the latter stages of my trip i could comprehend most of the nouns in the sentence, along with the odd adjective or verb and use common-sense to work out the meaning of the sentence.

The peak of my chinese came in yangshou, where i talked to a rickshaw driver about my iPod Touch, while playing Mahjong. Even got a discount fare out of him, other highlights where drunk bargining with the traders in yangshou and getting a certain polo shirt.

Conclusion
Absolutely awesome. I loved china, and can't wait to go back. God willing i will one day, how long for is just a question of how long they will give me a visa for!

Zaijian

Friday, June 26, 2009

Ah, the sixties


This program made me wonder what is the big thing of our generation. Yes i know that we have the internet, but is that all we get? Might sound greedy but if you think back to the sixties they had colour TV, Jet Airplanes, moon landings etc. Is the current parallel Twitter and Facebook?

As great as the internet revolution is, i hope for something bigger. Sure my pre (When Palm holla's at me) will have wireless charging, but where my lasers, and hover boards!

Granted i went to Shanghai, and didn't ride a maglev train, but that is a trial, and show of chinese showmanship like this, and this, rather than an actual technological revolution, at least in my opinion.

Sunday, May 10, 2009

freaking out chinese people in doha

At the moment i'm sitting in Doha international minding my p's and q's. But i really want to do is freak out a chinese person. When i say freak them, i mean butt in to their conversation, and add something witty. Yes folks, thats how i get my kicks.

Of course first and foremost this is a technology blog. So lets chop up game. The in flight entertainment was pretty awesome, i watched grand torino, and the valkyrie, played a little tetris. But the most awesome thing, (if it had worked) live TV! Nothing fancy just news channels. I guess it's too much to ask for skysports @ 40k in 2009.

Also while at heathrow, i checked out the HP mininote 1k. I've wanted a netbook for a while but i've been hoping pingguo (apple) would service my mobile needs. Oh, just to say again, while my ipod touch is awesome for movies and web browsing(especially compared to this e61), when it comes to blogging, its pants.

i love travelling, don't get me wrong, but would love it even more if i could be playing FM right now ... Dalrymple wins the cup ...

Friday, May 08, 2009

It's over!

Quick post to mention that i've finished my degree! more importantly i that i can get back to doing what i love, writing code (and playing FM).

Heres some extremely basic python for transforming a simple list of CRLF separated values into a sql statement.



def main():
fh = open('list.txt')

sql = open('sqlDump.txt','w')

i = 0
for line in fh:
statement = "INSERT INTO table (name) VALUES ('%s');\r" % line.rstrip()

sql.write( statement )

fh.close()
sql.close()

if __name__ == '__main__':
main()


Nothing special.

Off to china on sunday!!
再见

Tuesday, April 28, 2009

The iPod Touch is awesome

Yes,i finally gave in and got my first iPod. First i must say, that although i still hate iPhones, when it comes it MP3 players this thing is awesome.

Messenging devices need keyboards.

For all intends and purposes this thing is basically a netbook/net tablet.

China (and my dissertation!) is only days away. All i'm lacking now is the camera. 

** UPDATE **
Never edited a blog post in my life, but there is first time for everything, and this perfectly illustrates my point.

This post was short for a reason. I wrote it on a ipod touch. I hate typing on touch screens, i like keyboards. Why you ask? Tactile feedback! A simple beep is great, but imagine, if you could actually press a key, and feel the response from it! Wouldn't that be awesome! RIMM thought the same thing, and created the Storm, sadly RIMM should have stolen a page from Palm, and took a handful of Apple engineers to create the UI. Cause the Storm sucks badly (plus no Wifi what year did you think it was!)

Virtual keyboards not only provide no tactile feedback, but they also take up screen real estate. Granted that in most situations you only need it for a couple of seconds to put in a web address or to send a tweet. If you are from the long form generation, and can see past the reality distortion field (no physical keyboard eliminates the need for multiple skus!! ), you will know that keyboards are just better. Thats why i'm clinging to my e61 with a death grip, it's huge, ugly, but it messages like no other (well until palm pre time!).

Tuesday, April 21, 2009

中國 is calling


I decided to blog from the park today. The primary reason behind this the 18 degree weather. You have to take advantage of this things when you have the chance.

In all the time i've had my beloved blackbook, i've never really used it outside. Quite frankly i don't know why. It looks quite cool(i think) to just sit here, with google reader watching the news and the world go by all at the same time.

At the moment there are two things dominating my mind, well actually three, but i'm only going to write about two.

China,
I'm getting so excited it's scary. Currently i'm waiting to see if the lovely folks in the chinese government will grant me entry to their beautiful county. I'm practicing my chinese often, and my tonal pronunciation is getting better.
I still haven't decided whether or not to bring my mac. I didn't want to, but i planned to have a palm pre in my possession by this time! But if i really want to podcast, and stay fairly connect, and considering that my e61's battery doesn't hold a charge like it used to it maybe that time. Plus i get to play FM for hours, oh the fun i'm gonna have! Just imagine a 22 year old man clapping to a screen at 40k feet!

My degree,
It's almost over i can taste the end, and it tastes sweet. Not quite 草莓 (Strawberry)but nice. There is still a fair bit of work left to do, but all things are possible, and i'm on target. Sadly i doubt i'm going to get a stunning degree, but at this point i just want to be free of academia. But at the time of writing there are only another 2 and bit weeks left, so bring it on. (remind me i said that).

With summer coming up, and hopefully more time on my hands i'll hopefully blog a bit more. It's not like i'm going to be doing loads now that i 'have' to hold down a job, but still if people can have 100k followers on twitter i surely must be able to blog once a week. Maybe i need to but some twiiter integration on this thing! Speaking of integration, The usual summer process of redsign should be happening soon, both the blog and the company site, i need to attempt to be serious, if only for a moment.

再見

Quote of the Day
"The greatest skill you can have as a man is being able to cook"

Mark Udall, One of my lectures

Friday, April 10, 2009

Couch DB as messaging queue

Never thought about it before, but the idea ran through my head while writing my dissertation. Thought i should save it for a rainy day. But it would make a very nice queue. 

Ah, Messaging queues so distinctly british!

Thursday, April 02, 2009

Beijing Bitches

It's booked i fly out on the May10th

My route is:

Beijing > Shanghai > Xi'an > Yichang > Three Gorges Dam > Yangshuo > Hong Kong

I've even started a podcast. The Only Negro In China Podcast. I recorded the first episode yesterday, expect to see it online soon.

Exciting times

Thursday, March 19, 2009

I need to try this

We called it the Rubber Duck method of debugging. It goes like this:

1) Beg, borrow, steal, buy, fabricate or otherwise obtain a rubber duck
(bathtub variety)
2) Place rubber duck on desk and inform it you are just going to go over
some code with it, if that's all right.
3) Explain to the duck what you code is supposed to do, and then go into
detail and explain things line by line
4) At some point you will tell the duck what you are doing next and then
realise that that is not in fact what you are actually doing. The duck
will sit there serenely, happy in the knowledge that it has helped you
on your way.

Works every time. Actually, if you don't have a rubber duck you could at
a pinch ask a fellow programmer or engineer to sit in.

Andy

Andrew Errington src

Tuesday, March 17, 2009

So thats why Java ME is so popular

I have to hand in my EWT (Emerging Web Tech) assignment tomorrow.

Part of the assessment is a look at Development platforms in the mobile space. Until recently native was a dirty word as it usually involved device specific C code. Java has always been fairly popular, but i've always dismissed it for it's non native look and feel.

However, after exploring java ME some more i can see why it appeals to many developers.

The Hello world application is fairly simplistic compared to iPhone, Andriod and especially symbian equivalents.

But we all know that it doesn't hold a candle to the Palm Pre. I would demostrate how amazing the Palm Pre is, however i don't have one yet!

Now if i could just work out how to install the thing in OSX we might be on to a winner!

Lastly the 3 iteration of the iPhone SDK was released today. It's good to see apple can still pull some magic out of the hat. I call it magic, because only in the world of apple can cut and paste be termed as a feature on a smartphone in 2009. FYI i've been cutting and pasting on my E61 for 2 years!

Monday, February 23, 2009

Disseration 101: spanning data across multiple cookies

Cookies have are spec'd to hold a max of 4KB. Thats a lot of data. 4096 ascii characters to be exact. However this is 2009, and my ideas of 'a lot' are laughable. Well since we know that one cookie holds x, how about 2x?

Well thats great, but how do i split data across two structures, and ensure that it remains consistent. Well clearly this problem isn't new, it's been solved in TCP, RAID, and many other situations.

TCP's approach is to assign each segment a sequence number, it divides the load based on the window size and assigns it a number.

But how would that look?
(key:value)
foo=1007; hello
bar=1007; world

the issue with the above is that i have to access random keys to get at the data, so something like the below would be better ...

x1007=foo: hello
x1008=foo; world.

in the above the name of the cookie is the sequence number, the first value is the name of the user key, and following the semicolon, the value. Still a little rough around the edges, but what isn't?

Another alternative, is to cram as much data into each cookie. This increases the amount of entries that could be assign

Friday, February 20, 2009

Foreign living

My trip to Barcelona has been fasinating so far. One of best moments was visiting a local supermarket. It was amazing to be surrounded by people, who all spoke another tongue. It was amazing to have a convrsation with someone else, knowing that everyone (or at least most people), had no idea of what was being said.
It made me really want to live and work outside of uk. i've always felt that i don't want to raise my children in britian, for variety of reasons. So it seems logical that i try to move aboard, but the question is where do i start?

Friday, February 06, 2009

hola! Barcelona

I'm on my way to barcelona at the moment. Its perfect timing really as the weather this week has been crap. So 3 days in relative sunshine should be nice.

Wednesday, February 04, 2009

Jonathan and the social internet revolution

It's 2009. I forget this a lot of the time and find myself doing things circa '00.

Well as of today, no longer. Twittering, flickr posting, facebook ... Stuff (surprisingly doesn't have a verb yet), i should be doing it all.

I won't go as far as to say that the days of isolation are over, however when i find myself giving away my location (using googles new latitude service), you can see why i think this way.

i really want a new phone

Sadly in the mean time, i'll have to deal with just having this (e61) thing. I had planned to get the nokia e71 again however, the palm pre happened. At which point all my funds went right back into my pocket. This isn't a blog post of sorts, just an opportunity to test out blogging from a phone, via email. I was working on a blogger client using python for s60 however, i've just remembered how much fun mobile development is without a decent emulator.

Wow, thats old

Considering that this is the internet and all, i thought i should post this. below was the old text from the about me section of this very blog.
Russian Space Station, named in partial memory of the Fallen "Mir" and that outpost from the movie "Armageddon". I talk about technology, my new life at Southampton Solent University and living on my own @ 18. Subscribe on the RSS or just visit, thanks for popping by.


Tad out of date don't you think.

Are men really that useless: Anglerfish reproduction...

I've always been told that men are useless, however this takes the biscuit. This is how anglerfish reproduce

When he finds a female, he bites into her skin, and releases an enzyme that digests the skin of his mouth and her body, fusing the pair down to the blood-vessel level. The male then atrophies into nothing more than a pair of gonads, which releases sperm in response to hormones in the female's bloodstream indicating egg release.

Sadly i know men who are about as useful as this...
Source

Anyways I'm gonna try and liven up the blog, one post a month/2 months is crazy, this is web 2.0 right. Daily journal returns ...

Quote of the Day
Josh "After i'm done swiping my visa, I'm gonna ask them what their flavour is?"
Me "What do you take this thing for, Baskin Robins!"

Grown women taking their clothes off, seems to have a strange impact on people.

Wednesday, December 31, 2008

2008: The Year in Review

In keeping with RSS tradition, i felt that it was only right to look back at the year. Review my highs and lows, my victories and failures, and highlight anything else that took my fancy during 2008.

My highs of 2008

FOWA London 08
My first tech conference. It was a great experience. I met a lot of people that i would never have met otherwise. It also gave my twitter account a reason to exist. However, the best part of it was being surrounded by other people that knew what i meant when i said something, and more to the point, said things that went completely over my head. Part of me would like to go to the miami event, however not sure if i can slip it in given my workload.

Netro 42
Having been locked up as ASP programmer, i have to thank the folks at Netro42 for letting me break my professional PHP duck. However thats not the only reason that i enjoy it, it also gave me a chance to work with a smaller (not quite startup) company, and see what that is like. Best of all i got the job via facebook!

The return of a friend
One of my best friends had changed over the summer of 2007. Don't quite know how to describe it, but they were different. Anyway, when they returned to uni in 08 they had returned to their old self. It was like getting a whole new friend.

A New friend
Sure i met loads of people during the course of 2008. However some stick out more than most. This year that person was Yasmin. Don't know why, but we just get along really well. Like my other friends i'm blessed to be able to meet nice people.

Fulham/ Jimmy Bullard and Roy Hodgson
Amazing, simply amazing.

Working with Non-Brits
Thanks to FOWA, i got to work some nice guys from holland. Unfortunately our project, an iPhone application hit a snag, and won't be rolling out anytime soon. But it was one of my long term aims. I'm now really considering moving abroad to work.

Chinese Speaking
Ni Hao, wo shou zhongwen! Never thought that would happen, but it did in 08.


My Lows of 2008

Amit going home
This was a sad moment, just because he had been a constant character while i've been at Uni. Part of me felt responsible for not trying to help him more. But hopefully his absence won't be the end of our association.

Looking for work
This sucked. Full stop it sucks, ultimately it had a positive outcome. But during the search it sucked.

Wanting to leave uni
After returning from the summer break, i felt that uni had run it's course. Having tasted the big bad world, i wanted more. Maybe it was the paycheques going to my head, or maybe it was something else. But after moping around, and being told i'm a fool by most people i decided to stay, and look i'm writing this post now ^_^.

Some of my standout moments of 2008
  • Tunde smashing a window when manchester united won the champions league.
  • Quickly followed by a random guy dancing and screaming in our house.
  • Being mistaken for a homeless person
  • Helping Joel home after a messy evening envolving a bottle of rum
  • Meeting Lorenzo Barbosa
  • Working on the Kings Road, Ahem, Chelsea Ahem, West London Ahem.
  • Spending £80 on a coat, never thought i would see the day
  • Not buying a single piece of tech this year, although not without trying (thanks expansys).

Overall 2008 has been good to me, the lord has been good to me. Despite my attempts to mess things up via over thinking, and who knows what else, i'm still alive and well.

Targets for 2009
  • Travel
  • Go to China/Hong Kong
  • Start making some damn software already
  • Be slightly less boring (seriously)
  • Get closer to God
  • Learn another language
  • Read more
  • Speak my mind more
How many legs does a dog have if you call his tail a leg?' The answer: `Four, because calling a tail a leg does not make it a leg'
One of Abraham Lincoln's favorite riddles

I love high brow quotes as much as the next guy, but it wouldn't be the same without some of my favourites from the year...

"Chamonsters" - Yasmin
"All Right, Dear Diary, Jackpot" - Family Guy, Tunde, Josh, Jai
"Wee Ooh Wee Ooh Wee" - Lil Wayne, Ms. Officer
"Manage Expectations" - Any office anywhere
""


Tuesday, November 18, 2008

Objective-j is amazing

I got bored in the library today, so I decided to check out objective-j. In a word Amazing. It's objective C in the browser, not like it, it is actually it, down to the @at the declaration of a string.

Unfortunately I've got nothing to take advantage of it at the moment, maybe in the summer/ rest of my life

Sunday, November 16, 2008

Javascript client storage library

So thats my dissertation topic. It's out there for the world to see. Up until very recently it was GIT GUI client, however after checking out GIT GUI my ideas seemed redundant, and wasteful.

So the plan is to develop a client side storage wrapper/ abstraction independent of any of the major is frameworks. Light weight wrappers can then be built modeled on the singleton pattern, for the various libraries. The library would have a "storage provider" interface , therefore as technologies are introduced new providers can be created. Initially I plan to create 3. Cookies, flash, & HTML 5 session storage.

As I'm typing this on a iPhone, I'll stop now. But rest assured I hate this thing.

Monday, November 10, 2008

IPhone livin

My brother was kind enough to lend me an iPhone.

At the moment it's just to test out my new iphone app. But I really don't think that apple will be seeing my cash on this front. As I learnt with my palm, touch screen keyboards dont compare to regular qwerty ones. Sure you narrow skus, but the difference in typing speed is to much for me.

I will say that the interface is just as amazing as it looks. But this thing still needs some work

Sunday, November 09, 2008

Jonathan, The stock broker

First of this crap is gambling, don't let anyone tell you any better. With all the flashy screens and graphs you may think it's not, but when you really think about it, thats what it is.

My inspiration was Warren Buffett, he said

Be fearful when others are greedy, and be greedy when others are fearful


Greed is what ruins anyone, control the greed and the success will come (in theory). So first your wondering where did i get the cash from, well i had planned on buying a new laptop, but it didn't really make sense. So instead of just handing over the cash to apple, why not try to do some proper investing.

I'm a firm believer in not trying to be too clever, there is only one sector i really know anything about, Technology. I planned to do a mixture of short term buys combined with some long term investments.

Sensible Investments
Apple or AAPL was one of my long term buys. Currently trading at sub $100 only a few months ago this stock was floating around $200. The company has low debt, and good sales, so it sells itself.

Sun or JAVA is a little more of a risk, the stock is trading low at the minute, mainly because of the credit crunch (read: can't borrow cash to buy servers), so there is a fair chance we might see an upturn in the next few months.

Crazy Ones
Lehman Brothers LEHMQ, first your thinking, but they went belly up. Yeah, they did, and there stock is trading at $0.067. Tempting ....

AIG, This is a stock that at one point as $70 it's now $2. What's the worst that could happen? But seriously, they have over a Trillion dollars in assets, and their stock is in the tank thanks to losing $8 billion in the last quarter.

RBS, This is an example of the fact that i actually know nothing. I picked RBS in my google finance portfolio about two weeks ago. at the time it was £0.90. At the moment it's £0.64, i lost 28%! Theoretically! Dangerous game this

One Day
Berkshire Hathaway BRK.A. The company of the great Warren Buffett, it's 1.55 million shares trade at $113,000 each!!! Just a tad out of my league.

Basically this stock thing is crazy, extremely risky and a money pit, but i can't wait to get my hands dirty (not in an Enron way!).

Good luck to any fellow investors.

Wednesday, October 15, 2008

When did it get this bad?

When did it get this bad? Just as well i'm Jamaican

Quote of the Day
Simon: What you getting?
Me: An iPhone, worst thing is i don't even want it

Damn Apple and closed market tactics

Monday, October 13, 2008

FOWA: My thoughts

FOWA was actually amazing. I highly recommend it to anyone who, like myself doesn't have a hardcore programming team to socialize with. One of the key benefits for me was meeting other people, the talks were good, but the networking was better.

Francisco Tolmasky
My highlight was getting to talk to Francisco Tolmasky. He is part of the team behind 280 north, popularized for its 280 slides app, and for bring Cocoa to the web. It was fantastic to talk to someone, who is trying to take the future of the web in a particular direction, and having the opportunity to understand that vision first hand, and be able to interact with them.
Plus it was a chance to talk to a not only a (former) member of Apple's development team, but also to man who's work can be found in many pockets, far and wide, as he was part of the mobile Safari development team.
Perhaps the most interesting thing for me was discovering that he was actually head hunted by apple. He had submitted patches to Webkit, and seems that the overlord was watching and gave him a call.

Jason Calacanis
I also got say hello to Jason Calacanis. He gave an insightful talk into his hiring philosophy. Essentially he advocated dumping average performers, and employing only good and excellent staff, arguing that there work output is significantly better than that of a mixture of average and below par employees.
I partly agree, however from a emotional stand point i think i would have a issue with sacking folks just because they're not amazing, however it could be argued that i wouldn't have employed them in the first place. My theory is that unless your smarter than me, it's not gonna work out.

Live Diggnation
Alex Albrecht is actually really funny in person. I never realized just how funny he is until the diggnation taping. His timing is fantastic.
Personally i'm not the biggest fan of Diggnation, however it was fun, i certainly wasn't screaming and diving around for prizes, but it was good fun.

Adobe Air
When i had first heard about this i thought it was gonna be amazing. However the need to install the framework put me off. However adobe has discovered that no one wants yet another shockwave/flash/sliverlight situation, and you can now bundle the framework with your app. I spoke to nice guy at the conf who explained to me all the cool stuff i could do, and answered all my questions. Air looks like a serious competitor to traditional (does a traditional web app exist?) web apps. The ability to run offline, and completely independent of the browser is temping, a great use is for forms in corporate setups, (read oracle forms and it's siblings are dead). Look out for some air apps in the future, however first i gotta work out how to get the application.xml file to work correctly!

New Project(s)
One of the main reasons i wanted to go to FOWA, was to borden my horizons, and thanks to my new dutch friends i did just that. I've been commissioned to make a small iphone app. This is ideal as i wanted to do some work with the iphone, but i had no iphone, and no ideas.
Since i get to do some iphone work, and i'm not really scared nor care for apples legal team, i'll try to publish some samples as i explore the SDK.

Macs and more Macs
I knew that macs where popular among my kind, but damn! There were too many, i almost felt sick. I would have loved to see a photo of what the audience looked like from the stage, it would have just been a sea of apple logos. On the note of Mac laptops, the new ones come out tomorrow, i think i might have to drop a G ...

All in all FOWA was great, I'm tempted to go to the one in miami in Feb 09, however the whole idea of a conference in miami doesn't really seem like work. Plus i'm a third year now, i can't be flying around the world 'networking' ... can i???



Ignacio: To follow a testing methodology?
Me: Nah, not really.
This is why it is important to go to conferences!

Saturday, August 09, 2008

Getting the file size before upload with Ajax

One of my new projects requires users to upload pictures to our service. The problem is that everybody and their mother has a 7.2 Mpx camera. After some wikipedia research i discovered that jpeg photos are encoded at maximum of about 8.25 bits/pixel. (don't write me about decimal point bit values please :) ).

So out came the pad of paper (and calculator)...

(7.2 * 10^6) * 8.25 = 594 * 10^5 [bits]

(594 * 10^5)/8 = 7425000 bytes or 7.1 Mb per picture

Now i wanted to limit the users to 1 Mb per picture, and wanted them to upload numerous ones at that. Now from a usability point of view it would be a "epic fail" if uncle Roy waited for 5 minutes while his picture uploaded, just to discover that we won't accept it because it's too big.

Now, I imagine your saying that this problem has been solved, it's called a flash uploader (or sliverlight depending on who you get your checks from). However there is a new solution, doing file size checking without flash, using only ajax.


Thats right ma, no flash. Firefox 3 has introduced something new to our world. It's called the filelist Object. Lying deep within in it is a property called (drum roll please) fileSize, and you can use it like so...


Javascript

//Only works in firefox 3
//i Used jquery to do a dom lookup
//However you could do the ol' fashioned window.document.getElementById()
fileSize = $('#fileInput')[0].files[0].fileSize;


It returns the size of file in bytes as an integer! 

Hopefully you've learnt something new, i certainly did. I have a plan to get a similar technique to work on all browsers, however at the moment i'm being thwarted by browser security issues :(.

You can get all the files over at the lab

Andrew Carnegie
A man who dies rich, is a man who dies shamed

Wednesday, July 23, 2008

OSS: Python webpage link checker

Another piece of python to go. Nothing special, but something fairly useful that i've thrown together. 
The following code samples are released under the terms of the GPL 2.0

It's URL link checker, it's not fully recursive (working on it, they don't teach recursive algorithms on my course). But checks all the anchor tags on the given page, returning warnings and the like depending on what it finds.

Usage: To use this just run it like so "python [scriptname]"
It will then ask for the url of the page you wish to check, and then it will print a report, like so.

Python

#Link Checker
#Brazen attempt to write one in 15 minutes
# Jonathan Dalrymple
# July 15,2008
# Start 11:52
# End 12:35

import httplib
import sgmllib
import re

#HTML Parser
class LinkChecker( sgmllib.SGMLParser ):
def __init__(self, verbose = 0):
sgmllib.SGMLParser.__init__( self, verbose )

self.linkList = []
self.inLink = False
self.lastHref = None
self.hostName = None

print 'Parsing file...'

def parse( self, fileStr ):
self.feed( fileStr )
self.close()

def start_a( self, attr ):

#Show user that the parser is working
#print '*'

self.inLink = True

for name, val in attr:
if name == 'href':
self.lastHref = val

def end_a( self):
self.inLink = False

def handle_data(self, str):

if self.inLink:

tmp = self.__parseUrl( self.lastHref )
self.linkList.append( (str,tmp['host'],tmp['path']) )

def __parseUrl( self, str ):
ret = {}

#slice of preceeding http
#if str[0:7] == 'http://':
# str = str[7:len(str)]

# Extract path regex "\w+\.(\w*)\.(\w{2}\.)?(\w{2,3})"
m = re.compile("\w+\.(\w*)\.(\w{2}\.)?(\w{2,3})").match( str )

if m == None:
#print 'Error in handle url, regex failed'

ret['host'] = None
ret['path'] = str
else:
ret['host'] = m.string[0:m.end()]

if m.end() <>
ret['path'] = str[ m.end(): len(str) ]
else:
ret['path'] = None

return ret
#Check link
def __checkLink( self, displayName, host = None, path = '/' ):
if host == None:
host = self.hostName

#slice path and determine if it is a full url
reqObj = httplib.HTTPConnection( host, 80 )

#print '---Requesting %s' % url+path
reqObj.request('get', path )

response = reqObj.getresponse()

if response.status == 200:
retVal = "SUCCESS |%s returned %d" % (displayName, response.status )
elif response.status == 404:
retVal = "FAILURE |%s returned %d, (%s)" % (displayName, response.status, path )
else:
retVal = "WARNING |%s returned %d, (%s)" % (displayName, response.status, path )

return retVal
def testUrlParser( self, list ):
for u in list:
print '--' + str(self.__parseUrl( u ))
def runReport( self, urlStr ):
urlDict = self.__parseUrl( urlStr )

if urlDict != None:
self.hostName = urlDict['host']
req = httplib.HTTPConnection(urlDict['host'], 80)

req.request('get',urlDict['path'])
response = req.getresponse()

if response.status == 200:

htmlStr = response.read()

self.parse( htmlStr )

print "%d links found" % len( self.linkList )

for v in self.linkList:
#print v
print self.__checkLink( v[0], v[1], v[2] )
else:
print "Download Request for %s failed: %d" % ( response.reason, response.status)


def main():

#urlStr = "http://www.google.co.uk/search?hl=en&q=bar&btnG=Google+Search&meta="
urlStr = raw_input('Url you wish to check:')
if urlStr != None:
bar = LinkChecker()
#foo = ('www.google.com','http://www.google.com','http://docs.python.org/lib/lib.html','docs.python.org/test')
#bar.testUrlParser( foo )
bar.runReport( urlStr )

if __name__ == '__main__':
main()


Quote of the Day
I now finally understand why those guys buy £100,000  cars, only to sit in traffic. It's because they remember the days of running for the train, only to find that it's standing room only and their new best friend is a significantly taller gentleman's (or lady!!) armpit and or sweaty back.

Realizations, Andorra here i come

Thursday, July 17, 2008

20 hours, count it if you haven't got anything better do.

In a few months i'll be going to china. I'm led to believe the fight is like 20 hours, making it the longest of my life. I honestly have no clue what to do in that time. A second battery for the macbook is essential, however beyond that what do i do! Count clouds, see if i can work out where i am, sleep...

On another front, i got a job or contract i should say. Working for netro42 in london. I must say i love it there for a number of reasons.
A. I have a 4 core mac pro and 23" cinema display
B. I get to use osx to work
C. They have flexible working times ie 10am is just fine with them.
D. The office design is ultra modern and open plan.
E. Management are the development team!!!!
F. The people aren't too bad either.

There are a lot of lessons which i plan to take out of this and apply to my own company once i'm free of uni. But its been a good experience thus far.
Quote of the Day

Caption

Saturday, June 21, 2008

Facebook Chat

This started as a long post, but as i am learning actions speak louder than words

Monday, May 19, 2008

Backrow, Thats a big ass framework

Some months a ago i spoke about front row. First, the plan was to reverse engineering it, then it was building a plugin for it. Well, it hasn't exactly had my complete attention, however it did drift back into my mind today.

The main sticking point for me has been the lack of documenation, however this should be expected considering that we're talking about a unsupported framework, from one of the most secretive corporate entities in existance.

So in my quest to write for leopard front row, i decided that a nice class diagram would come in handy, easy right...

Well this is what it looks like, after exploring appoximately 30-40% of the 500+ classes!

However i've learnt alot about naming conventions and framework layout. The most striking thing is the level of depth. For example there are classes for everything under the sun, like the Entry of IPv6 addresses. Stuff i personally would have overlooked. I guess thats why i get the semi-big bucks.

Needless to say the folks at apple know how to design a framework, and have done a great job in the absence of namespaces, to provide rigid catagorization of classes.

Class names are nice and logical, for example any class ending with 'layer', is most likely a subclass of BRRenderLayer, eg. BRListLayer or BRTextMenuLayer.

The experience has also made me feel like i've been using the framework, rather than an outsider, looking in. So hopefully in the coming days i can actually leverage this thing to do something other than allow me navigate tv series from the comfort of my bed.

Quote of the Day
"It's a pitty they made so much fuss about gay cowboys, it's actually a decent film"

I happen to think brokeback mountain is a half decent flick