LAME MP3 Encoder for Windows Download

For those of you who use the LAME MP3 Encoder to rip CDs to MP3 (like me), the LAME project recently released version 3.98.2 of the encoder. Since the LAME project does not release compiled binaries, I thought I would compile the encoder and stick it on my site for all to download. I know from experience that finding the latest version of the encoder compiled for windows can sometimes be hard so I thought I would help the cause. The zip file below contains both lame.exe and lame_enc.dll. It was compiled with Visual Studio 2008 on Windows Vista. Please let me know if you have any issues with the files or if you find a newer version of LAME was released (so I can update my files).

Update 2010-10-03: I have updated the LAME library to 3.98.4. It was compiled with Visual Studio 2008 on Windows 7.

LAME MP3 Encoder (Win32)

Apple Notebook Event Reaction

Yesterday Apple had a small event in California to unveil their new notebook line. Apple announced a new Macbook, Macbook Pro, and Macbook Air. I was especially interested in the announcements because I am in the market for a new Mac and I was leaning towards a laptop.

Nvidia Graphics

One of the larger announcements made at the event was how the new notebooks were going to include the new Nvidia mobile chipset and graphics chip. The new chipset should give a nice speed boost for many high end graphics applications (like the new Photoshop CS4) and allow for more gaming capabilities on the Mac platform. While I welcome the new chipset I am not going to be doing much graphics work on my laptop so I am not that interested.

Aluminum Enclosure

Another big announcement made was about the new manufacturing process for the notebooks. All three of the notebooks are now being made using a unibody construction technique. They made the cases out of solid aluminum to make them stronger and more durable. I really like the new aluminum cases and I am all for a stronger, durable laptop. I am glad I waited to buy a new mac because these cases are much nicer than the plastic ones of the previous generation.

Glass Trackpad

One feature I am going to have to try before I buy is the new mouse trackpad. I have been wishing Apple add a right-click button on their laptops (or all Apple computers for that matter) for a long time. But instead of adding a button, they decided to take away mouse buttons all together. Apple made the entire trackpad a button and made the it even larger to support multi-touch gestures like they have on the iPhone. I have an iPhone and iPod touch and I like the touch gestures but I don’t know how well they will work on a notebook. I plan on going to an Apple store to try out the new trackpad before I make any decisions on the notebook.

24 Inch Cinema Display

Another announcement they made was a brand new 24 inch monitor with a built in web cam, microphone, and USB hub. It’s a very nice monitor but it is still much more expensive then other monitors of the same side. I don’t think a web cam is worth an extra 200-300 bucks.

Disappointments

I was disappointed with the lack of Blu-Ray support for any of Apple’s computers. I could care less if they put the drives in the computers but I at least want the ability to play them if I put my own drive in. Steve Jobs said that they are holding off until licensing issues are resolved and demand picks up. While I agree that Sony needs to ease up on some of these absurd licensing and DRM restrictions but I don’t think Blu-Ray will take off until a company like Apple makes it easy.

I was also disappointed with the lack of a real price cut. Apple did technically reduce the cost of the laptops but that is only for an under powered machine with the old plastic case. The new notebooks with all the great features are still rather expensive and I think that is a mistake. But I can’t say that I am surprised since Apple never has any really affordable products.

Final Thoughts

Overall I am pleased with the new notebooks. As I said earlier, I am definitely going to try before I buy any notebook so I guess I am off to an Apple store this weekend.

Why I shouldn’t Buy Train Tickets – Part 2

October has begun and I have the September’s results for my train travels. Make sure to read part 1 of this story to learn why I am keeping track of the number of times my train ticket is checked.

For the month of September I traveled on the train a total of 42 times and had my ticket checked only 15 times. Remember that a one way ticket is $2.25 USD and a monthly pass is $60.00 USD. If I only bought one way passes for the times I was checked I would have saved $26.25 USD.

So it seems that buying a monthly pass is turning out to be a bad idea.

Simple Backup Script using Windows Script Host and JScript

At work, I do my development on my local hard disk. I do this mainly for speed. But in between CVS check-ins I need to make sure I don’t lose any data. The company gives us all network drives that they keep backed up so I decided I would backup my local data to the network drive every night. I didn’t want to do this every day before I left work so I decided to write a script to automate the process. I had a few goals for this script to accomplish:

  1. Back up all the data in my local folder to a designated folder on my network drive.
  2. Keep each days backup in a separate folder labeled with the date of the backup.
  3. Automatically check the backup directory for backups older than a specified amount of days. I wanted to keep 5 days of backups at a time.

So I started to write a simple batch script to accomplish my goals. I always try to start with the simplest language to solve my problem. There is no reason to write a full blown application for a such a simple task. As I was writing the batch script the backing up part was easy to write but I couldn’t quite get my automatic deletion of older backups to work the way I wanted to. So I decided to abandon the batch script and move up to the next level. I examined the tools I could use and I decided to utilize another scripting technology built into Windows: the Windows Script Host or WSH.

There are two types of languages you can use to write WSH scripts: VBScript and JScript. VBScript is a simple scripting language based on Visual Basic and JScript is the same but based on JavaScript. I am familiar with both Visual Basic and JavaScript so I had a choice to make. I decided to use JScript because I like the syntax style better than Visual Basic.

So I hopped onto MSDN and read up on WSH and JScript syntax and a few hours later, had a finished script. I was pleasantly surprised at the power that the WSH and how easy it was to develop the script. Below is the script:

/*
 * Local to Network Drive Backup Script
 * Version 1.0.2 -- 2008-10-22
 * Written by Matt Bertolini
 *
 * Copyright (c) 2008 Matt Bertolini
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

// Variables to customize
var appName = "Local to Network Drive Backup Script";
var appVersion = "1.0.2";
var appVersionDate = "2008-10-22";
var sourceDir = "C:\\path\\to\\files\\to\\backup";
var backupDir = "C:\\path\\to\\backup\\folder";
var numDaysSaved = 5;

// Editing below this line is not recommended.

// Windows Script Host objects
var out = WScript.StdOut;
var fso = WScript.CreateObject("Scripting.FileSystemObject");
var WshShell = WScript.CreateObject("WScript.Shell");
var currentDateObj = new Date();

// Event log constants
var LOG_EVENT_SUCCESS = 0;
var LOG_EVENT_ERROR = 1;
var LOG_EVENT_WARNING = 2;
var LOG_EVENT_INFORMATION = 4;
var LOG_EVENT_AUDIT_SUCCESS = 8;
var LOG_EVENT_AUDIT_FAILURE = 16;

// Display script information to console.
out.WriteLine("===============================================================================");
out.WriteLine("\n  " + appName + "\n");
out.WriteLine("  Version " + appVersion + " -- " + appVersionDate);
out.WriteLine("  Written by Matt Bertolini\n");
out.WriteLine("  Script Directory: " + WScript.ScriptFullName);
out.WriteLine("  Backing up files for date: " + dateToIsoString(currentDateObj));
out.WriteLine("  Number of days to keep backups: " + numDaysSaved);
out.WriteLine("  Directory being backed up: " + sourceDir);
out.WriteLine("  Backing up to directory: " + backupDir);
out.WriteLine("\n===============================================================================\n");

// Execute script functions.
backupFolder(sourceDir, backupDir);
deleteOldBackups(backupDir, numDaysSaved);

WScript.Quit(0);

function deleteOldBackups(backupDir, numDaysSaved)
{
	// Create folder object for backup directory
	var backupDirObj = fso.GetFolder(backupDir);

	var fc = new Enumerator(backupDirObj.SubFolders);
	for(; !fc.atEnd(); fc.moveNext())
	{
		var folderName = fc.item().Name;
		var cutoffDateObj = new Date();
		cutoffDateObj.setDate(currentDateObj.getDate() - numDaysSaved);
		if(fc.item().DateCreated < cutoffDateObj)
		{
			out.Write("Deleting backup " + folderName + "... ");
			fso.DeleteFolder(fc.item(), true);
			out.WriteLine("done");
			WshShell.LogEvent(LOG_EVENT_SUCCESS, appName + " - Old backup " + folderName + " deleted successfully.");
		}
	}
}

function backupFolder(sourceDir, backupDir)
{
	try
	{
		if(fso.FolderExists(backupDir) == false)
		{
			out.Write("Backup folder does not exist. Creating folder...");
			fso.CreateFolder(backupDir);
			out.WriteLine("done");
		}
	}
	catch(e)
	{
		out.WriteLine("Could not create backup folder.");
		WshShell.LogEvent(LOG_EVENT_ERROR, appName + " - Could not create backup folder -- " + e);
	}

	try
	{
		out.Write("Creating folder for today\'s backup...");
		backupDir = backupDir + "\\" + dateToIsoString(currentDateObj);
		fso.CreateFolder(backupDir);
		out.WriteLine("done");
		out.Write("Backing up files...");
		fso.CopyFolder(sourceDir, backupDir);
		out.WriteLine("done");
		WshShell.LogEvent(LOG_EVENT_SUCCESS, appName + " - " + "Backup successful.");
	}
	catch(e)
	{
		out.WriteLine("Backup failed.");
		WshShell.LogEvent(LOG_EVENT_ERROR, appName + " - Backup failed -- " + e);
	}
}

function dateToIsoString(dateObj)
{
	var yearStr = dateObj.getYear().toString();
	var monthStr = (dateObj.getMonth() + 1).toString();
	var dayStr = dateObj.getDate().toString();
	if(monthStr.length == 1)
	{
		monthStr = "0" + monthStr;
	}
	if(dayStr.length == 1)
	{
		dayStr = "0" + dayStr;
	}
	return yearStr + "-" + monthStr + "-" + dayStr;
}

Next, I wrote a small batch file to call the Windows Script Host with the parameters that I wanted. Here is the batch file:

@echo off
cls
setlocal
title Local to Network Drive Backup Script
call cscript.exe //nologo backup.js
endlocal
cls
exit

Now for the best part. I am releasing the script under the MIT License so everyone is free to use and modify the script. All you have to do is keep the license at the top. Now I know the script is not perfect so if you find any bugs or have any suggestions on how to improve it, comment in this post and I will see what I can do.

Update 1 – 2008-10-02

I found a small bug in the ISO date formatting function so I have updated the script and bumped the version up to 1.0.1.

Update 2 – 2008-10-22

I have updated the script to version 1.0.2 by adding some more logging features (to the Windows Event Viewer) and to fix a bug with the deletion of old backups).

Why I shouldn’t Buy Train Tickets – Part 1

I am a regular working stiff now and that means that I am also a commuter. To get to work I have to take two trains: New Jersey Transit and PATH. Every month I have to buy a monthly pass to ride NJ Transit but as I settled into my commute I quickly noticed a disturbing trend; my ticket was not being checked.

Since I payed $60 USD for my monthly pass I was kind of annoyed that my ticket wasn’t being checked. Every time I rode the train without a check, I was wasting money. Because of this, I decided to do a little experiment. I started keeping track of when my ticket was checked to see how much money I could be saving by not buying a monthly pass. My backup plan would be a standard one way ticket. Since a one way ticket does not expire, I would keep one in my wallet for a time when my ticket was checked.

The first month I conducted this test was August. In this month I rode the train a total of 40 times. Of those 40 times, my ticket was checked only 10 times. A one way ticket for my trip costs $2.25 USD. So for the month of august, if I just bought one way tickets, my travel costs would be $22.50 USD. That is $37.50 cheaper than a monthy pass. That’s quite a savings.

Because of my findings in August, I decided to continue my experiment through September. I wanted to gather more data to see if it August was just a fluke or if NJ Transit really doesn’t care. I will post my September results in part 2 of this story. Stay tuned.

Trip to Walt Disney World – Part 4

If you haven’t done so already, make sure to read part 1, part 2, and part 3 of my my trip to Walt Disney World.

My last full day at Disney World was mainly a catch-up day for the family. We decided that we wanted to go back and ride some of our favorite rides but mainly we just wanted to have a fun relaxing last day. The day started at the Magic Kingdom.

Continue reading Trip to Walt Disney World – Part 4

Where Have You Been?!?!

As you are all definitely aware, my fourth and last post on my trip to Walt Disney World never came when it was supposed to. Well, it is going to come eventually. I have had a draft of the posts written for a long time. The reason why the post never came was because the real world finally caught up to me. I have started my working life and it has officially taken 98% of my life.

I can’t really give you specifics about where I work or what I do but I do work at a large company in New York and I am a computer programmer; that’s all your gonna get. While my career has started my job hasn’t really started yet. I am currently in training and will join my team in a few weeks.

Another big life event happened after I started my job. I finally moved into my first apartment. I was supposed to move in before I started work but unfortunately my apartment was delayed since it was new construction. Because of the delay, I was unable to sign up for internet access until after I moved in. My installation date was also pushed back because I could only get an installation on the weekends (employees in training don’t get days off). So today is my first day with internet access; a full two weeks after I moved in.

Now that I am working full time, I forsee my blogging habits to morph into weekly posts made on the weekends. The first post after this one should hopefully be the conclusion to my Disney World trip. Now all I have to do is remember what happened on that vacation. Stay tuned to see if I can remember.

Trip to Walt Disney World – Part 3

If you haven’t done so already, make sure to read part 1 and part 2 of my my trip to Walt Disney World.

Day five began just like day four. We headed to the pool for several hours of needed relaxation. These days were some of the hottest days of the week so it was a very good idea to hit the pool during some of the hotter hours so we didn’t get grumpy while at the parks. I think we spent more times in the pool than out. Continue reading Trip to Walt Disney World – Part 3

Trip to Walt Disney World – Part 2

If you haven’t already done so, make sure to read part one of my trip here.

Day three of our vacation started much like the day before. We woke up, went to breakfast, and immediately went off to a park. On this day we decided to go to the Magic Kingdom. There were a few new attractions that the family had not done and of course the classics that we all love to do. Continue reading Trip to Walt Disney World – Part 2

Trip to Walt Disney World – Part 1

If you haven’t been following my Twitter feed you might be wondering why I haven’t updated the blog lately. This is because I have been on vacation at Walk Disney World for the past week. The trip was sort of a graduation present and last vacation before I start work in July. This was a family trip and I was fortunate to have my entire immediate family come along (there was some doubt that my brother would be able to make it). Continue reading Trip to Walt Disney World – Part 1