Winternet

Kottke Kottke

Filed under: — jwinter on 1/14/2008 at 4:53 pm

I really like Jason Kottke’s site. I read his RSS feed religiously. I do not like his “guest authors". If I wanted to read them, I would subscribe to their, crappier, blogs. I’d much prefer that when Jason took a vacation, his blog did too.

With Yahoo Pipes, this wish can become a reality.

Kottke Kottke (All Kottke all the time):
http://pipes.yahoo.com/pipes/pipe.run?_id=5n8FQOrC3BGvfKzk6UjTQA&_render=rss

There’s some kind of escaping issue, but isn’t there always?

Haskell News

Filed under: — jwinter on 1/9/2008 at 10:36 am

I’ve started a site on the programming language Haskell. The site is called Monad and it’s pulled in a lot of useful news and information so far.

Scriptych

Filed under: — jwinter on 12/17/2007 at 12:13 pm

Scriptych, the JavaScript News site that I launched this fall, now has categories for each of the major JavaScript frameworks. Check out the latest news on: Dojo, ExtJS, jQuery, YUI, and Prototype.

Greasemonkey - Hide YouTube comments

Filed under: — jwinter on 11/23/2007 at 3:45 pm

I wrote a Greasemonkey script to hide/show YouTube comments.

Javascript News Site

Filed under: — jwinter on 11/20/2007 at 10:45 am

I’m editing a site on JavaScript news. It automatically pulls out interesting stuff. Check it out its entries on
John Resig, Jack Slocum, JavaScript Libraries, and Google Gears.

Multiple Databases in a Single Django Project

Filed under: — jwinter on 10/13/2007 at 11:25 pm

Django doesn’t yet support splitting your project or models across multiple databases. To scale up your database you use a solution where the application code still believes that it’s connecting to a single database server and database, but you’re actually connecting to a meta-db-server and db (i.e., a federated database). What I describe below is a way to get around that for a specific case where you can dispatch to a different db for different requests.

The first way is to segregate your requests for different DBs into their own Python sub-interpreter in mod_python or mod_wsgi. If you configure each of requests to run in their own Python sub-interpreter (using mod_python or mod_wsgi), you’ll be loading your entire Django project for each of the databases you’re serving.

Using mod_wsgi you’d put something like this in a VirtualHost in your httpd.conf file:
#This maps a hostname to a database
#Set the DB_NAME environment variable for use by Django
RewriteEngine on
RewriteMap host_db_map txt:/etc/httpd/conf/host_db_map.txt
RewriteRule . - [env=DB_NAME:${host_db_map:%{HTTP_HOST}|DEFAULT_DATABASE}]
#We run each in its own Python sub-interpreter with the WSGIApplicationGroup directive
WSGIApplicationGroup %{ENV:DB_NAME}

From my experience, and what I’ve read on the Web, loading Django itself takes roughly between 20 and 30MB of memory, and you’d be loading a Django instance for each one of the databases you add. But there’s another way to do this and continue to load a single Django instance.

Through custom middleware you can set the settings.DATABASE_NAME you want to use based on information contained in the request. The code for that would look something like this:


from django.conf import settings
class DBChooserMiddleWare(object):
“"”
Set the settings.DATABASE_NAME to match the http host
“"”
def process_request(self, request):
#choose_db returns a database name given an HTTP_HOST
#but it could be any sort of logic to choose a db or db server here
settings.DATABASE_NAME = choose_db(request.META[’HTTP_HOST’])
return None

Teamocil

Filed under: — jwinter on 11/22/2006 at 11:13 pm

There’s no i in Teamocil,
At least not where you think.
So together let’s make a choice,
And for once we’ll be in sync.
Teamoci-il,
I never thought I knew you well,
Teamoci-i-il,
Now I think we really gel.
Tea-mo-cil.

Teamocil is no longer available. Please try either Groupug, Bondat or consult your own Wellness Guide.

Teamocil.

Jakob Nielsen’s Worst Advice

Filed under: — jwinter on 5/18/2006 at 9:40 pm

Jakob Nielsen writes about web usability. He’s often got some great insights backed up by some good research or just common sense. However, he wrote about design mistakes in building blogs a few months back and I’m still reeling from the effects of his second “mistake":

2. No Author Photo
Even weblogs that provide author bios often omit the author photo. A photo is important for two reasons:

  • It offers a more personable impression of the author. You enhance your credibility by the simple fact that you’re not trying to hide. Also, users relate more easily to somebody they’ve seen.
  • It connects the virtual and physical worlds. People who’ve met you before will recognize your photo, and people who’ve read your site will recognize you when you meet in person (say, at a conference – or the company cafeteria if you’re an intranet blogger).

And in the past few months I’ve seen more and more awful photos of geeks in the blogs I read.

The downside of his advice is that putting a picture on your blog will often ruin your credibility. After seeing these horrible pictures I think to myself: “Well can someone who can’t put on a decent suit, can’t crop a photo, can’t smile without a ridiculous smirk, and can’t match a tie to his suit really know that much about MySQL tuning?” Or, the converse: “Well, can someone who clearly spends 2 hours twisting his hair into perfect points, ironing his ironic Miami Vice T-shirt, and polishing his stylish Italian leather shoes every day have anything interesting to say about closures in Javascript?”

I don’t mind drunken cameraphone photos in your photos section. Especially ones that you wish you hadn’t published by the next day. I do mind you putting your weird mug on every page of your blog. I don’t want pale, doughy guys looking seriously at me while I read about XML. It’s creepy.

Author photos also emphasize the worst part about working with computers, even worse than the vain, smarmy dudes in bad suits. The huge gender imbalance in the IT industry. When all I see are balding, pudgy dudes with weird smirks on their faces it makes wonder: where are all the balding, pudgy women with weird smirks? Where do they work? Renaissance Faires?

What to do about it? Well, Firefox has a few extensions that might help: Adblock (get rid of them forever), NukeAnything Enhanced (destroy them each time you see them).

Or, just read some blogs that remain author photoless (so far as I see): Ned Batchelder, Sam Ruby, Wil Shipley, and Joyce Park.

Programmer Job Listings by Domain Knowledge not Language

Filed under: — jwinter on 1/24/2006 at 11:52 pm

It doesn’t seem quite right to me that programming jobs are always advertised by language instead of domain knowledge. I’d much rather have a programmer on our team who understood the Web domain (REST, HTTP, content databases, client/server, and on and on) than one whose personal language preference happened to match up with our office. Fact is, we could be wrong about the language we’ve chosen, the database we’ve chosen, the middlewhere we use, the APIs we’ve created, etc. and not see the forest for the trees. I’d gladly take someone who could come in and see the simplest solutions to these (someone who knows how to cut with the grain) even if it meant some short-term unpleasantness while we retrain in a new language.

Getting Selected Text from a Textarea Through Javascript in Safari

Filed under: — jwinter on 7/19/2005 at 2:22 pm

Is not possible. Will update this post if shown to be incorrect.

How it’s done in IE:

document.selection.createRange().text will contain your selected text.

How it’s done in Mozilla/Firefox:

//Get the textbox through the DOM
var txta = document.getElementById(’txt’);
//this will contain your selected text
txta.value.substring(txta.selectionStart, txta.selectionEnd));

How it’s done in Safari:

Call Dave Hyatt and ask him what’s selected.

Barber Brothers Furniture

Filed under: — jwinter on 7/13/2005 at 9:51 pm

I just built a site for my friend Beau and his brother Nate who are starting a Furniture/Cabinetry business. The Barber Brothers Woodshop is open for business. Neena gave me a ton of suggestions for the colors, fonts, and layout and I used almost all of them.

It was nice to actually build a complete site, I haven’t done that in a really long time. I forgot how much tedium can really go into it. But being able to program definitely helps. This was a small site, but there were a few times when I wanted slightly different changes to groups of pages. Writing a short script to make these changes kept it quick and interesting.

C# Hello World in Mono on Windows

Filed under: — jwinter on 5/31/2005 at 10:47 pm

The following are the basic steps for quickly getting Mono up and running on Windows.

  1. Download the Mono Installer for Windows. This installs Mono, Gtk#, and XSP (a webserver for serving ASP.NET applications).
  2. Save the following code into a file called HelloWorld.cs
    
    using System;
    public class HelloWorld {
          public static void Main(string[] args) {
             Console.WriteLine("Hello World");
          }
    }
    
    
  3. Click Start–>Mono 1.x.x for Windows–>Mono-1.x.x Command Prompt. This should bring up a terminal window with the Mono directory added to your path. This way gmcs, mono, etc. will work from whatever directory you are currently in.
  4. Type gmcs HelloWorld.cs into the Command Prompt to compile your source code.
  5. Type mono HelloWorld.exe into the Command Prompt to run the program.

Nothing complicated, but I was looking around for something to make sure that the basics were configured correctly.

Susan Senator

Filed under: — jwinter on 5/8/2005 at 4:54 pm

Susan Senator is a writer whose done some really excellent essays on autism. She has a new book out called Making Peace with Autism.

PAAMAYIM_NEKUDOTAYIM

Filed under: — jwinter on 4/1/2005 at 5:05 pm

Means “twice colon” in Hebrew. If you’ve borked scope resolution (::) in PHP, you’ll get a T_PAAMAYIM_NEKUDOTAYIM error.

Junot Diaz

Filed under: — jwinter on 3/31/2005 at 11:33 pm

About seven years ago, Junot Diaz was one of my favorite authors. Drown is an incredible collection of short stories. Read it, if you haven’t.

But what the hell? Drown was published in 1997. It’s been eight years. I don’t mean to tell a man how to live his life, but Drown was one of those books (like Mysteries of Pittsburgh) where you couldn’t wait for the author to get older to hear what he had to say about the rest of his life. What happened?

Update: It looks like he’s kept writing, but his stuff hasn’t been collected yet.

Homecoming, with Turtle from the New Yorker

Batman

Filed under: — jwinter on 3/26/2005 at 12:10 am

I’ve been reading a lot of Batman comics lately. Here’s what I’ve read:

The Killing Joke
Alan Moore never ceases to amaze me. The back story on the Joker and the main narrative of trying to crack Jim Gordon worked together really well. And his writing is just so much smarter and more literate than anyone else that I’ve read in superhero comics (Neal Gaiman included). The scene between the Joker and his wife is so pitch-perfect, that it gives the rest of the story a lot of its weight. And the fact that the Joker’s song not only rhymed, but parsed right for a musical number, was a nice touch that I frankly didn’t expect from a comic. The artwork on the Joker and Batman is incredible, too. I wish there were more of these.
Dark Night Returns
I had to go back and reread to remember how sophisticated this story is. This is on everyone’s list, but it’s there for a reason. Frank Miller brings out everything that’s interesting about Batman. Which is that he’s a hair’s breadth away from being a villain and, more importantly, that he’s not super. He’s tired and broken and human. I like the artwork on this Batman best. Also, Superman is a dick.
Knightfall
Just a really cool comic. It’s sort of a kitchen sink story: all the supervillains are broken out of Arkham and an old, tired Batman has to put them all back and fails. Some of the artwork is just sloppy, though. There’s a panel, at least in my book, where they just forgot to ink part of Bane. And another where Batman’s head is coming out of his left shoulder. The story’s cool enough to make up for it though. I haven’t finished the other two books yet, but it’s only gotten better so far.
Batman: Year One
This one was only okay. It was just short on narrative. Not enough happened over the pages, at least not enough to keep me interested. The premise is Bruce Wayne’s first year as Batman, but the close calls didn’t have enough tension to really draw me in. It was my favorite take on Commissioner Gordon, though.

WordPress Comment Spam nofollow Hack

Filed under: — jwinter on 1/22/2005 at 5:04 pm

I guarantee WordPress will have a better way to do this in the future, but for now, if you want to add "rel='nofollow'" attributes to all of the links in the comments to your blog, here’s how:

  1. Open up template-functions-comment.php
  2. Replace lines 124-128 with
    if (empty($url)) :
    echo $author;
    else: #Update 2005-01-22 Adding nofollow support.
    echo "<a href='$url' rel='nofollow'>$author</a>";
    endif;
  3. Replace line 177 with
    $comment_text = apply_filters('comment_text', $comment_text);
    $comment_text = str_replace('<a ', '<a rel="nofollow" ', $comment_text);
  4. Check the comments on your site to ensure you didn’t screw up your WP installation.

Doing this doesn’t prevent comment spam on your site, but it does prevent Google from giving spammers any PageRank points, which is why spammers spam in the first place.
More information:

  1. Google Blog on Nofollow for Comment Spam
  2. Phil Rignalda on Nofollow

Serendipity Lameness

Filed under: — jwinter on 12/18/2004 at 3:29 pm

Serendipity, a blog tool written in PHP has some pretty overengineered HTML and Javascript.

Let’s take a look at this:

<a href="http://example.com" title="http://example.com"
onmouseover="window.status=’http://example.com’;return true;”
onmouseout="window.status='’;return true;">
An example link</a>

First of all, using the URL in the title attribute is silly. But apart from that, why have the totally unnecessary Javasript to provide the URL in the status bar? This is the default behavior in any browser where the user actually wants it.

The saddest thing about this code: It actually prevents the URL from showing up in the status bar in Firefox.

Serendipity developers, here’s the HTML that you want to generate:

<a href="http://example.com" >An Example</a>

or at most:

<a href="http://example.com" title="An Exemplary Example" >An Example</a>

Daily Bible RSS Feed

Filed under: — jwinter on 11/21/2004 at 10:22 pm

Official launch of the Daily Bible RSS feed. Just add the following URL to your aggregator:

http://jwinter.org/bible/sub/

This will redirect you to a jwinter.org/daily-bible/YYYY/MM/DD/ with YYYY/MM/DD/ replaced with today’s date in that format. To start over, either return to the subscription URL above or manually change the date in the URL.

It’s the King James version. You’ll find a chapter a day in each entry starting with Genesis going right on to Revelations.

Neena with Rachael Ray

Filed under: — jwinter on at 8:36 pm

Neena and I went to the Chestnut Hill Mall to get a book signed by Rachael Ray of 30 Minute Meals. Neena had her picture taken with her.
Neena with Rachael Ray

Lyrics to Ira Glass’ Disturbing “I Wish Song” from This American Life

Filed under: — jwinter on 10/29/2004 at 2:54 pm

Because I couldn’t find it through Google:

Oh the woman in Act I is wistful,
But funny in a quiet way
And the guy in Act II has a tough job to do,
A mission that’s gone on twenty days
I only wish their stories will be gripping and special
Even though it’s not the news and they’re not stars
You’ll remember what they said, you’ll mention them at dinner
And when they’re on, you will not leave your cars

Chorus:
Because it’s radio
Stories on the radio

Can be funny and emotional, can fill you with longing
My wish is that this show lives up to this song and
Bring on the conflict, make the people speak
Bring on that music we use every week

Chorus:
I wish for radio
Decent stories on the radio

Heeeerrrre… [talking]

Oh I wish that you’ll stay here and not touch that dial
Please don’t say goodbye or ‘I’ll see ya’
You know you want to hear the final words
We have from Tory Malatia

From Episode 259: Promised Land

Table of Programming Wisdom

Filed under: — jwinter on 10/4/2004 at 11:08 am

Lots of good advice in the following table:

Table of Programming Wisdom

with links to the books where the author discovered them. To my great shame, the only book on that list that I’ve read cover-to-cover is The Pragmatic Programmer.

Notes from php|works

Filed under: — jwinter on 9/24/2004 at 3:20 pm

Not that I could attend, but a couple of my favorite PHP bloggers spoke there. Check out their slideshow goodness:

I definitely recommend George Schlossnagle’s book, “Advanced PHP Programming", for anyone programming in PHP.

BU Gets Dave’d

Filed under: — jwinter on 8/19/2004 at 8:03 am

We got linked to by Scripting News. Cool.

Client Side Feeds

Filed under: — jwinter on 8/9/2004 at 7:39 am

This Scottish paper has an interesting feature: Client-side feeds.

Scroll to the bottom of the page and you’ll see a Javascript “feed". Click it and it pops up a wizard that writes the Javascript for including headlines from a portion of their site. Like RSS, but without the need for any server-side processing to include it.

It’s actually something that could have predated RSS, but with RSS around, it makes a lot more sense.

LDAP in Thunderbird

Filed under: — jwinter on 7/20/2004 at 3:41 pm

Versions of Thunderbird above 0.6 use LDAP v3. Many LDAP servers (including Boston University’s) are still using v2. If you’re getting an LDAP initialization error with the message Error code 2: Protocol Error, add the following line to your prefs.js file (in Windows XP that file is at /Documents and Settings/username/Application Data/Thunderbird/Profiles/default/random characters/prefs.js):

user_pref("ldap_2.servers.your_server_name.protocolVersion", “2″);

Replace your_server_name with the name you had chosen for this LDAP server. It should appear in other lines of the file like: user_pref("ldap_2.servers.your_server_name.position", 4);

PHP 5 Is Out

Filed under: — jwinter on 7/14/2004 at 8:06 am

PHP Version 5PHP 5 is released. Lots of exciting new features, many described in Zend’s PHP 5 In Depth. The new XML support based on libxml2, HTML Tidy support built in, and most of all the new object model are the most interesting changes to me. Go get it.

Slashdot has a story on it, but for some reason they’ve emphasized a new closed-source PHP compiler from a third party. This was a mistake, because now the comments are mostly about the price of the compiler and confused questions about how PHP is actually used. For the interested, compiling to bytecode for the speed boost is interesting for most PHP users and for that we have the Zend Accelerator and Turck MMCache. Compiling to native binaries is intriguing, but, like Perl and other interpreted languages, mostly a side note. The real news is PHP 5.

Firefox 0.9 Unconfirmed View Source Bug

Filed under: — jwinter on 7/12/2004 at 4:44 pm

This may be the result of the Web Developer Bar and not the browser, but Viewing Source makes a new HTTP request to the server. That sucks. It used to be a Mozilla bug, over a year ago, but now it’s back. It sucks because if you have a page that is the result of a POSTed form, you’ll rePOST when you’re trying to View Source.

Fixing Your Playstation 2

Filed under: — jwinter on 7/11/2004 at 12:13 pm

Is your PS2 clicking as the disk tries to spin up? If so, and if you’re warranty’s already run out, and if you’re feeling adventurous, you can follow these intructions to open up your PS2. You basically want to change this little white gear wheel. Move clockwise it 15 degrees, put the disc reader cover back on (not your PS2’s cover) and try a disc. If it doesn’t work, move it another 15 degrees and try it again. This worked for me.

Internet Explorer’s Javascript Engine Pollutes the Global Namespace

Filed under: — jwinter on 7/10/2004 at 7:26 pm

IE pollutes the global namespace with all of the ids and names from any form elements in the document. If you happen to have an id called parent_id and a Javascript variable called parent_id, your scripts will not run as expected.

It’s a good habit to declare variables with var in Javascript, but still, it’s annoying that IE does this.

Ruby Blog

Filed under: — jwinter on 6/25/2004 at 10:26 am

My next project is to roll my own blog tool using Ruby and Postgresql.
Reasons:

  • I’ve heard plenty of good things about both
  • I think I know enough about the application space
  • Learn one new programming language a year (PragProg rule)
  • I don’t write enough code.

Update:
It might be cool to do something for file sharing/chat for small groups.

Mozilla Thunderbird - Compose Messages in HTML

Filed under: — jwinter on 6/11/2004 at 4:20 pm

I turn this off. I want Thunderbird to look like and send message like a console application. Anyway, I’m posting this because it took me forever to find it, since it’s not in Tools–>Options–>Composition anymore, it’s in Tools–>Account Settings–>Composition and Addressing.

CSS Crib Sheet

Filed under: — jwinter on 4/18/2004 at 11:55 am

Dave Hyatt has some good advice on using CSS.

CSS Crib Sheet

Bloglines Review

Filed under: — jwinter on 3/23/2004 at 10:58 am

Bloglines is hands-down the best RSS reader I’ve used. This includes desktop applications on Windows, OS X, and Linux, and web-based applications. Here are the reasons why I use it to read my favorite websites.

Synchronization
Since it’s a web-application I can use it from work, home, and on friend’s or coworker’s computers. I read an entry on the T on my Sidekick and when I get home it’s marked read in my aggregator.

Interface
HTML Frames have their uses (rarely) and this is one case where they’re used to great success. I can’t deal with aggregators who display your subscriptions as one big long crazy list. I subscribe to some high-traffic feeds and I don’t want them cluttering the screen when I’m trying to see if Joel Spolsky has posted anything new.

Bandwidth-friendly
Bloglines only grabs a feed once for all of its users thereby bearing the bandwidth burden for the sites that provide syndication.

Feature-rich
Want to know how many Bloglines subscribers a feed has? Want to know what people who read your blog also subscribe to? Want recommendations based on your current subscriptions? Bloglines has all these features and more.

Support
Less than a day turnaround for a question that I really shouldn’t have asked (it was in their help documents).

35 Ways to Find a String

Filed under: — jwinter on 3/22/2004 at 10:09 am

35 Exact String Matching Algorithms

Exit 13

Filed under: — jwinter on 3/14/2004 at 10:24 am

Exit 13 is a comic anthology featuring a new story by one of my favorite artists, Nijo Philip. Order a copy before it sells out.

Boy, does Dell suck.

Filed under: — jwinter on 3/12/2004 at 10:23 am

Dell has horrible customer service. I’ve called twice (both calls over an hour and ending with being disconnected) and filled out their “E-mail Customer Care” form three times (the first e-mail bounced back to me, the second time the response page timed out). The third e-mail resulted in this communication, which is so useless as to be worse than no response:

I apologize, but due to a system problem, there has been a delay
in processing the on-line orders. Until the order has been processed
we are not able to access the information.

Oh, well that clears that up. They have no idea where my order is. To them, it’s floating in the ether and may, at some point in the fourth dimension, materialize and my credit card will be charged. I’m really looking forward to that.

Dell Sucks Too

Filed under: — jwinter on 3/10/2004 at 7:56 pm

I was under the impression that Dell, unlike Gateway or HP, was well-run and customer-friendly. That they had managed to avoid sucking as much as most other computer companies do. Well…

They suck too. I placed an order for a 17 inch LCD Monday night with Next Day shipping. It should be on my desk right now. Instead I’m LCD-less and have been on the phone with Customer Support for almost two hours. At the end of which, I was transferred to an office that was closed. Before the rep transferred my call into oblivion, he told me: “Someone is working on this as we speak. I’ll transfer you right over so you can talk to them.”

Never in my life have I had to try so hard to give someone 400 dollars.

From now on, I do all my business through New Egg. I’ve gotten a lot of good hardware and good service from them for great prices.

Knuth Lectures

Filed under: — jwinter on 2/23/2004 at 3:09 pm

Don Knuth lectures on-line here.

He’s incredible.

print.google.com

Filed under: — jwinter on 1/11/2004 at 11:53 pm

I’m a bit behind the curve on this, but Google is now (as of Dec. 16th) serving excerpts from books within search results. If you just want the excerpts include site:print.google.com in your search.
Examples:
“Don Delillo” site:print.google.com
“David Foster Wallace” site:print.google.com
“Anne Lamott” site:print.google.com
“Ian McEwan” site:print.google.com

More Great Fresh Air

Filed under: — jwinter on 1/8/2004 at 3:52 pm

Randy Newman on Fresh Air. I love NPR. I wish all media had such extensive archives.

Monty Hall and Being Wrong

Filed under: — jwinter on 12/18/2003 at 3:02 pm

Great article on the Monty Hall puzzle and being absolutely, completely wrong.

RSS/Atom Slideshow

Filed under: — jwinter on 12/12/2003 at 3:20 pm

Sam Ruby’s got a great slideshow up about Atom and RSS. Excellent overview of what’s going on with both formats. Also, he’s linked to a lot of good stuff.
Design principles for XML
vCard and vCalendar
Variety’s RSS Feed

Joel Spolsky through Google Catalogs

Filed under: — jwinter on 12/11/2003 at 11:08 am

Joel on Software’s article on ERWin.

USF Lectures

Filed under: — jwinter on 12/9/2003 at 11:35 pm

Terrence Parr’s Programming Languages course offers several good lectures as mp3s. Some fascinating stuff.

Jack Hitt/Steve Martin

Filed under: — jwinter on at 11:41 am

Is Jack Hitt from This American Life actually Steve Martin? He sounds just like him on the radio.

They Might Be Giants on Fresh Air

Filed under: — jwinter on 12/2/2003 at 5:20 pm

Cool interview with the Johns from They Might Be Giants on Fresh Air with Terry Gross.

PHP: A Tourist’s Guide

Filed under: — jwinter on 11/19/2003 at 9:59 am

Lots of cool stuff that I didn’t know existed for PHP at PHP: A Tourist’s Guide. talks.php.net and conf.php.net are especially cool.

Styled RSS

Filed under: — jwinter on 11/9/2003 at 1:17 am

Styled RSS feeds

Seems better than serving the garbage that gets dumped to the screen when a user clicks it. Gotta get around to it for this site.

Sortable Tables with Javascript

Filed under: — jwinter on 11/5/2003 at 2:32 pm

Stuart Langridge does a really nice job with Javascript.

http://www.kryogenix.org/code/browser/sorttable/

He’s also got some cool stuff with unordered lists as drop-down menus. Very nice.

UPDATE: Dudn’t work in Safari. Take a look at this when trying to debug it later:
DOM Support in the major browsers [via Quirksmode]

To Read

Filed under: — jwinter on 11/3/2003 at 10:31 am

Short Words to Explain Relativity

How the RSA Cipher Works

Javascript and Select Box Magic

Filed under: — jwinter on 10/28/2003 at 4:59 pm

Here’s a widget I designed for managing options in a select box. With this you can have users choose from a pre-formatted list of choices, or come up with their own options, all of which they can then put in whatever order they like. If you’re submitting to a PHP form, these options would be available, in order, in the $_POST[’list’] array.

Take a look and see if you can use it. This has been done in all kinds of different places on the Internet, but I think this is a simple, easy to understand version that anyone could yank and add to their site. So please do that. Let me know if you find bugs.

Back Button on Winamp

Filed under: — jwinter on 10/18/2003 at 12:15 am

Why isn’t there a back button in Winamp? I’m always losing the playlist I put together because I’ll put in a CD and it’ll jump to auto-read it, or I’ll hit the little up arrow button instead of the Add Song button. Or I’ll find an MP3 and double-click it instead of right-clicking then selecting “Enqueue".

Hmm, maybe it’d really be an Undo button instead of Back. But still, I wish something were there. Anyway, Nullsoft rules.

RSS Feeds

Filed under: — jwinter on 10/14/2003 at 1:53 am

I created an RSS feed for one of my recent projects at work. Boston University News has a feed here:
Subscribe to Boston University News

We use PHP and templates to drive the dynamic sites we create. So providing a new RSS feed was pretty easy, all the scripts were already written to get the information from the database. We just needed to come up with a template RSS file to put that information into. So the hardest part was trying to choose among the conflicting “standards” that are out there.

I liked RSS 2.0; it seemed like the clearest. But, since an individual news release can have more than one author, we couldn’t use the author sub-element of item. Items in RSS 2.0 are assumed to have a single author, no collaborators. So we used dc:creator in a way that may or may not be supported by your aggregator. This was based on a post from RSS-Dev which I can’t find at the moment. We also used dc:date also based on research that I can’t find now.

Red Sox Ticket Booth is CASH ONLY

Filed under: — jwinter on 10/13/2003 at 6:33 pm

If you’re buying Red Sox tickets on the day of the game, be sure to bring cash. Don’t wait two hours in the pouring rain to find out that a credit card is not acceptable.

More on e

Filed under: — jwinter on 10/8/2003 at 11:57 pm

There’s more about e on Wolfram’s Mathworld site. That site is incredible. It always comes up in google when I’m looking for math stuff. Sometimes the explanations are a little over my head, but it’s mostly good.

OCaml

Filed under: — jwinter on at 11:47 pm

Still trying to learn OCaml. This tutorial is pretty good so far.

The right way to call a function with two arguments is actually function_name arg1 arg2. function arg1, arg2 and function(arg1, arg2) apparently mean different things. The first is a function with two arguments and I think both the second and the third are functions with one argument that is a list of two elements. This is still new to me, so hopefully I can make corrections and learn by posting here.

e, the transcendental constant

Filed under: — jwinter on at 12:09 am

For my Programming Languages class, we had to calculate e using the Maclaurin series 1/0! + 1/1! + 1/2! .. 1/n! in Fortran IV, Fortran II, and C and print some info about it out to the screen. I wrote it in OCaml during one of his lectures. OCaml has two numeric types int and float (makes sense so far) but has different operators for integer and float operation (umm) and I couldn’t figure out a clean way to mix ints and floats. Look at the nasty casting I do here:

let rec factorial n =
    if (n < 2) then
       1
    else
	n * factorial(n-1)
;;
let rec calculate_e precision =
    if (precision<2.0) then
       2.0
    else
	1.0/.float_of_int(factorial(int_of_float(precision))) +.
calculate_e(precision-.1.0);;
let how_precise = read_float();;
print_string (string_of_float(calculate_e(how_precise)));;
print_newline();;

There’s gotta be a better way. By the way, I gotta admit writing it in Fortran was kinda fun too.

Went to BloggerCon today

Filed under: — jwinter on 10/6/2003 at 1:35 am

Went to BloggerCon today. It wasn’t really a conference for me, but it was free and there were a few geeks there. It was more for blog writers (which I couldn’t count myself among) and not really for developers. Localfeeds.com and Feedster were both in the Infrastructure meeting I sat in on. The Localfeeds guy was pretty cool, it would’ve been nice to have been able to ask him some technical questions about his application, but there wasn’t a good opportunity really.

0.513 || Powered by WordPress