Thomas H. Chapin IV Musings and General Nonsense

31Mar/091

The Vendor Client relationship – in real world situations

I ran across this video the other day and thought it was funny enough to be worth sharing. Every now and then you actually run across clients like this:

8Mar/092

A Card “Force” Using Unintuitive Mathematical Odds

"A card force is one of any number of methods used in close-up magic to apparently offer a subject a free or random choice of card, when in fact the magician knows in advance exactly which card will be chosen. This can then be revealed later in the trick."

Premise: We have a set of three cards, all of which are known to us. We attempt to force a specific card on the unsuspecting participant by instructing them to randomly point at one of three cards, which are all laying face down. Theoretically, they have a one in three chance of picking the correct card randomly. If they point at the desired card, we immediately instruct them to flip it, effectively "forcing" the card on them in one try. If this works on the first try, the trick will be especially impressive. However, if it doesn't work on the first try, we still have a fall-back method:

If they point at one of the other cards, instead of telling them to flip the card, we pretend that they're playing a game of elimination and we simply remove the card, instructing them to point again. If they point at the next incorrect card, we instruct them to remove it, leaving one final card: the correct one.

Potential downside: If they point at the desired card on the second step, then the "force" fails,
because when we remove it, the end card will actually be the incorrect one.

Cards used: Ace of Hearts (the desired card), Queen of Clubs, and 8 of Spades

Approximate Results After 2000 Simulations:
Times ended on Ace of Hearts: 1322 (0.661)
Times ended on Queen of Clubs: 339 (0.1695)
Times ended on 8 of Spades: 339 (0.1695)

Click here to run the simulations yourself using javascript

Explanation:
Odds of picking the right card during the first step: 1/3. If incorrect card is chosen on first step, we pretend it's an elimination game and remove the card, leaving only two cards, the desired card, and the incorrect card. At this point, you might think there is an even 50/50 chance they will choose the correct card, but in reality, the odds of them choosing and eliminating the desired card are still 1/3 because it hasn't been touched. The odds of them choosing and eliminating the second incorrect card, however, have increased to 2/3. This is unintuitive, but the simulation shows it to be true.

Verdict:
Because of the fact that we know which cards are which, we can effectively double our seemingly low 33% odds all the way to 66% simply by using this card force method.

The only unsolved problem is, how do you handle a dead end where someone chooses the wrong card, and then the right card on the second step?

30Oct/080

Flash 10 Demo

Grant Skinner (gskinner.com) just recently posted this Flash 10 3D music visualizer demo on his "gBlog". It's crazy awesome, and even after examining the source code, I'm still not sure how it all works.

For what it's worth, I went and edited it a bit, removing the music visualizer stuff and just making it spin according to your mouse position over it. Fun stuff. Check it out (P.S. Get Flash 10, Now!):

12Jan/060

Get rid of those pesky Windows XP temp files

I just recently stumbled upon a nifty way to make my windows xp machine run a little bit faster. Check it out.

If you search your entire computer for temp files, you may be surprised to find hundreds of megabytes worth of data that has been sitting around since God knows when. Windows is supposed to automatically delete these, but sometimes it just doesn't happen. Now... supposedly when you boot up your computer or internet explorer, Windows will scan through your temp files (looking for recently viewed web pages, etc). So if everything is cluttered up, things might run a little bit slow.

So the goal here is to delete all temp files before we shut down the system at the end of the day. This way, everything is fresh and clean, come next morning!

  1. Open up a copy of notepad and paste in the following chunk of text:

    @echo off
    taskkill /F /FI "USERNAME ne SYSTEM" /FI "USERNAME ne LOCAL SERVICE" /FI "USERNAME ne NETWORK SERVICE" /FI "IMAGENAME ne explorer.exe" /FI "IMAGENAME ne cmd.exe" /FI "IMAGENAME ne taskkill.exe"
    RD /S /q "%HOMEPATH%\Local Settings\History"
    RD /S /q "%HOMEPATH%\Local Settings\Temp"
    RD /S /q "C:\temp"
    RD /S /q "C:\Windows\Temp"
    SHUTDOWN -s -t 01


  2. Save the file off as "C:\shutdown.bat" (make sure you set the file type as "All Files", *not* "Text Documents")
  3. Browse to your C:\ drive using windows explorer and right-click on the shutdown.bat file. Select the "Create Shortcut" option in the context menu.
  4. Rename the shortcut file to "Clear Temp Files & Shut Down".
  5. Right-click on the shortcut and select "Properties" from the context menu.
  6. When the properties window pops up, make sure you are on the "Shortcut" tab and click on the "Change Icon" button. If it gives you some kind of error about the file not containing any icons, ignore it and just click OK.
  7. Where it says "Look for icons in this file:", make sure that it says, "%SystemRoot%\system32\SHELL32.dll".
  8. Select the red, square icon with the circle and a vertical line in the middle. This is the shutdown icon that you see when you click on your start button and select "Turn off your computer".
  9. Ok your way out of there back to your explorer window.
  10. Drag the shortcut to your desktop.

Now, whenever you want to shut down your computer, just double-click the icon on your desktop!
Windows will clear your temp files after killing all your programs (it can't clear temp files if programs are currently using them), and then it will proceed to shut down.

IMPORTANT NOTE: If you are using Windows XP Home, you may not have the taskkill.exe file, as it only comes with Windows XP Pro by default. Click here to download it and extract it to your C:\Windows\System32\ folder.

12Jan/065

Boot up Windows before you even log in

If you don't use any Windows XP login security, then you can skip this article. Otherwise, if you are like many Windows XP users who have to enter a password every time their computer sluggishly boots up, then read this!

Ok. Here's the scenario:

You have to wait 2 minutes while your computer turns on. You have to sit in front of your computer during this whole time because once it finally gets to the login screen, you have to type in the password. The computer then crunches numbers for another 2 minutes while it loads a wide variety of programs (MSN messenger, your Norton Antivirus, your Microsoft Office shortcut bar, etc...). Finally, after like 5 minutes, you have access to your desktop.

How would you like your computer to load all those programs *before* you ever have to enter your password? You could press the button to power up your system and go get a cup of coffee. Five minutes later, you come to your desk and type in your password. BAM! Instantly dropped to the desktop! Your programs are already running and all systems are a go!

Here's how to do it:

  1. Download Microsoft's free TweakUI tool and install it.
  2. Click your Start button, go to your Programs menu, and select Tweak UI from the "Powertoys for Windows XP" folder.
  3. In the TweakUI window, double-click the "Logon" item in the left-hand column to expand it.
  4. Click on the "Autologon" item underneath the "Logon" section.
  5. Check the box that says "Log on automatically at system startup"
  6. Click the "Set Password" button and enter in your windows login password
  7. Click OK and close Tweak UI.
  8. Download this .reg file and run it. When it asks you if you want to merge it with your registry, choose "Yes".NOTE: If you feel queasy about merging a reg file with your registry, you can also add it by hand. Go to Start > Run and type in "regedit" and press OK. Browse to [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run] and create a new String Value. Name it "Lock Computer on Startup", and set the value to "rundll32.exe user32.dll, LockWorkStation"

Presto! You're done!

Now, when you boot up your computer, it will automatically log you in to your desktop and start up your programs. However, it will still secure your system, requiring you to enter your password to access it.