Finally, EDC 2008
icon1 Roaa Mohammed | icon2 EDC, Microsoft | icon4 03 28th, 2008|
I wrote a previous post about the timing of the EDC, finally the registration is now opened...
Check out the details at http://edc2008.com/
It is for 2 days (13th & 14th of April) in Cairo international Conference Center..
See you there in shaa Allah..





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

الشركات والمؤسسات التجارية هي عامل هام في نهضة البرمجيات الحرّة وتطويرها، ولا يجب نبذ أهميتها بأي حال من الأحوال، ليس لقوة نفوذ تلك الشركات، ولكن لأن أغراضهم وإن كانت تجارية بحتة فإنها ليست بالضرورة معارضة لمبادئ حرية البرمجيات، وطالما أنهم يقدمون تجارة لا تعارض تلك المبادئ، فإن هذا من شأنه المساهمة في نشر البرمجيات الحرّة ودعم تطويرها. فمجتمع البرمجيات الحرّة ليس مجتمعا قائما على العمل الخيري والتطوعي، بل هو مجتمع قائم على مبادئ الحرية والمشاركة، وليس في هذا ما يتناقض مع الأغراض التجارية بأي حال من الأحوال.

*تم نشرها كافتتاحية في مجلة لينكس العرب





EDC registration is open!
icon1 Mahmoud Zidan | icon2 Uncategorized | icon4 03 27th, 2008|

Microsoft EDC
EDC 2008 is the biggest Developers Conference of the year in Egypt, and is a critical event for any developer who wants to see the newest as well as the next-generation technology. EDC is full of sessions and activities that help you to learn the current and the future of the Microsoft Platform and get to know people who are as passionate about software as you are.

Benefits of Attending EDC 2008
Egyptian Developer Conference is designed to help those who build, deploy, or operate solutions based on Microsoft technologies. It helps professional developers, designers, analysts and architects to learn the capabilities and the possibilities with the current Microsoft .Net Platform. It also helps technology managers evaluate the range of technologies to consider for the future growth and management of their ongoing IT systems needs and requirements.

Who should attend
Whether you are an amateur developer, a "code-guru" or anything in between, you need to be at the biggest developer conference in the region. Code developers, webmasters, web designers, infrastructure architects, applications & database developers, hobbyists or just plain geeks: If your job title has even a passing resemblance to any of these, be sure to be there. This developer conference is your window into the future of the Microsoft platform and the software industry as a whole. After the event, you'll be more informed, more skilled, and more inspired than ever before.

Hurrrry up registration is limited...
Registration: http://www.edc2008.com/Register.aspx
Agenda: http://www.edc2008.com/Agenda.aspx


Source FCI-H





I’m tagged !!
icon1 Roaa Mohammed | icon2 Tags | icon4 03 24th, 2008|
Asmaa has tagged me to write 8 things noone knows about me.. so here they are..

1- I don't like tagging.. & I always thanked god noone ever did that to me.. & I always wondered what forces people to reply back !!
2- I slept yesterday 3 hours only cause I had two exams today & I'm so tired.
3- I have 4 little tortoises at I home.
4- I stopped drinking soft drinks (Pepsi, 7-up, soda.. etc) for 9 months till now & planning to stop it forever in shaa Allah.. (They are so unhealthy, I recommend you all to do so)
5- I was in the Egyptian Basketball National Team till I was 16..
6- I love cartoons so much.
7- I took First Aid course in the red crescent.
8- I think there are many things that most people don't know about me !!

Finally, finished the 8 points !! ..
Anyway,I'm not planning to tag anyone..




Google Summer of Code™ is on!
icon1 Mahmoud Zidan | icon2 Uncategorized | icon4 03 22nd, 2008|

Google Summer of Code is a program where Google funds students to work on Open Source projects over the summer. They have recently announced their mentor organisation list .

Over the past three years, the program has brought together over 1500 students and 2000 mentors from 90 countries worldwide, all for the love of code. We look forward to welcoming more new contributors and projects this year.

All participating mentoring organizations for 2008 have provided additional information for their would-be students, including a list of sample project ideas. Take a look and see which ones most closely match your skills and interests, then start talking to your would-be mentors! They'll begin accepting student applications on Monday, March 24, 2008, so you have a full week to get to know more about what your would-be mentors are looking for and to hone your proposal ideas. Remember, the more a mentoring organization knows about you, and you about their code base and community, the more likely it is that your application will be attractive to your potential mentors.

Why not put an application in and get PAID to work on a Open Source project over the summer!


Important Urls:

Google Summer of Code home

Important Dates (and Times)







SQL and some remarks
icon1 Eslam Afifi | icon2 Beginner, SQL | icon4 03 21st, 2008|

Since there is no time now to talk in details about SQL, I'm pointing out some notes and links to articles and websites that discuss SQL in a simple manner. So, if you have questions, leave a comment.
http://www.w3schools.com/sql/default.asp
http://www.codeproject.com/KB/database/sqlintenmin.aspx
http://www.databasedesign.co.uk/sqlselectshortsummary.htm
http://msdn2.microsoft.com/en-us/library/ms189463.aspx

SQL Constraints

http://www.1keydata.com/sql/sql-constraint.html

Notes:
  1. SELECT TOP n WITH TIES will not select all repetition, instead it will select repetitions till the first truncation. And it is only to be used with ORDER BY.
  2. To get the current date use the GetDate() function.

Here is a file containing some windows applications and SQL notes thanks to Abd El-Rahman. I haven't review it's content, so, here is the file[^] as it is.





Event-Driven Programming
icon1 Eslam Afifi | icon2 C# 2.0, Intermediate | icon4 03 21st, 2008|

Hey guys, how are you?

Here we discuss windows event-driven programming. There are some stuff must to know, I know they sound hard but in fact they are very easy.


The Message Queue


Unlike MS-DOS-based applications, Windows-based applications are event-driven. They do not make explicit function calls (such as C run-time library calls) to obtain input. Instead, they wait for the system to pass input to them.

The system maintains a single system message queue and one thread-specific message queue for each graphical user interface (GUI) thread.


Whenever the user moves the mouse, clicks the mouse buttons, or types on the keyboard, the device driver for the mouse or keyboard converts the input into messages and places them in the system message queue. The system removes the messages, one at a time, from the system message queue, examines them to determine the destination window, and then posts them to the message queue of the thread that created the destination window. A thread's message queue receives all mouse and keyboard messages for the windows created by the thread. The thread removes messages from its queue and directs the system to send them to the appropriate window procedure for processing.


With the exception of the WM_PAINT message, the system always posts messages at the end of a message queue. This ensures that a window receives its input messages in the proper first in, first out (FIFO) sequence.


The WM_PAINT message is a message from the system to tell the application it must draw itself. It has the highest priority in the message queue to maintain responsive GUI.


The Message Loop


The main task of the WinMain function is processing the message queue. It will get a message from the queue and pass the message to the appropriate function to process it then remove it from the message queue.


// this is a generic simplified C++ windows application's WinMain body

while(GetMessage(&msg)) // retrieve a message from the application message queue (by reference)

{

    TranslateMessage( &msg ); // prepare that message in the message queue to be processed

    DispatchMessage( &msg ); // determine and call the function that will handle that message

}

So, the DispatchMessage will know which Control will process the message and call its WndProc function and from there The OnClick, for example, and then raise the Click event.

Events


Events are delegates that will be invoked when specific actions happen.


public delegate void SampleEventDelegate(string someData); // here we define the delegate singature


public class SampleEventSource

{

    public event SampleEventDelegate SampleEvent; // here we declare that there is a public event named SampleEvent of the same signature as the delegate SampleEventDelegate

}

The same rules of delegates apply to events. So, when we add an event handler to that event it must be of the same signature. The following line we create an object of the SampleEventSource and add an event handler to its event.


obj.SampleEvent += new SampleEventDelegate(myfunction); // that we already have a function called myfunction in the class we're declaring the obj object with the following declaration.



private void myfunction(string data) {     MessageBox.Show("Event raised with these data\n" + data);

}

You deal with event the same way you deal with delegate. So, any of following lines of code will do the job.


obj.SampleEvent += new SampleEventDelegate(myfunction);

obj.SampleEvent += myfunction; // implicit conversion to delegate

obj.SampleEvent += delegate(string data) { MessageBox.Show("Event raised with these data\n" + data); }; // anonymous method

As you see here, there is no EventArgs e or object sender in the code above and yet the code is correct. The EventArgs e is to supply the data you want to the event in conventional way instead of passing your data as single parameters like the code above. So, if you want to pass data along with the event, create a new class that inherits from the EventArgs class and extend it with the members and functions you want.


What about the object sender? Because of the fact that a single function can handle more than one event, these events can be events of different objects, you need something to tell you which object triggered that function. This becomes handy in situations like when you're creating a calculator application, instead of having 10 functions with almost the same code to handle the Click event of the 10 numeric Buttons, you make only one function to handle the 10 Buttons' Click and then use a switch statement to control the function behavior.


You can handle the same event with more than one function and they will get executed in the same order they were added to the invocation list of the delegate.


Windows Controls Events


Windows Controls provide events that will automatically be raised by the control itself. All you have to do is assigning event handlers.


Examples,

The Control.Click event will be raised when the control gets clicked.

The Control.MouseEnter will be raised when the mouse enters the control's region.


Here is a simple demo of events, I hope I covered everything.


And some useful CodeProject articles, you may find extra information in them but it's ok, skip the advanced parts.

http://www.codeproject.com/KB/cs/event_fundamentals.aspx

http://www.codeproject.com/KB/cs/events.aspx


The information provided about the Message Queue and the message loop are from the Platform SDK for Windows XP SP2.





فداك نفسى يا رسول الله

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

المهم تيجو نفكر فى الكلمة شوية

فداك نفسى : يعنى انا هضحى بنفسى عشانك ، النفس الآمارة بالسوء اللى معظم بلاوى البنى أدم منها

طب هو النبى صلى الله عليه وسلم عاوز من نفسك ايه؟ ، النبى صلى الله عليه وسلم مات يا جماعة " إنك ميت وإنهم ميتون " سورة الزمر الآية30

يبقى نقدر نقول كل واحد ردد الشعار ده "أفلحت إن صدقت" و نقدر نقول لو عملت بالكلمة دى صح هنلاقيك ملاك طاهر برئ و مش بتعمل اى مشاكل و لا بلاوى

طب هوه الكلمة دى كفاية؟ ، طب سؤال تانى لكل واحد ردد الشعار ده ، انت ايه تعرفه عن النبى صلى الله عليه وسلم ممكن تقوله لواحد بيؤذى النبى صلى الله عليه وسلم عشان يبطل يعمل كده؟ ، طب سؤال كمان : عملت ايه غير انك تقول الكلمة دى عشان النبى صلى الله عليه وسلم ؟ ، اصل اى حد ممكن يقولها ، حتى الرسام اللى رسم الرسوم دى ممكن يقولها ، ساعتها ايه الفرق بينك وبينه

كفاية كده كلام عن الشعار ده و خلاصة القول "ان الشعارات و حدها لاتكفى بلا عمل"

المهم ان إيذاء الأنبياء موجود من قديم الأذل

خد عندك

"يَأَيهَا الَّذِينَ ءَامَنُوا لا تَكُونُوا كالَّذِينَ ءَاذَوْا مُوسى فَبرَّأَهُ اللَّهُ مِمَّا قَالُوا وَ كانَ عِندَ اللَّهِ وَجِيهاً " الأية 69 سورة الأحزاب

و الشيخ الشعراوى بيقول فى تفسيره للأية دى ان بنى اسرائيل قذفوا سيدنا موسى عليه السلام "1:03"

و فى ظل ترديد الشعار السابق ع الفاضى و المليان لفت نظرى كلمتين

الأولى من واحد مثقف جه فى التليفزيون زمان وقال :

"السيد المسيح عليه السلام ايضا تعرض للسب و مش بس كده ، ده فيه رسام تناول السيد المسيح فى صورة اباحية فلو كان كل العالم اللى انتفضت للإعتراض على إيذاء رسول الله صلى الله عليه و سلم عملت نفس الكلام من أجل السيد المسيح عليه السلام ، يمكن كان الناس التانيه قدرت ان احنا صادقيين فى نوايانا و مش متعصبيين زى ما بيقولو علينا"

"مكنش ينفع اعدى الكلمة دى من غير ما شوف الصورة دى و اجوجل و لقيت الصورة مشهورة جدا و موجوده على ويكى فلو مش هتقول ايه اللى خلاك تحطها فى البوست ده و من باب العلم بالشيئ لعلك تصلح شيئا ما، ممكن تعرف كل حاجه عن الصورة من.................................... هنا"

تصدقو كلام الراجل ده طلع صح انت فاكر الأية قبل الأخيرة فى سورة البقرة

"ءامن الرسول بما أنزل إليه من ربه و المؤمنون كل ءامن بالله و ملائكته و كتبه و رسله لا نفرق بين أحد من رسله"

و هكررها تانى لا نفرق بين أحد من رسله حتى فى صد الإساءة يا جماعة

الكلمة التانيه اللى لفتت نظرى كانت من مروة الصغير 2008 فى حفلة تسليم جوايز مسابقة الرحيق المختوم فى الكلية لما قالت :

"فى وسط الإيذاءات اللى تعرض لها رسول الله صلى الله عليه وسلم كان نفسنا ان الناس يعرفوا سيرة النبى من خلال مسابقة عن كتاب للسيرة زى الرحيق المختوم"

و الله احسن حاجه فى الكلمة دى انها تناولت عمل بلا شعارات

التجربة نجحت من وجهة نظرى المتواضعة:

- ناس كتير قرأت الكتاب و عرفت شيئ عن سيرة النبى صلى الله عليه وسلم عليه الصلاة و السلام

- و ناس كتير جاوبت على المسابقة من شتى انحاء مصر

- و ناس ساهمت فى الجوايز اللى زادت قيمتها 10 اضعاف عن القيمة اللى توقعوها

- و أربعة أو خمسة بس هما اللى كسبوا الجوايز منهم مروة بس من حاسبات و الباقى كانو ناس من أسكندرية و جامعة الأزهر و مش فاكر الباقيين كانو من وين

تجربتى مع الكتاب

انا الحمد لله اشتريت الكتاب و بقرا فيه دلوقت خلصت 320 صفحة من 400 و داخل اهو على فتح مكة و بعدها نختم بجة الوداع و طبقت مفهوم الف ليلة وليلة بقراءة الكتاب قبل النوم مباشرة ، كل يوم 70 % منى يبقى تحت البطانية و اقرا ربع ساعة او نص ساعة و اطفى النور ، و انام و طبعا كل لما استمتع من القراية اقعد ادعى للناس اللى خلونى اقرا الكتاب شوية دعا من القلب فى جنح الليل

تصدقو كنت هنسى اقول اسماء الناس اللى بدعيلهم على مدار 400 صفحة (مروة الصغير و نهى محمود و هبة عصام) 2008 و كل واحد هيقرا الكتاب لازم يدعى لهم

بقية الكلمة بتاعت مروة الصغير 2008

"يا جماعة احنا عاوزيين نعمل مسابقة تانيه و مستيين اقتارحاتكم لإسم الكتاب الجديد او اى شئ تحبو تقترحوه"

و ده سبب كتابتى للبوست ده

يلا كل واحد ممكن يقترح كتاب نقراه و نعمل منه مسابقة كل الناس تشارك فيها و كل واحد قرا البوست لازم يقترح و تعاطفك لوحده مش كفايه ، اتبرع و لو بإقتراح فى التعليقات او ع الميل ده fcisall@gmail.com

و دى اقتراحاتى لفريق الرحيق المختوم سابقا:

- الكتاب اللى بيزغزع "لا تحزن لعائض القرنى" لأنك طول ما انت قاعد تقرا الكتاب تحس انه بيزغزغك عشان تضحك و تقوم تعاود الحياة و العمل

- و سمعت عن كتاب الفوايد لإبن القيم بس مقريتوش للأسف

- و انا بحب السير الذاتية و بعشق واحد اسمه قطز عشان اسمه محمود زى اسمى و بستمتع كل ما اقرا عن حياته و قريت كتاب الفاروق عمر بن الخطاب لعبد الرحمن الشرقاوى و هو كتاب ممتع جدا

- اتمنى انتظام مواعيد الأسئلة و عدم إطالة فترة المسابقة الجديده

- اتمنى ان التفاعل من المشاركين يكون اننا نجيب كتاب قديم ملوش حقوق ملكية فكرية و مش موجود اون لاين و كل واحد ياخد صفحتيين يكتبهم و نحط الكتاب على و يكى بوكس

- اتمنى ان المشاركيين يعملوا كام صفحة ويب بى اتش بى او ايه اس بى دوت نت و نحطهم على اى منتدى من بتوع الكلية و الناس تجاوب على الأسئلة اون لاين و ممكن حتى اللى قرا الكتاب يقترح الأسئلة اون لاين و نعمل ميلنج لست للناس المشتركة و نبعتلهم عليها كل معلومات المسابقة بإنتظام

نسييت اقول حاجه :

البوست ده لكل الناس و الدليل انى قريت كتب كتير عن الرسول صلى الله عليه وسلم مؤلفها ناس مش مسلميين لدرجة ان فيه كاتب كتب فى مقدمة كتابه "ليس غريبا ان يؤلف كاتب مسيحى كتاب عن سيرة رسول الله لأن السيرة الذاتيه هى دليل لكل من اراد ان يقتدى بالعظماء ايا كانوا" بتصرف

و الدعوة ثقافية بحته ، ثقافية بحته ، ثقافية بحته و عامة لكل للناس و بالخصوص لطلبة حاسبات

و بعد ما تزهق شوية من الكود و المذاكرة ممكن تشاركنا بالتعليق و تعاطفك لوحده مش كفاية ، أتبرع و لو بفكرة فى التعليقات او ع الميل ده fcisall@gmail.com

و معلش يا جماعة : انا مش عاوز ارد ع التعليقات فى البوست ده بالذات عشان تبقى التعليقات للإقتراحات فقط و مشوهش التعليقات بردودى





Microsoft Student Festival 2008 Wave..
icon1 Roaa Mohammed | icon2 Internship, MSP, Microsoft | icon4 03 19th, 2008|
Ahmad Fathy -MSP in Engineering, Alexandria university- is making a series of posts on his blog about Microsoft Student Festival..
He asked me to contribute in the Microsoft Student Festival 2008 Wave by sending my experience in MS Internship booth, check the post here.
Thanks Ahmad & waiting for more interesting posts !!




Alsalam alikom wa ra7mat Allah wa barakatoh

Recently, we have ran into a problem when we had to modify Install Shield script to programatically configure some security policies while being installed. We thought this information may come in handy for some of you. However, I know not much people will be interested in such a detailed problem...

Our deliverables will be:
- a .inf file a security template file that contains the proposed configurations
- a .sdb file (Security DataBase) this is able to inspect the client policies and modify/configure it.
- a .rul file (Install Shield Script) that is able to install such configurations

Let's start one by one,
  1. Open Start Menu -> Run -> MMC and hit enter
  2. File menu -> Add/Remove Snap-in
  3. Press Add and choose "Security Configuration and Analysis" then hit Add
  4. Choose "Security Templates" and hit Add... then Ok to close the main dialog
  5. Expand Security Templates and Add a new template as in the picture

  6. Choose a name (Tmpl Trial for example) and description then hit okay
  7. Now expand the newly created template, and configure it as you wish.

  8. Right click on the template, save as and choose any place you want to save it in (by default a file will have been created for you)
  9. Right click on the Security Configuration and Analysis, choose Open Database
  10. Type a name for the data base you want to create, let's call it Tmpl Trial DB
  11. It will ask you to pick a template for it, choose the .inf file you have saved earlier (in step 8).
  12. bingo, just close the mmc and don't save the Console1 if it asked you to :)

If you didn't change the default paths, you will find those files in My DocumentsSecurity
Now we've created the .inf and .sdb files... the only remaining task is to write the script that will apply the configurations

For those not familier with IShield script, what we basically want to do is to execute this command:

C:WindowsSystem32secedit.exe /configure /db "C:....Tmpl Trial DB.sdb"

There are a couple of things we don't know about,
  1. The path of the Windows Directory... you can replace that part with WINDIR macro
  2. The path of the .sdb file, you can make sure it's being copied to the installation directory, and then you can use INSTALLDIR macro

So, here is a sample script:
szApplication = WINDIR ^ "system32\secedit.exe";
szParameters = "/configure /db "" + INSTALLDIR + "Tmpl Trial DB.sdb"";
LaunchApp(szApplication, szParameters);

N.B. Of course to run the installer we need a user who has privileges to configure the security policy.

That's all...

Happy coding :)

Alsalam alikom wa ra7mat Allah wa barakatoh




Static and non-static
icon1 Eslam Afifi | icon2 Beginner, C# 2.0 | icon4 03 19th, 2008|

Hi everybody, how are you doing?
Here we discuss some theoretical stuff for the mid-term exam. Sorry guys, I know we all know those stuff, consider it a quick revision. I hope I cover every thing. If I forgot to mention anything or said anything incorrect, please correct me. I welcome your comments.

The this keyword
We can say that this refers to the object of the class which will execute the code.
The equivalent keyword of this in Visual Basic.Net is Me which is a very self expressing name.
You cannot assign a value to this. A line like this = null; or this = new Foo(); causes compilation error because this is read-only.
The this keyword is also used to create indexers. It is also used in C# 3.0 to create extension methods.

The static keyword
Static members (variables or methods) don’t belong to a particular object. They belong to the class.
You don’t need to create an object to access a static member, because it belongs to the class.
The equivalent key word of static in Visual Basic.Net is Shared. This is a self expressing name because static variables are shared across all instances (objects) of the class.
The static keyword can be combined with other keywords (private, public …) in a meaningful context.
Static members can address only other static members of the same class but not the non-static ones.
Non-static members can access static members of the class.

Static variables
Consider the following class.

class Foo
{
    public static int SharedVariable;

    public void AddOneToTheSharedVairable() // this is an instance function. can only be called by an object
    {
        SharedVariable += 1; // static member are accessible
    }
}


Take a look at the following code snippet.

Foo.SharedVariable = 5; // I don’t have to created any objects of the class before I access a static member. note that the variable is also public

Foo f1 = new Foo();
// f1.SharedVariable // error. the static member doesn’t belong to the object but it belongs to the class.
Foo f2 = new Foo();
// now we have created 2 objects of the Foo class

f1.AddOneToTheSharedVariable(); // the static variable is changed by an object of the class
// now lets see what happened to the static variable
Console.WriteLine(Foo.SharedVariable); // 6

f2.AddOneToTheSharedVariable(); // now the object f2 is also changing the static variable
Console.WriteLine(Foo.SharedVariable); // 7

Static methods and the this keywords
Static functions and static properties can’t address the this keyword because they belong to the class not to an object. The this keyword is not available in the context of static members.

Notes:
• When all objects should share the same value of a variable you should use static variables. Example, a war game, each soldier object should know how many soldiers are there in the war field in order to determine how will he attack they enemy. So, instead of having a non-static variable for each soldier object, use a static variable to hold the count of the soldiers, this way saves memory and processing.
• When you want a function to be called without creating an object first make it static.
• If you have the choice between static and non-static function go for the static function, although it depends on the situation, this saves you the time of creating objects.
• Remember, static members cannot access non-static members.
• The static keyword cannot be used with constants because constants are static by nature.
• A static member cannot be marked as override, virtual, or abstract.
• The static keyword is used in operator overloading and when defining implicit and explicit type casting. You don’t create an object to perform the ‘+’ operator.

Static classes
A static class means that all its members are static and must be static. A static class cannot have non-static members.
We all are familiar with the System.Math class. This static class has static functions (Sin, Pow…)
A static class is sealed by default i.e. cannot be inherited.
You cannot create objects of a static class.

Notes:
• Usually, when you want to create a utility class like the System.Math you would use the static keyword.

For further information about C# keywords, see this CodeProject article by Marc Clifton.





Intro
icon1 Eslam Afifi | icon2 General | icon4 03 19th, 2008|
Acknowledgment
First of all, I would like to express my sorrow that my professor Dr. Roshdy Aamer will no longer instruct us. It’s a big loss to college, my colleagues and me personally. And I would like to thank him for his efforts teaching us and his dedication and love to his work. Whatever I say, I still can not give him the appropriate credit.

About this blog
1- The main topic of this blog is programming. Specifically for the .Net Framework 2.0
2- Topics like Windows Forms Applications, Database Programming will be discussed.
3- Other topics might also be discussed.
4- Necessary information will be provided, technical detailed information will be provided whenever is possible.
5- Comments are essential enriching blogs. So, feel free to share knowledge with us and to ask questions.
6- I just want to mention that the name of the blog was one of many suggestions and it got the highest rating from my colleagues.

Reasons why I write this blog
1- I realized recently that it’s essential that I blog to help my colleagues in college, specially that our professor wont instruct us any longer due to health issues.
2- I should pass knowledge with my colleagues, the upcoming generations and other people.
3- Blogging will force me to learn further details, extend my knowledge and keep up-to-date as I have to provide as correct information as possible.

Resources and references
1- MSDN
2- The CodeProject
3- My teachers.
4- Friends and personal experience.
5- Variety of books, blogs, websites and other sources of information.

Apology
I would like to apologize to all my friends that this blog is in English since it would be hard to write the content provided in Arabic or to switch frequently between these two languages. I will use simple English and explain every thing in many different ways as far as I can.

I just want to mention that this is the first time I blog and I will be glad to receive comments, correction of wrong information I provide and questions.

I recommend you also ask questions at The CodeProject. Just, please, read the forum rules. Ask your question in the right forum. Don’t post programming questions in the lounge or any other non-technical message board. Ask clear and specific questions; provide details as much as possible to get your question answered. Don’t mention the word urgent or ask for a full code, no one will write your homework or do a project for you. And I want to say again, before you post a question at The CodeProject, READ THE FORUM RULES.





السلام عليكم
قمت اليوم بإنشاء مدونة أخرى للتدوينات السريعة.
لذا من الآن فصاعدا ستكون المدونة الحالية للمقالات الكاملة والإعلانات والتدوينات العادية.

لكن أحيانا يكون لدي خبر قصير أو تعليق ورأي سريع على موضوع ما وليس هناك وقت للكتابة مطولا حوله، لذا سيكون هذا الغرض من المدونة الأخرى.
بالإضافة لأن ربما لا يرغب البعض إلا بتدوينات معينة ولا يهتم بالأخبار السريعة وما شابه.
أرى أن هذا سيكون تنظيما جيدا للمحتويات الآن.
لذا.. أراكم هنا أو هناك. :D





Blog URL Moved
icon1 Haytham Alaa | icon2 Uncategorized | icon4 03 17th, 2008|
Alsalam alikom wa ra7mat Allah wa barakatoh

I had to move my blog URL to Blogspot, this made me lose almost all pictures I had in the posts, I'll try to upload them back when I got time..

Thanks and sorry for inconvenience.

Thanks,
Haytham Alaa




My fists choice to share files between my Linux and Windows machines was file transfer through messengers .. isn't funny?

Yea.. it is funny, but this due to my laziness to Google it

But now every thing is okay and I can freely share files between my 2 PCs

So to summarize:

To share files between Linux(Ubuntu) and Windows(Vista) you can use Samba

Samba is a free software re-implementation of SMB/CIFS networking protocol. Samba is released under the GNU General Public License. Samba provides file and print services for various Microsoft Windows clients and can integrate with a Windows Server domain, either as a Primary Domain Controller (PDC) or as a Domain Member. It can also be part of an Active Directory domain. Samba runs on most Unix and Unix-like systems, such as Linux, Solaris, and the BSD variants, including Apple's Mac OS X Server (which was added to the Mac OS X client in version 10.2). Samba is standard on nearly all distributions of Linux and is commonly included as a basic system service on other Unix-based operating systems as well.

For how to step by step of using Samba kindly check this Wiki page




Installing ns2.32 on Ubuntu7.10
icon1 Mahmoud Zidan | icon2 Uncategorized | icon4 03 12th, 2008|
This article works fine for Installing ns2.31 on Ubuntu 7.04 but for ns2.32 it needs some minor changes so I will repeat the commands with these changes so that ohters may save time repeating this work

Download ns-allinone-2.32 and Install

$ wget http://nchc.dl.sourceforge.net/sourceforge/nsnam/ns-allinone-2.32.tar.gz

$ tar -xzvf ns-allinone-2.32.tar.gz
$ cd ns-allinone-2.32
$ sudo apt-get install build-essential autoconf automake libxmu-dev

If an error raising Package autoconf is not available or something similar then this post may help you for fixing that

(If previous command still generate some errors, and if it does, restart your computer and try the following step :)

$ sudo apt-get install -f build-essential libxt-dev libxt6 \

libsm-dev libsm6 libice-dev libice6 libxmu-dev

If an error raising Package autoconf is not available or something similar then this post may help you for fixing that

Now run this command

$./install

Set environment variables

$ gedit ~/.bashrc 

Add the following lines to the end of it. Remember replace "/your/path" by something like "/home/purple"



# LD_LIBRARY_PATH

OTCL_LIB=/your/path/ns-allinone-2.32/otcl-1.13

NS2_LIB=/your/path/ns-allinone-2.32/lib

X11_LIB=/usr/X11R6/lib

USR_LOCAL_LIB=/usr/local/lib

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB

# TCL_LIBRARY

TCL_LIB=/your/path/ns-allinone-2.32/tcl8.4.15/library

USR_LIB=/usr/lib

export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH

XGRAPH=/your/path/ns-allinone-2.32/bin:/your/path/ns-allinone-2.32/tcl8.4.15/unix:/your/path/ns-allinone-2.32/tk8.4.14/unix

NS=/your/path/ns-allinone-2.32/ns-2.32/

NAM=/your/path/ns-allinone-2.32/nam-1.13/

PATH=$PATH:$XGRAPH:$NS:$NAM

Let it take effect immediately:

$ source ~/.bashrc

Note: the step described above is important;otherwise, you cannot run ns successfully.

(or you can restart your X windows,i.e. logout and then login, or reboot your system, to make it work.)

Now,the installation has been completed.If you try:

$ ns

Then a "%" will appear on the screen.type "exit" to quit the mode and back to "$"


Validation

After these steps, you can now run the ns validation suite with

$ cd ns-2.32 $ ./validate







Able to install automake and autoconf
icon1 Mahmoud Zidan | icon2 Uncategorized | icon4 03 12th, 2008|
After upgrading to the latest Ubuntu and trying to set up a development environment,  the command "sudo apt-get install automake autoconf" returns the following:

Reading package lists... Done
Building dependency tree... Done
Package autoconf is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package autoconf has no installation candidate

To solve the problem I had to hack the /etc/apt/sources.list which had incorrect entries for the package info (it first points to the install CD). I uncommented the internet sources and fixed each one individually by checking the proper paths to the repositories.

Some hints:

Back up the sources.list you got from this tutorial with this command: sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup

Then edit the sources.list by typing sudo gedit /etc/apt/sources.list

Get your updates using the command sudo apt-get update

Source






البوست طويل ف لو انت من هواة الإنجاز روح ع الخلاصة

انا كنت بتكلم مع واحد صاحبى 2008 فقالى اه ياعم انت هتشتغلنا و بعد كده تروح تكب الكلام ده ع البلوج

سيبونى ارد عليه و محدش يحوشنى ...

الغيبة ذكرك اخاك بما يكره فمتقلقش يا صاحبى مش هيحصل لو بتكره

قصة قصيرة

واحد صاحبى دفعة 2010 : و الله العظيم يا دوك اكتر من 90 ف المية من الدفعة بياخدو كورسات فى البرمجة عندنا

ز : دى مصيبه يا م ان 90 فى الميه و ف البرمجة ، ده احنا لو قلنا ان كل الدفعة بتاخد دروس يبقى دى الماده الوحيده اللى مش المفروض يتاخد فيها دروس

ز : قعد يكلم نفسه و سأل نفسه سؤال هو انا ليه مش بدى كورسات

يمكن عشان مش حاسس انها الوسيلة المناسبة للتعليم لأن ده نظام الكبسولة اللى اول ما الأمتحان بيخلص تخرج من الجسم زى ما دخلت

و يمكن لأنى طول عمرى على مدار الدراسة مخدتش غير 7 دروس

انجليزى تانيه اعدادى ، انجليزى تالته اعدادى ، انجليزى تانيه ثانوى ، انجليزى تالته ثانوى ، فرنساوى تانيه ثانوى ، رياضه تانيه و تالته اعدادى

لاحظت ان اكتر نص الدروس اللى اخذتها فى حياتى كانت فى الإنجليزى و ده عقده سببها مستر ---- اللى درسلى فى سنة اولى اعدادى فى مدرسة صلاح الدين الأيوبى اللى ف المظلات

كان بيدخل يقرا الكلمتين اللى فى الكتاب

بيل لايكس هيذ فريند

بيل تووك تو هذ صن

بيل بلايز فووت بوول

و طبعا مكنش بيقول ولا كلمة عربى و خرجت من سنة اولى كلها بكمة واحده ، طبعا هيا كلمة بيل ... بلا نيله ولما جت اختى تذاكر لى ليلة الأمتحان لاقيتنى مش عارف الألف من كوز الدره بالإنجليزى و مش عارف فيرب تو بى

بس لما جيت اتكلم مع واحد صاحبى و بقوله المستر ده تعبان اوى

رد عليا و قالى ده عندنا فى الدرس بيشرح شرح جامد جدا غير اللى بيقوله هنا و بيترجم لنا كل الكلمات و بيدينا هوم وورك من كتاب بيت باى بيت

خلاص كفايه كده عن المدرس ده و المهم انى طلعت الأول ع المدرسة ف السنة دى و حلفت انى لازم اخد درس انجليزى السنة الجايه

يمكن افتكرت اننا لما كنا اربع اخوة و كنت اصغرهم كانت الدروس بتستهلك جزء لا بأس به من الدخل الشهرى بتاعنا و دلوقت بشوف نفس السيناريو مع كل اقاربى وجيرانى مع ارتفاع النسبة ، لدرجة ان الناس دلوقت بيضحوا بجزء من ضروريات الحياه من لبس و أكل مقابل انه يدى ابنه دروس فى كل المواد

قصة قصيرة : بتعبر عن وجهة نظر لا بأس بها

المكان و الزمان : الهايكستب قاعدين ع الرمل و الوجوه تعلوها التراب و بيحيط بيك الالاف مؤلفة من الشباب اللى زى الورد مستنين من صباحية ربنا عشان يسمعو راحيين فيين فى الجيش و ده كان يوم 13-10-2004

صاصا : بص يا زيزو انا عاوزك بقى اول ما تنزل الكليه تبقى حووت كورسات و عاوزك تنافس ----- الحصة ب -- جنيه

ز : ده مش اسلوبى عشان ---- و ---- و ---- و ------------------------

صاصا : ليه يا ابنى كل واحد حر انا مش بحب احضر المحاضرات و معايا فلوسى و محدش بيجبرنى على حاجه ومستريح كده

ز : سكت.... أفندم بوروروم ايوه جاااااااااااااااااااااااى

قصة كمان : بتعبر عن وجهة نظر لا بأس بها

ده واحد صاحبنا دفعة 2005 و طلع من العشرة الاوائل ف الكلية

صاحبى : و الله ياحوده انا مكنتش بحضر ولا محاضره على مدار الأربع سنين و كنت بذاكر ال 3 أيام اللى قبل الأمتحان بس

بس بعد كده عرفت ان المعلومه كانت ناقصه لانه كان بياخد كورسات و كمان لاقيت ان فيه زيه كتير من الأوائل بياخدو مراجعات

القصتين اللى فاتو اصحابهم اثبتوا نجاح و جهة نظرهم فى الكورسات

بس لما تعرف حسب التصريحات الرسمية لدكتور رشدى عامر ان نسبة النجاح فى الداتا ستركشرز زفت

و لما النتيجه تعتمد رسميا هبقى اقول النسبة ، نقدر نقول ان اكتر من – فى الميه ما اثبتوش نجاح و جهة نظرهم فى الكورسات

و جهة نظر لا باس بها

ده واحد صاحبنا اسمه ع ج 2004 سمع فى اول سنة اولى من ح م 2003 ان لو عاوز تبقى بروجرمر كويس اقرا كتاب Object Oriented

و فعلا عمل كده بناء على نصايح ح م و مش هو لوحده كان معاه ماك و كيمو و انتيمو و مجدى و دوحه و عبد الهادى بس انا مش معاهم

و ده واحد تانى صاحبنا كان الدكتور فى سنة اولى بيشرح لسه فى ال if statement من كتاب C++ how to program بس الراجل قاعد ورا فى المدرج بيقرا فى شابتر 7 فى الكتاب

اه على فكره انا سعات كنت بقعد ورا اقرا ميكى اللى ظاظا كان بيجيبلنا منها 4 اعداد كل محاضره و لو مفيش ميكى او سمير ممكن نرغى

و ده ز فى الأجازه خلص على كتاب C++ how to program من الجلده للجلده

وجهة نظر لابأس بها

ده واحد دفعة 2010 سأل فلان لما رجع من ميكروسوفت ريدموند :

الواحد : نفسى اروح ميكروسوفت

فلان : نفض لكل المحاضرات و الشكاشن و اقعد اقرا فى البرمجه

انا : انا مكنتش حاضر بس لو الكلام ده اتقال فعلا اسمحولى ان اقول ان كلام فلان ده هبــــــــل

و اقول للواحد ده و اللى زيه لو عاوز تعمل حاجه كن نفسك و متقلدش حد ولو عاوز تاخد قدوة متاخدش كلام اهبل بس كفاية عليك الأنبياء موسى و عيسى و محمد عليهم الصلاة و السلام ولا نفرق بين احد منهم

قصة كمان لابأس بها

زمان كان ال ACM تعمل اعلان فى التليفزيون و الجرايد الصفرا يا جماعه احنا هنعمل كذا و تعالى و انت تعرف

المهم روحنا المره دى و طلع الموضوع كوم COM راح جه الراجل اللى بيشرح اللى انا اتكلمت عنه فوق و قال لو عاوز COM عليك و على كتاب Developers Workshop to COM and ATL

المهم مشفناش الراجل غير المره دى و جبنا الكتاب و قريناه و اتعلمنا كوم و اعتقد ان هى دى الطريقه الصح للتعلم

قصة كمان

قصة صاحبى البروجرامر دايما بنقوله يا حرامى و سعات بقوله يا فيلسوف و من القلائل اللى خرجو من حاسبات و كان ليهم فى الأدب و الشعر و الكلام ده و كتير بنندهله يا مجنوووووووووون و على فكرة هو سامحلى انى اقول اسمه ع البلوج بتاعى بس مش هقول دلوقت

المهم صاحبى ده فى مره حكى حايته و قاللى انه اول ما دخل الكليه كان نفسه يكون معيد بس لما ظهرت نتيجة الترم الأول ف سنة اولى لاقى نفسه جاب جيد راح عرف ان مش هيكون من هذه الفئة الـ.... فخد قراران

اول حاجه انه مش هيحضر اى حاجه فى الكلية و تانى حاجه انه قرر يكون بروجرامر محترف فأشتغل من سنة تانيه مره Freelancer و مرة Part-time و سعات لحساب نفسه و هو بيدرس و اتخرج سنة 2005 بتقدير عام جيد و كان كذا شركه بتتخانق عليه و هو فى الجيش عشان يشتغل معاهم يوم الأجازه بتاعه وبعد ما خلص الجيش حصلت نفس الخناقه بين اندية الوسط عليه و يارب يلاقى فرصة ف الأهلى او الزمالك و لا حتى يحترف فى بلاد الفرنجه

خلى بالك المهم انه خلص الكليه ونجح و حقق اللى كان عاوز و اشتغل اللى كان بيحبه

اه على فكرة هو من الناس محترفى الكود اللى بيكتبوا كود بسرعة و بينجز بس الكود فى الأخر بيطلع زبالة و اسف على اللفظ بس مفيش حاجه احسن من كده ممكن نوصف بيها الكود بتاعه و هو من انصار فلسفة "مش مهم الكود يكون زبالة المهم انه يكون شغال"

كمان كلنا كاصحابه عارفين انه من الناس اللى دماغهم بتفكر كويس و ربنا يوفقه يمكن بعد 30 سنة نلاقى مسلسل على اسمه بعنوان لن اعيش فى جلباب ابى

انا كان نفسى تشوفوه فى الإفنت اللى بيعملوه النهارده بس....

و عموما لو لقيت فرصة لما افضى هحاول اعمل معاه حوار و اتصور معاه ع القهوة و انشر الحوار و الصورة ع البلوج ده

قصة كمان : بتعبر عن وجهة نظر لا بأس بها

صاحبى : المشكلة ان موضوع الدروس ده خد شكل احتكار و دى مش مشكلة المحتكر ولا مشكة المستهلك وانا نفسى ادى كورسات حتى لو ببلاش عشان نحل ازمة طوابير العيش

رديت عليه و قولتله فكره جامده و الله لو جدع اعملها بس انا مش فاضى انفذها معاك بس ما احنا ممكن نشوف العيال الجامده ف الكليه و نخليهم هما اللى كل اسبوع يعملو الموضوع ده فى اى لاب او مدرج او حتى فى جنينة الكلية و نحل ازمة احتكار الأسمنت

انا عارف ان فيه تجارب مشابهة فى الكلية و بجد جزاكم الله خيرا يا جماعة معى انى دايما عندى نقد بس مش بقوله لأن --------

فى قصص كمان بعضعها مش هكتبها عشان اصحابها ميزعلوش زى صاحى الأولانى و كفايه كده اوى لو عندك قصه اكتبها فى التعليقات او ابعتها ليا فى إميل

الخلاصة :

برفض موضوع الدروس كمعيد

لعدم قناعتى بانها الوسيلة المناسبة للتعليم و عدم اقتناعى ان مش هى دى الحاجه اللى ممكن استهلك فيها وقتى

تعاطفا مع طوابير العيش ابو شلن ومش عاوز اكون سبب فى ازمة كمان تضاف لمشاكل الأسر المصرية

لعدم و جود اسباب ماديه ضرورية تجعلنى ادى كورسات ووجود بدائل مش بطاله لما اعوز بقى

برفض موضوع الدروس كطالب

لوجود بدائل افضل من ذلك للتعلم

التعليم غايه لإصلاح الحياه و ليس و سيلة للنجاح فى الإمتحان فقط

اوافق على موضوع الدروس كطالب فى الحالات الإستثنائيه كحالة المستر بتاع بيل اللى اتكلمت عنه ف الأول

اوافق على موضوع الدروس لغيرى من اصحابى و حبيايبى المعيديين

لوجود اسباب ضرورية ماديه

بشرط العدل و المساواه بين التعليم داخل الكلية و خارجها

الخلاصة الجامده

عندك Compiler؟

عندك DSL؟

عندك Google؟

عندك Emule؟

عندك Torrent؟

طيب مستنى ايه؟ اتعلم بقى يا اخى بلا كورسات بلا ... و ربنا هيسهلك

الناس اللى اتكلمت عنهم و مالهومش حق انهم يزعلو

م : محمد و ده الطالب صاحبى الوحيد من الطلبة اللى خدو نمرة تليفونى اللى كل فتره فى الأجازه و الدراسه الاقيه من غير اى مناسبة بيكلمنى فى التليفون و بيقولى بسلم عليك يا دوك

ز : زيدان

ع ج : عبد الله جمال صاحبى و ياما اشتغلته

ح م : حسين مهنا

باقى الناس اللى اتكلمت عن لسانهم برده مش من حقهم يزعلوا خالص و لو حد لاقى اسمه مكتوب هنا متعلقتش لو سمحت الإ لو كنت هتزود وجهة نظر





روابط ٧-مارس-٢٠٠٨
icon1 حسن إبراهيم | icon2 أخبار وروابط | icon4 03 7th, 2008|





السلام عليكم
تم بحمد الله الانتهاء من العدد الخامس من مجلة لينكس العرب بجهود فريق المحررين والمنسقين في منتديات لينكس العرب. وباب المساهمة في الأعداد القادمة مفتوح لمن يريد المشاركة.

موضوعات هذا العدد:

  • كيفية تركيب البرامج في توزيعة ديبيان ومشتقاتها
  • تعرف على OpenSSH و FTP
  • تكملة سلسلة مقالات لغة البايثون
  • مجموعة منتقاة من الأخبار
  • الترجمة مع برنامج stardict
  • تلميحات ودروس بسيطة

رابط التحميل بصيغة pdf