Wednesday, January 21, 2004 - Posts

Blog Engine: .Text vs. DasBlog

What is now the best Blogging Engine? I think it's difficult to decide. Now there are 2 engine that seems the best: .Text and dasBlog. They have some different and common feature that could be resumed as follow:

Unique .Text features:

  • Database backend (SQL Server or MSDE)
  • Multiple Blogs from single install
  • Extensible content pages (“Articles“)
  • Extensible categories for “Articles“ & “Links“

Unique dasBlog features:

  • XML backend
  • Blogroll manager
  • “Mail to Weblog“
  • SMTP notifications
  • User can select skin
  • Installation program (.msi)
  • Many configuration options 

The common feature are:

  • skins/themes
  • RSS 2.0 and Atom feeds
  • traceback and referrals
  • categories
  • comments
  • Web Service access

What is the winner of this contents? Maybe a future engine that combines all these feature?

Build an IIS Virtual Directory Addin for Visual Studio .NET

This is really a cool article from Peter A. Bromberg... It's a good example of how you can create a VS.NET Addin.

Check it HERE!

Problems about System.Web.Mail?

Now are available the FAQ... check it!

DotGNU... have you try it?

Does anyone have tryed this open source project (DotGNU)?

I'm really interesting to know opinions and comments about it...

ImageGallery Application in ASP.NET

Last week I was searching for some ImageGallery stuff in ASP.NET and came across this nice tool, which is also linked from ASP.NET Source Projects tab. Check out nGallery, which is an open source Image Gallery application:

http://www.ngallery.org/

It has a diversified set of download options like Source, Binary or Source and Binary, in case you want to tweak and deploy, just deploy etc.

Check it out...

Solve parameters ambiguity with Web Services

The most immediate solution is to have a lot of methods, each one for a special function (for example, for a Class Person you can have a method to print First Name and Last Name and another method to print the Corporate Name). But if you have 50 or more options? It's not a practicable choice.
An alternative way is to use a CHOICE element.
Let's see an example...

We have 2 Class:

public class PersonaFisica
{
 public string FirstName;
 public string LastName;
}

public class PersonaGiuridica
{
 public string CorporateName;
}

we can map the classes with a single property:

[XmlType(Namespace="urn:peway:datatypes")]
public class Contact
{
 public string CodiceFiscale;

 [XmlIgnore()]
 public TipoPersona Tipo;

 [XmlChoiceIdentifier("Tipo")]
 [XmlElement("PersonaFisica", typeof(PersonaFisica))]
 [XmlElement("PersonaGiuridica", typeof(PersonaGiuridica))]
 public object Persona;
}

where TipoPersona is an Enum Type:

public enum TipoPersona
{
 PersonaFisica,
 PersonaGiuridica
}

in this way we inform the XML serializer that the property Persona can be PersonaGiuridica and PersonaFisica.
The XmlChoiceIdentifierAttribute is used to identify which class we're using with the Enum. When a SOAP message arrives, the XML deserializer check the type of Persona and will map it on the correspondent type.

So you can print the names based on the Enum value:

[WebService(Namespace="urn:peway:services")]
public class Contacts
{
 [WebMethod]
 public string PrintName(Contact contact)
 {
  switch(contact.Tipo)
  {
   case TipoPersona.PersonaFisica:
    PersonaFisica pf = (PersonaFisica)contact.Persona;
    return string.Concat(pf.Nome, " ", pf.Cognome);
   case TipoPersona.PersonaGiuridica:
    PersonaGiuridica pg = (PersonaGiuridica)contact.Persona;
    return pg.RagioneSociale;
   default:
    return "Not recognized Person";
  }
 }
}

Descriptions for the Enum Types

In your programs, you can use very often (for comfort) the Enum Type, and sometimes you would associate a description to the elements, for use it on the user interface.

A way to do this is to use the System.ComponentModel.Description attribute:

Public Enum Prove As Integer
         <System.ComponentModel.Description("Prova uno")> _
         Uno
         <System.ComponentModel.Description("Prova due")> _
         Due
         <System.ComponentModel.Description("Prova tre")> _
         Tre
End Enum

To retrieve these descriptions you can use the reflection:

Dim fields() As System.Reflection.FieldInfo
fields = GetType(Prove).GetFields(Reflection.BindingFlags.Public Or _
                                                      Reflection.BindingFlags.Static)

For Each field As System.Reflection.FieldInfo In fields
       Dim descriptions() As Object
       descriptions = field.GetCustomAttributes( _
                             GetType(System.ComponentModel.DescriptionAttribute), _
                              False)

       If descriptions.Length > 0 Then
              MsgBox(DirectCast(descriptions(0), _
                            System.ComponentModel.DescriptionAttribute).Description)
       End If

Next

Microsoft Alerts now available also in Italy

It's a service available only in 4 Nations in the world (USA, Hong Kong, France and now also Italy). You can receive in real time informations about Reports, Economy, Politics, Sports, Foreign countrcountries, Shows and Music. You can choose how to receive and where...

You can try this service for free: www.msn.it/alerts

WAMP 1.5 is here!

From today is available for a free download WAMP 1.5.0, a tool for automate the installation process of Apache, PHP, MySql and phpMyAdmin on Windows systems.

E-novative WAMP is totally free, simple to use and you can download it from  HERE.

This is the future??

Could it happen a day?? :)

OS "sucks or not" Meter... a good study?

An interesting (and curious) study... but, what about the generic term "Windows"???

http://srom.zgp.org/

ServiceConfig Class... check it!

This class is sometimes neglected (I'm one of this) but, with it, is possible to do some nice things.

For example, if you would like to set the timeout of a transaction (deprecated), the ServiceConfig class can be used as follow:

if (ContextUtil.IsInTransaction)

{

      ServiceConfig config = new ServiceConfig();

     

      config.TransactionTimeout += 1000;

      ServiceDomain.Enter(config);

} 

 

Nice :)

Visual Studio .NET secret Shortcuts

Maybe you don't know these undocumented shortcuts in Visual Studio .NET:

If you are in the Code Window, press SHIFT + ALT + ENTER and you'll obtain a wonderful Full Screen Mode of your window (all opened windows, toolbar and Windows Start Bar will disappear)...

With Visual Studio .NET is also possible to do a "squared selection" of text, only by pressing the ALT Key and moving the mouse (you can now Copy, Cut, Paste and Delete the selection).

This is a standard selection:

and this is a "squared selection":

Wonderful :)

My first post here...

I'm really happy to start my Official Professional Blog here... and expecially to start it at my birthday (yes, today is my birthday!!!!) ...

A little presentation about me? I'm an Italian Computer Engineer and i'm working for a software house in Turin called SHIFT s.r.l. My first activity is about the .NET world, and i'm focused about Visual Basic .NET and ADO.NET.

I have a personal site (http://www.demiliani.it) and a "free time" blog (http://www.demiliani.it/blog), but from today this blog on DOTNETJUNKIES will become my first point of tecnical contact.

I hope that this Blog could be an important way to share opinions and knowledges with other communities and developers like me...

Thanks for this opportunity!