Showing posts with label University. Show all posts
Showing posts with label University. Show all posts

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, 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!

Saturday, January 26, 2008

Json Encoding

For a enterprising young developer like myself, i don't take advantage of json enough. So since i'm in the mix at the moment, with my DFTI course work, i thought now would be a good time.

Unfortunately the json_encode() function that i had seen in the PHP documentation, is only in the CVS distributions at the moment (v 5.1.2), so i came up with the below.

PHP

/*
This function converts an array to a Json string.
*/
function jsonEncode( $pArr ){
$arr = Array('{');

foreach( $pArr as $val ){

if( is_numeric( $val) ){
array_push($arr, $val );
}else{
array_push($arr, '"');
array_push($arr, $val);
array_push($arr, '"');
}
array_push($arr,',');
}
//Remove trailing comma
array_pop($arr);

return implode('',$arr);
}

/*
This function converts an associative array to a Json string.
*/
function jsonEncodeAssoc( $pArr ){
$arr = Array('{');

foreach( $pArr as $key => $val){
array_push($arr, '"');
array_push($arr, $key);
array_push($arr, '"');
array_push($arr, ':');

if( is_numeric( $val ) ){
array_push($arr, $val);
}
else{
array_push($arr, '"');
array_push($arr, $val);
array_push($arr, '"');
}

array_push($arr, ',');
}

//Remove trailing comma
array_pop($arr);

array_push($arr,'}');

return implode('',$arr);
}


Both functions take either a regular array, or a Associative and converts it to a json string, which looks like ...


{"id":1,"name":"Ham And Pineapple","description":"<p>Fusce magna sem, gravida in, feugiat ac, molestie eget, wisi.</p>","categoryId":1,"hasNuts":0,"vegetarians":0,"imagePath":"ham-and-pineapple.gif","price":4.95}



The above is just some data from my database. It's a pizza ordering system. I plan to go all ajaxan with a Drag and drop shopping cart, as well as some other shiny stuff.

I haven't a clue what i'm going to do concerning javascript, i'm looking at mootools, mochikit, and of course jquery and maybe even yahoo ui. Might be a last minute thing.

Sunday, March 25, 2007

A Guy, A Mac, and a Linux Distro

So, it's that time of year again. Everyone's disappeared to their various corners of the uk, and i'm left here to contemplate life on earth.
So many people have asked, why have i decided to stay here on my own, simple i got a lot of work to do, plus i wanna take advantage of the gym.

Heres what i got to do in the next three weeks

  • Database fundamentals Coursework

  • Internet Computing Assignment

  • Computer Architecture Coursework

  • OOTM Assignment Assignment

  • Learn x86 assembly

  • Finish the Fat Cheetah website

  • Write & Design a reusable PHP CMS

  • Write & Design a reusable PHP forum

  • Apply for loads of Jobs

  • Do someone else's assignment

  • Cook various people dinner

  • Revise for networking

  • Buy and play with a Treo 680



Quite a lot of stuff if you ask me. I'm only working at maplin on the weekends, so i'm gonna try and give this thing my full attention. In my eyes these three weeks will make or break my course, prehaps in yours too ...


Now if you excuse i have to contemplate whether or not to get a facebook or not.

Quote of the Day
PS3 buyer"I need an optical cable for my PS3"
Me "Cool, how is it?"
Customer"Don't know didn't get any games."

Nice going sony, you get a grown man to fork over £425 quid, and then shaft him and give him no games.

Friday, February 09, 2007

Whats new....

Well since the data disaster, i've managed to rewrite a sizible chunk of code for isolation. However, it's hard work, considering i had done it all before. I've also gone backup nuts, and wrote a back script that i keep in the dock.

In other news, i've started on a light Cocoa project. A Cocoa version of one of my favourite games, Dope Wars. As you've come to expect here's the teaser...




Loads of work as you can see Started yesterday, while watching lost. Now although i love Xcode, i hate this whole idea of connecting the program to the UI. I can see the benefits, but i dislike the way it's done. Sure it's kind of similar to the way things are done in visual studio, but still.

Plus i've started learning about assembly on a serious level, so i'm now learning 3 languages at the same time, as well as brushing up on my C skills, to help improve my ideas on all these new fangled languages. Coupled with this i want to do some proper ruby on rails development, and see what all this crap is about in a production like environment.

Lastly, i've discovered that for all my love of computers macs, that i really don't know what i want to do after i leave university. Web development, is exciting, fairly easy and pays ok, but it's not a challenge. I write CSS in my sleep.... Writing kernel/device drivers looks cool, but how often does one need a new camera driver? Software development looks cool, but things take too damn long. And i'm not keen on all this paper designing either, wheres Visio for OS X? Although i plan to work for no one, and do my own thing, i'm not quite sure what yet.

To sumerize in Objective-C ...
Future = [Me whereIsCareerGoing:currentStatus];


Quote of the Day
Am i too nice, or do i just like thinking that?

Lets put the vote to the people