This is common sense, of course, but I was amazed at the profiteering some computer stores are up to.
I was looking for some CAT5E network cable to connect my media centre to my network, and enquired at a few stores. I was quoted R7.50 and R8.00/meter, and finally bought at another store for R3.00/meter. Granted, the first two prices were for stores inside a popular shopping mall, and the last is not. But charging 166% more than someone else for the same thing? I was even contemplating getting a wireless network adapter because it would have been cheaper than the cable at R8.00/meter!
Since then I found the name of a cable supplier which might even be cheaper than R3.00/meter. In case you are in Cape Town, look at Cape Cables.
Shop around before you open your wallet
0 comments Filed Under: Network Cable
Generic classes and Component services
I recently wrote a lightweight generic data access layer with generic list functionality. Everything worked fine until I had to implement a derived class as a Serviced Component. Turns out classes with generic methods cannot be added to component services, regsvcs.exe gives the following error
An unknown exception occurred during installation:
1: System.Reflection.ReflectionTypeLoadException - Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Searched Google, and found 2 hits. If that happens you know trouble is looming on the horizon...
It appears to be a known bug, see the details here.
So for now I had to implement a workaround by not having my class derive from the generic base class but instead to have a private instance of it.
0 comments Filed Under: C#, Component Services, Generics
Getting Hauppauge WinTV-PVR-150 IR Blaster to work
I'm ready to move to the next level, to be able to change the channels on my decoder using the IR blaster that comes with the PVR-150. This link will help you a lot: LIRC PVR-150 IR blaster support
I only had to download the firmware and put it into the /lib/firmware directory on mythbuntu, and configure the IR blaster in Mythbuntu Control Center. I still have to figure out which codeset to use, but at least the irsend makes the little led on the blaster flash now.
0 comments Filed Under: hauppauge, IR Blaster, Media Centre, mythbuntu, mythtv
MythTV on Windows
I found a nice mythtv front-end for Windows, MythTV Player. Version 0.50 even supports Live TV. It can skip commercials as well.
I found the download here
0 comments Filed Under: mythtv, mythtv player, Windows XP
My first foray into PowerShell
I needed to change the date/timestamp on a file, and found that the touch utility does not exist. I also could not find the XP resource kit download, which apparently contains it. Then I remembered that PowerShell was installed when I recently installed SQL Server Express 2008.
$(get-item test.txt).lastwritetime=$(get-date "08/31/2012")
0 comments Filed Under: PowerShell, Timestamp
How many rows in all the tables in a database?
Often one needs to know the number of rows in all tables in a database, like when you are writing or executing tests, and need to know if you have test data for a table.
SELECT sysobjects.[name], max(sysindexes.[rows]) AS TableRowsYou can find the original here.
FROM sysindexes INNER JOIN sysobjects ON sysindexes.[id] = sysobjects.[id]
WHERE sysobjects.xtype = 'U'
GROUP BY sysobjects.[name]
ORDER BY name
0 comments Filed Under: RowCount, SQL Server
C# generics and testing
The power of C# generics, you just gotta love it.
The generic method:
public void TestGeneric(int logicalRecord) where L : new()
{
L list = new L();
Type x = typeof(L);
MethodInfo LoadMethod = x.GetMethod("LoadById");
Listrecords = (List )LoadMethod.Invoke(list, new object[] { logicalRecord });
Assert.IsTrue(records.Count > 0);
}
Invoking the generic method with the Factory type and the List type
TestGeneric(logicalRecord);
0 comments Filed Under: C#, Generics, NUnit