Fun, Tech Dribbles

Life of SE (Software Engineer)


The moment I implemented “IJob” interface on my Life’s base class, all my “friend” functions turned into “virtual” functions.

I didn’t want to at first, but when I tried to “override” those, I couldn’t.

It turned out, that the “class” Friendship is “sealed” and I cannot derive my LifeAfterJob class from it. :(

The only way I see is to create stubs for my Friend Functions and call them using some mocking framework such as FacebookMocks or SkypeMoq. The problem with this approach is that I have to hardcode their responses with a limited set (I am fine, How are You?, nothing special, and so on)

The sub routines like GetTogether() and EatOut() have been replaced with WorkLate() and TooTired().

If only I could call the garbage collector on objects like Boss, Timelines, and PerfomranceReview… I would have enough space in the Memory to “cache” “List<Jiggers>”

 

 

This post was originally shared at my Tumblr Blog

Standard
Fun, Pakistan

Advertising: Tips for making Pakistani television commercials


Originally posted on ImaanSheikh:

If you plan on pursuing a career in advertising in the country, there are a few golden tips none of the pros are going to teach you. As an expert in couchpotatership, I have spent quite some time in front of the telly and have been generous enough to list down these tips. They mainly apply to television commercials, however, you are free to use them anywhere.

I wish you a fruitful career in the world of advertising. You’re welcome.

1. Go to ridiculous lengths

So you say you’re really creative and you probably have some fresh concepts for your ads, but they are deemed mediocre. Why?

Shock factor.

Go Ripley’s Believe It Or Not on this shit. Do something you should not do. No one should. Ever. Shock your viewer.

Unfortunately, since you cannot fall at the feet of every potential consumer and beg them to buy your wares…

View original 1,718 more words

Standard
Pakistan

The Tangled Ropes


PakistanFlag

Islamic Republic of Pakistan has a unique society, perhaps the most interesting social setup for sociologists to study. The reason for it being so special is the fact that Pakistani society is a combination of various sub cultures and ethnicities. It started from world’s oldest civilization, the Indus Valley. It saw invasions from Aryans and Greek. The Persian and Pukhtoon Muslims attacked from the west one after another on the fertile lands of Punjab and Sindh. The Europeans came from thousands of miles away and setup colonies here. Due to all this Pakistani culture has many sub-cultures, colors of various races and languages mixed with the flavor of Islamic nationalism and modern democracy. Where all these combinations have made this society more colorful, it has also placed some stains on the fabric of society.

Pakistan, as a nation, is a developing country and consequently she faces a wide array of social problems: educational, economical, political, religious and a number of internal ethnic and linguistic conflicts. Pakistani society, as like every other society, is a collection of people living under certain constraints to aid each other’s life. The society is not just a sum of individuals; it is far more than that. Wherever there is a society there are social issues. Social issues, as defined on Wikipedia1, are “matters which directly or indirectly affect a person or many members of a society and are considered to be problems or controversies related to moral values”.

It is not to say that developed countries don’t have social problems but the fact which matters most in the case of Pakistan is that Pakistan is an economically weak country therefore its social setup, its norms, its culture, its religion and everything else is criticized and seen with a skeptical eye.

Every human has some values either personal or dictated by society. The combination of social and personal values creates ones personality and it is these values that dictate the actions taken by the individuals. Every human, in his heart, wants to be accepted by other people around him. In this lust of acceptance one has to fulfill the social contract. The society decides what to value and what to not. While there are a few societies that value education or bravery; Pakistani society like many other societies, value Power and Wealth. As Long Fellow once said:

“Money is honey, my little sunny

A rich man’s joke is always funny”

It is this lust of power and wealth that leads people to do immoral things. It is this lust, among various other reasons, that make people deviant. Corruption is one such act that enables people to gain power and wealth beyond their rights. Similarly there are a number of illnesses that inflict the Pakistani Society such as:

  • Illiteracy
  • Lawlessness
  • Poverty
  • Disunity
  • Inflation
  • Religious and Social Intolerance, Bigotry and Prejudice
  • Feudalism
  • Sectarianism
  • Cast System
  • Tribalism
  • Social Imbalance
  • Government System (both lack of appropriate laws and leaders)
  • Materialistic Classification
  • Ignorance of Human and Cultural Potential
  • Humans Right Violations:
    • Child Labor
    • Child Abuse
    • Human Trafficking
    • Gender discrimination

Let us briefly describe the extent of social issues and how much damaging these are. There are hundreds of thousands of pages available on the Internet which describes, in detail, almost all of the above listed problems along with statistics known as socioeconomic indicators. Here we present a few of them:

Since 1995, Transparency International has published an annual Corruption Perceptions Index (CPI) ordering the countries of the world according to “the degree to which corruption is perceived to exist among public officials and politicians”. The organization defines corruption as “the abuse of entrusted power for private gain”. Pakistan lists at number 143 out of 178 most corrupt countries. Remember that it is what people perceive and not some actual data. The people of Pakistan perceive their government to be very corrupt. [Wikipedia, childinfo]

History is witness that Corruption has ever been one of the main causes of downfall of nations. It has ever created disappointment among the communities where this evil prevails. The machinery of government gets rusted and it is quite obvious that Corruption decrease respect for law. This evil leads to revolution and military take over.

The literacy rate of Pakistan is also among the lowest in the world. Here the literate person is defined as a person who has age 15 and over and can read and write. Only 49.9% of total population is literate out of which 63% are men and 36% are women. Government of Pakistan spends merely 2.2% of GDP on education where as Government of Malaysia spends 25.2% of their GDP on Education. [Wikipedia]

According to the Federal Bureau of Statistics of Pakistan, 3.3 million out of 40 million children are working in various industries as child labor. The very recent issue of brutal murder of two brothers in Sialkot by a group of people is enough to shed some light on the lawlessness issue.  Poverty is on the rise as well where some 22.6% population is living under $1 a day [Wikipedia]

In the period of 1989-2010, 3423 people have lost their lives and 7320 people got badly injured in 2530 sectarian violence incidents. The country has witnessed multiple marshal laws resulting in destabilized economy and separation of a part of country. The list goes on and on but that is really not the point here.

To sum it all up corruption, poverty, material classification, inflation and social imbalance are direct result of lawlessness and lack of government system. Lack of government system affects lawlessness and vice versa. Poverty results in corruption and corruption has direct correlation with lawlessness.

All these social problems are inter-related and mostly depend on each other. Moreover, there are a few problems which are merely symptoms of the real cause. For example: feudalism is a product of the mentality of slavery, whereas, illiteracy is partly due to landlords not allowing education in their areas. Illiteracy is causing people to suffer at the hands of each other and most importantly at the hands of other countries and nations. As it turns out, it is a vicious circle that has not end. It is as complicated as strings tangled with each other with no ends in sight. If we apply force on it will get more tangled. The only way is to apply patience and slowly and gradually find the ends of the string and untangle it.

If we compare today’s society with that of pre-British rule, we’d find many social illnesses today that were almost non-existent. The reason for these illnesses is the fact that the people of this region were under British rule for more than a century. The British were a more developed society at the time they invaded this region. The combination of the master and slave societies as well as politics by the former masters have developed a number of problems such as materialistic classification, feudalism, linguistic and ethnic issues and so on.

Among other social problems, the classification of humans is also mentionable. This classification is a direct result of centuries of British rule in the subcontinent. We might have dealt with the physical slavery but our minds are still enslaved with the classification and the sense of being inferior to others. This inferiority complex leads to dissatisfaction and moral dilemma. The imprisonment of minds continued even after decades of independence. This imprisonment lead to the mind set of superiority and inferiority complex which is still evident in form of feudalism.

Like a medical anomaly in human body and a surgeon who has to deal with it, we need to understand the cause and effect relation of social issues and eliminate the causes therefore eliminating the effects as well. If there is a headache due to high blood pressure, it is wise to control high blood pressure instead of taking medicine for the headache. But first we have to distinguish between the causes and symptoms among social illnesses. The foremost problem that leads to other problems is illiteracy. It is this lacks of knowledge that makes people suffer. It is this lack of knowledge that makes people unable to understand their rights and responsibilities. It is this very illness that makes them ignorant towards their surroundings, the environment, and their rights and responsibilities which ultimately affects them as well as people around them.

If we are to eradicate these evils we need to work hard and smart. Working hard implies dealing with rigor and force and working smart means to tackle one problem at a time starting with the smallest of them for better results. We believe that it is more important to address small issues first and then work towards the extinction of the larger ones.

One thing is for certain. For all the problems that Pakistan is facing, there is no single silver bullet that can solve all the problems. All these problems are inter-related and can be solved with patients and hard work.

The first and foremost thing to do is to enlighten the people or educate the masses. This education must not be of ritualistic nature. We must educate, not only our youth but our grownups as well, in a fashion that not only teaches them how to read and write but also make them competent and united. The education should be of such nature that makes people think and realize the importance of social justice and fair play.

I think it is time for the literate people to recognize their role in the development of society. We should form circles of education where we can teach people around us. These circles could be formed easily with every educated person teaching people in his vicinity. We can also use Electronic and print media to bring about a positive change. This would bring a silent revolution in the country and in the society. As long as people won’t realize their duties towards the state and society, there will be chaos.

Although it is the responsibility of state to provide education to people, I think it is time to think out of the box. The government is mostly run by feudal and feudal can only survive as long as their subjects are illiterate and weak. Therefore they will not allow any scheme that would jeopardize their monopoly over the affairs of state.

Merit must be the number one priority of Pakistani nation because Merit based society is absolutely necessary for better future.  Once the problem of illiteracy is dealt with, there will be very few problems left in the society to deal with. Feudalism has a simple solution. The one applied in India by Jawaharlal Nehru. But to apply the same in Pakistan we need to form a stable and functioning government.

Instead of believing in bookish theories, we must do something practical to kill these evils. We will have to make a new government, which should be very much sincere to public. This new government should send those people in administration that can really know and settle the problems of public. Different kinds of department should be established to correct the social issues. Then minds of the people can be changed by moral values. Morality should be an inevitable part of education. Lastly there should be an exemplary punishment of those who are responsible for creating such evils. Political parties, N.G.Os and national media can play very important role to root out this evil. Remember William Golding saying:

“Man produces evil as bee produces honey.”

To conclude we can say that if we want to make progress in our country and to eliminate the evils of our society, it is our duty to act and act smart. Napoleon has said: “Nothing is Impossible”. Let us try to understand what Long Fellow says:

“Lives of all great men remind us

We can make our lives sublime

And, departing, leaving behind us

Foot prints on the sand of time”

This society needs a revolution. The choice is ours whether we want a silent one of a bloody one.

Standard
Pakistan

Quaid-e-Azam, Muhammad Ali Jinnah


But what lifts great leaders above others? In his book “Reflections on Leadership”, former US President Richard M. Nixon quotes Charles de Gaulle’s remark that

“Nothing great is done without great men, and these are great because they willed it.”

Great leadership is a unique form of art requiring both force and vision to an extraordinary degree.

The more one reads about the life and times of Quaid-i-Azam Muhammad Ali Jinnah the more one is struck by the fact just how very great a leader he was. He was a colossus, a man of iron will and unimpeachable integrity, a constitutionalist to the core, whose unyielding determination in the face of seemingly insurmountable odds resulted in the creation of Pakistan. There is no other leader in history of whom it can be said that he created a new country.

Muhammad Ali Jinnah was

“the recipient of a devotion and loyalty seldom accorded to a man.”

This was the glowing tribute that the President Truman of the United States paid to the Quaid-i-Azam. According to Allama Iqbal, Jinnah was

“the only Muslim in India to whom the community had a right to look up for safe guidance.”

Aziz Baig a top ranking writer and journalist says in his admire book Pakistan Faces India:

“With the fire and faith of a Lincon, the courage and conviction of a Napoleon, the shrewdness and statesmanship of Disraeli, Jinnah rose like a mountain which over showed his worst detractors.”

It was by his unflinching devotion and sincerity of spirit that he was able to wrench freedom from the unwilling hands of the Hindus and British.

Quaid-i-Azam was a man of lofty character. All his life as a leader of the Muslims not for once did he exaggerated a situation in order to elicit a favorable political or social response. His love for truth governed his conduct. He spoke what he meant and never resorted to those underhand means which politicians generally employ to hoodwink the masses. His approach to a situation was always methodical and rational. He steered clear of emotion and based his thought and action on realistic principles. Mrs. Sarojini Naidu has rightly remarked:

“He was pre-eminently rational and practical, discreet and dispassionate in his acceptance of life.”

Quaid-i-Azam honesty, integrity and argumentative skill were admired by all those who did not see eye to eye with him in political matters. Sir Stafford Cripps who arrived in undivided India in 1946 to negotiate with the congress and Muslim league leaders regarding the political future of India was pronounced pro-congressite. His motives could not escape Jinnah’s penetrating intelligence. He described him

“as a man of the highest probity and honor; difficult to negotiate with, for the very reason that he was so determined in his purpose.”

Field Marshall Sir Claude Auchinleck said of Jinnah,

“I admired him; his tenacity and tremendous personality – his inexorable determination.”

Apart from being a man of outstanding character, he was endowed with a piercing intellectual vision. No other Muslim in his time could visualize the plight of the Muslims in case the British left the subcontinent in the hands of the dominating congress party. He could perceive the Banya designs that they did not have any sincere desire to promote the welfare of Muslims but were determined to dominate those who had ruled over them from the very first day of their entry into the sub-continent. But for Jinnah’s astuteness and foresight, the Hindus would have succeeded in turning the tables on the Muslims of India. Therefore, he decided to lead and organize the Muslims not because he had any personal ambition but because the Muslim nation stood in need of a leader who could guide it sincerely at that critical juncture of time and protect it efficiently against the evil designs of Hindus and the positively unsympathetic attitude while working for the Muslim League he was not aiming at the projection of his personal image but was selflessly working for the attainment of Pakistan so that the Muslims of the Subcontinent could have a country which they could call their own. He thus succeeded in rescuing his nation from slavery and servitude.

Jinnah’s faith in himself was incredible. You must have read the story of his reply to the judge who said to him: “Mr. Jinnah remember that you are not addressing a third class magistrate.” Jinnah answered, “My Lord, allow me to warn you that you are not addressing a third-class pleader.”

In accomplishing the task he had taken upon himself on the morrow of Pakistan’s birth, Jinnah, to quote Symonds “had worked himself to death, but had contributed more than any other man to Pakistan’s survival.” He died on September 11, 1948. To quote Lord Pathic Lawrence, secretary of state for India (1945-47), who had headed the cabinet Mission in 1946,

“Gandhi died by the hands of an assassin, Jinnah died by his devotion to Pakistan.”

But I deem it wise to say heroes like him never die. Do they?

Anonymous Author

Standard
Pakistan

Corruption


Shakespeare has said:

“What a piece of work is man! How noble in reason. How infinite in faculty form and in moving; how express and admirable. In action how like an angle, in apprehension how like a God; The beauty of the world, the paragon of animals.”

In these lines Shakespeare has beautifully exalted man but the same man is facing many problems created by man. Centuries ago when man entered into “New Stone Age” form “Old Stone Age” man shows his bestial and barbarian nature in certain walks of life. He is responsible for creating evils like Corruption. Pope rightly says:

“What man has done for man.”

Today when man has touched the surface of moon and the world itself has become a global village, the evils of Corruption have spread in the society of man. With the changing time Corruption has become one of the most horrible problems all over the world, especially in the third world countries like Pakistan.
At the very outset we must accept wholeheartedly that the evil of Corruption weakens the basic foundation of nation. This evil not only demoralizes one’s nations but also becomes the cause of entire destruction in the long run. When people are under the pressure of Corruption their minds cannot be further utilized for the development of the country. People feel insecurity and keep thinking about it all the time. Corruption no doubt spreads discontentment in the society and ultimately a nation’s good image gets spoiled in the world. If it is not properly checked, judicial, moral and economic system of the nation is destroyed. William Golding rightly says:

“Man produces evil as bee produces honey.”

The main causes of Corruption are illiteracy, poverty and wrong economic policies of the government. Unfortunately majority of our people is uneducated and on the other hand one education is not professional. Lack of social and economic justice is also responsible for increasing Corruption. Sometimes the injustice compels the people to do something wrong. When people will not be given their rights, people will raise their voices, weapons and means to compensate their hurt feelings. Lastly, in a nutshell, temptation for wealth and lust for power have given more dimension to Corruption. Now materialism has gone into the very depth of man’s veins and thus materialism is spreading Corruption in the society in a large scale. Now people believed what Long Fellow has said:

“Money is honey, my little sunny
A rich man’s joke is always funny”

History is witness that Corruption has ever been one of the main causes of downfall of nations. It has ever created disappointment among the communities where this evil prevails. The machinery of government gets rusted and it quite obvious that Corruption decrease respect for law. This evil leads to revolution and military take over. Any nation cannot bear revolution and military take-over for a long time. We can remove this evil from the society if we believe what R.W.Emerson has said:

“Not gold but only men can make
A people great and strong
Man who
Stands fast and suffer long”

If we want to root out this evil, then a complete change of political, social and economic system is necessary. Worn-out and out-dated methods of removing evils like Corruption should be left now. Instead of believing in bookish theories, we must do something practical to kill this evil. We will have to make a new government, which should be very much sincere to public. This new government should send those people in administration that can really know and settle the problems of public. Different kinds of department should be established to wipe out the evil of Corruption. Then minds of the people can be changed by moral values. Morality should be an inevitable part of education. Lastly there should be an exemplary punishment of those who are responsible for creating this evil. Political parties, N.G.Os and national media can play very important role to root out this evil.
To conclude we can say that if we want to make progress in our country, it is our duty to co-operate with the government to eliminate this evil. Napoleon has said: “Nothing is Impossible”. Let us try to understand what Long Fellow says:

“Lives of all great men remind us
We can make our lives sublime
And, departing, leaving behind us
Foot prints on the sand of time”

Anonymous Author.

Standard
Tech Dribbles

SEO: Frequently Asked Questions


SEO or Search Engine Optimization is a hot term these days. I have tried to cover it in kind of FAQ.

What is a search engine?
Search engines help people find relevant information on the Internet. Major search engines (Google, MSN, Yahoo etc) maintain huge databases of web sites that users can search by typing in some text.

Why is search engine placement important?
The vast majority of Internet users find new web sites by using a search engine. And a position within the top 20 listings of a major search engine tremendously increases traffic to a web site. On the other hand if you are willing to advertise your site, it’s very expensive.

What is Search Engine optimization?
Search engine optimization or SEO, means to improve your listing in search engines.
High listing means more traffic and more traffic means more income.

How to improve listing in search engine?
Different engines have different algorithm to search and list and they usually change algorithm frequently to make sure the user specifically gets what they want.
Some of the various factors that search engines consider are:

Page related

  • Format, placement and content of the title tag
  • Keyword frequency, weight, prominence and proximity
  • Use of the meta description tag
  • Use of ALT tags
  • Use of comment tags
  • Use of keywords in URL names
  • Alphabetical placement

Site Related

  • Link popularity
  • Click popularity
  • Themes
  • Overall site design

What are Web Directories?
Directories are often confused with search engines, but actually they’re completely different. Instead of using spiders to crawl the web, directories such as Yahoo! and Open Directory Project have real people who review and index their links. They also require web sites to adhere to rigid guidelines in order to be included in their indexes. As a result, directories tend to contain a comparatively small number of high-quality links.

The factors that influence search engine rankings simply don’t apply to directory rankings. Instead, directory editors look at the quality of a site: its functionality, content and design. It means that webmasters hoping to see their sites listed on directories have to use very different strategies as compared for search engine placement.
What search engines don’t like?
It is extremely important to know what search engines don’t want. Otherwise, your perfectly optimized site may not be indexed and could even be blacklisted. Therefore, when you learn about factors that influence search engine rankings, you should also learn which tactics to avoid.
Spam: The following techniques are considered Spam

  • Meta refresh tags
  • Invisible text and overuse of tiny text
  • Irrelevant keywords in the title and meta tags
  • Excessive repetition of keywords
  • Overuse of mirror sites (same sites that point to different URLs)
  • Submitting too many pages in one day
  • Identical or nearly identical pages
  • Submitting to an inappropriate category (for directories)
  • Link farms
  • Frames, Dynamic contents And Flash intros: Although search engines won’t penalize for the use of frames, dynamic content and multimedia files, they will have difficulty indexing them. The items are the following:
  • Text in graphics (use ALT tags)
  • Pages that require registration, cookies or passwords
  • XML
  • Java applets
  • Acrobat files (PDF), except Google
  • Dynamic content (URLs with “?” in them), except Google, Altavista, FAST and Inktomi
  • Multimedia files (Flash, Shockwave, streaming video, Silverlight)

These are some of the basic questions and which I have answered. To be honest SEO is a topic can’t be covered easily.

Standard
Tech Dribbles

Improve Your Site’s Ranking in Search Engines


Following are the guidelines to improve listing of your website at any search engine:

  • Use site design elements to improve your search engine positioning
  • Understand how search engines work
  • Know what factors influence search engine rankings
  • Improve your site’s search rankings in other ways
  • Avoid Spam
  1. The design of website is very important factor for both, users and search engines or directories.
  2. To understand the work of search engines You may need to understand specifically each search engine. But understanding Google would be sufficient enough.
  3. The factors which influence search engine rankings are the following:
    1. Design: Your site’s design plays a major role in the user’s decision to either stick around or continue surfing. Graphics, layout, load time, fonts and ease of navigation can all influence the user. To craft a site that retains visitors, make it fast, clean and pleasant.
    2. Keywords: Most techniques to improve your search engine rankings have one thing in common — keywords. Choosing appropriate keywords is extremely important. Keywords are what lead search engine users to your site.
    3. Theme: A theme is defined by search engines as a common topic throughout the site. In an effort to provide their users with more relevant information, search engines developed sophisticated technology that “extracts” site’s themes. This technology allows results to be more focused on the topic searched for. Think of themes as your most important keywords used consistently throughout the site.
    4. Site Popularity: With click popularity and stickiness DirectHit claims to allow users, rather than search engines or directory editors, to organize search results.
      1. Click Popularity: It is a measure of the number of clicks received by each site in a search engine’s results page.
      2. Stickiness: It is a measure of the amount of time a user spends at a site. It’s calculated according to the time that elapses between each of the user’s clicks on the search engine’s results page.
    5. Link Popularity: Link popularity is much more than a measure of how many links point to a site. Search engines use far more sophisticated formulas to gauge how popular sites are. Therefore, developing quality links is more important than ever. And a growing number of search engines use link popularity in their ranking algorithms.
  4. The other ways to improve search ranking are very difficult but important which include paying attention to what your competitors are doing. Analyze their high-scoring pages and use their techniques.
  5. To avoid spam you need to learn what tactics each search engine considers spam and avoid using them, other wise the site may get banned.
Standard