A family found an image of Jesus in their marmite lid. They mentioned that their kids ate the marmite, but they kept the lid.
So, erm, I hate to bring this up, but I have to ask.
If bread (or at least bread-like cardboard product) is the body of Christ, and wine is the blood of Christ, what is marmite? Er. On second thought, I'm not sure I want to know.
On a related note, why do we never see Mohammed, Yahweh or Satan in common household objects?
Friday, May 29, 2009
Wednesday, May 27, 2009
The Removable Battery War
Of late, we've been seeing a lot of devices with integrated, non-removable batteries. The iPhone and palls, Macbook Air and Macbook Pro 17", many netbooks, and the list goes on. People are very upset about this.
Why do manufacturers go for integrated batteries? Generally because it allows them to provide more battery for a given weight and especially volume, and it cuts down on costs related to battery removal mechanisms, power systems which can tolerate the battery being removed without shutting down, and so forth. Okay, fine. The 17" Macbook Pro in particular gets a very considerable battery life boost out of this; it apparent manages about eight hours for normal use.
However, a lot of people seem to have a knee-jerk reaction to this; a device which does not have a removable battery, the thinking goes, is simply not worth considering. There are a few concerns here. First, a fairly small minority of people actually use more than one battery, and want the freedom to be able to swap batteries when the first runs out. This is a quite legitimate use case, and clearly integrated batteries don't make sense for these people, except possibly where the removable battery life would be less than half that of an integrated one taking up the same space.
Another worry is replacing the battery. Most makers of integrated battery devices do offer replacement, but you generally have to send the device away, and it is often rather expensive. Modern batteries have a maximum number of cycles before they start going downhill quickly, and also a maximum age; a lithium ion battery that has been sitting on a shelf for five years, not even being used, will have lost most of its capacity.
A user may then legitimately worry that their battery is going to die and need to be replaced, but I suspect a lot of people aren't looking at this rationally. Three years might be a reasonable life expectancy for one of these integrated jobs before it becomes annoyingly low-capacity. At that point, if it were a replaceable battery, the user would simply buy a new one. Assuming, of course, that new ones were still being made; this is not always the case. This battery will generally be reasonably expensive; for a mobile phone, probably close to the cost of replacement, and people rarely keep mobile phones for that long, anyway. For that matter, the battery in lower-end laptops will be a significant chunk of the total machine cost. High-end laptops are slightly different; people may well want to keep them more than three years, and a battery will be a small part of the cost of replacement.
A third worry, and I think, in practice, the one which is actually driving the outrage, is "They are taking away a capability I used to have!" People don't possibly conciously realise that this is why they have a problem with the idea, but it fits the facts better. In practice, not many people purchase replacement batteries for anything. In particular, they do not replace batteries in mobile phones. The average lifespan of a mobile phone is considerably less than its battery. For more expensive devices, the inconvenience of having the manufacturer replace the battery at a slightly higher cost after three years, if they even keep it that long, should pale compared to the convenience of higher capacity, smaller device and/or lower purchase price which come with the integrated battery in the first place.
No doubt, there are some devices where an easily-replaceable battery makes sense, and those devices will continue to use removable batteries. However, for most normal consumer devices, the advantages of the integrated battery would seem to greatly outweigh the downsides. I'd be quite surprised if basically all mobile phones, at least, don't have them in the next couple of years.
Why do manufacturers go for integrated batteries? Generally because it allows them to provide more battery for a given weight and especially volume, and it cuts down on costs related to battery removal mechanisms, power systems which can tolerate the battery being removed without shutting down, and so forth. Okay, fine. The 17" Macbook Pro in particular gets a very considerable battery life boost out of this; it apparent manages about eight hours for normal use.
However, a lot of people seem to have a knee-jerk reaction to this; a device which does not have a removable battery, the thinking goes, is simply not worth considering. There are a few concerns here. First, a fairly small minority of people actually use more than one battery, and want the freedom to be able to swap batteries when the first runs out. This is a quite legitimate use case, and clearly integrated batteries don't make sense for these people, except possibly where the removable battery life would be less than half that of an integrated one taking up the same space.
Another worry is replacing the battery. Most makers of integrated battery devices do offer replacement, but you generally have to send the device away, and it is often rather expensive. Modern batteries have a maximum number of cycles before they start going downhill quickly, and also a maximum age; a lithium ion battery that has been sitting on a shelf for five years, not even being used, will have lost most of its capacity.
A user may then legitimately worry that their battery is going to die and need to be replaced, but I suspect a lot of people aren't looking at this rationally. Three years might be a reasonable life expectancy for one of these integrated jobs before it becomes annoyingly low-capacity. At that point, if it were a replaceable battery, the user would simply buy a new one. Assuming, of course, that new ones were still being made; this is not always the case. This battery will generally be reasonably expensive; for a mobile phone, probably close to the cost of replacement, and people rarely keep mobile phones for that long, anyway. For that matter, the battery in lower-end laptops will be a significant chunk of the total machine cost. High-end laptops are slightly different; people may well want to keep them more than three years, and a battery will be a small part of the cost of replacement.
A third worry, and I think, in practice, the one which is actually driving the outrage, is "They are taking away a capability I used to have!" People don't possibly conciously realise that this is why they have a problem with the idea, but it fits the facts better. In practice, not many people purchase replacement batteries for anything. In particular, they do not replace batteries in mobile phones. The average lifespan of a mobile phone is considerably less than its battery. For more expensive devices, the inconvenience of having the manufacturer replace the battery at a slightly higher cost after three years, if they even keep it that long, should pale compared to the convenience of higher capacity, smaller device and/or lower purchase price which come with the integrated battery in the first place.
No doubt, there are some devices where an easily-replaceable battery makes sense, and those devices will continue to use removable batteries. However, for most normal consumer devices, the advantages of the integrated battery would seem to greatly outweigh the downsides. I'd be quite surprised if basically all mobile phones, at least, don't have them in the next couple of years.
Labels:
annoyances,
batteries,
consumer goods,
Technology
Sunday, May 24, 2009
Filthy, perverted animals!
Vast quantities of recent research into gay sheep, necropheliac ducks, auto-fellating sheep, lesbian seagulls and so on seems to show that animals are far kinkier than previously thought.
No doubt the American right will shortly engage on a War on Animals. Given that they also tend to object to vegans (and PLANTS, with their polyploidy, are clearly libertines), this will lead them to subsist on dust. This will have a marked effect on Rush Limbaugh, noted wobbly druggie king of the Republicans. Yay!
Funnily enough, this important issue was brought up 40 years ago, in Monty Python's gay mollusc sketch.
I wonder am I a bad person for thinking it would be really terribly funny if these bigoted loons starved themselves to death on moral grounds?
No doubt the American right will shortly engage on a War on Animals. Given that they also tend to object to vegans (and PLANTS, with their polyploidy, are clearly libertines), this will lead them to subsist on dust. This will have a marked effect on Rush Limbaugh, noted wobbly druggie king of the Republicans. Yay!
Funnily enough, this important issue was brought up 40 years ago, in Monty Python's gay mollusc sketch.
I wonder am I a bad person for thinking it would be really terribly funny if these bigoted loons starved themselves to death on moral grounds?
No news is bad news
From the BBC:
- 'Reporters paid way into palace' - This is the TOP STORY
- Another MP expense claim - Really, who cares at this point?
- Something about face transplants
- Another gay priest, this time in the Church of Scotland
- Ex-president of South Korea killed self
- Dispute over who's allowed say 'Allah', in Malaysia.
- Iran blocks Facebook - They didn't block it before? They have the internet?
- 'Grenade' brought to helpdesk - BBC inappropriate quoting syndrome
- Franco's testicles expose - The media takes far too much interest in the naughty bits of Fascist dictators. Why don't we hear more about Stalin's balls?
- 'Apology over chef's omelette contest swear word' - What?
- Cheap weddings!
- 'High costs fuel record losses at BA' - It is a PUN, you see. Because the high costs were due to expensive jet fuel. Yay!
- Oh, no, Susan Boyle again.
- Something about Windows 7, of all things.
- 'Russia is making plans to detach and fly away its parts of the International Space Station' - Only after the rest of the thing is scrapped, disappointingly; this would otherwise be hilarious.
That's all from the front page, and is therefore the news considered most interesting. It is basically all rubbish.
This can't be good. They're probably covering up a nuclear war, or something. (During the Cold War, some nations planned to do exactly this in the event of a nuclear war; switch news coverage to non-threatening rubbish).
Angels and Demons
Something to do with the Catholic Church and antimatter, it seems. Yes, antimatter. At least as silly as, say, those later episodes of Star Trek Voyager where they went back in time every separate episode.
So not watching.
So not watching.
Saturday, May 23, 2009
Dramatisations! Now for bacteria, too!
Seen on TV ad: 3d animation of Danone Actimel repelling 'bad bacteria', through magic. In the top right corner, in small print: "Dramatisation"!
As opposed to one of those bacteria ads where they inserted an actual camera in somebody's stomach, then? Still, dramatisation sounds like the wrong term.
As opposed to one of those bacteria ads where they inserted an actual camera in somebody's stomach, then? Still, dramatisation sounds like the wrong term.
Trying Twitter again
Twitter is, of course, terribly popular, but it always got on my nerves a little bit. One of my biggest issues with it was that once the IM notifications went away one day, and never came back, there was no sensible way to watch it. The client apps are pretty much invariably terrible.
But! The newest beta of Adium, the MacOS IM client with the bird icon, has quite nice Twitter integration! So I'm giving it another try; if nothing else, I am now following just about everyone who is following me. Yay!
My Twitter is here.
But! The newest beta of Adium, the MacOS IM client with the bird icon, has quite nice Twitter integration! So I'm giving it another try; if nothing else, I am now following just about everyone who is following me. Yay!
My Twitter is here.
Heheh, Demonware timeline
So, someone put together this lovely timeline of the company I used to work for (Demonware, now part of Activision Blizzard Vivendi Fax Machine Goat), with a weird tool called Dipity. It has things like game releases and people joining the company.
My hiring (in 2006! Eek!) is commemorated with this bizarre photo:
I have no idea where that was taken, or why I have that weird expression/hand-motion in it. I still wear that jumper regularly, though; it is starting to wear out.
My hiring (in 2006! Eek!) is commemorated with this bizarre photo:
I have no idea where that was taken, or why I have that weird expression/hand-motion in it. I still wear that jumper regularly, though; it is starting to wear out.
Perplexing Amazon EC2 bug
Amazon EC2 is Amazon's thingy where you can rent computer time. This is rather like the 60s, but simultaneously very modern, and probably connected to a CLOUD in some way! Yay!
Anyway, one of the things that you can and should do is that when you have your virtual machine set up just as you like it, you should make an image of it, so that you can deploy multiple clones of it.
Here is the procedure.
Anyway, one of the things that you can and should do is that when you have your virtual machine set up just as you like it, you should make an image of it, so that you can deploy multiple clones of it.
Here is the procedure.
- Put your super-sekrit keys in the /mnt directory (where, breaking with convention, a filesystem is mounted directly).
- Install ec2 tools.
- Curse, and remember that you need Java for them.
- Install Java, making sure to accept Sun's (or Oracle's!) huge license agreement indicating that you are not a nuclear power plant, which pops up unexpectedly when you run apt-get, making baby Stallman cry.
- Type ec2-bundle-vol -d /mnt/img -k mysecretkey.pem --cert mycert.pem -u [long number] my-lovely-image --arch x86_64
- Wait
- Now, do ec2-upload-bundle -b mynicebucket -m my-lovely-image.manifest.xml
- Wait
- Notice that it has failed for no good reason, with no sensible error message. Recall that these things must be smaller than 10gb. Delete stuff until smaller than 10gb, bundle and upload again.
- Yay! It worked!
- Go to the browser admin interface.
- No, not with Safari, with Firefox. Otherwise it won't work.
- Go to the AMI section, click 'Register New'.
- Paste in link given to you by the upload stage.
- Note that it looks okay on a cursory branch.
- Shut down VM, because you don't need it now that you have an image of it.
- Days later, attempt to start a new one from the image.
- Note that while the screen to start it up comes up, it doesn't give you the option to choose a VM type. Fill in other details and click start. Note that it complains that you haven't chosen a VM type, but that it also won't let you.
- Note that in the image description, the 'architecture' bit says 'undefined'.
What has gone wrong? Any ideas?
Well, you put a dash in your image name. Which is FORBIDDEN. Obviously. Not that the bundling script warns you of this, or that it's documented anywhere, or anything. Start again, without dashes, and note that it works this time.
Fortunately, I did not shut down the VM until I had checked I could launch it. Because I am PARANOID. One does not get far doing this sort of sysadmin-y task unless one is paranoid.
You learn something new every day, eh?
Bonus EC2 annoyance. When starting an image, you are asked whether you would like it in US East, US West, Europe or somewhere else. Fine so far, right? Ah, but. Click the 'advanced' tab, and you will be given the option to choose from one of three zones (seemingly datacenters), 'a', 'b' and 'c'. If you are foolish enough to assume that you don't have to click the advanced tab when starting any old image, you will simply be assigned to one of these randomly. This almost never matters, except quite often; latency between zones is far higher than within zones.
Bah.
Thursday, May 21, 2009
Terrifying demon-creature Declan Ganley more terrifying than usual
Pop quiz.
Quotation A:
[Country] needs to reaffirm its commitment to freedom, family, faith...
Quotation B:
[Country] regards Christianity as the foundation of our national morality, and the family as the basis of national life.
Now. Which was Declan Ganley, and which was Adolf Hitler?
Quotation A:
[Country] needs to reaffirm its commitment to freedom, family, faith...
Quotation B:
[Country] regards Christianity as the foundation of our national morality, and the family as the basis of national life.
Now. Which was Declan Ganley, and which was Adolf Hitler?
Wednesday, May 20, 2009
Politics Fail
And when entering the labels for the previous post, Blogger suggested 'Finna Fail' when I typed 'fail'. Yay! Clearly, Google are attempting to catch up with Wolfram Alpha in the machine learning arena.
Sunday, May 17, 2009
Eurovision... in SPACE
So, this year's Eurovision contest, hosted in Russia, was on today. The start of the voting was announced by... the crew of the International Space Station. Or, more precisely, two of them, the Russian and Japanese ones. Presumably the US one wasn't allowed to participate due to the current toilet dispute. If it'd been a week later, there'd have been six people there, two of them actually European, but that's life.
Important space station facts learned: (1) It has a terrible camera. (2) The laptops were running Windows XP, presumably due to high licensing costs for Windows Vista Space Station Edition.
Also, the interval show largely involved a woman telling us that Russia is not in fact a totalitarian police state. That there had been high-profile police suppression of a gay rights march the same day was, perhaps, unfortunate.
We also learned that it was warm and sunny in Moscow today. Google Weather tells me that this was a blatant lie.
Important space station facts learned: (1) It has a terrible camera. (2) The laptops were running Windows XP, presumably due to high licensing costs for Windows Vista Space Station Edition.
Also, the interval show largely involved a woman telling us that Russia is not in fact a totalitarian police state. That there had been high-profile police suppression of a gay rights march the same day was, perhaps, unfortunate.
We also learned that it was warm and sunny in Moscow today. Google Weather tells me that this was a blatant lie.
Golfing on the sly
I was searching for illegal something-or-other the other day, as you do. And these were Google's suggestions when I had entered the 'illegal' bit.
'Illegal golf clubs'? Really? How does that work? They'd be hard to hide, surely.
Note also that Google's search suggestion thing is apparently regionalised.
'Illegal golf clubs'? Really? How does that work? They'd be hard to hide, surely.
Note also that Google's search suggestion thing is apparently regionalised.
Wolfram Alpha Instant Review
Wolfram Alpha is a sort of search engine/knowledge base thing from Wolfram, who make Mathematica. It just launched today.
The idea is that you ask it for information, and it gives it to you. Sometimes this works, and sometimes it does not.
Here's the result for Skylab, a largely failed space station. We are told that it has now descended to Earth, which is correct.
Here is a result for Buran, the Soviet space shuttle. Note that it is apparently still in orbit after 20 years. Eek! Has anybody been told?
Here's what happens when it breaks, as is happening a lot in this launch period. Note the query string.
It's good at chemistry.
It's not so good at animals.
Is slowness really a proper thing?
There are nice quantity graphs.
Novelty measurements can be used, though it sadly does not know the word 'forthnight'.
Some results are just bizarre.
And some, are, well, doubtful. (What happened in 2002?)
Things are not generally as clickable as you might like. For instance, you might expect the constituent countries below to be clickable. And you would be disappointed.
Also, see the map? It's one of the few you will see, because the promised maps for things like GDP or fax machine production or whatever don't work at the moment.
Note also that you get that rather nice font that Mathematica uses.
Overall, I really like this, and I think it will get a lot better (especially after important stoat data is added and maps are working again; expect all demographic-y maps on Wikipedia to be from this within the next few months), but I don't see how they even vaguely imagine they could make any money from it.
The idea is that you ask it for information, and it gives it to you. Sometimes this works, and sometimes it does not.
Here's the result for Skylab, a largely failed space station. We are told that it has now descended to Earth, which is correct.
Here is a result for Buran, the Soviet space shuttle. Note that it is apparently still in orbit after 20 years. Eek! Has anybody been told?
Here's what happens when it breaks, as is happening a lot in this launch period. Note the query string.
It's good at chemistry.
It's not so good at animals.
Is slowness really a proper thing?
There are nice quantity graphs.
Novelty measurements can be used, though it sadly does not know the word 'forthnight'.
Some results are just bizarre.
And some, are, well, doubtful. (What happened in 2002?)
Things are not generally as clickable as you might like. For instance, you might expect the constituent countries below to be clickable. And you would be disappointed.
Also, see the map? It's one of the few you will see, because the promised maps for things like GDP or fax machine production or whatever don't work at the moment.
Note also that you get that rather nice font that Mathematica uses.
Overall, I really like this, and I think it will get a lot better (especially after important stoat data is added and maps are working again; expect all demographic-y maps on Wikipedia to be from this within the next few months), but I don't see how they even vaguely imagine they could make any money from it.
Labels:
fun,
review,
wolfram alpha
Friday, May 15, 2009
Your snack foods are made out of radioactive waste, now!
From an ad for Nutella: "... And Nutella releases its energy slowly!"
Just like Caesium-137.
Case closed.
Update: Oh, and I thought I was just messing. A quote: Currently at Sellafield the high-level waste (PUREX first cycle raffinate) is mixed with sugar and then calcined.
Dear me.
Just like Caesium-137.
Case closed.
Update: Oh, and I thought I was just messing. A quote: Currently at Sellafield the high-level waste (PUREX first cycle raffinate) is mixed with sugar and then calcined.
Dear me.
Thursday, May 14, 2009
Torture, glorious torture
So, apparently Obama is not going to let us see the torture photos. Which is odd. I mean, at this point we all pretty much assume that prisoners were waterboarded, subjected to the rack, had MKULTRA techniques used on them, sodomised by Dick Cheney, required to watch all three instalments of High School Musical, and so forth. What is there in there that is so horrible that it's worse than the things we will naturally imagine if not shown it? Bizarre.
Speaking of torture, this grinning Republican loon says that torture is okay because it has worked for the last 500 years. Hear that? They may be busy with the Muslims now, but make no mistake; after they have run out of Islamists, they will come for the Jews, the homosexuals, and, of course, the witches. Say your prayers, Harry Potter.
Speaking of torture, this grinning Republican loon says that torture is okay because it has worked for the last 500 years. Hear that? They may be busy with the Muslims now, but make no mistake; after they have run out of Islamists, they will come for the Jews, the homosexuals, and, of course, the witches. Say your prayers, Harry Potter.
Friday, May 8, 2009
Disturbing totalitarianism fact of the day!
Kim Jong Il, dictator of wacky old North Korea, claims to be an 'Internet expert', it seems.
But is he on Twitter? Enquiring minds wish to know.
Update: Oh, god, he is. Or North Korea is, anyway; it just broadcasts their insane propaganda news site.
But is he on Twitter? Enquiring minds wish to know.
Update: Oh, god, he is. Or North Korea is, anyway; it just broadcasts their insane propaganda news site.
Labels:
kim jong il,
north korea,
twitter
Thursday, May 7, 2009
Erlang-based Comet proxy, with sample game
Comet is a name given to a HTTP push system; that is, it allows a web server to send messages to clients in real time. It's used for things like GMail Talk and Facebook Chat. I've always been a little surprised that it isn't used more, but it generally isn't all that accessible as a technology.
Anyway, with that in mind, I spent Monday (which was, conveniently, a public holiday) extending Erlycomet, an Erlang-based Comet server, to allow passing off application logic to another app. Erlang is a nice language for writing things like a Comet server, but not necessarily such a nice one for writing a game backend, say.
What I ended up with is far from perfect, and in particular the initial method of communication (HTTP GET requests) between Erlycomet and the backend is dreadful; if I was using this for something real I'd probably go with Thrift, or at least XML-RPC, instead. It works, though, to an extent. It needs a bit more work, but once it's slightly nicer I'll release source.
Why on Earth might someone want to use something like this? Well, it allows the writing of web applications which can send messages to each other and/or receive them from a third-party source in real time, without using server-expensive polling, and without relying on something like Flash or necessarily being able to connect to arbitrary sockets. The mechanism used, in this case, is so-called long-polling; the browser makes a HTTP request to the server, and the server doesn't bother answering until it has a message for the browser; the browser then receives the message and opens a new connection, awaiting the next one.
Erlang's quite good at handling tens of thousands of connections, and in principle a system like this could handle tens of thousands (or, in this contrived example, a million) clients at a time, only bothering the non-Erlang application logic section when it had work for it. The Erlang section can handle simple things like chat and instant messaging itself, without talking to the backend (except for authentication, if you need it).
Here's a playable demo; a real-time multiplayer tic-tac-toe game. Just open it in two different browsers, enter the same game name in each, and you'll be able to play. Please note that you should try to pick a unique name, as the Javascript for dealing with the situation where the game is full is a little broken. :) Note that it doesn't presently work on IE6; it does, however, work on the iPhone:
It turns out to be surprisingly usable on EDGE; under half a second's delay before making a move and seeing it on the computer.
This application uses a (hastily-implemented, not very good, and certainly not production-quality) Python backend, but you could use just about anything. Here's the backend source:
games[gamename] = game
if int(player) == 1:
parsed_path = urlparse.urlparse(self.path)
Anyway, with that in mind, I spent Monday (which was, conveniently, a public holiday) extending Erlycomet, an Erlang-based Comet server, to allow passing off application logic to another app. Erlang is a nice language for writing things like a Comet server, but not necessarily such a nice one for writing a game backend, say.
What I ended up with is far from perfect, and in particular the initial method of communication (HTTP GET requests) between Erlycomet and the backend is dreadful; if I was using this for something real I'd probably go with Thrift, or at least XML-RPC, instead. It works, though, to an extent. It needs a bit more work, but once it's slightly nicer I'll release source.
Why on Earth might someone want to use something like this? Well, it allows the writing of web applications which can send messages to each other and/or receive them from a third-party source in real time, without using server-expensive polling, and without relying on something like Flash or necessarily being able to connect to arbitrary sockets. The mechanism used, in this case, is so-called long-polling; the browser makes a HTTP request to the server, and the server doesn't bother answering until it has a message for the browser; the browser then receives the message and opens a new connection, awaiting the next one.
Erlang's quite good at handling tens of thousands of connections, and in principle a system like this could handle tens of thousands (or, in this contrived example, a million) clients at a time, only bothering the non-Erlang application logic section when it had work for it. The Erlang section can handle simple things like chat and instant messaging itself, without talking to the backend (except for authentication, if you need it).
Here's a playable demo; a real-time multiplayer tic-tac-toe game. Just open it in two different browsers, enter the same game name in each, and you'll be able to play. Please note that you should try to pick a unique name, as the Javascript for dealing with the situation where the game is full is a little broken. :) Note that it doesn't presently work on IE6; it does, however, work on the iPhone:
It turns out to be surprisingly usable on EDGE; under half a second's delay before making a move and seeing it on the computer.
This application uses a (hastily-implemented, not very good, and certainly not production-quality) Python backend, but you could use just about anything. Here's the backend source:
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import cgi
import urlparse
import urllib
games = {}
class CometHandler(BaseHTTPRequestHandler):
def join_game(self, clientId, gamename):
global gamesif not games.get(gamename):
games[gamename] = {"player1": None,
"player2": None,
"turn": 1,
"board": [0,0,0,0,0,0,0,0,0]}if not games[gamename]['player1']:
player = 1
games[gamename]['player1'] = clientId
elif not games[gamename]['player2']:
player = 2
games[gamename]['player2'] = clientId
else:
player = 0print "Joining %s to %s" % (gamename, clientId)
f = urllib.urlopen("http://127.0.0.1:3000/command?clientId=%s&joinedAs=%s&state=joined" % (clientId, player))
s = f.read()
f.close()if player == 2:
f = urllib.urlopen("http://127.0.0.1:3000/command?clientId=%s&joinedAs=%s&state=otherjoined"
% (games[gamename]['player1'], player))
s = f.read()
f.close()def make_move(self, clientId, gamename, move, player):
global gamesgame = games[gamename]
res = None
move = int(move)-1if game['turn'] != int(player):
res = 'wronguser'
elif not game['player1'] or not game['player2']:
res = 'oneuser'
elif game['board'][move] != 0:
res = 'spacetaken'
else:
game['board'][move] = int(player)
if int(player) == 1:
game['turn'] = 2;
else:
game['turn'] = 1;res = 'played'
games[gamename] = game
if int(player) == 1:
other = game['player2']
else:
other = game['player1']
move = move + 1win = False
if res == 'played':
print "Played %s %s" % (player, move)
f = urllib.urlopen("http://127.0.0.1:3000/command?clientId=%s&state=%s&player=%s&move=%s"
% (other, res, player, move))
s = f.read()
f.close()f = urllib.urlopen("http://127.0.0.1:3000/command?clientId=%s&state=%s&player=%s&move=%s"
% (clientId, res, player, move))
s = f.read()
f.close()def do_GET(self):
parsed_path = urlparse.urlparse(self.path)
form = cgi.parse_qs(parsed_path.query)method = form['method'][0]
if method == 'join_game':
res = self.join_game(form['clientId'][0], form['gamename'][0])
elif method == 'make_move':
res = self.make_move(form['clientId'][0], form['gamename'][0],
form['move'][0], form['player'][0])self.send_response(200)
self.end_headers()
self.wfile.write("Meep")
def main():
try:
server = HTTPServer(('127.0.0.1', 5123), CometHandler)
server.serve_forever()
except:
print "Eeep"
server.socket.close()if __name__ == '__main__':
main()
Tuesday, May 5, 2009
Monday, May 4, 2009
Perplexing spam of the day
Spam the first:
* Certified coders earn up to $35,000 per year
Google tells me that that is about 26,000 euro. So that is the cap on a programmer's (I assume, perhaps wrongly, that that is what a coder is) salary? Ouch.
Spam the second:
Hydroxycut is a weight loss drug, which is poisonous and evil. This is apparently an offer. They are telling me that it will kill me, then referring to the whole thing as an offer. Eek.
* Certified coders earn up to $35,000 per year
Google tells me that that is about 26,000 euro. So that is the cap on a programmer's (I assume, perhaps wrongly, that that is what a coder is) salary? Ouch.
Spam the second:
Hydroxycut is a weight loss drug, which is poisonous and evil. This is apparently an offer. They are telling me that it will kill me, then referring to the whole thing as an offer. Eek.
Terrible explanation of technology of the week
From here:
Funnily enough, it's from the blog of a PR person who thinks that bloggers need to be regulated. You know, like newspapers are. (Except of course, they are not; newspapers print total nonsense all the time.)
Reading this, I do wonder if perhaps the regulation of people who write misleading rubbish about computers is called for?
Bonus:
Really?! Has anybody told them yet?
Cloud computers allow the remote storage of huge densities of data, often in large internet hotels in the US; it is this remoteness that has led them to be termed 'cloud', as if the information literally comes out of the clouds.
Funnily enough, it's from the blog of a PR person who thinks that bloggers need to be regulated. You know, like newspapers are. (Except of course, they are not; newspapers print total nonsense all the time.)
Reading this, I do wonder if perhaps the regulation of people who write misleading rubbish about computers is called for?
Bonus:
Most people who use the internet will have been using cloud computers for some time; sites like YouTube, Facebook and Bebo all use cloud computer networks to store all the information that people upload.
Really?! Has anybody told them yet?
Sunday, May 3, 2009
Chinese lamb with cumin
Back when I worked on Parnell Street, we'd often go to one of the many, many local Chinese restaurants for lunch. (I now work on Pearse Street, where local food choices include two Spars and the Trinity College cafeterias, unfortunately...) Anyway, in this country at least, we tend to think of 'Chinese' food generally meaning Cantonese.
There was one restaurant which had an amazingly good dry fried lamb dish with cumin seeds. (It also had free tea, and was generally pretty cheap.) Very nice, but not at all what I'd be used to thinking of as Chinese food. It turns out that it is probably from Xinjiang or Sichuan, and it seems to be a very well-known dish; I even found a recipe! Might have a go at making it sometime, though lamb in non-chop form can be surprisingly tricky to find.
Update: While trying to figure out where this was from, I found a listing of restaurant reviews in Shanghai. There in a Yunnan (apparently a southern province) restaurant whose name means 'Southern Barbarian'! I'm not sure that you'd get away with that sort of thing here...
There was one restaurant which had an amazingly good dry fried lamb dish with cumin seeds. (It also had free tea, and was generally pretty cheap.) Very nice, but not at all what I'd be used to thinking of as Chinese food. It turns out that it is probably from Xinjiang or Sichuan, and it seems to be a very well-known dish; I even found a recipe! Might have a go at making it sometime, though lamb in non-chop form can be surprisingly tricky to find.
Update: While trying to figure out where this was from, I found a listing of restaurant reviews in Shanghai. There in a Yunnan (apparently a southern province) restaurant whose name means 'Southern Barbarian'! I'm not sure that you'd get away with that sort of thing here...
Subscribe to:
Posts (Atom)



















