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.