Tag Archives: Java

Brainfuck.

Posted by in Geekery Comment on this

No, not me, well okay…kind of me.  However i hope you’ll understand where I’m coming from when you read this

(85-90% of you can stop reading now) While i was programming last week i came across a language I hadn’t seen before, it’s called ‘Brainfuck’ (Real Programming language…)

<geekery>Minimalistic esoteric programming language created in 1993, and only has 8 true commands, everything else it does is only an adaption of such, was invented to try and be a Turing-complete language, with the smallest possible compiler, and it looks something like this

The following code displays fibonacci numbers under 100…

+++++++++++
>+>>>>++++++++++++++++++++++++++++++++++++++++++++
>++++++++++++++++++++++++++++++++<<<<<<[>[>>>>>>+>
+<<<<<<<-]>>>>>>>[<<<<<<<+>>>>>>>-]<[>++++++++++[-
<-[>>+>+<<<-]>>>[<<<+>>>-]+<[>[-]<[-]]>[<<[>>>+<<<
-]>>[-]]<<]>>>[>>+>+<<<-]>>>[<<<+>>>-]+<[>[-]<[-]]
>[<<+>>[-]]<<<<<<<]>>>>>[+++++++++++++++++++++++++
+++++++++++++++++++++++.[-]]++++++++++<[->-<]>++++
++++++++++++++++++++++++++++++++++++++++++++.[-]<<
<<<<<<<<<<[>>>+>+<<<<-]>>>>[<<<<+>>>>-]<-[>>.>.<<<
[-]]<<[>>+>+<<<-]>>>[<<<+>>>-]<<[<+>-]>[<+>-]<<<-]

Hope you join me in saying wthat the fuck…
And in Java

public class Fibonacci {
    public static long fib(int n) {
        if (n <= 1) return n;
        else return fib(n-1) + fib(n-2);
    }

    public static void main(String[] args) {
        int N = Integer.parseInt(args[0]);
        for (int i = 1; i <= N; i++)
            System.out.println(i + ": " + fib(i));
    }

}

To the average person, both of those may look complete bollocks, just thought I’d share my recent findings, feel free to offer your opinions :P </geekery>

More Info…

Ash



Travelling…

Posted by in Geekery, Travel Comment on this

Well I’m placing a reasonably save bet that I’m the first member of hooded badger to post some content from a Virgin Train!

For anybody interested theres Free WiFi on most Virgin services from now until 28th Feb curtsy of Google, sponsored by Google Chrome, which is a fantastic way of promoting their new (proportionally) browser, and trying to increase its market share.  It’s something i do hope they decide to carry on in non-holiday periods, as it’s a service already provided for free by Google in many airports, train stations, and certain airlines (again Virgin Atlantic included).

Anyway, enough about how I’m posting this and more about posting something.  So I’ve stayed up through the night once more, to try and complete a Java Lab/Assignment, with a fairly decent success rate in the end it has to be said, however it’s the second night in a row. not to mention having worked the last 2 days… Oh and deciding to (learn to) play Squash Tuesday, and play 5-aside last night.  Great exercise, not so great for the whole staying awake during the day business.  Alas I resort to Coffee and high energy snacks, Jaffa Cakes.  After all I wouldn’t want to fall asleep on the train and miss my stop :P On an aside how the hell did it suddenly get so cold again, it was -8º in Bangor at 5:30am!

I came across a Motivational picture however that pretty much sums up my mood so I’ll share it with you;

Monty Python.
So thats my mood, excited for this evening, Exams over, Assignments done, New semester/new Modules on Monday, and I’m off out tonight.  There is one thing though, the amount of time i spent on Java RMI’s, Sockets, and Internetworking.  I now want to practice the skills *head desk*

(SleepDeprived) Ash