Saturday 21 May 2011

Jobs

With the close of my AI BSc in sight, I've started making plans for what's going to happen afterward. I'm not having a ceremonial graduation because I'm a cheapskate, and likely to have been bored to death by it.

Exams are on 24th, 27th and 30th of this month, and I'm actually fairly ready for them.
I've been looking through job offers and telephoning around, have had a couple of phone interviews and been talking with agents. The most promising position so far, is for a python/javascript/django developer in London.
After I started searching for jobs, I anticipated a move would be necessary, but it's a fair way away from Aberdeen.


Onward and upward...

On the 27th, I've got a phone interview with another company who may want me for a Java role, accompanied by a coding test over a collaborative text editor. For that, I'm pretty damned nervous in all honesty.

I've had an interview for the first company already, which went pretty damned well. They've now invited me down for a face-to-face interview on the 31st - a day after my last exam. It's probably going to end up being on a plane or an overnight train.
 


I didn't manage to make the ARM position, not sure why.


Ah, well...


Not much time lately for messing about - I've been studying my arse off for the coming exams, specifically my 'Computer Games AI' course, a lot of the material is shared with my Higher exam, back in secondary school.

There was also a period when it felt likely that I'd get a position in France, so I decided to crash-study French. It was easier than I thought, and I found myself to be potentially very good at languages. Sadly, I've forgotten most of what I learned that day. I'll get back to it at some point.


Lee.

A rant about iPads

I've got a friend who's Macbook pro recently died without warning.
Apple were willing to replace the dead motherboard for about £419. A fair bit, for a 4/5 year-old machine.
Also recently, the same friend acquired an iPad 2 for the price of £500.
He says he's looking for a new Apple laptop to replace his old one, 'To do university work on'.
So, I thought: he just forked out for an iPad 2 - Isn't there an app for that, or something?
I'm serious - you buy a computer, but it can't do quite everything that a normal machine can do, so you have to buy one of those, to make up for the deficits of the first one.

If he can't write and compile code and write reports on his iPad 2, what the hell is the point of the unit?

Steve Jobs cites the iPad as a 'missing link'-device, 'bridging the gap between netbooks and smartphones.'
Some iPad proponents accept these deficits, and attempt to justify them with claims fitting the form of: 'But it's not a computer, it's an appliance - it's not meant for serious computer users, it's meant for people who want to do light tasks'.
(For such a discussion, read: http://www.geeksix.com/2010/01/the-really-big-point-that-ipad-haters-are-missing/)

I'm going to summarise the point made by that page in my own language:
"The iPad can't do things, not because it's a 'weaker'-type of computer, but because it's not a computer at all, and as such, it's not supposed to do these things. Also, anyone who still doesn't understand is a stupid-face who is unable to grasp subtlety and good design!".


What Apple have in fact done, is take a successful product(The tablet pc, a dubious device for a normal user anyway), remove features that most people don't use, and market it as a separate 'kind' of device.

But the iPad isn't even that good. It omits features that normal people(even novices) DO want, such as an SD card slot, a keyboard and a USB port. I know that these things are available as addons, but the dongles look bad, and when attached, remove some of the device's actual selling points(Nice shape, pretty finish, and self-contained appearance).

It also seems to actually require the presence of a 'full' computer, running Apple's iTunes application to update iOS.




The argument that the iPad is 'not a computer in the normal sense', presented in the article on http://www.geeksix.com doesn't hold water, because:
  • The purported use of the iPad is exactly the same as the use of a normal desktop/laptop computer most of the time, for many users. We know this is true anyway, or there would be a real lack of user-base.
  • Addons exist which allow the iPad to duplicate much of the functionality of modern PCs, such as an SD card adaptor, USB adaptor, and addon keyboard.
  • There is an online repository of free and paid applications available for the iPad. In it's stock state, the iPad is perfectly capable of 'normal-person-tasks', such as playing music, social networking, web surfing, email checking. In fact, i'm surprised apple even have an app store, considering how much it detracts from being different from laptops/desktops/netbooks/smartphones.

The iPad is not another class of device. It's mostly a normal computer. It's a hardware/software combination which can carry out tasks.
The iPad is designed to create a synthetic market segment, it's OS is simply another platform, separated and incompatible with others already in place such as OS X and Windows.

Many-an-ignorant-user has presented me with the same argument in fact, for Apple's desktops/laptops - that they aren't meant for 'power users', they're 'just for normal people who don't want to know how computers work'. This is more obviously flawed than the similar iPad argument, I believe, due to the larger, more open ecosystem of applications available for OS X, when contrasted with that of iOS.

In fact, I'll bet that if the device survives, we'll start seeing IDEs and other similar tools which aren't for 'normal people', running on some incarnation of iOS, before long.

I think I've been quite good here, in that I've avoided poking the normal holes in apple products, like 'delicate' or 'overpriced'.
This has been more of an attack on the philosophy/ideals held by Apple and some of it's users.

If you disagree, show me your worst in the comments, I look forward to reading them.

'Til next time :)


ADDENDUM:
If you do feel like swapping £500 for something with a touch screen, may I recommend the Dell Inspiron Duo

Wednesday 4 May 2011

A driver

I've always been fascinated by the Linux kernel, mainly how so many drivers and bits get written into it with so little 'real' documentation. Some of it's there, scattered across the web. I've yet to find anything as comforting as a Linux kernel doxygen manual.
The closest thing that's currently up and running is LXR (http://lxr.linux.no) - a sourcecode viewer/search site.

I've been holding off from actual kernel hacking for a long time (this is mainly down to intimidation), but yesterday I finally bit the bullet and started reading source code properly and trying to understand it. And turns out, it's not so bad after all. To prove it, I wrote a simple proc file driver: http://fluffy.bizarrefish.org.uk/sync/fun/lee.c


Toodleoo. I'll have something big to write about soon, I imagine.

Friday 29 April 2011

Ubuntu Natty - First Impressions

I managed to remember to try out the new Ubuntu 11.04 on the day of it's release, so I grabbed an iso and booted a flash drive up on my bog standard Acer lappy (Intel T4200, 4GB RAM, nothing special).

The thing that hit me hardest has got to be the new 'Unity' interface. It's pretty, waay prettier than anything else - the smooth sliding of the 'dock' on the left, the practically edible buttons thereon.
I know it doesn't sound like much, but that's the point. Unity is pretty damned lean.
Touchscreen-friendly; The buttons are big, and the 'left-click' context-menus are kept to a minimum. It almost makes me want to fit a touchscreen in my laptop(I WILL do it).


It's not too slow, either. I'll play around with it some more, but it seems more than adequately zippy on this no-frills machine. I'd be interested to see how unity would perform on my HTC Magic.
But there's little point to that until I can get Xorg accessing the framebuffer (the FB driver in the android kernel needs a fixup to work with Xorg (Or Xorg needs a hack (Oh, 1 sec...just found this:
http://wiki.meego.com/ARM/MSMQSD#MSM_XOrg_driver))).


And that's the end-a'-that chapter...

Saturday 23 April 2011

Done done done :D

Just a quick update;
The data extraction project is finally over!...well probably not -
I imagine I'll have something else to do for it before long, but the database is now sane(as far as I can tell), and filled with specs for about 600 laptops. W00t!

Now, my AI project - still haven't done much on it, but have been reading up on Turing machines/FSMs a bit, and have been awestruck on multiple occasions by the genius of Alan Turing and Alonzo Church - These guys were unbelievable.


Toodle-oo, folks.

Friday 22 April 2011

Work work work

Just finished a large lump of code for my university group project's data-extraction job.
The data for 1500-odd laptops has left the HTML and is now in MySQL INSERT queries, ready to be loaded into the database. This part will surely expose some small flaws in my processing. But not for tonight, though.

Still not much closer to pulling a nifty AI-demonstrating scenario out of my arse for the 12th of May, when I must have a working implementation, lest I lose 12.5% of my mark for CS3516.
After the database is built, I'll be able to devote time to that, before the big holidays.


Had my Haskell assignment due in today and completely forgot about it. It's been done for over a month, as well. Ffs, I've even helped a mate do this one... bet he didn't forget to hand his in on time.
Not sure exactly how much it's worth. maybe 10% of my final mark, maybe more :\
Ah well...





ARM are still taking their sweet time with my application, not a titter yet. Starting to get paranoid gmail is somehow broken. 

After all this crap with deadlines, BASH, Ruby, HTML and regular-expressions, I now intend to thoroughly chill out. That is, if I don't get lured away from sleeping by some interesting thing which I must, must, must, read about.

Thursday 21 April 2011

Starting Lisp

First off, Lisp isn't a language. At least, it's not just 1 language - it's a family of them which all share a similar syntax and manner of operation.
The variant I've been acquainting myself with is Common Lisp.
It's intimidating for several reasons, the main one being the elitist attitude attached to many of those who use it. Maybe it *is* the best, most advanced language in the world(I can't say), but hearing that makes it no easier to learn.
The syntax looks....bloated. One would tend to skim though a line of code and assume there is some kind of unnecessary, 'yet beautiful' paradigm at work which could only be appreciated by an academic, but in all makes a less useful language.
It definitely helps to have a background in functional languages to understand just how useful Lisp can be. 

After downloading and installing a Lisp runtime (clisp, for example), you will notice that the front-end takes the form of a Read-eval-print loop, something very familiar if you come from a ruby/python/similar background.

For those unfamiliar with this concept, it's exactly what it says it is. You type text in the correct syntax, which gets *read* into an internal format, then gets *eval*-uated, and the resulting data *print*-ed on the screen.

Now to the code :)

In the loop try evaluating some data, like 1 or 3 or "sandwiches", and hitting enter to evaluate. That shouldn't do anything really very surprising at all.
What's happening here is that the reader is converting the text, "1", into the internal Lisp object which represents an integer.
This object is then passed to the evaluator, which does nothing with the object.
Still the integer object representing 1, it gets passed to the printer, which converts it to a textual representation "1".

Thrilling stuff, eh?
Not really, no. In that example, the evaluator did absolutely nothing, but it's in fact the most complex part which makes up a Lisp system, as we shall see.

But, how do we write out a Lisp list?
Like this: (1 2 3 4), this is a list containing 4 objects.
Lists can also contain other lists: (1 2 3 4 (1 2 3))

Now lets try to evaluate a list.
Type (1 2 3 4) into the read-eval-print prompt, and hit enter.
This will now throw a potentially very ugly error(ugliness is implementation-dependant).
clisp responds with the following insult:


*** - EVAL: 1 is not a function name; try using a symbol instead
The following restarts are available:
USE-VALUE      :R1      You may input a value to be used instead.
ABORT          :R2      Abort main loop

Not nice to look at, but it's point is that the object '1' isn't the name of a function.
Why was it expecting a function name? Because that's how Lisp code is written. It's a list. It's all lists.
Want to call a function? Create a list beginning with the function name, and the parameters as the other list elements.

Here's a practical function call, the seminal "hello world" program:
(print "Hello world")
This is a list containing two objects. One is a name, the other is a string. The reader, takes this, creates these objects in memory, and passes the list to the evaluator. The evaluator notices it's been given a list, and after evaluating all of the other elements, calls the function named by 'print' with the "Hello world" string as an argument(remember, simple objects like strings do nothing when evaluated).

But what if we feel we need to stop evaluation for some reason? What if we just want to tell the evaluator to stop and, for example, not evaluate a list. Rather, leave it as a list?

This is where the special name "quote" is used.
When the evaluator encounters a list to evaluate whose first element is the name: "quote", it simply returns the other element in the list without trying to evaluate it.
Given this, we can do what we described, and get the evaluator to leave our list alone by writing the following:
(quote (1 2 3 4))
After the reader has done it's job, and turned everything into objects(2 lists, one inside the other), the evaluator sees the first element of the list passed to it is the name 'quote'. This makes it stop in it's tracks, and simply evaluate to whatever object was given as the argument, in this case, a list of 1, 2, 3 and 4.
This is then passed to the printer, and is displayed as:
(1 2 3 4)
on the screen.

As the reader(you, not the Lisp reader) will hopefully now understand, this quote thing is useful. Most obviously, when you want to write out lists. This assumption is true enough, in fact, that in Common Lisp, there is a shorthand in the form of the single-quote, eg:
(quote someobject)
is completely and utterly equivalent to
'someobject

and (quote (1 2 3 4))
is totally and thoroughly the same as
'(1 2 3 4)


Now, a quick test. If you want the printer to show a list, why can't you type:
(print (1 2 3 4))
when instead you must type:
(print '(1 2 3 4)) ?


It may not say much, but I feel this tutorial clearly outlines the workings of the language, which are easily misunderstood.

More Common Lisp:
Make a greeting function, 'greet':
(defun greet () (print "hello"))

Make a better greeting function, which takes a string as a parameter:
(defun greet2 (name) (print (concatenate 'string "Hello, " name)))

Call the greet2 function:
(greet2 "Lee")
prints => "Hello, Lee"


That's all for now :)

Wednesday 20 April 2011

A start

Right, first post, hmm...


I guess I'll start with what I've been up to at Uni...
On the last leg of my Comp Sci course, I'm finding it increasingly difficult not to check out of things.
I just want the damned thing to be over, and to go and do my Industrial Placement with ARM (which I may or may not get).
As of now, I've got a _sane_ database of laptop specs to pull out of my arse for my group statistics/AI project (essentially a product comparison engine). It's gonna be a long haul of ruby, sed, bash, regexes, and little manual fixups. Really, not fun stuff...


Now onto the fun stuff...
I like progamming languages. I LOVE progamming languages, I know a fair few. The newest members of my army, being scala, haskell and ruby.

Scala blew me away when I first met it. It had so many features.
Seemed like it had all the best language features, created to this date.
Then, I hated it. I hated it for it's seemingly nonsensical type-inference mechanism, which surely did little more than to make code unreadable.
A few days went by, A few days writing 1600 lines of Java for my Games AI project, and lo-and-behold, I didn't feel so bad about it.
I concluded that, aside from a few choice features (pattern matching, traits), it should be thought of as no more, and no less than Java, but with less of the verbose crap.

I still wasn't satisfied, I wanted something different. MORE different.
I attempted to write my own stack-based 'functional assembler', if you will, which actually turned out pretty nifty.
A lovechild of Lisp(as I understood it then) & FORTH, I hope to implement it on an FPGA someday when I have money.

Speaking of Lisp; yesterday, I finally managed to wrap my head around Common Lisp!
Or at least it's syntax and actual operation.
I feel somehow liberated, even though I don't know enough about the libraries, or have had enough practice, to do anything really useful with it.
I may just be doing my next Games AI project in Clojure in an attempt to get to grips with the Lisp way of thinking.

Industrial Placement...
Last week, I finally applied for the year's placement/internship at ARM, in Cambridge, that I've had my eye on for over a year now. I've yet to hear back from them, but i've got a vote of confidence from my cousin, Ben, who did this placement a few years ago.
After I complete that, I'll have - aside from experience working for one hell of a name - a designated BSc Hons in Computer Science; Hopefully enough to kick-start my career into a...direction of some kind.


That's about all for now, I believe.
I'm now off to depress myself with HTML.
Till next time :)

Lee