jump to navigation

Gmail classifies mail from Google as SPAM June 16, 2009

Posted by fahdk in Computing, Uncategorized.
Tags: ,
add a comment

Gmail-Spam-Bug

How to create multiplatform software using C/C++? May 23, 2008

Posted by fahdk in Computing.
Tags: , , , , ,
4 comments

I am sure there would be many ways and approaches to creating multiplatform software that people have used over the years. Here I humbly present three basic points about an approach that I have found to be useful. Readers are encouraged to voice their opinions in the Comments section.

Point 1: Start off with platform independent data types.

Basically create a header file that defines your own custom data types and maps them to the fundamental data types available on the system. Have separate sections for each platform and it is good to repeat your definition for each data type separately for each platform so that changing things on a particular platform would be easier later. Sample code follows…

#if defined (LINUX && __X86__)

typedef long long myint64;

#elif defined (LINUX && __X64__)

typedef long myint64;

#elif defined (SOLARIS && __X86__)

Point 2: Create a platform abstraction library.

Something like the Apache Portable Runtime or the Netscape Portable Runtime but instead of using these or developing something like these, you can develop your own small little static abstraction library and add only those abstractions to it that you need for your project. As a side note, remember that the Pthreads library is available on the windows platform as well.

Point 3: Create your software utilizing the platform independent data types and platform abstraction library.

Make sure you never use system defined types in your application nor do you use any platform specific system call directly.

This approach should help you create reliable and maintainable multiplatform software.

Thanks.

Hazrat Maulana Ilyas [rh] on Usool, Sulook and Dawat March 11, 2008

Posted by fahdk in Islam, Sulook, Tabligh, Tasawwuf, Uncategorized.
Tags: , , , , , ,
add a comment

Taken from Malfoozat Hazrat Maulana Muhammad Ilyas [rh] by Maulana Muhammad Manzoor Nu’mani [rh].

-2-

He said – the quran and the hadith have proclaimed with emphasis that the religion is easy [yusr], which means, that it is thoroughly easy to follow. Thus those things that have a higher degree of importance in religion will also have a higher degree of ease, accordingly. Now, correction of intentions [tasheeh an neeyah] and purification of intentions [ikhlaas lillah] being extremely important, rather being the soul of all actions and pillars of the religion, are also easy. And since this purification of purpose for Allah [ikhlaas lillah] is the gist of all sulook and tareeq, it follows that sulook is also something very easy. But it should be remembered that things become easy by following its methodology [usool] and ways [tareeqah]. If the wrong methodology is adopted, even the easiest of tasks become hard. The mistake that people make is that they consider the part of following the methodology in itself as difficult and they shy away from it; even though (they do not realize that), even the simplest of tasks in this world can not be completed without following its methodology and its correct way. Ships, boats, trains, motor cars, all run by their methodologies. Even a pot of food and bread are prepared by following their respective methods.

-3-

He said – The special purpose of tareeqat is that the commands of Allah [ahkaam wa awaamir] become beloved to the heart and the prohibitions of Allah [nawaahi] become despised to the heart (this means that such a state develops in oneself so that fulfilling the commands of Allah gives one taste and pleasure and going near the prohibitions of Allah creates agony and dislike). This is thus the purpose of tareeqat. Whatever else exists such as special litanies or actions [adhkaar wa ashghaal] or specific kinds of exercises, so these are just means of obtaining the purpose even though many people consider these means to be the real tareeq even though few of these actions actually fall under bidaah.

Anyways, since these things fall under the grade of means rather than the goal, it is important to cast a second look at them under changing situations and needs; but those things that are part of the shariah, it would be incumbent to act on them in every age.

-4-

He said – The status of faraidh is very high compared to the status of nawafil. In fact it should be understood that the purpose of nawafil is to complete whatever has been left from the faraidh due to neglect. Thus faraidh are real and nawafil are for the faraidh and are secondary [furooi], but the state of some people is such that they are neglectful of faraidh but when it comes to busying themselves in nawafil they are much more persistent. For example, all of you know that inviting people towards good [dawat ilal khair], ordering the good [amr bil maaroof] and negating the evil [nahi an almunkar] (meaning all the branches of tabligh) are from the important faraidh, but how many are there who fulfill these faraidh? However, there is no shortage of people who exert themselves and make themselves consistent in voluntary litanies [adhkaar nafaliyya].

A karaamat of Maulana Qasim Nanotwi [rh] November 25, 2007

Posted by fahdk in Islam, Tasawwuf, Uncategorized.
add a comment

Taken from the book Arwah-e-Thalatha by Hakim Al Ummah, Maulana Ashraf Ali Thanwi rahimatullah alaih.

Narration 285: Molvi Muhammad Qasim says that he once visited Gangoh to the room of Hazrat Maulana Muhammad Qasim Nanotwi rahimatullah alaih and found a new, unused earthen pot lying in the room. He says; I picked it up and used it to pull water from a well and drank the water. On drinking, I found the water bitter. I mentioned this to Hazrat rahimatullah alaih before the dhuhr prayers. Hazrat mentioned that the water in the well is sweet. I gave him the pot and he drank from it and he also found it to be bitter. Hazrat asked me to keep the pot by the side and proceeded to lead the prayers.

After the prayers, Hazrat requested all those present in the masjid to recite as much Kalimah Tayyibah as possible. Hazrat himself began reciting the kalimah and after that he raised his hands and started making dua with intense humility and devotion. After this, he picked up the pot and drank the water and found it sweet! All those present in the masjid at that time also tasted the water and verified that it tasted sweet. Later Hazrat explained that the pot was made from soil that was taken from a grave which was undergoing the punishment of Allah azza wa jal. Alhamdulillah, due to the blessings of the kalimah, the punishment has been removed.

Narration 288: Molvi Siddeeq Ambethwi’s son Molvi Farooq mentioned that Molvi Ahmed Hasan Amrohwi, who was the teacher of Molvi Farooq, told him that Hazrat Maulana Qasim Nanotwi rahimatullah alaih, when he noticed pride in any of the students, he would sometimes make them pick up his shoes and if he noticed humility in any of his students, he would pick up their shoes himself.

Maulana Nanotwi [rh] and Dunya November 11, 2007

Posted by fahdk in Islam, Tasawwuf, Uncategorized.
add a comment

Narration 250: Taken from the book Arwah-e-Thalatha by Hakim al Ummah, Maulana Ashraf Ali Thanwi rahimatullah alaih.

My Respected, late father said that Maulana Mahmud Hasan rahimatullah alaih used to say that all our elders were like the sun or the moon. Each one was higher and better than the other. However, when their residences were visited, some or the other things from the basic necessities of life used to be found. In the room of Hazrat Gangohi rahimatullah alaih some basic things from the necessities of life were present. In the room of Hazrat Haji Imdad qaddisallahu sirrahu some basic things could be seen, but in the room of the person who was divorced from the creation and who was ascetic of this world [namely Hazrat Maulana Qasim Nanotwi rahimatullah alaih] there were no provisions to be seen. Yes, there used to be a straw mat but it was also broken, as if he used the single mat all through his life. There was no trunk and no clothes. When these elders used to go on travel then, for example, the close companion of Hazrat Gangohi rahimatullah alaih, Hazrat Abdullah Shah used to carry a trunk and clothes. But in the case of Maulana Nanotwi rahimatullah alaih, there was no such formality. If, sometimes, one or two set of clothes were present, they used to be sent to someone else for safe keeping. However, on most occasions, the entire travel used to be completed in the same clothes that he was wearing when he started. Only one blue lungi used to be with him so that when the clothes became dirty, he tied the lungi, removed his clothes and used to wash the clothes himself. Even this single pair of clothes that he had, were nothing but a cloak [achkan] and pajamas.

When it got cold, he sometimes wore a cheap turban [amamah] but mostly a cap covering his ears throughout the winter. Through his life he never had a button stitched on to any of his clothes saying that it is a sign of the Christians. He instead used to use a cord [bandh].

He never kept anything for himself but used to give a lot to others. Even if someone came to him aspiring dunya, he would not go back empty handed. Many gifts used to come to him but they would all be distributed to others. He did not keep anything for himself and used to say that others have the right.

Haashiya by Maulana Ashraf Ali Thanwi rahimatullah alaih: The goal in tareeq is settling and firming of the heart which for some people happens by leaving off of means and for others by adopting means while both are done for the beloved…

Also, not wearing buttons is from precaution. Other than this, for normal conditions, if buttons would not create doubts in the mind of persons who see them being worn, it would not constitute similarity with non-Muslims [tashabbih].

About Windows Events (synchronization) August 17, 2007

Posted by fahdk in Computing, Windows.
6 comments

Salaam.

I was trying to understand some C++ code on the Windows platform that uses the Windows Event synchronization object. Not being familiar with this object, I asked Shaikh Google about it but did not find an appropriate response.

Shaikh MSDN was also not very forthcoming about clarifying the issue, so I had to do a few experiments to figure it out myself. This blog entry sums up my understanding and should be helpful to those programmers who wish to know how the Windows Event object exactly works.

First we should discuss some terminology.

When an Event object is in signalled state, any thread issuing a Wait command on it will find the Wait successful (it will not block). In other words, signalled means unblocked.

When an Event object is in nonsignalled state, any thread issuing a Wait command on it will find the Wait blocking (assuming the timeout parameter for the wait was not 0). That means, nonsignalled can be thought of as blocked.

Now let us look at some APIs related to the Event object.

HANDLE WINAPI CreateEvent(
LPSECURITY_ATTRIBUTES lpEventAttributes,
BOOL bManualReset,
BOOL bInitialState,
LPCTSTR lpName
);

This call is used to create an Event object and returns a handle to it.
lpEventAttributes [in] is a pointer to a SECURITY_ATTRIBUTES structure. We will not go into the details of this parameter. It may be set to NULL.
bManualReset [in] is an interesting parameter and we will discuss this in more detail. If this parameter is TRUE, the function creates a manual-reset event object otherwise, it creates an auto-reset object.

Basically, Events in Windows can be of two types; manual-reset and auto-reset. A manual-reset Event object can be made to change its state from signalled to nonsignalled and vice-versa using the system calls SetEvent and ResetEvent respectively. This is fairly straightforward. To use this object, you will set it to nonsignalled (using ResetEvent) if you want the other thread to block on it, and you will set it to signalled (by calling SetEvent) if you want the other thread to proceed. As you can see, this is fairly simple.

Manual Reset Event (Pseudocode)

 

 

 

 

 

 

 

 

An auto-reset Event is not so straightforward initially. The idea behind this is that as soon as a thread unblocks on this object, the object will get blocked immediately and automatically for the other threads. So you do not need to call ResetEvent for this Event object. A Wait call on this object, when it succeeds, also does the ResetEvent (changing to nonsignalled) for you automatically. Notice that in this sense, it works like a semaphore with a max count of 1.

Auto Reset Event (Pseudocode)

 

 

 

 

 

 

 

 

lpName [in] The name of the event object. If this is NULL, the event object cannot be shared between processes. If it is not NULL, a global object will be created that can be shared between threads of different processes. Note that if an Event object was created previously by another thread, a handle to this object can be obtained using the OpenEvent API call.

Thanks.

Joining in Namaz – Part V March 28, 2007

Posted by fahdk in Fiqh, Uncategorized.
add a comment

This is in reference to the post Joining in Namaz.

Meeting in second rakat of the Eidain namaz: The person offers his second rakat with the imam and then gets up at the time of salam to offer his first rakat. He begins this rakat with “sanaa” and then recites the fatiha and a surah. After this he performs three extra takbir lifting his hands for each takbir. After this the person goes into the rukuh while saying the fourth takbir and thus completes the namaz.

If a person joins the imam during the rukuh of the first takbir then, if he thinks that he has sufficient time, he should perform the three takbirs before going into the rukuh. If, however, he thinks that he does not have enough time, he should just say those takbir in the rukuh without lifting his hands.

Meeting in second rakat of Jumah: The way to do this is similar to that of fajr namaz. The person completes the second rakat with the imam and then gets up to offer his first rakat in which he recites the sanaa, fatiha and a surah.

With this we complete the posts about “Joining in Namaz.”

Joining in Namaz – Part IV February 14, 2007

Posted by fahdk in Fiqh, Uncategorized.
2 comments

This is in reference to the post Joining in Namaz.

Meeting in second rakat of Maghrib: The person performs the second and third rakat of Maghrib with the Imam until the Imam says salaam. At this point the person gets up and performs the first rakat in which he recites “sanaa” followed by fatiha and surah and then completes his namaz.

Meeting in third rakat of Maghrib: The person performs the third rakat with the Imam, then gets up and performs the first rakat in which he recites the “sanaa” followed by fatiha and a surah. After this he sits in tashahhud and then gets up to perform his second rakat in which he recites the fatiha and a surah only.

Joining in Namaz – Part III February 14, 2007

Posted by fahdk in Fiqh, Uncategorized.
add a comment

This is in reference to the post Joining in Namaz.

Meeting in third rakat of Dhuhr, Asr or Isha: The persons completes the third and fourth rakat with the Imam. After this, he gets up and offers his first rakat in which he recites the “sanaa” followed by fatiha and a surah. Then he offers the second rakat in which he recites the fatiha and surah, following which he sits in “tashahhud” and completes his prayer.

Meeting in fourth rakat of Dhuhr, Asr or Isha: The persons completes the fourth rakat with the Imam and then when the Imam says “salaam”, he gets up and starts his first rakat in which he recites “sanaa” followed by fatiha and surah. At the end of this rakat he sits in tashahhud. After this he gets up to pray the second rakat in which he recites fatiha and surah only and then without sitting in tashahhud he prays the third rakat in which he recites only the fatiha.

Joining in Namaz – Part II February 13, 2007

Posted by fahdk in Fiqh, Uncategorized.
add a comment

Here is a translation of some parts of the Image posted in Joining in Namaz.

Meeting in second rakat of Fajr: If the person joins the Imam in the second rakat, he will be completing his second rakat with the Imam but his first rakat would still be pending. He should therefore, complete his first rakat after the second rakat. For this he will recite “sanaa” followed by fatiha and then a surah in this rakat.

Meeting in second rakat of Dhuhr, Asr or Isha: In this case, the person completes the second rakat with the Imam and sits for “at-tahaiyaat”. Then he gets up along with the Imam and completes the third and fourth rakat as well. When the Imam says “salaam”, the person still has to complete his first rakat, so he gets up and says the “sanaa” followed by fatiha and sura and so on until he finishes this rakat as well.

More to follow later, inshaAllah!