Recursion worry

March 5th, 2008 § 0

My favourite bit of the Twitter Tools FAQ:

“What happens if I have both my tweets posting to my blog as posts and my posts sent to Twitter? Will it cause the world to end in a spinning fireball of death?”

(Apparently it won’t.)
–c.

Cat-like programming detected

May 30th, 2007 § 0

Even teh kittehs are learning to code lolomfgbbq!!1!

–c.

JSON and Jack

September 26th, 2006 § 0

Work: Trying to get my head around JSON, and Object Oriented Javascript. Having never written a single line of OO code in any language, I’m finding the subject just a bit impenetrable at the moment. Though, on re-reading that article by Dustin just now for the third or fourth time, I started to feel a balance tip in my head towards understanding. Did you ever do those “Magic Eye” pictures, that look like a messed up pattern and then suddenly you see the page become a 3D dinosaur or whatever? It was like the first time one of those starts to “work” for you. I was reading the words over and over, and suddenly I felt part of my world view begin to change fundamentally. But then, just like when you realise that the page is becoming 3D and you involuntarily focus, losing the picture completely, my mind rebelled and thought of something else. I’m going to come back to it after lunch. Then I’m going to read it a few more times. Then I’m going to damn well try it.

Home: Oscillating wildly between writing solos in Cubase for the Little Monkeys studio album, and filling every other spare second with series 3 of 24. No, really. Every spare second. Even Guildwars doesn’t stand a chance when Bauer Fever descends.

This blog entry took place between 12.41pm and 12.44pm.
–c.

The Easiest Zebra

September 18th, 2006 § 1

Say what?

It’s more JQuery stuff, so if you care not a jot, then hie thee hence.

OK, so there are a million ways of generating zebra-striped tables. If you don’t know what a zebra-striped table is, then you probably don’t need to. But if you do, then you may be familiar with methods like this and this. That’s all good.

(By the way, I realise that an even better way to do this is to generate the stripes by writing the alternate classes out on the server-side, but for the purposes of this post I’m assuming that can’t be done. Imagine the table’s being retrieved by AJAX or something, so client-side code has to be the way.)

With the awesomeness of jQuery, this is how you do it:

<script type="text/javascript">
$(document).ready(function(){
$("table.stripeThis tr:even").addClass("striped");
});
</script>

See that? One check to see if the DOM’s loaded, then one line of code. And that would apply to all tables on the page with the CSS class “stripeThis”.

Nifty.
–c.

UPDATE: Here’s a sample page. View the source. See? :-)

jQuery, and awesomeness

September 14th, 2006 § 1

I’ve had reason to look into javascript libraries recently at work, initially in the building of the Profero Tacheback site (which I urge you to visit and perhaps sponsor/donate – it’s all for charidee mate), and more recently in a general R&D capacity.

And even though it wasn’t used on that site, and I’ve actually not used it on a project yet, jQuery has leapt out at me as being awesomely powerful without being too much of a sledgehammer for my nuts.

What I loved was that it has built-in syntax for selecting everything in the document that matches a CSS selector (for example) and also has built-in AJAX handling methods and has some pre-built visual effects that are easy to use, yet it’s not a hulking behemoth like Dojo or an inflexible pre-packaged box-of-tricks like Scriptaculous.

These are by no means fully explored opinions – this is my reaction after toying around with the libraries in question with a particular task at hand – and I’m fully with the “each to his own” idea, so I’m definitely not saying that jQuery is the one and all others are heathens. I’m just saying it lit my lights, it spun my wheels, it rang my particular bell.

YMM, as ever, V.
–c.

Geek Anthem

September 7th, 2006 § 0

Geeks, friends, coders, unite. We have ourselves an anthem.

I give you the sublime Code Monkey, by Jonathan Coulton.

Best geek song ever. No, really. Lyrics here.

–c.
(I’ve done my time as a code monkey – I can relate. ;-) )

Where Am I?

You are currently browsing the Code category at clivemurray.com.