Winternet

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.090 || Powered by WordPress