Sunday, 27 July 2014

Patterns

Finally bought myself a patterns book, lots of wow and that is very clever moments and to get the best out of it a number of re-reads is a must. 

Factory, prototype, adapter, chain of responsibility and singleton I can see how they can be useful, they make a lot of sense. Some others will have to be left until I can go through them again




Little bits, looking through pluralsite agile courses the agile manifesto was mentioned which I have signed. 

Doing other reading about collection types, just how easy it is to implement a list, stack, queue, once the concept of a node is understood, I made my own list!

Hopefully this then makes it easy to see that you can add lots of different methods for push, pop, enqueue, dequeue, contains etc.

namespace basicsTests
{
    class Program
    {  
        static void Main(string[] args)
        {
            var firstNode = new aNode<string>("first string");
            var secondNode = new aNode<string>("second string");
            var thirdNode = new aNode<string>("third string");

            var someList = new aList();
            someList.add(firstNode);
            someList.add(secondNode);
            someList.add(thirdNode);

            someList.displayList();
            Console.Read();
        }
    }

    class aNode<T>
    {
        public object stored;
        public aNode<T> nextNode { get; set; }

        public aNode(T objectToHold)
        {
            stored = objectToHold;
        }
    }

    class aList
    {
        aNode<string> headNode = null;
        aNode<string> tail = null;

        public void add( aNode<string> node)
        {
            if (headNode == null)
            {
                headNode = node;
                tail = node;
            }
            else
            {
                tail.nextNode = node;
                tail = node;
            }
        }

        public void displayList()
        {
            var displayNode = headNode;
            while ( displayNode.nextNode != null)
            {
                Console.WriteLine( displayNode.stored);
                displayNode = displayNode.nextNode;
            }
            Console.WriteLine(tail.stored);
        }
    }
}






And apart from that a dragon fly flew into me, they make a decent noise when they take off.



 

Sunday, 20 July 2014

Getting healthy

The healthy programmer

Book with laptop and colourful coder walking away from it

At the moment I have not been able to implement all of the suggestions, new desk and monitor are needed. The only monitor about that meets the auto light adjustment and low blue is the BenQ BL2410PT.

Books website http://healthyprog.com/ 

A few of the main take aways from this book are to not sit for longer than an hour. Get walking, I bought a pedometer I am quite far short of the 10,000 steps per day so walking after lunch this week to see how the stats change.

Don't buy a cheap pedometer, there are lots about for less than £3, they don't count properly in my experience. Tanita 3 axes is working well.

Silver black pedometer with 3 buttons and counter display


Signing up for the yoga class sounds a pain, there are a few classes about, not just fitness centres the local college here offers different courses.  

Little useful things

OnClientClick can be added from the code behind just as an attribute
someButton.Attributes.Add("OnClientClick", "someJS();");

Off by one errors even happen to experienced devs and can produce strange results. 

Browsing stack exchange, there is a good thread on books to read, I have added a lot to the reading list
http://stackoverflow.com/questions/1711/what-is-the-single-most-influential-book-every-programmer-should-read 

Things for me to think about, I need to address the lack of knowledge with Regx, SQL and XML. When should I start looking at another language to dive into, apparently since I have done more in object orientated languages I should look at functional. Which functional language, f# and erlang look good, then looking at the job boards opportunities are limited. So much to learn!




Sunday, 13 July 2014

New Server!

Purchased a new server to manage back ups and a few bits, and this was on sale, the HP MicroServer N54L, they are the older model but for £130 not bad.

Decided on Linux to run it, ubuntu seeming the the in fashion flavor I went with that, a few hiccups with the install via USB which worked in the end using LinuxLive.

The only problem with ubuntu being graphics drivers, apparently this server has a built in mobility radeon 4500, which caused a black screen of death. 

To actually get into ubuntu was a bit of a faff, mash the shift key while it boots, this gets you into grub, hit e to edit, then after the kernel command add nomodeset. This allows ubuntu to boot properly.

When I get the basics set up, crash plan can go on and will sort it self out with backing up a remote copy of all the files I have.

More about the hardware, I like lots of little touches, the HP logo being red if you do something bad, easy HDD removal, internal USB port, and all the screws you need with their own torx key mounted inside the door. 

computer screen with purple background and dialogue box with scrolling text
black cube server box with white hp logo


server cube black with front door open showing quick release hard drives

server cube with door open and top off for optical drive

black server cube open with top off and quick release drives out


Little things learnt this week, asp button onclientclick will allow the onclick to run if onclientclick returns true.

Paint.net is not really that bad if you take the time, lot of short cuts for cropping images which I have done a bit of this week. 

Just dump zombie code and let svn handle it, so much effort to work around.









Sunday, 6 July 2014

All the little things

Purchases, 

Head first SQL, I read the reviews and liked the idea of the quirky style of learning which does seem to work for a lot of people, just not for me. 

The book just didn't work for me in the way I found it confusing about what I was actually supposed to do and actually a little bit of set up to get everything running. Perhaps for us more visual people picking a db with some sort of GUI would have been a lot of help. 

For next time I would pick a book that would err towards ms SQL, the book in it self was not a complete bust, I can now use select statements well which is helpful for digging out details. 

A4 sized book, picture of a woman surrounded by funny comics

Note: I take pictures of the books to prove I read them, to jog my memory when I review my posts for learning and I am visual thinker, images break up the text.

Things learnt this week, 

ctrl + f5, to do a full refresh of a page, the browser will get new copies of images and does not rely on any caching.

When using selenium IDE, select will work, when brought across to NUnit c# via selenium IDE this will not work, the correct command is SelectElement.

Click before SelectElement works in selenium IDE, in NUnit all this does is end up highlighting the selection in the drop down not selecting the item. 

I often use ctrl + k + f to clean up selected code in visual studio 2013, just use ctrl + k + d and clean up the whole document. Code is often moved around without any formatting applied which makes it harder to understand, especially nesting. 

A c# operator I was not familiar with is the null coalescing operator, I can see how to it could be handy it is new to me so very clunky. The idea is nullable types can be checked for null whilst their value is being assigned, otherwise we can set a default value.

Object someObject = null;
Object anObject = someObject ?? new Object();

The above assignment to anObject reads as if someObject is not null assign anObject the value of someObject else anObject is assigned the value of newObject(). 

Use space bar to pause play any media in ff seems to work in chrome, handy for pluralsite.