Tuesday, March 31, 2009

skype on iPhone

Skype released an iPhone version...
Does anybody have used it already?

More details in wired

Friday, March 27, 2009

True or Not... be prepared

Here comes again, Conficker will return and have a new variant.
So what can we do?

More info here Beware

'Psyb0t' worm infects Linksys, Netgear home routers, modems

Now we need worry about this. Have a virus called "psy0t" and he don't want your computer, but your modem. Check more in ZDNet and APC.

Thursday, March 26, 2009

Inheritance: returning to the basics of OOP

According to MSDN:

Inheritance, together with encapsulation and polymorphism, is one of the three primary characteristics (or pillars) of object-oriented programming.

It is very simple to do it in C#, but sometimes we can fall in some traps.
Today we had a very interesting problem. How to prevent a child class to override a base class method?
Lets go to our problem: We have a base class called ContentPageBase that inherits from System.Web.UI.Page. And we want to use it as base for our WebContentPages.
But, we want to prevent those child pages to access the method Page_Load(). How to do it?
Simple, there is a class type named "abstract". Lets go again consult the MSDN:

The abstract keyword enables you to create classes and class members that are incomplete and must be implemented in a derived class.(..)An abstract class cannot be instantiated. The purpose of an abstract class is to provide a common definition of a base class that multiple derived classes can share.

So we can define a common definition of the Page_Load() method that cannot be overloaded by the child classes. By defining a class as abstract, it blocks all the methods from being overrided unless you defined the method as virtual.

So the code will be like this:
public abstract class ContentPageTemplate : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Page.Title = "Calling from Base Class";
}
}
If you try to override the method by implementing the child class:

public partial class WebContent1 : ContentPageTemplate
{
protected override void Page_Load(object sender, EventArgs e)
{
Page.Title = "Hello ";
}
}

When compiling the following error will appear:
cannot override inherited member 'ContentPageTemplate.Page_Load(object, System.EventArgs)' because it is not marked virtual, abstract, or override

Actually there is no way to prevent the child class to just write a new method with the same name, but you can avoid the overriding by creating abstract classes.
If you don't define a class as abstract, the compiler will automatically convert all the methods as virtual, and you lose the control over them.

Video: OnLive gaming demonstrated live, network latency discussed

Now trying to use in games, imagine in a future you don't need computer in home or work (Maybe in this case the war room will be more fast to create. hehehehe).

Online demostration


Who like games: Onlive

Saturday, March 21, 2009

Firefox Lover's


from : MundoTecno

Reasons to install IE8 :

green : surf in web
blue : download Opera
orange : test a new anti-virus
red : download Firefox

One image is better than one thousand words... ;-)

Thursday, March 19, 2009

IE 8 final version.

According to a brazilian blog(meio bit) the final version of Internet Explorer 8 will be launched today, 1h in the morning JST.
I am using in my machine the demo version, and I have only one problem with my Visual Studio 2003, it doesn't run in debug mode when more than one IE window is open. Wondering why... Lets see how the final version behaves..