## Thursday, December 20, 2007

### A story of him who wanted to not call the constructor !

Hello there, everybody !
Welcome to my blog. Please seat yourself and enjoy the post.

Once upon time, a old wise man was sitting alone thinking in some problem that was taking all over his mind. He wanted to make things easier for the local programmers who use the RMI library. There problem was that to use RMI you need to override and implement certain interfaces. So the poor villagers, er, programmers had to work extra hours to harvest, er, design the changed system to adapt it to RMI specs.

The old wise man have figured out a simple way to help them. He can provide them with a magical bean, er, program that can do the tedious specs conformation for them. The magical bean overrides the classes and sends the overridden class over the network, instead of an evil magical creature, er, RMI artificial stub that throws them with rocks, er, RemoteExceptions.

The old wise man spent days and days working alone all the day long, until he finally produced what he have promised. The magical bean worked as expected. However, there were one drawback with that bean. It kills the other crops, er, remote stubs still call the default constructor of the super class. That constructor is meant to run on the server side. In some cases it can wreak havok if run on the client side; creating or deleting other crops, er, files for example.

That problem kept the old wise man up for 3 days. although it was the big feast, but he cared for the poor villagers more than his own joy. He set his mule up, and started on his way to search for a solution. Even if it took him to sweep the entire globe.

On his mysterious journey, he met a powerful wizard, called BCEL. BCEL claimed that he has a potion that enables the old wise man to control the magical bean to an unprecedented level. The old wise man believed him and bought the recipe. He spent the next weeks trying to prepare the potion. The results wasn't encouraging at the first, but as he got better in preparing it over time, the results got better.

Trial #1
Now it is the big day. He have gained enough skill to try to prevent that evil magical bean from invoking the constructor. He have manipulated the magical bean and removed the invoke that calls the super constructor. But the soil, er, JVM, struck him with lighting, er, exception that the object is uninitialized.

Trial #2
Bravely standing up after the lighting, he manipulated the magical bean again, to call the Object's constructor directly, without passing the on the original super constructor first. But still, JVM struck him again saying that the wrong constructor is being called!

Trial #3
He thought, if I can manipulate the magical bean's constructor, why don't I manipulate it's super constructor too ? And the next super one and so on. So staying for hours in his laboratory, he invented his own fertilizer, er, class loader. That special fertilizer has the ability to manipulate every magical bean, and even every normal bean that gets out of the soil. Yet he wasn't so lucky. JVM had to make his grow the magical bean twice every time he wanted harvest an RMI application.

The old wise man keeps trying, and hopefully soon he will be able to something. Even if he had to manipulate JVM itself!!

End of part 1...

Update 22/dec/2007: Using JVMTI (JVM Tool Interface) One could change every loaded class in the system. It can also redefine them as many times as he want to. And best of all, it needn't be native code ;).

## Monday, November 19, 2007

### Typical debugging session

Typical debugging session...

## Sunday, November 11, 2007

### Chat protocol v1

5-way SIP
P1: s/a (SYN)
P2: s/a (SYN)
P1: hru ? (SYN/ACK)
P2: l7mdL u ? (SYN/ACK)
P1: l7mdL (ACK)

Session:
P1: s'up ? (PING)
P2: aho mashya, u ? / aho 3ayesh, u ? (PONG)
P1: l7mdL (ACK)

Session Suspension
P1: brb/afk (URG)
P2: tyt (ACK)

Half-closed Session Termination
P1: bbl (FIN)
P2: tyt (ACK)

4-way Session Termination
P1: i have 2 go now, need anything ? (SYN/FIN)
P2: no thx (FIN/ACK)
P1: s/a (FIN)
P2: s/a (FIN)

Session Reset
P1: i have to go now, salam (RST)
P2: ... (void)

## Sunday, October 28, 2007

### The meta-effect

Alan Turing, the mathematician, and father of computer science, died trying to prove somethings are fundamentally unprovable[1].
Finally this long-awaited article comes to light. People who read it might actually think I am really crazy. But I will write it anyway. I don't actually know if this is an already-defined theory with another name or not, but I've been thinking in it for a while now.

The meta-effect happens in every day life, and in different ways, but we never notice it. I've been able only to know 2 instances of it, one of which only exists in the meta-effect itself.

I don't know how to start but through an example, and I have one example as said above. You learn how to sum 2 numbers. Your teacher taught you how to sum two numbers, and he had learned how to teach you how to add 2 numbers. The guy who taught him how to teach you how to add two numbers have learned that too! I don't actually care about any of these facts, only do notice that I can go for ever.

How do humans learn things ? How do humans learn how they learn things ? How people analyze how they learned about they learning things ? Common fields facing that particular effect are psychologists, sociologists and natural language programmers.

That meta-effect things needs a lot of studies to know its true nature. For example, to which level should we go ? Or can we know a level without the other ? At which level there is no more useful information ? Do we need to advance to another level ?

The most fascinating aspect of all that, is how human mind can elevate in meta-levels like that. Studying the effect of how human analyze how their mind are in a higher meta-level, lets call it: meta-cognition-level-2, for short MCL2. In my last article what I was speaking about is MCL2. While we analyze MCL2, we are elevating to MCL3. As a rule-of-thumb, when you give a level a name, say MCL(n), you are actually at level MCL(n+1). In MCL2 we talk at MCL1. And when we talk about MCL2, we are at MCL3.

Warning, the next is much more complex!

We talked about meta-effect in learning, or some topic. What if that topic was the meta-effect itself ?! There is meta-levels, in a single topic. Each level analyzes the level beneath it. But what about analyzing the meta-levels itself (like in differentiation in calculus*). Let's call that, meta-meta-effect. Is there is a single meta-meta-effect for all topics, or there is separate one for each topic, or there is both ? Is the former a higher (another kind) of meta-meta-effect ?

Generalization

If we give a thread of cognition stream the name m/l/t, where m is the differential meta-level, l is the ordinary meta-level, and t is the topic, where t* is applicable to all topics. Normal everyday talk or thinking is 0/0/t*. Some advanced experience of learning activities involving consideration of previous learning experiences, is 0/1/t*. M/L/T (big letters are free unbound variables, means applicable to anything) where M > 0 is only applicable when talking about meta-effect.

Well, I might go more analytical next post isA.

[1] http://bestdocumentaries.blogspot.com/2007/09/dangerous-knowledge-full-documentary.html
* Cool, this might lead to some new science called cognitive calculus :D

## Wednesday, October 10, 2007

### 30 Minutes is not the same as half an hour

No it isn't playing with the words, so stop trying to figure it out that way.
As usual I have been digging in some stuff, this time related to Natural Language processing. And on the other side, I had to determine an estimate for a task in my work. Usually we measure tasks by hours. But the task was somehow small that it takes less than an hour. So I wrote 30 minutes.
After I sent the mail, I kept thinking, why didn't I write half an hour ? Inherently "half an hour" is more rough estimate than 30 minutes. Exactly like when you measure yourself to one and a half meter, against 150 cm.
It is about the scale, no; it is about the precision. I've always been fascinated how reading that the government have spent 30 Billion LE on that project seems normal, while reading that it spent 30,000 Million LE seems huge! Reading that it spent 30,000,000,000 LE would seem gigantic. 3 * 10^10, almost means nothing. Although they represent the same quantity.
What have derived this idea, is thinking how an NLP program will ever comprehend such style in understanding, which I believe is very related to how human mind evaluates things. It maybe even somewhat related to psychology than reasoning; subconsciously: that number takes that many characters, then it must be huge!
A theory I've been thinking in for a while, in NLP and Natural Language Understanding in specific, is that most babies know nothing about languages when they are newly born. Yet they function correctly. So language is complementary, but not essential in learning. Language only aids learning by adding new means to it: communication.
So I believe that before any serious trials are made to make a full natural language understanding program, knowledge representation and learning methods need to be formalized first. You can't add communication facilities to a program that will not use it. Well, in fact you can, but it is useless.
Babies see a bottle, then most of the time, they hear 'bottle', so according to the famous psychology phenomena "Conditioning"[1], both events: seeing a bottle, and hearing the word 'bottle' stimulate each other. That's simplified. It is actually kind of statistical learning. Over time, they learn to be more sensitive to some phonemes than the other, depending on the inherent probabilities in the language most common in their environment. "Koreans notoriously fail to distinguish 'l' and 'r' sounds"[2].
If I would guess similar pattern for vision, and motor skills. For example, I might guess that babies might see the percepted image as-is, but with the aid of the 3 dimensional perception, they can notice certain patterns as they move around, leading to detecting the boundaries of objects. As they do that, and over time, they learn the patterns, and the colors, and learn to use them to distinguish objects and extract them. I might use the existence of optical illusions as evidence. Somewhere in your childhood you have mixed objects like that. Kids usually deal with big cubes and learn the dimensions to sharpen the object-detection neural networks in their brains. And they grow up they get more exposed to more complicated patterns, like text for example.
So if we assumed a simplistic model, that a human is a combinations of sensors, and a statistical pattern-matching learning machine, and non-linear initially-empty knowledge/rule base, that is stimulated by the sensors and the pattern matching machine, then we only need to figure out the inter-dependencies between them and also figure out the abstract functionality contract for each of them, to be able to create a real NLU program sometime.
What on the stage now is artificial hard-coded NLU programs. what I am seeking is a self-learning NLU program, that can teach itself languages, and can then teach itself everything. Of course, sensors are needs, experiments which the system should go through (life-experiments) should be available to the system. But one more thing, that were not in the past assumptions can destroy all that. The assessment problem.
The assessment problem
On what basis should the program accept of reject a new piece of knowledge ? The program till now is only a pure knowledge collection machine, stimulated by external events. What's the use ? The program must ponder the knowledge it gained, and assess the acceptable and non-acceptable pieces of knowledge, especially that there is a lot of contradiction out there, because knowledge available in the world is highly affected by personal view points and preferences. How the program will learn the ability to compromise between two conflicting facts ? If there is two different view points, how can the program choose one ? Or should it compromise or select one, or worse yet, select only two from a set of contradictions ?
Humans, have been forged to the good nature, such contradictions and wrong choices affect their nature after that. It's a matter of trust, which source should the program trust ? And one what basis should it grant or revoke trust ?
This is far beyond the scope of NLU, or machine learning, this.. is .. humanity ! Yes, this is1 human kind. No application what soever will be able to reach that state consistently and independently. As you might have noticed, this is not first-order knowledge. They might create applications that understand first-order knowledge better than the human (i.e. some advanced sort of databases), but they will never create a program that can reach arbitrary orders of knowledge. At least not one that will be close the the human. The humans will prevail the top in that.

References:
[1] http://www.alleydog.com/101notes/conditioning.html
[2] http://www.asian-efl-journal.com/dec_03_sub.K1.php

## Friday, October 5, 2007

### تجربه: مقتطفات رمضانيه 2

ديه تجربه احط تدوينه من مدونتي السريه واشوف حتضحكوا عليا وﻻ لأ... اللي حيضحك حيعرف شغله!
لو حد عنده فكره
support
العربي زفت اوي كده ليه في بلوجسبوت يقولي

==============================================

التدوينه تبدأ من هنا ...

==============================================

المره دي التدوينه متفائله شويه

انا زي كل يوم مؤخرا مطحون طحن في الشغل و كان عندي فطار بره و كمان الشغل لازم يتسلم الساعه 9 و الشغل يدوب عليه الوقت اصلا من غير فطار. فضلت شغال لحد ما كان فاضل ربع ساعه على الفطار بقول حاخد تاكس. والمسافه اصلا برضه ربع نص ساعه كده حسب الناس متفقه عليا عشان تزحم الشارع ولا ﻷ. المهم قلت اخد معايا حاجه افطر بيها تحسبا للـتأخير.

المهم وانا في السكه التاكس بطء عشان واحد شاورله و فاضل 5 دقايق عالمدفع. اول ماقربنا من الواد اشرأب -حلوه اشرأب ديه- عنقه عادي يعني زي اي واحد بيوقف تاكس. التاكس طبيعي مفرملش عالاخر يعني و اذا بالواد يرمي لنا بشئ جوه العربيه. انا في الاول اتخضيت و بعد كده قلت اكيد ده اعلان - بس غريبه اعلان ايه ا للي قبل الفطار ده ؟؟ المهم طلعت في الاخر كيس بلح. انا بصراحه قعدت فتره على مستوعبت ان في ناس كده و بصراحه فرحت بيهم جداااا. و قعدت ادعيلهم من قلبي. و كمان شارعين لقيت اتنين تانيين. و كمان شارع لقيت واحد بيوزع ازايز ميه. و بعد منزلت من التاكس -و الادان بيدن- لقيت عربيه وقفت تديني بلح! لو شفتو التدوينه اللي قبلها والست اللي بتقول حاجه افطر بيها يابني. مش عارف اقول ايه يصراحه المهم ان انا مبسوط اوي.

الايام دي بروح المهندسين كتير. قبل كده كانت بالنسبه ثقب اسود لا ادري له مكان. المهم النهارده خدت بالي من حاجه عجبتني برده. الاشاره فيها عدادبيقولك فاضل كام ثانيه والاشاره تفتح او تقفل!! بصراحه حسيت اني احترمت اللي عمل كده عشان هو بيحترم السواقين. كان نفسي اخدلها صوره احطها بس للاسف معنديش كاميرا رقميه.

هي الحاجات ديه اللي مخلياني حموووت واشتري كاميرا..

## Sunday, September 16, 2007

### نقطه تحول

في حياه كل واحد فينا بتبقى في نقط معينه في حياته بتعبر عن تغييرات ضخمه في شخصيته. احيانا بتبقى النقط سببها تغيير في الظروف او الاحداث المحيطه بالواحد. مثلا على اعتاب مرحله جديده في حياته او نتاج تجربه معينه اثرت فيه او نتاج سلسله احداث سببت ظروف صعبه.
اكيد مثلا مرحله الجامعه ديه اثرت في كل واحد فينا تأثير كبير اوى مش حاقول اعادت كتابه شخصيتنا كلها.
انا بكتب التدوينه ديه عشان في نقطه تحول احتمال تأثر على تدويني كمان. اللي ملاحظ انا بقالي فتره مش بكتب كتير ( قال يعني كنت بألف كتب قبل كده :D ). بس في الواقع انا بقالي فتره بفكر احول اكتب عربي و كمان اكتب كلام عادي - يعني مش تقني.
للأسف الكلام العادي اللي انا عاوز اكتبه مش حأحس براحه الأ وانا مش معروف انا مين. بصراحه انا مكنتش بكتب غير تقني مش عشان معنديش حاجه تانيه اقولها و لكن عشان مش ببقى براحتي وانا مش عارف مين اللي ممكن يقرا الكلام اللي انا بكتبه.
و لما شفت مجتمع المدونين - خاصه المصريين - لقين ان نسبه كبيره منهم مش معروف شخصياتهم و انا حسيت ان ده بيدي حريه اكتر في الكلام. اه يعني القارئ احسن مني في ايه انه يكون عارف انا مين وانا اساسا معرفش انه قرا التدوينه, مش كده لازم يكون في عدل لازم يكون في مساواه ( مش المساواه التانيه قصدي المساواه بين القارئ والكاتب)
عشان كده قررت اخيرا اني اشارك في مجتمع المدونين المجهولين. و عشان كده برضه مش حابعت العنوان لحد نهائي.
بيتهيألي كده كفايه حد عنده سؤال ؟,

## Tuesday, September 11, 2007

### The dark forces of evil have conspired against this program !

No comment... !

Update: As confusing as it may seem, but it has a reasons. The Java compiler doesn't recompile already compiled files if a file they depend on have been changed since the last compile time (doesn't consider dependencies). The SEGMENT_LENGTH _IN_KILOBIT is final static variable involved with other constants in an arithmetic operation, the compiler optimizes that (constant folding). So when CoolStreaming class gets recompiled (the value of that final static variable changes), this class won't get updated with new value, although the debugger did. A clean rebuild is sufficient to solve that.

## Saturday, July 21, 2007

### When Math is Misused - Revenge

It's revenge time. You should have read the last post on the same topic. I've got the chance to write a paper and I just wanted to see how it feels like to write such complicated mathematical stuff. The paper was about a min-heap and stuff, pretty simple and can be written in a few paragraphs. Take a look at the pictures.
The amazing thing is that after the 2 days I spent writing in 2 pages, I realized that well-formalizing the issue allowed for much much more potential that was initially possible. Initially we just move the load from a loaded machine to the lightest node in the system, but after well-formalizing the problem it is now possible to prove the degree to which this algorithm is really effective and efficient or not. It also showed me a point I didn't look to before, that if a machine get lightly loaded, it can take the load from other machines, without the need of the other machines to ask it to, and thus making real load-balancing.
I really was amazed not only because of the new potentials, but also that writing mathematic proofs and well-formalization is very much like programming, the logic of the proof follows like lines of code follows for the goal of the program/proof. I can say that I enjoyed writing that paper, well, like I do enjoy writing complex C++ code (and I do enjoy that more than games) (maybe it is cause I used the paper to learn Latex, I dunno).

## Saturday, July 14, 2007

### The bigger view, redefining the impossible

Many people of which I have dealt with, even if not saying it, are profoundly convinced that some of the applications which they use, maybe on daily basis, cannot be made by them. How many of the readers right now convinced that they can make, say, a web server, a SQL server, an OS, or a C++ compiler ? How many are convinced they can make a web browser!

I know some readers might think I encourage reinventing the wheel, they should know that this is not true. I mean that if a person knows and believes that he can make a wheel, he can then trust his own ability and imagination to start thinking beyond that and make a whole car, and maybe a space shuttle even. I am convinced that people who cannot trust their ability to make such -system- software are tied and will be forever dependent on other companies to make that software for them.

Under such circumstances it becomes natural why people limit their mind to predefined software categories, which have standard development procedures (i.e. web sites, database applications, etc..). In order to innovate you do not only need a vision, but also you need to trust your ability to achieve that vision. Often people disregard good ideas only because -deep inside- they know they can't do it. To hide that from themselves and from others, they tend to belittle the idea or call it foolish or inapplicable etc.

Thinking outside the box is also one feature of innovation. But to be able to do you need to know what's inside the box, and you also must have the liberated(1) thinking to do so. Because we are not surrounded by a lot of liberated minds, innovative minds might be afraid to go outside the box because they will be made fun of and belittled by those unliberalized minds.

(1): by "liberated" I mean those people who trust their selves and their thinking and are not tied by limited thinking of the surrounding environment.

I want to implant a certain concept in the minds of those people of IT in our country. Which is, nothing is impossible, and nothing is so hard that it can't be done. For example, you might think application X is hard to make. This is only built on the fact that you don't know yet how to make or how to approach it. But actually once you know the drill, it is almost like any other application you did (remember your first program, and your last program, and compare if you would have thought that this last one was possible when you did your first).

For example, from what I discovered, that the drill to approach an OS kernel is to make a simple Hardware abstraction layer (HAL) and to base other stuff (memory management, etc.) above it (like a simulation), and to approach the HAL you need to start by reading the Intel System Developer guide -for Intel systems-. The remaining is just regular work, read and apply, no thinking. (notice I said the drill to 'approach' not to 'make').

Also I found the way to start in an RDBMS is to start by making the Table class, and one-by-one add functionality to it (select, project, save, getSchema etc.). Once you've found a start point, the remaining, as I said, is just regular work, like any other program.

I know some people which was saying to me that making an OS and RDBMS is just reinventing the wheel and a waste of time. Well, I just wanted to know the drill, and know how they are done, so I can liberate my thinking and achieve the freedom of thinking and not to be limited by stuff I don't know. How are we going to innovate in such fields without that ?

I am not saying that the reader should go and -reinvent the wheel?- and make his/her own RDBMS or OS, but I am saying that if this what it would take to liberate your mind, then do it. Or take whatever necessary to liberate your mind. If just reading about them is enough for you, then be it. About myself, I had to do them myself, I just don't believe all I read, and I didn't think that the authors are better than me in a way that makes them able to do it while I can't.

All I want to reach in this article, is that don't think in terms of what's there, but think in terms what you can do. For example, don't think "This program doesn't do X :( I'll have to wait for the next release", but think "This program doesn't do X, so I'll make my own X!" or "I want a program that does X, there isn't ? I'll make my own :)" or better yet, "I wish I don't find a program that does X so I can do it!". And if you find such a program, you might take a look at the source to know how it was done.

One by one, you will reach a phase where you don't know the word 'impossible'. For example, imagine a program that you can ask to explain quantum physics for you, and the program scans the internet for it, and -built on your background, which he knows, cuz he chats with you a lot- he builds a tutorial with the style he knows that you prefer, and start explaining in a conversation with you, in which you can interrupt and ask, all in voice, not text. The program also can detect your face and knows when you look like you don't understand. I'll ask you: is that possible ?

## Tuesday, July 10, 2007

70%How Addicted to Blogging Are You?

Mingle2

## Monday, July 2, 2007

### Database applications, a message ...

Finally, a short period of rest before continuing working in the graduation project. So many blog posts I wanted to send and I didn't because I was tired.

Note that this is not in anyway disregarding the importance of database or website development. They are very important fields in our life.

Most of you know that my interest is theoretical scientific research. So I am not so much in favor of 'pure' applications that doesn't add new technologies or ideas; just uses them to tailor a predefined template of programs. This post is going to 'attack' and try to refine that sort of applications, and it's most common example: 'Mere' database applications (well, both desktop and web).

My idea is that having such repetition in the implementation of one -mostly the same every time- idea, and the variation is only in using or fine graining, makes the concept needs rethinking. So that instead of making a separate application that just uses a database, for each use of databases, you can broaden the concept so that there is only one database application that suits every possible use.

First, let's include some examples, digg.com, flickr.com, and every forum that exists. If we exclude creative search techniques (Google for example.), and appealing GUI (flicker; web 2.0 in general), and the concept of user-oriented content (forums. Digg - like the radio show, 'what the listeners ask for'), what do we have left ? Database, adding data, retrieving data and information, calculating statistics, and everything you find in a database book.

The core of many projects and websites is data processing, converting data from one form to another, and saving and retrieving data. I don't think I've found a data mining website before (can anyone mention an example of one, please ?). The rest of the program is just eye candy and mostly --except in rare cases-- non-reusable non-extendable --in a scientific way I mean, not in a sales way-- ideas (the general purpose of the website).

It's like talking about pen and paper. Every new website, or database application, just uses pen and paper and it just tells you this paper is for writing questions, and this paper is for writing posts. Paper is paper, and excluding fundamentally new ways of writing, and fundamentally new paper, the task is user-performable. So why not give the user the power to use the paper the way he wants to, and let us concentrate on the rest: fundamentally new stuff; inventing.

The idea in a very similar problem is: separate the paper mills engineers and the newspapers writers. They are totally separate jobs. Thus in our field, separate the 'computer scientists' (or computer professionals in general, including CS and IS) from the website authors.

Not only database applications or websites I am talking about. I am also talking about GIS. Geographical information systems, used to be an information system thing (IS) and is considered an advanced field. My thinking is that once that field gets ripe and the only variations left is to change uses and purposes, just leave it to other peoples (GIS geologists, or traffic authority or whatever they will call themselves) and concentrate (I mean IS people) on making the next technology, for example: Voice Information System, Space Information System, or ... there are many stuff left to be done, don't stick to the easy and clear one just because the other new fields seems fuzzy or not very well-defined, that's where history-remembered scientists starts this way by exploring what no one did before.

And by the way, I want to call the term 'computer professional' to be obsolete a meaning-less. I don't know if I am the only one to say that, but anyway. We computer scientists, information system guys, information technology guys, and whoever mission is to create new technologies in their field, should let a technology go after it is ripe to people who are only dedicated to it. Websites, should no longer be called as 'our' field. There is website-professionals who need not know binary or internal working of a computer, they might also need not know programming at all. Thus computer-professional should be replaced with a 'field'-professional. Because they will be very diverse and have absolutely nothing in common, except that they use computer hardware, RAM and hard disks.

Not all database applications and not all websites are like that, after all, the content judges. For example, a website to do calculations on a set of people stored in a database to classify them on a certain complex criteria that you need to make your own algorithm (not just be sorting and branching) that can't be made using a simple SQL query, that no so-called website-professional can do. That can be acceptable for us to do. But otherwise, either repetitive memorized website-development, or content writing, is not acceptable for us to do as it is not our field, nor our profession, nor what we were prepared to do, we were prepared for something much higher, much complex, and much greater.

If you (CS, IS, or IT guy) are still convinced that the new idea for your website justifies making a website, then you didn't get the idea of this article. Save such ideas to website-professionals. Your job is much creative than that.

A little example, if you are making a program that uses a database, and uses communication between computers, you can do it using SQL/DLinQ and Sockets/WCF, but you can also devise your own way like making a new spontaneous way of accessing your data, and a new spontaneous way for calling your program on the other machines. The new ways, need not be so general, they only need to serve your specific needs in that program (i.e. single protocol, single language communication; single language data access; the language you use). Only try to make them as reusable as possible. Do whatever you need so you can concentrate on the creative parts of your application not the 'exhaustive' parts.

Reusability concept is more than I imagined, it isn't just making 'code' reusable so you don't need to write the same functionality twice, but also the whole process, so you don't need to drag and drop the same components twice!

I hope the idea have reached you. Thanks for reading so far.

## Friday, June 1, 2007

### Can you guess what these are ?

When I was surfing the net searching for object-oriented operating systems, I ran into NeXTSTEP, an operating system made by NeXT (Created by Steve Jobs after he was fired from his own company, Apple!) back in 1989, written in Objective-C. When I read about it I also seen that it worked on NeXT computers. Early NeXT computers shipped with a Magneto-Optical drive instead of a hard disk, the former was invented by them.
These pictures is a Magneto-Optical disk. This technology is still used today: look here.

## Sunday, May 27, 2007

### Latex for blogger

$\pi = \int_{0}^{1} \frac{4}{1+x^{2}}$If you need to type mathematics, Latex will help you (pronounced Latek, source: Wikipedia).
The formula shown above is written in Latex as:
$$\pi = \int_{0}^{1} \frac{4}{1+x^{2}}$$
Compiled on the fly using the link "http://www.forkosh.dreamhost.com/mimetex.cgi?" concatenated with the formula in Latex.

The professional tool for writing scientific documents: LaTeX NOT Microsoft Word. By Waleed Youssef Ph.D (FCI Helwan)
A reference to Latex here.

## Thursday, May 24, 2007

### STL Clips 1

Guess the output of that program:

#include <iostream>#include <algorithm>using namespace std;int main(){string str = "<F";transform(str.begin(),str.end(),str.begin(),bind2nd(plus<char>(),-2));cout << str;return 0;}

Output (highlight to see):
:D

## Saturday, May 19, 2007

### A piece of code

Well, the title says it :D. I was bored so I did this image from a screen shot of the memory management module in ArOS. El mafrood en dah granite :D and don't ask elly gab 3aleeh code :D. I imagine it like a piece of paper that got wet and the ink was flushed. I've seen a similar black and white effect in "The code, Linux" documentary (which I am searching for the original English version, because the one I have is in Finnish)

## Thursday, May 17, 2007

### Electromagnetic shields - can SciFi be realized ?

First, those who will search for the term on Wikipedia, they are speaking about another thing. They mean shielding components against electromagnetic interference. But what I am talking about is making a physical shield from an electromagnetic field ( yup, a one that can prevent bullets from hitting you ).
It all began when I watched the "Elegant Universe" documentary on the theory of everything. Usually these theories aim to unify theories about weak and strong nuclear force, electromagnetic force, and gravity.
There was an example in it showing the gravity is much weaker than electromagnetic force that when an object falls to the ground, it is met by a resistance/repulsion between the electromagnetic field of it's electrons with the electromagnetic field of the ground's electrons. ( That's why electrons don't just mix up and object blend into each others mysteriously. )
So I thought if we can generate such an electromagnetic field to imitate that resistance, we can imitate that a physical shield does exist, and it will generate a repulsive force that prevent a moving entity from moving further using a collision.
The question is how we can generate such a thin layer of electromagnetic field without generating a big interference with the surrounding systems, especially the human body, which is sensitive to such field.
I don't actually have the exact knowledge to answer that. It is especially that I don't recall the exact relation between electromagnetic waves and electromagnetic fields. I don't also know the exact shield power needed to actually prevent something from going through, but I think it might be gigantic ( something related to "Energy = Mass X C2", where C = light speed in vacuum ). I need to revise electromagnetic shields and remember how they are calculated and if their direction might affect the total result or not. ( I might revise our freshmen year physics course ).
Anyone out there can help by suggesting topics or even telling me if this is possible or not ?

## Tuesday, May 15, 2007

### A computer can't think, because of this

I've been thinking for several years about the process of human learning and perception. I gained several thoughts about it.
Regardless of humor, compassion, irony, and recalling memories; the rest of human brain power is directed towards what they don't know, being the most famous factor: the future.
Tomorrow's weather, the match result, the exam result, the future job, the future salary, the future inventions, can we someday reach the stars ?
And past mysteries: who murdered President Regan, El-Sadat, etc. How did the pharaohs build the pyramids.
Even gossip talks: Who said what about who, who cheated in the exam etc.
In the exception of the last point, the first 2 are usually lead science forward.
You would NEVER - almost ? - find someone who is interested in hearing ( or thinking ) what he already knows, stating the obvious they call it.
Who would care to know "again" that the High Dam gives Egypt electricity ?
But they care to think "what if it was destroyed?"
Humans usually think in stuff they don't know. And as paradoxical as it might seem, they need to know what they don't know so they can think about it !
So in my point of view, a computer system, to be able to think, and represent knowledge, it can not ignore the need to represent ignorance !
I might put it simpler: knowledge representation won't be perfect unless it can represent what is not known !
That's already the case in QAS ( Question Answering Systems ) when the represent questions. But can a computer system, generate such questions ?
It did, by comparing the input knowledge representation to a pre-defined cases of full meaning representation patterns, so it only meant to complete the given pattern.
But can the computer think beyond that ?
Till now that is not thinking. I mean can the computer system generate the full-meaning representation patterns by itself, and be able to induce the answer to the generated question by using common expert system techniques, and perhaps mathematical induction rules ?
Can it afterwards confirm the results of its own induction by launching virtual simulations and comparisons to basic scientific rules and maybe - sometimes - common sense ? ( I might write another one about common sense isA )
"generate the full-meaning representation patterns"... based on what ? Creativity. Can computers be creative ?
"generate the full-meaning representation patterns"... what will trigger the generation anyway ? What guides the direction of generation ? Might we say genetic-algorithms ? Is randomness the key ? I think this is strange, it might, and might not be the direction, but I don't feel like it is the correct way.

### A cross-platform application loader, an idea

Well, I always get ideas and thoughts in exam times :S. Anyway, here we go.
Imagine your system's desktop as follows:
Gnome (*nix) + Windows sidebar + Visual Studio .NET + xCode (Mac) + GCC + Bash + Need for Speed + (well, any application that runs on another platform, OS, or H/W architecture), and they are all native.
Is that even possible ?
Lets see.
I might think of 5 factors that makes this not possible:
1- Application Binary Interface ( ABI ).
a- Encoding
b- Endianess
c- Instructions ( H/W platform )
d- Name mangling ( Dynamic-linking issues )
2- Application Programming Interface ( API ).
a- Arguably boiled down to only low-level system calls, thus it gets to the interface between pluggable API user-space libraries and the system kernel
3- Cross-compatibility between different expectations of Inter Process Communication ( IPC ) and common shared libraries.
a- A mix of point 1 and point 2.
4- Incompatible shared dependencies.
a- Application A depends on version X of library S and application B depends on version Y and both versions are incompatible if both applications use it for IPC. Well, this kinda also gets down to the scope of one platform
5- Incompatible assumptions about the expected behavior, especially if it was buggy behavior.
a- If an application depends on a known bug in the system API and another applications doesn't. This also gets down to the scope of one platform

I'd be thinking of a resolution to each of these points isA and writes thoughts here as an update isA. If you've got any kindly leave a comment.

## Saturday, May 5, 2007

### FCI Tag

Hossam Sadik has tagged me !

List five things you learnt in FCI –not Technical :D-??
- lazem ya3ny mesh technical :S -
* et3alamt en el 7aya bet3addy besor3a
* we en al 7aya a2sar men en e7na na2adeeha fe za3l we 7'na2at
* we en ana 3ashan asa3d nafsy, lazm asa3ed elly 7awalya
* we en al 7aya gad wel le3b we 3ashan tel3ab lazm teb2a gad fe wa2t el gad
* we aham 7aga at3alamtaha ma3na el sadaka el 7a2ee2aya

Five things you will miss in FCI?
* starting my day seeing the smiles on my friends faces :)
* ra7alatna, 7'asatan fel autobus
* the chance to make anyone fe dof3ty ( wel kolya kollaha ) happy
* el esboo3 el thakafy :D
* Student Union ( futex group ) work and meetings ( for student union, or mozakra :D )

Best day in FCI Helwan?
- el fetarat el gama3ya fe ramadan, el esboo3 el thakafy, yoom el match :D, a7'er yoom fel emt7anat ( cuz i see my friends happy then :) )

Worst day?
- lemma ala2y el dof3a za3lana men zolm doctor aw men ay 7aga tanya

Best week?
- bardo el esboo3 el thakafy :D

Best doctor, course, book, project?
- Dr El gar7y, statistics, C++ the complete reference, GP :D

Worst doctor, course, book, project?
- ( there is much worse doctors anyway ), SW2 , advanced OS, dsp

Best instructor?
- most of them are good, but i want to highlight some instructors who have affected my life deeply and guided me in my learning journey : Mr Ayman Ezzat, Miss Mai Hamdallah, Mrs Marwa, Mr Amr Ghoniem, Mr Ehab elGindy, Mr Mo3taz

Best situation?
- see the video to know

Did you meet your sweet-half in FCI?
- not yet

Did you regret for knowing someone in FCI?
i don't regret anything, if it was bad experience then i learn from it.

What was your favorite place in the faculty?
- with my friends :D wherever that is

What is the size of our digital photos on your hard disk?
- about 1 GB, someday i'll take the full collection from ramy isA :D

What will you do in the last day?
- i will stay to the end and leave as the last person isA

What would you like to say to dof3tnaa?
- 7'odo balko men ba3d :D

What would you like to say to other grades -aldof3at altanya- ??
- antom el sabkon we na7no alla7kon, ... er ... el 3aks ma3lesh :D

i'd like to tag Shereef Sakr, Youssef Mamdouh, and Ahmad Mubarak,

then
echo 'no' $(date +%H:%M:%S); sleep 10s else echo 'yes' play /your/sound/file.mp3 & sleep 60m fi done ## Sunday, March 4, 2007 ### Tagged: Five things you don't know about me! Ramy Mahrous have tagged me here. Here is my five things: 1- I love comedy. The only thing I'd love to watch on TV is comedy series or comedy movies. 1.1- I also like serious SciFi movies, not childish, or rotten (ro3b ma3awy) ones. 1.2- I also like reading for Arabic sarcastic writers: Youssef Ma3aty and Es3ad Younis. 1.3- I love to read Rwayat Masrya lel geeb, for Nabil Farouk and Ahmed Khalid Tawfik. 1.4- I am not into games that much. My toy is 3D modeling and rendering. 2- I hate repeated types of programming! I only like programming types which I didn't do before. For example, if I did DirectX programming someday, then I hate to program DX. If I have never programmed using OpenGL, then I'd be interested in doing it. Same for other examples. 2.1- If I am not in the mood, I'd really hate reading technical articles. I only get in the suitable mood when I have enough sleep (12 hours), hence I learn more in summer because I sleep enough. I really love sleeeeeeping... 2.2- If I have tough problem in a program, the first solution is to sleep, it gets easily fixed when I wake up! 3- I don't want to work as a programmer (see number 2). My dream is to work in theoretical scientific research, as opposed to the applied one. 4- I originally wanted Abstract Math section of the Science faculty, instead of FCI. Or the Optics section of that faculty. 5- I don't want to live in Egypt except if I found real good education for my kids isA. I like to tag Omar el Hussanein, Islam Ossama, and FCI-H Technical Blog Team :P (howa keda :P). ## Wednesday, February 28, 2007 ### I will not throw paper airplanes in class Visit this link to see the whole series of the languages used :D ## Tuesday, February 27, 2007 ### What Blender/Indigo can do :D [Note: I am not the creator of these pics] One of my fascinations is Realistic 3D graphics. Most of my free time, I spend playing with 3Ds Max. Now since I -for 5 months now- moved to Linux, there is no 3Ds Max there -or at least I didn't try using it on wine windows emulator. I've been trying to use the alternative there; Blender 3D modeler. It's interface is really different than 3Ds Max but I like it more. It is more natural there to reach the control you want. Anyway, since my fascination is not about 3D modeling itself, but realistic renders, I searched for alternative to realistic renderers to use with Blender. With 3Ds Max, there was the bundled scan-line renderer, the radiosity renderer, and the mental-ray renderer. The latter are the most realistic of them all, and the former is the least. While surfing the amazing renders in the CGTalk-3D Choice Gallery forum, I ran into a scene rendered using another renderer; Nextlimit Maxwell renderer. I was shocked of the degree of reality those renders had. I kept reading about Maxwell renderer until I found it was an unbiased renderer (I can't find a link to define it you right now, settle for that it is based on physics, physics and nothing else, it uses wavelengths instead of colors for instant! It also simulates a real camera, shutter, film, file ISO, and all those analog-photography parameters that I know nothing about). When I tried it out, it really produced some renders that I couldn't believe it was me who rendered them. While I was searching for something related to Blender, I ran into Indigo. It does the same as Maxwell, it can run on Linux, and it has a script to convert blender files to its own format. Nothing more can encourage me to get to learn and use Blender. My problem in producing realistic 3D images anyway is that I am no modeler. If I have models, appropriate textures (like 3DTotal Textures collection), the right renderer, (and maybe a great physics simulator) and enough time/PCs I'd produce the most realistic 3D graphics/animations you've ever seen. Till then, here is a few renders I found on the internet rendered using Indigo. Enjoy the full collection here. ## Saturday, February 17, 2007 ### Beryl 0.2 RC1 + Vista theme :D Notice the preview when hovering the window title in the taskbar. Also see the motion blur in the second image. The last image there, is a ring-like application switching. See that the taskbar and the gnome-bar are transparent? it is not a Beryl feature if you were wondering, it i s just a transparent PNG file set as the background. I forget to ask , do you like the Vista look ;-) ? ## Monday, February 12, 2007 ### Download all? If you faced a site with about hundreds files that you want to download you will know what is this about. I've faced two of them today. A site containing the MDC pictures, and a site containing MP3s for the whole Qur'an by Mashari. In the page that containing all the links, I could have passed on them link-by-link pressing 'save item as'. Alternatively I did the following. I right clicked on the page, using Firefox, 'View page info'. In the 'media' tab, I selected all the images and saved the link list to a file called list.txt. Then I created a new folder and put the file in it. And I wrote the following simple command and pressed enter: for File in$(cat list.txt) ; do wget $File; done And I let it download all the links mentioned in the file. And about the MP3, I went to the 'links' tab and likewise put all the links in a files also called list.txt in another folder. But this time there were two links for each Sura, one in MP3 and one in Zip. I did that to get the zip links only: cat list.txt | grep -i zip > list.txt Then I issued the same command to start downloading. After that I did: for File in$(ls); do unzip $File; rm$File; done
to unzip files and delete unzipped .zip files.

After that I did:
play *.mp3
to play them all :D ( yeah mp3 from the command line :D )

for File in $(cat list.txt)do wget$FileFile=$(basename$File)unzip $Filerm$Filedone
Like that once a file is downloaded it is unzipped and deleted automatically.

I am writing this to let people who use 'non-unix' know how simple and handy Linux can be.

## Friday, February 9, 2007

### BlueScreenOfDeath : BSOD

Sarcastic image :D

## Friday, February 2, 2007

### Importing Old Posts : Done

I have imported my old posts from my old blog at msn live spaces. See them in this tag "OldPosts".

## Thursday, February 1, 2007

### 24 hours of stress

24 hours ago, I formatted my Linux partition. By MISTAKE. And since my life was on Linux most of the time, you can imagine the disaster if you formatted your windows partition. This is a story of how I fixed that without reformatting or reinstalling or doing anything. That was a short introduction. In-depth details coming next, ba3d el fasel :D.

Hibernation in Ubuntu messes the swap partition. To fix it I have to issue the command mkswap. Which later I understood that it does reformat the swap partition. I by mistake instead of issuing it on sda6; the swap partition, I did it on sda7 the Linux root partition. el 7ala tedahwart saree3an, and soon I couldn't login a virtual console to fix it. I didn't understand what I made wrong till I couldn't access any file or folder. The desktop was wiped clear.

That was the first hour. The next hours involved fixing the MBR, searching for undoing mkswap, recovering partition tables, recovering files, then recovering inode table, respectively. In the middle there were involved some searching in the internals of the ext3 filesystem because when I didn't find a way to recover the inode table I decided I am gonna do it myself if I had to. Anyway after less than 12 hours I had a complete copy of all the files in my Linux partition.

8 hours ago I send to alt.linux asking the how to recover the inode table. An hour ago someone replied that I should run the command e2fsck. I tried running it from cygwin over windows, I couldn't specify the correct device, non was recognized. I have had downloaded Ubuntu live CD in case I'd have to reinstall it. I used it to run the e2fsck command (similar to chkdisk on NT). It fixed it and I was able to mount it. Then I used the super-grub disk bootable CS to restore the MBR back so GRUB on that fixed partition can run again. Then I booted into my dearest Linux, and the first thing I did was that I opened Kopete, changed my nickname, then opened firefox and wrote this article.

It was really bad 24 hours of stress with nightmares that I have to reinstall all that. And before I was able to take a copy of the files, I was afraid especially cuz the last version of the OS source was on that partition.

Al 7amd llah really.

## Wednesday, January 31, 2007

### Keeping it up

While I was playing NFS:Carbon today, I remembered this story out of no where. 7 or 8 years ago, there was a game on Playstation -PS 1 indeed- called "Gran Turismo 2". It was a car racing game. I kept playing it with no luck of winning any race. The game had mutli-level driving license system. Level A to C and anther 2 advanced licenses. Some races require licenses higher than the others. Of course those races gets you has a much higher winning prizes. After a year, I was able to get license A; I think that was the most basic license. To win a license you must win through some tests. Anyway, that made me finally can access better races, thus buy better cars. I stayed at this license for another year. Then I got license B. Winning prizes per race of license A only reached 400 dollars. But with license B you can access races that gives up to 5000 dollars. I kept trying to win races with no luck. I had bought a Nissan Skyline. I had hard time to win. With extra money, I upgraded the car. I also tuned it (by the way, it has an advanced performance tuning system that none of NFS have reacehd, most of it could be understood only if you have studied car mechanics in details); as a matter of fact I tried tuning it for several values randomly. I kept trying for 3 months till I found optimal values that made me win a certain race very easy. That race winning prize was 5000$. But still after that I couldn't win races that require License C; those races winning prize can reach 200,000$. While seeing what cars I can buy I found an 1000 Horse Power car (this particular car had a subtitle that this value is fictional, other cars are normally equivalent to the real thing). That car costs 2 Million $. Of course by only winning races of 5000$ I couldn't afford it. But that car really deserves it. I was sure that it can make me win absolutely any race. What do you think I did ????

## Saturday, January 6, 2007

### Linux XP ( joke )

(This "article" is a JOKE and has absolutely nothing to do with the real Linux XP distro. I have never used Linux XP myself and have absolutely no idea what that distro is like) , hey, just in case they sued me or something :D
This is a part of the text - see it for yourself :D:
Improved virus and worm support. The unfortunate fact is that there are many viruses for Windows but very few for Linux. Linux XP has a special support for Windows viruses, which means that Windows viruses can damage a Linux XP system just as much as they damage Windows! This makes users who migrate from Windows really feel like home. The new Outlook compatible mail client for Linux XP ensures the easiest and most efficient way of getting infected by new viruses and forwarding them to all of the user's friends. When a Linux XP system gets infected by a virus, a dialog box is displayed with a progress bar and the informative text "Please wait while your system is being damaged." At the same time some relaxing music is played in order to make sure the waiting is as pleasant as possible, since the process may take a while, depending on the virus.

Trojan Horse downloads. The Linux XP's website has huge software download archives, and the users can easily download many different Trojan horses to their system. And because every normal user on a Linux XP system has the same rights as the root user, our customers can be confident that the damages caused by Trojans are maximized on a Linux XP system, thus letting the users experience exciting moments.

## Friday, January 5, 2007

### Kids!

This video of one of our friends... :D : Khalid Adel Salama, Section 1, was the Student Union Vice President last year.

### Xgl/beryl On Ubuntu - some screenshots

They are all on my machine, not from the internet.

## Wednesday, January 3, 2007

Interesting... :D
Taken from: http://digg.com/hardware/why_doesnt_this_work_A_True_Dumbass