30 June 2012

(Slightly) Faster Typing with Standard Android Onscreen Keyboard

Found that you can enter digits and punctuation by using the touch-and-hold gesture on the standard Android onscreen keyboard. For example, hold down the q to get '1' or hold down the DOT to choose from a menu of common punctuation marks. This gesture makes it possible to type slightly faster since you do not need to change modes so frequently.

The touch-and-hold gesture also provides extra characters for keys in the number and symbol modes. For instance, 1 provides a choice of fractions with 1 as the numerator, $ provides common currency symbols and ( provides different left brackets.

2012-07-17: When three dots appear below the suggested words, touch-and-hold any of the suggested words to get a table of additional words.

If you read the Google's Use the keyboard guide, it mentions the touch-and-hold gesture but you might miss the usefulness of the feature since the guide does not go into detail or provide any examples.

PS. When I tried the touch-and-hold gesture on a physical BlackBerry Bold keyboard, I get capital letters, so that gesture is available on other mobile phone keyboards.

23 June 2012

Flatten or Collapse Excel Multi-column Data Into One Dimension

You can flatten or collapse multi-column Excel data into one row or column using GnuWin utilities.

  1. Copy the worksheet data into the clipboard.
  2. Open a CMD window and enter this chain of commands: getclip | tr -s [:cntrl:] \n | putclip.
  3. Paste the data back into your worksheet. You should get a column of data.

The getclip-putclip pair of programs gets and puts data in the system clipboard and is part of the CygWin package in GnuWin. tr translates control characters (e.g. TABs) to NEWLINEs and the -s option squeezes out repeated characters. This chain of commands works because each column of Excel data separated by a TAB character in the clipboard. Here are more examples of this pattern.

If you want to remove duplicates in your data, insert sort -u into the chain: getclip | tr -s [:cntrl:] \n | sort -u | putclip. For example, if you start with this input (note the trailing TABs in rows 1 and 2) ...

2 4 
3 5 7
4 6 8
5 7 9

... you end up with the following:


If you want a single row output, replace all control characters with TABs: getclip | tr -s [:cntrl:] \t | putclip. In this case, you cannot include sort because it sorts lines of data and there is only one line in the output.

1 2 4 3 5 7 4 6 8 5 7 9 

09 June 2012

Add Album Art to Google Play Music

The standard Google Play Music app doesn't display album art for MP3 files ripped by Microsoft Music Player (I thought the images are embedded in the files). This seems to be annoying enough to warrant the creation of album art grabbers apps on Google Play. The aptly named Album Art Grabber by Tim Clark seems to do the job. After running the app to get the images, I found I have to delete all the data stored by the Google Play Music before it displays the downloaded album images.
  1. On your Android device, open the Apps manager.
  2. Select Device, Apps.
  3. Select the All tab.
  4. Select Google Play Music.
  5. Select Storage, Clear Data.
See this video How To Add Album Art On Google Play Music (for Android).

06 June 2012

Graffiti for Android

Check out "Graffiti for Android"

My first handheld computer was the Palm Pilot. It was a remarkable device for many reasons but the feature I remember best is the Graffiti writing input system. To enter text, the user has to learn to write a simple shorthand that is similar to block lettering. It takes about a day to become used to the writing style.
For an Android phone, you can install the Graffiti application from Google Play. To use it, go to the Settings panel, Language & Input, Default and choose Graffiti as the default. The next time you enter text, the Graffiti input pad will appear instead of the Android keyboard.


02 June 2012

Cannot open user default database. Login failed.

I encountered this error when I tried to open a new connection using SQL Server Management Studio (SSMS): Cannot open user default database. Login failed.. It was a bit puzzling because my application using the same user account and password can connect to the required database.

It turns out that when SSMS starts a new connection, SQL Server expects the user account to be assigned to a default database (per the message) while my application could always connect since a database is specified in the connection string.

When a client connects to a SQL Server instance without specifying a database context, the default database defined for its login is used. If that database is unavailable for any reason, the above message appears.

The fix is to specify the default database for the user in their Login Properties.

I think when the DBA restored my database, the previous database was first deleted, so the default database setting was also deleted for my user account.


Cannot open user default database. Login failed.