new server

April 20th, 2004 by

this journal is now defunct. My new one is at http://kae.verens.com/.

iPod on Linux

February 18th, 2004 by

One of my bosses handed my an iPod with about 15GB of music on it, so I brought it home and started working on getting it mounted on my machine.

I was hoping it was going to be as simple as mounting my camera (just plug it into a USB port, and KDE takes care of the rest).

I had an AIC-5800 firewire card lying around (Adaptec), so restarted the computer, and stuck that in.

Mandrake’s “harddrake” recognised it as an “unknown” card, but knew that it used the aic7xxx module. That was the first sign of trouble…

I connected the iPod to the card, and waited for the magic. Nothing happened.

After scouring the net for hours (I’ve been sitting here four hours trying to do this), and following lots of instructions, I’ve managed a big fat zero percent of success.

I’ll keep trying… I think it might be the firewire card, so will concentrate on that for the next four hours.

Friendly URLs

February 18th, 2004 by

If you have a CMS that has unfriendly URLs such as “/?id=6785″, or similar, you could use this little tip.

Add a .htaccess to trap 404s (missing pages). chmod it to 644. In it, place this: “ErrorDocument 404 /404.php”

Now, for the interesting part. The following script assumes your table is called ‘pages’, your database connection script is held in ‘.htDB.php’, and stuff. Read it to figure out more.

<?
$contact='kverens@contactjuggling.org';
include('.htDB.php');
$r=preg_replace('/^\//','',$_SERVER['REQUEST_URI']);
$r=preg_replace('/\?.*/','',$r);
$r=addslashes(urldecode($r));
$q=mysql_query('select id from pages where name="'.$r.'"');
if(!mysql_num_rows($q)||ereg('/',$r)){
 mail($contact,'[yoursitename.test] missing page',
  $_SERVER['HTTP_HOST'].' '.$_SERVER['REQUEST_URI']."\nfrom: ".$_SERVER['HTTP_REFERER']);
 header('Location: /');
 exit;
}
header('Status: 200 OK');
$r=mysql_fetch_array($q);
$id=$r['id'];
include('index.php');
?>

Note that this grabs the page’s ‘id’ from teh table. If you use a different scheme, then obviously, you’ll need to amend this.

erd

February 17th, 2004 by

After spending a fruitless few hours searching for an Open Source program which can draw out the relationships between various tables in a database, I’ve found nothing useful to me.

The one program which looked perfect for the task, Rekall, crashed when I tried to create a database with it. This was after hours and hours of compiling…

The one I’ve been pushed towards by most people is Dia, but that’s too general, and has too high a learning curve for the time which I can spend at it.

I’m thinking I might have to write one for future work. A pity I’m a web developer, and not a GUI developer. I have the wrong skillset.

kite dangers

February 16th, 2004 by

Terrible news. I heard about this earlier today and was in shock. Mostly at the young 18 month old girl who had her throat cut by some stray string (in a different news article about the same event – can’t find the URL). I couldn’t help but imagine how I would react if that happened to my son in front of me. I was in shock just thinking about it.

Jareth actually had a narrow getaway today. I had placed him down on a couch to sleep, and a guitar which was standing at the other end of the couch fell on him. The head of the guitar hit the side of his head, and he now has a nasty lump and a small cut. Luckily, it was a graze, and did not do any permanent damage. It took me a few minutes to convince myself that he was fine.

daily prophet popups

February 14th, 2004 by

quote from alt.html today:

Yep, my first thought was “how do you use a radio button on paper”?
[...]
My second thought was that in J.K. Rowling’s world, parchment with form controls and dynamic display is probably rather commonplace. This led to the third thought, which was to wonder if the _Daily Prophet_ and the _Quibbler_ have pop-up ads, and whether there are spells to block them. Which led to the fourth thought, which was to wonder if such publications ever tell their readers that they need to “upgrade” their wands in order to read them; “This scroll requires an Ollivander’s wand, but you don’t have one.”

gay marriages become legal in the US

February 13th, 2004 by

Maybe the US isn’t so stuck up after all. “Dozens of same-sex couples marry in SF

My favourite quote:

“This is a couple that’s been together 14 years,” Katz said moments later. “They’re one of the most extraordinary couples I know.”
Yet they couldn’t get married, she said.
“And then you see someone like Britney Spears, someone who takes it with so little respect,” Katz added, referring to the pop singer’s recent short-lived Las Vegas marriage.

Nice to see the merkins treating same-sex couples in a non-biblical, human way.

eircom sucks

February 11th, 2004 by

I get online using an ADSL line provided by Eircom.net. I use a Netopia Cayman 3341 as a router for my home network, and as a newbie to the world of in-depth networking, I’m completely lost.

I bought a block of for IP addresses from the same company (I think a block of four is called a /27 block?).

My problem is that every time there’s a power shortage, a machine crash, or even someone sneezes, my router resets and is given another IP address.

That plays havoc with my DNS. I try to run an IRC server, and use it as a test server for some new projects.

Every time my IP resets, I have to change the A record of my domain, and wait 8 hours for Eircom’s domain servers to update.

What’s bloody frustrating about this is that I have the technology! I own the IP block I want to link to my router!

At first glance, the Eircom.net support page is pretty complete.

When I dig a little deeper, though, suddenly everything’s fucked. I don’t use Windows or Mac, and the router is OS agnostic anyway.

My question is – how do I set up my router to have a static IP address? Even calling Eircom.net’s help line doesn’t help – they readily admit that they don’t know!

Futurama header

February 10th, 2004 by

I got this from Simon Willison’s blog, and had a good chuckle.

lynx -mime_header http://slashdot.org/ | head -n 6 | tail -1

accessible hierarchical menus

February 10th, 2004 by

Using a hybrid of Mike Hall’s hierarchical menus, I’ve come up with a rather nifty method to accessify them.

The problem was that each submenu was held in a layer of it’s own, with no visual clue to what the relationship was between each layer and it’s companions. This was a problem especially for non-coding web designers – it should not be necessary that a web designer have to learn JavaScript in order to create a funky menu. Also, any menu created should have it’s meaning, use, and relationships clear to even a non-JavaScript browser.

So, the method I’ve come up with is to create the menu using a tree of unordered lists, such as this:

I then add the below line at the head of the document, and add class="magicmenutop" or class="magicmenuleft" to the root <ul>:

<script type="text/javascript" src="magicmenu.js"></script>

That script searches for the <ul> containing the magicmenu (left|right) class, and does some cool stuff to it.

The menu traverses the tree, replacing each level of the tree with a layer, in the manner that Mike Hall’s script understands.

A difficulty arose when I wrote the traversal algorithm. I decided to use a depth-first recursive method, as it was simplest, but quickly realised something I had only been peripherally aware of – JavaScript’s variable scopes suck! Essentially, a variable created in a JavaScript is global, so a recursive instance of the same function will destroy any copies of itself.

That was, of course, very vexing.

The solution was to create an external array holding the variables. The index of the array was pretty handy – the index of the layer that the algorithm was writing to at the time.

Another difficulty arose when it was pointed out to me that the script fscked up in Opera and IE. I can’t test IE yet (don’t have it at home), but downloaded Opera and worked on that.

It turns out that Opera does not understand the document.styleSheets collection, and all efforts to dynamically create document-wide styles failed. (the styles I’m talking about are the all-important positioning directives – I don’t mess with colours – leave that to the designers)

I ended up having to write the styles directly into each layer and link as I wrote it.

Long story short – I’m happy with it, and think it will make a formidibale tool. Must contact Mike and mention it to him.

bloated javascript calls

February 9th, 2004 by

It really irks me when someone goes to the effort of creating a backwards-compatible whatever (menu, style thing, etc), yet bloats the HTML with javascript calls which will mean nothing to the non-javascript browsers.

For example, this month, ALA has an article on a JavaScript-based photo-gallery method, which is admittedly quite cool.

Now, at first glance, the idea is great – You simply create an unordered list of photo links, and dynamically load the image (overloading the ‘click’ method). Unfortunately, the method used introduces bloat that will slow down non-JavaScript browsers.

From the simple line <a href="images/bananas.jpg" title="A bunch of bananas on a table">some bananas</a>, we add code, creating <a onclick="return showPic(this)" href="images/bananas.jpg" title="A bunch of bananas on a table">some bananas</a>. Ideally, the use of JavaScript should introduce as minimal as possible a change to the page’s source.

How to solve it?

Simple – We know that the gallery images are all contained in a <ul>. So, in the external JavaScript which handles the gallery functions, we add an initialisation function which searches the document for <ul> elements that are given the class “gallery”. All links within that are then dynamically amended to include the event code onclick="return showPic(this)".

My philosophy with JavaScript is that it should affect the source code of the document as little as possible, leaving a very clean, easily readable source, free of clutter.

cars

February 3rd, 2004 by

Had my first driving lesson today. It was interesting trying to figure out what I was nervous about – I can skate, bike, and rollerblade, so what’s the big deal?

Turns out, what I’m nervous of is teacher patience. I’m a slow but steady learner. The key problem, though, is “slow” – while I learn, and learn steadily, I am always aware that I have little patience in others when I am trying to teach them – so why should a teacher have patience in me?

Anyway – it went off without too many problems. Stalled once or twice until it was explained to me a bit more about how the engine and car fit together.

I must find out how exactly a clutch works – the description didn’t seem to gel with me – I need a good physical understanding of it to be confidant that I won’t break anything.

accessible tabs

February 1st, 2004 by

Like the new look? I’m using a method I developed a while back with collapsible lists to break the blog stories apart into tabs.

A simple example is here.

I won’t insult your intelligence by describing how to use it. It should be obvious from the source.

A walker for my goblin

January 30th, 2004 by


I bought a walker today for Jareth. It’s cool, but it sucks as well.

It’s cool, because he likes it, and seems to be getting the hang of it.

It sucks because:

  1. It’s not adjustable, which is weird because making it adjustable involves modifying just one piece of plastic in it, so I don’t know why they haven’t done it.
  2. It has a few toys built into it, but none of them are noisy, and they’re all one colour except for the phone, which is red.
  3. It cost €35, so I hoped for at least an instruction booklet. The box was even plain white cardboard. Cheap.

Tesco made some money from me. I hope that money goes towards researching improvements n that monstrosity. I’ll use it, but I think it could have been better.

hungover and grateful for the heat

January 30th, 2004 by

9° in the house today. I should get some oil. thankfully, i’ve wrangled a pay-day change from da bosses, so I can order it today.

I was admiring the subliminal background image of Kevin Lyda’s homepage. Made me chuckle.

bbbbbbblogs

January 29th, 2004 by

Nice engine in this thing. The backend is not as themeable as the front end, it seems, but I managed to copy my “other” site’s theme in a matter of minutes. Purty cool.

I’d still love to get my hands on the writer of that damned calendar, though ;)

As mentioned by Donncha, I believe HTMLArea would be a useful tool for the backend.

Maybe I should stop chatting about revolution and just do it. I’m similar to the Judean People’s Front in that matter…

cold… so cold…

January 29th, 2004 by

central heating packed it in a few days ago, so I woke up, 7am, shivering to a freezing house. the thermometer said 10° celsius. I think it was lying.

I discussed the idea of moving to Belturbet with Bronwyn yesterday – her parents are offering the house to us on a low-rent basis. after a little thought, we both agreed it was ridiculous. no broadband, no prospect of broadband, and the only way I could get to work is with a bus which leave to Monaghan at 12:30.

better off where I am.

we’ll keep on looking

image formats

January 27th, 2004 by

I’m about due to improve my community site, and was polling the regulars for some ideas. One idea was “avatars” for forums. Simple, I thought – after all, one project I’m working on for work is a large photojournalist site with lots of funky image manipulation. Then I remembered that avatars are usually in .gif format. Why can’t web browsers stick to open formats like .mng??? That’d make life easier (.gif is not handled by the open source image manipulation libraries I use – GD and the like).

overuse of css

January 27th, 2004 by

There comes a time when a man must scream and threaten bloody murder. One point of CSS is it’s ability to optimise the code needed to lever style into an element. This ideal is thrown out the window when the optimization looks like the following:

<tr class="b2calendarrow">
<td class="b2calendarcell">7</td>
<td class="b2calendarcell">8</td>
<td class="b2calendarcell">9</td>
<td class="b2calendarcell">10</td>
<td class="b2calendarcell">11</td>
<td class="b2calendarcell">12</td>
<td class="b2calendarcell">13</td>
</tr>

The above could be written a lot more efficiently by leaving out the b2calendarcell class, and instead addressing the cells as “.b2calendarrow td“. And don’t forget the indentation! In this case, it’s probably best to have all <td>s on one line. This would give the following:

<tr class="b2calendarrow">
 <td>7</td><td>8</td><td>9</td><td>10</td><td>11</td><td>12</td><td>13</td>
</tr>

Isn’t that much nicer?

mr – no, Sir. feckit – i have no title

January 27th, 2004 by

typing is difficult when there’s a three month old nipper screaming and wriggling on your lap.