December 30, 2011

Learning Russian

It has been a few months since I have written anything here but that is going to change. I plan to learn Russian starting today and I will use my blog to chronicle my progress. Hopefully, I will be able to understand Russian a year from now. Tick tock ... :)

August 25, 2011

Change the shortcut key of the Redo command from Shift+Alt+Bkspce to Ctrl+Y in Visual Studio 2010

In Visual Studio 2010, the default shortcut key of the Redo command is Shift+Alt+Bkspce. However, in other programs like Excel 2007 and Word 2007, the shortcut key of the Redo command is Ctrl+Y.


Figure 1: The Edit menu with the Shift+Alt+Bkspce shortcut key assigned to the Redo command.

To change the shortcut key of the Redo command:
  1. In the Tools menu, click Options.... The Options box should open.
  2. In the setting list, expand Environment and select Keyboard.
  3. In the Show commands containing field, enter "redo".
  4. In the command list, select Edit.Redo.
  5. In the Press shortcut keys field, press Ctrl+Y in your keyboard.
  6. Click Assign.
  7. Click OK.

Figure 2: The Option box after completing Step 5.

If the Ctrl+Y shortcut key is assigned to another command, it must be removed from that command.

To remove a shortcut key from a command:
  1. In the Tools menu, click Options.... The Options box should open.
  2. In the setting list, expand Environment and select Keyboard.
  3. In the Show commands containing field, enter the name or a part of the name of the command.
  4. In the command list, select the name of the command.
  5. In the Shortcuts for selected command list, select the shortcut.
  6. Click Remove.
  7. Click OK.
 
Figure 3: The Edit menu with the Ctrl+Y shortcut key assigned to the Redo command.
 

August 19, 2011

Get the Hyper Text Markup Language (HTML) source code of a web page using Visual Basic .NET

Imports System.Net

Public Function GetHtmlSourceCode(ByVal address As String) As String
    Dim webClient As WebClient = New WebClient()
    Return webClient.DownloadString(address)
End Function


You can use the DownloadString method to get data from a web page by downloading and parsing its source code.

August 1, 2011

A Bristol Boxkite replica parked in Changi Airport

Jenny and I were at Changi Airport yesterday accompanying our moms who were going home to Philippines after about 3 weeks of vacation in Singapore. While Jenny and I were walking around in the airport, we found a Bristol Boxkite replica parked in Terminal 2.


July 30, 2011

Translate an Excel column number to its equivalent column letter using Visual Basic .NET

Private Function GetColumnLetter(ByVal columnNumber As Integer) As String
    Dim columnLetter As String
    If columnNumber <= 25 Then
        columnLetter = Chr(65 + columnNumber)
    Else
        columnLetter = GetColumnLetter(columnNumber \ 26 - 1)
        columnLetter &= Chr(65 + columnNumber Mod 26)
    End If
    Return columnLetter
End Function