Aleksandar's computer workshop

Let's see what Aleksandar was fixing today.
My findings, tips & tricks related to computers, internet, programming and other stuff I was working with.

Differences Between Microsoft Visual Basic .NET and Microsoft Visual C# .NET

Because of the past differences between Microsoft Visual Basic, Microsoft Visual C, and Microsoft Visual C++, many developers have the impression that Microsoft Visual C# .NET is a more powerful language than Microsoft Visual Basic .NET.
Some developers assume that many things that are possible in Visual C# .NET are impossible in Visual Basic .NET, just as many things that are possible in Microsoft Visual C 6.0 and earlier or Microsoft Visual C++ 6.0 and earlier are impossible in Microsoft Visual Basic 6.0 and earlier. This assumption is incorrect.
Although differences exist between Visual Basic .NET and Visual C# .NET, they are both first-class programming languages that are based on the Microsoft .NET Framework, and they are equally powerful. Visual Basic .NET is a true object-oriented programming language that includes new and improved features such as inheritance, polymorphism, interfaces, and overloading.
Both Visual Basic .NET and Visual C# .NET use the common language runtime in the .NET Framework, and almost no performance issues now exist between them.
Visual Basic .NET may be oriented more toward ease of use by providing features such as late binding, and Visual C# .NET may have a few more “power” features, such as handling unmanaged code, but the differences are very small compared to what they were in the past.

More details:

This article points to the "Differences Between Microsoft Visual Basic .NET and Microsoft Visual C# .NET" white paper

Quick reference guide to highlight some key syntactical differences between VB.NET and C# 

Complete Comparison for VB.NET and C#

VB.NET and C# cross conversion tools are available here:

Convert C# to VB.NET 

Convert VB.NET to C# 

Free disk space checking in Linux

There are plenty of tools with which you can check your disk space.
However, Linux already has a built in function to show you just what you need to know.
Open a terminal window or push (ctrl+alt+F1 to go to console) and type:

df

You will see something like this:

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hdb2             12262868   2383044   9256904  21% /
/dev/hdb1               101086     11096     84771  12% /boot
none                     95580         0     95580   0% /dev/shm
 

This one is bit unreadable, because size is represented in 1K-blocks. Lets try to make it clean and more readable:

df -h

Filesystem            Size  Used Avail Use% Mounted on
/dev/hdb2              12G  2.3G  8.9G  21% /
/dev/hdb1              99M   11M   83M  12% /boot
none                   94M     0   94M   0% /dev/shm
 

Now the size is represented by megabytes and gigabytes.

Health monitoring in ASP.NET 2.0

Here is a very simple web.config file that sends an e-mail whenever an unhandled error occurs. Pay attention to the <healthMonitoring> and <system.net> section. These are the important ones that makes it work.

 

<?xml version="1.0"?>
<configuration>
   <appSettings/>
   <connectionStrings/>

   <system.web>
      <compilation debug="false" />
      <trace enabled="true" localOnly="false" />

      <healthMonitoring enabled="true">
         <providers>
            <add name="EmailProvider" 
               type="System.Web.Management.SimpleMailWebEventProvider"
               from="you@domain.com"
               to="you@domain.com"
               subjectPrefix="Error: "
               buffer="true"
               bufferMode="Notification" />
         </providers>
         <rules>
            <add provider="EmailProvider" name="All App Events" eventName="All Errors" />
         </rules>
      </healthMonitoring>

   </system.web>
   <system.net>
      <mailSettings>
         <smtp from="you@domain.com">
            <network host="smtp.domain.com" />
         </smtp>
      </mailSettings>
   </system.net>
</configuration>

How easy can it get? Truly amazing.

http://blog.madskristensen.dk/post/Health-monitoring-in-ASPNET-20.aspx

http://aspnetresources.com/articles/aspnet_2_0_health_monitoring.aspx

http://msdn2.microsoft.com/en-us/library/ms998306.aspx

http://msdn2.microsoft.com/en-us/library/yc5yk01w.aspx

Mail Password Recovery moved to new site

Old Mail Password Recovery page has be moved to new location. Update your bookmarks. I have some plans to update the tool, so keep eyes on it.

Few words about program for people which are not familiar with it.

Mail Password Recovery allows you to recover your email password for any POP3 account, as long as it is stored in an email program on your computer.
You just need to temporarily change the settings in your email program, so that it connects to email password recovery instead, and your password will be revealed.

More information is available here:

http://gsmblog.com/page/Mail-Password-Recovery.aspx