VC6 - 1200
VC7 - 1300
VC7.1 - 1310
VC8 - 1400
VC9 - 1500
Tuesday, October 19, 2010
WINVER and _WIN32_WINNT Values
NT – 0X0400
2000 - 0x0500
XP - 0X0501
Server 2003 - 0X0502
Vista - 0X0600
Windows 7 - 0X0601
Saturday, October 16, 2010
Two ways to proof of 0.999… = 1
Long Division
1/9 = 0.111...
9 x (1/9) = 9 x 0.111...
1 = 0.999...
Digit Manipulation
X = 0.999...
10X = 9.999...
10X - X = 9.999... - 0.999...
9X = 9
X = 1
Source : http://en.wikipedia.org/wiki/0.999...#Digit_manipulation
Wednesday, October 13, 2010
Hex/int conversion in C
int –> Hex
int i = 10;
void* h = (void*)i;
Hex –> int
void* h = 0xa;
int i = (int)((const char*)h - (const char*)0);
Monday, June 28, 2010
GMail targeting under 1sec load time with HTML5
According to Google, many of the upcoming features of GMail are going to be HTML5-ready. They hope HTML5 will speed up loading and execution time of GMail. Google’s goal is to get their Web-based email service to load in under 1 second. While going through the original article I noticed a couple of interesting things.
Speed is a feature! – Truly it is. I do believe speed is one of the most critical decision factor when it comes to selecting a software application. To be honest I am very much happy about the load and execution time of Google, but they are looking for more. Interesting!.
Currently, the Gmail program is comprised of 443,000 lines of JavaScript, with 978,000 lines if comments are included. – I did actually not know that it was written completely in JavaScript in the first place. The interesting point is roughly each line of JavaScript is accompanied by one line of comment. That implies how vital the comments are in a software programming and of course how complex the GMail logic is ;-).
Wednesday, June 23, 2010
Qpid Site Gets a Major Revamp!
Apache Qpid site gets a major revamp. It looks really awesome. Great work guys!
Tuesday, June 15, 2010
Airplanes punch holes in clouds and make it rain
This is a very rare scene in the sky. A recent study reveals that these punches are formed by airplanes. According to scientists droplets in clouds exist in a supercooled state, well below freezing, yet remain in liquid form. When planes go through these clouds, they cause a drop in temperature that freezes these droplets. As a result part of the cloud gets converted into ice crystals forming a punch hole. These ice crystals fall to earth in the form of snow or rain. So, this is another way airplanes mess around with the weather.
Monday, June 14, 2010
How to fix : DoModal inside a DLL Crashes with VS2005 SP1
ISSUE :
I had been experiencing a strange crash in my application since I installed VS2005 SP1.
It was an MFC-based add-in (i.e. a DLL) for MS Excel which did a DoModal internally to show up a Dialog. When I debugged I saw that the culprit was the following code segment in dlgcore.cpp.
Basically the AfxGetApp() returned NULL leading to an assertion fail.
FIX :
I inserted the code CWinApp theApp; in one of the source files in my DLL making a CWinApp-derived object available to the DLL. That solved my problem.
Thursday, June 10, 2010
How to Debug Apache Qpid Broker with Intellij IDEA
Apache Qpid/Java no longer has a Apache Maven build as it’s build system was moved to Apache Ant some time back for historical reasons. Therefore you can not do usual mvn idea:idea gimmick to generate IDEA project files. You can create an IDEA project from the scratch but it is unlikely someone would bother to do all that. So, the only viable solution is to use Remote debugging facility in IDEA. This is how you could go about doing this business.
Basically you need to start Qpid broker in debug mode – JPDA mode to be precise - and have your IDE connect to the remote JVM through an IDEA Remote Debug Configuration so that you will be hooked into the remote JVM and get triggered for the calls that are being made.
You can could start the Qpid broker in JPDA mode by passing the command line argument –run:jpda to your startup script. On windows it is qpid-server.bat –run:jpda. The broker will start as a JPDA listener. You can set the wire protocol transport using the JPDA_TRANSPORT environment variable that defaults to dt_socket. You could also use dt_shmem on Windows platforms in case you need to use the shared memory transport. You can set the address (port) using the JPDA_ADDRESS environment variable that defaults to 8000.
Since we do not have an IDEA project for Qpid, we just create an empty project and attach source to it. Once that is done you could follow the steps given below to setup the debugger to use JPDA.
1. Go to Run –> Edit Configurations
2. Add a new configuration instance of type Remote
Set Transport depending on what you set in the broker startup script, Socket for the default case. Set Port accordingly, 8000 for the default case. You may also set the configuration instance name – Unnamed in the screen shot - and press OK.
3. Start your broker using the command qpid-server.bat -run:jpda
4. Launch debugger using Run –> Debug and you should see the following message in the IDEA console.
5. Set breakpoints as you wish and start debugging. Happy debugging! :-).
AMQP 1.0 Prototype IM Client
I downloaded an AMQP 1.0 desktop IM client from AMQP 2010 F2F homepage. The broker was running on the cloud – on an EC2 instance in Virginia to be precise - in this case.
The coolest thing about this tool was its protocol trace that showed AMQP frames and message flow. I was fascinated to see real AMQP frames in a real world application.
With Apache Qpid Back Again …
I have been contributing to Apache Qpid for more than two years now. A major contribution I did was helping make Qpid/C++ Windows port a success. This is what Steve had to say about what I had done ;-). I should admit the fact that without Steve’s involvement Apache Qpid/C++ Windows ports would have been an utter failure. Kudos to Steve!.
These days I am having a deeper look at Qpid/Java security model as I need to get it working with one of WSO2 projects. It is indeed going to be a really exciting work. I will not forget to post updates here!.
Monday, June 7, 2010
Data deduplication in a nutshell
Data deduplication is a special form of data compression where redundant data is eliminated improving storage utilization. In a nutshell, in the deduplication process duplicate data is eliminated leaving only one copy of the data. However indexing of all data is kept for restoring purposes. Obviously data deduplication helps reduce storage capacity as only unique data is saved in the disk.
Lets have a look at an example.
A considerably large image of size 3MB taken during your summer holiday might contain 100 instances of the same block of pixels. Lets think the size of each block is 10k (to be realistic lets imagine its an images of a lake with a scenic pasture in the background … fair enough ;-)). With data deduplication the size of your image comes down to something like 2M because the total size of redundant blocks adds up to 1M (i.e. 10k x 100). Just imagine the storage utilization you would gain in an enterprise storage implementation!. Its quite a lot.
Also, data is money at the end of the day. If you look at most of the storage services that are there at the moment you will see that they are comparatively expensive. Therefore data deduplication will come in handy when it comes to storing large dumps of data.
Tuesday, June 1, 2010
Computing as a Commodity
I just created a new post on my other blog on cloud computing. Please read it at http://danushka-menikkumbura.blogspot.com/2010/06/computing-as-commodity.html.
Monday, March 15, 2010
Windows Compilation Models for C/C++
ML (Default)
---------------
MFLAGS = -ML
Single-threaded, statically linked
Runtime library - libc.lib
MT
---
MFLAGS = -MT
Multi-threaded, statically linked
Runtime library - libcmt.lib
MD
---
MFLAGS = -MD
Multi-threaded, dynamically linked
Runtime library - msvcrt.lib
Tuesday, March 9, 2010
Friday, March 5, 2010
Funeral held for IE6
More than 100 people, many of them dressed in black, were expected to gather around a coffin Thursday night to say goodbye to an old friend of ours.
Read more here.
Sunday, February 28, 2010
Less than one second Linux boot!
The following video shows an instance where Linux has been tuned to start in less than one second. Interesting!.
Sunday, February 21, 2010
How to configure Facebook Chat on Pidgin
As Facebook Chat now supports Jabber/XMPP, you can integrate it into your favorite chat client. I have been a big fan of Pidgin for more than three years now. Therefore I have mentioned the simple set of steps for setting up FB Chat on Pidgin.
1. Launch Pidgin, go to Accounts –> Manage Accounts and click Add… .
2. Fill in the Basic tab as shown in the following screenshot.
Please note that here the Username is your Facebook username.
3. You need to make sure you have unchecked all SSL options on the Advanced tab.
4. Click Add and you are done.