Toyota, you know you are in trouble

Posted by Peter Morris Sat, 20 Feb 2010 19:17:00 GMT

When even the geeks are making fun of you! http://www.xkcd.com/702/

Does anyone else work this way?

Posted by Peter Morris Sat, 20 Feb 2010 07:11:00 GMT

It is just after 7am on Saturday morning and I have just completed the most intense half an hours work of my day. When I finished, I opened my eyes and turned over in bed with a smile.

JQUERY, before you go to bed, put your toys AWAY!

Posted by Peter Morris Wed, 10 Feb 2010 15:11:00 GMT

I have been wrestling with an issue I have with jquery dialogues. When I hit an issue like this, I always assume it is my fault. Pretty safe bet that. But no! JQUERY does not put its toys back where it found them!

Interesting Book...

Posted by Peter Morris Mon, 08 Feb 2010 09:10:00 GMT

The article I mentioned about AREL mentioned a book that I really intend to look into.

Structure and interpretation of computer programs

YERS! get in there! Rails 3.0 FtW

Posted by Peter Morris Mon, 08 Feb 2010 08:48:00 GMT

For the last 5 years I have classed myself as a Ruby on Rails developer. More recently, I realise I might possibly not be able to say that. I have been using Django a lot. I love RoR, but Django has some nice features. One of them is its ORM query mechanism, but things are changing....

Wait, stop, I have been doing it wrong for 20 years.

Posted by Peter Morris Mon, 08 Feb 2010 08:24:00 GMT

IT, as in IT work.


I have been a professional coder (don't laugh) for over 20 years. Yesterday, My son(Alex, 12) and I where in the car, and as is natural, our discussion got around to copyright. Where it has been, where it is going, why it is as it currently is. During the discussion, I realised, I have run my career all wrong.

Coffee, Coding and Geographical Irrelevence

Posted by Peter Morris Mon, 01 Feb 2010 14:25:00 GMT

A new coffee shop cum cafe opened up within walking distance recently, I have high hopes and detailed aspirations.

Django/Python Epix Phail #5 - don't be evil.

Posted by Peter Morris Fri, 29 Jan 2010 13:15:00 GMT

Every language has its rough spots.


Ruby for instance does not handle array slices very nicely.

>> a = [1, 2, 3]
=> [1, 2, 3]
>> a[0]
=> 1
>> a[0..1]
=> [1, 2]
>> a[2, 3]
=> [3]
>> a[3, 4]
=> []
>> a[4, 5]
=> nil

 

Now, thats evil. Why should a[3, 4] give you an empty array (which is expected) but a[4, 5] give you nil!

But, Ruby gets some things right.....

>> a='1,2,3'
=> "1,2,3"
>> a.split(',')
=> ["1", "2", "3"]
>> a = '1'
=> "1"
>> a.split(',')
=> ["1"]
>> a = ''
=> ""
>> a.split(',')
=> []
>>
 
See that? an empty string gets you an empty array.

Theoretically, it SHOULD give you an array with a single empty text element, but it is nicer than that.

Not Evil.

Python on the other hand....

>>> a = '1,2,3'
>>> a.split(',')
['1', '2', '3']
>>> a = '1'
>>> a.split(',')
['1']
>>> a = ''
>>> a.split(',')
['']

Evil! pure and simple.

And lets look at slicing....

>>> a=(1,2,3,)
>>> a[0:1]
(1,)
>>> a[0:2]
(1, 2)
>>> a[0:3]
(1, 2, 3)
>>> a[0:4]
(1, 2, 3)
>>> a[1:4]
(2, 3)
>>> a[2:4]
(3,)
>>> a[3:4]
()
>>> a[4:5]
()
>>> a[6:7]
()
>>> a[7]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IndexError: tuple index out of range
 

In some ways that is better, slicing works nicely, but indexing a single element raises an index error.

Surely, if it is happy to slice the array outside of its limits and return a valid result, why not handle

accessing an element outside of the limits too?

 

Out with the old, in with the new. 11

Posted by Peter Morris Sat, 02 Jan 2010 11:49:00 GMT

Every year I do a bit of a clear out of my bookshelves.


I have two shelves above my desk in my office where I hold my books, the lower shelf, is my 'working set' the books I reach for all the time. The upper shelf are the 'good to haves' but are books I don't need every day. Every year, I review the books in the upper shelf, and move a selection to the boxes in the loft, so that I can push books from my 'working set' shelf up and to free space on my working set for books I need as I move speciality.


So, into the loft this year goes...

  • PIC 16cXX Assembler data book
  • DC01 Television Tuners
  • Zilog Z8 microcontroller handbook
  • Microchip Data book
  • Keil 8051 Assembler/C51 manuals
  • Java in a nutshell
  • Programmers Guide to the Netbios
  • Palm Programming
  • iAPX88 Book

The assembler data books probably should have gone a couple of years ago, but
 I was a bit sentimental, I loved doing assembler coding.

From my working set to the 'upper shelf' (sort of like being demoted from the cabinet to the back benches I suppose

  • Lisp (Winston & Horn)
  • K&R The C Programming Language
  • Managing Projects with Make

And new in the working set is a section on Django and Python.

Django, epix phail #4 - The road to hell. 11

Posted by Peter Morris Fri, 01 Jan 2010 13:04:00 GMT

The road to hell is paved with good intentions, Djangos MTI gives you the tools to pave yourself right into the abyss.