The WOW starts Now!

Wednesday, 31 January 2007 17:01 by admin

Today marks another momentous occassion on the Redmond Giant. Today is the consumer launching of Windows Vista and Office 2007.

Actually the software has been available to the business community for almost 2 months now. And this release means that consumers can now publicly purchase Windows Vista and Office 2007. This is quite significant since computer manufacturers are now bundling Windows Vista on their new computers. And also, hardware manufacturers are releasing Windows Vista compatible drivers.

Microsoft expected Vista to superceed the sales that they made on the Windows 95 launch. This is quite possible since Windows Vista is a completely new Operating System. Though it has been plagued with problems during the development cycle the end-results are quite satisfying.

I can say that the first time you will use Vista, you can really say WOW! It has a more sleekier feel than WinXP, and tons of new features that would greatly ease your computing experience. Enough said, upgrade now or suffer the consequences! :)

Watch Webcast

Vista Launch Pictures

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:  
Actions:   E-mail | Permalink | Comments (1) | Comment RSSRSS comment feed

.Net Enumerations

Saturday, 20 January 2007 17:01 by admin

It's been a while that I've been using Enums (enumerations) in .Net. But the problem is I'm using it just like in a C++ style. I've never thought of anything new regarding .Net's approach to enumerations. Until now.

An Enumeration is a collection of constant numeric values. In other words, its simply a group of constants. A general declaration of enums would look like this:

enum sample {
    item1 = 0,
    item2 = 305,
    item3 = 451
}

Enums are very useful specially if your constants are grouped in a special way. Instead of declaring a constant per "group value" you can instead create an enum to give it a more "groupy" view. Well, I think you got my point.

.Net enums are quite special. Since everything in the .Net framework is an object its safe to say that enums are also objects. The .Net framework has an Enum class which contains some static functions that is quite helpful when you're using enums. Here's the list of some useful functions:

Parse Converts the string representation of the name or numeric value of one or more enumerated constants to an equivalent enumerated object.
GetValues Retrieves an array of the values of the constants in a specified enumeration.
GetUnderlyingType Returns the underlying type of the specified enumeration.
GetName Retrieves the name of the constant in the specified enumeration that has the specified value.
GetNames Retrieves an array of the names of the constants in a specified enumeration.

The most useful so far, for me, is the parse method. Let me demonstrate its usefullness. When I'm creating a database system and encounters a field that has a fixed number of values (eg. Status) I'm representing it as an enum in my program. But I'm using the string representation in my database. So its quite troublesome to convert from string to enum values. Usually I create a funciton that looks like this:

MyEnum Convert(string myValue) {
    switch (myValue) {
        case "item1":
            return MyEnum.item1;
        case "item2":
            return MyEnum.item2;
    }
}

As you can see its quite lame :). But I got used to it during the C++ days. Now, this is the exact problem that the Parse method solves. It reads a string and automatically converts it to the enum that you are using. Here's a sample:

retVal.PayMode = (PaymentMode) Enum.Parse(typeof(PaymentMode), reader["PayMode"].ToString(), true);

Now this sample reads a string in a DataReader object and let the Parse method convert it to its Enum (PaymentMode) representation. Now this is pretty useful if your using many enums in your program. If you want the reverse, convert an enum into its string representation then you can directly use the ToString() method.

The second useful function is the GetNames method. It's quite simple, it returns an Array of strings containing all of your enums in its string representation. This is quite useful if you want to bind a control to an enum. For example, you have a combo box control in which you want to display the contents of your enum for your user to choose from. Instead of doing it manually you can directly bind it this way:

comboBox1.DataSource = Enum.GetNames(typeof(MyEnum));

Also, take note that when using the enum methods you must use the Enum class which has an Upper Case E. Enum and enum in C# is quite different. So use the Enum if your trying access its methods, and use enum (with a small e) if your just declaring an enumeration.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:  
Actions:   E-mail | Permalink | Comments (2) | Comment RSSRSS comment feed

Slow Internet Connection!!!

Wednesday, 17 January 2007 11:01 by admin

These past few weeks, as I think you also have noticed. The internet is quite crippled. It was supposed to be the result of the quake in Taiwan last December 23. It supposedly damaged an underwater cable which crippled all of the ISP here in the Philippines. I know that this news is quite old but I just got fed up with the slowness of their fixing. I mean they suppose to have fixed it by now and they are claiming to do it in the end of the month! Grrr....

I just opened my Live Mail Desktop to check my mail, when boom! my connection timed out! It really sucked! I can't even access it using the web interface. Darn! I really hope they fix this in the fastest possible time. It seems that I was blasted back on my college days where a 56kbps modem is the fastest internet connection.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:  
Actions:   E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed