Sunday, April 24, 2011

Roaming in jamaica

£6 per MB and it's EDGE, give me strength please.

One flip side this country is a very different to the one I left. But for the most part different for the better.

Going to my grandparents house for the first time in 10 years has been fairly emotional. I'm still expecting to see them around house despite the fact the both have been dead for sometime.

I've compared it to a time machine, as it feels like I've just fast forwarded into the future. One without two people that I had come to know and love so well.

When I landed the lady at customs asked why I hadn't been back in so long (10 years), I'm slowly learning that it's because I knew subconsciously that it would be an emotional roller coaster.

Tuesday, April 12, 2011

Animating a series of images with CALayer

So you want a to animate a series of images, flip book style. While it is true you can use UIImageView, everyone knows that is for wimps. Real men (& ladies ;) ) use CALayer (like a boss)...

But how? Well you might have some how got in your head that CALayer's contents property supports a NSArray of CGImages. Well this is not the answer, remember that the contents property takes an 'id'as a argument so it supports virtually everything under the sun and then some. Hell, if you felt like making crazy things happen you could just throw a NSData object in there.

Anyways, the actual solution is to use a CAKeyFrameAnimation, to manage the rotation of your images, control the frame rate, and ultimately the duration.

Well all is said and done it should look at this

Sunday, April 10, 2011

Drawing text with a Gradient

Problem

You want to draw (unicode) text with filled with a gradient.

Solution

Since my middle name is now "Core Graphics", let me help you out. It's actually pretty simple. Create your desired gradient in a your image editor of choice, and save it as a PNG. Import it into your project and then ...

Yep folks thats it. Now if you find that your gradient is slightly out of place, you can use CGContextSetPatternPhase to help. You of course would use this before your drawing statement. The docs say:

The pattern phase is a translation that Quartz applies prior to drawing a pattern in the context. The pattern phase is part of the graphics state of a context, and the default pattern phase is (0,0). Setting the pattern phase has the effect of temporarily changing the pattern matrix of any pattern you draw. For example, setting the context’s pattern phase to (2,3) has the effect of moving the start of pattern cell tiling to the point (2,3) in default user space.

So when all is said and done you get this lovely effect

text drawn with a gradient Best of all this effect works all the back to iOS 2.0!

Saturday, April 02, 2011

Problem: Symbolicate won't ... um symbolicate.

Long live Crash reports, Crash reports are dead. We all love em right, couldn't live without them. But what happens when crash reports go bad. Sadly this isn't a lead up to a blockbuster movie but in fact a real life issue.

As much as a i love Xcode 4, (and i really love it) it swallows errors that symbolicatecrash script spits out. This caused me to send loads of time trying to fix an issue that i knew nothing about.

Well here's the solution. 

1. Do a project clean in Xcode (cmd+shift+K)
2. Delete the entire 'PROJECT/build' directory
3. Go to ~/Library/Application Support/iPhone Simulator/VERSION/Applications/UUID and delete each folder that contains your application name. Be sure to do so for each Version of the SDK.

And then attempt to symbolicate your reports.

I'm led to believe that some genius (who i'll target at WWDC and buy him/her a beer) thought it would be a great idea to use Spotlight to find dSYM files. Sadly i don't believe they thought (or could) apply any sort of search order, leading to spotlight returning random binaries. (When good ideas go wrong).

FYI. If your a member of the Xcode Team, i genuinely appreciate all the work that you folks put into 4.x.  

Thursday, March 31, 2011

Coming to America

So after managing to avoid the states in all forms for well over a decade it's time to go back. I'll be able to enjoy the benefits of naked body scanners, and requests to show my papers.

Anyways the trip is split into 4 parts, over two months.

A. New York city
B. Jamaica
C. Los Angeles
D. WWDC in San Francisco.

Interestingly, I have no return ticket, not because I'm planning on becoming an illegal (please note TSA) but because I'm not sure if I'm coming back to the UK or if I will carry on heading west, and reunite myself with the Chinese people (they miss me you know).

The first leg is booked for April 18th, so as song says I'll be "new York da da da dada da new York" HOV ...

While WWDC should be a blast the most emotional part will be going back to Jamaica almost 10 years to the date that I left.

Bon voyage

Tuesday, March 15, 2011

Jonathan @ 24

Well would you look at that. I'm 24 years old. Kinda strange I might add. Well being the kinda introspective dude I am, I thought I would look at my highlights over my 23rd year on this planet.

....

Yeah so that's it, fascinating don't you think. But seriously my 23rd year was a good year, and I'll strive to make my 24 th even better, with the usual smattering of travel adventures, odd situations and hard core forking.

Thursday, February 10, 2011

Creating Push Notification certificates that you can use .cert -> .pem

Thanks to this helpful the post, the rest of the world knows how to convert .cert files (the ones the ADC gives you) into .pem files, the ones you need to actually send notifications to apple.

To further aid this, threw together a little shell script that takes two arguements, the certificate.p12 file and the private key.p12 file and creates a apns_certificate.pem file. Saves a bit of typing and also gives you a hard copy of the commands needed to create the certificates

Wednesday, February 09, 2011

From Russia With Code


I had the privilege of travelling to Kiev, Ukraine for Business. For me this was first trip to eastern europe. Thus far i had only been as far as Hambug, Germany. Which even at it's height was in West Germany, and i believe in the UK control area, so it wasn't even that different. I'm writing this on the plane but i expect the culture difference to be close to that of china, but with out the squat toilets ...

In a way this is good prep for me as i've always wanted to ride the train from Moscow all the way to 北京, and maybe even on to Pongyang, DPRK (insert joke here).

The Standout things
* Everyone seems to like drinking tomato juice, in lieu of fruit juice.
* Haven't seen a samovar yet.
* Yes, they drink a lot of vodka.
* You never drink vodka without eating ... unlike the UK
* It's not as destitute as you would think
* A lot of people speak english, especially in service industry.
* My Russian is awful
* It kinda looks like that level from Call of Duty 4 modern warfare, you know, this one, seriously.

Sad i was only there for three days, three cold days, where i didn't go outside much. But hopefully i should go back in the summer so i'll have more to say and show then.






Wednesday, January 19, 2011

Why does Darren Bent cost £18 Million?

I think Bent is good goal scorer, with a proven record. But i don't think he's worth £18 million quid. Thats not an insult, i'm just old school and think that's a lot of money. (I don't think Chris Smalling is worth £7 million either, that is an insult ... to man utd ^_^, thanks Sir Alex we really like Dembele) It's a good question don't you think. I'm no accountant, but lets try and work this out. I'm always amazed at how a football clubs legal people arrive at these figures.and have felt that while they are crazy there has to be some kind of reasoning and logic to them.

It is slightly hard to do this as few things are actually official, but as Rafa says lets work with the facts (that are mostly rumours).

Darren Bent is rumoured to earn £50k a per week, and had 2 years left on his contract at sunderland.

That means that his contract excluding any bonuses or commercial rights is worth about £2.6 million a year or £5.2 million. I believe this should be his 'book value', and the value that would stated on Sunderlands accounts.

Next Darren's move to Sunderland from Tottenham cost £16 million, with a cash component of £10 and the additional £6 million to be paid in various (i assume) performance related bonuses. Now i would guess that a club like sunderland structured the majority of these payments to be done over a period of time, being that Bent only left a year and half ago, they probably haven't paid this total sum yet.

Lastly as reported, a cause in the deal with Tottenham, was that Sunderland had to pay them 10% of his next transfer fee, something they would also need to take into consideration when negotiating with Aston Villa.

So lets do some basic addition with the numbers above

£5.2m (contract)
£10m (purchase price from spurs)
£15.2m

Now lets say that Sunderland have a policy of trying to maintain a profit margin of around 10% margin on player sales, that puts us in a range of £16.72 million.

Now we are missing one thing, Spurs cut. Thats 10% right?

10% of 16.72 million is £1.72 million

Which i assume sunderland passes on to Villa, so we get £18.39 million. If if they can't legally do this £16.72 still isn't far off the headline £18 million figure that we see in the press.

In fact depending on how much sunderland and already paid tottenham in bonus related payments, they might not have even made a profit. Also i dont know if Darren's 50k p/w wage is before or after tax, because if it is after tax, the value of his contract to the club is effectively doubled. due to the 50% tax rate.

Not accurate, not throughly researched, but certainly interesting.

Next, how the hell did they work out 'CR7' was worth north of £70million?

If you got any insight for me please share either on twitter @veritech or in the comments.

Friday, January 14, 2011

OpenGL Docs

I was about to dabble with OpenGL in recently, when i made a horrific discovery.


Happy Friday :D

Tuesday, January 04, 2011

NSNotificationQueue, Coalescing and SIGABRT

So it's one of those days, your steaming along adding a feature and then bam, you hit a road block. Well here was mine.

I've come to love many cocoa API's over the last year. One i've been late to embrace is NSNotificationQueue. What can i say that hasn't already been made clear ... it's a queue for notification objects ... well almost it has one particular feature that makes it totally awesome, Coalescing.

Coalescing is useful for when you want to call a method multiple times but only have it execute it's action once every so often. Since i've started coding for iOS i've been a fan of simply calling [UITableView reloadData] to refresh my table views, it's simple concise and i don't have to worry about index paths etc. However if you are drawing complex cells, and you need to call this method while you process some data you really don't want to happen every single time, the user isn't playing COD, they just want to see their data, and not have it flick around. So in my UITableViewDataSource classes i do this ...


With the handler to the reloadNotification calling the actual reload method. This means that in one area of my app, where i am listening for NSManagedObjectContextObjectsDidChangeNotification (gotta love cocoa conciseness )the reload method gets called just once instead of 10+ times.

Awesome right ....

Well there is a problem, you might have noticed that enqueueNotification: takes a postingStyle. This calculates when in the duration of the run loop the queue will attempt to deliver your notification. Because i want my Run loop to be a free spirit and not care about what my crazy background threads were doing i would usually choose NSPostWhenIdle. Well i did till today.

The problem is the UITableView that this data source is assigned to can be dealloc'd at anytime, and while my dataSource is a good cocoa citizen and removes it's self as an observer before it is dealloc'd the notification has already been assigned it's target and is waiting till the run loop is idle ... read waiting till after my object has been dealloc'd. This of course means the the objective-c runtime attempts to call the reload method on dealloc'd object, and we all know what happens when that happens ... Well i thought i did. I code with NSZombieEnabled on, so in such a situation i expect to see a nice friendly message saying i've sent a message to an invalid object ... I got that message ... sometimes. Instead 9/10 times i got a big, fat, bold SIGABRT.

Oh, but you have stack traces ... um no. When crap happens in the objective-c runtime, you close your eyes and pray that they will go away, well thats what i do.

Anyways the solution was to ensure that notification was dispatched as quickly as possible, so NSPostNow was a much better fit. My professional($_$) opinion is that unless you have a long running object (ie the app delegate) or a singleton, never use the NSPostWhenIdle.

Conclusion

NSPostNow > NSPostWhenIdle
(9 out of 10 times)

Friday, December 31, 2010

2010: My Highlights

Well would you look at that, the year is over already. Before we condem it to history i wanted to have a quick look back at this year.

Float-Right (aka my career)
I've been self employed for entire year! Thats right folks a whole year. In that time Float-Right has really grown. While i'm not quite groupon, and i haven't bought that Aston Martin Rapide yet, i'm happy with what i've been able to achieve in that time. I've had some help mind you, not only in the form of my Mum, who has kept me snug with regular cups of tea, but also my small but loyal twitter following who make up for the lack of work colleagues.

2011 should see Float-Right do more work internationally, not only in terms of client base, but also in terms of where i will physically be located (thats right, i'm going back to Espana!). Also i hope to finally meetup with the rest of the iOS/Mac dev community at WWDC this year. As a result please send me work! Flights to San Francisco, hotel stays, and WWDC tickets are not cheap. Even my budget travel ethos doesn't cover me on this one.

Travel
In 2009 i travelled to China, Hong Kong, Barcelona,Spain & Paris,France. I thought that was fairly amazing. Well i think it's fair to say i've had another good year, visiting Amsterdam( Netherlands), Barcelona(Spain), Sevilla(Spain), Tel Aviv & Jerusalem (Israel).

Despite now being essentially banned from a number of nations thanks to my visit to Israel, my list for 2011 is even bigger. Argentina, Australia, USA, Switzerland, Norway and of course my new home (in the sun), Sevilla.

Moments
Have had a lot of interesting moments and times this year, but here are some of my highlights.

* Encouraging Ezra (@ezrabutler) to take a boat trip in international waters for his birthday ... this was about 1 month before the infamous flotilla incident

* Meeting Joaquin. Not that it was bad, it was just overwhelming.

* Hanging with Jason and his friends in Sevilla, he really helped make that experience amazing.

* My "lovely" trip to sunny barcelona, hint, it wasn't lovely, and it damn sure wasn't sunny.

* Being confused for a homeless person on the streets of Barcelona at 2am.

* Meeting Jonathan/Joe (@improvmonkey), full of interesting facts and views on life, the world, and the babylonians.  I've never met a grown man that can party like that. I can't mention Joe without mentioning some other folks i met on that trip; @ahoova @llan_peer and @guy.

* Amsterdam with the lads, while people find this hard to believe i don't smoke, but that was hilarious. Especially the trip to the park on the last day. Shout out to @andrew_francis & @jai_morjaria. We gotta do that again.

* The sheer number of people that i met in Sevilla, too many to name them all (well i might have forgotten some of their names ... ). Strangely two of my favourites were both Aussies, Amy & Jardana.

* While i also met her in Sevilla, she deserves a bullet point all to herself, Serpil, aka El Professora, the woman that helped beat my spanish into shape, while also showing me what being truly multilingual looked like. She was also a really nice person!

* Buying stuff in a spanish shop in chinese. Absolutely hilarious.

* FOWA after party, that's always funny.

=======================================================
Anyone else noticing that all the good stuff happens overseas ... i'm just saying
=======================================================

* Geeky i know, but i finally purchased my first ever Macbook pro :)... which i put a rather large dent in three weeks later :(

* Living in a hostel(s) for two weeks. It was awesome at first but really started to get depressing towards the end.

* Finally having a piece of published software! Only took 22 years.

* Having a flight cancelled for the first time in my life.

* Watching the sunrise on beach in Tel aviv.

* The way people (who aren't from California) get excited when i tell them i make iPhone apps for a living, (putty in my hands i tell you...)

* My cafe con leche experience ... aka hot milk with a tea bag in it. Priceless.

* Completely stopping Web Development, i can't explain how great that is.

* Meeting the Girls as @andrew_francis and i call them, hilarious night. Good people.

* Saying the Stweetfight app would only take a couple of hours (thanks @samwilliamh)

* Doing a standup like performance for a roof terrace full of germans.

Well that made me smile, if no one else. So lets give away some awards.

My most hilarious moment of 2010 ...
Watching Nykia drop off a chair. Being 2010 it's on video of course

My most depressing moment of 2010
Letting go one of my early clients.

My happiest moment of 2010 ...
I can't pinpoint a single moment, but as the above shows all the time i spent outside of the UK were my happiest times. (i'm still game for the passport swap if you are)

My Saddest moment of 2010 ... 
My grandmothers funeral, never have i shed that many tears in so little time

Goals for 2011
I have many, being the continuously improving sort of person i am, but here are a few.

* Go back to spain (por todos tiempo)
* Go back to China (on my to the DPRK perhaps ....)
* Build a Mac App
* Discover this work/life balance that people talk about
* Go somewhere i haven't been
* Improve my Spanish & Chinese, especially my ability to read the latter.
* Starting learning Arabic
* Pray a little/lot more, at this rate someone might confuse me for an atheist! I'm actually a christian shock horror!

To everyone, best wishes in 2011. Don't forget it's just like 2010, but your older this time ^_^

Thursday, December 16, 2010

Offscreen drawing on the iPhone using NSOperations, CGImage, CGLayer


What?
Creating and or modifying images offscreen or in a background thread.

Why?
Chiefly for performance. The main thread of an iPhone application is usually fairly busy doing all sorts of things. By rendering complex images in the background, you can do all manor of things. In my case I wanted to know how to render an image larger than the size of the device screen, and then save that image to disk.

For my fellow lovers of NSOperationQueue(aka possibly the most awesome class in Cocoa), this allows you to bundle image processing and generation in to NSOperation subclasses or if you like the new hotness a block, and add it to the queue.

How?
Well with a lot of C. If you have ever overridden UIView's drawRect: then most of what is below should make perfect sense.

First thing is first, as we want to operate on our own thread we have to create everything ourselves. Primarily that means no quick calls to UIGraphicsGetCurrentContext().

The key thing to remember is that the drawing coordinates are inverted. This means that CGPoint(0.0f,0.0f) is actually the bottom left not the top left corner. I'm lead to believe this is a hold over from the Postscript drawing system that originated on the mac, and this is how the big boys do it. So stop whining and code.

Nicely it would appear that the UIImage representation methods automatically invert the image, so you only have to invert your coordinates for CGContext drawing calls.

Exactly How?

This is the process
*Create a CGColorSpace
*Create a CGBitmapContext
*Create a new CGLayer
*Get the the CGLayer's context

Draw into the context as you would normally, using the CGContext methods

*Render that CGLayer into the CGBitmapContext
(if you want an image)
*Create a CGImage from the CGBitmapContext
*Convert the CGImage into a UIImage
*Use one of the UIImageJPEGRepresentation or UIImagePNGRepresentation methods to get an image that can be saved to disk or sent over the wire etc.

NOTE: This code will not work unless you have a image named sample.jpg in your bundle or change the assignment to the backgroundImg variable.

Sample code


Go forth and code.

Friday, November 19, 2010

Ultimo Videos de Sevilla

My last videos from sevilla, headed to a Flamenco club with some new folks after my flight got cancelled, enjoy


Sunday, November 14, 2010

End of an era

This morning I found out that my grandmother died. While it's a sad event in and of itself, bares an additional level of significance.

It signals the end of Samuels surname. My grandparents only had girls, 3 of them to be exact. While my surname might be Dalrymple, I identify more with my maternal side of the family, and felt more in touch with that side of my family.

It was also that side of the family that was the first to come to England during the wind rush years, and is partly why I hold a British passport, and thus am able to live in Sevilla.

My grandparents did a lot for me, not only did they raise me but much of my personality and drive developed as a result of their influence. So I owe them a lot.

Sunday, October 31, 2010

Sevilla en el Video

Heres triplet of videos that i've shot on the iPhone 4 since i've been here.This first one is just some kids playing football down by the river.

This second video was taken one evening in one of the many plazas in Sevilla. The locals (mainly students), are doing pre drinks before rolling before heading to a club, or knowing so of them, just simply having dinner!

Friday, October 29, 2010

Day 22

Today was a personal milestone. It signified the longest time I've been away from home in my relatively short life.

Before this china held the record, at 21 days. Now while you could argue that I was in Jamaica for much longer, I was living with my grandparents so it was a very different scenario.

I'm relatively settled now, I know my way around town, my Spanish and more importantly my confidence in my Spanish is improving. I got some friends, most of whom speak English sadly.

How long will I stay for, your guess is as good as mine. But
the sevillianos are wonderful (& beautiful) people, they have awesome food and are really friendly. Why would I want or need to go else where.

Only time will tell, I look forward to the next 22 days.

Monday, October 18, 2010

Are you for real?

I've been in spain for 12 days. During that time i've been looking for a place to call home. My conversations with various parties have usually begun with this.

¿Puedo visitar de habitacion hoy o esta semana?
This is spanish for "Can i visit the room today or this week?" However some of the responses i get back to this simple request are crazy. Take this one for example

 Hello.Jonathan

         Thanks for the email and am really glad for you interest in my  Apartment.I owns the Apartment,My name is [REDACTED] and also want you to know that it was due to my wife's Sickness that made us to leave the  Apartment and also want to give it out for rent and looking for a responsible person that can take good care of the  Apartment, we are not after the money for the rent but want it to be clean all the time .So for now,I am in Benin Republic Cotonou in our new home and also I am with the keys and documents of the  Apartment,we tried to look for an agent that we can give this documents before we left but could not see and we don't want the  Apartment to be used any how in our absence that is why we took the keys and documents  along with us here and as you know that,I and my family are in the Benin Republic Cotonou on a christian mission of God all because of the sickness,so i hope you will promise us to take very good care of the  Apartment but your absolute maintenance of my  Apartment is most important thing.So get back to me on how you could take care of our  Apartment or perhaps experience you have in renting a home.Note that the rent is going to be ( 260 Euro) No extra fees.I will like you to give me a call on this effect to know how serious you are.Hope you are okay with the price  per month with DVD Player, air conditioning,alarm system. The kitchen is fully equipped with all necessary cooking utensils,refrigerator-freezer, four-hob and oven,microwave,dishwasher and washing machine and Dryer and i will want you to get back to me with the Application form below :


  APARTMENT ADDRESS:[REDATED]



            ========  RENT APPLICATION FORM  ========
            ========= PRIVATE & CONFIDENTIAL========  
     
    Also,Pls answer these questions below:
    1)Your Full Name__________________________ ____________
     
    2)Present Address(where you reside now) & Phone
      Number________________________ _______
    3)How old are you _____________________________
     
    4)Are you married ______________________________ _____
     
    5)How many people will be living in the  Apartment ___________________________
     
    6)Do you have a pet ______________________________ ___________
     
    7)Do you have a car ______________________________ ____________
     
    8)Occupation ______________________________ ___________________
     
    9)What is your religion ______________________________ ______________
     
    10)How long are you willing to stay
    ______________________________ ___________
     
    11)When do you intend to move in ______________________________ ___________
     
    12)1 month Or 2 month deposit needed ______________________________ ________
     
    13) Pictures of all the Occupant that will stay in my  Apartment ______________________________ ________
     
    Looking forward to hear from you with all this details so that i can have it in my file incase of issuing the receipt in your name and contacting you.Await your urgent reply so that we can discuss on how to get the keys and the documents to you,please we are giving you all this based on trust and again i want you to stick to your words,We are putting everything into Gods hand,so please do not let us down in this property of ours and God bless you more as you do this. Pls note that you will be viewing the  Apartment from outside and won't be able to inspect the Interior because the keys and the documents to the  Apartment are with me here in Benin Republic Cotonou and It is located on a cool, quiet and safe neighborhood.
     
     
    Thanks and God Bless.
    Regards.
Um, ok. So do you want to take me out into the woods and shoot me too? I thought for a moment, that this could be true story, even though it may as well have had SCAM in the title. Later that same day i got another email from another landlord.


Hola,
La renta mensual es de 450 euros para todo el piso, incluyendo todos los servicios públicos (agua, electricidad,gas,calefacción, Internet, TV,garaje, aire acondicionado, lavavajillas, recogida de basuras). Se puede mover en cualquier momento. El problema es que soy la única persona que tiene las llaves y estoy lejos,en Romania con mi trabajo, pero si sigues interesado podemos tratar algo,utilizando un servicio de efectivo en entrega como TNT, que se encargará tanto de pago y la entrega de las llaves en la manera más segura para usted.
Gracias
Thanks to google translate ...

The monthly rent is 450 euros for the entire floor, including all utilities (water, electricity, gas, heating, Internet, TV, garage, air conditioning, dishwasher, garbage disposal). You can move at any time. The problem is that I am the only person who has the keys and I'm far away in Romania with my work, but if you interested we can work something out using cash on delivery service such as TNT, which will handle both payment and delivery of keys in the safest way for you.

Wow, so apparently everyone in Sevilla goes away and takes their keys with them. Maybe they need an iPhone app for that ...

Tuesday, October 12, 2010

Los Negros

So I've been in Sevilla almost a week. What can I say its a cool city. Filled with beautiful women, nope of whom speak English. But hey I wanted a challenge.

So like all places what makes Sevilla so different from Hemel Hempstead. Well there are a lot of differences. There are no crazy roundabouts, the women look better, and they speak better English... I think the biggest difference is the attitude of the people. People here place a premium on family and community. The focus on work is significantly less and 'hustling' mentality is almost absent. The people here wish to enjoy and their lives. That's not to say I've moved to a society of lazy folks, but they certainly do know how relax. As one person put it 'they work to live, not live to work'.

The search for a place to live is going slowly, I've decided that I want to live with Spaniards as that's the only way I'll improve my Spanish. While it's difficult, nothing worth doing is ever easy right?

What has made this trip a great deal easier and somewhat less nomadic, is the presence of Jason, in his own words the 'original g'. However I prefer a more apt term for the two of us, Los Negros. He also happens to cook a mean steak.

Friday, October 08, 2010

48 Hours

In 48 Hours i've met, and gotten to know the following

6 Aussies
8 Americans
1 Canadian
3 American Iraqi War Vets
2 Spanish Teachers
Several Spanish students
2 Beautiful German ladies
A load of Germans
1 Korean women needing her photos backed up.
1 Moroccan
1 Frenchman

And last but not least, 2 Brits.

Sunday, September 19, 2010

More than just a place in the sun

Every 10 years, that was, and has always been the plan. To move country every 10 years. Next April, will signal a decade back in England, having come back from Jamaica in 2001.

I made this decision In my early teens because I reconized that the world is a big place. My fairly recent acceptance of all things chinese has only strengthened that, not to mention the negative direction I see Europe taking politcally and socially.

While the lure or being a tax exile is not only atractive, but downright sexy, it's the adventure of the unknown that I think atracts me. I often think of my grandfather, in his late 20's boarding a boat to sail to Southampton in the early 50's. Alone and leaving his young family behind to carve out a new life. While I know I'm nowhere near as brave as he was I like to think that what I'm attempting to do is on a parallel with his feat.

As it stands my plan is to shun English, and the lands that promote it as a first language. My first stop is Seville, in southern Spain. I plan to stay there for a few months and relearn most of the Spanish that my old 7 grade teacher taught me. Then sometime before the end of the year make my way to South America and adapt my new found linguistic skills for the new culture. After that who knows.

Unless I take up residency in any one country, I can usually only stay for three months. So the plan is two move around every 2 1/2 months so that I don't end up having Interpol chasing me down.

Having said all of this my plan may fail, and my warm freshly baked semi Latino ass might find its self back on these shores, looking for work. But hey, you can't win if you don't play.

The flight is booked for October 5th, let's see what happens.

Jonathan

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!).