Sunday, July 30, 2006

scam-tastic-2

Scam-tastic!

It's a magic magnet which improves your fuel efficiency! Imagine! Note that it used 'neodymium super conductor magnets'... Neodymium is a rare earth element magnet found in hard drives and things; there are no room temperature superconductors, so you'd better be ready to pour liquid nitrogen into your car a fair bit.

Also, it makes your air conditioning work better. And probably cures your cancer, too.

And people actually but this sort of nonsense!

Saturday, July 29, 2006

lamp-of-darkness

Lamp of Darkness

When searching for 'ceramic Satan' (I was trying to figure out was that really in the lyrics of Plastic Jesus or was I imagining it; it is) I found this beautiful item, a 'Gorgeous 1920s Solid Bronze Ceramic SATAN Lamp. I'm not convinced they're meant to Satans, mind you; look more like satyrs.

Also, I am currently watching an episode of Will and Grace where they keep coming back to a scene in a gay bar. The music playing is Beyonce's Baby Boy. They have shown bits of what's meant to be a two or three hour sequence, with the same damn music all the time.

simple-wordpress-poster

Simple Wordpress Poster

Here's a simple tool for posting to a Wordpress blog using a basic interface. Might be particularly useful in lynx or from a mobile device. Inspired by this post.

Friday, July 28, 2006

nuclear-nation-2

Nuclear Nation

I almost hesitate to link to this page, it's so ugly. But the gist is that a group has formed in Ireland to advocate using nuclear energy. It's about time. Irish people tend to be particularly emotional and irrational on the issue.

Wednesday, July 26, 2006

bits-and-pieces

Bits and Pieces

When waiting for the train this morning, the young couple on the platform opposite were enthusiastically discussing their sex life. Little did they know that due to an acoustic oddity in the station design, all was clearly audible to us on the other side. Yuk.

The coffee shop at the station, formerly Mr T's Coffee (yes, really. There was/is also one at Howth Junction, I believe) is now 'Rueben's Gourmet Coffee House', purveyors of coffee, pastries, newspapers... and cigarettes. I hadn't realised they were standard fare for a coffee shop. Restlessness, dehydration AND cancer, all in one easy transaction. And brain damage, if you opt for the Sun.

When going to the gym today, I foolishly left my iPod in my locker. Gyms are unusably boring without the delightful strains of Kenneth Williams being mean to people.

From a blog comment on over-hyped technology Ruby on Rails: "...The agility of it all really surprised me after coming from Java, which really feels like it's only 48% agile for most tasks. I've found myself up to 93% agile with Rails (around 86% in plain Ruby.) ..." I can only hope they were taking the piss.

New Zealand lawyer in court in drag. "The more this goes on and the deeper the cover-up gets, the frocks will get prettier," says drag-lawyer. UNTIL THE COURT'S BRAINS EXPLODE FROM THE PRETTINESS. I am trying, unsuccessfully, to think up good lawyer drag names. (Ally Man-Beal? Nah.) Also, note that 'Time-line - New Zealand' is linked off the article. Sadly, drag-lawyer doesn't feature. Yet.

Israel appears to have tact issues. The traditional mechanism for dealing the UN is making very silly arguments and shouting 'veto' a lot, not blowing up its officials.

Blair wants to ban junk food advertising. It's just as well Mary Hearney isn't our minister for defence, really...

"The IRA is no longer involved in any centrally organised criminality, the British and Irish governments believe." - Oh, dear.

More politicians with prostitutes. Honestly... "If I've learnt nothing else in the last 10 days, it's that my personal life and my family life is the most important thing and I regret not getting the balance right over the last four years as I should have from time to time." Generally, the balance involves few prostitutes, in fact. You can even omit them entirely! Imagine! It certainly is an old-fashioned political naughtiness, though. These days, you expect them to be taking enormous bribes or conspiring to send people to be tortured in the US and other dubious nations, that sort of thing. Still, he is a liberal democrat, I suppose.

Monday, July 24, 2006

wsdl-creator

WSDL Creator/Editor

I've mentioned WSDL before recently. It's a web services description language, typically used to describe SOAP webservices. Although it's XML, and thus supposedly wonderfully human-readable, and so on, in practice, it's fairly tricky to write by hand, and it's easy to make mistakes. Oddly, though, there don't seem to be any free WSDL authoring tools. So I wrote one.

It's a fairly simple web-based thing. It uses, for the moment, the document SOAP style favoured by Microsoft. In the future, I may add support for RPC, but in practice must WSDL/SOAP libraries will cope with either happily enough. I've tested its output with ZSI for Python, Perl's SOAP::Lite, and a .NET tool. It allows the user to create complex types, and methods to use them. It hides messages, ports and bindings, instead simply letting the user define methods. The user can then download the WSDL file corresponding to the service they've defined. For the moment, it doesn't support reading WSDL files; however, it does let the user dump the state of their webservice into a file, and resume from where they left off by uploading that file later on.

So, limitations? For the moment, it only supports fairly basic standard types, plus user-defined complex types. As previously mentioned, no RPC/encoded support, just document/literal. That's about it. It is NOT well tested; don't come complaining to me if it causes your application to break, or your hardware XML processor catches fire, or whatever. And I wouldn't really recommend producing 100kb WSDL files like MapPoint and similar have on it, either. Other than that, fire away! If you like it, or if you find problems or have suggestions, please do let me know.

Sunday, July 23, 2006

soap-in-python-zsi

SOAP in Python - ZSI

SOAP (it no longer actually STANDS for anything) is an XML-based RPC protocol commonly used for webservices, and generally transferred over HTTP, although various other transports, including HTTP, are possible. Most publicly-available SOAP webservices are described by a WSDL (pronounced wiz-del or, Wikipedia tells me, woozedel, surely up there with 'SquiReL' in the silly acronym pronunciation stakes) file, an XML file specifying input and output parameters, methods and custom types.

Now, obviously if writing a webservice, you don't want to have to generate SOAP messages yourself (though, once you see the libraries, you'll be tempted, oh, you'll be tempted), so you'll want to use a library. There are two major libraries, SOAPpy and ZSI (both here). Only ZSI is still under active development, and the two will apparently be merged, eventually.

I've just spent a few days trying to figure out ZSI; the documentation is really most lacking (in particular, few of the examples actually WORK on current versions), and I'd never played with SOAP before. So, here's what you do if you want a WSDL-described Python web service.

First, you'll need ZSI. ZSI requires the Python wrapper for Expat, an XML parser library. Irritatingly, it will not warn that this is missing on startup, nor indeed to the console while running. Instead, the warning will be included in SOAP messages returned. Yay! If you're using Linux, your distribution probably has a ZSI package which will take care of all this for you.

Assuming you want WSDL, you'll also want a WSDL file describing your service. This is beyond the scope of this post, but there are various tools for making them (here's one I wrote) and they aren't horribly difficult to write yourself. Now, run 'wsdl2py -f myfile.wsdl' (produces bla_services.py, describing the service, and bla_services_types.py, describing any custom types) and 'wsdl2dispatch -f myfile.wsdl' (produces bla_services_server.py, containing skeletons for your webservice methods, plus some magic to hold it altogether. This is the part that held me up; it's actually very useful, but it's not mentioned in the documentation (which doesn't really touch on writing wsdl-described services at all) or examples, and indeed is only mentioned once on the mailing list) on your file.

Now, you want to edit 'bla_services_server.py', or whatever. You'll find it contains a stub for each of your methods like so (the parts in bold are examples inserted by myself:

def soap_myMethod(self, ps):
# input vals in request object
args = ps.Parse( myMethodWrapper )

name = args._name
age = args._name


# assign return values to response object
response = myMethodWrapper()

message = "Hello %s" % name
age_list = [i for i in range(1,age+1)]

response._message = message
response._age_list = age_list


# Return the response
return response


Note that all members of the argument and response structures are prefixed with an underscore.

To invoke all this, then, you'll want a fairly simple file:

from bla_services_server import *
from ZSI.ServiceContainer import AsServer
AsServer(port=8080,services=(Service(),))


This imports those methods you wrote earlier, along with the ZSI machinery for creating a dispatch server. This code creates a small standalone POST-only server on port 8080. If you're actually exposing a service to the real world, you should probably use cgi, fastcgi or (preferably) mod_python instead; instructions for doing this are in the ZSI docs.

Now, how to test it? One way would be to have ZSI generate a python client from the wsdl. The downside to that is that both sides will be using code generated by wsdl2py, and as such will share the same (not necessarily quite correct) interpretation of the WSDL file. I noticed, in particular, that the client will be very tolerant of messages produced from a broken WSDL file. There's an easy perl client, SOAP::Lite, but it's extremelytolerant of broken output. There's a Windows only one here, based on .NET 1.1, which is quite fussy, but doesn't seem to be too good at RPC-type (as opposed to Document-type) SOAP; it can't use the Google web service, for instance. Apparently, AXIS, a Java library, is quite good;I haven't gotten around to testing it yet. If you enjoy C, MacOS has C (and Objective C) SOAP libraries.

Anyway, hope this is of some use to somebody. It's the products of a few days of false starts and experimentation in what is really a quite good, but very poorly documented, library.

As an interesting aside, ZSI is unusual in that generated XML includes not only linebreaks, but actual correct indentation! As the XML standard doesn't require such things, it has become common for XML that people will never have to look at, such as SOAP messages, RSS feeds and generated XHTML, to exclude it for space reasons, but the authors of ZSI apparently cared not for such things. The whole deal, of course, is fairly space-inefficient; a query and response of one integer each would be wrapped in a kilobyte or so of XML, for instance, and the Google web API wsdl, consisting of three methods, two very simple, results in an amazing 30kb of python. And there's more! Amazon web service generates 320kb, MapPoint 400kb and something called SRM 420kb. All this, for RPC!

Friday, July 21, 2006

brick-tastic

Brick-tastic!

Seen on my way home from work, on a small building site:


Over 500 bricks! Imagine! Why not try their brick database? They're really horribly over-enthusiastic about all this; it's quite sad, really.

(Note that my phone's camera is a little damaged. Bomb-proof unscratch-able screen it may have, but the lens leaves a bit to be desired.)

Monday, July 17, 2006

apples-web-20-syndrome

Apple's Web 2.0 Syndrome

I recently submitted a widget to Apple's download area. It's here. Anyway, I tried going to one of the referring sites that visitors were coming from at Apple. And got this. It's the Web 2.0 error message! Quirky, attempts at being cute, gratuitous grammatical error, it's all there.

I'll have extra AJAX on my iBook, please.

Sunday, July 16, 2006

firefox-with-spell-check

Firefox with spell-check!

Version 2 beta 1 of Mozilla Firefox is now out. Now, one thing that's put me off Firefox for a while is the absence of a spell-check. No more! This version has one. By default it's set to US English, but there are instructions to fix that here.

I'm going to give it a go for a bit; it certainly does Javascript better than Safari does.

Saturday, July 15, 2006

search-for-songs-by-lyrics-ap

Search for songs by lyrics Apple widget

I wrote an Apple widget for my FindMeATune service. Just type in a few words of a song's lyrics, and it'll try to tell you the name and artist. Widget here.

low-sun-protection-factor-t-s

Low Sun Protection Factor T-shirt

I just noticed this morning that my whole upper body is somewhat tanned, despite me never ever wandering around shirtless. I blame radiation-permeable tshirts.

Wednesday, July 12, 2006

apple-quick-response

Apple Quick Response

I submitted my quotes widget to Apple's widget listing. Less than an hour later, someone from Apple visited, using an intel mac. That was quick!

scott-adams-wonderful-blog

Scott Adams' wonderful blog

Scott Adams, creator of Dilbert, now has a blog. It's actually very entertaining. Of particular note: in line with a study in the US whose results indicated that people who are prayed for take longer to recover from illness than those who don't, he recommends praying for people you don't like, to kill them. (Note the usual mix of weirdoes that such subjects attract in the comments). He appears to be good at getting peoples' backs up; there's another post, this one about the proposed law to outlaw flag burning federally in the US, which attracts all manner of crazy 'patriots'.

Also, something completely surreal.

quote-a-basecom-again

Quote-A-Base.com Again

(Edit: Minor update again)

I decided that the widget I released yesterday for Quote-A-Base.com was simply too dreadful, so a slightly nicer one is now available. It looks like this:

Picture 2.png
Download here.

(Just to recap, it's a sort of super quotes widget. You give the widget a tag from the site and it shows you random quotes which have that tag. Oh, you can have more than one at once on dashboard, if you're feeling extravagant.)

The website is still fairly hideous, though. Hopefully will fix. You'll notice that there are more quotes now; I must confess I was inspired to write this thing by Mark's I'm Sorry I Haven't A Clue quote widget, hence the large number of quotes from that show. I will be adding more quotes from elsewhere shortly; do feel free to add your own, of course.

Oh, you can also get an RSS feed of any given tag. I'm not sure how useful this is to anyone.

picture-2png

Picture 2.png


Monday, July 10, 2006

another-weird-and-wacky-websi

Another weird and wacky website - this time, quotes

I've just launched Quote-A-Base.com, a website devoted to collecting quotes and presenting them in various ways. Quotes can be tagged by the user. Currently, you can either get an RSS feed for a particular tag, or use a MacOS X widget, available here, which, once told which tag you want to use, will get a new quote with that tag every time you view your dashboard. Both the site and the widget are currently very ugly; this is because of my minimal skills with things like CSS and image editors. I hope to improve upon this soon.

Anyway, how I imagine this working is, say you want to have your own set of quotes to be shown on your quote widget. On each quote you want, you add your own tag, maybe 'rsynnott' for me, for example. You put that into your widget, and you get your quotes. You can, of course, also add quotes.

More features coming soon. Any suggestions?

(For those interested in the technical details, the site is implemented with mod_python, and communication with the widget is currently in a silly CSV format; may change to XML later.)

Sunday, July 9, 2006

i-should-really-take-the-hint

I should really take the hint, shouldn't I?

I was at the George tonight (gay bar/club thingy in Dublin). A friend's (IMO) not very goodlooking (I wouldn't have gone for him, and that's saying something; at this point I'd go for just about anyone under 25 and non-fat, I hate to admit), got with (scored, whatever, pick your favourite euphemism) someone. Now, I've been going to gay places for over three years now, and have never, ever, ever [insert aforementioned euphemism here] anyone at all. I foolishly sorta tried to come onto someone tonight. That didn't work out. So now I'm more confused than ever. I really do hate looking like this; I received terribly unfortunate genetics. I'd give anything to be even average-looking...

On a more cheerful note, I rediscovered, though watching Black Books, a song I really like. Hmm.

Friday, July 7, 2006

the-educated-consumer

The Educated Consumer

In a newsagents in town, two twenty-something girls, regarding a bottle of lucozade (pseudo-gatorade, for any American visitors): "Oh, it's 150 calories per hundred mils" (or something) one says. "Yes, but look, NO FAT" says her companion. I find the image of a soft drink with fat and intriguing, not to say revolting, thought. "Oh, I'm so jealous of such-and-such, she never bothers with soft drinks". "Yes, but I don't have her discipline" says the other smugly, walking to the cash desk with her no-fat soft drink. Hmm. This is why the whole country is going to die of chronic wobbliness, really.

Monday, July 3, 2006

odd-evening

Odd Evening

This evening, I went for a drink with Mike, a guy I went out with for a couple of weeks a while ago before he dumped me by simply not answering my calls or text messages. Well, that's all in the past now. It's surprising how much easier it is to talk to someone when you're not worrying about whether they like you or not.

Train back to Sutton was delayed, only leaving town at 23:50. Never seen it so late before. Spent most of the time re-listening to Saturday Night Fry. Well worth a listen; very funny.

Sunday, July 2, 2006

saturday-night-blues

Saturday Night Blues

Hmm. I'm not really a happy camper. I got a haircut today. Bit of a disaster really. I've been obsessing about the way I look (moreso than usual, I mean) all day. And it's a bit of a disaster, quite frankly. Dubious skin, a mess of a face, and I could probably stand to lose a bit more weight. Also, I need decent clothes... yada yada yada. The usual drill, more or less. Some people seem to be able to ignore all this stuff, but it really is quite a big deal for me, and is probably propelling me towards a lonely, cat-related death. (Background: In Sex and the City, Miranda worries that if she dies alone, her cat will eat her, as cats are apparently wont to do). I'm sick of being the ugly single one!

Hmm, I suppose the losing weight bit is possible, anyway.

antimatter-and-gravity

Antimatter and Gravity

Interesting idea, though I would assume it's not original. It is now possible to, horrendously inefficiently, create antimatter. Now, say you could get that rate of efficiency up to above 50%. On reacting with an equal mass of matter, both the antimatter and matter convert more or less entirely to energy. So, for X eV worth of antimatter, (plus some uninteresting matter) you get 2X eV of energy. If you can (A) produce antimatter at greater than 50% efficiency and (B) utilise the energy from the matter/antimatter reaction at 100% efficiency, you've effectively got free energy (except, of course, for the uninteresting matter). Naturally, we're a long way from actually being able to do this sort of thing, but I wonder does it work in principle.

Also, a device to detect gravity waves is about to come online. It will be interesting if it finds anything.

Saturday, July 1, 2006

input-validation-oddities

Input Validation Oddities

I happened to see the FAQ for a site called cartell.ie. It runs some sort of information service for cars. Note the last question. "Ensure you enter the registration correctly without any spaces." Now, an Irish car registration is of the form [0-9]{2}-[A-Z]{1,2}-[0-9]{1,6} more or less; that is, a two digit date, a one or two letter county code, and a registration number ranging from one to six digits. Generally separated by spaces or dashes. Given that the programmer knows what format they're receiving, they could very easily have made allowance for the user entering it in one of those ways, making the site easier and less frustrating to use. So why on earth didn't they?