Archive for the 'Life in General' Category

Age From Birthday Calculator

Tuesday, June 24th, 2008

Figured this might be handy to some folks… Just enter in a birthdate (or just any date for that matter, doesn’t necessarily have to be a birthday), and it will give you the number of years that have passed since then! Why use your head when we have computers!?

Month:

Day:

Year:
(YYYY)

UNIMPORTANT NOTE: This script uses the average number of days in a year as part of its calculation. If I hear about that causing any problems I’ll look into another way of doing it, but I think it’s the most reasonable, far more so than using a whole number like 365.

The JavaScript:

function getAgeFromBday() {
  var month = document.getElementById('bdc-month').value;
  var day   = document.getElementById('bdc-day').value;
  var year  = document.getElementById('bdc-year').value;
  var bdate = new Date(year, month, day);

  if (bdate.getDate() != day || bdate.getMonth() != month || bdate.getFullYear() != year) {
    alert('That date appears to be invalid!');
    return false;
  }

  var today = new Date();
  today.setHours(0);
  today.setMinutes(0);
  today.setSeconds(0);

  if (bdate > today) {
    alert('Provided date must fall before today\'s date!');
    return false;
  }

  alert(Math.floor((today - bdate) / 31556952000));
}

The markup:

<p>
  <strong>Month:</strong><br />
  <select name="bdc-month" id="bdc-month">
    <option value="0">January</option>
    <option value="1">February</option>
    <option value="2">March</option>
    <option value="3">April</option>
    <option value="4">May</option>
    <option value="5">June</option>
    <option value="6">July</option>
    <option value="7">August</option>
    <option value="8">September</option>
    <option value="9">October</option>
    <option value="10">November</option>
    <option value="11">December</option>
  </select>
</p>
<p>
  <strong>Day:</strong><br />
  <input name="bdc-day" id="bdc-day" style="width: 15px;" type="text" />
</p>
<p>
  <strong>Year:</strong><br />
  <input name="bdc-year" id="bdc-year" style="width: 30px;" type="text" /> (YYYY)
</p>
<p>
  <button type="submit" onclick="getAgeFromBday()"><strong>DO IT</strong></button>
</p>

Drumstick spinning / twirling techniques

Wednesday, June 11th, 2008

This video covers only the first technique described; it is the one about which people are generally most curious. I might record some other videos that cover the other ones mentioned — and also some not mentioned — depending on how this one goes and also how motivated I might be feeling to do more.

Using Web Developer Toolbar with Firefox 3 Beta

Thursday, January 24th, 2008

THE UPDATES KEEP COMING! The toolbar has been updated for RC1, so be sure to grab it from Firefox addons, or the official site.

YET ANOTHER UPDATE: Firefox 3 Release Candidate 1 (RC1) is out, so this article once again applies. Have at it! I’ll post another update when the toolbar is updated again and works out-of-the-box.

IMPORTANT UPDATE: The toolbar has been updated and should now work with Firefox up to beta 4. You can download it from Firefox addons, or the official site. Thanks Davosian for the heads up!

So I recently upgraded to Firefox 3 Beta 3, and am now using it as my primary browser. Major speed increase with version 3! Memory seems to be handled much better! Excellent!

Note: At the time of this writing, you can get Beta 2 from here. I went ahead and got a nightly build, which, at the time of this writing, is beta 3. Regardless of which beta version you choose, know that you are taking a risk as the software is not in its final stages.

If you are a web developer, you probably use Chris Pederick’s impeccable Web Developer toolbar.

It hasn’t yet been updated for beta 3! Why? Probably because it hasn’t been tested enough! If you are like me and are hardly concerned about that, and want your Web Developer toolbar, then you might be interested in knowing how to get it working with beta 3!

The steps:

  1. Download the Web Developer toolbar .xpi file from the official site. NOTE: If you are doing this from Firefox, you must right-click and choose “Save Link As…” (otherwise it will attempt to install the extension)
  2. Rename web-developer.xpi to web-developer.zip. (XPI files are just ZIP files with different extensions)
  3. Open the zip file, extract and open the file named install.rdf.
  4. At the time of this writing, the line we are looking for is line 27, and it should look something like this:
    <em:maxVersion>2.0.0.*</em:maxVersion>.
  5. Change it to look something like this:
    <em:maxVersion>4.0.0.*</em:maxVersion>.
  6. Save the file and add it back to the zip file. Depending on your zip utility, this can usually be accomplished by opening the zip file and dragging the newly saved file back into it (be sure to overwrite the existing install.rdf). Rename the file to once again have an .xpi extension.
  7. Open Firefox and drag web-developer.xpi into the browser window. It should then ask you if you want to install the extension, and it should not complain about the FF version!

That’s it! This is working fine for me so far, but don’t come crying to me if your computer blows up…

UPDATE: Thanks Ronnie for pointing out the secure updates issue. I forgot to mention that. Check this comment for direction on getting around that warning. Please let me know if those instructions aren’t clear enough and I’ll update again.

ANOTHER UPDATE: The Edit CSS feature (which, to me, is one of the most important) seems to be glitching. It has worked, but doesn’t always. One persistent problem is with closing the Edit CSS dialog once it’s opened — it doesn’t close once it’s opened. So if you have 6 trillion tabs open and you want to edit the CSS on one of the pages… WAIT! Open a new window and then do it… That way once you’re finished, you don’t lose all your tabs.

Canon PowerShot SX100IS

Friday, December 14th, 2007

The Canon PowerShot SX100IS is a good digital camera. A few years ago I had a PowerShot A60 — definitely money well-spent, loved the heck out of it. Unfortunately the construction of the A60 was crap and it ended up breaking, but it was a trooper while it lasted. At one point Canon did put out a CCD Image Sensor Advisory Service Notice, and fixed the problem out of warranty along with fixing a faulty review button! This was free, and it was years out of warranty! So I think that speaks volumes about the company’s customer service.

Back to the PowerShot SX100IS. While it’s not suitable for professional work, it does a fine job at point-and-shoot, and it goes fully manual: The ISO speed, aperture, shutter speed, flash output, white balance, and many other manual controls can be adjusted.

Low-light conditions may prove to be an obstacle with this one. While it is possible to take the ISO speed to 1600, it’s practically pointless. There will so much noise that the picture will likely be useless.

One interesting feature that’s more of a novelty for me is the face recognition. The thing can actually spot people’s faces! While I’ll probably never use this in practice, it’s just neat!

UPDATE: Some reviews on the web say that the SX100 has a really bad video capturing system. I disagree; there is a “low quality” mode that uses a high compression suitable for email. Using that setting your video will be of poor quality. It can do higher resolution and it does a decent job. It is true that you can hear the zoom motor while capturing video. It’s not that loud, and if you’re recording something loud such as a concert, it shouldn’t be a problem. Keep in mind that this is not a digital video camera anyway, it’s a point-and-shoot, and it does a good job with what it’s designed to do.

Tip: I think that the Night Snapshot mode works fairly well indoors with no flash if the room has ample lighting.

Tip #2: “Dragging the shutter.” While in Program (P) mode or Aperture Priority (Av) mode, if you press the Menu button and scroll through the options on the first page, you’ll notice one called “Slow Synchro.” That creates really interesting effects. With the flash open and on in those modes, the shutter will remain open shortly after the flash goes off. In low-light situations this helps to illuminate the subject (through the flash) while also bringing light to the background (through the shutter delay). Camera shake will cause the background to blur significantly.

Moola Invitations

Sunday, November 11th, 2007

Are you looking for a free invitation to Moola.com?

CLICK HERE to get your invites!

UPDATE: I got bored of Moola.com. It is so incredibly frustrating. I’m not sure whether or not I can trust it. There are a bunch of calculators out there that tell you the best possible statistical moves. Especially with those, it seems I should have been winning more than I was. I mean not everyone on that site could possibly be a freakin’ Moola master. Maybe it’s rigged! If you use the search a lot, you can rack up some money. Even that almost always lands on a minuscule value. I give up on Moola.com! If you still want to try it, you are more than welcome to have at it!

This Train is Bound for Glory

Thursday, August 2nd, 2007

This was originally a rough cut (I wanted to redo the end part) but has graduated to a final cut because I don’t feel like working on it anymore. Traditional gospel.

Glory Bound Train
DOWNLOAD (1:50; 1.3MB; 96Kbps)

MAH HOLY BUCKET

Thursday, August 2nd, 2007

This is a fusion of two different songs:

  1. There’s a Hole in My Bucket - Traditional children’s song
  2. My Bucket’s Got A Hole In It - Hank Williams
MAH BUCKET
DOWNLOAD (2:35; 1.9MB; 96Kbps)

MySQL UNION Omitting Duplicate Results

Sunday, July 8th, 2007

I was trying to UNION two SELECT queries but for some reason it seemed to be omitting duplicate results (the primary key wasn’t included in the SELECTed columns so some had everything but that in common) as if they were SELECT DISTINCT queries. To work around that I added rand() as the last SELECTed item and it worked. This is probably an ugly hack, but it did what it was supposed to do. One could probably just as easily include the primary key. I still don’t know why it was omitting duplicates and now that it works I probably won’t look into it for a while.

What Happened to the Kramer We Knew?

Tuesday, November 21st, 2006

Mel Gibson is silently thanking Michael Richards :-)
Here’s a funny satire dealing with both of them…

Rehydrate Yourself — Compliments of the House

Friday, October 20th, 2006

Whoever invented the public water fountain was a genuinely thoughtful person.