Windows 7 runs extremely hot on MacBook Pro with Boot Camp 3.1

I was having some issues with the Windows XP installation in Boot Camp on my MacBook Pro, so I decided to turn it into a Windows 7 machine.

Unfortunately, the machine ended up running incredibly hot, even though I was booting it up and not really doing anything processing intensive on the machine.

As it turns out, I found that other users had some luck by enabling the Powermizer mode of their Nvidia GeForce 8600M GT internal graphics card. This would scale back the GPU processing and allow the idle fan speed of about 2000 RPM to properly cool the MacBook Pro.

As is the case with any registry hacks, edits or low level driver manipulation, you can quite easily do more harm than good. Please follow my advice at your own risk.

Alas, there is no setting that I could find for this in the newest 64-bit Windows drivers for the Nvidia GeForce 8600M GT internal graphics card in my MacBook Pro.  After a little digging, I found that I could add the following DWORD values to my registry to enable a lower power mode:

  • PerfLevelSvc (0x00003333)
  • PowerMizerEnable (0x00000001)
  • PowerMizerLevel (0x00000001)
  • PowerMizerLevelAC (0x00000001)

The key that these values were added to was HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Video\{FIND_YOUR_GUID}\0000. You will have to find the GUID to use in the key above, just look at all of the 0000 keys inside of the Video key for the one that has a whole mess of values in the right hand pane, this will likely be it.

Unperial gallon

I wonder how the paint company has managed to keep the cost of a gallon of paint steady amidst all of these rising prices…

Oh wait, now I get it.

E-Tech update: They have once and for all denied my appeal for a refund on the Sony replacement keyboard. Maybe I should have done a more big budget picture to demonstrate instead of what was done. (99 cents total were spent on Blue Harvest, I needed some chalk to write on the clapperboard and there were no kids around to beat up so that I could steal some.)

The plural of “digital cameras” is…

It has been a while since I posted something, and so when I was cleaning up the files from an older computer last night and stumbled on this beauty that I screen captured way back on August 19, 2004, I figured I should share…

Don’t bother going to their web site and checking, Dell fixed it pretty quickly, just in case you were wondering. Oh, and no word yet from E-Tech eStore regarding my appeal.

E-Tech Sony replacement keyboard woes

For many years, I faithfully used a Sony Vaio VGN-FS742/W notebook computer. This computer was an absolute workhorse, and I never had a problem with it, despite using it heavily for software development as well as the usual e-mail and web surfing activities.

After I let my brother and his family use the computer, an unfortunate incident occurred that involved the cosmetic destruction of the B key on the keyboard. The key worked, but the tabs that held the platform that the keycap sits on broke off, so the B key stuck out higher than the rest of the keys on the keyboard. Unsightly, yes, but still functional.

Alas, my brother had to have a functional and flat keyboard, so I began the process of looking to find a replacement keyboard for a computer that was 5+ years old. The Sony part number for this keyboard is 147915321, and it must be the same keyboard on all VGN-FS series Vaio notebooks.

The first thing that I found was that I was more than likely going to have to buy a used keyboard and hope that it worked just fine. So I ordered one from the E-Tech eStore. The keyboard arrived well packaged, and after I installed it, I tested every single key on the keyboard and found that all of the keys worked except for the V key.

At this point, I should have requested an RMA for a refund, but I mistakenly requested a replacement. After sending the first keyboard back and getting the second keyboard, the situation got worse, as on the 2nd keyboard, quite a few more keys were not working. And of course, at this point my return request for a refund was rejected, as E-Tech is claiming that their keyboards are all tested, and that I check my equipment for failure.

So, as a response, I created this little rant video showing that my equipment is fine:

httpv://www.youtube.com/watch?v=A_c1hBj2MG0

As I said in the video, I cannot see how they could have tested the keyboard fully, since my hardware seems to work fine with my old keyboard with the B key tabs broken. I am guessing that their replacement keyboards are all pulls from computers that are dropped off at the computer recycling, and for the particular keyboards that I received, the reason the computer was at the recycling center was that some of the keys stopped working.

By the way, congrats to the Ohio Bobcats.  Big win last night.

UPDATE: I still haven’t heard anything from E-Tech eStore regarding my appeal of their RMA request denial. Thanks to Tai Tran (eBay seller ID ttni) who came through with a perfectly working replacement keyboard.

VB.NET Printing For Dummies

In order to send stuff to the printer in VB.NET, it is not quite as simple as dealing with the Printer object as in VB6. There are a couple of extra steps involved. Here is what I found, along with some helper methods that you might find useful.

On the form you want to print from, pull up the Toolbox and add a PrintDocument, a PrintDialog, and a Button, set the Document property of the PrintDialog to point to the PrintDocument you just created, and in the button’s Click event, insert the following code:

    Private Sub butPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butPrint.Click
 
        If PrintDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
            PrintDocument1.DefaultPageSettings.Landscape = True
            PrintDocument1.Print()
        End If
 
    End Sub
 
    Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
 
        PrintTestPage(e.Graphics, PrintDocument1)
 
    End Sub

The Print method call in the button click event then fires the PrintDocument PrintPage event. Notice that I have set the default page settings to landscape. Don’t forget to wire the PrintDialog Document property to your PrintDocument, otherwise if you change the printer to print to in the print dialog, the document will still go to the default printer.

The PrintTestPage method is just something simple that I put together to make sure that the coordinates and justifications are all working fine. Here is that code:

    Sub PrintTestPage(ByVal g As System.Drawing.Graphics, ByVal doc As PrintDocument)
 
        Dim x, y As Integer
 
        For x = 0 To 100 Step 10
            For y = 0 To 100 Step 10
                PrintAtLocationWithColor(g, doc, x.ToString + ", " + y.ToString, x, y, _
                                         If(x = 0, "L", If(x = 100, "R", "C")), If(y = 0, "T", If(y = 100, "B", "C")), _
                                         "Arial", 8, True, Brushes.Red)
            Next
        Next
 
        PrintRectangle(g, doc, 0, 0, 100, 100)
        PrintRectangle(g, doc, 10, 10, 80, 80)
        PrintRectangle(g, doc, 20, 20, 60, 60)
        PrintRectangle(g, doc, 30, 30, 40, 40)
        PrintRectangle(g, doc, 40, 40, 20, 20)
 
    End Sub

The two methods called here, PrintAtLocationWithColor and PrintRectangle, are shown here:

    Sub PrintAtLocationWithColor(ByVal pg As Graphics, ByVal pd As PrintDocument, ByVal s As String, _
                                ByVal xPosition As Single, ByVal yPosition As Single, _
                                ByVal justification As String, ByVal verticalJustification As String, _
                                ByVal fontFace As String, ByVal fontSize As Single, _
                                ByVal fontBold As Boolean, ByVal theColor As Brush)
 
        Dim w, h As Single
        Dim x, y As Single
        Dim f As Font
        Dim sty As FontStyle
 
        sty = FontStyle.Regular
        If fontBold Then sty = sty + FontStyle.Bold
        If fontSize < 1 Then fontSize = 8.0
        f = New Font(fontFace, fontSize, sty)
 
        If pd.DefaultPageSettings.Landscape Then
            x = xPosition / 100 * (pd.DefaultPageSettings.PrintableArea.Height)
            y = yPosition / 100 * (pd.DefaultPageSettings.PrintableArea.Width)
        Else
            x = xPosition / 100 * (pd.DefaultPageSettings.PrintableArea.Width)
            y = yPosition / 100 * (pd.DefaultPageSettings.PrintableArea.Height)
        End If
 
        w = pg.MeasureString(s, f).Width
        h = pg.MeasureString(s, f).Height
 
        If Left(UCase(justification), 1) = "C" Then
            x = x - w / 2
        End If
        If Left(UCase(justification), 1) = "R" Then
            x = x - w
        End If
 
        If Left(UCase(verticalJustification), 1) = "C" Then
            y = y - h / 2
        End If
        If Left(UCase(verticalJustification), 1) = "B" Then
            y = y - h
        End If
 
        pg.DrawString(s, f, theColor, x, y)
 
    End Sub
 
    Sub PrintRectangle(ByVal pg As Graphics, ByVal pd As PrintDocument, ByVal xPosition As Single, ByVal yPosition As Single, _
                                ByVal width As Single, ByVal height As Single)
 
        Dim w, h As Single
        Dim x, y As Single
 
        If pd.DefaultPageSettings.Landscape Then
            x = xPosition / 100 * (pd.DefaultPageSettings.PrintableArea.Height)
            y = yPosition / 100 * (pd.DefaultPageSettings.PrintableArea.Width)
            w = width / 100 * (pd.DefaultPageSettings.PrintableArea.Height)
            h = height / 100 * (pd.DefaultPageSettings.PrintableArea.Width)
        Else
            x = xPosition / 100 * (pd.DefaultPageSettings.PrintableArea.Width)
            y = yPosition / 100 * (pd.DefaultPageSettings.PrintableArea.Height)
            w = width / 100 * (pd.DefaultPageSettings.PrintableArea.Width)
            h = height / 100 * (pd.DefaultPageSettings.PrintableArea.Height)
        End If
 
        pg.DrawRectangle(Pens.Black, x, y, w, h)
 
    End Sub

All of the positioning and size parameters of these methods are percentages across and down the page, which I find much easier to deal with than absolute or printer specific positioning. This makes it dead simple to scale the reports to any page size I want to use.

Documentation overload

Peanut allergies are really only a problem if you can open the package…  Oh wait, now I figured it out…

So I should probably take the jackhammer back to the tool rental place, I guess I won’t be needing it to eat my Kit Kat bar.

Sansa e250 database rebuild

For some reason, my Sandisk Sansa e250 MP3 player was stubbornly refusing to acknowledge the music that I was copying to it. I tried just about everything I could think of short of formatting the device to get it to see my folders in the Music folder. My device has the latest version 1 firmware upgrade, and I have tried to use both MSC and MTP mode to copy folders to the device, all to no avail.

Finally, I found out that I could force the device to do a database rebuild by doing the following steps, which should work on any Sansa e200 series MP3 player with the version 1 firmware:  (WARNING:  Please do not do this if you are worried about making your device inoperable.  There is always a risk that this will happen when you start futzing with the system files.)

  • Go into the Settings screen and scroll to USB mode, and set it to MSC
  • Connect the device to the computer
  • Once the device mounts as a drive on your computer, browse to the device, look for the System folder, and the Data folder in that folder
  • Delete the file called PP5000.DAT
  • Disconnect the device

Once you disconnect, the device will restart, and it should refresh the database. If you prefer MTP mode, make sure to go back into the settings to change it back.

Gmail phishing warning

I think that Google might have the Gmail phishing filter set just a tad too strong. I was in my Gmail account this morning and accidentally clicked on the very first message I got in the account, which is of course the introductory e-mail that describes how to switch your existing e-mail over to Gmail. Here is what I saw:

.NET Kombat (Format vs. ToString)

In converting some legacy VB6 code to VB.NET, I noticed that there was a lot of use of the Format function in the code to convert numbers to strings. This makes sense as Format was pretty much the only game in town in VB6.

However, in .NET, they introduced a handy-dandy .ToString() method that, on the surface, seems to do much the same thing as the Format function. I have been able to use them pretty much interchangeably with the desired results coming out every time.

I started to wonder which way was faster. Since I am a big proponent of empirical knowledge instead of just trying to get the theoretical story behind the two ways to do this, I rolled together this quick VB.NET console application:

Imports System.Text
 
Module Module1
 
    Sub Main()
 
        Dim i As Integer
        Dim r As Random = New Random()
        Dim t As Double
 
        System.Console.WriteLine("10,000,000 Formats")
        Dim sb1 As New stringbuilder
        t = Timer
        For i = 1 To 10000000
            sb1.Append(Format(r.NextDouble * 100.0, "###0.00 "))
        Next
        System.Console.WriteLine("Seconds elapsed: " + (Timer - t).ToString("#######0.00"))
        System.Console.WriteLine("Length of string builder: " + sb1.Length.ToString())
        System.Console.WriteLine()
 
        System.Console.WriteLine("10,000,000 ToStrings")
        Dim sb2 As New StringBuilder
        t = Timer
        For i = 1 To 10000000
            sb2.Append((r.NextDouble * 100.0).ToString("###0.00 "))
        Next
        System.Console.WriteLine("Seconds elapsed: " + (Timer - t).ToString("#######0.00"))
        System.Console.WriteLine("Length of string builder: " + sb2.Length.ToString())
        System.Console.WriteLine()
 
        System.Console.WriteLine("Press any key to end the program ")
        System.Console.ReadKey()
 
    End Sub
 
End Module

And here are the results:

As you can see, the ToString method is about 15% faster when doing 10 million calls with random numbers.

Oh, and by the way, Happy Pancake Day.

Weird Stuff Warehouse

A co-worker brought this link to my attention:

Silicon Valley’s Island of Misfit Tech

I can’t believe that, with all of the trips that I have made to the Bay Area, that I never heard of this place or stumbled upon it by accident. I so want to go there now to look for a copy of Microsoft Bob. Or maybe I should try to sell my copy of Microsoft Dogs.