JS Fireworks

May 9th, 2009

I’ve just submitted my Chrome Experiment - JavaScript Fireworks.
http://js-fireworks.appspot.com/

This amuses me because it’s such an old-fashioned idea. A bit like snow on your website, it’s a very nineties theme and I suspect I’ll have a lot of ex-Geocities users asking me how to include it on their pages.

I’m particularly pleased with the TinyURL inclusion, just for the hell of it :) And I look forward to tracking the messages via Google Analytics.

It’s no revolution (some of those experiments are awesome), and it’s not very Chrome-specific. Firefox handles the canvas better now, and Safari is very fast. Should I use excanvas to support IE???
Anyways, I’m pleased with the effect.

Update (12 May 2009):
No response so far (snif). I saw some hits from California, and one message sent saying “Not Your Mother’s JavaScript” - which is the experiments’ tagline. Fingers still crossed.

Update (13 May 2009):
Some quick updates: IE support! Really shows off the awesome excanvas library. But it’s a bit slow. I’ve intentionally not reduced the activity in IE to show the performance difference. Also, changed the default message. :)
Also, allowed click events to bring up the window, so it’s a bit more useable.

Update (16 May 2009):

Added various controls to experiment with. Time and gravity controls are fun. Toyed with framerate and number of sparks sliders, but didn’t work out.

Update (21 May 2009):

Added credit for the font, which was a free font, BM Receipt, passed through Cufon Generator to get each point as a JavaScript array, then stripped back to remove the lines, leaving just the points.

Intermediate tables in Django

April 20th, 2009

Intermediate, intermediary, join tables in Django are something I’ve just ranted about on Twitter. Twitter’s great, because rants are limited to 140chars, so you don’t look so silly when you find the answer in the documentation.

Django’s documentation says that you can add ManyToMany join tables using the “through” parameter.
http://docs.djangoproject.com/en/dev/topics/db/models/#extra-fields-on-many-to-many-relationships

That table can hold useful extra fields. The documentation shows how to query against those fields, but not how to return them to view.

Ideally, we want to return them in a template. My example is a school with members, and a year for each.

Models:

class School(models.Model):
name = models.CharField(max_length=200)
members = models.ManyToManyField(Member, through='SchoolMember')

class Member(models.Model):
name = models.CharField(max_length=200)

class SchoolMember(models.Model):
member = models.ForeignKey(Member)
school = models.ForeignKey(School)
year = models.IntegerField(default=1900)

Template:

{% for myschool in myschoollist %}
{{ myschool.name }}
{% for myschoolmember in myschool.schoolmember_set|dictsort:"year"?%}

{{ myschoolmember.year }}
{{ myschoolmember.member.name }}
{% endfor %}
{% endfor %}

I think this works, but I’m not sure it’s optimal. Can anyone set me straight?

Updated: ?I’ve added sorting to show each year in order.

All about ME

March 28th, 2009

Something I’ve meant to do for ages is to write up what it’s like to have ME, mostly so that when I look back and don’t remember all the detail, hopefully when I’m finally clear of this thing, then I don’t feel that I’ve missed out, or was complaining unnecessarily.

Read the rest of this entry »

Wedding Site Update

March 24th, 2009

I’ve just updated our wedding website.

http://kenneth.kufluk.com/wedding/

The website has all the details of our plans for the day, so if you’ve just got an invitation but aren’t sure what to do, have a look at the website, then send your RSVP in. We’ll need to know your numbers (number of adults, number of children with ages), and of course your eating needs (veggie/vegan/carnivore).

If you haven’t got an invitation, but were expecting one, just wait for the postman. :)

For those that think I’m a design genius - sorry it ain’t so. I’ve taken a templatemonster site, and adapted it.

SEO Ins and Outs

February 27th, 2009

There are lots of SEO agencies around now.
When I first heard of them, I was baffled. Optimizing a site for search is something I consider an everyday part of my job. The thought of paying an external agency a small fortune to review my work seems like a waste of money.

Having now worked with a couple of these agencies, my view hasn’t changed. However, I have come to understand a little what they might be useful for.

Read the rest of this entry »