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

Wednesday, September 2, 2009

Emulator wiz Design

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


I had a nice experience last term wiz the Architecture project that I wanted to share here. We were supposed to make an emulator (for those who don't know the project, it's a simulation to what happens inside the processor).
The normal way to make this project is to use some IFs & ELSEs. My friend (who was a senior then) told me that it was so easy and that they called it "donkey work" :(
Since the emulator was my task in the Architecture, I got so frustrated to know this information and decided to think of a better way to do it.
My friend and I asked dr.Ahmed salah & he told us we could make it with components like what we did in VHDL and he left it open for us to know how this would be implemented in C#

First Milestone:

How to make a good design?

That was solved using design patterns. Here we used the observer pattern.

“ IObserver” was implemented by all the components & “ISubject” was implemented by the Clock.

interface IObserver

{

void Updateobject(ISubject subject);

}

interface ISubject

{

List ObserversList { get;}

void AttachObserver(IObserver observer);

void DeAttachObserver(IObserver observer);

void NotifyObservers();

}

Second Milestone:

How to connect all of these components?

We made a dummy class called processor, where all the wirings took place.

Third Milestone:

Same wire, 2 endpoints!

The same wire connected 2 components, and it doesn’t make sense to change the value on one endpoint without changing it on the other end.

We needed here a simple referencing to the values of the 2 endpoints of the wire. This wasn’t supported by the simple ref keyword in C#. I really can't remember why it had a problem. But I Do remember spending 2 sleepless nights trying to solve it, so it had a problem :D. Anyway we had to search for another way to do it.

We learned that when making an object of a class, we are given a pointer to this object & not just the value. We used this tip to implement our own passing by reference.

We made a MyString class, that didn’t contain anything but a string. And whenever we wanted to pass a string by reference we made an object of MyString & used it.

class MyString

{

public string str;

public MyString(string Str)

{

str = Str;

}

}

Here is a snap shot with all the classes we used in our project.

At last I wanna thank all the people who helped us.

Dr.Ahmed Salah & Dr.Karim Emarah for their support all the time.

Alaa Shaker for introducing us to design patterns.

And of course my team members: Sara (partner in this project), Menna & Mona for your help and ultimate trust :)

And for my team members, plz correct me if I said any wrong information and kindly add any missing ones.




Sunday, August 16, 2009

It's a bird

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

A very nice video that I just saw. Take some time to think after watching it.



I do believe that Ramadan is a very good chance to change ourselves.

Friday, August 14, 2009

yes we can!


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

Yesterday was the warm up contest for this summer and my team decided to join.

Our team name is "yes we can!". and before the contest, instead of preparing ourselves we said:
"yes we can...but who said that we will? :D", As our main aim was to spend some time together, have fun & use our brains :D

During the contest, mino said more than once:
"This problem is very easy, let's go to another one :D". The funny thing about that is that she meant what she said :D. Her slogan was "Thinking not Balloons :D"

The day went really nice. and the 3 of us had fun -which was the whole point of us participating- and we also won 2 balloons :D . After the contest, there was an event to honor those who won and also to announce the new committee. I was too tired to attend :( but i knew the details from my friends and I knew it went fine el7amdulellah :)

Thank you mino & s0risAr for this nice day =)
I know that both of you had some problems in attending and staying till the end.
I totally appreciate it.

love you both :)

Saturday, July 25, 2009

Finally :D

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

Finally I have a team for my graduation project.
Not just any team...but a wonderful one :)
4 friends that i love & respect.

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

very happy & excited
I hope we can do something nice together :)

pray for us :)