What is this VB.NET?!

Salam 3lykom

 

When you try to do something, First  calculate how much are the Benefits / Harms.

 

Actually I’m disappointed and still wondering how can VB developers avoiding some thing like that!

 

Two weeks ago , I discovered a bug  in Visual Basic Language itself ! … Really I was so excited to find out the bug and configure some solutions ! and this is my post on MSDN forum :

 Hello all ,I discovered that error by chance when I was working on Collections. But I found it in FOR loop in VB.Net.Have a Look :

Sub Main()  

        Dim Y As Integer = 10  

        For x As Integer = 0 To Y  

            Console.WriteLine(x.ToString())  

            Y = Y - 1  

        Next  

        Console.ReadLine()  

End Sub 

‘and the result was 

10 

‘and that is not logically correct !! 

‘the Correct result should be : 

‘as Y decreased every step. 

In other words : why FOR loop limit is not updated every step!!!! ? Is it a Bug or What ?!thanks in advance !!  

url : http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/e7b47ed3-834e-4e05-8357-00ca92fc8a1f/ 

Frankly , replies were very disappointing :S , All were about “We cann’t Change anything ! ” or “You can use another way !!”.

 

I think the bug is very basic/essential , how can they avoid it like that !

 Only the positive reply was from Jonathan Aneja , VB Team Manager :D !!

 

Hi there,

 

This behavior is by design, as documented in the help topics. VB has several different looping constructs that provide a lot of flexibility here - in this case you could use a “Do While” or “Loop Until” if you want the ability to dynamically change the upper bound.

 

I’m going to resolve this bug as “by design” for now, but if you have any questions feel free to contact me directly at jonathan DOT aneja AT microsoft DOT com.

 

Thanks,

 

Jonathan Aneja

Program Manager, VB Team

 

the only excuse I can consider it , that they are vb lovers :)

 

but actually I can’t advise anyone to use vb from now !! , I like C-family more :)

 

I have nothing to say now , I just wanted to log it :) !

 

Salam 

One Shot !

Salam 3lykom

 

 

I know this post is late for 2 weeks , but I think the all the picture still in mind .

It is all about this summer vacation .

 

I can’t be full descriptive about all the 3.5 months, but I can log the main points:

 

1- I resumed my Career & Certification Courses

2- Although my Certification Course was canceled, I went on my way. And now I’M 3 MCP (Microsoft Certified Professional). I’ve passed 3/5 exams which:

 

 

Exam ID

Description

 

Date Completed

 

315

Developing and Implementing Web Applications with Microsoft® Visual C#™ .NET and Microsoft® Visual Studio® .NET

 

Sep 29, 2008

 

229

Designing and Implementing Databases with Microsoft® SQL Server™ 2000 Enterprise Edition

 

Sep 15, 2008

 

316

Developing and Implementing Windows®-based Applications with Microsoft® Visual C#™ .NET and Microsoft® Visual Studio® .NET

 

Aug 28, 2008

And I intend to go the 4th one this month ISA.

4-I did 3 major tasks/Applications at my Company … and recently I discovered that   I play a great role in my team … THANKS GOD.

5-I had known new friends (Wael ,A.Kamal, Mrwa , Eman) , I think  I will never forget them :) .

6-I got a glasses :D . Although my eye-sight is still 6/6 sharp –Msha2 Allah :d - ,Doctor advised me a glasses for computer.

7-”I Aveo” :D , we got a new car … It is Chevrolet
Aveo Mo.2009 , I’ll talk about it later ;)

8-I was not good at Ramadan this year , and I really feel sorry about that and it will not be happen any more .

9-I watched Heroes series  S1&S2 … it is really great one ,I loved Klear & Matt so much :)

 

 

That is enough for now , the new year -3rd year Computer Engineering – started already and I think I will have a lot to post :D .

 

salam

 

Career.Resume();

Salam 3lykom

After 1 week of vacation , wYoumeen Gamdeen f Ras el Bar … I think Now it is time for Fun & Work.

Today , I’m back to Work , And I’m So Excited about that :)

This Summer , A lot of time , and also a lot of work to do !.

I hope to achieve all what I’ve planned !! , I hope that for all of you :)

Salam

خيانة !!

سلام عليكم

لما يبقي في حاجة مستخبية و مع ذلك الاحداث تمشي طبيعي … تبقي دي خيانة !

لما كل اللي حوليك يبقي عارفين سر و مكتمين عليه بقالهم يومين وانت الوحيد اللي مش عارف … تبقي دي خيانة !!

 

بس بصراحة … أجمل خيانة فالدنيا

 

دة كان عيد ميلادي ال20 … معتقدش فيوم اني هقدر انساه … و دول هم الخونة :

 

خلصنا امتحان و السنة خلصت… بس المزاج مكنش قد كدة !! … طلعنا علي كوك دوور … و انا قاعد فامان الله مستني سندوتش الجمبري يجي :) !!

فجأة تلاقي ناس مكنتش اتخيل ابدا اني اشوفهم فاللحظة دي … “محمد فتحي ” انتيمي من عشرتاشر سنة كدة و لا حاجة … بجد كانت مفجأة جاااامدة !!

حسيت ان فيه حاجة مش مظبوطة … بس بردو مكنتش مدي خوانة اوي :D

خلصت الجمبري :p … و رحرت اغسل ايدي زي الناس الطبيعيين !

بس لما رجعت … مكنش فيه حاجة طبيعية … كوك دوور مقلوب … و العيال هايصين و تورتة محطوطة و هييييييصة …. :D

اااااااه يا ولاااااااااااد ال ….. لتاااااااااااااني مرة يتعمل فيي الموضوع دة !!!

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

اااه … يعني لما عاطف و حاتم اختفو بعد الامتحان مكنوش فمشوار و لا حاجة … دول كانو بيجيبو التورتة :D !!!

لما فؤاد ينزل الكلية و هو اصلا معندوش امتحانات ولا حاجة … تبقي دي مش صدفة !

لما ناجي يقابلني الصبح و يقولي” كل سنة و انت طيب يا حمدي “ … تبقي دي غلطة مطبعية :D :D

وغيرها من الافلام و الحركات والتليفونات الغريبة اللي حصلت …و اللي لسة بجمعها

بس …………………….. قطعنا التورتة و نسفناها طبعا !!

طبعا اتذلييييييييييييييييييييت علي ما طلعت الهدية … مفيش حاجة بتيجي بالساهل !!

ودة كاسيت زقزوقة الجديد

 

شكرا جدا يا شباب … لا موبايل فالعربية بعد اليوم !!

واخيرا … عايز اشكر اتنين كان ليهم دور عظبم جدا فاليوم دة :

1- فكري باشا … اللي كلو كان خايف منه ليقع بلسانة و يستخدم ذكاءة كالعادة … انا اصلا كنت مطمن طالما هو مسقطش حااجة :D :D

2- اظرف و الطف و اخف انسااان فالدنيا … حبيبي و الله يا تاح … دة اللي كان بيعطلني و انا فالحمام بغسل ايدي … قال اية ” كان بيهزر معايا ” :? :?

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

وفعلا اليوم دة اكيد مش هقدر انساه !

علي فكرة الفيديو جاااااامد جدا … بس كبيير اوي !

سلام

I’m Back

Salam 3lykom

Exams finished , I think that I’m unleashed again :) … Usually posts after exams shows vacancy as a new mode … I think that is not at this year :D

Actually exams this year was just a break !

This year was not a good one , I spent hard times in it !

Hmmm… Just Let it GO !

Happy to resuming My Life & Excited to Back to the Technical Work :) !

Salam


Yesterday … Is Not SUCH a DAY!!

Although I intended to write some posts lately, but really that one can’t be delayed.I must log it in my life.

It was long time to pass such that bad time!!, It started at 11 pm of the previous day 7-May , I waked up planning to spend the night studying for oral exam in the morning , actually they are 2 , 2 oral exams in one day :? !! .

Taking my shower and some thing to eat, then having some time on the web is a very normal things we do every day :) .

Starting studying about 2:00 am , beginning with C# subject I said that would take just 30 minute – As Usual- ,I spend a complete 1 hour just in DataBase applications .Realllllllllllllly It is the WORST ways to Manage DataBase I have ever seen in My Life .After that I realized some fact in the book :

“The Syntax Errors is more than Copy & Paste Ones” :? :? .

Then I turned to the next subject , It was “Power and Machines” , I really don’t know why a Computer Engineer should study POWER STATIONS in details :? ,About 3 hours I was lost in some Strange Stuff -I’ve never heard about :D - in this subject ,Then I took a decision -2ny 2twakel 3la AllaH :D - and went out !!

It was 30 minute to go , I didn’t find any prepared thing to wear :? , I can’t find my brush , finally … My little brother has finished my Gel :evil: !!!

Waiting , Waiting ,Waiting … and more continuous waiting outside the lab to get the programming exam , Hearing some news about the Really stupid questions that the Dr ask , then I found that the ORAL PROGRAMMIGN EXAM is to write some snippet of code of his applications in a piece of paper … BOOOOSHES !!

I think I got an easy question so I finished it and turned to get the next exam, and is it was really a Surprise!

It was not an exam, it just checking if you have bought the book or not :? –Mas5araaa Wallahi - !

Actually, there ware 2 books, and I have brought just one from my home and that is mean that you will not get a good mark :? :? :?

For some unknown reasons we have delayed to the end of the exam, which also means more waiting for some thing you really don’t know!!

Then we entered to the Dr, Who found that all the group didn’t have the 2 books then simply he canceled our exam :evil: :evil:

-7raaaaaaaaaaaaaam wallahi-

At the end of the day in collage, THERE WAS A DISASTER, really HARD CRISIS!!

Although I’m not of both sides of the problem, but actually it Directly affected on me, all what I can say:

“I’m Not The Suitable Man To Hold Fallen TEARS … and That Will Not Be Easy To Be Forgotten”.

After all of that I wanted seriously to go home as soon as possible!! So I went back home!

NOTE:

لما روحت البيت … لقيت العربية عطلانة علي الطريق و لازم الميكانيكي يروح يجيبها + موبيل اختي الصغيرة اتسرق !!!!!

So , I canceled my Certification Class and went to sleep to end that horrible day as quick as possible , Whishing to wake up in the next day –w2na sleem - !!

Remembering that day makes me SAD, I’m going to make some tea ….

Salam

Complex Numbers Class in .Net

Salam 3lykom

As my friends (Daif and MadCore :) ) told me that we have to report a programs deals with the complex number – to simulate some equation in Electric Circuits – I found it a great chance to Create a new TYPE from scratch :) .

Complex Numbers

There are no class in .Net that deal with complex numbers and its operation , So you must implement it yourself … I don’t think it is hard mission ,but it’s great thing to create new types.

CompleXLib features:

1- Define the Complex number by Real & Imaginary Form (Re + Imi)

2- Define the Complex number by Polar Form ( Magnitude , Angle )

3- Handle the equal (==) and not equal (!=) operators

4- Override ToString() Method to get the Complex Numbers From ( “Re+Imi”)

5- Implementation of the basic Arithmetic Operations (Sum ,Subtract , Multiplication ,Division)

//CompleXLib still under developing and I’m trying to solve polar constructor issue

using System;
using System.Collections.Generic;
using System.Text;
 
namespace CompleXLib
{
    public class Complex
    {
        //Internal Data Members
        double re, im , magnitude ;
        float angle;
 
        //Empty Constructor ==> 0+0i
        /// <summary>
        /// No parameters to get zero complex number == (0+0i)
        /// </summary>
      public  Complex()
        {
            this.re = 0;
            this.im = 0;
            this.magnitude = 0;
            this.angle = 0;
        }
        //Overloading Constructor for Real & Imaginary
        /// <summary>
        /// Complex number with initial values (Real & Imaginary Format)
        /// </summary>
        /// <param name=”re”>The Real term of the Complex number </param>
        /// <param name=”im”>The Imaginary term of the Complex number</param>
        public  Complex(double re, double im)
        {
            this.re = re;
            this.im = im;
            this.angle = this.GetAngle();
            this.magnitude = this.Absolute();
        }
        //Overloading Constructor for Polar
        /// <summary>
        /// Complex number with initial values (Polar Format)
        /// </summary>
        /// <param name=”mag”>The Magnitude of the Complex number</param>
        /// <param name=”angle”>The Angle of the Complex number</param>
        /// <param name=”PolarFlag”>Just a flag to get the Polar format … NO USE</param>
        public Complex(double mag, float angle ,bool PolarFlag)
        {
            this.angle = angle;
            this.magnitude = mag;
            this.im = GetImaginary();
            this.re = GetReal();
        }
        #region Properties :
        /// <summary>
        /// Get or Set the Angle of the Complex number
        /// </summary>
        public float Angle
        {
            get { return this.angle; }
            set 
            { 
                this.angle = value;
                this.re = GetReal();
                this.im = GetImaginary();
            }
        }
        /// <summary>
        /// Get or Set the Magnitude of the Complex number
        /// </summary>
        public double Magnitude
        {
            get { return this.magnitude; }
            set
            {
                this.magnitude = value; 
                this.re = GetReal();
                this.im = GetImaginary();
            }
        }
        /// <summary>
        /// Get or Set the Real term of the Complex number
        /// </summary>
        public double Re
        {
            get { return this.re; }
            set
            {
                this.re = value;
                this.angle = GetAngle();
                this.magnitude = Absolute();
            }
        }
        /// <summary>
        /// Get or Set the Imaginary term of the Complex number
        /// </summary>
        public double Im
        {
            get { return this.im; }
            set
            {
                this.im = value; 
                this.angle = GetAngle();
                this.magnitude = Absolute();
            }
        } 
        #endregion
        #region Internal Methods
        //This method to get the phase Q … as angle = (@+Q)
        int GetPhase()
        {
            int phase = 0;
            if ((Math.Sign(this.Re) == -1) && (Math.Sign(this.Im) == 1))
                phase = 180;
            else if ((Math.Sign(this.Re) == -1) && (Math.Sign(this.Im) == -1))
                phase = 180;
            else if ((Math.Sign(this.Re) == 1) && (Math.Sign(this.Im) == -1))
                phase = 360;
            return phase;
 
        }
        //Get the Exact angle of the Complex number … depend on Re and Im
        float GetAngle()
        {
            int phase = this.GetPhase();
            double angle = 0;
            if (this.re != 0)
                angle = phase + ((180 / Math.PI) * (Math.Atan(this.im / this.re)));
            return (float)angle;
        }
        //Get the Real term of the Complex number … depend on Magnitude and Angle
        double GetReal()
        {
            double re = (this.magnitude * Math.Cos((Math.PI /180)* this.angle));
            return re;
        }
        //Get the Imaginary term of the Complex number … depend on Magnitude and Angle
        double GetImaginary()
        {
            double im = (this.magnitude * Math.Sin((Math.PI/180)* this.angle));
            return im;
        }
        #endregion
        //Overriding ToString() Method to get Complex numbers format
        /// <summary>
        /// Get the Complex numbers Format ( Re+Imi)
        /// </summary>
        /// <returns>String</returns>
        public override string  ToString()
        {
            char sign;
            if (this.Im >= 0)
            { sign = ‘+’; }
            else { sign = ‘-’; }
            return (String.Format(“{0}{1}{2}i”, this.Re, sign, Math.Abs(this.Im)));
        }
        //Overloading == operator
        public static bool operator==(Complex c1, Complex c2)
        {
            if ((c1.Re == c2.Re) && (c1.Im == c2.Im))
                return true;
            else return false;
        }
        //Overloading != operator
        public static bool operator !=(Complex c1, Complex c2)
        {
            return (!(c1 == c2));
        }
        //Static versions of the methods
        #region Static Methods
        /// <summary>
        /// Get the Conjugate of the Complex number
        /// </summary>
        /// <param name=”c”>Complex number</param>
        /// <returns>Complex number</returns>
        public static Complex Conjugate(Complex c)
        {
            return new Complex(c.Re, (-1 * c.Im));
        }
        /// <summary>
        /// Get the Absolute value of the Complex number
        /// </summary>
        /// <param name=”c”>Complex number</param>
        public static double Absolute(Complex c)
        {
            double abs = (c.re * c.re + c.im * c.im);
            return Math.Sqrt(abs);
        } 
        #endregion
        #region Object Methods
 
        /// <summary>
        /// Get the Absolute value of the Complex number
        /// </summary>
        public double Absolute()
        {
            return Complex.Absolute(this);
        }
        /// <summary>
        /// Get the Conjugate of the Complex number
        /// </summary>
        public Complex Conjugate()
        {
            return Complex.Conjugate(this);
        } 
        #endregion
        #region Operators
        //Defines Operations and Operators
        public static Complex operator +(Complex c1, Complex c2)
        {
            return (new Complex(c1.Re + c2.Re, c1.Im + c2.Im));
        }
        public static Complex operator -(Complex c1, Complex c2)
        {
            return (new Complex(c1.Re - c2.Re, c1.Im - c2.Im));
        }
        public static Complex operator *(Complex c1, Complex c2)
        {
            return (new Complex((c1.Re * c2.Re - c1.Im * c2.Im), (c1.Re * c2.Im + c2.Re * c1.Im)));
        }
        public static Complex operator /(Complex c1, Complex c2)
        {
            if ((c2.Re == 0) && (c2.Im == 0))
                throw new DivideByZeroException(“Division by Zero is not allowed”);
 
            double re = (c1.Re * c2.Re + c1.Im * c2.Im) /
                        (c2.Re * c2.Re + c2.Im * c2.Im);
            double im = (c2.Re * c1.Im - c1.Re * c2.Im) /
                        (c2.Re * c2.Re + c2.Im * c2.Im);
 
            return (new Complex(re, im));
        }
        #endregion  
    }

}

        //End of Code

 

Download CompleXLib with Test project:

http://www.4shared.com/file/40075838/7bab2ae4/TestComplex.html

W8ing  feedbacks  & Gug-Reports ;)

Salam

What a 5km/hours could do !!

You need to a flashplayer enabled browser to view this YouTube video

PLEASE ,SLOW DOWN !! 

ْْX vs !X

X vs !X

Tes7a aw maTes7ash …. Tenzel el kollia fatra owla aw Tanya aw talta msh far2a … no23od shahreen msh 3arfeen el manhag ray7 feen wgay mneen msh far2a … t7el fl mid-term aw mat7ellsh … bardo msh far2a :?

Howa da el 7al fl el term el awal … twahan fe twahan … tanfeed taaam w2hmal 3la el 25er . mnaheg ta3bana ,mo3eedeen zoraf gedan, da 3′eer el 2ltzam el fazee3 bl gadwal bta3na :D

3wamel kteer wsbab aktar el mohem n el term fl a5er baz mny … mafo2tsh feeh 5als atla3 mn course a5osh fProject … da 3′eer el wa2t el fazee3 elle kan bydee3 fel Site .kol da fl a5er 5lany arfa3 sh3ar ‘X’ .

X fl digital mean “Don’t Care” whowa da el 7al … la sections walla reports walla mid-term walla ay 7aga f7aga … kollo tat sh3ar ‘X:D

Lkn el 7war kda msh naf3 5als … ana msh hynfa3 a3ady 3la el 7rokrok kda … wbsra7a ana msh met3awd 3la 7aga zy keda … el sho3′el el technical wel interests 3moman she2 gameel awy … bas lazem balance 3shan may7salsh dorp lakadar AllaH .

Da ba2a el !X ! = ‘Not‘ fl programming …. El mohem n ana naweet a3′yar el wad3 da .. ISA ykoon feh 2htmam akbar bel drasa zy el IT …kman ana shayf kza 7aga hatsa3dny fl kessa de :

- feh kaza madda gamdeen awy el term da (Operating Systems – C# Programming – Web applications ) fl 7aya hatkoon exciting ISA :D

- mafeeeeeeeeeeeesh Math … bsara7a el ryada ba2t 3′abia awy fel a5er … ana mn el nas elle bet7eb el math gedan .. bas elle bna5do da akeed msh math … 27na bna5od wghat nazr sha5sia ll3olma2 fe 7al msa2el malhash lazma :? kollo dash fe dash :?

- No more responsibilities :D wde 7aga gamda gedan .

ISA rabna ywafa2ny wkol el dof3a wkoon term kways wActive gedan ISA .

Ah nseeet … el kalam da kollo lw 3adeet fl term el awal :? Rabena yostor wallahy :)

salam

SystoR

بسم الله الرحمن الرحيم

SystoR

SystoR is a System Monitoring Tool –that I really need it when I’m working on my pc- , It can monitor each of (Processor – Memory – Hard Desk Drive – Network ) of your machine .

The full features of SystoR :

- Nice design allows normal working on PC when it is running .

- Monitoring of :

- Processor => Usage & Details.

- Memory =>Used / Free space of Physical & Virtual Memory .

- H.D.D => Transferring rate (Reading /Writing) – Free spaces.

- Network => Transferring rate (Sent /Received).

- Data charts with adjustable Scale.

- Running on Startup.

Screenshots:

SystoR main window

Processor

Memory

Hard Disk

Network

Full Power

Download :

http://www.4shared.com/file/37490981/3c5c1a6e/SystoR.html

 or

http://rapidshare.com/files/90917274/SystoR.rar.html

Story about SystoR :

Whatever the machine I’m working on , or whatever I’m doing, I always need any feedback about the machine status .So I used to use “Task Manager” :) … and minimize it to system tray .But three years ago when I was watching a video tutorial it was on Linux and there was some tool the same design with SyatoR … Frankly I got the idea of SystoR from that tool … so I wished to get it working on Windows .

Recently, I decided to write it … and already I finished the core of the program, the bad news is I found some implementation of the tool working on Windows :( with the same features … for a while I lost the exciting …but I decided to complete it just for fun and more experience .So when I finished my exams , I started finishing Systor as well.

The idea about “I feel the Progress”, that I am really feel the progress in my level .as I didn’t face any programmatic problem while the development process … and I hope that lasts for ever :D .