Here's probably one of the most innovative and clever shop signs I've seen. This is a picture I took when cycling home the other day on Rivington Street
Page 68
Page 68
Here's probably one of the most innovative and clever shop signs I've seen. This is a picture I took when cycling home the other day on Rivington Street
...over PostgreSQL?
I've just read through this document:MySQL vs PostgreSQL and it's obvious paragraph after paragraph that PostgreSQL is the better database. Performance, features and community are all in PostgreSQL's favor. There is almost nothing in MySQL's favor apart from obscure things like faster count(*)
(without conditionals) and built in replication support. In the last two weeks I've also had the great fortune of playing with full textindexing in both MySQL and PostgreSQL and again, MySQL sucks ass and PostgreSQL (8.3) is really impressive and fast. (I've used both databases quite extensively over the past 8 years as a web developer)
I once heard that Google uses MySQL for its user database with a custom built transaction machine. And I read that Google engineers had donated some great code to the MySQL project. But why do they bother? What do they know that other engineers don't? And why is MySQL so popular with cheap stack-em-high LAMP hosting sites?
I do understand that PostgreSQL came off a bad start 5 years ago(ish) when it didn't support Windows which meant that newbies had to use MySQL and that stigma is still lingering but that was a very long time ago.
I guess it takes a lot of convincing to switch from one technology to another once you've set your mind on something. That's why we're human. A proof of this is shown if you scroll down to the bottom of this page there's a little simple survey and despite being on a long article with objective convincing arguments that PostgreSQL is better MySQL is doing quite well. Why?
Doing some on-site consulting on an old Zope CMS that has been developed by many different developers over many years. It's pretty good and has lots of powerful features but over the years certain things have been allowed to slip. One problem was that you couldn't click the "Properties" tab. The reason was that it was trying to fetch properties that didn't exist anymore. What had happened was that the class attribute _properties
(which is used by the "Properties" tab in the ZMI) had been stored as a persistent attribute. Here's how to solve that:
def manage_fixPropertiesProblem(self):
""" fix so _properties becomes a class attribute instead """
if '_properties' in self.__dict__.keys():
del self._properties
return "Awesome!"
When V8 was announced to the world jointly with the launch of Google Chrome there was a lot of buzz about how fast it was.
Then, the guru of Javascript, John Resig couldn't hold back his announcement about Tracemonkey and how it was faster than V8
Now there's a third one that apparently beats them all: SquirrelFish Extreme
"As you can see, SquirrelFish Extreme is 36% faster than V8, and 55% faster than TraceMonkey."
Personally I take all of these things with a shovel of salt since what matters isn't how fast it can compute raw Javascript code but how well it all works together with the browser and the browser's graphic routines and stuff and most importantly how the DOM tree is updated by the Javascript instructions.
Closing note; the most important thing is that there's something happening and this will mean that Javascript becomes more and more reliable for web developers and not just reliable but also faster so apps like Google spreadsheet might one day become usable. To quote John Resig on his closing notes:
"I fully expect to see more, massive, projects being written in JavaScript. Projects that expect the performance gains that we're starting to see. Applications that are number-heavy (like image manipulation) or object-heavy (like relational object structures)."
I have for a long time wondered why I'm supposed to use this in the top of my executable python files:
#!/usr/bin/env python
Today I figured out why.
The alternative, which you see a lot around is something like this:
#!/usr/bin/python
Here's why it's better to use env
rather than the direct path to the executable: virtualenv. Perhaps there are plenty of other reasons the Linux experts can teach me but this is now my first obvious benefit of doing it the way I'm supposed to do it.
If you create a virtualenv, enter it and activate it so that writing:
$ python
starts the python executable of the virtual environment, then this will be respected if you use the env
shebang header. Good to know.
Both in Zope2 and in Django you need to work with attributes called id
. This is a shame since it's such a huge pitfall. Despite having done Python programming for so many years I today fell into this pitfall twice!! The pitfall is that id
is a builtin function, not a suitable variable name. The reason is that I was changing a complex app to use something called the UUID
as the indentifier instead of the ID
which happened to be a name of a primary key in a table.
This meant lots of changes and I tested and tested and kept getting really strange errors. I took the whole thing apart and put it back together when I discovered my error of checking if variable id
was set or not. id
, if undefined, defaults to the builtin function id()
which will always return true on bool(id)
.
It's been a long day. I'm going home. Two newbie mistakes in one programming session. I'm sure I'm not the only one who's been trapped by this.
Watch this speech and listen. It's impressive. As long as I can remember I've always thought the US elections being phoney and very much about the guy (until this year I guess) and his charm, looks and presentation. Unlike politics here in Europe (I've only lived in three European countries) it has always seemed that election campaigns over here are more about the issues and the politicians trying to sell their side of the issues. Until now. This Obama guy does make a difference. He talks about concrete issues, how to solve them, how important they are and actually gives evidence of understanding why they are important. And last but not least, he ridicules the press and the whole election itself for not being about the issues. Quite refreshing.
Please take the time and watch the 6 minute speech.
Sadly the McCain supporters are not going to reach my blog post and watch the video. But if there are, against all odds, any McCain supporters here, what do you think about this speech? Please let me know what you think.
Booking and finding timetables for trains here in the UK sucks. The worst, for me, is when you don't know which London station certain destinations start from. For example, if you're going to take the train to Aberdeen, do those starts start from Victoria, Kings Cross, St Pancras, Paddington, Euston, Liverpool street or London Bridge? Sometimes you even have to know which train company to use!
Accessible UK Train Timetable seems like a great website to remedy this. You can enter a search for something like "London" to "Aberdeen" and it magically works out that Kings Cross is the London station you have to tube yourself to. They've also got this great map which I haven't fully understood yet but seems work. The URLs when you do a search become really friendly too. For example:
http://traintimes.org.uk/london/aberdeen/10:00/2008-09-03
...when I've done a search for London to Aberdeen today. And if you want a timetable that isn't for a particular day just change the URL to this:
http://traintimes.org.uk/london/aberdeen/10:00/
One last thing. Several months ago I found another website for booking trains and finding timetables. It had a blue background I think and was almost equally user-friendly. Only problem is that I can't find it again or remember what it was called. But I think I'll stick with traintimes.org.uk for now.
If you, like me, like Opeth and Pain of Salvation and you like the piano, then do check out Kalle Kappner and his free mp3s on this website. It's beautiful stuff if you, like me, like metal.
I discovered one of his Opeth compositions on Last.fm and tried to buy it from iTunes and Amazon but nothing could be found. I then searched the torrents but nothing there either. Then imagine how happy I became when I found that he's giving them all away on his website.
Here's a great blog tip: Weird Asia News, China, Japan, Korea | Offbeat, Strange, Odd, Crazy, Engrish
It's a constantly updated blog about all things weird happening in Asia. After a quick look it seems most of the entries are about China and Japan but that's fine. I'm definitely bookmarking this on on my Netvibes
It helped me find this awesome documentary about North Korea by VBS.tv. Do check it out.