What is Luck and How Can We Become Lukcy?

February 23rd, 2010

One of my favorite quotes: "Luck is what happens when preparation meets opportunity" – Seneca.

This morning my friend handed me an article about luck "Be lucky – it's and easy skill to learn" by Prof. Richard Wiseman. I liked this article a lot and want to share it here.

Prof. Wiseman has studied the luck and what makes people feel lucky or unlucky. Insights from this great work are that people's thoughts and behavior are responsible for their good or bad fortune. He conveys an experiment of more than 400 people that describe themselves as either lucky or unlucky. In this experiment, each person is given a newspaper and asked to count the number of pictures in it. It takes about 2 minutes for the unlucky people to find out that there are 43 pictures, whereas the lucky group finds the number in just few seconds. The reason is that on the second page there is a message written with 2" (5cm) big letter "Stop counting. There are 43 photographs in this newspaper.". The lucky group sees it but the unlucky group misses it.

This experiment reveals that:

"Unlucky people miss chance opportunities because they are too focused on looking for something else. They go to parties intent on finding their perfect partner and so miss opportunities to make good friends. They look through newspapers determined to find certain types of job advertisements and as a result miss other types of jobs. Lucky people are more relaxed and open, and therefore see what is there rather than just what they are looking for."

To see if unlucky people can become lucky, Prof. Wiseman sets another experiment – "Luck School". For one month, participants carry out exercises that would help them increase their skills in spotting opportunities, listen to their intuition, think they are lucky and be more optimistic by trying to find the good in the bad luck. The results from the experiment are positive – unlucky people become lucky and lucky people become luckier. Even one of the participants from the unlucky group, after graduating from the "luck school" successfully passes the driving test after three years of trying.

Uncategorized , , ,

Translating Instruction Address to Source Line

February 22nd, 2010

In this article I will describe how to programmatically translate an instruction address from a Win32 executable to a source line. The described approach uses the Microsoft debugger engine dbgeng.dll. Therefore you should have it installed. If you don’t have it, you can download and install the Windows debugger WinDbg which will install dbgeng.dll.

Requirements

To use this approach you will need to have installed windows debugger engine – dbgeng.dll. If you don’t have it, install WinDbg debugger. This will install dbgeng.dll

Approach

Many debuggers support debugging at source code level. The debugger is capable to provide debugging at the source level by translating instruction addresses to lines in source code files. In our approach we use the same mechanisms that debuggers use. This particular solution, to translate an instruction address to a source line, uses functionality provided by the windows debugger engine dbgeng.dll.

In overview, we create a process from the Win32 executable file from which we want to translate instruction addresses. Then we attach the debugger engine to the created process. To create a process and attach the debugger to it we use CreateProcessAndAttach function. When the debugger is attached, we call function GetLineByOffset to do the actual translation. After we finish with the translation task we terminate the process with the function TerminateCurrentProcess. Besides these procedures there are few more things that are necessary to do which I explain in the implementation.

Implementation

First we create objects that implement the following COM interfaces: IDebugControl , IDebugClient, IDebugSymbols. To create these objects we use function DebugCreate.

static IDebugClient5 *dbgClient5 = NULL;
static IDebugSymbols *dbgSymbols = NULL;
static IDebugControl *dbgControl = NULL;
...
DebugCreate(__uuidof(IDebugControl), (void**) & dbgControl);
DebugCreate(__uuidof(IDebugClient), (void **) & dbgClient5);
DebugCreate(__uuidof(IDebugSymbols), (void **) & dbgSymbols);

Before crating the process from the executable we set the debugger engine filters so that the target process breaks into the debugger immediately after it is created. To set the debugger filters we use function SetSpecificFilterParameters.

DEBUG_SPECIFIC_FILTER_PARAMETERS filter[10];
for (int i = 0; i < 10; i++) {
	filter[i].ExecutionOption = DEBUG_FILTER_BREAK;
	filter[i].ContinueOption = DEBUG_FILTER_GO_HANDLED;
	filter[i].TextSize = 0;
	filter[i].CommandSize = 0;
	filter[i].ArgumentSize = 0;
}

dbgControl->SetSpecificFilterParameters(0, 10, filter);

Using function CreateProcessAndAttach we create a windows debug process and attach the debugger to it.

ULONG64 server            = 0;
PSTR    commandLine       = executableName;
ULONG   processId         = 0;
ULONG   attachFlags       = 0; 

dbgClient5->CreateProcessAndAttach(
	server,
	commandLine,
	DEBUG_PROCESS,
	processId,
	attachFlags);

To translate the instruction address to a source line we call function GetLineByOffset.

ULONG64 offset = instrAddress;
ULONG fileNameBufferSize = MAX_FILE_NAME_SIZE;
memset(sourceInfo->fileName, 0, fileNameBufferSize);
sourceInfo->lineNo = 0;
sourceInfo->fileSize = 0;
sourceInfo->displacement = 0;

HRESULT isOk = dbgSymbols->GetLineByOffset(
	offset,
	&sourceInfo->lineNo,
	sourceInfo->fileName,
	fileNameBufferSize,
	&sourceInfo->fileSize,
	&sourceInfo->displacement);

If we want to translate multiple addresses, we have to call function GetLineByOffset multiple times without repeating the earlier operations. After we finish with the translation we detatch the debugger from the process by terminating the process with function TerminateCurrentProcess.

HRESULT isOk = dbgClient5->TerminateCurrentProcess();

Download

The code complete source code is available for download from InstructionToSourceLine.zip. Note that the instruction address provided as input should be a decimal number but not hexadecimal.

C# Version

There is also a C# implementation of this tool that you can download from InstructionToSourceLineCSharp.zip. This C# implementation consists of 2 parts – DbgEngManaged and InstructionToSourceLineCSharp. DbgEngManaged is a managed c++ library wrapper for the debugger engine DbgEng.dll. InstructionToSourceLineCSharp is a C# console application that references DbgEngManaged library. Note that the error handling here is not done properly so don't judge me for it :) The provided code here is something that I have quickly prototyped and decided to share for those who for some reason need to use the debugger engine. It can also serve as an example of using native and managed code together. 

Programming, windows , , , , , , , , , , , , ,

Avoid Being Ripped Off for Spanish NIE Number – How to Apply

December 23rd, 2009

I have just seen one Google advertisement of an agency that offers their services for helping foreigners to issue NIE – Número de Identidad de Extranjero – number. The subject agency charges the insane 165 Euros + Expenses for a NIE number application on your  behalf.

The agency shows that the normal procedure is very complicated as it requires waiting on queues, involves notary, lawyers and other bureaucracy. And to safe you all these "complicated" paperwork, the agency offers you a service to apply for NIE number on your behalf and obtain the NIE number in 2 weeks – for 165 Euros + Notary Expenses.
 
Actually, the application process is very simple and very fast and costs about 6 Euros (which I believe the subject company will charge it to you as an extra fee). When you come to Spain, what you need to do is:
2.       Go to any bank, show them the NIE application form. The person will understand that you want to pay the fee for it. Take the receipt.
3.       Check from internet at which police station you need to submit this form (Where to apply for NIE). Non-EU citizens sometimes may need to wait on a queue about 1-2 hours. The usual waiting time for EU citizens is about 10 minutes. The reason for this is that places to apply for NIE numbers are different for EU and non-EU citizens.
4.       At the time of application, you will be immediately issued the NIE number.
 
If you want for any reason to apply for NIE number without coming to Spain, you can do it through the Spanish embassy in your country. Call the embassy and ask them how you can do it. I believe it will be cheaper than 165 Euros + Expenses. But anyway, I don’t see a reason why one would need a NIE number without ever coming to Spain.

Uncategorized , , , ,

A Story about the Big Excursion

December 18th, 2009

 20 Years since the Exodus of the Turks in Bulgaria

This year marks the 20th anniversary of the compelled migration of Bulgaria’s Turks. Being a part of the brutal forced assimilation process that the Bulgarian government imposed on the largest minority of the country, it is the biggest exodus that Europe has seen since the World War II. More than 320,000 people left their homes seeking for shelter and protection in Turkey [1, 2].  Later this became known as “The Big Excursion”. Here I will try to relate my recollections of the sad story of my family during this excursion.
 
 
Before Going – The Preparation
It was the summer of 1989, two years after my father lost his life in a tragic accident at work. Just when our grief over my father’s death was becoming a thing of the past, we faced an even more cruel reality. Following the forceful change of name and religion of not only the living but also the dead, which involved the breaking of the centuries-old tombstones, and killing and internment of the “disloyal” citizens in Belene, five-years of ethnic cleansing was coming to an end: we either had to give up our ethnic identity or leave the lands of our ancestors.
 
I remember the panic-stricken face of my mother Nazife, then 36. All the time she was repeating, “Everybody is going, we cannot stay”. She didn’t know what to do. I believe she was trying very hard to avoid bursting into tears in front of her two kids.
 
One day, when she came home from work she told my (maternal) grandparents that we needed passports. Getting passports was no easy task; you could get one if you knew the right persons and appreciated their toil. Later, my mother told me that the bribes for the passports amounted to 5000 Levas (For reference, at that time a flat of 75m2 cost about 12,000 Bulgarian Levas). It looked like our forced migration was creating the first entrepreneurs of the soon-to-be-capitalist Bulgaria.
 
I remember the moment when we went to one of the few photographers in Shumen, the one in the city center at the big roundabout at the Russian Square. There was a very long queue. I cannot tell now the exact length but we had to wait from the morning till afternoon and I missed my favorite cartoon. But we were “fortunate” – we could make the photos for the passports in one day.
 
During this preparation process, there was one person, who was making life easier for us: aunt Katya. Being a member of the Communist Party and having good “connections”, she was “helping” my mother to bribe government employees for quickening the procedure. Of course, while “helping” aunt Katya was getting her generous commissions.
 
By the time we received our passports, my mother had started to arrange the logistics for our trip to Turkey. Most important of all, we didn’t have a car so we had to find one. You may wonder why we didn’t prefer public transportation. After all, this was a communist country and was supposed to have a good public transportation network. The answer is very simple: there were no trains and buses going to Turkey. Unfortunately, my mother’s efforts were frustrated with people’s unwillingness to sell their cars. This unwillingness was due to the difficulty of getting a car: in the communist era, people had to wait for years to get their turn to buy a new car. So, my mother had to hire the son-in-law of aunt Katya for driving us to the border. His name lost in the mists of those dreadful days, he was not less “helpful” than his mother-in-law and took a dive into capitalism by charging us with a fee that is probably enough to buy a new car!
 
Since we were going to settle in Turkey and had no plans of going back to Bulgaria, my mother made sure we took some of the basic furniture such as beds, table, and chairs. This meant we were once more at the mercy of aunt Katya, who “helped” my mother in finding a truck driver who would drive a state owned truck to transport our heavy luggage.
 
Before our departure, my mother sought ways of selling the house and the flat we used to live. Being offered a puny amount – just as much as the expenses we paid for the drivers – we gave up on selling. We actually didn’t need any money because, as all Turks do, we had our savings hidden at home for such emergencies. Our bank accounts, as with all other Turks, were blocked and we were not able to touch our own money. But, again with some “professional assistance” from aunt Katya, my mother could withdraw a small portion of our money.
 
As part of preparing for Turkey, we needed to get some food supplies and clothes. The idea was to make sure we could survive the first days of our lives in Turkey. However, this turned out to be very difficult. The shops were either out of stock and not being supplied or refusing to sell to Turks. Therefore, my mother decided that we should try our chances in Varna, the 3rd largest city in Bulgaria, 80km east of Shumen. After hiring a car and a driver, thanks to the “help” of aunt Katya, my mother, my maternal aunt Mürvet and I set out for Varna. Not surprisingly, we were stopped at a police barricade, where, following a check of our IDs, we were kindly asked to go back or wait for the others to return. Although our documents were with Bulgarian names, we were somehow detected. This meant we had to get off the car and wait for aunt Katya to complete this insurmountable mission.
When Going – On the Road
On June 12, 1989 we got our passports and were ready to hit the road. Our luggage was packed and loaded in the truck. As soon as my brother Behrin, then 14, took his graduation certificate on June 15, we didn’t wait a single day and left for Turkey the following day (June 16). It was me, my brother, my mother, and my maternal grandparents. Together with us were the family of my aunt Mürvet. My mother, my grandparents and I were privileged to travel in the car – the new model of Moskvich, while my brother and my cousin Erol were in the back side of the truck with the luggage. My aunt Mürvet, my uncle Mümin and my other cousin Türkan were lucky to travel with their own car – Trabant.
 
We were all very excited and happy. It was the beginning of a new life. We were talking about our new future in Turkey. We were going to the relatives of my grandmother – her stepbrother Mehmet. They were a rich, influential and wealthy family in Bursa and would help us. However, after about 2 hours of driving, just before Rishki Prohod, we reached a convoy of vehicles headed for Turkey. The convoy was newly formed and we were lucky to be just half a kilometer behind the front of the convoy. However, it didn’t take us long to realize the road was blocked by the police cars and soldiers and being near the front didn’t help us at all. During the next 2-3 days the convoy reached Aleksandrovo, the nearest village about 5 kilometers down the road. The only reason why it didn’t grow longer was because the people had heard about our misery.
 
We were stuck there for 9 days (until June 24, 1989). There were no bathrooms, no places to sleep, no shops, no restaurants, no facilities for cooking, no nothing. During these 9 days we ate of the provisions that we had planned as our survival kit in Turkey. My mother, my grandparents, our driver, and I slept inside the car in an upright position, while my brother and my cousin Erol were sleeping in the truck on top of the luggage. Nobody knew why we were waiting and nobody had any idea about how long we would wait.
 
During the daytime, we were going to the forest by the road, where we made friends with the other children and played games. The weather was sunny but almost every day of our wait we had this short summer rain for about 30 minutes. By the second day, we found spring water inside the forest, which solved our drinking water problems. However, during these 9 days, we the children had a kind of shower only once, with water that was warmed by the sun, whereas the grown-ups had to defer this luxury until out arrival in Turkey.
 
One day in the middle of this waiting, my uncles, Tevfik and İsmail, and aunt Katya came to see us. They had heard about the convoy on the TV and guessed that we might be here. They also brought us some food.
 
On the 9th day, before the noon, the police finally lifted the barriers and we could continue our trip to Turkey. As soon as the wheels started to rotate, we were once again filled with excitement and started talking about our future plans. But this didn’t last long. In the afternoon, while driving by a forest near the Turkish border, there was another barricade. The police was redirecting all convoy vehicles into the forest. It looked ominous and we could do nothing but try to come up with good reasons that nothing bad would happen to us. One popular argument was that there were Bulgarians among us, such as the drivers. We drove about half a kilometer into the forest and reached an open area surrounded by soldiers, where we saw other people sharing our concerns. The bad thing was that the police didn’t let the people go back to their homes any more. We had to stay.
 
Unlike the other point near Rishki Prohod this one was surrounded with trees and was very humid. The eerie environment seemed to shatter the people’s determination. The security forces didn’t let anybody leave the place. Filled with fear, not many would have resisted the urge of going back to their homes and living with their assigned Bulgarian names.
 
It certainly was not a very pleasant stay. We were not able to play. The ground was wet and muddy. Also, as far as I can remember, the police redirected the trucks to another location and all of us (a total of six people) had to sleep in the car, which meant, given the humble size of a Moskvich, I ended up sleeping on top of my mother and my grandfather. Again nobody knew how long we would stay in this forest and why we stayed there.
 
Luckily, our second ordeal lasted only a single night. On the morning of June 25, 1989 (around 09:00) the police lifted the barrier and the convoy once again started moving. We soon merged with the truckers somewhere on the main road, if my mind is not failing me, and reached the Turkish border at Malko Tarnovo at about noon. There was a long line here, which was shortened by the sense of relief provided by the presence of the Turkish soldiers across the border. Nothing bad could happen to us before their very eyes. They wouldn’t stay and watch the Bulgarian forces harming us; they would surely protect us from the malice delivered by the army of the country we were citizens of.
On the Border
 

We crossed the border on the 10th day, 25 June. Because of the excitement, the time we waited at the border didn’t look long. Actually, considering the time we waited for many trivial things such as making photos, the time we spent at the border seemed like an instant. Some time in the afternoon we were finally at the side of the Republic of Turkey. I didn’t even realize the crossing of the border. But I remember that on the Turkish side there was some order and peace unlike the big chaos on the Bulgarian side.

As soon as we crossed the border, my mother made a quick deal with one of the many Turkish truckers for carrying our belongings to the final destination, Bursa. After transferring our belongings from the Bulgarian truck into the Turkish truck and completing the paperwork, we were kindly invited by the Turkish soldiers into one of the few huge military tents for having lunch. Inside the tent were tables with chairs. Soldiers were continuously passing with big pots and serving hot soup of red lentils. This tasty soup was the first warm meal we had after the last 10 days. I will never forget its taste. Since then the soup of red lentils is my favorite one. The bread they had was also hot and soft. The good thing was we could ask for as many plates of soup as we want. And we all did ask for one more. I remember, at that moment because of strong emotions my grandfather silently cried. I will never forget this warm welcome!
 
When we were finished with the lunch, it was about sunset time. We all got into the truck that we hired and headed toward Bursa. My mother, my grandmother, and I sat in the front cabin, while my brother and my grandfather had to hop in the back, befriending with the luggage. My aunts were also coming but they were in another truck.
 
When we were passing through Istanbul, it was after midnight and I was asleep. We stopped here to have goodbye with my aunt and my cousins. They were staying in Istanbul at some their relatives and we would have to continue. Though I was sleepy, I remember how my mother and my aunt cried a lot. I remember that my mother continued to cry for some time after we have split and got in the truck.
In Bursa
We arrived in Bursa early in the morning the next day (June 26, 1989). I remember how my grandmother walked to the house of our relatives and called them. The relatives we went to were the family of my grandmother’s stepbrother. There were a lot of strong emotions in the air. During the day, many people came to see us and my grandfather told them about our difficult journey.
 
The same day, my cousin from Turkey, Nurdan, who was a few years older than me, took me to a local shop – bakkal. I was fascinated with the variety of nicely-packaged products vying for my attention. I took one small chocolate bar and started for exit, just when Nurdan told me that I had to pay for it. I didn’t have any money and felt very awkward. I had thought at the beginning that my cousin would make me a gift by buying me some sweets. Luckily, the shop owner gave it to me for free.
 
Life in Bursa was not as easy as we expected it to be. Making a mental switch from socialism to capitalism was something that we were not ready for. The religion that never had any significance to us was another thing we had to bear.
 
My mother and my grandfather started working. My mother was employed in a water bottling company named Sultan Su. My grandfather couldn’t find a good job in any factory because of his age and had to start working as a gardener at the house of one rich family. So our income was meager and far from providing us an affluent life. All those nicely packaged sweets and cookies in the shops looked so delicious but we were not able to buy any of them. I used to wait for my grandfather on his way back from work and ask him to buy me something. Unlike my mother, he could never say “No” to me, his namesake.
 
In the meantime, more and more immigrants flowed into Bursa. Many of them were temporarily lodged in the public schools. Among them were some family friends from Shumen. We met with many other immigrants staying in the same school and started playing with the immigrant children. Somehow we couldn’t integrate with the local children. They were very rude and laughed at our dialect of Turkish. Sometimes we met with our cousins, mostly with Fatih, and watched countless karate movies at their home. His parents were very kind to us.
 
In the same school Turkish language courses were organized to prepare the immigrant kids for education in Turkey. Age of the attendants ranged from 7 to 20+. I was the youngest and it was very difficult for me to catch up with the others. Of course, at the end, I scored the worst result on the exam. Our relatives urged us to register in religion courses but my mother didn’t let them do it. Her argument was that we had to learn reading and writing Turkish and prepare for the school.
 
One evening when we returned we saw that there was a car with a Bulgarian license plate parked in front of our relatives’ house. Uncle Mecit and his grandmother had come to seek the hospitability of our relatives. This meant we had to free one of the two rooms given to our disposal and live in a single room. For some time, all five members of my family had to put up with the inconvenience of sleeping in one bed along its long side.
 
After some time we rented a part of a two-room house. It was a very crappy place; it didn’t have a bathroom. But we were able to act more freely without bearing in mind other people. We were also away from the immigrant children and I started meeting with local children. It was a bit difficult to establish relation with them. Luckily the school started and I had duties to do.
 
Things were not looking good. Our budget was stretched. To help my mother and grandfather in providing our sustenance, my grandmother was washing the clothes of some football players on hand. Because we didn’t have a washing machine. At the same time we were hearing about some people returning to Bulgaria. The situation was not bad there. It looked like the communism was coming to an end. So, one day when my mother told us that we would go back to Bulgaria, we were actually very happy about this and I was jumping up and down on the bed.
Returning to Bulgaria
 

On Nov 13, 1989 (after 3 months and a half) at about sunset time we set out for Bulgaria. It was morning when we arrived at the border. There were many people returning. Seeing this confirmed that we are not doing wrong. My mother and my grandfather arranged the moving of the luggage from the truck to a cargo train. It took almost the whole day. It was very unpleasant weather – dark, cold, and rainy. We crossed the border at about 18:00 and were welcomed, as we had expected, with the sarcastic smiles of the Bulgarian customs officers and their inquisition, “What happened in your Turkey? Why do you return? Didn’t you like it?”.

On the Bulgarian side of the border, there was not any formal procedure to complete except a medical examination. I don’t know why – probably there was no transportation – we had to spend the night at the border. We passed the whole night in a cold depot stuffed with many other people like us and half slept on a bench. The next day (Nov 14, 1989) in the morning we took the one and only taxi at the border and left for our warm and cozy home. By the time we arrived in Shumen it was late in the afternoon and getting dark. We were all very tired. My mother rang the bell of our neighbor, aunt Milka – my mother’s best friend, whose husband had died in the same accident with my father. She was so sincerely surprised to see us back. While she and my mother were preparing us a meal, we had already started playing with her children, Katya and Nikolay. So, finally we were back at our sweet home.
Back in Bulgaria
Upon our return, we realized that the communist regime in Bulgaria had been overthrown and Todor Zhivkov – the dictator responsible for our ordeal – was about to resign. We had missed all these news while we were busy with the preparations of our journey back. Indeed, the totalitarianism in Bulgaria was over. Legislation was changed and the Bulgarian government recognized Turks as an ethnic group. In March 1990, a law was ratified, allowing Turks to get back their Turkish names which were forcefully changed to Bulgarian during 1984-85. In 1991, the constitution was changed and Turks were given rights such as teaching in Turkish at schools.
 
Today, although the Turks in Bulgaria are recognized and have equal rights before the law, implicit and explicit discrimination against them is unspoken truth. And last but not least, during these 20 years since the Big Excursion, there has not been even one person held liable and jailed for doing this scoff at them.
References
The exact numbers and date of events are taken from the following sources:
[1] “Refugees A Modern Balkan Exodus”, The Time Magazine
[2] “Възродените – 20 Години По-късно”, документален филм B-TV
Links
·         The Big Excursion, Francesco Martini – Oservatorio Balcani e Caucaso

World , , , , , , , , , ,

Top Conferences in High Performance Computing

September 18th, 2009

 Department of the Computer Science and Engineering at University of San Diego ranked conferences and journals in high performance computing based on their impact. According to their rank, the top conferences in the area are better than the journals. The table below is my shameless copy&paste from the original document “Judging the Impact of Conference and Journal Publications in High Performance Computing”. Conferences in the table are classified in three different classes and grouped based on their importance/impact.

Grouping
Archival Journals
(Combined areas)
General High Performance Computing
Related Conferences in Programming Languages
Related Conferences in Architecture
Related Conferences (cross-discipline & other areas)
Group 1
TPDS, JPDC, CPE, TOPLAS, TOSE, SPE, TOCS, TOC, Micro
SC, PPOPP, HPDC, ICS
PLDI, POPL, OOPSLA
ISCA, Micro, HPCA
ASPLOS, PACT, SPAA, Sigmetrics, SOSP
Group 2
 IJPP, PC, PPL, CL, JILP, JSA, IJHPCA, SP
 
IPDPS, Europar, ICCS, ICPP, ISCOPE, CLUSTER, SCPPSC, CCGrid
CC, LCPC, CGO
ICCD, ISHPC
 
Group 3
PARA, HCW IRREGULAR
FDDO
PACS, CAECW
EPIC, Interact, MTEAC
 
 

Uncategorized ,

Uses of const in C++

May 25th, 2009

To exmplain to a friend the different uses and semantics of "const" in c++ I come accross one very nicely written article "The C++ ‘const’ Declaration: Why & How". It concludes with an example that has all the possible uses of "const" in one statement. I copy & paste it here.

Of course one sometimes needs to combine some of these different uses of ‘const’ which can get confusing as in

const int*const Method3(const int*const&)const;

where the 5 uses ‘const’ respectively mean that the variable pointed to by the returned pointer & the returned pointer itself won’t be alterable and that the method does not alter the variable pointed to by the given pointer, the given pointer itself & the object of which it is a method!

Programming ,

Quality of Living by Countries for 2009

May 20th, 2009

This morning I saw an article about ranking countries based on the quality of living (2009 Quality of Life Index). The ranking is prepared by International Living magazine. To produce the annual Index, the magazine takes into account nine categories: Cost of Living, Culture and Leisure, Economy, Environment, Freedom, Health, Infrastructure, Safety and Risk, and Climate. 

According to the index the first three countries are France, Switzerland and USA, and the last three countries are Somalia, Sudan and Yemen. Few countries such as Iraq and Afganistan are assigned 0 for safty and risk rating. Bulgaria is 42nd, Spain is 27th, Turkey 65th. The full list of the ranking can be found at 2009 Quality of Life Index.

World

A Short and Comprehensive Tutorial on Windows API

April 15th, 2009

I needed to write a simple native Win32 windows application and after searching around I found very nice tutorial - easy to read and with rich examples. So here is the link "Windows API Tutorial". The tutorial includes examples of how to write native (win32) applications with forms, drawgraphics and threading. The tutorial follows a good practice of encapsulating the Win32 abstractions in C++ classes (something which is alredy done at MFC) and makes things to understand easier.

Programming, windows , , , , ,

dumpbin – reading header files of windows binaries

March 24th, 2009

Using dumpbin /headers you can read the header of windows files and check for example for what architecture and addressing mode the binary is compiled for.

windows , ,

Learn Linux Distribution and Version

March 12th, 2009

To learn the distribution of the linux and the version type: $cat /etc/*-release

linux , ,