Monday, July 27, 2009

Sunday, July 26, 2009

msft drivers for Linux

This has been all over tech news last week. Microsoft contributing code to the kernel (GPL for the first time). The drivers help Linux run better on a Windows host.

I like the note at the bottom of the article...
"For those that want to hear Microsoft's take on the news, here's a video of Hanrahan discussing the move with Sam Ramji, the company's senior director of platform strategy. (Note: Silverlight is required.) "

Irony anyone?

Thursday, July 16, 2009

crowdsourcing to find answers

I have been using stackoverflow every so often to get answers and it's generally to questions others have asked.

Figured it's finally time to get a little more proactive in looking for answers by asking the questions myself.

use gcc to help you deprecate methods/functions in c/c++

Every so often you need to deprecate/remove/rename classes and functions in a very large project. Rather than grep'ing your way through the large source tree and trial-&-error method of compiling the project, a good way to do this would be to use the __attribute__ macro.

You assign the "deprecated" attribute to the variables, functions, methods that you plan to phase out.

GCC will cause a warning at all the places it is called.

class Foo {
public: Foo() __attribute__((deprecated)) {}

The thing to check would be that you are not using -Wno-deprecated-declarations when building.

Since I recently switched over to using NetBeans, I can do a "Find Usages" in the entire project, but very often your project only covers the part of the code base you personally have been working on.

Wednesday, July 15, 2009

MontaVista 1-second boot

It is impressive when you can boot within a second, even in an embedded environment. MontaVista is marketing the right feature in this video.

Obviously this is difficult to achieve on different architectures with storage devices and need to load drivers.

Sunday, July 5, 2009


I recently tried out OpenProj and it worked well for some minimal stuff. It seems to be feature rich and useful to open MSProject files as well.

Check it out at or on sourceforge.

OpenProj by Serena Software is a desktop replacement of Microsoft Project. OpenProj has equivalent functionality, a familiar user interface and even opens existing MSProject files. OpenProj is interoperable with Project, with a Gantt Chart and PERT chart.

Saturday, July 4, 2009

wchar and unicode

Instead of using the standard ASCII characters, there is sometimes a need to support an alphabet that has more than 256 (2^8) characters. That is where you use Unicode where every character is 16 bits, thus giving you 65536 (2^16) characters.

In C for example, a wchar would be a Unicode character. The regular C string functions won't work on Unicode strings, so instead you use the C runtime library functions available for Unicode strings, prefixed with wcs.
Example: wcslen, wcscpy and such.

Of course the C compiler and the runtime library must have support for Unicode if you plan to use it.

You tell the C compiler that you plan to use Unicode through a macro:

_UNICODE // Tell C we're using Unicode, notice the _
// Include Unicode support functions

Then define a Unicode string:

wchar_t string[] = L"Ubuntu rocks";

The L macro tell the compiler that this is a Unicode literal and not a char (unsigned short) variable.

Here is the wchar.h header file.