I finished installing Gentoo Linux on 3 of my old Linux boxes (2 to go). It runs very smoothly. I am really impressed by Gentoo Linux. I am upgrading my OpenMosix kernel to 2.4.20-3 and I face some little quirks. Hopefully they'll be resolved soon.
I also finally configured succesfully distcc. Not every ebuilds use it: MySQL doesn't but ntp does. I guess it's a case-by-case type of thing. Hoepully X and KDE will take advantage of it otherwise it will take a week again to compile everything...
I'll get one more used PC tonight: an IBM PG300GL. It will likely replace one of my old Digital PC5100. Or it may be added to my cluster. I'll see...
I'll probably have to go on a business trip next week, to be confirmed.
1:29:43 PM comment [] - See Also: LinuxOpenMosix
Spent most of the week-end finishing and fine-tuning my installation of Gentoo Linux on two old boxes I have. It is very stable and more responsive than Red Hat 7.3 I used previously on these two boxes. The only drawback is that I now have two OpenMosix clusters: One with three machines running Red Hat 7.3/kernel 2.4.16 and one with two machines running Gentoo 1.4_rc4/kernel 2.4.20. I'll probably start to convert one more Red Hat machine to Gento tonight. And the rest over the next week-end. I am also discussing with somebody about getting 6 more machines!
The only major problem I had was with distcc. I just couldn't make it work. I followed the instructions, tried many things but it just won't distribute. I'll have to simply rely on OpenMosix to distribute task on the machines of the cluster. This do works. I used it to compile Samba without any problems at all.
I am also thinkering with the idea of installing Blender on all my Linux machines to distribute the load when rendering. I discovered a very nice utility allowing the distribution of a blender job on an OpenMosix cluster. I'll try this one over the week-end too.
1:05:48 PM comment [] - See Also: LinuxOpenMosixMultimedia
I just installed the SpamBayes plug-in for Outlook. Like Jon Udell, I think it just rocks. The fact it relies on the words of the content and their occurences protects me against spam especially well since most of my friends and familly are writing to me in French while 99.9999% of the spam is in English. In this case, ham and spam don't even use the same words corpus!
10:42:16 AM comment [] - See Also: Metadata
I tried to install Gentoo tonight but I have a problem burning a bootable CD from the ISO files available. I posted a message about it on the Gentoo forum. If you read it and have a solution, let me know.
9:33:21 PM comment [] - See Also: Linux
Roy Osherove posted a link to some cool Registry settings. One of them I found quite usefull: Enable AutoCompletion in Command Prompt. Once this setting is done, you can use the tab key for autocompleting while typing in the command prompt (cmd)! For example you type "cd c:\progr" (without return) and press the tab key, "progr" will be completed to "Program Files".
To enable this setting, change the following key in the registry: HKEY_CURRENT_USERSoftwareMicrosoftCommand ProcessorCompletionChar Change this value (or create the key, DWORD) to 9.
A while back, I created a simple console app for thumbnailing photos for posting on my family Web site. The application simply asks for a directory and a reduction percentage, then looks for any images in the directory provided and reduces them by the requested percentage.
This was fine as far as it went, but I realized after a colleague, Ryan Trudelle-Schwarz, requested copies of some of the photos I'd thumbnailed with this app, that I had neglected to correctly transfer the properties from the old image to the newly-created thumbnail. Given that digital cameras like mine (a Nikon CoolPix 4500) provide a lot of information in the properties, from photo info like focal length, exposure time, and ISO speed to important stuff like the date the photo was taken (as opposed to the date the file was last copied/altered).
Given that the app did mostly what I wanted, I didn't tackle the property transfer until recently. I was pleased to find that as with most stuff in .NET, it was pretty easy, once I stopped trying to fight the platform (I initially tried doing a For loop with a counter variable, but wasn't getting the PropertyItems populated that way). My initial successful code took advantage of a neat feature of arrays (the properties of an image are stored in an array called PropertyItems) called Enumerators. Enumerators, which implement the IEnumerator interface, allow you to easily traverse the members of an array or collection much the same way as you would a recordset or a DataReader. The code below gets an enumerator for the PropertyItems array of an instance of System.Drawing.Image that is created from the image being thumbnailed, and then calls the SetPropertyItem method of a new instance of System.Drawing.Bitmap that will contain the thumbnail version of the image:
Dim imgPropEnum As System.Collections.IEnumerator = img.PropertyItems.GetEnumerator
While imgPropEnum.MoveNext()
bmp.SetPropertyItem(imgPropEnum.Current)
End While
In a subsequent email, Ryan suggested the following code, which is a little cleaner, and perhaps more like what a VB programmer would expect to use:
Dim PropItm As PropertyItem
For Each PropItm In img.PropertyItems
bmp.SetPropertyItem(PropItm)
Next
Either will work, and both are examples of how simple tasks graphics-related tasks are in the .NET Framework. The trick, as I discovered, is to work with the framework, rather than against it.
As an aside, while I was playing with the code above, I also took a look at the GetThumbnailImage method of the Image class, but found that the method appears to both reduce the size of the image and compress it, such that the resulting image quality is fairly poor. In all fairness, the MSDN docs for the GetThumbnailImage method does warn that
GetThumbnailImage works well when the requested thumbnail image has a size of about 120 x 120. If you request a large thumbnail image (say 300 x 300) from an Image object that has an embedded thumbnail, there could be a noticeable loss of quality in the thumbnail image. It might be better to scale the main image (instead of scaling the embedded thumbnail) by calling DrawImage.
but I was hoping that the code for creating a decent thumbnail would've been as simple as a single method call, perhaps one overloaded to allow both compressed and non-compressed thumbnails. Not that it's all that difficult to scale an image in .NET, of course. I guess I've just gotten spoiled by how much the framework classes do for the developer that now I expect them to do everything. Perhaps in version 2.0.
[Listening to: How Blue Can You Get? - B.B. King - The Best of B.B. King [MCA] (05:09)]
This is a very cool trick as I take tons of pictures that I shuffle around and manipulate a lot. I could use this trick in a script that is applying a series of "steps" to a fixed set of pictures.
Just to test the w.bloggar tool with this blog and because it's always nice to have something to say, I thought why not post a nice T-SQL Tip. (It works on Oracle too btw)
Optional parameters When you have a table, say Orders (as in the Northwind database which comes with SQLServer), which has more than 1 foreign key (FK), it is typical that developers will query the Orders table based on a combination of these FK fields. However, as with the Orders table, this can be quite cumbersome when there are a number of FK fields. It would be nice if you could pass along any combination of these FK fields to a single stored procedure which would use these parameters to query the table in a uniform manner, so there will be no recompiles (most people who try to use optional parameters end up concatenating SQL strings in a stored procedure, which is not that good).
The idea is this: for every parameter you do not need, you pass in 'NULL' as value. For every parameter you do need, you pass in the value you want to filter on. Let's get back to the example table, the Orders table in the Northwind database. This table has 3 foreign keys: CustomerID, EmployeeID and ShipVia. If we want all Orders of a given CustomerID which are taken by a given Employee we normally wouldn't be able to use the same stored procedure which would query for all Orders for a given Customer which are shipped via a given ShipVia value. But you can! Here's how:
CREATE PROCEDURE pr_Orders_SelectMultiWCustomerEmployeeShipper
@sCustomerID nchar(5),
@iEmployeeID int,
@iShipVia int
AS
SELECT *
FROM Orders
WHERE CustomerID = COALESCE(@sCustomerID, CustomerID)
AND
EmployeeID = COALESCE(@iEmployeeID, EmployeeID)
AND
ShipVia = COALESCE(@iShipVia, ShipVia)
That's it! This stored procedure will query for Orders on any given combination of CustomerID, EmployeeID and ShipVia. If we f.e. want to select all Orders for Customer 'CHOPS' and ShipVia '1', pass these 2 values to the stored procedure and pass NULL for @iEmployeeID. This will result in the requested rows.
Caveats. Of course there are drawbacks. One of them is that this is slower than a query which is taylored to the columns you want to filter on. It also needs a clustered index to work well, but every table should have a clustered index anyway to support fast retrievals of data.
While backing up with Veritas Back Up Exec 8.6, it is impossible to either capture or render with Adobe Premiere 6.0: tried 4 times, crashed the machine 4 times...
9:00:39 PM comment [] - See Also: MultimediaAdobe Premieredat24x6
I finally solve my OFO problem with BackupExec. It seems it isincompatible with Roxio EasyCD creator. I got rid of Roxio and boom, problem solved. I am testing it intensively to make sure I ironed out any problems left.
4:48:00 PM comment [] - See Also: dat24x6
I just bumped into an Anti-Spam tool that actually seems to work. It has caught 100% of the Spam coming into my In-box for the last 48 hours without ANY interaction on my part.
It is an Outlook Add-in so it is seamless (no external program to scrub your email first, nothing server side required). This was something I've wanted for a while now.