Advice to my younger self

“There is no god but You! Glory to You! I was one of the wrongdoers!” (from the Quran, verse 21:87)

If you could give advice to your younger self, what would it be?

I would give myself two pieces of advice:

1. You cannot guide yourself

Even if you spend years reading the best available books, without God’s help and guidance you will never be able to achieve guidance.

Whomever God guides is the guided one. And whomever He sends astray—these are the losers.

The Quran, verse 7:178

The proper attitude toward guidance is to desperately desire it from God the way a person dying of third desires water. This was one of the most difficult lessons I have learned in life and possibly the most important one.

2. You cannot benefit yourself without God

Nothing you do can ever succeed if God does not want it to succeed. Success should first always be sought from God. All good things come from God and we have no power to do anything that benefits us except through God’s will and approval. So it is from God that we should seek all benefit.

Whatever mercy God unfolds for the people, none can withhold it. And if He withholds it, none can release it thereafter. He is the Exalted in Power, Full of Wisdom.

The Quran, verse 35:2

In short, both when it comes to guidance and success, God should be our center. He should be the King from whom we desperately seek these things, knowing that nothing we do will have any benefit unless He desires it.

The lesson I have learned is therefore that I must lead a God-centered life; to throw away all my illusions that I am capable of benefiting or guiding myself.

Human and Social Development in Islam

Panoramic view of the Alhambra Complex in Garanda, Spain.

What exactly do we mean by human and social development?

This question will be answered differently if we were to ask a diverse set of people.

Even though most people may agree that human development entails having more “freedom”, “equality”, “justice”, and access to opportunities for “self-fulfillment”, “happiness”, and “flourishing”, different societies may interpret these values very differently depending on their worldview. This is because concepts of development and progress ultimately stem out of a society’s belief and value systems and are measured according to them. The worldview of a community or culture dictates how that society perceives reality and consciously or subconsciously shapes that society’s normative principles of ethics, morals, development, and progress.

Just like the right ideal can galvanize people towards progress, a wrong ideal can derail the efforts of humans and societies. The dominant secular (neoclassical economics-based) worldview has done just that through its myopic formulation of human development in terms of material wealth and by ignoring the role of spirituality or character development in defining human development. This narrow formulation of human development, accompanied by the rise of market-based capitalism and the estrangement of God from human life, has significantly damaged the human psyche and society, as well as the environment.

The Islamic worldview in contrast has principally spiritual end-goals of human development and defines life to be purposeful. The purpose of human life is clarified by God in the Quran to be “nothing except for the worship of God”1. A primary distinction between the Islamic and non-Islamic worldviews is that the former incorporates a belief in the impermanence of this worldly life (al-dunyā) and the existence of an eternal afterlife, al-ākhira. The Quran says in this regard, “And this worldly life is not but diversion and amusement. And indeed, the home of the Hereafter—that is the [eternal] life, if only they knew.”2. The real measure of human progress and actions thus is to be seen in the light of the Quranic verse, “And that to your Lord is the finality”3.

It is illuminating to see a Quranic negative example related to human development in order to understand what should not be mistaken as human development. The Quran narrates the story of Qārūn, an affluent contemporary of Prophet Moses [as],

So Qārūn came out before his people in his adornment; those who desired the worldly life said, "Oh, would that we had like what was given to Qārūn; indeed, he is one of great fortune." But those who had been given knowledge said, "Woe to you! The reward of God is better for he who believes and does righteousness; And none are granted it except the patient."

 The Quran, verses 28:79–80.

God clearly establishes through these verses the true Islamic knowledge of development by defining the belief in God and righteous actions to be better and deserving of everlasting reward. Islamic development does not conflate needs with objectives and goals. While economic well-being is a need of all people, it is not the ultimate goal of human efforts. Islamic development is not about material accumulation or the freedom to consume. It entails the development of an ethical innate character (akhlāq) through the process of the purification of human souls (tazkiya), which is manifested externally through the correspondence of human actions with divine guidelines and internally through the rectification and purification of intrinsic human character traits.  

We can therefore begin to describe the ends (i.e., objectives) of the Islamic conception of development by describing seven interrelated overlapping concepts. In contrast to the secular worldview, human development entails freeing oneself of base desires and recognizing one’s servanthood before God (ʿubūdīya) and attaining a God-consciousness that can rein in selfish indulgences and actions that are harmful for oneself and society (taqwā). By attaining a high standard of ethical character (akhlāq) through the purification of human souls (tazkiya), human beings can deserve to be the vicegerents of God on earth through their attempts to perfect their servanthood before God (ʿubūdīya). 

Although new concepts such as sustainable development and human-development have recently been proposed, the true barrier in the Islamic worldview that can check human transgressions is God-consciousness (taqwā), which literally means guarding oneself against God’s displeasure. God describes in the Quran that the most noble person before God is the one with the most taqwā. By adorning oneself with these attributes, one will be able to scale the heights of excellence (iḥsān) and civilization (ʿumrān) and achieve true felicity, happiness, and welfare in this life and in the hereafter (saʿāda).

By subscribing to these notions of development, human beings can rise above the inhumane pursuit of selfish interests and create sound and harmonious societies while also earning the pleasure of God and escaping the illusion of those whose effort is lost in worldly life, while they think that they are doing well in work.”4

To read more on the seven overlapping ends of Islamic development, read our paper:  “The Ends of Development in Islam: Seven Overlapping Concepts”, J. Qadir, A. Zaman, Journal of Islamic Banking and Finance, Volume 35, No 3, 2018. http://islamicbanking.asia/wp-content/uploads/2017/10/July-Sept-2018.pdf
[Longer version]: “The Islamic Worldview and Development Ideals”, J. Qadir, Journal of Islamic Banking and Finance, Volume 35, Number 1, Jan–Mar 2018, pp 33–44. https://tinyurl.com/islamicdevelopment

Birth control in Islam: A study of the hadith on coitus interruptus

A hadith found in three places in Sahih al-Bukhari suggests that birth control is not recommended in Islam:

We asked (the Prophet PBUH) about it and he said, 'There is no harm if you do not do [coitus interruptus1], for if any soul (till the Day of Resurrection) is predestined to exist, it will exist."

Sahih al-Bukhari 4138

First, this hadith does not say that birth control is bad. It merely say that there is no harm in not using birth control.

This hadith, however, is not a very high-quality one due to its meager chain of narrators. Below is a diagram of all of the chains of the authentic versions of this hadith:

This hadith has only an 11.79% chance of authenticity, which is quite low. In my mathematical hadith verification methodology (which I discuss here), a hadith that falls between 10% and 20% is munkar (strange and unlikely to be true, but not clearly false and fabricated). A munkar hadith is not strong enough to act as a basis for establishing sunna (the tradition of the Prophet PBUH). For this reason, we cannot say with certainty that a negative view of birth control is part of Islam. In this case, the commonsense view should be used that birth control is a matter of personal choice.

Speeding up grep of a 12.4 GB text file

I am working on a vocabulary-building book for SAT and GRE students. Below is a picture of the provisional cover of the book:

In order to have a wide corpus of classical texts to find word usage examples, I downloaded a massive ebook collection from the Gutenberg project and merged all of the text files into one big file that reached 12.4 gigabytes in size. I then wrote a PHP script that used the grep utility to search through about 250 billion lines of text1 to find the word usages I needed.

Here is an example of the results for the word “taciturn”:

In order to find interesting examples, I use the following regular expression:

egrep -aRh  -B 20 -A 20 "\b(she|her|hers|his|he)\b.*taciturn" merged.txt

This finds usages of the word that start with a pronoun such as “she”. This helps find usages that occur mostly in novels, rather than other types of books (the Gutenberg collection contains many non-novel files, such as encyclopedias and legal works).

My first step toward speeding up the grep was to move the file to an old SSD I have that is attached to my desktop. The SSD supports up to 200 MB/second read speeds. This was not good enough, so I eventually moved it to my main Samsung SSD which has over 500 MB/second read speeds. Below is a screenshot of the iotop utility reporting a read speed of 447 M/s while grep is running:

My first idea to speed up the grep was to use GNU parallel or xargs, both of which allow grep to make use of multiple CPU cores. This was misguided since the limiting factor in this grep was not CPU usage but disk usage. Since my SSD is being maxed out, there is no point in adding more CPU cores to the task.

Using the following grep command, it took a little over 30 seconds to finish grepping the entire file once:

Here is the output for the time command which tells how long a command takes to finish:

One of the first suggestions I found is to prefix the command with LC_ALL=C, this tells grep to avoid searching through non-ANSI-C characters.

That seemed to make the grep very slightly faster:

Just to see what happens, I next used the fmt utility to reformat the file. The file currently is made up of short lines all separated by new lines. Using fmt, I changed it to having lines of 500 characters each. This was likely going to make the grep slower since it was going to match a lot more lines since the lines were going to be longer:

But on the upside, I was going to get a lot more results. The fmt command decreased the number of lines from 246 million to only 37 million:

But actually what happened when I did the next grep was that the grep time decreased to only 23 seconds:

I guess the reason is that grep has a lot fewer lines to go through.

Unfortunately it looked like fmt had corrupted the text. Here is an example:

I think the reason was that some (or most, or all) of the text files were using Windows-style newlines rather than Unix-style ones which was perhaps confusing fmt. So I used this command to convert all Windows-style newlines into spaces:

After that operation and running fmt again on the result, grepping again seems to result in non-corrupt results:

And:

I also looked for the corrupted passage above to see how it looked now:

So it all seems fine now.

As far as I know there is no way to speed up the grep significantly further unless I get a lot of RAM and do the grep on a ramdisk, or get a much faster SSD. Just out of curiosity I decided to try out changing the fmt command to make lines of 1500 characters each to see how that affects the grep:

That didn’t actually do anything to speed up the grep further: