Blog

Conflicts of Fitness: Islam, America, and Evolutionary Psychology

Get it on Amazon.com as a Kindle ebook or paperback.

Conflicts of Fitness: Islam, America, and Evolutionary Psychology by A.S. Amin is a highly original examination of the dynamics of gender and sexuality within Western societies on the one hand, and within Islamic societies on the other.

As someone who has been working on reconciling Islam and evolutionary theory and on developing a post-feminist theory of human sexual dynamics, I hardly expect most books to tell me anything I haven’t already heard or thought about, but this book manages it. It is a short and enjoyable read that sticks to the facts and does not often try to force an interpretation on them, which will make it agreeable to people coming from differing backgrounds and ideological currents.

The author’s main thesis is that different societies have different reproductive climates designed to maximize reproductive success. In a short-term climate, like that of most of the United States, human evolutionary instincts drive men to do their best to have sex with as many women as possible while not caring very much about a woman’s virginity and past sexual experiences. As for women, the climate drives them to display sexual receptivity through makeup, dress and manners designed to encourage men to think of them in sexual terms.

On the other hand, in a very-long-term climate like Saudi Arabia, men maximize reproductive success not by trying to have as many short-term relationships as possible, but by maximizing paternity confidence. Saudi Arabian seek virginal women so that they can be assured their children are theirs, and they go to extremes to ensure this; marrying very young women and preventing women from leaving the house, getting an education or a career.

This way of looking at the problem of women’s status in extremely conservative Muslim societies is a breath of fresh air from all of the moralistic or emotional treatments the subject has so far received on the hands of ideologically-driven intellectuals and commentators. It is also good to find another Muslim who can think of these matters in scientific and largely apolitical terms.

A reader of Conflicts of Fitness may wonder how a Muslim can write from an evolutionary perspective when Muslims do not generally accept the theory of evolution. Amin does not offer an explanation for this, focusing on his research topic without delving into this issue, leaving it to the readers to work it out. In my essay God, Evolution and Abiogenesis I explain how the Quran is compatible not only with evolution, but with abiogenesis as well.

Explaining Islam’s policy toward polygamy

Before reading this book, I had often thought of polygyny as a privilege granted men in order to deal with certain exceptional circumstances (such as having an infertile wife). Conflicts of Fitness explains that there is more to it than this, and that women, rather than men, are potentially the primary beneficiaries of polygyny:

  • If you have ten men and ten women, by allowing the most successful man to marry the two women, nine men are left to compete for the remaining eight women. These men will be forced to offer stronger commitment to these women in order to secure their hands in marriage, in this way creating a society where most relationships are highly committed.
  • Successful middle-aged men often strongly desire to use their wealth and success to build new families and have more children. In a monogamous society, such men are forced to divorce their current wives, or worse, cheat on them. In an Islamic society, a safe outlet is provided for these men, enabling them to keep their current wives (who, if divorced, would most likely be unable to marry again due to their old age), while also enabling them to create new families. While this is not ideal for the current wives, most would prefer it over being divorced. This also increases the options of younger women, since married men would compete for their hands in marriage. Polygyny is not a zero-sum game for women, and the overall benefits to women is almost certainly greater than the harm it does.

Most Western women and men empathize with the underdog when thinking of hypothetical situations, therefore they are unlikely to accept the above explanation, since they empathize with the poor woman who will suffer having to share her husband with another woman. The fact that she chooses this over divorce is not given attention since it goes against the “Islam is misogynistic” narrative.

For a Muslim who already believes in the Quran, the explanation is a good vindication of the policy, and it should help restrain scholars overeager to place strict restrictions on polygyny. In a society where marriage is by consent and where people are free to divorce whenever they want, polygyny will be self-balancing. Men will have to balance the fear of losing their present wife with their desire for a second one, meaning that the majority of men will be unlikely to abuse this right. My experience of Kurdish and Persian society proves this correct.

Explaining makeup

In a short-term reproductive climate, women signal their receptivity to short-term-style sexual relationships in various ways, one of which is makeup. One thing that makeup does is simulate the effects of sexual arousal:

It turns out that when a woman becomes sexually aroused, certain physiologic changes take place. Among these changes are dilation of the pupils and the blood vessels in the cheeks and lips.

The author refers to this facet of makeup-as-a-signal-of-sexual-receptivity in many places in the book. However, while this is highly informative, it is not the complete picture. Makeup also serves as an important axis for enabling women to get ahead of themselves and other women. Makeup enables a woman to enhance her apparent quality as a worthy mate by making herself look younger and healthier. In a long-term or somewhat-long-term climate, makeup helps a woman appear as a better substance compared to her competitors. This, however, runs the danger of sending the wrong signal, of appearing to be receptive to sexual advances, for this reason in a long-term climate, a woman has to walk a fine line between enhancing her looks (which helps her get the interest of more suitors wanting to marry her) and signalling sexual receptivity (which garners the attention of the wrong audience).

The generational gap in reproductive strategies

The author mentions that an important reason for the strife that so often exists between teenage girls and their parents regarding dress and makeup is a generational gap in reproductive strategies. The parents grew up in a climate that was more long-term-oriented than the present climate, and they want to enforce the mores of their outdated climate on their children, not realizing that the climate has changed, and that by preventing their daughter from dressing more skimpily or wearing more makeup or dating more freely, they are causing her to fall behind her peers. Immigrants, especially Muslims, bringing up children in the West suffer a similar conflict. What should be done to handle this problem? The author does not say.

Should Muslims submit to the new climate, admitting that laxer standards are needed for their children, or should they fight off the West and try to keep isolated?

The Muslim Westerner’s mindset toward the West’s short-term reproductive climate should not reactionary, it should instead be constructive. Muslim men and women, following the Quranic program, should live and marry and construct their own Western society that proudly rejects everything it considers inferior and harmful and happily embraces everything it considers beneficial. Instead of trying to live in an “intellectual ghetto”, as Tariq Ramadan calls it, they live in the center of the Western intellectual tradition, reforming it, critiquing its weaknesses, calling for betterment, and freely defining new ways of life, exactly the way the intellectual elite throughout the ages have always done, defining new ways of life for themselves often at odds with the wider society.

Approaching Muslim women

I have seen some Western non-Muslim men wonder how you go about approaching a Muslim woman (to see if she is interested in a relationship), since the way they dress often signals unapprochability. The answer is that you don’t approach Muslim women (at least not the vast majority). The author gives an evolutionary explanation for this. Muslim women seek long-term partners, which requires deep knowledge of the man before any contact is made. It is for this reason that parents, relatives and friends are often heavily involved in planning and executing marriages. Approaching a Muslim woman, telling her she is beautiful and that you find her really interesting will most likely upset and offend her, since you are offering her exactly what she does not want; a relationship based on a short-term sexual attraction, and because being seen talking to a random man can harm her reputation.

Westerners, and some liberal Muslims, think these facts show that Muslims are out of touch or backward, and that they must be “better-educated”, “liberated”, “integrated”, “assimilated” and a whole lot of other euphemisms referring to the belief that Muslims should stop being Muslims and act more like non-Muslims for their own good.

The Quran requires that Muslims implement long-term reproductive strategies in their lives, meaning that for Muslims to remain Muslims, short-term reproductive behaviors can never be normalized. A Muslim woman who has a PhD and is attending a conference is not going to respond positively to some non-Muslim man’s pick-up line no matter how well-educated and liberated she is, if she is a devout Muslim. This is because in effect the man is calling her to abandon her chosen way of life. For her, sexual relationships are long-term matters that require the critique and approval of her family, relatives and friends, since Islam teaches her to think of herself as a member of a community, and to respect the opinions of her relatives and the authority of her parents. If a man is interested in her, instead of approaching her directly, he does it in a manner that shows his respect for the Muslim community and her family, and that shows his long-term interest in her, by having a friend or relative approach a friend or relative of hers.

Of course, this is not always an option, sometimes a direct approach is the only one possible, for example for a Muslim man and woman studying at the same college but knowing nothing else about one another, and having no one to mediate for them.

Islam, women, careers and divorce

The book analyzes the significant relationship between reproductive climates and attitudes toward women having careers. In a short-term climate, men cannot be relied on as providers, since they are interested in independence and short-term sexual relationships. In a long-term climate, men can be relied on, since men have no option but to be providers, in order to be able to attract the love interest of women.

This means that in a short-term climate, a career can be essential to a woman’s survival, while in a long-term climate, it can be largely irrelevant.

Men who like to follow a short-term sexual strategy (having sexual access to many females without having to commit themselves) will have an incentive to promote women’s “liberation”. For such men, it can be frustrating to live in a society that limits the availability of women, and they may do what they can to bring about change, to discredit the “backward” patriarchs, to get women out of society’s protection and into their own hands.

In his analysis of Islamic thought as it applies to the topic, the author’s methods and ways of thought are close to mine, which was a pleasant surprise. He refers to some of my favorite scholars while also maintaining a critical eye toward their opinions. He makes many references to the UCLA professor Khaled Abou El Fadl, someone largely unknown to me until reading this book:

Reviewing many of the Qur’ānic verses used to justify women’s restricted access to divorce, he concludes that the full implications of these verses have not been fully considered and intimates his opinion that Islam gives women the same access to divorce as it does to men. However, Abou El Fadl seems somewhat troubled that his opinion is in disagreement with the majority of Muslim jurists throughout Islamic history. The question becomes, is the majority opinion the result of the unequivocal evidence found in the sources of Islamic law, or a manifestation of the reproductive climates in which those opinions were formulated?

A woman should have full rights to divorce, because ethically, this is almost certainly crucial for ensuring the fairness of the marriage system. A man is given a degree of authority over his wife in his household. To ensure that this authority does not lead to abuse and tyranny, a woman must always retain the right to leave. Preventing her from leaving is going to greatly reduce her bargaining power in the relationship. I also support the opinions of the Salafi scholars al-Albani and Ibn Baaz in requiring a formal procedure for a man to divorce his wife, requiring him to stay with her for one menstrual cycle without having sex before the divorce is considered official. I believe that allowing a man to perform a permanent triple divorce by uttering a sentence is a highly damaging and defeats many of the purposes of Islamic law.

Reproductive climates and the practice of fiqh

Fiqh refers to Islamic jurisprudence, the field of discovering the best possible practical applications for the teachings of the Quran and the Sunnah (the Prophet’s traditions ﷺ). One of the main theses of the book is that the reproductive climate affects the way men interpret Islamic principles.

According to Amin, in very-long-term climates like Saudi Arabia, paternity confidence is one of the prime directives in the minds of the jurists, so that they support nearly everything that can in some way restrict a woman’s freedom and make her a better reproductive object. Egyptians have a less long-term climate, so that their scholars are willing to make concessions to women’s freedom even if they acknowledge that in certain circumstances these granted privileges may lead to less paternity confidence.

Amin’s thesis is that reproductive climates affect the derivation of fiqh, leading to differing rulings (fatwas). This is one of the main conclusions of the book, that Muslim men prefer different interpretations of Islam based on their reproductive climates. To Saudi Muslim men, it is “obvious” that women should be restricted for everyone’s good, while to (cosmopolitan) Egyptian Muslim men, it is “obvious” that women should have more freedoms. A man’s reproductive strategy affects his values and makes him prioritize certain things over others, leading to a type of Islam that fits his own reproductive goals.

This scientific analysis of the derivation of fiqh is important and very much needed in order to separate what is truly Islamic from what is merely cultural within the rulings of the scholars. A new field can be launched, the (evolutionary) sociology of fiqh, that studies these matters.

The limitation of his evolutionary psychology approach is that it treats humans as genetic creatures, so that he studies how manifestations of genetically-driven instincts affect psychological behavior. To me this is only half of evolutionary psychology, although I know that many evolutionary psychologists limit themselves to this.

Humans are not genetic creatures, but genetic-cultural creatures, genes affect culture and culture affects genes. This adds a layer of complexity to human psychology that, if ignored, leads to incomplete theories. Thus the Egyptian toleration for less paternity confidence is not necessarily a consequence of the reproductive climate, it might be a cause of it. Perhaps the cultural appreciation of Egyptians for human rights led to a toleration for a shorter-term reproductive climate, so that this ideal was given priority over the concern for paternity confidence.

IQ is largely genetic (i.e. not cultural), but its consequence is a culture that appreciates various intangible ideals, whose consequence, in turn, is a re-interpretation of religion that tolerates a laxer reproductive climate, since this is more likely to achieve those ideals.

Having a high IQ does not mean that a person will be a nice, idealistic person. Rather, a high IQ population, after accepting certain teachings (Western/Christian philosophy, the Quran, Sufism), ends up becoming something of a humanist. A low IQ population, given the same teachings, will mostly focus on its form and ignore its content (ideals). Thus low IQ Muslims and Christians are often obsessed with appearances, socialization and ritual, while it is the high IQ Muslims and Christians who bother to read deeply into the texts.

It is, therefore, my hypothesis that when Islam is given to a high IQ population, the result is a humanist Islam, as is so well seen in cosmopolitan sections of Egypt. While when Islam is given to a low IQ population (Saudi Arabia, Afghanistan), the result is a focus on texts (naql, its extreme example being Wahhabism) and negligence toward the Quran’s principles.

While the author’s focus on reproductive concerns within the practice of fiqh is useful and enlightening, it is an incomplete view of the system. Genetics can lead to certain cultural (by “cultural”, I mean everything that’s not genetic) behaviors, which can then come back and influence reproductive behaviors, leading to highly complex feedback loops.

Dress codes for slave women

Amin mentions the fact that jurists have tolerated laxer dress codes for slave women compared to free women. According to his theory, this is a sign of the fact that since a slave woman is a short-term mate (more of an object of desire than reproduction), a short-term mindset toward her was tolerated, some jurists going as far as allowing her to show her breasts in public. Since paternity confidence was not a concern, the amount of skin a slave woman showed was not of much concern.

This behavior is also seen in Arab and Indo-Pakistani men living in the West who have short-term sexual relationships with Western women, but once they go on to seek a wife, they look for women from conservative families whose chastity and virginity can be relied on.

In both of the above situations, a double standard is maintained depending on the purpose of the woman in question. While the dress codes of slave women have no practical relevance to the modern practice of Islam, from a sociology of fiqh perspective, the matter might provide a useful insight into the thinking processes of jurists, showing how personal biases and reproductive goals affect the way Islamic sexual morality is interpreted.

It should, however, be noted that part of the justification for this double standard for the dress codes of free vs. slave women is verse 33:59 of the Quran:

O Prophet! Tell your wives, and your daughters, and the women of the believers, to lengthen their garments. That is more proper, so they will be recognized and not harassed. God is Forgiving and Merciful.

A common interpretation of “so they will be recognized” is that so that it will be known that they are free women and not slaves (as mentioned in al-Tabari’s tafseer). This clearly provides justification for tolerating different dress codes for different classes of women.

Another Persian scholar, al-Razi, interprets this verse as saying that virtuous women should dress more conservatively if there is a chance they will run into uncouth strangers, so that those strangers may recognize them as virtuous women and not women open to flirtation. This interpretation is more satisfactory in my opinion and prevents the use of the verse as justification for having double standards regarding different classes of women.

What does Islam select for?

All societies select for something. —Greg Cochran
All policy is eugenics.1 —Ikram Hawramani

Another relevant and highly interesting topic that is not covered by the book is the effects of reproductive climates on genes. For example, in a society that practices polygyny for long enough, the sex ratio will likely correct itself so that slightly more women than men will be born.

As I explain in my essay The Gene-Culture, any study of humans that entirely focuses on genes, or entirely focuses on culture, is going to be incomplete, because it focuses on one force while ignoring its equally important companion force.

A study of religious policies toward gender as entirely reproductive strategies, while highly informative, is incomplete. Thinking in terms of centuries and millennia, rather than in terms of individual generations and societies, will bring into focus the importance of religion as a gene-modifying force; Islamic culture will rewrite genes by selecting for certain characteristics and against others, the same way that genes (and reproductive strategies) affect our practice and interpretation of Islam, causing us to focus on certain aspects of Islam (and ignore others at times).

Islam rewards and promotes self-restraint, which is strongly associated with IQ, therefore high IQ people will get a more favorable treatment under Islam compared to lower IQ people who have difficulty with self-restraint. A woman who has a reputation for being “wild” is going to be passed up by men in favor of women who have a reputation for restraint. A man who does not have the long-term planning capacity to get a degree and a good career is going to be passed up by women in favor of men who have such capabilities.

Short-term climates create winner-take-all realities where a few attractive men get to have sex with a great number of women, as Conflicts of Fitness studies in detail, while the less sexually attractive and shy “nerdy” men are going to find it very difficult to find mates.

The Islamic system prevents this reality from existing. It punishes the womanizing “alpha males” by forcing them into long-term relationships where they have to make do with one, two or at most four women. And since many of these “alpha males” will not have the money to take care of too many women at the same time, they will often be forced to make do with just one or two women. This means that the rest of the women will not have access to these men, so that they are made to settle for less attractive men.

In an Islamic society, similar to Japanese society 100 years ago, the majority of men will be able to marry, including shy and nerdy ones who are totally incapable of using charisma to attract women. This fact of Islamic societies may be a significant contributor to the high fertility rates that devout Muslim societies enjoy.

Conclusion

Conflicts of Fitness is a worthy contribution in the best tradition of Western civilization, an effort to arrive at the truth without concern for political considerations.

The Last Mufti of Iranian Kurdistan (And a Critique of Political Islam)

This book is a beautiful tribute to the memory of Ahmad Moftizadeh, may God have mercy on him, containing a detailed and well-supported biography of the man and detailing his works and beliefs.

As someone whose (Sunni) family spent the late 80’s and most of the 90’s in Iranian Kurdistan, Ahmad Moftizadeh and Nasir Subhani, I have been hearing the names of these two men mentioned with love for as long as I can remember.

I am thankful that such a work was done by someone with a Western background, since the quality of the research is much higher than that of Eastern publications.

On the matter of politics, the author quotes Moftizadeh as saying:

He who embarks on a political project is the most likely to lose God’s way. Just take a look at the world.

The book provides further evidence of the futility of political Islam, something I have been studying for years, beginning with my study of Sayyid Qutb. Both men belong to a class of Islamists who believed that “good and sincere” men would be the perfect men to govern a country, ignoring the fatal flaw within this hypothesis; that there is no way to reliably find “good and sincere” men, and once supposedly “good and sincere” men are selected, there is no way to reliably make them continue being good and sincere. You always end up with a limited democracy where all kinds of insincere power-seekers make it through the system and gain power. From the history provided by The Last Mufti and clues elsewhere, it appears that there were many good and sincere men among the Shia leaders of the Iranian revolution, but within ten years the revolutionary government was ruled by some of the worst criminal scum to ever walk this earth.

The critical weakness within political Islam is that for it to work, everything must go perfectly:

  • Nearly everyone involved in the political movement must be sincere and not a power-seeker
  • The current government must respect the Islamists and allow them to peacefully take power, it must not persecute them and assassinate its leaders (Iran, Algeria, Iraqi Kurdistan and Egypt’s experience show just how naive this expectation is.)
  • Most of the country’s Muslims must support them, instead of the party becoming a cause for division and dislike among Muslims, where some people trust the party and others have good reasons not to trust it due to what they know about the party’s leadership and power structure.
  • It must be able to keep its moral integrity and attain success despite facing a thousand dirty tricks played by the opposition, which has no religion and no qualms about using every trick in the book to defeat them. If the opposition makes up lies, sets fire to its establishments, intimidates its members and uses the law to put hurdles in front of them, the Islamists, if they want to continue to follow Islam truly, must not counter these with their like.

The conclusion I have reached at the moment is that seeking power is like seeking wealth, and that no God-fearing Muslim or group of Muslims will self-elect themselves to do it. Power corrupts and attracts the corruptible. All Islamist political activism that is aimed at seeking power (such as by winning elections) is inherently un-Islamic because the chances of it doing good are far smaller than the chances of it doing evil:

  • The party can attract good and sincere people, only to have the government imprison and torture them, because the party makes them easy targets, and makes the powers that be uncomfortable. While if they had not acted politically, if they had remained ordinary civilians, they would have attracted dangerous attention far later in their careers, and any persecution would have befallen a far smaller group of people. The Muslim Brotherhood has probably caused the unintentional deaths of hundreds of thousands of innocent people who by today would have had millions of descendants who would be devout Muslim judges, journalists, writers and professionals, doing far more for Islam than the Brotherhood has done.
  • The party causes division among Muslims, because not everyone will want to join them, since people will judge the party by its members, and if they know any of its members to be insincere and corrupt (and the party is bound to attract such members), they will not want to have anything to do with the party. This is a cause for a highly dangerous and corrupting form of division in the community, as is highly evident in Iraqi Kurdistan’s Islamist scene.
  • The party can give Islam a bad name, as Iran’s Shia Islamists, Turkey’s Islamists and the Muslim Brotherhood have all done. Any evil they do reflects on Islam.
  • Terrorism is just a continuation of political Islam by other means.
  • When a foreign government wants to interfere with local politics for its own benefit, political groups including Islamist ones, are at the forefront of the tools it will consider using. Examples are Iranian support for Iraqi Kurdish Islamists, Turkish support for Syrian and Chechnian Islamists, Saudi and US support for various Islamists around the world including terrorist ones. The Islamist group can easily be entangled in international power plays and become nothing but a disposable tool that will have support for a while from a foreign entity, until the winds change and the foreign entity abandons them or starts to support their enemies against them.
  • Group think: Every political party eventually builds its own culture of “political correctness”, because there will be members who seek power, and one of the main ways of ensuring an increase in power and avoiding a loss in power is to fit in with everyone else. The least sincere and most toxic individuals will be the most eager to fit in, to create a large set of virtue-signalling behaviors that they follow to show their sincerity and dedication. This will cause others to respond in kind, and soon members of the party can be easily distinguished from the general population by their distinguishing manners, values and forms of speech developed within the party. This culture makes it difficult for sincere members to contribute through constructive criticism, because insincere power-seekers will act as if such criticism is defeatist, divisive and harms the interests of the party. The sincerest members can easily become marginalized within the party.

I am not against all Islamic political activism, however. The “good” form of Islamic political activism has one key attribute: It must never seek power. That is the key differentiator. We can criticize governments, we can publish exposés, we can refuse to do any evil the government apparatus asks us to do, we can try to influence politicians in a publicized manner (we must never scheme behind the scenes, as this too is a form of power-seeking, any dealings we have with politicians must be public, such as in the form of open letters, if it has to be secret, it is a way of befriending politicians and gaining power from it, and this causes it to turn into the “bad” type of political Islam), we can do everything we can to improve the world and to reduce tyranny, but none of this must include power-seeking.

This is the way of the Prophet, peace be upon him, while he was under the sovereignty of another power. He spoke the truth, but he never sought power. And his activities eventually made those in power uncomfortable, until they tried to kill him. What he did was not fight back, but immigrate to a different area.

If the Prophet, peace be upon him, had acted like today’s Islamists, using political organization and directly targeting Mecca’s power structure, he would have attracted the murderous attention of Mecca’s pagans far more quickly, perhaps within a few months. But by not doing this, by not being political, he was able to work for 13 years in Mecca. And once it became too dangerous for him to be there, he left for a different place.

Whether political Islam seeks or does not seek power, it will always risk persecution. But the point is that while Islamism spends lives needlessly (attracting murderous persecution quickly), the Prophet’s type of political activism does not spend lives needlessly.

Islamism tries to change the world in a top-down way; we gain power, then we will do good with it. The Prophet’s political activism, on the other hand, tries to change the world in a bottom-up manner; we work with the people and tell the truth, and this causes social and political change down the road.

The Prophet’s way is far more likely to be successful because:

  • It only attracts sincere people. People are not attracted to the movement for power, because it promises no gain in power. This means that like the Prophet’s circle, it will be free from the poisonous personalities that seem to exist in every Islamist party.
  • It does not attract quick and harsh persecution. It may attract it eventually, but it will have far more time to attract devoted followers.
  • It does not create division among the people, because there is no “my Islamist group” vs. “your Islamist group”. All Muslims are treated the same by it.
  • There is no danger of group think, because the group does not seek power. There are fewer insincere people wanting to increase their power and status through virtue-signalling.

At this moment, to me the facts that the power-seeking form of political Islam attracts insincere personalities, creates division and invites harsh persecution are sufficient to consider it a very foolish form of activism. The right way is the Prophet’s way, which is to never seek power, but to work with the people, helping them improve spiritually, while also criticizing tyranny and injustice, knowing that all power comes from God, and if the time is right, He will give it, if He wants.

In Islam, we neither seek wealth nor power. We act as if we already have these, not feeling poor or weak, but criticizing those in power bravely, because we know we are servants of the Most Rich and the Most Powerful. Like the Prophet, peace be upon him, our mission is to live the Quran while not being attached to wealth or power (because by the virtue of being God’s agents, we already have these). The seeking of wealth or power has nothing to do with our mission. Our mission is to be with the people, the poor, the enslaved, the voiceless, to teach them, to help them regain some hope and courage. Like the Prophet, we deal neither with wealth nor power unless these things are freely and openly given to us, in which case we follow his example in dealing with them.

One argument in favor of political Islam that Islamists mention is that Muslims need “organization” to better arrange their affairs. I agree, but we can have all the organization we need without seeking power, therefore this does not justify Islamism.

And if they say that Islamists are needed to protect the interests of the Muslims, the examples of the past century show that Islamists expose Muslims to far more persecution, torture and murder than they would be exposed to without them, therefore no, Muslims do not need this type of poisonous favor. Islamists have shown time and again that they are completely powerless at defending the interests of Muslims. Either they and their friends get imprisoned, tortured and assassinated en masse, or they gain power only to be bombed into oblivion by the latest bully on the world stage. They can say that ideally, if everything goes perfectly, they can do much good. Yes, but things never go ideally. Ideally communism can create great happiness and equality. Realistically, communism always creates police states, purges and starvation. In the same way, realistically, Islamism always creates far more evil than good despite the best intentions of its leaders.

It should be mentioned that Maktab Quran, Moftizadeh’s movement which continues to exist today, does not seek political power. However, it continues to act as something of a party, just not a political one, and this makes it suffer some of the issues Islamist parties suffer from (causing division, attracting persecution, having limited penetration among the population). They would have done much better if they had been nothing but a group of friends with each of them acting independently, becoming leaders in their own communities, and not naming themselves anything. They continue to be highly respected and to do good deeds, as they do not suffer from one important weakness of political parties, which is the promise of power attracting toxic personalities. Their lack of power-seeking ensures that only sincere people are attracted to their group.

Better than Maktab Quran would be a movement that is not a party, but a creed, and that has no organization (or need for one). It is an intellectual movement of educated and dedicated people acting together because they all follow the same creed, similar to a colony of ants which does not have central organization, but whose each part functions in tandem with the parts closest to it. And this already exists to some degree. Throughout the world, millions of Muslim intellectuals are developing a sense of belonging to a “mainstream”, loving its leaders and doing good works in their local communities. A new creed from a new Ghazali could help give direction to them and cure the Muslim world from the misguided, power-seeking form of political Islam.

The author provides the following interesting snippet on life in modern Tehran:

During the government of Mohammad Reza Khatami, the first so-called reformist president of the Islamic Republic, the author was an intern for Iran’s premier private consulting firm in Tehran. The firm’s management was educated and or raised in the West, while the majority of its employees had similar backgrounds, or came from a segment of Iran’s middle class that was educated and relatively progressive in its values. Headscarves were promptly removed in the office, flirting was common among the young employees, and everyone but the valet sipped tea throughout the day during the month of Ramadan. Even though most of these individuals voted for reformist candidates in the Islamic Republic’s elections, they disavowed allegiance to the system, and did not believe religion should play a role in government. For them, “reformism” ideally meant reforming Iran into a modern, Western-style secular country.

How to get a demo of the OneDrive File Picker JavaScript SDK to work on a local development server

After getting the Google Drive file picker working on the page of a project I’m working on within just a few hours, I was faced with the task of getting the OneDrive JavaScript Picker to work, which I almost abandoned because of Microsoft’s brain-dead documentation. After hours of watching Microsoft videos and piecing together documentation, I finally got it to work.

Through it all, I was often reminded of this good old joke:

A helicopter was flying around above Seattle when an electrical malfunction disabled all of the aircraft's electronic navigation and communications qquipment. Due to the clouds and haze, the pilot could not determine the helicopter's position and course to fly to the airport. The pilot saw a tall building, flew toward it, circled, drew a handwritten sign, and held it in the helicopter's window. The pilot's sign said "WHERE AM I?" in large letters. People in the tall building quickly responded to the aircraft, drew a large sign and held it in a building window. Their sign read: "YOU ARE IN A HELICOPTER." The pilot smiled, waved, looked at her map, determined the course to steer to SEATAC airport, and landed safely. After they were on the ground, the co-pilot asked the pilot how the "YOU ARE IN A HELICOPTER" sign helped determine their position. The pilot responded "I knew that had to be the Microsoft building because, like their technical support, online help and product documentation, the response they gave me was technically correct, but completely useless."

So here is how to actually get their amazing picker to work. I will assume you’ve already created your app in the App Portal.

1. Enabling SSL

You must first enable SSL on your demo server if you don’t have it. To do that quickly and for free, create a self-signed certificate and install it. Here is a guide on creating a self-signed SSL certificate.

When creating the certificate, don’t forget to use the Fully Qualified Domain Name for your local server. I use the fake domain myproject.dev as the domain name for my project, and put www.myproject.dev as the FQDN.

After you have generated your .key and .crt files, put them in /etc/ssl/crt/ or some such similar place.

With that done, create an SSL virtual host that uses the files you created, as follows (this is for a PHP website). The following code will have to be added wherever you have your VirtualHosts, it could be apache2.conf, or in a new file (such as ssl_vhost.conf) placed inside the sites-available directory (/etc/apache2/sites-available). If you put it in sites-available, you will have to run the command a2endsite /etc/apache2/sites-available/the_file_name_I_used.conf to enable the vhost.


ServerName default

## Vhost docroot
DocumentRoot "/var/www/html"
SSLEngine on
SSLCertificateFile /etc/ssl/crt/myproject.crt
SSLCertificateKeyFile /etc/ssl/crt/myproject.key

## Directories, there should at least be a declaration for /var/www/html

Options Indexes FollowSymlinks MultiViews
AllowOverride All
Require all granted


Require all granted
SetHandler proxy:fcgi://127.0.0.1:9000
## Logging
ErrorLog "/var/log/apache2/default_vhost_error.log"
ServerSignature Off
CustomLog "/var/log/apache2/default_vhost_access.log" combined

## Custom fragment

2. Creating the URI Redirect File

Somewhere in your file structure, for example in /var/www/html, create a file called onedrive_picker_redirect.html (or any other name you choose). The file has to load the OneDrive JavaScript SDK, it doesn’t have to do anything else. Here is the contents of the file (note that I’m using version 7.0 of the SDK, use whichever one you want to use for your project):

3. Add a link to the redirect file in the Microsoft App Portal

Put the full SSL link to the redirect file (such as https://www.myproject.dev/onedrive_picker_redirect.html) in the App portal, as shown in the screenshot below. You can keep the Logout URL blank.

4. Add the redirect file to the OneDrive picker launcher using the “advanced” parameter

We now get to the easy part. On the file from which you want to launch the picker, add the following code to launch the picker, or modify your existing code to match below. Notice the redirectUri parameter, which has to exactly match the one you used in step 3.

5. Go to your demo page using the HTTPS URL

The picker will not work if you try to launch it from a non-https page. If you were doing your development on a non-https URL earlier, you will now have to go to the same page under https. If earlier the page was at www.myproject.dev/onedrive_picker_demo.php, now go to https://www.myproject.dev/onedrive_picker_demo.php.

6. Now try it out

Now click the button to launch the picker. You will get a login prompt. After logging in, you will get the picker. Click on any file you want and click “Open”.

7. Look at the console

To verify that everything is working properly, open the console, and if you used the picker code above that I used, you should see an object that contains the information for the file you picked:

8. Go back to square one

Now that we have gotten Microsoft’s limitless supply of self-absorbed ineptitude out of the way, we can get to do some actual coding to interface with their horrible products and discover entirely new and never-before-experienced ways of suffering.

If you want to send the file info to a server to store it there, see my blog post on using PHP to download OneDrive files picked from the picker.

87 to Socrates

If you had a list of your ancestors and went back through them to your 87th ancestor, you will reach a man and woman who lived around the time Socrates was born.1

This chart below shows how unimportant we are. In 1000 years we will be just another number on someone else’s timeline. It also shows how important we are. If any of these men and women had failed to reproduce, the chain would have been broken and we wouldn’t exist today.

Recovering from a SAXParseException error with no data loss

I was working on a book I’m writing in LibreOffice Writer. I am using the docx format for the book, as I plan to finish its formatting in Microsoft Word, not knowing that LibreOffice Writer has a tendency to corrupt docx files. After closing and opening the file again, I received the following error:

I extracted the docx file (which is just a zip file, on Windows you can rename it to something.zip to extract or, while Ubuntu Linux allows you to extract it without renaming it). Found the document.xml file and opened it in VIM. I used the following command to jump to position 791513 on line 2:

791513l

That is the position number followed by a lowercase L.

I don’t see any error there, so LibreOffice Writer is not telling the truth, the error is not there. I opened document.xml in Chromium, but it reported the same wrong error position. Since the error message I received was saying the “w:cstheme” attribute was redefined, I decided to use regular expressions to search for it. I spent a stressful hour trying to learn VIM’s ridiculous regular expression syntax, but couldn’t figure it out.

In the end, I decided to use egrep instead. I ran the following command on the command line, which looks for a “w:cstheme” attribute that is not separated by a forward slash from antoher “w:cstheme” attribute, meaning it will find tags that have duplicate “w:cstheme” attributes, which is the error that LibreOffice Writer is reporting:

egrep "w:cstheme[^/]*w:cstheme" document.xml

And voila! It highlighted the error:

I copied the highlighted text (using ctrl+shift+c), opened document.xml again in VIM, and pasted the text in VIM’s seach bar (first press forward slash to open the search bar, then ctrl+shift+v to paste):

Pressing enter twice, it jumped right to the line and position (“column”) where the error was, which was actually position 817157:

If you understand html/xml, you will see the issue. To correct it, change this:

<w:rFonts w:eastAsia="Times New Roman" w:cs="Times New Roman" w:cstheme="majorBidi" w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cstheme="majorBidi"/>

To this, removing one of the unnecessary ‘w:cstheme=”majorbidi”‘ attributes:
<w:rFonts w:eastAsia="Times New Roman" w:cs="Times New Roman" w:cstheme="majorBidi" w:ascii="Times New Roman" w:hAnsi="Times New Roman" />

I searched again for the error in VIM, to make sure there were no repeated errors. I fixed multiple other occurrences of the error until I couldn’t find any more. Now, when opening the document.xml in Chromium, no error was reported:

This was a good sign. I made the mistake of compressing the parent folder of the document, renaming it to docx, and trying to open it. LibreOffice Writer said the document was corrupted and offered to fix it. It tried but failed. After a long time, I realized my error. I shouldn’t have compressed the parent folder, I should have compressed the files and folders inside the parent folder directly, as follows:

Above I have selected the files and folders that make up the docx document. I then right-clicked it and chose “Compress”, and chose the “zip” option. Below is the compressed file:

Next, I renamed the file to “occupy.docx_FILES.docx”:

Then I opened the file in LibreOffice Writer, and it worked!

To prevent this in the future, I will save the file in the ODF Text Document format (.odt), which is the native format used by LibreOffice that supposedly doesn’t suffer from this issue. Once the book is done, I will then save it as docx for use in Microsoft Word.

Islam, the Good Parts: Guaranteed Basic Income for Women

One thing that is rarely mentioned when speaking about Islam, even among Muslims, is that Muslim women don’t have to work. They can work if they want to, but they don’t have to if they don’t want to.

Islam makes it the duty of a woman’s male relatives to take care of her financially. Men have to provide for their sisters, mothers, wives and daughters. This is not merely an act of charity that men are encouraged to do. It is their legal duty. In a devout Muslim society, no woman can ever be homeless as long as she has a self-respecting male relative.

This provides a tremendous sense of freedom for women, including single women, who want to do creative work. They can focus on doing what they like, for example growing a small business or a writing career, while enjoying freedom from the stress of having to earn a living. Instead of having to work for potentially abusive employers or customers, they will have the option of only choosing jobs they like and leaving whenever they want.

In a country like the United States where two incomes are often necessary for a small family to maintain a dignified existence, it may seem unrealistic (and potentially unfair to men) for such a system to be implemented. How can a few men provide for so many people? The answer is Islam’s mechanisms for wealth-preservation and the encouragement of productive investment that ensure the super-wealthy can never get too financially powerful and collude to lower wages as has happened in the United States, and also ensures that a single stream of income is generally enough to feed a large family. These mechanisms, such as the ban on interest and the speculation tax, will  be discussed later on.

There is one flip side to the system that needs to be mentioned. When inheritance is distributed, women receive half as much as men. Since Islam puts all financial duties on men, it rewards them by giving them a larger share of inheritance, as men’s wealth is, after all, also partially women’s, as a man is obliged to take care of all of his close female relatives. Islam, however, doesn’t run away with the idea of a male-provider society by giving all inheritance to men, since not all men can be relied upon to be good and fair care-takers of women. It also doesn’t run away blindly with the idea of equality by giving men and women equal shares of inheritance when it has burdened men with heavier financial duties. It chooses a middle ground between the two extremes. It gives men more duties and a larger inheritance, while also providing a fall-back in case of unfair and undutiful male relatives by giving women a half-share of inheritance.

The virtues and evils of such a system can be debated. Why not give men and women equality in all things? Islam’s view is that men and women are not identical when it comes to all things. It assigns different rights and duties to each sex depending on their particular strengths and weaknesses.

The main issue at question here is this: Is a system that takes the differences between the sexes into account more likely or less likely to be fair, compared to a system that assumes men and women are exactly the same? Is it unimaginable that differentiating between the sexes can lead to a fairer system of rights and duties compared to turning a blind eye to all differences?

Feelings run high when this matter is discussed. The only way to resolve the matter is to undertake large-scale scientific studies to find out whether sex-aware systems lead to better societal outcomes compared to sex-blind systems.

Does it improve the mental health and happiness of women for them to know they will never have to work, and for them to know that there isn’t one chance in a million for them to ever be homeless (given the potentially dozens of male relatives eager and willing to take care of them if they lose their homes or jobs)?

Does it increase or decrease a woman’s chance of career advancement for her not to have to worry about making a living while she focuses on her studies or work? Or is it better to put her in debt and compel her to work as a waitress or bartender so that she can make ends meet while she studies or grows her small business as it is done in the United States?

If we cherry-pick facts and anecdotes, we can make either system look good or bad, but rigorous and empirical comparisons can be done. We can fully resolve the debate through decades of unbiased social research  that compares the outcomes of an Islamic system to competing systems.

Any comparison’s of an Islamic system compared to others will have to take account of IQ, as IQ is the most important factor in determining a population’s prosperity. India is much poorer than China, for example, not largely because of Hinduism versus Communism or Buddhism, but because India’s average IQ is in the mid-80’s, while China’s IQ is above 100. Populations of equal IQ tend to converge toward having the same level of prosperity. China is in the same league as South Korea and Japan when it comes to IQ, so it is practically certain that it will reach the same level of prosperity as these two countries within a decade or two. India, however, is in the same league as the Dominican Republic and Paraguay when it comes to IQ, so as it develops, it will converge toward the same level of prosperity as these two countries. Of course, different population sizes and natural resources will affect things, but not to a great degree, and the larger the populations of the countries that we are comparing, the smaller will the effect of natural resources become. To study this topic further, I recommend the book IQ and the Wealth of Nations by professors Richard Lynn and Tatu Vanhanen.

To have a fair comparison of an Islamic system compared to others, we can compare ethnic Japanese Muslims to ethnic Japanese non-Muslims in Japan (similar IQ, same country) and see how Islam’s system of rights and duties affects the Muslim population compared to the non-Muslim one. Are ethnic Japanese Muslim women happier, more productive, more mentally healthy compared ethnic Japanese non-Muslims, or not?

Unlike Communism, whose adherents can claim that it wasn’t properly implemented when it fails, the Islamic system can be scientifically tested. The requirement is to account for IQ and devoutness (a Muslim who uses credit cards, mortgages and for-profit insurance is not following Islam properly and should not be counted toward the Muslim side). Examples of devout Muslim populations that can be studied are the conservative Muslim middle classes of Egypt and Malaysia. Egypt’s conservative Muslim middle class can be compared to the middle classes of non-Muslim countries of similar IQ (low-80’s), such as Honduras, Nicaragua and the Dominican Republic. And as for Malaysia (IQ 92), we can compare the conservative Muslim middle class there with the middle classes of Greece, Ireland, Bulgaria and Lithuania.

Solve the invisible spaces problem in Word 2013

An annoying issue in Word 2013 is that sometimes the space key seems to stop working, until you press a non-space character, at which point Word deigns to show you both the space and non-space characters.

To solve the problem, press enter to create a new line, then go back to your line. The problem is caused by a bug in Word where having a page break or section break right after the line you are on prevents spaces from showing. Make sure there is a line (empty or not) below the line you are typing on, and the problem disappears.

How to export the entire sequence by default in Adobe Premiere Pro CS6

  1. Move the yellow playback marker far to the right, until it goes into the blank area and the preview window becomes black. If you are doing batch work, move the marker farther than any of your clips are going to be. For example, if you are exporting 1 minute videos, move the marker to the 2 minute mark.
  2. On the bar below the playback marker’s bar, find the right end of the selection bar and move it to the far left, so that there are 0 seconds selected. The left end of the selection marker should also be to the far left, obviously.
  3. That’s all. Now when exporting, Premiere will automatically select the entire sequence for export.

AWS Storage Historical Pricing and Future Projections

Some blogs are calling the recent price wars between cloud providers “a race to zero”. But this is the wrong way to think about it. As technology progresses, we simply need to start thinking in terms of larger units.

Here is a table of historical Amazon S3 prices:

Date $/GB/Month $/TB/Month
14-Mar-06 0.15 150
1-Nov-08 0.15 150
1-Nov-10 0.14 140
1-Feb-12 0.125 125
1-Dec-12 0.095 95
1-Feb-14 0.085 85
1-Apr-14 0.03 30

In terms of gigabytes the prices seem to be approaching zero. But in terms of terabytes, the prices are just barely starting to become reasonable. The linear projection below suggests that we will be using terabytes as our unit of choice when speaking of cloud storage until 2020 and later, when prices will start going below $1 per terabyte per month.

Some time after 2020, perhaps around 2025, we will start speaking in terms of petabytes per month.

Fire Phone folder where screenshots are stored

Using my Windows 7 computer to browse the Fire Phone’s files, I found the screenshots in the following folder:

Computer\Fire\Internal storage\Pictures\Screenshots

To take screenshots, you need to hold down the volume down and power buttons together. You will hear a sound and see an animation informing you that the screenshot was successfully taken.

Horoscopes and Islam

A Muslim should believe or read horoscopes or not? Because I saw a post that says the person who believes in horoscopes is a disbeliever.

Horoscopes go under the category of superstition, since there is no basis in science or religion for them. Therefore a well educated and intelligent Muslim should take them for what they are: Fancy-sounding nonsense that impress the gullible.

However, we should not be judgmental toward those who believe in horoscopes. Even though this is an obvious flaw in their faith, we ourselves may have greater flaws that are not so apparent. Those who take pleasure in attacking the obvious flaws of others almost certainly have similar or greater flaws themselves.

We shouldn’t be quick to say who is a believer and who is a disbeliever. We can say a person who is not thankful toward God is a disbeliever; but we all show unthankfulness toward God every now and then; therefore are we to say that we are all disbelievers? We should not pass final judgment on people, that is God’s job, not ours. A person who has a part of disbelief in him or her may also have many parts of belief and goodness that outweigh the disbelief.

List of 20,000 right-angled triangles with whole-number sides

Some mathematical investigations can benefit from having a handy list of right-angled triangles with whole number sides. We know of the common [a = 3,b = 4, c = 5] triangle often used to illustrate the Pythagorean theorem (5^2 = sqrt(3^2 + 4^2)), but sometimes we need more of these. For this reason I made the following lists, placed inside handy text files. They start from the smallest possible triangle (the [3,4,5] one) and iterate up.

List of 20,000 right-angled triangles with whole-number sides sorted by the smallest side (i.e. side a).

List of 20,000 right-angled triangles with whole-number sides sorted by the largest side (i.e. the hypotenuse or side c).

Mashing two regular expressions together in JavaScript on the fly

var pattern1 = /Aug/;
var pattern2 = /ust/;
var fullpattern = (new RegExp( (pattern1+'').replace(/^\/(.*)\/$/,'$1') + (pattern2+'').replace(/^\/(.*)\/$/,'$1') ));

Explanation:

  • pattern1+'' turns (“casts”) the regular expression object into a string.
  • .replace(/^\/(.*)\/$/,'$1') removes the beginning and ending slashes from the pattern
  • new RegExp() turns the resultant string into a regular expression object. There is no need to add back a regular expression delimiter (i.e. slashes usually) since the RegExp() function (“constructor”) adds the delimiter if it is lacking.
  • If you want the resultant expression to have a flag, for example i, you add it so: new RegExp(string,'i');
  • This code is quite unreadable and you might be doing yourself and others a kindness if you use a less clever method. To make it more readable, the technique can be wrapped in a function:
var rmash = function(reg1,reg2) {
var fullpattern = (new RegExp( (reg1+'').replace(/^\/(.*)\/$/,'$1') + (reg2+'').replace(/^\/(.*)\/$/,'$1') ));
return fullpattern;
};

var my_new_pattern = rmash(pattern1,pattern2);

Generalizing the mash function to handle an arbitrary number of regular expressions and flags is left as an exercise.

How to do long-running computations in JavaScript while avoiding the “maximum call stack size exceeded” error

The following program calculates the value of the series of the Basel Problem. The result is a number that starts with 1.644934. Like π, this sequence can go on forever, which means the program never exits. Without proper design, such a program runs into the maximum call stack size exceeded error, which is designed to prevent a program from using too much memory.

var cr = 1;
var total = 0;
var x = function() {

    total = total + (1/(cr*cr));

    
    if(! (cr % 20000)) {
        $('#t1').val(total);
        $('#t2').val(cr);
        setTimeout(x,0);
    }
    else {
        x();
    }
    cr++;

};
x(); //initial call to x().

The solution is to add a setTimeout call somewhere in the program before things get too close to exceeding the call stack. In the above program, cr is a counter variable that starts with 1 and increases by 1 for every iteration of the x function. Using the conditional if(! (cr % 20000)) allows the program to catch its breath every 20,000 iterations and empties the call stack. It checks whether cr is divisible by 20,000 without a remainder. If it is not, we do nothing and let the program run its course. But if is divisible without a remainer, it means we have reached the end of a 20,000 iteration run. When this happens, we output the value of the total and the cr variables to two textboxes, t1 and t2.

Next, instead of calling x() the normal way, we call it via setTimeout(x,0);. As you know, setTimeout is genearlly used to run a function after a certain amount of time has passed, which is why usually the second argument is non-zero. But in this case, we do not need any wait time. The fact that we are calling x() via setTimeout is what matters, as this breaks the flow of the program, allowing proper screen output of the variables and the infinite continuation of the program.

The program is extremely fast, doing 1 million iterations about every 2.4 seconds on my computer. The result (the value of total) is not perfectly accurate due to the limitations of JavaScript numbers. More accuracy can be had using an extended numbers library.

You may wonder why we cannot put all calls to x() inside a setTimeout(). The reason is that doing so prevents the JavaScript interpreter from optimizing the program, causing it to run extremely slowly (about 1000 iterations per second on my computer). Using the method above, we run the program in optimized blocks of 20,000 iterations (the first block is actually 19,999 iterations since cr starts from 1, but for simplicity I have said 20,000 throughout the article).

Using an object anonymously in JavaScript

var month = 'Jan'; //or another three-letter abbreviation

//After the following operation, proper_month will contain the string "January".
var proper_month = {'Jan':'January',
                              'Feb': 'February',
                              'Mar' : 'March',
                              'Apr' : 'April',
                              'May'   : 'May',
                              'Jun'  : 'June',
                              'Jul'  : 'July',
                              'Aug'   : 'August',
                              'Sep'  : 'September',
                              'Oct'   : 'October',
                              'Nov'   : 'November',
                              'Dec'   : 'December'
                             
                             }[month];

How to: Become wise

If you want to become wise, read 100 books that interest you. The books you choose to read can be about any topic and they can be of any quality, good or bad. The important thing is that you should find them interesting, because the fact that you find a book interesting means it contains information that is new1 to you (and thus it increases wisdom), because “interesting” simply means “something that provides new information to the brain”.

No book is going to solve all of your problems. Each book may make you a 1% wiser person. Thus if you want to become double as wise as you are now, you would have to read about 70 books. 100 books would be a safer number.

Some of the books you read will contain false information, because almost any book will contain some claims and assumptions that are false. But if you don’t give up and continue reading books one after another, as your knowledge increases, so will your awareness of what is true and what is false. Wisdom is simply a map of reality (accurate information about how things really are), and each book you read (even a simple story) tries to give you a small piece of the map. Some books will give you false pieces that do not describe anything that actually exists on the map. But as you read more books, your knowledge increases about the other pieces that surround the false piece, and thus you start to have an intuitive sense of what the false piece should actually look like, and thus you recognize the false piece for what it is: false. Recognition of the falsehood in itself increases your knowledge, for your brain can abstract the patterns of falsehood, and it can actually build a map of what falsehood itself looks like, and thus it will become increasingly hard for falsehoods to mislead you.

If you start to read a book that at first seems interesting, but eventually lose interest in it and start to find it boring and tiring, you should feel no qualms about abandoning the book and starting another. When this happens, it can be due to one of two things:

  1. The book does not contain anything that’s new to you, and thus your brain recognizes it as a repetition of things that you already know very well, and therefore you brain is asking you to stop wasting your time with the book.
  2. The book contains information that has too many prerequisites, and thus your brain is not equipped to handle the information. You should abandon the book now and return to it after reading many other books.

Spend a year doing this and at the end of it you may laugh at how unwise and biased you used to be a year ago. During your journey you would have picked up some new biases, therefore it is unwise to stop your journey. Continue reading books and these biases will be cleared up. You will never stop picking up biases, but their frequency will decrease as your wisdom increases, for biases have patterns of their own and the wise mind can learn to avoid many of them. This is why you find the wisest people to be those who are least ready to make final judgments on any topic–they are “open-minded”, knowing when they do not have enough information.

In most cases, when it comes to most topics, humans rarely have perfect knowledge, therefore the wisest often refuse to give final answers on anything or to give counsel freely to those who ask for it. They will speak about what they know, and refuse to delve into what they do not know.

Import and play your own audiobooks on the Amazon Fire Phone

[Update: I now recommend using these steps to install the Google Play Store (which does not “root” the device and does not cause any permanent changes), then buying the highly rated Listen Audiobook Player (which has up to 3x playback speed with pitch correction and a slider that shows your place in the book and how much is left–while taking playback speed into account) in the Play Store for $0.99. The entire process takes about 15 minutes.]

Amazon makes it impossible to import audiobooks into the Audible app, probably wanting you to buy all your stuff from them and under their control. I’d actually be more willing to use Audible if it let me import the many audiobooks I already own from other sources. Most Fire Phone audio apps are useless for audiobooks since they do not let you browse the audiobook’s files, instead treating the audiobook as a song album and and making a complete mess out of the order of the tracks. Another issue with music players is playback speed. I usually like to listen to audiobooks at double speed (and usually more if I am able to fully give the book my attention), but most music players I’ve tried on the Fire Phone do not have a playback speed feature.

I was almost losing hope that I would be able to get a proper audiobook experience out of the Fire Phone, until I happened on the Rocket Player App, which has almost all the required features for an audiobook player:

  1. It allows you to browse the files on the phone and keep the proper order of the tracks (while others players mess up the track order). If the track order is still messed up in Rocket Player, use a free and open-source Windows program called Mp3BookHelper (Project Page | Download Link) to rename the tracks (both file names and the Title ID3 tag) sequentially.
  2. It has a playback speed setting (after buying the $4 premium version of the app) with pitch correction. The playback speed can only go up to double speed, which is pretty good but I wish it could go up to four.
  3. It remembers your place in the book, even after closing the app (provided that you do not use the app to listen to other things, which is quite doable since there are many other apps optimized for music listening).

Steps for importing your own audiobooks on the Fire Phone and playing them using Rocket Player

  1. Install the free Rocket Player App, then upgrade it to the $4 premium version.
  2. Move your audiobook into a folder on your phone. You can use the USB cable or, if your laptop supports bluetooth, you can use that too, though USB is much faster.
  3. If you used the USB cable, unplug it, otherwise the audio player may not be able to see the new files.
  4. Tap the “Folders” tab in Rocket Player. Browse to the audiobook folder (but don’t go inside the folder). Tap the folder and hold, until a menu comes up. Press “Add to playlist” and create a new playlist. Now you can go to the “Playlists” tab to find the audiobook and play it.
  5. In the Rocket Player settings, you can find the “Playback speed” setting and change it to what you like.

Is reading the Quran better than listening to it?

The majority of scholars (such as Qatar’s Islamic Affairs Ministry, Ibn Baaz, and the UAE Islamic Affairs Ministry) do think that reading is better than listening, but they have no evidence for this except their own personal opinions and unauthentic sayings of the Prophet. To me reading a book or listening to it are the same thing. I listened to the Harry Potter and Lord of the Rings books (instead of reading them with my eyes), does this mean that I somehow understood or “benefited” less from the books than if I had read them?

I suffer from dry eyes and late at night when I read Quran, if my eyes start to feel bad, I switch to listening. Does this mean that God automatically drops my rewards because I decided to receive God’s word through my ears instead of my eyes?

To me, Islam is a religion based on logic, not magic. No good deed is magically better than another, and whether I decide to receive the Quran through my eyes or ears my reward depends on my effort and sacrifice (how much attention I give to the meaning and how much time I dedicate to it), not on some random eyes-are-better-than-ears prejudice.

Growth of CPU GFLOPS by year, with future projections

In Q1 2006, the fastest, most expensive CPU could do 12.421 GFLOPS on the Whetstone test. In Q4 2014, the fastest consumer CPU (Intel Core i7-5960X) can do 169.79 GFLOPS.

I added two trend lines to the chart. The green one is a linear trend line, showing that in January 2018 we will have a 200 GFLOPS CPU, which doesn’t sound like much, while the red exponential trend line promises 500 GFLOPS during the same period. The truth will likely be somewhere in between.

The latest CPU’s gains come from its 8 cores, therefore a better performance chart would only show single-thread improvements, since single-thread shows the true performance improvement per core and is a big bottleneck for many games and applications.

A quick single-thread comparison can be done between the Intel Core 2 Extreme X7900 (Q3 2007), which received a single-thread score of 968 on the PassMark test, and the Intel Core i7-2600K (Q1 2011), which received almost exactly double the single-threaded performance at 1943. It took Intel less than 4 years to double the performance of its highest-end consumer CPU. But three years later, the fastest CPU in single-threaded tests is the Intel Core i7-4790K with a score of 2532, meaning that in about four years Intel has only managed to gain a 30% performance improvement in single-threaded applications.

This is a big deal and shows the performance stagnation that gamers and professionals have been complaining about in recent years. If the next four years end up like the past four, in 2018 the fastest consumer CPU will only be 30% faster if no additional cores are added. The interpretation of Moore’s Law that promised a doubling of performance every 18 months has long been inaccurate.

Below is the data that I based the chart on the top on, taken from CPU reviews that featured the SiSoft Sandra Whetstone test.

 Quarter        GFLOPS
 10-Jan-06	12.421  
 10-Apr-06	15.703   
 10-Oct-06	33.797   
 10-Apr-07	37.693   
 10-Jul-07	26.7     
 10-Oct-07	44.4     
 10-Jan-08	44.2     
 10-Oct-08	62.879   
 10-Jan-09	66.5     
 10-Oct-09	55.9     
 10-Oct-10	67       
 10-Apr-11	83       
 10-Jul-11	91       
 10-Oct-11	121      
 10-Jan-12	136      
 10-Apr-12	93.2     
 10-Jul-12	126      
 10-Apr-13	93       
 10-Jul-13	135.4    
 10-Oct-14	169.79

Using one category page to show multiple categories in WordPress

[Update: There is probably never a good reason to do this. Instead, create a new category to hold the posts.]

Trying to show multiple categories in one loop is easily the hardest thing I’ve done in WordPress.

  1. First, create a container category where you want your multiple categories to be shown. Let’s call it the MultiCat category and give it the multicat slug. No posts are required to belong to this category, and if they do, it will have no benefit.
  2. Next, add this bit of code to functions.php of your theme. This is where we create a query variable which enables us to identify the multi-category page properly. Update the category slugs below to match the slugs of the categories you want to show together.
    function multi_cat_handler( $query ) {
        if ( $query->is_main_query() && $query->query["category_name"] == 'cat1-slug,cat2-slug,cat3-slug,cat4-slug' ) {
         $query->set("allish",'yes');
        }
    }
    add_action( 'pre_get_posts', 'multi_cat_handler' );
  3. Next, add this code to functions.php. Update multicat to the slug of your multiple categories category. Also update the other slugs as in the previous step.
    function alter_the_query_for_me( $request ) {
        $dummy_query = new WP_Query(); 
        $dummy_query->parse_query( $request );
    	  if($dummy_query->query['category_name'] == 'multicat') {
    		$request['category_name'] = 'cat1-slug,cat2-slug,cat3-slug,cat4-slug';
    	  }
        return $request;
    }
    add_filter( 'request', 'alter_the_query_for_me' );
  4. To display the h1 tag of the MultiCat category page properly, we use the following code:
    if(get_query_var('allish') == 'yes') {
    echo 'Title of the Multiple Categories Page';
    }
    else {
    echo 'Normal code that outputs category title';
    }

    If you do not do the above, when people go to the MultiCat category page, they will see a random title from one of the multiple categories you want to show on the page, which is not the behavior you want.

  5. Below is the main code that outputs your posts. The if clause at the top allows us to know we are on the multiple categories page (we cannot use other methods such as checking category ID, since that will return a random category’s ID from the multiple categories we want to show).
    
    
    
    
    
    
    
    Here lies the code that outputs your post content
    
    
    
    
    
    Here is the loop that outputs your normal categories
    
    
    

    The $args array contains the query we use to pull posts from the database. We are pulling posts from the categories with the IDs of 3, 4, 671 and 672. Notice that in Step 2 we used category slugs, while in this step we are using category IDs. They have to match, and order may matter.

That’s all.

Caveats

The RSS feed of the category page will be the RSS feed of one of the categories shown on the MultiCat page. This may be fixable through using RSS-specific filters, but in my case I had no need for RSS and did not try to find a fix.

Page 5 of 6
1 2 3 4 5 6