Wednesday, July 12, 2006

Coding. Impress your Friends

Whilst browsing for code examples today I found this gem of a site.

A Full repository of Hello world Programs in almost every language you could think of. Now you too can make your friends marvel at your mastery of whitespace :p
There I go trying to name my first post something clever and avoid the standard "First Post" and now its come back to bite me. Still its given me the challenge of finding some obsure language that they havent got to make the contribution.

Saturday, July 08, 2006

Needs ??

Well after reading this I had to give it a Go
The Kemp Project: Interesting...
Anyway Using Danno Meant I had to Scroll down about 20 pages to give me anything So here's how far I got before I got bored

  • Danno needs to go to jail: I Think not. Im Not a Number im a Free man

  • Danno needs reminding that execution is the key: Now that's more like it.

  • Danno needs help: Yeah, definitely

That was upto 5 pages into google. And most of the posts didn't include the two words concurrently. I was told I was a good German Sheppard though.

So Lets try again using my "Other" Name Dan. Now that was better Got plenty more useful results

  • Dan wants/needs a big beasty car like mine

  • Dan needs medical help

  • Dan needs the love too

  • Dan needs tech support

  • Dan needs an Antenna

  • Dan needs your help in editing his news report

  • Dan needs to make money because how would he pay for all those trips in Ukraine

  • Dan needs a snooze!

  • Dan needs cheese

  • Dan Needs More Red Bull


Well a new car would be nice. But "Big and Beastly" makes me think of the mobile battering rams used on the school run, cant afford a drink let alone the petrol on one of them things.
Medical Help and Love. As long as the two aren't interconnected and I end up with cock rot its ok with me.
As for tech support. I work with computers and know all the tricks to fix them.. Making sure its plugged in, turning it off and back on again, Typing format C: on windows based systems
An Antenna would be cool. Though is it radio or insect like ones out of my head. The possiblilitys are endless but I would have to cut holes in any hats.
I always need help typing reports, Not looking forward to my final year project report, but I cant have help with that.
Trips to Russia though. Possibly something to do with the dial a bride.
A snooze and Cheese, surely a bad combination. Not sure the nightmares would be enjoyable.
Red bull that would help thin the blood in my caffeine system. Therefore averting the need for a snooze and saving me from any nightmares that may ocour.

Friday, July 07, 2006

The Banking system

Why is it that banks are only open during business hours ? Surely all the people you want coming into banks (Like those earning money) are actually working during this time and therefore cannot go to see their "Friendly" manager. So they can pay in or withdraw some of that money they have worked so hard to earn.

Opening between 9 and 5 means that the only people you are likely to get with time on their hands are those that surely would be "Bad" customers for banks ie. Students, Layabouts, wastrels, vagrants, Vagabonds, malingering sods, and the workshy. If I owned a financial establishment I would have guards armed with 50000 MegaHurtz Tazers to keep such people away. Surely the only thing they can do is remove money from you. Giving you nothing to invest to make the shareholders happy.

perhaps it is something to do with the banks not actually wanting you to be in credit. Preferring instead to loan the aforementioned people vast amounts of money that they can ill afford. Quite where this money comes from in the first place is anyone's guess. But we know they rub their hands when they get to take your house in repayment for that "any purpose loan" that's interest repayments are more than your annual salary. I suppose that its easy money and that's why they keep the finantially savvy out by restricting their access.

Thinking of Debt. The UK is apparently in $7,107,000,000,000 worth of Debt (Source: The CIA) If ocean Finance paid off our Debt we would owe a $902,589,000,000 a year in interest Giving us just 7 years before we were back to Square 1 (And that's not compound interest). Be interesting to see them try and reposes the UK though. In fact the same website says that the World Debt is a Staggering $38,540,000,000,000 That is a incredible amount of money. Firstly where the hell has the money come from ? Secondly to whom is it owed ? Having not (to the best of my knowledgeable though it is the CIA website ;-) made contact with extra terrestial loan sharks it means somewhere something which I cannot understand.

You see I can lend you a fiver (if I have one, which I would if I could pay in my cheque so don't even ask) Which makes you in 5 pounds in debt to me. There is still balance in the force as my money hasn't magically disappeared it has just been relocated temorarilay. If I don't have the money to lend you then I could possibly borrow some (though I'm more likely to tell you to go forth) meaning I become a link in this relocation chain. The money still exists and is still the same amount. No body should be able to lend more than they actually have. The debt should just work its way up the chain till there is no more.

So where has this extra debt come from ????? Its either someone has been very creative with the accounting, Aliens or the Banks.

Answers on a postcard to the ususall address

Wednesday, July 05, 2006

The Devilment that is Recusion

Recursion: (re·cur·sion)
see: Recursion

Scarily enough the Cambridge online dictionary or many spell check dosn't have it. Anyway I digress back to the story.

I was having a bad coding day, Trying to implement a binary search which I decided to make recusive. Spent the best part of a hour trying to work out where things went wrong before giving up and scratch writing it with iteration.

Now recursion does have its uses but what exactly is it the best thing for ?
I do like the clean minimalistic code it produces (student printing budget), but the statement that its easier to understand can be argued with. Simple functions can become difficult to trace when you have a big stack of parameters to keep track off as it burrows through the stack then snaps back at you.
Recurive functions offer no increase in performancece, actually reducing speed and increasing overhead as calls have to be made to the stack each time navigatete a level in the recursion.

But beforI i get death by flame. And due to the fact I'm a man of science :p lets look at the facts
Source
Recursion Vs iterationon
  • Neither is more computationally powerfull.
  • They are completely interchangeable. Anything done Recusively can be done iteratively
  • recursiveve algorithms do tend to look better with cleaner simpler code
  • iterativeve functions have less overhead as the calculations are done "inplace"

So Who wins ?? Neither to be fair. It all depends on your approach. If you really dig recursion then you can use it for everything. (Though iterating over a list would be overkill) The same applies to iteration. I suppose its just a matter of preference.

That said recursive code is neater and smaller than ititerativeve counterpart. Meaning it (should) be easier to understand and maintain. The trade off is speed and for some complicated functions algorithm complexity it can really make your brain hurt sometimes trying to work out that algorithm. That's what prompted this little rant in the first place.

Well back to the world of WSN's Till next time

Monday, July 03, 2006

System.out.println("Hello World");

Right then starting my proper blog. The one held by micro$oft is being reserved for the irrelevant side of life, There policy of "following" the correct web standards has also helped with that decision as it is impossible to access via Firefox or on a Linux system, as they "apparently" don't support the html in it ??? Where as I see this as a good way of self promotion. With information on my current projects and important ;-) observations on life.

Firstly got my exam results back. Slacked a little in my second year with the average grades dropping slightly. But all but one is still on the correct side of 70%, the one below is at 69% Damm. But I'm still on line for a 1st so who cares.

I'm now back in the world of "work" having kindly been given a undergrad research bursery from the nuffield foundation. The cogent research group has me working with wireless sensor networks. Implementing some routing algorithms in SenSor their WSN simulation software. Its now week 3 and the real work has started implementing the Rumor routing algorithm. The first couple of weeks I spent learning the software, and managed to get my own protocol up and running. Loosely based on RIP there's too much overhead for WSN but it helped me learn the ropes on both SenSor and Python.

My python "infinite Monkey Simulator" is getting off the ground, hopefully some time soon I will get the net code nailed and turn it into a true distributed app. Then we can see what those monkeys can write. Currently the keyboard presses are at random, which may not be right, If you happen to know any monkey psychologists who can help let me know.

Other projects in various places on the back burner are :-
Clio Cup mod for R-Factor. The physics and external modeling is done. I just got a new "trial" of 3DS Max. So I can get back on with the modeling. Once I finish the cockpit its will be ready for beta testing.

Modeling projects. As well as the car there are various modeling projects in states of disarray. The Tardis is build but needs proper texturing, The time tunnel works but needs tweaking to look anything like the BBC's

3d Engine. Yeah decided to write one of these too. Got DX SDK, Got .NET, haven't got the time. Eventually I will start on it Creating a model viewer for the aforementioned models. Should be good fun.

Till next time, This is Dan, last survivor of the Nostromo, signing off.