Smart Contracts

Updating Solidity code and Testing a Smart Contract

Books on the Blockchain

Publica Self Publishing

Goodbye Contracting

Hello brave new old world...

Ruby-Selenium Webdriver

In under 10 Minutes

%w or %W? Secrets revealed!

Delimited Input discussed in depth.

Tuesday, 28 February 2017

100 Day Deep Work - Day 1: C# Namespaces

OK, so officially Day 1 of the #100DayDeepWork challenge inspired by Cal's Deep Work book and I've actually raced ahead of myself and done some of the proposed study out of order. Namely, the 1hr course by Mosh which was a good warm up, I should have thought of doing that first instead of something that takes 8 hours ;]

Better still, I was able to skip forward during his presentation as the material is very basic for me at at this point. Be sure to check the description section as he kindly provides the timings for each topic he discusses. You can also check out his website and courses too if you like his style (you will!).

One thing that came up from his video however was Namespaces. I've certainly used namespaces in my code before, heck Visual Studio automagically creates a namespace for you and as part of C# there no getting around using them. However, it's always interesting to note that you use these things without questioning, so I decided to do some Deep Work on Namespaces. There were two goo take-aways that are a bit more ingrained in my brain now:

  • Namespaces aren't arbitrary, they are describing the structure of the solution you're coding
  • They're hierarchical and so thought needs to be given to how you declare them
  • That hierarchy controls scope and so can be a powerful tool for your code design
Going ahead I'll be paying more attention to the use of Namespaces and how they appear in my code.

Nested Namespaces
As we create our namespace hierarchy we can declare them in a long form that we write out as below. For example;
namespace ExampleNamespace
    class ExampleClass
        public void ExampleMethod()
           //some stuff here

    // Then add a nested namespace
    namespace TheNestedNamespace
In terms of declaring them I'm not going to use nested namespaces as that feel like a great way to over complicate the layout of code. Instead I'll follow the common shorthand approach.

The shorthand, and I think tidier way, of declaring them is more as we usually see:
using ExampleNameSpace.TheNestedNameSpace
This seems much neater to me.

Another consideration is that if the nested namespace usings may become very long as we build our hierarchy out. A way around this is to use an Alias.

using MyAlias = ExampleNameSpace.TheNestedNameSpace
Now we can just type a line such as:

That's it for Day 1 of Deep Work. I had a question nagging me about iterating over multiple elements with Selenium so tomorrow I might work on that just so it's not distracting.


P.SThis is the book that gave the idea of the 100 Day Deep Work challenge, check it out!
Day 1:
Day 0:

Monday, 27 February 2017

100 Day Deep Work - Day 0 - The Learning Plan

Yes, Day 0 of #100DayDeepWork was all about planning and it took place on a 2.5hr journey back to London. In truth I slept some of that time, but hey I still got the 90 minutes in!

You can pick up the book that inspired this or just carry on reading through the posts.

Following on from the post yesterday and looking back over James's infographic, I thought it would be wise to plan a little first. If mastery is the primary objective that, I feel, needs depth of understanding. As such I've planned out to work through a set of online tutorials and likely before they finish to then start cutting code by following a collection of YouTube tutorials I've collated.

The courses I'm going to work through are:

Once they're done, well actually as they're worked on and I feel the urge to cut code, I'll jump onto application and algorithm development. The idea is that by the time I've done the above I've started a) encountering material I'm already comfortable with and b) have seen more then one way to do the same thing.

Just be aware these phases of C# and Selenium will overlap. There's no need to just to C# or just do WebDriver after all. Indeed, the course by Nikolay starts with a C# primer. Right now I'm in an automation role looking purely at front end. Pretty basic then but a good warm up for to go deep diving.

After the above I will start layering in some Deep Learning of C# via sample app development. I created a playlist here: Learn C# via application development. These 8 videos will take about 5 hours or so to complete.

30+ Days so far
With stopping and starting videos, practice, etc. I'd estimate this is around 50 hours of Deep Learning minimum. That's about 33 days, but with skipping over the things that I'm happy with I'd say we have 30 days learning here.

OK, time to rest up and get onto Day 1 of #100DayDeepWork


Friday, 24 February 2017

100 Day Deep Work - Mastering Automation

Hi All,

I recently caught a tweet to a blog post by James Willett (Twitter / Blog) where he mentioned the idea of doing a 100 day Deep Work Challenge. The basic idea of which is that over 100 days you do a 90 minute focused session to achieve a defined learning or productivity goal. It’s a great idea that I’ve decided to take up the challenge!

Now I haven’t read the book that James refers to, but hey, grab it via my Amazon link. I’ve Instead read the very informative blog post he created. Make sure to read it and have a look at the infographic he produced. While I recognise reading the book would probably be wise to read, I’m going to say I don’t need to as I already know what I want to study and having done similar challenges in the past, James’ post is a good enough guide.

So what’s my challenge?

A New Year’s Resolution
At the start of 2017 I made a commitment to transforming my technical capability with automation – by the end of the year. Yes, I’ve been doing automation as an element of my delivery toolkit for about 5 years, but I’ve never felt I have the deep expertise that I have around testing. I’m happy that 90% of the time I am the best tester in the room. Not being arrogant, it’s just I’ve studied, written, presented, mentored, taught and applied what I do for the last 15+ years. I better be pretty good by now!

With automation however, I’ve always felt there’s a huge body of knowledge I have yet to acquire and a depth of expertise that I have a duty to possess when delivering automation to clients, that I don’t currently possess. That troubles me. My wife disagrees, saying I am probably better than I think. She may be right, but I know what level I want to achieve and how that looks in terms of delivery and I’m not there yet.

So, to the Challenge. In summary, I’m going to focus on the deep learning and subsequent practical use of C#, Selenium WebDriver, SpecFlow (and so BDD) and Git. As I’m not paying for the SpecFlow+ Runner I’m going to generate reports using Pickles.

Let’s look in details at the 6 Rules James outlines in his blog post:

1) 90 Minutes everyday
That’s actually fine, I spend easily that each day studying generally anyway and though it’s a longish session the idea is that I accelerate the learning.
Caveat – There’s a catch here, I am NOT doing this at weekends. Simply because we have a family agreement that I can work and study as hard as I like in the week, but weekends are for family. Laptop shut, 100% attention to family. No exceptions.

2) No distractions
As Rule 3 stipulates doing Deep learning first, that’s fine as I’ll be locked in a room on my own

3) Deep Work first
The Deep Work will be done first thing in the morning so that’s also just fine. It means getting up a notable amount of time earlier, but that just means I need to get to be earlier. Not a bad thing as it’ll stop me ‘ghosting’ around through the small hours as I often do.  I need to be out to work by 8.00am, so my start time is going to be 6am. Ugh, let’s see if I can keep that up!

4) Set an Overall Goal
The Goal to achieve is reasonably simple to prove as a friend and I have set up a new site called; where the goal is to provide a real back-to-basics and step-by-step series of posts and pages that allow newcomers to automation to get set-up and running with Selenium based automation. If that site isn’t content heavy by mid-year, you know I didn’t complete the challenge.

5) Summarise every session
Every session will be summarised on this blog, using the tag #100DayDeepWork and I’ll post a link on Twitter each day and sometimes on LinkedIn. Yep, no hiding if I succeed or fail. I’ll not only post the update about what I’m learning, I’ll share how the challenge is going generally.

6) Chart your Progress
I’m going to make a Calendar / Chart with the days showing, then publish it each day on this blog and link it via Twitter too. As per the Caveat in Step 1, that means I’ll achieve the 100 days in roughly 5 months. Feels like a long haul already.

There it is; 100 days of Deep Work, 100 Tweets, 100 Blog posts. Let’s see how this goes!

As a last thought – Let’s add a Good Cause into the mix
Blog views and advert clicks off those posts generate revenue. My ad revenue is minimal, about a £1 a week on average. If you take the time to view the posts daily, you’ll generate ad revenue. If you see an ad you like then click it and they’ll be a bit extra generated. At the footer of each post I’ll add any affiliate links I have. Use them to generate affiliate revenue. 

OK, onto the Deep Work!