THANK YOU ALL who sponsored me to do the lizard walk with the FWC Kung fu club on Saturday 25th of April for the Claremonth Project. Together I believe we raised over £3,000 for the charity and it was a fun event altogether.
Page 63
Page 63
THANK YOU ALL who sponsored me to do the lizard walk with the FWC Kung fu club on Saturday 25th of April for the Claremonth Project. Together I believe we raised over £3,000 for the charity and it was a fun event altogether.
My crossword solving website Crosstips now has a cute little chart in the lower right hand corner. It's a sparkline. The line indicates how many searches have been done in the current month. The screenshot was taken on the 28th of April so it's the searches done in April and it's near the right hand side which is the maximum.
These charts are made with Google Chart which is something I've never had the great opportunity to try before.
Making the chart was quite a pleasure actually. I had it up and running within minutes just my looking at some examples. The lib I used to make it happen was pygooglechart which was, despite its lack of documentation, really easy to use.
How useful this sparkline is to the people who try to get unstuck on their crosswords I really don't know but it sure looks cool.
I don't have any stats to back this up but if I look around the office almost a lot of people use Gmail or Hotmail or something web based. My family uses Gmail, Yahoo mail and Hotmail (and me on Gmail) for example. So it bugs me when websites use the mailto:
thing. Especially if they rely on the Subject line.
Here for example, on the EDF Energy Contact us page, they have a long list of "Email us" links. They're almost all going to mailto:customer_correspondence@edfenergy.com
but all with a different subject line:
mailto:customer_correspondence@edfenergy.com?subject=Dual Fuel enquiry
mailto:customer_correspondence@edfenergy.com?subject=Dual Fuel sales enquiry
mailto:customer_correspondence@edfenergy.com?subject=Energy efficiency enquiry
mailto:customer_correspondence@edfenergy.com?subject=Priority Services enquiry
mailto:customer_correspondence@edfenergy.com?subject=Electricity prepayment enquiry
mailto:customer_correspondence@edfenergy.com?subject=Gas prepayment enquiry
mailto:customer_correspondence@edfenergy.com?subject=Home movers enquiry
mailto:customer_correspondence@edfenergy.com?subject=Green Tariff enquiry
mailto:customer_correspondence@edfenergy.com?subject=Meter Reading enquiry
mailto:customer_correspondence@edfenergy.com?subject=Bill payment enquiry
mailto:myaccount@edfenergy.com?subject=MyAccount query
...
Does that mean that I have to somehow copy the Subject line from each so that my email gets routed to the right department? I just don't know. Why can't they have different email address for each thing or a web form where I can email them there and then?
Using mailto:
should be done very sparingly. Considering that most people (like my mom) don't know to right-click and select "Copy email address" I prefer this way to show an email address:
<a href="mailto:more@userfriendly.com">more@userfriendly.com</a>
I've now written my first Git hook. For the people who don't know what Git is you have either lived under a rock for the past few years or your not into computer programming at all.
The hook is a post-commit
hook and what it does is that it sends the last commit message up to a twitter account I called "friedcode". I guess it's not entirely useful but for you who want to be loud about your work and the progress you make I guess it can make sense. Or if you're a team and you want to get a brief overview of what your team mates are up to. For me, it was mostly an experiment to try Git hooks and pytwitter. Here's how I did it:
Truncated! Read the rest by clicking the link below.
This cost me a good hour of debugging so I thought I'd share it in case anybody else stumbles across the same problem. In the end, to solve my problem I had to add debug statements to StringIO.py
to be able to find out where in my Zope Page Template a non-unicode string with non-ascii characters appeared and messed things up.
The error I was getting was this, which I suspect several Zope developers have encountered before:
UnicodeDecodeError: \
'ascii' codec can't decode byte 0xc3 in position 46: ordinal not in range(128)
The traceback only mentions files in the innards of ZPT of which none you can really do anything about. We all know that the key to avoid Unicode error is to be consistent. You can do this:
>>> '\xc3' + 'string'
'\xc3string'
>>> u'\xc3' + u'string'
u'\xc3string'
But you can't do this:
>>> '\xc3' + u'string'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 0:
ordinal not in range(128)
So, how did I get these non-unicode strings into my application in first place. Simple, I have a search parameter q
and end up with a URL like this:
/bla/bla?q=régime
And the template had this little innocent piece of code:
<input tal:attributes="value request/q"/>
That's what f'ed everything up. So, I ended up having to add this:
<input tal:attributes="value python:context.unicodify(request['q'])"/>
With this little helper function in the base class:
def unicodify(self, s):
if isinstance(s, str):
return unicode(s, 'utf8')
return s
So, hopefully by writing this it will help someone else making the same trivial mistake and not wasting their evening with sporadic print statements all over their frameworks code.
Rumor has it's it's $thousands still if you can even buy one. The juicy thing about these is that they promise around 50 hours of battery life since it takes 0 power to show a screen. It only takes power to change the screen which makes it ideal for reading e-books.
Typeracer is a game where you're competing with other typers by trying to write a text as quick as possible. One race takes about 1 minute.
Not only is it very well done and extremely "educational" but it's also fun. Unlike other games of the same genre you're not judged by your speed and accuracy. In Typeracer it's all about speed. Your mistakes is your problem since they stop your speed. It's hard to explain but it just works great. Play it and you'll see.
Having played this I realise that my spelling is absolutely terrible. I've grown to depend on the spellchecker in Firefox and when I'm doing programming I don't have to spell particularly much because I use auto-complete. At the moment I average around 55 words per minute which means I win quite a few races but still far far away from the high scores which start on 100+. Gotto to practice more!
I've got a public ical at: http://m.fwckungfu.com/calendar.ics
This works in Google Calendar and in the iCalendar Validator but when I try to import this as a file in Apple iCal I get this message:
"Error subscribing to the calendar
Data downloaded from http://m.fwckungfu.com/calendar is not valid."
WTF? Who's ass have I not kissed to get this working in Apple iCal? Does anybody know any reason why Apple iCal is being so trixy?
I've now made a simple interface alternative (not AJAX) to Crosstips. This one doesn't do any fancy AJAX to look up works and you just type in the unknown letters as a space (or a _
or a .
or a *
) so you don't have to know how many letters it is.
It feels refreshing somehow to go back from AJAX back to plain old GET requests. The best thing about this is that it will work on a mobile phone too. The way I've wired the page is so that if you visit the site with a mobile device (not an iPhone though) it will load the extremely cut down version of the layout which is more suitable for mobile phones. This means that people will be able to get unstuck doing crosswords in bed.
I'm pretty damn sure I won't pay to see this movie in the cinema. I'm pretty sure I won't want to download it illegally and watch it either. But I have to admit this is a pretty awesome way to show the trailer.
Just watch it and you'll see what I mean.