Showing posts with label geek. Show all posts
Showing posts with label geek. Show all posts

Friday 21 November 2008

Internet Salmagundi VIII

As we all know, Bazza O. will be the first black US president. And on a personally scary note, he's the first one who's younger than The Bloke. Not me, though. Obama was born in the same year as me, but he's still older than me. Cartoon collection here. And the key question we're all asking, I'm sure: who will be the new White House chef?

Yet more wacky hijinks from loony American Christians: a burning cross is the perfect Xmas lawn decoration! Really!

Here's a very encouraging development in the search for a cure to AIDS.

It's been a good fortnight for music. Two Robyn Archer concerts; and a Jonno Zilber CD launch. And I stumbled on this music site: 100 greatest blues songs.

Cectic is back, yay! Only one a week, but it's better than nothing.

Funniest diet ever. Up yours, Atkins!


And now for something serious. Do you want your internet connection slowed down by 30-85%? Do you want your access blocked to random sites that vaguely resemble some that some wowser dislikes? Like maybe breast or testicular cancer information, or support groups for GLBTQ teens, or anything from Scunthorpe? Or are you an adult who *gasp* wants to read adult content online? The Rudd government needs a wake-up call on this totally ridiculous net censorship rubbish.

It's technically totally stupid; it's treating adult citizens like naughty children who can't make their own decisions; it's putting us up for justifiable international ridicule; it's a massive and stupid waste of public money for no reason other than to pander to the wowsers. Start at the No Clean Feed site for more information about what you can do. And do it! Yeah, join the facebook group, but don't leave it at that level of slacktivism.

Wednesday 12 September 2007

Lesson of the Day: restart the sodding server. And eat lentils.

Aaaaaaarrgghhhhh! JSP is hard, let's eat.

OK, so as a generic bioinformatics IT type, I have to deal with all kinds of code. I don't get to specialise in a language. Get a JSP app running when I've never even read, let alone coded, a JSP page before in my life? Sure, no worries. It's only code, how hard can it be? I've downloaded and unpacked the source, popped it into tomcat, it mostly goes. But there are errors. I have to get this file upload page working. I fix the database problem with the duplicate statements. I fix the javascript error with the windoze-specific file separator. I'm feeling good, powering along, and then comes the jsp refusing to compile.

That turned into an all-day battle. It can't resolve a type. I find the library with the relevant class in it - it's org.apache.commons.fileupload. It all seems to be correct, it's right there in the WEB-INF/lib directory. I don't understand this. I try everything I can think of - moving it to other possible directory structures; putting it right in tomcat's lib directory; editing the import statements to get only the specific class needed; fully qualifying the class name... I send begging emails to the friendly Italians who wrote the original code. (Yes, I am trying to debug code with occasional comments like "Non ci sono input". No, I don't speak Italian.) I can see it's attempting to recompile each time, so it's not a caching error. I check that the jar file is complete and contains the class. Yes, it's not corrupt, it's fine. Nothing works. And then the bloke says to me "did you restart the server?"

Well, no. I hadn't. It didn't occur to me - and why would it? Tomcat is clearly attempting to recompile the jsp each time I reload - it's aware that the code has changed. But apparently it's NOT aware that libraries have moved. But that is the trick, and finally it works! Or at least, I no longer have an error on line 32 but on line 75, which is good enough for me to call it a day. Talk about a trap for new players.

Since I've been working at home for the last few hours, dinner is almost immediately available. I just need to wash and steam some greens. The sausage and lentil casserole is sitting there in the slow cooker. It's warm and comforting - both healthy and tasty. The thin rabbit sausages from EcoMeats are mildly spicy, and they match the earthy herby lentils nicely. Last night I fried up a finely diced onion and carrot, browned the sausages, and deglazed the pan with brandy. In the morning, I tossed it all in the slow cooker, with the de-fatted lamb stock, a bit of red wine, Australian green lentils, and some bay laves, thyme and rosemary from the garden. When I left for work I turned it on low; I came home early after a meeting and it was smelling great.

See? I knew I'd think of something to do with that lamb stock. Oh, and the curry yesterday was fine - actually it turned out a bit too mild. Rescue mission successful.

Cooking today: Sausage and lentil casserole.

Tuesday 28 August 2007

I <3 Eclipse

I've not been working in java for 5 years now, but I need to get back into it. And I've suddenly been reminded that 5 years is like eternity in software. I used to use a Borland IDE way back when, but Eclipse seems to have turned into the Java IDE of choice. It's free, it's huge, it's supported by IBM's Linux drive and a massive developer community. And it's unbelievably full featured, so much so that it's hard to get a beginner grasp on. But now I have discovered a set of video tutorials, and I'm in love.

It hit me around about lesson 7, where we followed a test-driven development method, and wrote a test for a non-existent class. Of course this fails to compile, but then comes the thrilling thing. Click on an error and you get a range of autofix suggestions - including generating code stubs for the new class. I made a whole class to match my test - data field members, constructors, getters & setters and all - with just a few mouseclicks and a couple of lines of typing actual code. It even makes a TODO list to remind you of the code stubs it's generated so you can go fill them out.

I'm now wondering if their PHP subproject is going to be better than my usual emacs. Hmm. Kids nowadays don't know how lucky they are; I have actually written real working code on punchcards; had to get up before we went to bed, eat a bowl of gravel for breakfast, had to pay 't millowner to let us work there...