Shuva's blog
Multiple desktops on Windows atlast 
Tuesday, August 26, 2008, 09:37 AM - Tips and Tricks
A must use tool for every high-productivity desktop users and a great relief for people coming from Linux or Hummingbird interface which always supported multiple desktop sessions.

Download the recently published, small (62KB) tool called Desktop v1.0 from Microsoft Sysinternals and try it out. You have multiple options to toggle between desktops including the linux conventional Alt-F1,F2,F3,F4 keystrokes. I just installed a few minutes back and I am loving it.

As a side note, it allows you to create up to 4 desktops but I get an error saying that enough space is available to create the 4th desktop.

Happy Desktopping.//


3 comments ( 326 views )   |  0 trackbacks   |  permalink   |   ( 3 / 45 )
Little known, undocumented VC++ "macro" called __LPREFIX 
Saturday, August 23, 2008, 01:34 PM - Programming
__LPREFIX is actually not a pre-processor macro though it is used like a macro. It is the MS VC++ compiler and not the pre-processpor which actually handles this. This can be used to add the L-prefix to a string thereby making it a wide string (wchar_t).

Example: The following two lines are the same.
wchar_t* msg = L"Hello World!";
wchar_t* msg = __LPREFIX("Hello World!");

This however does not explain the need to use this prefix. Where would it be useful?

If you have something like
#define MSG "Hello World!"

You cant do
wchar_t* msg = L MSG;  //error

The only way to get around this is either to call the Narrow to Wide conversion routines or just say
wchar_t* msg = __LPREFIX( MSG );

If you are using only wchar_t in your code and you want the wide version of macros like __DATE__, __LINE__, __FUNCTION__, etc then this could be helpful.
#define __WDATE__ __LPREFIX( __DATE__ )
#define __WTIME__ __LPREFIX( __TIME__ )
#define __WFUNCTION__ __LPREFIX( __FUNCTION__ )

As a side note, a cross platform (and the correct) way to get the wide version of a predefined macro like __FILE__ is :

#define WIDEN2(x) L ## x
#define WIDEN(x) WIDEN2(x)
#define __WFILE__ WIDEN(__FILE__)

Another undocumented VC++ related string "macro" is __SPREFIX which is used to create a managed string object(.Net) from a string.
Example:
System::String^ date = __SPREFIX( __DATE__ )

Fun: The MS VC++ 2005, VC++ 2008 compiler crashes if you try to compile the following program:
#include <windows.h>
#define DATA __SPREFIX( __DATE__ )
int main() {
DATA;
return 0;
}

Well, they never documented it anyways.

Related link: Go get Microsoft Visual Studio 2008 Express Edition. Its free.

Happy Prefixing.//
add comment ( 93 views )   |  0 trackbacks   |  permalink   |   ( 3 / 45 )
Link servings : great web designs 
add comment ( 70 views )   |  0 trackbacks   |  permalink   |   ( 3 / 43 )
Idea of software destruction 
Sunday, August 10, 2008, 08:26 AM - Ideas and Thoughts
I have learned and practiced "continuous development" and "continuous engineering". Does something called "continuous destruction" exist? I think it does exist, its just that we don't consider it as an area of study or practice in the Software Development Life Cycle. I think disposition of a component of a system is critical to its survival in this fast moving world of technology.

Continuous destruction should happen at all levels of the engineering community. From the top level product management to the individual coder, we should probably have the attitude to identify what to throw away and come up with something better.

It usually happens that we wait for the system to become obsolete or wait for someone to tell us that we need something better. After a new system is developed and delivered we generally sit down and relax and go into dividend earning mode.

So what’s stops you from destruction? Is it the lack of courage to change your “presently good system”? Is it the courage to tell yourself what runs short in your existing system? I think it’s the lack of inputs to decide what’s important and what’s not important for the system. What else?

In my current life as a developer, most of the successful designers are those who seem to have the guts to throw away their existing work or constantly evaluate parallel technology. These developers end up delivering more quality components. How many time shave you seen successful consumer products change their User Interface. Many do. Dont they?

The idea of "destruction" however is not studied as a phase in the Software Development Life Cycle, which I think we should be doing. Not doing so, makes different people with different roles in the project have separate ideas and energy about the idea of software destruction.

Related interesting link: Would Google destroy Digg or take it to the next level?

Happy destruction.//
add comment ( 65 views )   |  0 trackbacks   |  permalink   |   ( 3.1 / 46 )
The "I am here" debugging technique. 
Tuesday, August 5, 2008, 05:48 AM - Programming
No matter how good is your debug logging or your debugger, there are times when you think that its quicker to just put in one printf("I am here"); statement to debug your code. One thing to remember is not forgetting to print the the End-Of-Line character.

printf("I am here"); is different from printf("I am here\n");
In the former case, the print may get delayed and if your program crashes immediately you may be even get this line printed making you think that the control did not reach this line. So always use printf("I am here\n"); if you at all use this debugging technique.

Happy Debugging.//
1 comment ( 73 views )   |  0 trackbacks   |  permalink   |   ( 2.9 / 37 )

<<First <Back | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | Next> Last>>