Total Pageviews

Disclaimer

This is a personal web page. The views expressed on this blog are mine and do not necessarily reflect the views of my current employer.

I am currently employed by Morgan Stanley.

April 30, 2012

How to Resolve Cobra Tag App Crashed After Android Firmware Upgrade

I bought a Cobra Tag earlier this year after losing my phone at office. It has become a must of my phone but Cobra Tag started to crash this afternoon, after I upgraded my phone to Android 4 via HTC update wizard. I was going to contact Cobra for customer support, but soon discovered the root cause on my own before hitting the Send button.
The cause is rather simple: I was using a custom alarm tone (Microsoft Bing tone if you ask, as it is so unique), and that was broken after the firmware upgrade. After setting it correctly, and also re-pair the tag to my phone this issue disappears. I found it out, simply because upgrading the phone, I noticed that the Music app also experiences some issue rescanning all my collection on the phone.

Therefore, a few minutes ago I modified the mail from an inquiry to a bug report. Hope Cobra developers can fix this issue after receiving my report, as the app should simply report it cannot find the tone music file, instead of quietly die.

[Update: Cobra recently provided an updated Tag app in Google Play which resolved all the issues. Excellent!]

Packaging Crad's ActionList for .NET via NuGet

In case you don't know Crad's ActionList for .NET, you can refer to http://www.codeproject.com/Articles/13879/ActionList-for-NET-2-0. For information on NuGet, you can visit http://nuget.org.
As usual, Microsoft re-invented the wheel and announced NuGet a long time ago. Whether you like it or not, you will have to accept the fact that one day you need to support it. One problem I met is that many old but useful free stuffs are not packed for NuGet, such as Crad's ActionList for .NET. So I stepped out and forked it on GitHub,
and then created NuGet packages for it,
This serves myself well, as many of my existing open source projects use this control, which dated back to 2007 and 2008 (http://www.lextm.com/2008/02/dockpanel-suite-tip-2-conflicts-with.html). I hope that I can put more fixes to this library and maintain it for a while. If you have any patch that would like to share (under CPL 1.0), let me know.

BigDipper Light: Latest NuGet Packages

#SNMP started to provide 7.0 NuGet package last October. It was my first attempt, so there were a few issues with that package,
  • Dependency on log4net was not explicitly listed.
  • Only assemblies for .NET 3.5 were provided.
Therefore, after learning how to do better NuGet packaging for Crad's ActionList for .NET, I decided to apply the tips to #SNMP. So now you can see an updated #SNMP package versioned 7.0.0.2. This number is for the NuGet package, as the binary version number is still #SNMP 7.0 RTW version number. It contains the following changes,
  • Explicitly depends on log4net 1.2.10.
  • Assemblies for both .NET 3.5 and 4.0 are included.
About how to install it, you can refer to
To accompany #SNMP 7.5 RC2, another NuGet package is also published, which contains the latest binaries,
It depends on log4net 2.0 and ANTLR C# runtime 3.4.1.

April 29, 2012

BigDipper Light: 7.5 RC 2

The development of #SNMP 8 won't be an easy task, as so many things related to the compiler must be reviewed and enhanced. So in order to provide users a quick update, a new release candidate of 7.5 release is now uploaded,
This release is mainly a bug fix release but also contains a limited set of breaking changes (work item 7224, 7225, 7226). There is also a NuGet prerelease package available (based on the same change set).
Stay tuned.

April 22, 2012

C# SQLite for Windows Phone

There was an attempt to port csharp-sqlite to Windows Phone, and its output was a project called wp7sqlite,
It was active in 2010, but now it is dead. Why? Well, please check out csharp-sqlite and read its source code carefully. Yes, it already has built in support for Windows Phone. Kudo!

April 21, 2012

How to Transform T4 files (.tt) without Visual Studio

Microsoft integrates T4 text template support inside Visual Studio. However, you usually find it troublesome to transform such files outside Visual Studio (at command prompt or in your build process). In fact, you can even transform them without installing Visual Studio, because...Mono guys have a full open source implementation of that engine :) Then how should you make use of the Mono assistance?
  1. Visit MonoDevelop source repository and grab two C# projects named Mono.TextTemplating and TextTransform, https://github.com/mono/monodevelop/tree/master/main/src/addins/TextTemplating
  2. Create a solution file and add these two. Compile them and now check the output of TextTransform project.
This project gives you a command line utility called TextTransform.exe. About how to use it, simply execute it without any parameter and read its help. If you are familiar with Mono.Options, you can even learn that from its entry function, https://github.com/mono/monodevelop/blob/master/main/src/addins/TextTemplating/TextTransform/TextTransform.cs
Good luck.

April 09, 2012

TritonMate Words: License Change on SNMP Engine Support

If you follow #SNMP project closely, you should already know that the license for SharpSnmpLib.Mib.dll has been changed from Lesser GPL to BSD 3 Clause,
Now another change is coming, as documented here, http://sharpsnmplib.codeplex.com/wikipage?title=600012&referringTitle=KB
SharpSnmpLib.Engine.dll assembly in fact contains two namespaces, Pipeline and Objects, which were originally part of snmpd project (released under MIT/X11), and later moved to SharpSnmpLib.dll (released under Lesser GPL). However, the nature of agent development usually requires modifications on the classes under these two namespaces, so as to customize the agent behaviors. Lesser GPL requirements can be a roadblocker for commercial shops who would like to play with it.
I don't plan to sell commercial licenses for these two namespaces, as they are still in early development phase, and does not meet strict quality standards yet, so even if we sell them, supporting the users can be too huge a burden. Now you can feel free to shape them to whatever you like and hope you like this change.
Remember to go to our master branch, as that's for our 8.0 release, and covered by this license change. The previous releases (6.*, and 7.0) are still covered by our previous licensing model.
Stay tuned.

April 04, 2012

Wireless Connection Setup in openSUSE 12.1

I am using openSUSE 12.1, but the tip should apply to other recent openSUSE releases.

I noticed an issue today during the installation of openSUSE 12.1 on my desktop machine. That is, using Live CD I can connect to Internet wirelessly (via NetGear WNA1100 wireless adapter), but once openSUSE is installed on the hard disk and boots up, I cannot find the wireless network connection initially.

Other guys hit the same problem, too, http://forums.opensuse.org/english/get-technical-help-here/wireless/462402-wireless-works-live-cd-not-after-install-intel-3945-toshiba-satellite-a105.html. So here I provide a summary,

Root Cause
The live CD uses "
User Controlled with NetworkManager" mode, so you can easily set up wireless connection using the network icon in top panel.

Once installed on hard disk, openSUSE boots up with "
Traditional Method with ifup" mode, in which the network icon disappears.

Resolution
It is possible to switch modes like this,

  1. Open Applications -> System Tools -> YaST.
  2. Choose Network Settings from YaST items.
  3. Go to the "Global Options" tab.
Now you can switch modes freely. I think a reboot is needed for this change to take effect. I stick to User Controlled with NetworkManager, which works pretty good (even better than Windows, as I have to manually install NetGear drivers on Windows).

Note that Gnome 3 does not work on my system, so in step 1 I am still using the old menu. For Gnome 3, the steps should be slightly different.

April 03, 2012

Revival of MSBuild Launch Pad and Its 1.1.2 Release Candidate

I haven't been updating mPad for a long time (since June 11, 2011). There was no strong drive because all major features have been implemented (though ugly, they work). I kind of forgot about it till this bug report came a few weeks ago,
Alright, finally I got all the necessary details about the crash, and started to fix it. But was that all I could do this time? Nope :) I have explored a lot.
NuGet Packages
This has been the best way to publish your .NET libraries (I published #SNMP Library to NuGet last October). But today is the first time I tried to consume packages in the NuGet way.
First, I removed nunit assembly from lib folder and UnitTests project reference list. Then within Visual Studio 11, I choosed Manage NuGet Packages... menu item from the context menu in Solution Explorer. Well, after that it is easy to search online for the latest NUnit package, and add it to UnitTests project. The magic is that NuGet automatically downloads the package to packages folder, extracts contents, and adds the correct reference for me. So of course I added moq in the same way.
To make sure that I don't need to check in NuGet packages to source control, I followed this article,
Now dependencies can be easily managed. (NuGet is Mono friendly, too).
More Unit Testing
It was not easy to write a unit test case for MSBuild path resolution (MSBuildTask.FindMSBuildPath), but this time using moq I can fake the path validation part, and simulate the following scenarios effortlessly, so all test cases can be easily written,
  • .NET 2
  • .NET 3.5
  • .NET 4.*
  • .NET 2 + .NET 4.*
  • .NET 3.5 + .NET 4.*
(.NET 4.* means either .NET 4 or .NET 4.5).
Less Hardcode Information
In previous builds, .NET Framework versions and MSBuild path were almost all hardcoded in C# files. If .NET 4.5 were not an in-place upgrade of .NET 4, I would have to change a lot of lines to support it.
So in the past few days, I extracted all such information into the app.config file, and wrote custom section to handle them. Now if Microsoft decide to release .NET Framework 5 and Visual Studio 12, I guess I can support them by simply updating the app.config file :)
You can receive our latest change sets to see how the above changes have been made.
Don't forget to download the latest 1.1.2 RC,
Stay tuned.

April 01, 2012

TritonMate Words: Tips on sqlite-net and csharp-sqlite

Background
If you followed the recently changes in #SNMP, you know we have a new MIB compiler implementation based on ANTLR in the bottom layers, which exposes various new opportunities to explore.
To make full usage of this powerful compiler, we need to make big changes in the top layers such as updating the compiled module file format (*.module). You can imagine, using a database is an obvious option to replace the original text file format.
Challenges on normal SQLite approaches
I have evaluated several open source databases, and it seems that SQLite is the best for our needs (open source, small, though feature rich). So I started to try several SQLite libraries, and wished to find a light-weighted one to help me learn SQLite bits. However, most of the well known libraries
  • have too many features (which may not be useful for #SNMP)
  • have dependency on the native SQLite driver (sqlite3.dll), which I hate a lot.
#SNMP MIB Compiler is good at portable deployment. Currently, this compiler application can be zipped up and deployed because it is purely .NET. I don't want to lose this nice feature due to migration to SQLite.
New Hope
Because of Xamarin, I started to pay more attention to all information demonstrated in its seminars,
And I just watched this one called "Third Party Libraries with MonoTouch and Mono for Android", and came across sqlite-net for the first time,
I was happy that sqlite-net is one step closer to my goal, as it is a simple wrapper over sqlite3.dll, which provides very easy to learn ORM API.
To evaluate it, in one of the projects I created at office (a Launchy clone called Lex Pad), I made use of sqlite-net to migrate from a local text file to SQLite. I was able to finish all tasks in a only few minutes (less than 30 minutes). That experience was wonderful, except that it does not resolve the deployment problem yet.
Well, it was only a few hours ago when I tried to make sqlite-net to work with csharp-sqlite I found that sqlite-net already has some support for it and I just needed to update it to support the latest csharp-sqlite build,
Now the deployment problem is resolved :), since csharp-sqlite is a C# port of SQLite (rewritten from native to C#).
Though I have been busy with Touch Mouse Mate in the past few weeks, mates, please don't worry. I was still watching out for #SNMP, and will focus on it more in the coming weeks.
Stay tuned.