Nov 23, 2009

Mouse wheel affects: Focus vs Mouseover

I was recently asked to cite sources of applications that have their scroll wheel act upon their moused over target, as opposed to the mouse wheel acting upon the application's focus.

I am pro-Mouseover scroll wheel. Among the mouseover based, there are two camps. Those that ignore the wheel when the mouseover doesn't make sense, and those that use the focus when the mouseover doesn't make sense. I agree with the later.

Mouseover based: Uses mouse location to decide what the scroll wheel means.

Firefox v3.5.5 Tabs vs Window
Picasa 3 v3.5.0 Explorer vs Picture list
Calibre v0.6.7 Content vs Detail
TextPad v5.2.0 Explorer vs Content
Photoshop v8.0 Picture vs Picture
Google Earth v5.0.11733.9347 Left Menu vs The Planet >.<
FreeMind v0.8.1 Content vs Notes

Focused based: Uses the application focus to decide what the scroll wheel means.

Visual Studio '05 v8.0.50727.42
Windows Explorer XP Pro SP3
Excel '03
Dreamweaver MX v6.0
EVEMon v1.2.8.1385
FileZilla v3.3.0


Cool Edit Pro v2.00, Mousing over the sound wave and using scroll drops focus from anything else. Otherwise focused based.

Nov 11, 2009

SVN Automated Local Update


This short tutorial will get SVN to automatically grab any changes to a SVN repository for you at designated times. I use this so that each morning, I have a "what was changed" report, without the monotonous select all folders and ask for an update. You will need TortoiseSVN installed, and running Windows for this script to run correctly.

The Tutorial

Start by copying this base script into TextPad (or your text editor of choice):
@echo off

echo == Initiating system instance variables...
echo. -- Setting the variables...

:: Here you need to make some changes to suit your system.
set SVN=C:\Program Files\TortoiseSVN\bin

:: Unless you want to modify the script, this is enough.

echo. %SOURCE%
echo. %SVN%
echo. ++ Done setting variables.
echo == Updating source from SVN
echo. -- Running update...
"%SVN%\TortoiseProc.exe" /command:update /path:"%SOURCE%"
echo. ++ Done.

echo. -- Cleaning up...
set SVN=
echo. ++ Done.
Edit the SOURCE's CHANGEME to a directory that you could normally right-click and select "SVN Update". This address can be grabbed with a quick copy paste of the address bar when you have navigated to that folder in Windows Explorer. Such an entry should appear as so:
set SOURCE=E:\My Files\My Work\SuperSecretProject
Save that script as "SVNUpdateMyFilesPlease.bat". Next step is to get that file to run at proper intervals of time. Navigate to: Start -> Settings -> Control Panel -> Scheduled Task -> Add Scheduled Task.

In the wizard, hit next, then browse for your bat file you just made (you did test it to be sure it works, right?). From there, I trust that you can figure out the rest of the wizard.

If you have multiple projects, you need to make multiple bat files and multiple schedules, right? Wrong. All on one line, keep adding each project behind the last with a "*" between each.
set SOURCE=E:\My Files\My Work\SuperSecretProject*E:\My Files\My Work\KindaSecretProject*E:\My Files\My Work\ProjectIKeepForJobSecuirty*E:\My Files\My Work\ProjectThatWillHelpMeRuleTheWorld*E:\My Files\My Work\MuhahahahahahahaProject
The ["%SVN%\TortoiseProc.exe" /command:update /path:"%SOURCE%"] line can edited to do many things, such as close the update window when there were no errors, conflicts or merges.
%SVN%\TortoiseProc.exe" /command:update /path:"%SOURCE%" /closeonend:3
A list of what each closeonend:# does can be found here.

Credit Where Credit is Due

The script that makes this possible was written by varl from The multiple files in one line for windows command line was learned from this random "U B" fellow.

Nov 6, 2009

Grabbing Dews from a Fridge

As I walk off with the first can of Dew, it doesn't seem very cold, so I put it back and grab the other one. It feels much colder, and therefore, is the right one.

I can't help but think that my time holding the first can makes my fingers colder, giving the illusion that the second can is colder. I fear I'll never find the right can the first time.

(We only keep 2 cans in the fridge at a time, and replace them as we grab them. With three drinkers in the house, from time to time, they are both warm.)

Oct 21, 2009

Swine Flu vs Prisoner's Dilemma

Swine Flu is a moral dilemma much akin to the Prisoner's dilemma on a huge scale. To understand this, I need to assume you know the basis of the hype for the Swine Flu. It is less deadly in its current form then the generic flu. Swine Flu's strains change at an alarming rate, and it is quite contagious.

The Prisoner's Dilemma is as follows from Wikipedia
Two suspects are arrested by the police. The police have insufficient evidence for a conviction, and, having separated both prisoners, visit each of them to offer the same deal. If one testifies (defects from the other) for the prosecution against the other and the other remains silent (cooperates with the other), the betrayer goes free and the silent accomplice receives the full 10-year sentence. If both remain silent, both prisoners are sentenced to only six months in jail for a minor charge. If each betrays the other, each receives a five-year sentence. Each prisoner must choose to betray the other or to remain silent. Each one is assured that the other would not know about the betrayal before the end of the investigation. How should the prisoners act?
How is this like Swine Flu? The people that get infected (yes, I understand few to none of them do it on purpose) have some basic resistance against Swine Flu. The more people that get infected, the greater the chance that the Swine Flu will gain a deadly strain. The people that have already have had Swine Flu are more likely to survive a pandemic of that deadly strain.

Armed with the knowledge that the current strain is rather survivable and are a vaccine from the wild, and future strains may not be easily survived, would you be more likely to cause yourself to become infected to gain resistance against a future deadlier string?

I probably should note here that IANAD.

Oct 8, 2009

Bomberman Ultra (PS3 DL) - QA

This is a list of QA problems I've found with Bomberman Ultra. I try to hold my opinion's out of this as much as possible, and only point out bugs. Opinion's are in italics. If you'd like to contribute to this list, either contact me via the Contact section, or comment on this post.


  • A player can halt a multiplayer game from getting hosted by sitting in a game room without hitting x (confirming they are ready to play).
  • A system locks down in one of these scenarios (I'm not entirely sure which one happened):
    • Host/player leaves game, or powers off their remote system
    • Bad connection causes lag out
    During lock down, nothing on the controller has an effect on the game (game movement, start, PS3 Home button press/hold). Powering down the system by holding the console's power button was needed. I waited just short of a minute for any interaction. Even if there is an out for this scenario, 5 seconds is too long to disallow any controller actions.


  • The costumes pieces are unlocked by a profile's player slot numbers. Eg. This profile's player slot 2 has to unlock each of it's costume pieces separately than slots 1, 3, and 4. It is now my understanding that profile per player is a PS3 system problem. Get your act together Sony!
  • Local play is unable to customize player costumes. This can be worked around by going into Multiplayer, in which the other player slots may customize their bomber for Local play.
  • It would be better for only unlocked pieces to be shown. Taken a step further, for each sphere picked up, one is given a choice among three pieces to add to their collection. Eg. Player has collected 3 spheres since she last looking at the custom costume screen. She is shown three random locked pieces, and gets to keep one. This process is repeated twice more, each time three new random pieces shown.


  • Extra players signed in on a single console are stuck with player one's profile name. Loading other profiles isn't possible. Is this not possible at the machine level? I don't recall a single multi profile game on PS3.

Jun 17, 2009

Time sheets in Google: Displaying time as hours duration, not hours date

Both the "=hour(hours)" and "=time(hours,minutes,seconds)" functions of Google Spreadsheets are time values. This means that they will display what hour of the day your current input will be. This can be frustrating when a creating a time sheet.

After setting a format to "Hours" (under the 123 dropdown), the time function will still insist on using an hour of the day number. If you put in an int without a function, you'll have the number of days written out in the hours format.

To get around this, set up a normal column for your int hours, and set up an hours column with the function "=([hoursCell]/24)".

Jun 14, 2009

Tutorial: Moving from one Google account to another Google account


Back in 2004, I was still in high school, and choose a nickname for my email address to GMail. I am now out of college and using that same email address for business correspondence. Alas, the nickname itself isn't professional.

For years, I used a second email address from my nickname address. Any mail sent to "wattslevi" was forwarded to my nickname, and my nickname account was set up to send email as the professional name. Part of the "email as" feature tells the receiver who actually sent the email.
"From: [] On Behalf Of Levi Watts"
I dreaded the process of moving over to another account. I found the process to be much easier than I expected, even after considering the non-email aspects of my account (Google Docs).

The Process

GMail: Getting all of your old accounts emails into the new account

From the old account, go to "Settings" in the top right corner of GMail. Select the "Forwarding and POP/IMAP" tab, and enable under POP Download: "Enable POP for all mail". Click "Save Changes" below after that. Note: If you have previously used POP on this account, the wording may be slightly different.

From the new account, go to "Settings" in the top right corner of GMail. Select the "Accounts" tab, and under "Get mail from other accounts", click "Add a mail account you own." You will need to provide Google with your email address and the credentials for your account. Leave the POP Server and Port numbers alone. The "Leave a copy of retrieved message on the server" must be left off (GMail will provide an error saying it isn't allowed).

The other options in the popup are as you choose. I choose to leave the SSL security on as I'm sure I have personal information within my thousands of messages over five years. I also choose to archive the messages, with the intent to turn that function back off after all my emails got here.

Depending on how much mail is in your old account, it will take at least a half day for all those messages get transferred. After about five minutes, check to see if you have messages coming in (they will be oldest to newest). If you choose to archive your old messages, you will need to select "All Mail" to see the progress. Alternatively, you can also see its progress within "Settings" -> "Accounts" -> "Get mail from other accounts".

Your new account will continue grabbing 200 emails at a time until all the mail is retrieved. Some groups of 200 will take longer than others, depending on how big attachments to those messages are. The number of remaining emails will likely be displayed wrong. Its never told me I had more than 400 emails left, and I had about 4000 emails come across. In my case, it took the tool about 16 hours to retrieve 5 years worth of emails, and cost me about a half hour to learn to set it up.

About an hour into the process, a red error box appeared under the account settings letting me know that there was a problem getting email. From the "View history" of that account, I was told the error was on GMails side. It wasn't too long before it began to continue working again.

Drafts, sadly, must be taken across by hand. For my 52 drafts, this still hasn't been done.

Google Docs: Getting ownership of your old files

From Google Docs, select "All items", click on "Select: All ##" at the bottom of the screen, then select "More actions" -> "Change Owner". You will likely be greated with a "You do not have permission to change owner of x of the items selected." After clicking ok, any documents you weren't allowed to give away will be deselected, and you can hit "More actions" -> "Change Owner" again.

Provide your new email address, and select "Change owner." This is one of those bad times to spell your email wrong. After doing this, I was greated with an error saying something went wrong. Ignore it, and leave that page up. Check to see if your new account is getting new documents, and check again in five minutes. For me, that was enough time for all my documents to change owners (even though I had the error message).

At time of writing, the owner of spreadsheets can't be changed.

Google Calendar: Getting your old accounts calendars

I couldn't find a function to give a calendar away, but from the old account, you can make the new account a co-owner. In the top right of Google Calendar on the old account, go to "Settings", then hit the "Calendars" tab, then for each calendar, hit "Share this calendar", and under "Share with specific people" add your new account's email address and select "Make changes AND manage sharing.

I am fairly certain this gives you just about all the same rights over the calendar as you would if you owned it proper.

Another option is to Export your calendars from the old account and Import them to the new account. This option is found from "Settings" -> "Calendars" -> and just below the "Create new calendar" button.

As far as I know, Task isn't designed to be given from one person to another. You will have to manually move your task over. Hopefully there aren't too many.

Picasaweb: Moving your web album from one account to another account

Currently, there isn't a simple means of moving your pictures from one account to the other. The easiest method is to use Picasa and upload to a new account the same as you did for the old account. I'm fairly certain you will lose any captions you set on the web version of your album.

I don't believe the work is worth it for how often I use this part of my account.

Google Reader: Getting all those subscriptions from one account to another

From the Google Reader on the old account, go to "Settings", and select the "Import/Export" tab, and choose the "Export your subscriptions as an OPML file." You will be given a file named "google-reader-subscriptions.xml."

From your new account, go to the same tab, and select "Choose File" and click Upload. You will loos what items you have and haven't read, but you will have your feeds.

Google Maps: Giving your new account access to your maps

From Google Maps on the old account, select "My Maps", and for each map you want shared, select it, and select "Collaborate" on the left just below the map selection section. Add your new account as a collaborator.

For each received email making your new account a collaborator, you will need to select the link to "accept" the map.

This will be tedious to people who have many maps in their account.

Other services

The other services of Google, I do not use often enough to find it useful to change which account they function under. This blog, for instance, will remain under my nickname account.

If you go though the hassle of figuring out how to transfer another Google service from account to account, I encourage you to write your own blog entry, and link to your blog in the comments of this entry.

One last note

To see all the services you have used with Google, please see:

Apr 17, 2009

PPP: Basic Math Machine

A Programing Practice Problem designed for the beginner programmer with the means of programming either in console command line, or with a VPL.

I'm wanting a simple application that will take a user's input, consider the input, and output a result. If you remember in about 3rd grade, we were taught how to use "Math Machines" that could take a number, do something to it, and then output a result. What our application will do is very similar in concept.

1) Basic Math Machine: +3

Our application needs to take the user's input, add three to it, and output the result. Save this application as BasicMathMachine_PlusThree.

Input: -4, 0, 3
Expected output:
-4) -1
0) 3
3) 6

2) Basic Math Machine: +3 Loop 3

That would be a start to our masterpiece. Lets learn about a "for loop" next. After the user's input, add a for loop that goes from 0 to 2, counting by 1's. Move the calculation and output steps into the for loop. Save this application as BasicMathMachine_PlusThree_LoopThree.

Input: -4, 0, 3
Expected output:
-4) -1, 2, 5
0) 3, 6, 9
3) 6, 9, 12

3) Basic Math Machine: +x Loop 3

Story time! The government of an unnamed state once funded a business to write an application that would do some major math concerning state taxes. In their documentation for the creation of this application, they specified the tax rate that was current. They failed to realize in time that tax rates often change. Since they didn't ask for that part of the application to be a variable, it was hard coded.

Each time the tax rate changes, they had two options. Commission someone else to write a new application for them, or ask the business to alter it for them. This was unnecessarily expensive, much to the business's enjoyment.

Currently, our "+3" is hard coded into our application. Depending on what that three represents, hard code isn't necessarily bad. If we were calculating the circumference of a circle, for example, we would want to use pi. I'm going out on a limb, but pi isn't going to change in the near future.

Lets say that that three represents the size of shipments of our mysterious product. Business is growing, and we now have other options available for shipments. Modify the previous application so that we may alter the shipment size at run time. Save this application as BasicMathMachine_PlusX_LoopThree.

x = -4, 0, 3
s = 5

Expected output:
-4) 1, 6, 11
0) 5, 10, 15
3) 8, 13, 18

4) Basic Math Machine: +/-x Loop y

Two more changes before our application is ready to be sold. The first is to un-hard code the number of shipments that occur, allowing the user to select how many times to loop at run time. Save this application as BasicMathMachine_PlusX_LoopY.

5EC) Extra Credit:

We've had a few unhappy customers who wish to ship some of our product back. Alas, we are only able to add to our total sales. Un-hard code the type of math we use, allowing for adding or subtracting the user's imput. Save this application as BasicMathMachine_PlusOrSubtractX_LoopY.

Feb 17, 2009

C#.NET, Changing the text on a page from a control

Wanting to set an error message on a page from a control in C#.NET was a difficult task--at least until I learned how to do it. Some of my failed attempts included trying to set the parent's label directly, to setting a Session var. The first fails as the label doesn't exist in that context. The second fails because the Parent page's code runs first, leaving an unanswered error flag (via Session var).

The solution:

//Code inside of a UserControl, appearing on a page that
//has "literalParentError" used for displaying errors
//to the user.

   //Code that might break...
   //Provide the below error to the user
   Literal literalError = (Literal)this.Parent.FindControl("literalParentError");
   literalError.Text = (string)GetGlobalResourceObject("GRO_File", "Err_AppBroke");

The above allows for the means of a UserControl (.ascx) changing text located on its parent's page (.aspx). I found a question post from erik little having difficulties that lead to the above solution.

Where is this useful?

I needed it for multiple forms that users would fill out. I had one page that displayed different UserControls based on an earlier user selection. If any errors occurred, I wanted them to be displayed consistently across the board. Rather than editing all of the forms' UserControls each time a UI change was requested, a single change on the parent page saves time.

A search function UserControl could use this method of error display to keep consistency across entire site sections, yet still use the same code.

Jan 15, 2009

DateTime, UTC, and Local

Part of my work week dealt with displaying the correct date time to a distant user, based on what their settings on the site was. Microsoft provides the ability to move DateTime from UTC to local; alas, local is where the server is (in the case of webapps). This means that if my server is in the MNT timezone, I can't say "display as EST."

A workaround to this is using UTC and that commonly seen offset number (often displayed as GMT+x). Taking into account day light savings, this number added into UTC produces a user's local time, assuming you have their settings saved somewhere.

In my search for a workaround, I also wondered if the client's info would provide me their local time. This simple solution didn't reveal itself to me.

As a method of avoiding confusion about time around the globe, I'm all for "Global UTC." Most of my family are waking up for work by 7:00am MNT. I'm sure I could get them to say they wouldn't mind waking up at 2pm everyday. I just won't tell them the UTC part. *huge grin*