Tuesday, September 27, 2005

CSS Layouts: I Give Up

The ScreamWe're in the middle of a fairly major site redesign at Triporama, and I was doing my best to have the layout be as purely CSS as possible, replacing the previous table-heavy layout. It's turned out to be a major headache, and I'm taking a step back now and reimplementing parts of the layout with tables.



One problem with CSS today is that every different browser has different levels of support for the different versions of CSS, whereas tables have been around for so long that most browsers in use today handle them fairly similarly. The really big problem with CSS, though, is IE. Internet Explorer is a CSS bug fest. It would be great to say "fuck IE," (actually, I say that almost every day) but it is unfortunately still the most widely used browser.



Yes, I know--tables aren't meant to be used for layout; they're not "semantic", they're slower (not sure about that one--maybe if you have many levels of nested tables). And yes, clever designers have come up with all sorts of tricks to get CSS layouts to work across different browsers. But you end up spending hours or days getting your layout to work on various browsers and what you have in the end is a confusing morass of fragile code. It's just not worth it. I'll wait for IE 7 plus a few years (although my parents will probably still be using AOL 8.0 on a dialup line) before attempting a pure-CSS site again.



So, to summarize my new web design philosophy: use CSS for various individual elements/components on the site, but if you're doing a multi-column layout, use a table for the main layout (actually, I still have my header and footer positioned with CSS, as I spent far too long figuring out how to get the footer to stay glued to the bottom of the page if you have less than a page worth of content, but to flow after the main content if you have more...and the solution I found seems to work on all modern browsers). The layout for the whole site is in a single file, so making site-wide changes (another argument for using CSS) is still easy.

Monday, September 19, 2005

Slowlight

Spotlight was a great addition to OS X, and it works great for finding things buried in your filesystem. But for anyone used to Quicksilver or LaunchBar, it is painfully slow as an application launcher, which is really all I need most of the time. I recently reinstalled Quicksilver and I don't think I've touched Spotlight since then.

Link Roundup

Some random interesting stories/links I've run across in the last week or so:

Photos from this year's Burning Man in the form of a graphic novel. Very nicely done.



With an audio recording of you typing away at your computer for 10 minutes, it's possible to figure out everything you typed. (via Crypto-Gram)



Tongue-eating bug found in fish. So gross, but so cool. (via Boing-Boing)



Word Pads, a very addictive word game. My high score so far is only around 5000 18575.



I didn't really discover this in the last week, but it's too cool not to get a mention: the Gmaps Pedometer (the link centers on a more interesting location than the default of Hoboken, NJ). It's a testament to the brilliance of the Google folks that people have been able to come up with great hacks like this.



Finally, I'm going to try to play in the upcoming Ultimate Frisbee regionals, despite not having played since last winter, mostly due to my crappy back. I think I can hold it together for a weekend. Or at least a day. But this has inspired me: a 67-year old man comes out of retirement to play for his soccer team in their time of need. (via Fark)

Saturday, September 17, 2005

LINQ

I'm not a C#/.Net programmer, but LINQ is too cool. You can basically use SQL-like querying on just about any collection, whether it be an array in memory, a database, and XML structure. This is one of those "why didn't anyone think of this before?" things. Yes, there have been similar tools for querying objects for a long time, but nothing this elegant. Watch the video for a quick (well, 30 minute) intro, or, if you prefer text, read the overview document.

Thursday, September 1, 2005

New Pics

Finally got off my butt and posted some more pics to Flickr.



Tuesday, August 30, 2005

Spam Filtering Idea

I share a hosted server with a few friends. We host a number of sites (including this one) and our own email. We have SpamAssassin set up and tuned pretty nicely (thanks, Jelo). Unfortunately, it's killing our server. SpamAssassin can suck up a lot of resources. Ideally we'd have a server dedicated to processing mail, but we can't afford that.



So here's my idea: a spam filtering cluster. Have a bunch of [trusted] home-based servers set up with SpamAssassin and dynamic DNS. A mail comes into the main mailserver and if it isn't on a whitelist, it gets shipped out to one of the filter machines. The filter machine runs SA on it and lets the main server know the result (it doesn't need to sent the mail back, so no worries about low upload speeds). Emails over a certain size would probably just be processed on the main server to avoid the bandwidth and time required to send it out (large emails are rarely spam anyway). Finally, in order for the Bayesian filtering to function correctly, you'd have to periodically sync the data from the Bayesian learner out to the filter machines.



I've looked at SpamAssassin a bit and I think it wouldn't be too hard. SA comes with a client and a server, spamc and spamd. Incoming mail gets piped through spamc, which takes care of shipping it off to spamd for processing. Spamd can live on any other host. It can also just report back whether the email was spam or not, rather than returning the entire email. So the only two things left to do are:



  1. Write a small client (spamb?) that maintains a list of hosts running spamd. When a message comes in, pick the next hostname in the list, and pass it on to spamc. Spamc sends it to the appropriate spamd host, and receives the response--either yes/no or in our case, the full SA report, which gets attached to the message headers. If we get the full message back, that means that spamc timed out trying to contact that spamd host. In this case, mark that host as being down, along with a timestamp, and take it out of the rotation for a certain period of time.

  2. A way to distribute the users' bayesian data files and prefs to the remote systems. Apparently spamd can read user from a SQL database, although I haven't looked into it to see if the bayesian learner data can be stored in a database. If so, that's an easy solution to the problem. Otherwise, you could just write a script that checks for changes in any of the user files and if it sees them, rsyncs them to each of the hosts.



I'll let you know what happens if I get around to trying this out.

Sunday, August 28, 2005

Ruby on Rails Problem with OS X

I've been playing around with Ruby and Ruby on Rails lately. I'm not that far into it yet, but they both look interesting. I'll write more about my experiences later.



In the meantime, if you're setting this up on a Mac (running Tiger) like I am, do yourself a favor and before you start getting into any of the Rails tutorials (like Rolling With Ruby on Rails), go here first:



Ruby On Rails, Mysql, and OSX Tiger Woes



Do what it says (including the fix it mentions), and you'll save yourself a lot of grief. Note that as one of the commentors mentions, it works just fine with mysql-ruby-2.7 also.



Back to my tutorial...