قُلْ إِنَّ صَلَاتِي وَنُسُكِي وَمَحْيَايَ وَمَمَاتِي لِلَّـهِ رَبِّ الْعَالَمِينَ - الأنعام: ١٦٢

Monday, December 28, 2009

Try to make a difference

Al Salam 3alikom w ra7mat Allah w barakatoh

This is a really Speechless Speech!!
A group of 12 & 13 years old, trying to make a difference.


"If u don't know how to fix it plzz stop breaking it!"

[One person can make a difference & everyone should try]

Tuesday, December 22, 2009

Utopia: Newsletter 1st Issue

Al Salam 3alikom w ra7mat Allah w'barakatoh

Today We Published our First Newsletter for Utopia 2010 :D
So take a look & Enjooy B-) :)

special Thanks to Alyaa =) (f)

Monday, December 14, 2009

It doesn't always work the way we want

Al Salam 3alikom w ra7mat Allah w barakatoh

It doesn't always work the way we want!

When I was a little kid, I was willing to be a doctor. It was my dream that I kept practicing every day. Whenever someone gets hurt, I go clean his wound and give him a bandage. I even had my own aids bag.

I was so much like the “little doctor” in the house.

In 1st secondary I suddenly decided to switch roads. I chose to enter the Math section, and was willing to join the faculty of Engineering.

But things don't always work the way we want. I ended up in FCIS!

و عسى أن تكرهوا شيئًا و هو خير لكم و عسى أن تحبوا شيئًا و هو شر لكم و الله يعلم و أنتم لا تعلمون

Really "و الله يعلم و أنتم لا تعلمون"

I had the chance to know AMAZING friends there, I was doing well in my study. And if anyone asked me now...entering FCIS is the best thing that happened to me ever since.

I just love it. I know for a fact that I'm not the best, and I'm not even near there. But I'm learning and will keep learning forever insha'Allah.

Those were 2 things in my life that didn't work the way I want. But since ALLAH knows what's best for me, they happened. I'm glad they happened, and I'm happy where I am now.

These are not the most significant, nor the most important. They are not the ONLY 2 things that didn't work the way I wanted. But they give the meaning.

"و الله يعلم و أنتم لا تعلمون"

And give the feeling of acceptance & satisfaction.

May Allah always lead us to what's right...Ameen.

Sunday, December 6, 2009

قهوة على الحائط

قهوة على الحائط


في يوليو 2007 وفي مدينة البندقية الإيطالية وفي ناحية من نواحي أزقتها النائية كنا أربعة موتورين نحتسي قهوتنا - بين العشوين - في أحد المطاعم ( .. (بورتو فينيسيا
جلس إلى جانبنا شخص وقال للنادل/ القرسون إثنان قهوة من فضلك واحد منهما على الحائط. فأحضر النادل له فنجان قهوة وشربه صاحبنا لكنه دفع ثمن فنجانين....! وعندما خرج الرجل قام النادل بتثبيت ورقة على الحائط مكتوب فيها فنجان قهوة واحد

وبعده دخل شخصان وطلبا ثلاث فناجين قهوة واحد منهم على الحائط. فأحضر النادل لهما فنجانين فشرباهما ودفعا ثمن ثلاث فناجين وخرجا....فما كان من النادل إلا ّ أن قام بتثبيت ورقة على الحائط مكتوب فيها فنجان قهوة واحد..!؟

وفي أحد المرات كنا بالمطعم للغداء ..ثلاثة هذه المرة ( الرابع كان صايم..) فدخل شخص يبدو عليه الفقر فقال للنادل فنجان قهوة من على الحائط..
أحضر له النادل فنجان قهوة فشربه وخرج من غير أن يدفع ثمنه..
ذهب النادل الى الحائط وأنزل منه واحدة من الأوراق المعلقة ورماها في سلة المهملات

تأثرنا طبعاً ( كعرب ويونان..) لهذا التصرف الرائع من سكان هذه المدينة والتي تعكس واحدة من أرقى أنواع التعاون الإنساني..

فما أجمل أن نجد من يفكر بأن هناك أناس لا يملكون ثمن الطعام والشراب
ونرى النادل يقوم بدور الوسيط بينهما بسعادة بالغة وبوجه طلق باسم ( مادام فلوسه بتوصلو على داير المليم ..)!!
ونرى المحتاج يدخل المقهى وبدون أن يسأل هل لي بفنجان قهوة بالمجان

فبنظرةٍ منه للحائط يعرف أن بإمكانه أن يطلب...ومن دون أن يعرف من تبرع به ..

لهذا المقهى مكانه خاصه في قلوب سكان هذه المدينة ...

منقووووووول


Monday, November 23, 2009

بـــــــــــــــــــاء

السلام عليكم و رحمة الله و بركاته

قصة حقيقية نقلًا عن معلمة أختي

كنت في الحرم لأداء مناسك العمرة و لفت نظري امرأة كبيرة السن تقرأ القرآن و هي تبكي بكاءًا شديدًا. أكملت مناسكي و كانت المرأة لازالت تبكي. استغربت لحالها و قررت أن اسألها عن سر هذا الخشوع و البكاء.
ذهبت لأسألها فأخبرتني أن لها عدة أولاد كبار، تزوجوا و أنجبوا و انشغلوا بحياتهم...و أنها طلبت منهم أن يعلموها القراءة كي تقرأ كتاب الله
فكانوا دائمًا مشغولين عنها...استمرت بالإلحاح عليهم حتى تحرك ابنها الصغير و علمها حرف الباء 'ب'.
علمها كيف يرسم في اول الكلام و في وسطه و في آخره. و لم يكمل معها باقي الحروف...حاولت مرارًا معه أن يعلمها حرفًا آخر و لكنه كان دائمًا مشغولًا.
فعندما ذهبت للحرم و أرادت ان تقرأ القرآن...كانت تبحث عن الحرف الذي علمها إياه ابنها و تقول "باء" و استمرت هكذا و هي تبكي لأنها لا تفهم شيئًا مما تقول و تبكي على حالها!!

هذه المرأة تبكي لأنها تريد فهم كتاب الله و لا تستطيع...و نحن نعرف كيف نقرأ و نكتب و لكن...؟؟
هي تذكرة لحمد الله على نعمه...و تذكرة لتدبر آيات الله...و تذكرة لبر والدينا

قال تعالى: " طه ( 1 ) ما أنزلنا عليك القرآن لتشقى ( 2 ) إلا تذكرة لمن يخشى ( 3 )"

الحمد لله رب العالمين

Sunday, November 22, 2009

Dr Wayne Dyer - The Story of Teddy


The beautiful story of Teddy and Mrs Thompson, the Elementary School Teacher who was so affected by the life of one of her students; and how she too became such a positive influence on his life ...

Friday, November 6, 2009

لعله خيراً

Al Salam 3alikom w ra7mat Allah w'barakatoh

probably you've read this story before. It's just a reminder :)

لعله خيراً
كان لأحد الملوك وزير حكيم وكان الملك يقربه منه ويصطحبه معه في كل مكان. وكان كلما أصاب الملك ما يكدره قال له الوزير "لعله خيراً" فيهدأ الملك. وفي إحدى المرات قُطع إصبع الملك فقال الوزير "لعله خيراً" فغضب الملك غضباً شديداً وقال ما الخير في ذلك؟! وأمر بحبس الوزير
فقال الوزير الحكيم "لعله خيراً"، ومكث الوزير فترة طويلة في السجن. وفي يوم خرج الملك للصيد وابتعد عن الحراس ليتعقب فريسته، فمر على قوم يعبدون صنم فقبضوا عليه ليقدموه قرباناً للصنم ولكنهم تركوه بعد أن اكتشفوا أن قربانهم إصبعه مقطوع, فانطلق الملك فرحاً بعد أن أنقذه الله من الذبح تحت قدم تمثال لا ينفع ولا يضر وأول ما أمر به فور وصوله القصر أن أمر الحراس أن يأتوا بوزيره من السجن واعتذر له عما صنعه معه وقال أنه أدرك الآن الخير في قطع إصبعه، وحمد الله تعالى على ذلك
ولكنه سأله عندما أمرت بسجنك قلت "لعله خيراً" فما الخير في ذلك؟ فأجابه الوزير أنه لو لم يسجنه لصاحبه فى الصيد فكان سيُقدم قرباناً بدلاً من الملك... فكان في صنع الله كل الخير

:) فلعله خيراً

Monday, November 2, 2009

Contouring

Al salam 3alikom w ra7mat Allah w'barakatoh

These are my notes about our next assignment in visualization.

(Polygon Filling Algorithm)

1st we'll be using the loader to load the mesh we need to color. This mesh consists of polygons. We'll be coloring these polygons.

We'll make a function with the following specifications
Input:
  • The polygon to be colored
  • The contours that we did last week
Output:
  • An array of lines with their corresponding colors (we'll get them from the color map editor we did 2 weeks ago)
How will we color the regions of the polygon??

using the lines from the array we just got [L1 & L2]. We'll iterate on all the vertices we have in this polygon [V1, V2, V3 & V4] and check if the region we are coloring contains this vertex or not.
If it contains the vertex, then add the vertex to -say- an array of points that defines this region.
After we finish this iteration, we'll be having a set of points that defines the regions to be colored.

in this example we'll have 3 arrays:
[L1, V1] [L1, L2, V2, V4] [L2, V3]
These defines the 3 regions [R1, R2 & R3]
Now What?

can we start coloring?
No, we still need to sort these points, to be able to color the regions.
How will we sort them?
take any vertex as a reference point, then draw the main coordinates (wiz respect to this vertex) & calculate the angles between the main coordinates and the lines.
Sort the angles & start coloring.

Here we took V4 as a reference point.
The Orange lines represent the main axes.
and the angles are (1, 2 & 3)


(Texture Mapping)

This should be faster than the "polygon filling" algorithm and easier to implement.
say we have 8 colors. We'll store them as 8 pixels in the memory.
We should normalize the values, so that they range from 0 to 1.
Also the values of pixels in the polygon, should range from 0 to 1.
Now we'll iterate on the polygon's pixels and get the required pixel (color) directly from the memory.
No distribution is used. We get the color directly from the pixels we stored.


I hope you find this post useful :)
Al Salam 3alikom w ra7mat Allah w'barakatoh

Thursday, October 29, 2009

Color Map Editor

Al Salam 3alikom w ra7mat Allah w barakatoh :)




It's an assignment we took in visualization. The color map editor.


Does this picture look familiar?
I guess most of us has seen similar pics in our geography study @ school

How was this picture drawn??
As u can see, the brown parts represent high areas (like mountains), green parts are just ground & blue will be the see level.
These colors map to specific heights. This is shown in the gradient between colors. like this between beige & brown.
This is color mapping!

Why do we need this?!
We need color mapping because if this data was given in its numerical form, it would be really difficult for ppl to interpret. This visual form makes things easier & more fun.

How do we make this color mapping?
we have 2 main methods to this
  1. using a look-up table
  2. using a transfer function
what are these methods, and which one will we be using?
It depends on the problem we have.
If we have specific discrete values, we can use the look-up table. It will probably do the job required and it is easier to implement.
If we have continuous values (like the gradient mentioned above), we'll need to use the transfer function. Because when we use the transfer function we not only map 2 colors (for example) but we map all the gradients that lies between them, which represents more data.

Now let's talk about the 2 methods we have
Look-up table (LUT)
as mentioned b4, it is suitable when we have specific discrete data.
as you can see here, there are only 6 colors that represent some ranges of data
  • less than 18 --> baby blue
  • 18 - 20 --> light blue
  • 20 - 22 --> off white
  • 22 - 24 --> orange
  • more than 24 --> red
  • if the depth is less than 1000m then it's mapped to white
this can be reflected in a table that contains these colors (array).
when given a value "S", this value is mapped to a color "C".
Index(c)=([(S-Smin)/(Smax-Smin)]*numberOfColors)
if S was the min value, then Index(c) will be equal to 0*numberOfColors = 0 (1st color)
if S was the max value, then Index(c) will be 1*numberOfColors = numberOfColors (last color)
and of course if it was in between them it will give us an index in the array of colors we have.

This is briefly how the LUT works.

Now what about the transfer function?
What's special about it?

Transfer Function
The special part about the transfer function is mapping every gradient between any 2 colors.
as you can see in this picture, every color is a start in a range of values, till another range begins.

How will we get a value to a specific degree of the color?
Using Interpolation.
Let's start with an easy example.
if the first color is red (C1) & the 2nd color is yellow (C2)
C1 represents a value of 100 and C2 represents 200
and we want to know the value of the color corresponding 150
what will we do?
This is a simple case, as we know that the required color (C3) lies exactly in the middle of C1 & C2
so we deduce that C3=0.5*C1 + 0.5*C2

what if it didn't lie exactly @ the middle of 2 colors?
We'll calculate where exactly does it lies. This will be i (index of previous color) + f (fraction). (i+f) will be smaller than (i+1), as it lies between i & (i+1).
i = floor ((S-Smin)/∆S)
f= (S-Smin)/∆S – i
then, C = (1-f)*Ci + f*C(i+1)




i: is the index of a color
f: is the fraction in a given index

This will give us the exact color of any value in our continuous data. Hence, we'll be able to formulate a visualization like the one shown above :)

I hope you find this post interesting & useful :)



Al Salam 3alikom w ra7mat Allah w barakatoh

Thursday, October 22, 2009

Alhamdulillah


Al Salam 3ailkom w ra7mat Allah w'barkatoh


Sometimes I wish I had a simple life, just like a rock or a tree

But Alhamdulillah - Alhamdulillah I'm a person

And Allah has given me a choice that's free

So, Alhamdulillah - I choose to be a Muslim

And there's nothing else I'd rather be

Thursday, October 15, 2009

Effective Motivation Tips..

Al Salam 3alikom w ra7mat Allah w barakatoh

I don't know if I'm the only person here feeling "I still want my Vacation!!" or what
but anyway, some motivation tips won't harm.

The following is ALL collected from the Internet

This is a really nice video and it's only 1 min & 18 sec.s

Life = Risk


Always Remember to...


Effective Study Motivation Tips :

Get yourself to pick that book up now!

Well you’re not the only one feeling this way. Whether you are currently a student studying in school or an adult picking up new knowledge, all of us have experienced lack of motivation to study. This is especially so when the subject you’re studying interests you as much as watching paint dry!

Fortunately, with will power, determination and some simple tips & techniques, anyone can turn their dislike into study motivation.

Studying can be fun, interesting and exciting. Never label studying as “boring”, “painful” or “uncomfortable”. That way you’ll be pre-framing yourself negatively even before you start. You’d have lost the battle before it even began. In fact, don’t even call it a battle.
Studying is a meaningful journey of discovery.






Skipping seminars to stay in bed? Here's how to avoid
sleepwalking through your course, and get motivated.

----------------------------------------------------------------

Videos from the YouTube:
nevergive1680x1050.jpg (1680×1050)


and always remember to have good intentions :)
بسم الله الرحمن الرحيم
قل إن صلاتي و نسكي و محياي و مماتي لله رب العالمين * لا شريك له و بذلك أمرت و أنا أول المسلمين
سورة الانعام اية 163 - 162

Wednesday, October 14, 2009

Steps [0]: Utopia...A Deeper Look

Al Salam 3alikom w ra7mat Allah w barakatoh


Steps [0]: Utopia...A Deeper Look
Steps [1]: A Vision


Utopia...المدينة الفاضلة
The Perfect Place
That place that doesn't exist in real life.
I really wish some day we would come to a point where people are seeking to build this Utopia.

I have this paper now on my notice board

It's as shown "my steps to paradise" paper..
It should contain steps that I'm already taking right now and stuff that may encourage me.
Now it has an intentions paper & a statement which says: "Utopia...a deeper look".

For me "Utopia" always referred to the conference held in Talaee el Kamal School. but in this paper I meant another Utopia.
A bigger Dream that I have...

1st you'll need to know my motive...so check this fatwa about cartoons for kids and search for:
"وهذه بعض الإيجابيات من مشاهدة الطفل لهذه البرامج :"
and start reading from there.

The following was concluded:
بعد تبيّن هذه الإيجابيات والسلبيات ، يبدو الموقفُ الشرعيّ بعدَ ذلك واضحًا إن شاءَ الله تعالى ، فكلما وجدت السلبياتُ أكثر اقتربَ الحكمُ إلى التحريمِ أكثر ، وما أمكنَ فيه تجنبُّ هذه السلبيات اقتربَ إلى الجواز ، وهذا يدلنا على ضرورةِ السعي لإيجاد شركاتِ إنتاجٍ لأفلامِ الكرتونِ الإسلاميةِ ، بحيث تُغرَسُ فيها جميعُ الفضائل ، وتُنفَى عنها جميع المضار والرذائل .

This was how I had this Dream..
I came to this fatwa when i was searching for something which is totally unrelated to it.
I read it & I had my vision of this company...The R&D department not only wiz employees but also with kids to develop the most interesting cartoons & games EVER.
I remembered "Richie Richie" and how the little boy & his friends began in developing the chocolate to have a better taste. Well they are the target market, so their opinions must be highly appreciated & most probably will be VERY valuable!

I can see the kids enjoying watching these cartoons & gaining wonderful experience & developing their skills. I can see their parents feeling safe that their kids are not harmed in anyway by watching these cartoons, in the contrary they're always gaining more information & their behavior is getting better.

Well it's not just that. They're also learning about The Prophet -peace and mercy be upon him- & the noble companions. I see a 10 years old boy/girl knowing as much information as if they've read encyclopedias. I see them enjoying their science class @ school, because they saw the real thing in the cartoon & they can relate to it.
I see them having a vision to their life & a Big goal :)

I see a whole new better generation coming up to raise this Umma!

you may think of it like: "give me a break, all of this gonna happen because of a cartoon company?!"
well have you ever heard about the story of Microsoft, Apple or Pixar animations??
They all started small, ended BIG.
What make them special or better than us??
I guess it's the will. and the wish to change.
"Dare to make a difference".

i've always been praying Allah to Use me :$
and Subhan Allah I've passed by this fatwa wiz no apparent reason.
I had this idea & I took some steps towards it (okay little ones, but @ least i'm thinking about it now).
So here I am again praying Allah "اللهم استخدمني و لا تستبدلني"
and asking for the HIS Help & Mercy
and hoping that one day I'd make something that deserve to be brought with me yawm Al Keyama to tell prophet Mohammed "I did that for Allah, for You & for Islam".

May be "Utopia...a chance to change" is the nawah (seed) for "Utopia...A Deeper look"
May be both together would affect the new generation & would make people happier.
A Chance to Change...

sorry if i've been talking a lot about an idea...that may or may not be true one day
and most probably ain't important to most of the readers now :$ :$

I just wished to share...may be this would motivate someone to make something good and may be it would push me to take more real steps :)
Thanks for reading =)
Al Salam 3alikom w ra7mat Allah w barakatoh

Wednesday, September 30, 2009

Problem Solving

السلام عليكم و رحمة الله و بركاته

I came through three interesting links yesterday. May be they are common, I'm not really sure.
Here they are..

-UVA toolkit
Here you can browse for a problem, write the Input & it generates the output for you.
Perfect for testing when you think you have the problem right :)
It also links you to the problem statement and the statistics of the problem.


Here, there are 2 useful links
  • C programming basic
  • Algorithm
  • Math puzzle
  • IQ
where you can check the source codes of some problems.


If you navigated to the "UVa" on the left side, you can choose a volume and browse for problems.
Then you can check the category & difficulty of your problem.
If you chose a specific problem, you get some hints for it & sometimes the code is available too.

Monday, September 28, 2009

Detecting the "Enter" key

السلام عليكم و رحمة الله و بركاته

This is a short post.
almost a year ago, I tried to solve a problem on the UVa and i got it "Time limit exceeded". I knew before submitting that it won't be accepted, as i didn't know how to detect the "Enter" key press and it was needed as a stop condition for the first loop :D

anyway, here we go
if you are trying to use "cin" then you'll not be able to detect the new line.
when debugging, u may enter 10 new lines & then a value...i mean it will wait for the value and won't consider the new lines!

you may go to a lower level
if(cin.get() == '\n')
but that's when u are expecting the enter to be pressed
as it reads 1 char only

or u can use "cin.getline()"
and then check for the string's length
if == 0 then "Enter" is pressed
That's useful when u r expecting a mix of strings & enters


sources:
ACMaa Magdi (thanks :))

Thursday, September 24, 2009

Let's Share, shall we?

السلام عليكم و رحمة الله و بركاته

Do u remember having some milestone in a code & finding the solution somewhere online??
happens a lot, right?

i do remember our algorithms project...when my friends & me searched for the algorithms online
and sometimes we used to get the source code to be able to understand something
i remember LOTS of assignments and searching for codes to do a specific task
i remember searching for a function and not understanding it except when i see it in use
i guess we all had this very same experience through our past years in college

for me, it has been from the very first time I started writing code that I considered the Internet as my primary gate. It has always been helpful.
So i guess now it's time to pay back.

Many people have this urge of helping others. I felt this spirit in FCIS.
Students giving sessions, posting informative topics in their blogs, helping each others in anything & everything!

I owe Roaa for motivating me to do the prolog project. I used to hate it, really, and i just didn't know what could be done with this silly language.
I downloaded her documentation & saw the program snapshots. Thinking that she was just as old as me, and nearly with the same experience gave me the required confidence and the will to do something good.
I also remember in our algorithms project when we didn't know how to read the image to do the processing we needed, we almost did it because of her topic here
last but not least, open sourcing their image package project :). Well, i personally think that it was a great idea, and I guess it will motivate people to share more :)

So now that I have the urge to help others. I decided putting every useful thing I write online for people to get use of.
I know for a fact that I'm not very good in writing code. Maybe I'm not the most organized nor the most optimized. But at least I find a way to get the job done, and maybe it will help someone.
It's an open invitation for you to help others :)

Good links:

feel free to add more resources :)

SPREAD KNOWLEDGE: الحكيــــــــــــــــــــــــــــــــــــم

السلام عليكم و رحمة الله و بركاته

just read a post in my little sister's blog, and thought of sharing it

SPREAD KNOWLEDGE: الحكيــــــــــــــــــــــــــــــــــــم

It reminded me of the quote:
"Two men look out the same prison bars; one sees mud and the other stars."

Most of the time ppl have different opinions in the same thing. You may ask yourself how come
someone saw something in some way different than u? and u may think it is totally weird and everything, but it is not weird at all!
we all have different backgrounds. We don't share the same type of thinking nor the external effects.
In other words we don't all wear the same glasses!

So what can we do about this?
It's really simple...
-listen to other people
-put yourself in their shoes
-accept that we are all different
-try to appreciate a little

and remember to make sure that you understood what the other person is telling you in the way he/she means it.
always ask for feedback :)