BLOG

Thycotic Alpha-End Competition Entry

14 August 2010 by Stuart Cam

Thycotic have put up a Code Challenge.

Below is my heavily LINQ-oriented solution:

public interface IConverter
{
    string Convert(int number);
    int Convert(string number);
    string ConvertUsing(IConverter convertor, string number);
}

public abstract class ConverterBase : IConverter
{
    protected abstract string Chars { get; }

    public string Convert(int number)
    {
        return this.Encode(number)
                   .Aggregate(string.Empty, (s, c) => s + c);
    }

    public int Convert(string number)
    {
        return number.Reverse()
                     .Select((c, i) => Chars.IndexOf(c) * (int)Math.Pow(this.Chars.Length, i))
                     .Sum();
    }

    public string ConvertUsing(IConverter convertor, string number)
    {
        return convertor.Convert(this.Convert(number));
    }

    private IEnumerable<char> Encode(int number)
    {
        var remainder = number % this.Chars.Length;
        if (number - remainder > 0)
        {
            foreach (var power in this.Encode((number - remainder) / this.Chars.Length))
            {
                yield return power;
            }
        }
        yield return this.Chars[remainder];
    }
}

public class Converter : ConverterBase
{
    protected override string Chars
    {
        get
        {
            return "0123456789xyz";
        }
    }
}

public class HexConverter : ConverterBase
{
    protected override string Chars
    {
        get
        {
            return "0123456789abcdef";
        }
    }
}

public class BinaryConverter : ConverterBase
{
    protected override string Chars
    {
        get
        {
            return "01";
        }
    }
}

public class OctalConverter : ConverterBase
{
    protected override string Chars
    {
        get
        {
            return "01234567";
        }
    }
}

Note: The code doesn't handle negative inputs or exceptions.

Tags: ,

Categories: .NET | C Sharp | TDD

Death March

15 June 2010 by Stuart Cam
Death March - Edward Yourdon
Death March - Edward Yourdon
  1. Customer's requirements are captured in written form
  2. Requirements are transformed into further written documentation
  3. Timescales are predicted using guesswork and multiplication
  4. Invariably this process always results in a bid for work
  5. Cost is calcuated as a function of timescales and resources
  6. The statement of work is drawn up to include as many get-out-of-jail-free loopholes as possible
  7. The schedule is unveiled, all hail the schedule
  8. Developer units are hired to work to the schedule
  9. Requirements and specifications are buried in word documents and spreadsheets
  10. Key knowledge held by people who are disconnected from development
  11. Distributed teams make communication difficult
  12. Development derives additional requirements during the solution process
  13. Customer changes requirements
  14. Cycles of rework begin
  15. Plan starts to slip
  16. Management become unhappy
  17. Pressure begins to mount and quality begins to suffer
  18. Developers suggest solutions, but these are stifled or trivialised
  19. Retrospectives are conducted behind closed doors
  20. A new schedule is drawn up, goto 7.
  21. Morale plummets
  22. Self-preservation begins to take over
  23. The development team starts to dissolve

I wonder what the outcome will be?

Tags: ,

Categories: Management

Eric Evans DDD Presentation

12 June 2010 by Stuart Cam

Another fantastic presentation from Eric Evans which resonates strongly with me:

http://domaindrivendesign.org/node/198

During the presentation he talks about documenting the process he has been using over the last 6 years. You can download a copy of the draft write-up too.

http://domainlanguage.com/processdraft/

Is this the possible start of a new book?

Tags: , ,

Categories: Agile | DDD

The Others

25 May 2010 by Stuart Cam

During my 8 or so years contracting I've been fortunate enough to work with a variety of different companies, from the cautious and slow-moving banks through to dynamic and fast-paced digital agencies.

Throughout my journey I've been lucky to meet and work with some truly brilliant people, great designers, developers and managers. I've also come across my fair share of 'others':

  • The others aren't interested in learning.
  • The others carry grandiose titles like 'Senior Software Architect' simply for being in the company for 10+ years.
  • The others repeat the same mistakes over and over again.
  • The others use seniority to quash innovation and perceived threats from the lower ranks.
  • The others view new ideas and technologies with scepticism.
  • The others view the 'hired help' with suspicion and contempt.
  • The others treat their job as entitlement.
  • The others clock-in and clock-out.
  • The others play political games to compensate for poor performance.

I'm sure you know who the others are in your workplace.

The message for this blog post is to encourage you to be the best you can be; don't settle for being an 'other'.

Personal and professional development is the only true job security in this ever-changing world.

Tags: ,

Categories: General | Management


© Codebrain 2017. All Rights Reserved. Registered in England: 07744920. VAT: GB 119 4078 13