Blog

September 25, 2007 08:43 +0000  |  Blogger Geek Stuff 'Round-the-World Switzerland Travel 6

Pavel will appreciate this, but the rest of you might wanna read this anyway. I've added a single thing to my site that *should* fix the problem some of you have been running into when trying to post comments. For some reason, when some people tried to post a comment with a non-ASCII character in it (like curly quotes or non-English characters) the post would get truncated. I *think* I've fixt this by adding a charset definition to the HTTP headers. Apache will do this transparently when you add this to your VirtualHost.

AddDefaultCharset UTF-8

So, don't necessarily go about trying to break my site by posting fake comments, but if you post something and it doesn't come through exactly as you intended, please email me what you sent and I'll try to figure out what broke.

Oh, and I'm in Geneva today. So far, it sucks. The town is small, noisy, dirty and kinda ugly. No snow, not much in the way of mountains, just cold. I'll be going up to the UN headquarters today as well as the Red Cross museum though. That should be interesting :-)

September 16, 2007 22:20 +0000  |  Blogger Geek Stuff 4

Rather than post about fun European stuff, I thought that I would mention that I spent the 5hour train ride from Amsterdam to Berlin fixing stuff on my site. Namely, I've fixed the whole site (and my server as a result) to use UTC, (or GMT as the non-geek might call it) as well as allow each logged-in person to set a personal timezone.

This has the following effects:

  • You'll have to log-in again. I had to delete the history of who was logged in, so your cookies are no longer valid. Just login and the site will remember you from now on as it did before.
  • Times stated on the site (like on blog posts, comments and images) will be displayed in UTC unless (a) you're logged in, and (b) you've selected a timezone other than UTC. I've manually set all of your timezones to what I figured was local for you, so you may not need to do anything special.
  • When commenting, your personal info will be pre-filled for you. You can change this stuff by going to the Preferences section above.

As with any big site change, there's bound to be stuff I've missed. If you see something, please let me know about it and I'll fix it as soon as I can.

September 09, 2007 07:51 +0000  |  Blogger 'Round-the-World 2

You may have noticed that my site went away today (some of you did and even txt-messaged me about it -- thank you!). This will probably be a common thing for the next couple months due in part to the fact that my site is hosted at Melanie's house on a pseudo-static IP and a flakey router.

Under the circumstances, it's really the best setup I can get and I'm really appreciative of Melanie for tolerating the presence of my server stuff in her place for the next few months so I can blog from Europe and post pictures etc. Just remember that since I'm not around to watch to see if Rogers changes my IP (as it did today), I can't fix things right away. There may be some downtime and delays if stuff blows up and I'm offline for a few days. Don't worry. I'm not dead, just offline :-)

When I get back home, I'll have to look into good ISPs in Vancouver. Any suggestions would be welcome.

August 31, 2007 15:32 +0000  |  Blogger Geek Stuff 0

I ran into something interesting this morning while trying to patch some bugs in my blogger that I thought I should share. In short, you shouldn't use GROUP BY statements in a VIEW if you intend to benefit from any indexes on the original columns. Basically, the GROUP BY nullifies the index.

To explain further, I'll include the example I was working on here.

I have a caching table called c_blog that's populated by a more complex query on blog post creation or comments. That table has the following structure:

CREATE TABLE c_blog (
    id INT UNSIGNED NOT NULL,
    title VARCHAR(255),
    content MEDIUMTEXT,
    music VARCHAR(255),
    created DATETIME,
    modified DATETIME,
    comments INT UNSIGNED NOT NULL,
    private BOOL,
    worksafe BOOL,
    favourite BOOL,
    allowComments BOOL,
    UNIQUE(id),
    FULLTEXT(title,content),
    KEY(created),
    KEY(private),
    KEY(worksafe),
    KEY(favourite),
    KEY(allowComments)
);

Note the FULLTEXT index on title and content. I use this in my search section to get sorted results based on relavence.

However, security is handled by means of a view. I find out what kind of user you are, and select the appropriate view to use so the right people see the right stuff. However, the v_blog_private view looked like this:

CREATE OR REPLACE VIEW `v_blog_private` AS
SELECT
    v.id,
    v.created,
    v.modified,
    v.content,
    v.title,
    v.music,
    v.comments,
    v.private,
    v.worksafe,
    v.favourite,
    v.allowComments,
    l.user
FROM
    v_blog v
LEFT JOIN
    blog_lkp_blogUser l ON l.blog = v.id
GROUP BY
    v.id;

And running that view in my search section blew up with the following error:

Can't find FULLTEXT index matching the column list

Now, clearly, the FULLTEXT index was there. The problem comes with the fact that the GROUP BY statement in the view was generating a completely different result set that was in itself not indexed.

The solution was simple enough, just move the GROUP BY out of the view and into the actual query calling the view. But the problem confused me enough that I figured I should post it here for others to find.

August 29, 2007 13:05 +0000  |  Blogger 3

I've installed some simple code to rotate the header above so now the site should be a little prettier. More prettiness coming... as soon as I figure out how to make stuff pretty :-)

August 24, 2007 14:54 +0000  |  Blogger Moving 1

About 5years ago, two strange men came to my house, gave me a piece of paper and walked off with all of my worldly possessions. Yesterday morning, it happened again.

I'm officially bedless. The movers showed up yesterday, picked up nearly everything I had and loaded it into a tiny corner of their truck (I don't have much stuff). In exchange, I received a little piece of paper with a couple signatures and a promise that it'll arrive in Kelowna in "about ten days". From now until sometime late in November, I'll be living out of my backpack -- a prospect that's both kinda scary and exciting.

Melanie has offered to put me up 'till I leave, so I'll be sleeping there 'till I head to Europe. She's also playing host to my noisy server for which I'm very greatful as it hosts this site, my email and will be the staging area for image uploads while I'm shooting on my trip.

On an unrelated note, I believe I've patched my site to compensate for Internet Exploder's shortcomings as well as a hole I found in my commenter that failed to moderate posts. So if you see any new problems with the layout, or have trouble commenting, please let me know.

August 22, 2007 07:50 +0000  |  Blogger Geek Stuff 13

After much lifting and hacking, I've moved moulinrouge to Melanie's house for the duration of my trip. It'll live here while I'm wandering through Europe and Korea so I can have a place to post pictures and blog :-)

As an added bonus, you may have noticed that the site is BRAND FRICKIN' NEW today. I've been coding this baby for months now on the subway, in parks, in bed and on Melanie's couch... it's nifty, it's new, and it has a bunch of kickass features:

  • I've created a truncated RSS feed and plugged it into Facebook. I wanted to make sure that people commented in just one place (here) and not both here and that site.
  • Wider format. Hope you like it. If you don't, you can shrink your window :-P
  • New Spammer protection. I can't say spammer-proof, but it should be enough to make it too complicated for them to bother.
  • New Tagging system. Blogs are now tagged dynamically so I'm no longer bound by those few categories.
  • Sexy new search feature. Try it out :-)
  • New snapshots section. Everytime I shoot something with my camera phone, I can upload it here.
  • New look & feel. Ok, it's not as pretty as the original, but I was in a hurry. I'll try and pretty it up more before I leave.
  • Fully MVC system. This is a complete rewrite using all the tricks I've picked up at Riptown.
  • More admin tools
  • Really cool backend stuff for my imager. I needed these for my trip.

Now, if you'll excuse me I'll be trying to get some sleep before dawn. Do me a favour and try to break the site eh? Leave comments, change your preferences etc. Please email me if you find anything amiss.

July 22, 2007 16:14 +0000  |  Blogger Geek Stuff Imager Melanie Money Moving Riptown 'Round-the-World The Toronto Public Space Committee Travel 2

I've not been posting a lot lately, mostly because I'm just stupid-busy. I'd forgotten what an incredible hassle it was to move my life 4349.9 kilometres away in the first place and doing it again is generally un-fun.

For starters, the cost of moving is ridiculous. Most moving companies will only accept a minimum of 1000lbs (they charge by weight, not time), and since I live in a bachelor, that's typically an aweful lot of extra space. On top of that, I have to pay for storage (since I'll be in Europe for a couple months before getting to Vancouver) and insurance, and movers. My latest quote was $2429.54!

Clearly, I have to keep looking, but time is running short.

Once I have a mover, I need a moving day, and since I'm not likely to leave Toronto 'till September 11th (yes, you read right, it is the cheapest day to fly), I could be living at Melanie's out of a suitcase for nearly a month.

Then there's the flight itself, I've been working with a travel agent and the routing is insane. I want to visit these places:

  • Stockholm
  • Berlin
  • Amsterdam
  • Geneva
  • Prague
  • Rome/Vatican City
  • Seoul

So one would imagine that the cheapest (and most efficient) option would be:

  • Toronto » Stockholm
  • Rome » Seoul
  • Seoul » Vancouver

But sadly, because of the way the airlines work, not only do I have to use Frankfurt as my entrance & exit for Europe, and route my Seoul trip through Singapore, but in order to get home, I have to fly back through Europe!

  • Toronto » Frankfurt
  • Frankfurt » Singapore
  • Singapore » Seoul
  • Seoul » Singapore
  • Singapore » Frankfurt
  • Frankfurt » Vancouver

This trip is about $3500. I can't be the only one that thinks this is insane. Obviously, I can get a direct Seoul » Vancouver flight, but that costs roughly $600 more and a RoundTheWorld pass is nearly $5000.

I may still take the more direct route, if only because it means I'm not in transit for 26hours on my last leg, not to mention the environmental implications of adding so many more kilometres to my trip. I'll also be buying carbon credits, but somehow, that doesn't make me feel any better about it all.

I'm also leaving my life in Toronto, of which Melanie is a big part. She's going through a rough spot in her life lately, and sometimes I feel like I'm not helping enough because of all of these other complications, not to mention the fact that I'm likely to make it worse when I leave. Even though we both knew this was coming the day we met, it doesn't make things any easier.

I have responsibilities as coordinator for the Camaras in Public Spaces campaign of the TPSC. I have yet to find a suitable replacement. We have a big event coming up for August, but someone will have to be here in October to field questions from the press when the pilot project is over and the one I had in mind to replace me doesn't appear interested. Stephen has expressed interest, but he's always got so much on his plate, I wanted to bring in some fresh blood to run the show, but I'm not sure who that would be at the moment.

Then there's my job. I don't have one lined up in Vancouver just yet, though my current boss has been kind enough to look into available positions with Riptown's Vancouver office. Whether there's a spot for me there or not, I'm not too worried about finding work in what I understand to be a competitive market, but that spectre of joblessness is still pretty scary.

Lastly, I've started re-coding my site using the new techniques I've been learning at my current job. The new site (still in development) will use a true MVC system and include nifty stuff like Ajax and JQuery as well as a Modified Preorder Tree Traversal algorithm for storing the hierarchical sorting structures in my Imager. This is mostly in preparation for when I'm in Europe and want to remote-blog and upload images -- I want the site to be better equipped.

So that's all for now. Wish me luck I suppose. If my heart & brain don't implode from the pressure, those of you reading this from Vancouver should see me in a few months.