Friday, October 29, 2010

bibalex new DAR site

I have been working for a while in Bibalex digital book new site, here is a sample embedded book from the new site.



The book site provides users with online access to bibalex out of copyright books as well as a limited preview of copyrighted books.

You can sign up and enjoy new features like annotation tools which includes highlighting text, underlining text and adding stick notes in a certain position in a book.

the release version of the site is http://dar.bibalex.org/

Wednesday, January 23, 2008

Calculating Muslims' Prayers Times

Calculating Muslims' Prayers Times

I thought how to mathematically compute prayer times? Then I found that calculations of prayers times are more complex than I imagined.

Do you think that Douhr at 1 JAN 2005 is at the same time of 1 JAN 2008 for the same location?
Do you think that prayer times are the same for locations of the same longitude for the same date?

Are there any parameters other than date and location that could be taken into account when calculating prayers times?
What about prayers times for locations near poles where day can be as long as months?

Let's start by Douhr:

Douhr starts after midday. Computation of Douhr time depends on the location and the date:

L is longitude of the location in degrees.
EQT is equation of time.

Z is Douhr time in hours.


Since Time zone and L are constant over time i.e. depends only on location, the only time varying element is EQT equation of time which is defined as the difference between Local Apparent Time and Mean Solar Time in minutes. Time measured from sundial is the Local Apparent time while Mean Solar time is that of a clock. This difference arose from the fact that the earth's orbit around sun isn't a circle, but an ellipse. Other reason is the angle of obliquity which is the angle between that the plane of the Equator and the plane of the Earth's orbit around the sun.

Variation of EQT over the year

You can notice that there are 4 days of zero EQT Apr 15, Jun 14, Sep 2 and Dec 25.

Accurate calculation of EQT depends on the Julian day which a count of days since Jan 1 4713 BC. Some EQT graphs are inverted, simply add EQT to equation of Z instead of subtraction.

A good approximation of Equation of time:




EQT =
229.18*(0.000075+0.001868*cos(rads) - 0.032077*sin(rads) - 0.014615*cos(2*rads) - 0.040849*sin(2*rads))
This computation depends only on the day of year thus it's accurate only near 2005.

Fajr and Isha:

Fajr and Isha depend on Duhr as follows:

Fajr = Duhr – Tw(Ө)
Isha = Duhr + Tw(Ө)
Tw(Ө) is the period from noon till a twilight angle Ө.


Twilight: earth's atmosphere scatters sun light. In the absence of atmosphere on earth there would be no sunlight after sunset and before sunrise. So, Twilight causes gradual decrease of sunlight.
Twilight angle is the angle between line reaching sun's center and the horizon. Sun's center must be below it.

Greater twilight angle leads to earlier Fajr and later Isha.

This table represents conventions used to choose twilight angle

Convention Fajr Angle
Isha Angle
Leva Research Institute, Qom, Iran 16 14
University of Islamic Sciences, Karachi 18 18
Islamic Society of North America (ISNA), USA 15 15
Muslim World League (MWL) 18 17

Umm al-Qura, Makkah, Saudi Arabia

19 90 mins after Maghrib
Egyptian General Authority of Survey 19.5 17.5

To imagine twilight go to seaside at sunset and observe the sun gradually disappears , when you see the center of the sun at the horizon level , then the twilight angle is just near 0. Now the sun disappears and still sunlight is observable, that's twilight. Twilight ends when no sunlight is seen. The same can be done at sunrise.

Twilight before sunrise

Tw(Ө) is the period from noon till a twilight angle Ө:

Where lat is latitude of the position.
D is declination angle.


Calculation of D depends on location and Julian date.
Other approximation for Declination angle is:




D =
0.006918 - 0.399912*cos(rads) + 0.070257*sin(rads) - 0.006758*cos(2*rads) + 0.000907*sin(2*rads) - 0.002697*cos(3*rads) + 0.00148*sin(3*rads)

Variation of declination angle over the year

Sunrise (Shrook) and Sunset (Maghrib):

Similar to Fajr and Isha but with twilight angle of 0.8333.

Sunrise = Duhr – Tw(0.8333)
Sunset = Duhr + Tw(0.8333)

Sometimes more accurate measures can be obtained by taking into account height above sea level.

Where H is height above sea level in meters.

Asr:

According to Shafii, Hanbaly and Maliky mathab Asr starts when the length of an object's shadow equals the its length plus the length of its shadow at noon. While to Hanafi mathab Asr starts when the length of an object's shadow equals twice its length plus the length of its shadow at noon.
So ,

Asr = Z + offset
Where Mathab = 1 for Shafaii and 2 for Hanafi.

Summary:

To compute prayer times we need:
  1. Know the location (latitude - longitude), time zone and date.
  2. Compute Julian day, equation of time and declination angle.
  3. Start by Douhr.
  4. Then, compute Maghrib and sunrise.
  5. After that, compute Fajr and Isha using appropriate convention.
  6. Finally, compute Asr according to desired mathab.
Try to work out these calculations by hand.


References:

Some astronomical facts:
http://www.astronomicalfacts.com/article.html
The real helpful and correct source about prayer times.
http://www.ummah.net/astronomy/saltime/
Julian day and Equation of time calculator Javascript! Get its source to know method of calculation!
http://www.go.ednet.ns.ca/~larry/orbits/jsjdetst.html
Declination angle, sunrise, sunset PHP calculations step by step!
http://users.electromagnetic.net/bu/astro/iyf-calc.php

Tuesday, January 1, 2008

100 things we didn't know last year

100 things we didn't know last year



The bbc has a weekly tradition called "10 things we didn't know last week" to highlight some interesting and unexpected news and posts every week. Also other annually "100 things we didn't know last year" to highlight 100 things from the weekly ones.

The weekly 10 things can be always viewed at:

http://www.bbc.co.uk/blogs/magazinemonitor/10_things/


The 100 things we didn't know last year 2007 at:

http://www.bbc.co.uk/blogs/magazinemonitor/2008/01/100_things_we_didnt_know_last_3.shtml

These are some highlights of the last year:

  1. Saddam Hussein's codename while in US custody in 2004/5 was "Victor".
  2. Only about half of China's population can speak the national language, Mandarin.
  3. Serving anything more than tea and biscuits at a political meeting is an offence called "treating" and punishable by a year in prison or an unlimited fine, under the the Representation of the People Act 1893.
  4. Denmark is the happiest country in Europe; Italy the unhappiest. (The UK was 9th out of 15.)
  5. The secret to happiness is accepting misery.
  6. Nearly seven out of 10 (69%) of adults are still in touch with at least one childhood friend.
  7. CDs were nearly called mini-racks.
  8. The brain can turn down its ability to see in order to listen to complex sounds like music.
  9. Adults use maths skills 14 times daily on average and literacy skills 23 times a day.
  10. In Ethiopia the start of the year 2000 was celebrated in September.

And these are some shots from last years:

  1. The = sign was invented by 16th Century Welsh mathematician Robert Recorde, who was fed up with writing "is equal to" in his equations. He chose the two lines because "noe 2 thynges can be moare equalle".
  2. "Restaurant" is the most mis-spelled word in search engines.
  3. Cyclist Lance Armstrong's heart is almost a third larger than the average man's.
  4. It takes 75kg of raw materials to make a mobile phone.
  5. Bill Gates does not have an iPod.
  6. It takes less energy to import a tomato from Spain than to grow them in this country because of the artificial heat needed, according to Defra.
  7. The day when most suicides occurred in the UK between 1993 and 2002 was 1 January, 2000.
  8. You are 176 times more likely to be murdered than to win the National Lottery.
  9. Bill Clinton sent just two e-mails while he was president.
  10. Bill Clinton revealed in his autobiography that he didn't learn to ride a bike properly until he was 22.
  11. It's 30 years since the world's first barcode was used. It was on a 10-pack of Wrigley's Juicy Fruit at a supermarket in Ohio. The gum is now an exhibit in the Smithsonian Museum in Washington DC.
  12. Hexakosioihexekontahexaphobiacs is the term for people who fear the number 666.
  13. In America it's possible to subpoena a dog.
  14. Poets die young... "On average, poets lived 62 years, playwrights 63 years, novelists 66 years and non-fiction writers lived 68 years," according to California State University's James Kaufman.
  15. The Mona Lisa used to hang on the wall of Napoleon’s bedroom.
  16. The word "time" is the most common noun in the English language, according to the latest Oxford dictionary.
  17. In the 1960s, the CIA used to watch Mission Impossible to get ideas about spying.

And don't forget delay jitter is the variance of delay.

Last years 100 things:

http://www.bbc.co.uk/blogs/magazinemonitor/2006/12/100_things_we_didnt_know_last_2.shtml

http://news.bbc.co.uk/1/hi/magazine/4566526.stm

http://news.bbc.co.uk/1/hi/magazine/4134329.stm

Tuesday, December 18, 2007

Remember when.......

كل سنه و إنتم طيبين


Do you remember nice days when there were no computers?

Remember when.......

A computer was something on TV
from a science fiction show of note
a window was something you hated to clean
And ram was the cousin of a goat

Meg was the name of a girl,
And gig was your middle finger upright.
Now they all mean different things,
And that really mega bytes!

An application was for employment
a program was a TV show
a cursor used profanity
a keyboard was a piano

Memory was something that you lost with age
a cd was a bank account
and if you had a 3.5" floppy
you hoped nobody found out

Log on was adding wood to the fire
hard drive was a long trip on the road
a mouse pad was where a mouse lived
and a backup happened to your commode

Cut you did with a pocket knife
paste you did with glue
a web was a spider's home
and a virus was the flu

I guess I'll stick to my pad and paper
and the memory in my head
I hear nobody's been killed in a computer crash
but when it happens, they will wish they were dead.




Friday, October 12, 2007

TV typewriter, A TV and a Typewriter

TV typewriter, A TV and a Typewriter

From the historic stories which shows ingenuity and loyalty of a hacker is this one:

One poor MIT hacker had a motorbike accident and broke his leg. He stayed in hospital for a while. During this period two of his friends brought him a terminal and a modem to use his computer from the hospital.

When they went to the hospital they were stopped by the guard saying that it’s not permitted to bring terminals to the hospital, permitted things are: tape players, TVs, typewriters, radios … while computer terminals are not allowed.

They didn’t give up and came the next day and a guard stopped them again and asked them what are they carrying. They answered a TV typewriter. When the guard investigated the devices, they showed him that each character typed on the typewriter appears on the TV -terminal- instead of paper. Finally the guard said “A TV is all right, a typewriter is all right ... okay, take it on in!"

TV typewriters are real! But not that stated in the story. They are video terminals which display typed characters on a TV and they are connected to a keyboard. Low cost designs were available from 1973, invented by Don Lancaster and published in TV Typewriter Cookbook.

Tuesday, December 26, 2006

Microsoft Shares Your Pain

1% of bugs caused 50% of all incredible system errors.

Microsoft's error reporting system has reduced about 80% of system –as they say- errors which encouraged them to make a new way of error reporting.

Microsoft has evolved a new way of customer feedback system. The idea is that Microsoft knows how pain customers suffer when a failure happens in any of their systems. So, Microsoft's employees must share pain with customers.

Thus, WSYP project or We Share Your Pain. WSYP was developed by Microsoft team in United Kingdom. This project claims that Microsoft can discover which programmer who wrote the piece of code which is responsible for this failure. Then, cause him a physical pain. This is done by a special Aeron chair. So, instead of seeing a message of Send Error Report Don't Send the user will see a message of Share Pain Don't Share. Then the customer will happily choose one of the 3 options for punishing this programmer. And see a live video of the programmer sharing pain with him.

Option 1: Micro-Stun option

Electric shocks are generated through the chair arm sleeves.

Option 2: Micro-Impact option

The back of the chair releases back and thrusts forward into the person sitting, into the chair.

Option 3: Micro-Jab option

Watch it in the video.

There is also an ejection option to eject the programmers who have commutative serious bugs out of Microsoft.

Share and Don't Share message box.

Live video so that customers see the programmer cause their system to fail being punished with the selected option.

Micro stun in action

Ejection mechanism after serious errors

The video and the presentation can be found at:

http://www.microsoft.com/uk/technet/itsshowtime/sessionh.aspx?videoid=9999

A very interesting video

It's interesting to see how Microsoft feels customers' pains.
I have the video it's about 20MB




Microsoft believes that this system will reduce system errors massively.

And I think by know you don't care about being employed at Microsoft.

Friday, December 8, 2006

The first bug

The first bug


Do you what's the first bug or where did the term "Bug" come from?


In 1945 and during the world war II Grace Murray Hopper and a team at the Harvard University were working on Mark II Aiken Relay Calculator.

This primitive computer was facing problems and matters were getting worth till they discovered the problem. It was a moth! A 2-inch moth was trapped at relay #70. The team used ordinary tweezers to remove that moth.

This photo is the log file left by the team.

Last line in this photo: First actual case of bug being found.


They said that they had “debugged” the machine. Thus they used “bug” to describe their problem.


Grace Murray Hopper (1906-1992) was an admiral at the American navy forces. The term “Bug” cannot be related to Grace Hopper because it was used before she used it. She made it popular. So this case didn’t introduce this term. “Bugs” was used during World War II to describe problems in radars. It was also during Thomas Edison's life to mean an industrial defect.


In days of telegraphy tapers need to send dots and dashes of Morse code. And there were the newer, semi-automatic keyers that would send a string of dots automatically. These semi-automatic keyers were called "bugs". These semi-automatic keyers require skilled operators. Or if you are not experienced you would send garbled Morse code.

Bugs and quotes:

  • Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it? (Brian Kernighan)

  • When you say: "I wrote a program that crashed Windows", people just stare at you blankly and say: "Hey, I got those with the system -- for free." (Linus Torvalds)

  • Every program starts off with bugs. Many programs end up with bugs as well. There are two corollaries to this: first, you must test all your programs straight away. And second, there's no point in losing your temper every time they don't work.

  • There are no significant bugs in our released software that any significant number of users want fixed. (Bill Gates) have you any comment??

  • The only man who never makes mistakes is the man who never does anything. (Theodore Roosevelt)

  • Of all my programming bugs, 80% are syntax errors. Of the remaining 20%, 80% are trivial logical errors. Of the remaining 4%, 80% are pointer errors. And the remaining 0.8% are hard. (Marc Donner)

  • Sometimes it pays to stay in bed in Monday, rather than spending the rest of the week debugging Monday's code. (Dan Salomon)

So do you know where “Bugs” originated from?
I don’t know.

But it seems that Grace Murray Hopper case is the first actual bug found.



Monday, October 2, 2006

How to hunt an elephant ?

I wasn't planning to make a series of how to do things but it was a nice coincidence to get this interesting article from Byte magazine.

How to place the right person in the right place?

This is done by:

Sending him to Africa hunting for an elephant and observing his behavior.

Computer scientists:

Use the following algorithm:

1. Go to Africa.

2. Start at the Cape of Good Hope.
/* A rocky headland on the Atlantic coast of South Africa */

3. Work northward in an orderly manner, traversing the continent alternately east and west until you get to Cairo,

4. During each traverse pass,

      • Catch each animal seen.

      • Compare each animal caught to a known elephant.

      • Stop when a match is detected.

This algorithm is used to describe a test data that is designed to ensure that an algorithm is working properly.

Now I will leave you with other various jobs.

"Taken from Byte magazine September 1989"

Professional programmers: Know that this algorithm may not terminate so; they place an elephant in Cairo first then apply this algorithm.

MS-DOS support people: will not bother to hunt elephants in the first place, because everyone knows that you can’t fit an elephant into 640K -memory barrier-.

Mainframe operating system designers: will all hunt the same elephant, and all claim credit for the kill on the grounds that each was working on a virtual elephant.

Software salespeople: ship the first thing they catch and write up an invoice for an elephant.

Hardware salespeople: catch rabbits, paint them grey, and sell them as desktop “elephants.”

Engineers: hunt elephants by catching grey animals at random and stopping when any one of them weighs within +/- 15 percent of any previously observed elephant.

Economists: don’t hunt elephants, but they believe that if elephants are paid enough then they will hunt themselves.

Statisticians: hunt the first animal they see N times and call it an elephant.

Politicians: don’t hunt elephants; they will share the elephants that you catch with the people who voted for them.

Database administrators do not need to go out and capture elephants when they can retrieve them simply with an ad hoc query: SELECT * FROM AFRICAN_CRITTERS 2 WHERE CRITTER_TYPE = 'TERRESTRIAL' 3 AND SIZE = 'LARGE' 4 AND COLOR = 'GRAY' 5 AND TRUNK = 'YES' 6 AND ODOR IS NOT NULL;

Systems integration engineers are not so concerned with hunting elephants as with creating a seamless interface between the elephants and their environment.

For other jobs:

http://homepage.eircom.net/~nobyrne/elephant.htm

Saturday, September 16, 2006

How to ask a question?

How to ask a question?

This article describes briefly the steps you must follow to ask a question to a mail group or forum. If you are sending a mail to our groups then we are simpler than these steps, you are using step #5 in before you send a question. Use these steps when you send a question to TAs and other mail groups or forums.

Before you send a question,

Do the following in the same order:

  1. Search archives and FAQs
  2. Use search engines.
  3. Read a manual or book or help for your tool.
  4. Find answer by try or experiment.
  5. Ask a friend.

Prepare your question:

  1. Show that you have done last steps and you failed, this proves that you are not lazy.
  2. Show your steps in trying to solve the question.
  3. Try to surround the problem, i.e. try to get the problem in the smallest block.
  4. Describe your environment, e.g. operating system, compiler, others.
  5. Identify yourself.
  6. Compilers and other tools are trusted or to some extend so; don’t assume a bug in them.

When you ask:

  1. Choose the most relevant community to ask.
  2. Use a meaningful, exciting subject that attracts people to read. Don’t simply use “I need help”, “I got error” as subject.
  3. Try to be clear, write a question in a careful way, free of spelling and grammatical mistakes.
  4. Give all information and only information needed. Don’t waste time by describing your design which will not affect the problem.
  5. Don’t let people ask you again about details.
  6. Don’t send you guess instead try your guess yourself if it doesn’t work wait for a reply and send then your guess.
  7. Send questions in easily accessible format. Use standard fonts. You know problems of character encoding.

After getting an answer:

  1. Tell the replier if his answer fixed your problem or not.
  2. Send a small delicate thanks reply for the person wasted his time for you.
  3. You may send a report of the problem and steps in solving it.
  4. Prevent others from following the same steps in solving that problem, I mean reduce their efforts.

Finally smart question attract repliers to answer. Also, new idea sounds well. If you got no reply then, don’t panic may be repliers have no answer. And remember Ask the right question to get the right answer.

Links:

http://support.microsoft.com/kb/q555375

http://www.catb.org/~esr/faqs/smart-questions.html

Thursday, August 17, 2006

Common programmers' personality

Before;

A computer programmer may have a character different from a normal person. Oh! I am sorry, he is a normal person but, I mean a person at other work.
Note: This article doesn't reflect my personal opinion but some statistics collected on software programmers especially engineers.

Common programmers’ character:


The following personality is common among programmers:
  1. Can concentrate 12-16 hours at a time.
  2. When interrupted responds violently.
  3. Use only his head and hands.
  4. Less adaptive and have small social activities. Even concerned with computer. e.g.: chat, mail groups, forums, etc.
  5. Quiet serious and shy.
  6. Practical and logical.
  7. Low motivation towards management responsibilities.
  8. Loyalty to the profession rather than the employer.
  9. Optimism regarding time estimates.
This personality traits was applied to programmers despite their particular work(system analysis, design testers ,etc..).

MBTI Results for Software Developers

A common mean of categorizing personality was developed by Katherine Briggs and Isabel Briggs Meyers and is called the Meyers-Briggs.
Table -1- Personality Type of MBTI test
















Extraversion
  1. Expressive, Process by talking
  2. Speak before they think
  3. Need contact

Introversion

  1. Can’t process while anyone is talking
  2. Think before they speak
  3. Need time alone
Sensing
  1. Observant
  2. Experiment
  3. Attention to detail

Intuition

  1. Imaginative
  2. Theory
  3. Bored by detail

Thinking
  1. Practical
  2. Objective
  3. Being right

Feeling

  1. Personal
  2. Sympathetic
  3. Values and feelings

Judging

  1. Scheduling
  2. Love to make plans and stick to them
  3. Hate to change them
Preceving
  1. Probing
  2. Can’t stand plans
  3. More flexible


Two large studies have found that the most common personality type for software developers is ISTJ (introversion, sensing, thinking, and judging)
  • Introverts are more interested in the inner world of ideas. Not oriented towards people.(54%)
  • The sensing person focuses on known facts, concrete data, and experience. Not concepts and theories.(57%)
  • The thinker makes decisions based on objective analysis and logic and never relies on his emotions.(81%)
  • The judging person prefers order and control, not possibilities and flexibility.(54%)

A try to analyze these results

May be reasons to this character is education. Programmers are highly educated and almost got pressured.

Software programming career

About 60% of software developers have a Bachelor's degree or more.

Programming job is highly rated in terms of salary, working conditions (air conditioned well lighted offices) job security (almost no risk).

A study at IBM found that the average programmer spends only about 30 percent of the time working alone. The rest is spent working with teammates, with customers, and on interactive activities.

Challenging projects extend programmer’s capabilities, test his limits and apply practices. A challenging project may take from 2 weeks to years. Challenging projects generally done lonely.

A programmer can sacrifice his life to programming challenge especially during 20s. This fact bec0mes harder to justify when he marries and gets children move into their 30s, 40s, and 50s.
As he grows older. He relies more on working smart than on working hard. Software developers will become increasingly interested in the practices that allow them to complete their projects as promised and still be home in time for dinner(only dinner). They become interested more in software engineering professionalism.
Table -2- Percent of Software Developers Education in U.S





















High school graduate or equivalent or less10
Some college, no degree21
Associate's degree10
Bachelor's degree45
Graduate degree14


































Table -3- Worldwide Software developers grow
1950100
196010,000
1970100,000
19802,000,000
19907,000,000
200010,000,000
201014,000,000
202021,000,000

Table -2- shows education of software developers’ ratios in U.S.
While Table -3- shows population of software developers from 1960 to 2020

After;

Do you think this article applies to you??

Links:

http://cs.anu.edu.au/~Ian.Barnes/research/slides.html

A research done by Ian Barnes from The Australian National University on personality type and software development


http://www.eng.monash.edu.au/uicee/worldtransactions/WorldTransAbstractsVo1No2/17_Capretz14.pdf

A comparison between the personalities of software engineers students and engineers in general. Above statistics were done on software engineers not students.

Monday, July 17, 2006

A computer scientist


An English mathematician ,mechanical engineer and computer scientist who designed the first true digital computer. He spent most of his life building his mechanical computer. He built his computer to overcome the problems of high human calculations and slow rate.


How can a mechanical computer be a digital one? You may think that wheels and gears can represent and manage digits.


This machine -Difference engine- has a fantastic architecture that is similar to modern computers. Data and program memories were separated. And operations were instruction based. It had a control unit and can make conditional jumps. It has time signals and separate I/O unit.


He also designed a printer with variable column and row length and programmable output formatting.


After that he designed a more complex machine -Analytical engine- that can be programed by punched cards. This machine was also intended to have several operations such as branching, and looping.


A young lady Ada Lovelance the daughter of the famed British poet Lord Byron was hired to write software for this computer. She was of few people who knew lot about the Analytical engine. Ada is regarded as the world's first programmer. The programming language Ada® in 1979 is named after her.


This scientist is Charles Babbage 1791 - 1871 who a crater on moon -Babbage crater- and Charles Babbage Institute in United State were named after him. The science fiction novel The Difference Engine refers to him. He was elected as the fellow of royal society at 1816.


References and farther reading:

http://en.wikipedia.org/wiki/Charles_Babbage
http://www-history.mcs.st-andrews.ac.uk/~history/Mathematicians/Babbage.html
http://ei.cs.vt.edu/~history/Babbage.html



Saturday, June 3, 2006

Making of BMW e46 3 Series

This video is of my favorite car.

It isn't about exciting features of this car nor racing or driving comfort ability.

It's about manufacturing of this car or simply making of BMW.

So, you can take a tour inside BMW factories starting with metal-sheets cutting and shaping till last performance testing.

My notice is how workers are cheerful doing their work. Will we enjoy our work?

Now I will leave you with the video. Hope you enjoy it.





If you have any difficulties in buffering this video just wait for few minutes.

I may send it to you. It’s about 22 minutes. Or you can have instructions on how to download it.

Friday, May 19, 2006

The Third Culture

Science and Art and "The Third Culture"


Computers -since invented- have been an interesting tool for all. We mean now artists and scientists. This gave great opportunity for both to interact with each other. Artists are interested in great technologies and discoveries made by their mates (scientists). While Scientists are inspires by humanities and great meaning given by artists. So we have two cultures Science and Art. This will evolve the third culture.

We now will define the word science as the study of physical and experimental issues. So a scientist is a person who studies or teaches science.

While art is defined as beautiful things or a skill acquired to a person. It may also be the meanings of words, colors, pictures, nature, many things.

So the third culture tries to tie both Art and science.

Science fiction is an example of this third culture. Here the writer or the poet knows much abut science and art. But, he can use some words outside their context such as "black hole". This is never wrong. It never bothers scientists.

If Science and Art share the same problem, the main difference between them will disappear and will be only the style or the way of solving the problem.

Links:

http://www.edge.org/3rd_culture/
http://vv.arts.ucla.edu/publications/publications/00-01/ThirdCulture/ThirdCulture.htm

Wednesday, May 10, 2006

Hackers' folklore ”Story of Mel”

Hackers' folklore


This piece of folklore ”Story of Mel” was written by Ed Nather in 1980 for his friend Mel Kaye a true programmer credited with doing "the bulk of the programming" for the Royal McBee LGP-30 drum-memory computer in the 1950s.

Real Programmers write in FORTRAN

Maybe they do now,
in this decadent era of
Lite beer, hand calculators, and "user-friendly" software
but back in the Good Old Days,
when the term "software" sounded funny
and Real Computers were made out of drums and vacuum tubes,
Real Programmers wrote in machine code.
Not FORTRAN. Not RATFOR. Not, even, assembly language.
Machine Code.
Raw, unadorned, inscrutable hexadecimal numbers.
Directly.

Lest a whole new generation of programmers
grow up in ignorance of this glorious past,
I feel duty-bound to describe,
as best I can through the generation gap,
how a Real Programmer wrote code.
I'll call him Mel,
because that was his name.


As you see the author was fascinated by the old beautiful difficult days of programming where no compilers even assemblers. All programmers had to write their programs in machine language doing computations manually.

Then he starts to introduce his friend Mel a real programmer who he met in Royal McBee Computer Corp. Well the author Ed Nather was hired to write a FORTRAN compiler and Mel didn’t approve this as he said: "If a program can't rewrite its own code", he asked, "what good is it?"

This story is now regarded as one of the most famous pieces of hacker folklore.

Read the complete story:

http://www.cs.utah.edu/~elb/folklore/mel.html

Monday, May 1, 2006

Find out the Blind Spot

Find out the Blind Spot


Each of your eyes receives a different picture from the other. And the brain collects each of the pictures received by the 2 eyes and merges them into single 3 dimension picture which you see.

What happens if you receive only one picture?

Try this: I think you are in front of the computer about 50 cm. Close your right eye and concentrate on the cross mark in the picture below you see it and the black ball.
Now move slowly towards the screen and observe.


You will notice that at about 30 cm the black ball disappears.

Now what happens?

Each eye has a blind spot in the retina (The retina is a thin layer of cells at the back of the eyeball). This blind spot contains no photoreceptors (cells which receive the light).Thus, preventing the complete picture from getting to the brain.

So, Why is the Blind spot ?

This design allows a good blood supply close to the retina to both nourish the photoreceptors and help metabolize debris that accumulates there.

The other eye fill this black spot in most cases and even if the other eye doesn’t provide useful information the brain has mechanisms to fill in the hole. This filling in is why you see the white background.

Thanks god for great creation.

Read more:

http://serendip.brynmawr.edu/bb/blindspot1.html

http://serendip.brynmawr.edu/bb/blindspot2.html

http://www.exploratorium.edu/snacks/cheshire_cat.html

http://en.wikipedia.org/wiki/Blind_spot_(vision)

Monday, April 24, 2006

Errors & Bugs

Errors & Bugs

Absolutely all of us face errors in writing programs (Compilation and runtime and others). Some give up some make massive changes while others try to follow errors and never change code or idea.really I don't know what is the best choice but I think it depends on the project itself and on the programmer.

Well I will tell you about some errors I faced.

First error: When I compiled a project (signal flow graph) a nice error appeared.The error was multiple declaration for class List see earlier declaration actually they were more than one error. I compiled the program more than once but the same error List was a template class so I thought that was because of template errors or due to multiple inclusions from several files. All didn’t work. Finally I decided to trace the earlier declarations. I found that the earlier declaration was in other project (Sorting techniques) although the project file was not included. WOW! Yet I was very pleased that I closed the computer. Never work in 2 projects in the same time simply, delete one of them to be far from errors.
No comment.

Other error was in sorting techniques project the project compiled normally with 0 errors and some warnings but when I removed the checkbox of Build with runtime packages the following error appeared fatal linker error cannot find the file “perfgrap.obj”!! What is that file and who included it I don’t know? When I removed the checkbook the project compiled normally I made a new project added all files to that and compiled it with the same error so, what to do now?? I had a small idea I brought any object file from any project and copied it to the project directory then renamed it to “perfgrap.obj” then compiled the project. It compiled successfully and ran normally!
Past errors were all compilation errors what about run time errors?
One of the strangest errors I saw was privileged instruction error! I think it was the responsibility of the compiler to fix that error. other was Paging file error when I see this types of errors I do nothing more than compiling the project more than once.

What’s an error?

(Compilation) Not following the language rules.
(Runtime) The condition of preventing the program from continuing running normally.

What’s a bug?
.
A bug is a mistake or failure that prevents it from working normally or produces incorrect or false result.
Linus Travold "Given enough eyeballs, all bugs are shallow".
.
Advices for programmers:

1-Write smart compressed small code : e.g. to copy a string: while (*s++ = *t++) ;
2-Go back and enhance your old code.
3-Learn from your IDE.( Language features IDE features help…)
4-Development on a fast-super computer.
5-Write lots of comments.
6-Use accessors or properties rather than public data.
7-Be aware with input and organized with output.
8-All special cases must be handled immediately; you'll never go back and fix them.
9-Design first (on paper in mind) then code.

Monday, April 17, 2006

China president at Gates house, not White House

China president at Gates house, not White House

SEATTLE



Where do you think the first dinner of the historic visit of China’s president Hu Jintao to United States?

The White House? No.

It won't be in Washington D.C., but Seattle,The capital of Microsoft, and the Tuesday dinner will be held at the $100 million lakeside mansion of Microsoft founder and the world's richest man, Bill Gates.

The approximately 100-person guest list is a who's who of the U.S. Pacific Northwest power elite, including Starbucks Chairman Howard Schultz and Washington State Gov. Christine Gregoire.

Gates and Gregoire are expected to introduce and welcome Hu, who will then offer a toast in front of the gathering.

Like any good dinner guest, President Hu will not come empty handed. The Chinese government issued a decree two weeks ago that all PCs will need to have licensed operating system software installed before leaving the factory gates in an effort to crack down on piracy.
As a result, three Chinese PC manufacturers announced plans to buy a total of over $400 million worth of Microsoft Windows operating system software over the next three years and Lenovo Group, China's largest PC maker, is expected to announce a similar deal on Monday, organizers said.

This event is not so good for Linux lovers as it closes the door for Linux poularity in China(one of the greatest hosts for Linux).

Gates' lodge-style, 66,000-square-foot home overlooking Lake Washington with a reported seven bedrooms, six kitchens, 24 bathrooms, a domed library, a reception hall and an artificial estuary stocked with salmon and trout.

Gates lodge

The dining room overlooks the river!

http://www.gateslodge.com

Friday, April 7, 2006

Why People Don’t Work Like Elevators?

Why People Don’t Work Like Elevators?

Your reaction to intensive signals is faster than less intensive ones.

Do you know why?
Do you understand?


Consider the following 2 examples:

You are in a hurry and waiting for the elevator what will you do?
You will push the elevator button strongly and repeatedly, but do you think that this will bring the elevator faster? In other words do you think that the elevator will respond to you faster in that way?
You may imagine that but absolutely that is never true.

Now if you shout at your friend then (s)he will respond to you faster than simply calling him so, why people don't work like elevators?

People respond to brighter light, louder sound faster than other this known as Pieron’s Law



Reaction Time is the time between the action and your response.

I is the physical intensity of the signal.
R0 is the minimum time for any response
K and b are constants that vary depending on the exact setup and the particular person involved.

A graphical representation showing last relation can be shown:




In fact, Pieron’s Law holds for the brightness of light, the loudness of sound, and even the strength of taste.

To see why, think of it like this: Pieron’s Law is a way of saying that the response time increases but at a decreasing rate, as the intensity.


Tom Stafford &
Matt Webb