Chinh Do

Vista 64-bit and SoundBlaster X-Fi Crackling/Popping

First time here? Check out my greatest hits or look around in the archives, and consider subscribing to the latest posts via RSS or email. I am also on Twitter and Google Plus. Thanks for visiting.
23rd December 2008

Vista 64-bit and SoundBlaster X-Fi Crackling/Popping

Against popular wisdom, I decided to upgrade my bedroom home theater PC to Vista 64-bit a couple days ago (just have to make full use of all of my precious 4GB of RAM). Everything is working surprising well so far, with the exception of sound! Whenever I play any audio, my speakers now produce all kinds of pops and crackles along with the normal audio stream. Urgg.

After a couple of days of googling, tweeking various sound settings, uninstalling/reinstalling drivers, etc. without success, I almost gave up on the thing. Then I decided to try just one more thing, changing the default sample rate to “2 channel, 16 bit, 44100 Hz (CD Quality)” from the default “2 channel, 24 bit, 48000Hz” and just like magic, the pops and crackles are gone.

SPDIF Out Properties

posted in Software/tools, Technology, Tips | 7 Comments

20th November 2008

Gmail Adds Themes

Nice surprise logging into Gmail just now: Themes! I tried out a few and have to say they are nice to look at. I almost forgot I have actual emails to read. I’m going to try out a cheery theme to offset the grim news from Wall Street.

There’s even a Terminal theme for die UNIX shell diehards. It’s actually kind of cool… if only for a few minutes.

Gmail Themes

More info from the official Gmail blog.

posted in Software/tools, Technology | 0 Comments

2nd September 2008

Windows Underlined Letters for Keyboard Accelerators – Peculiarities

Ever since Windows 2000, menu keyboard shortcut characters are not underlined by default. According to Microsoft, the underlined letters are hidden until you press the Alt key. Let’s try that… First, use the mouse to click on the Help menu in Visual Studio:

Visual Studio About

Now, press Alt to show the underlined letters right? Poof, the menu is gone. Ok, that’s an easy one. I’m sure everyone have figured out that Alt key must be pressed before you access the menu. But can anyone tell me this? How do I show underlined letters for right-click/context menus with the Alt key? Well, the short answer is you can’t! If you don’t believe me, try it yourself. I’ve tried Alt+right-click, Alt then right click, right click then Alt, etc. Nothing works.

The only thing I’ve found to work is the Application key (this is the key with the image of a mouse pointer on a menu, between Alt and Ctrl). Interestingly, the Application key will always show underlined letters regardless of the “hide underlined letters” settings. The keyboard combination Shift-F10 also brings up the context menu, however that keyboard shortcut does not show underlined letters.

You can forget about all of this nonsense and have Windows always show the underlined letters by changing a setting (instructions below are for Windows XP):

  • Open the Display Control Panel.
  • Display Properties Control Panel Applet

  • Click on the Appearance tab, then Effects…
  • Uncheck “Hide underlined letters for keyboard navigation until I press the Alt key”.
  • Hide underlined letters for keyboard navigation until I pres the Alt key

posted in Software/tools, Technology | 7 Comments

29th August 2008

Web Scraping, HTML/XML Parsing, and Firebug’s Copy XPath Feature

If you do any web scraping (also known as web data mining, extracting, harvesting), you are probably familiar with the main steps: navigate to page, retrieve HTML, parse HTML, extract desired elements, repeat. I’ve found the SgmlReader library to be very useful for this purpose. SmglReader turns your HTML into XML. Once you have the XML, it’s fairly easy to use built-in classes such as XmlDocument, XmlTextReader, XPathNavigator to parse and extract the data you want.

Now to the labor intensive part: before your program can make sense of the XML, you have to manually analyze the HTML/XML first. Your program won’t know jack about how to extract that stock price until you tell it exactly where the stock price is, typically in the form of an XPath expression. My process of getting that XPath expression goes something like this:

  1. Scroll to/find desired element in the XML editor.
  2. Does element have unique attributes that can be used?
    • a – If yes, code XPATH statement with filter on attribute value. Example: //Table[@id=”searchResultTable”].
    • b – If no, code an absolute XPATH expression. Example: /html/body/div[4]/pre[2]/font[7]/table[2]/tr[5]/td[2]/table[1]/tr[2]/td[5]/span.

Step 2b is where it gets very labor intensive and boring, especially for a big web page with many levels of nesting. Visual Studio 2005 XML Editor/Resharper have a couple of features that I find useful for this:

- Visual Studio’s Format Document (Edit/Advanced/Format Document) command formats the XML with nice indentation and makes it a lot easier to look at.

- With Resharper, you can press Ctrl-[ to go to the start of the current element, or if you are already at the start, go to the parent element.

Even with the above tools, it’s still a painful and error-prone exercise. Luckily for us, Firebug has the perfect feature for this: Copy XPath. To use it, open your HTML/XML document, open the Firebug pane (Tools/Firebug/Open Firebug), navigate to the desired element, right click on it and choose “Copy XPath”.

Firebug Copy Xpath

You should now have this XPath expression in the clipboard, ready to be pasted into your web scrapper application: “/html/body/div[2]/table/tr/td[2]/table”.

A feature that I would love to have is the ability to generate an alternate XPath expression using “id” predicates, such as this: “//Table[@id=”searchResultTable”]”. With web pages that are not under your control, you want to minimize the chance that changes on the pages impact your code. Absolute XPath expressions are vulnerable to any kind of changes on the page that change the order and/or nesting of elements. On the other hand, XPath expressions using an “id” predicate are less likely to be impacted by layout changes because in HTML, element IDs are supposed to be unique. No matter where your element is on the page, if it has the same ID, you should still be able to get to it by looking up the ID. Hmm… this sounds like a good idea for a Visual Studio Add-in.

posted in Dotnet/.NET - C#, Programming, Software/tools, Technology, Tips | 5 Comments

28th July 2008

Windows Mobile 6.1 for Samsung SCH-i760

Good news for i760 owners: Windows Mobile 6.1 update is now available.

This update fixes one major annoyance: support for SDHC cards with more than 2GB. I use my i760 as a music player and it’s kind of tough to have to fit my music selection into 2GB (or 4GB if you use the hack but didn’t want to use a hack).

Some features of note in WM 6.1:

  • Support for SDHC cards  beyond 2GB. 8GB cards seem to be working fine for people.
  • Threaded SMS reader.
  • View YouTube videos (m.youtube.com).

Download the update from Verizon here.

More information here.

Verizon SCH-i760 Upgrade Tool

A word of warning:  the upgrade utility provided by Verizon/Samsung looks like a major piece of rushware. Many people reported no problems with the upgrade, but others reported of bricked phones, partially upgraded phones, and having to try the upgrade process multiple times to get it to work.

posted in Gadgets, Technology, Windows Mobile / Pocket PC | 2 Comments

17th June 2008

Finds of the Week – June 17, 2008

.NET, C#

General Development

Software, Tools, etc.

Gaming

Something Different

posted in Dotnet/.NET - C#, Gaming, Programming, Silverlight, Software/tools, Technology | 4 Comments

9th June 2008

Finds of the Week – June 9, 2008

.NET/C#

  • Microsoft project code named “Velocity” is a distributed in-memory caching platform that provides .NET applications with high-speed access, scaling, and high availability to application data. Download the Community Preview here.
  • Danny Simmons enumerated various reasons for using Entity Framework.
  • If your netMsmq WCF service shows signs of a handles leak, you may want to make sure you have .NET Framework 3.0 Service Pack 1 installed.
  • Bryan wrote a timely article on TDD Tips: Test Naming Conventions & Guidelines.
  • Microsoft announced the release of Microsoft Source Analysis for C#.
    “Source Analysis is similar in many ways to Microsoft Code Analysis (specifically FxCop), but there are some important distinctions. FxCop performs its analysis on compiled binaries, while Source Analysis analyzes the source code directly. For this reason, Code Analysis focuses more on the design of the code, while Source Analysis focuses on layout, readability and documentation. Most of that information is stripped away during the compilation process, and thus cannot be analyzed by FxCop.”

General Programming

Tools

  • The Query command line utility displays active Terminal Service/Remote Desktop sessions, among other things. This replaces the qwinsta utility.

Something Different

posted in Dotnet/.NET - C#, Programming, Software/tools | 1 Comment

1st June 2008

Finds of the Week – May 31, 2008

Programming

.NET/C#

Software and Tools

  • Google Maps Street View is in Richmond.

    Google Street View Richmond Virginia Goo

    It looks like the Street View images were taken around September 2007 because according to IMDB, the movie Game Plan was playing in the US starting 9/23/2007:

    Google Street View Richmond

  • Google Maps adds user-created photos, videos, maps. Via CNET.

    Google Maps Goog

Something Different

posted in Dotnet/.NET - C#, Gadgets, Programming, Software/tools, Technology, Tips | 1 Comment

7th April 2008

Finds of the Week – April 6, 2008

Programming

.NET/C#

Windows Mobile/Pocket PC

Gaming

Something a Little Different

posted in Dotnet/.NET - C#, Programming, Windows Mobile / Pocket PC | 1 Comment

31st March 2008

Finds of the Week – March 30, 2008

Programming

.NET/C#

PowerShell

posted in Dotnet/.NET - C#, PowerShell, Programming, Software/tools | 2 Comments