How to extend Visual Studio Xaml Designer

I do want to extend Visual Studio Xaml designer with a context menu, but encountered many troubles.

  1. To get start,  this page helps.
  2. To choose right extension method, I inspected source code of similar tools. For my case, it’s StyleCop.
  3. To understand VSPackage project, read How VSPackages Add User Interface Elements to the IDE.
  1. To set correct parent guid:id, refer project XAML Markup Styler. Two post are helpful here:
Posted in Uncategorized | Leave a comment


很多MP3的ID3是BIG5编码的 用下边这个PowerShell脚本可以批量把title, author变成简体中文

$big5 = [Text.Encoding]::GetEncoding(950)
$root = “<your mp3 folder>”
$files = Get-ChildItem $root -Filter “*.mp3” -Recurse
foreach($file in $files) {


$wmp = New-object –COM WMPlayer.OCX;

$media = $wmp.newMedia($file.FullName);

$newTitle = $big5.GetString([Text.Encoding]::Default.GetBytes($media.GetItemInfo(“Title”)));

$media.SetItemInfo(“Title”, $newTitle);

$newAuthor = $big5.GetString([Text.Encoding]::Default.GetBytes($media.GetItemInfo(“Author”)));

$media.SetItemInfo(“Author”, $newAuthro);


Posted in Uncategorized | Leave a comment


有人说了,我们可以安装word viewer。确实不错,可word viewer也得下载一会儿,最主要是我根本不想装多余的软件。现在SkyDrive就可以在线查看word, excel和ppt文件了,对于excel还可以在线编辑。Have a try. Office Live也有相同功能。

Posted in Uncategorized | Leave a comment

how to send gmail from ubuntu terminal

  1. Telnet won’t work because gmail requires SSL now.
  2. Prepare your user/password in base64 encoding.
  3. openssl s_client -CApath /etc/ssl/certs/ -connect -crlf (-crlf is important)
  4. SMTP session:helo
    auth login
    mail from: <sender>
    rcpt to: <to>
Posted in Uncategorized | Leave a comment

How run Windows Virtual PC and VirtualBox at the same time

Posted in Uncategorized | Leave a comment

Visual Studio don’t response when I create new project or stop debugging

Today, I found visual studio didn”t response for more one minute when creating new project or just stopping debugging. It was quit annoying! I had to wait and wait everytime I stopped debugging and wanted to change some code. I didn’t know what to do while waiting and can’t remember the idea I was thinking when I came back. Annoying.

VS’s UI didn’t hang, but you can’t click any place of it. I tried following things:

  1. Open Task Manager. CPU and memory is ok.
  2. Open Process Explorer. Can’t find any thread in VS is consuimg CPU.
  3. Open Process Monitor. No much record and information. VS was just profiling itself and creating a few existing folders.
  4. Uninstall newly installed VS exstention.
  5. Uninstall big VS exstension.

The problem was still there. It might have something to do with network because home network is slower than company network if VS is trying to fetch data from other servers. It shouldn’t show such difference because I didn’t encounter it before. The only difference from yesterday is that our servers were shutdown this weekend. Visual Studio might fetch data form shutdown server. It might relate to debugging, because it’s ok if I start program by pressing ctrl+F5. Finally I found a deadly symbol path pointing to our ‘sleeping’ server. 🙂

Posted in Uncategorized | Leave a comment


Posted in Uncategorized | 5 Comments