Friday, 24 August 2007

Security B&B way :)

I'm going with my friends over the weekend to climb up the highest mountain in Ireland - Carrauntoohil. I volunteered to book B&B. I sent an email to a few B&B owners and waited for a reply. Majority of them were booked out but one woman offered a family room for us. The interesting part of this story is how she wanted me to send my CC details. Below I show the best snippets from the email conversation.
The women:
"(...)Please give your cc number and expiry date if you wish to secure the booking.  Cash is paid on morning of departure."
Me:
"Is there any website that I can use to book the room? Sending CC number in an email is not secure. Emails are not properly secured and encrypted"
The women:
"People usually send 2 emails with half the number on each"
Just brilliant :)

Monday, 20 August 2007

From forestry to IT - channel 9 show

Peter Spiro is one of these guys who took unusual steps to get into IT. It's enough to have a look at him to figure out that he is more then interesting :) .  The whole conversation is about people and how to manage them in a way that both the Company and they benefit from it. It's first time I heard that we need to build properly layered systems just because there are some smart guys out there that want to unplug an old component and replace it with their own - better :).  
The next thing that absorbed my attention was his list of features that a good team should be characterized by:
  • trust
  • diversity
  • no single man show
  • shared responsibility
  • passion
It looks like a list of obvious things but you would be surprised how many teams lack 2 or more of them. And the last but not least, he knows what the work-life balance is. It was a well spent hour :).

Saturday, 28 July 2007

80 characters long line is gone

I remember that not so long ago everyone was saying that a line of code should not be longer then 80 characters. The problem with this approach is that it leads you to cryptic method/class/variable names because of the 80 characters hard limit. I could justify that rule back in the epoch of 15 inch CRT monitors because there are not too many things more annoying then constant scrolling from right to left and left to right to be able to read a piece of code. But even nowadays there are people who would stick with that rule which doesn't make sense for me because it's just a waste of space of your 17/19/20 or 24 inch LCD monitor. 24 inch is a really great one and 2 of them are just brilliant :).

Friday, 27 July 2007

Joel Spolsky will come to Dublin

Great news. Joel Spolsky will (more then likely) come to Dublin to promote FogBugz. I don't use FogBugz personally but I've been following Joel's blog for more then one year and I can always learn something from him. It's not about the technology itself. It's rather about how the technology is related to our real life and how we can take advantage of it :).

Friday, 20 July 2007

Dynamic nature of C# I bet you don't know :)

Yesterday I read a blog post that meant to discuss possible naming conventions for LINQ but it turned out that the most interesting part of it was something completely different. Namely, Krzysztof Cwalina wrote that we don't have to implement IEnumerable and IEnumerator to be able to iterate through an object(collection) using foreach statement. It's enough that a class exposes GetEnumerator() method. It doesn't have to implement IEnumerable interface. At the beginning I thought that it's just another example of syntactic sugar and that the C# compiler generates implicit IEnumerable declaration on our behalf. But then I opened ildasm.exe and saw that that's not the case. IEnumerable wasn't there. That's it. Have a look at the code snippet and screen shot below to check it out.
The bottom line is that I learn every day and .NET doesn't stop surprising me which is fun :).
EDIT: I've modified the image because it looked horrible.

using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
class Program
{
    static void Main(string[] args)
    {
        FakeEnumerableClass enumerable = new FakeEnumerableClass();

        foreach (object o in enumerable)
        {

            //works perfectly fine :)
        }
    }
}
class FakeEnumerableClass
{
    public FakeEnumerator GetEnumerator()
    {
        return new FakeEnumerator();
    }
}
public class FakeEnumerator
{
    public bool MoveNext()
    {
        return false;
    }

    public object Current
    {
        get
        {
            return null;
        }
    }
}
class RealEnumberableClass : IEnumerable
{
    public IEnumerator GetEnumerator()
    {
        throw new Exception("The method or operation is not implemented.");
    }
}


 

Tuesday, 17 July 2007

DTrace - an interesting tracing solution

I've just come across an interesting article about DTrace which is a tracing solution developed by SUN. I still need to dive into it deeper but it's key features are:
  • zero overhead when it's turned off
  • C based query language that allows you to query available probes
  • it allows you to analyze the whole system at very low(kernel level operations) and/or high level (number of garbage collections)
  • it gathers probes only when it's safe for the system
  • it's built-in into Solaris 10 and will be part of the next operating system from Apple called Leopard
It's been awarded many times and it really looks great because it provides very precise picture of the system.