Category Archive Self Improvement

The Pragmatic Programmer 20th-anniversary edition

Do I really need to read the pragmatic programmer 20th anniversary edition? I mean I read the original one years ago and loved it. So why waste the time? Well to be honest because I loved it! Why not see what I forgot and what is new?

But I don’t have time: I’m trying to bring my high blood pressure back down through exercise and getting my 135kg body through martial arts training and healthy eating while doing a full-time job. Frankly, I have a stack of new books to read some fiction, some fact and I’m studying Google’s SRE so is another book really a good idea? Well, what programmer doesn’t have a huge stack of books… Code Complete, SRE Workbook, Working with Legacy Code.

How about an audiobook? YES! Perfect. I can listen to it while I walk the dog and while I am cleaning the house! Which was a great idea, until the audiobook started trying to read a Linux grep instruction out loud. Soon after it was reading out semaphor code in the concurrency section and I quickly realised I needed to read it, in order to … well … read it.

Eventually, I did. Overall it was a great read and as always there were parts in it that I had forgotten over the last 4-5 years since I last read it. Well worth taking the time! The audiobook helped, but it sort of needed to pause and pop-up code on a window instead of reading it out loud.

To anyone thinking about reading this, go for it! It’s oriented for junior programmers, which I was when I originally read it, but there are themes, which I recognise have been subtly around me for the last 5 years without me even noticing they were from the book. It definitely had a huge influence on my career and even if you only read the beginning there are some concepts such as the broken window example, which have really helped me in job interviews.

Correct English

I have recently taken action to improve my English. It has been a few weeks of work and for my own sake, it seems worth recording here, why not? A huge part of my spirituality is my obsession with self-improvement and communication is a skill that everyone needs to work on. So here, I am learning about English.

I have always been insecure about my use of English. I often find my English skills lacking. It was the one subject that I struggled with at school and sadly no teacher was really available to tell me the difference between good English and bad English, particularly when it came to writing essays. A certain abscess of knowledge impacted me during my school years.

I thought that English was a matter of opinion. It was not like Maths or Science, where if you wrote the answer then it couldn’t be denied. It seemed the teacher might have a good day or a bad day. I wondered if our grades could be affected more by how much caffeine the examiner had in their system than what we wrote on paper. In fact, sometimes I imagined that if I and my best friends submitted the same answer for an English exam, then they would get an A and I would get a C because the teacher had more faith in my friend’s skill with the subject than their faith in me. Sometimes I think that my whole process of self-improvement is secretly a process of unpicking the woven threads of a troubled history, but whatever the reason improvement is always good.

Luckily through my degree at London Metropolitan University, I was aided by some incredible tutors who noted my tendency to dance around subjects and often assume everyone else was there with me already knowing what I knew. If they already knew, then why would they read what I had to say? I had to actually say it in a concrete way, not allude to it.

There was still a certain absence of style. My close friends were obsessed with it. One in particular, who will remain nameless, would not submit an essay until she was content with the style. By the time she was content with it, the essay would often be late and the tardiness often detracted from her score. Too often she got a lower score having improved the work due to the tardiness than if she had just handed it in on time with poor style, in the first place. What was this style that my friends were obsessed with and how could it be objectively achieved?

Luckily in later years, communication was a higher priority than a good readable style. I was able to work well as a type of secretary for a Law Court which involved drafting many letters and legal documents. I was able to learn a bit about the Ministry of Justice’s “house-style”, through the staff intranet and ensure that my writing was at least consistent. The house-style documents also taught me to remove many of the common mistakes that plague a lot of writers of Modern English.

However, my skill still affects me today. I found myself feeling unable to stand up for what I believed when someone, who clearly could not tell the difference between direct speech and indirect speech, started to disagree with me. I struggled the first time I came across someone referring to a work environment as “a fifty strong office” with no hyphen. Finally, I find myself in disagreement with people with whom I run a business about how we should draft something that is going to a newspaper, staff or customer.

I need a better command of English for the future. In recent years, I have begun a number of blogs, written quite a lot and continue to write public-facing emails and web publishing for Dragged Around London Ltd, where I am a director. So not only do I need to demonstrate skill, but I also need to be confident. In fact, I think confidence and academic sources is what I need.

How did I go about this? Well, I worked through Simon Heffer’s Strictly English : The correct way to write… And why it matters. For each section, I took some time to work through some examples of what had just been explained and I tried to apply it to everything I wrote when I was not studying. I was actually quite shocked at the sheer number of times I had the opportunity to use the subjunctive mood for example, which is almost always substituted for the indicative in spoken English. This practise helped it form part of my skills.

There were many common mistakes and explanations of the finer points of grammar. If I were to reproduce them all here, I would end up writing a book’s worth of information. But I will leave some comments about style, since that was the greatest effect this work had on me.

Can Simon Heffer really be considered a good source of information though? One of the main things I noticed was that the author was a writer for the Daily Mail. In my mind, the Daily Mail will forever have an impression that its authors and readers believe that there is a correct way to live one’s life. In my experience, the publication has often passed judgement on people who are different. And hello, I’m one of them. When the author kept saying, some people think this archaic way of speaking is pompous, but I think it should be retained, I frequently felt that the author’s prejudices about people who live and speak differently from him, has prevented him from recognising an evolving modern culture, which had already begun to leave him behind. He fails repeatedly to accept the last 40-70 years of language evolution, which is strange because what we call Modern English has been evolving as its own language for about 500 years. Why would he accept the first 450 years of that evolution and not the last 50? It seems to me, he is simply a man stuck in his time. In fact, a modern article suggested that correctly punctuated English induced anxiety in text messages and social media messaging. Using proper grammar often indicated someone switching to a level of formality which demonstrated that they were avoiding familiarity with the reader. The reader would often wonder what they had done wrong to deserve this formality. That does not however mean that Simon Heffer has nothing to offer us, but that his approach is limited.

One of the main things that I took from the book was some very useful sources of information, which the author collected nicely together. His main sources were as follows:

  • Modern English Syntax – C. T. Onions [1974]
  • The King’s English – Ascribed to the Brothers Fowler [circa 1908]
  • Politics and the English Language – An essay by George Orwell [1946]

The key takeaways from this process of learning are a few lists on what makes good written style; knowledge that I was denied in my youth.

Fowler’s text lays this out with 6 simple criteria in his section on vocabulary:

  1. Prefer commonly used words over far-fetched.
  2. Prefer concrete words over abstract
  3. Prefer singular words over circumlocution (beating about the bush).
  4. Prefer short words over long.
  5. Prefer Saxon words over Romantic.

My first criticism of Fowler, is that it is focused primarily on singular words since that was the intention of the piece and it does not comment on flow or anything that requires a less microscopic view. Secondly, while it mostly holds true today it is over 100 years old and there are other concerns today, which should be higher on the list. For example, there was no respect for concise sentences at the time and the result is often something that is unreadable today. Finally, I am not entirely sure I agree with the preference for Saxon words. In today’s modern English we are more of a multicultural society than ever before. For the last 40 years, our children have been raised with the metric system rather than the imperial so we can better communicate with Europe. There is more migration than ever before meaning more romantic words get imported into this country with people than ever before. Choosing words derived from the Romantic languages often makes our English more suitable for publication on the internet and more acceptable for a wide audience. Fowler was however characterising the “King’s English” not modern English for the internet-age 100 years before it happened.

George Orwell also provides us with a list:

  1. Never use a metaphor, simile or other figure of speech which you are used to seeing in print.
  2. Never use a long word where a short one will do.
  3. If it is possible to cut a word out, always cut it out.
  4. Never use the passive where you can use the active.
  5. Never use a foreign phrase, a scientific word or a jargon word if you can think of an everyday English equivalent.
  6. Break any of these rules sooner than say anything outright barbarous.

This is far more suitable since it looks with a wider lens rather than microscopically looking at individual words. It covers more detail and is a good 40 years or so later than Fowler’s, but it is still over 70 years old. It is still missing a few things.

Simon Heffer’s book made me consider quite a lot of my own opinions and the 7 C’s of communication mentioned on the MoJ’s staff intranet. I eventually looked at some of my own blog posts that I did not like and concluded why. In the process of thinking about my own writing, I came up with my own list to replace those that came before.

My own additions:

  1. Keep your sentences short to avoid derailing the reader’s attention. Remember in modern day people are used to reading Tweets not blogs. If you can break a sentence into separate packets of information, then you would probably be wise to do so and use them like brick to rebuild the full information by their proximity. A sentence really should be shorter than 20 words.
  2. Vary your sentence length to create a sense of fluidity.
  3. Be weird. Don’t say the expected. Don’t conform. Don’t be a Daily Mail reader. If you write what they expect, they will assume the rest of the sentence and stop reading. I think this is the reason for Orwell’s first point. They assume they know what you’re saying and stop reading. They also feel like they heard it before; that makes it boring.
  4. Be complete. Say everything your reader needs to know. If they might want more, but also might not, then give them a way to get it, but don’t include it. A hyperlink is good for this. Say things as precisely as you can.
  5. Break up paragraphs into different points. The first sentence of the paragraph should announce what the paragraph is about. Then you should explain the point and finally, close. This helps organise your work into digestible chunks.
  6. Avoid pronouns at the beginning of a new paragraph. If you’re making a new point then you should say who the actors are again. Don’t use “it”, “he” and “she” when you are starting a new point: “The difficulty of obtaining these books in Chinese” instead of “it”, “Daniel” instead of “he” and “The unknown older lady” instead of “she”. Yeah it’s longer, but it makes it less likely people will lose track.
  7. Be clear about what’s fact and opinion. Differentiate between them in your writing. Opinions could be prefaced with words like “I conclude that”, “it seems to me that” or anything else, which makes it clear where this information comes from.
  8. Avoid jumps in logic. Like maths you need to cover all your working out. For example it is clear from x that y is true and we are led to believe by z that when y is true abc must also be true, so we can conclude that abc is true. Straight forward formulaic logic.
  9. Follow all Orwell’s comments on good style from his essay Politics and the English language (above).
  10. Prefer less words over many. If you can say it in less words try to do so so long as you don’t end up breaking Orwell’s rules.
  11. Prefer verbs which don’t come with loads of prepositions to help convey their meaning. They often have multiple meanings and can lead to poor communication. Instead of “I cleaned up the table” prefer “I tidied the table” after all what does “cleaned up” mean? Cleaned? Tidied? Put everything away? Instead of “I want to give up sweets” prefer “I want to forgo / abstain from sweets”. Note that ‘give’ can mean passing a gift to someone else, ‘give up’ can also mean a form of surrender as well as abstaining. So why use ‘give’ when ‘abstain’, although it also has a preposition, does not have these multiple meanings? Where the preposition is required to ensure that meaning of the verb is clear, consider another option. This is most obvious when the verb means something different when it has no preposition. ” These are sometimes called phrasal verbs. Avoid them.
  12. Don’t be pompous. If one is truly an intelligent educated person they don’t need to emphasize it and make others feel disrespected.

More than anything, I realised that my use of language is actually quite acceptable. I simply had a lot of insecurity from poor teaching in school, which could not be reversed by my last English teacher in the 6 months she had with us. My work, blogging and academic writing have had an impact on my ability as well. While my vocabulary to describe literature could still be grown, I tend to write in a clear style which is far more suitable for a modern audience than Simon Heffer could achieve. I am more confident than before and this time was definitely a success.

Azure Services and Concepts

This is another notes dump. I’m working through a Pluralsight course called Microsoft Azure Fundamentals (AZ-900). These are some of my notes from doing this course.

Don’t Rely on this to Learn

I don’t recommend you read the notes. They might lure prospective future employers to my sight and I might look back and read them, but they’re not really there for people to learn from. However, Pluralsight is there for people to learn from. Because they’re not intended to be a source of learning they won’t be written to cater to learners. I will miss whole chunks of information, where I already knew that and I might drop whole sections if I feel it’s not relevant knowledge for my future career.

I tend to prefer to study things that aren’t bound to a specific technology or company, so I will avoid too much time being spent on this, so I can free up time to focus on other things. This is one of the major reasons for this Azure related gap in my knowledge. I would rather learn to make applications than use them and Azure provides a number of Microsoft-bound services. Also, since as I am a student, I am prone to misunderstanding and my notes might reflect a misunderstanding or out-of-date information.

Instead of reading this course pop over to Pluralsight for a small subscription fee, you can see the content of this spread out among a number of videos with multimedia. It will be quicker to learn from than this. For developers and sys-admins who tend to earn £20k+, they should be affordable at £24 per month and if someone is not a developer or a sys-admin, then this course is probably a bit beyond them at this stage.

AZ900 Content

This is about the specific products provided by Azure, which can be used in making a solution. Some things covered will be concepts like data centres, regions, ARM, Azure CLI, ARM Templates, Azure virtual network gateways, storage accounts, platform solutions like IoT, AI and big data solutions. This should cover the concepts portions of the AZ900 exam.

Sources for these notes

The majority of this is taken from Neil Morressy’s course on Pluralsight. This will reflect notes taken during a video so they might be a bit spacial. Grammar will go out the window, while I’m trying to keep up so good luck if you’re still reading. I’m also going to insert Vlad Catrinescu’s course content.

What is Cloud?

What is a Cloud? How does it help us? For a lot of people cloud just means online. The author Mr Catrinescu seems to suggest EVERY organisation out there is using Cloud computing… I don’t think this is true. I mean I tend to avoid absolutes like everything, but I know in my own limited company we use cloud and in my other employer, we provide a Cloud-based solution so there’s two that do use it. But some organisations like to avoid computers altogether, builders or wholesalers the odd company here or there. But I think any website is most likely going to be hosted on some sort of Cloud solution.

Once upon a time, we had dedicated servers for everything. Each networked application installed was often required to run on a dedicated server to ensure quality through dedicated processing power. Each one had its own CPU, RAM etc. Organisations were spending a ton of money on servers which mostly sat there unused. I mean not all applications are used all the time and yet they need dedicated server space.

We introduced virtual machines so something could have dedicated processing and more but on less architecture… there are still some more costs and there’s plenty of hardware requirements. This is more cost effective than before but there is space for improvement.

Cloud allows for a companies to pay for Saas without worrying about hardware maintenance, secure server rooms, and more. The cloud provider makes sure there are enough shared resources to provide the solution. The provisioning of new VMs and more is done for the user and provided in an almost instant manner. Services can be billed by their running time so you’re not paying for services when you’re not using them.

CAPEX and OPEX

Capex (capital expenditures) involve buying and setting things up which are going to be used for many years. Their costs can’t be deducted in the year it was spent some of it needs to be carried over into the future years.

Opex on the otherhand (operating expenditures) are deducted in the year they were used.

Why Use Cloud?

You can pay based on how many hours a virtual machine is up for you. You can set it to go up based on metrics for example if the cpu was at 70%. This is autoscale.

Cloud providers safeguard against loss or hardware failure. They can have services in other countries where they might not be affecgted by the same natural disaster for example. These provide redundancy.

Why Use Azure?

Azure is the most important cloud provider to use since it is the most used and it is used by 85% of the FTSE 500 companies.

X As A Service

We will be covering Iaas, Saas and Paas (Infrastructure as a service, Software aas and Platform aas). The main difference between these Services i the amount which is provided and who manages what.

With your typical On-premises servers you need to manage everything. With Iaas (Infrastructure as a Service) the hardware is set up by Microsoft or the Cloud provider while the software is entirely managed by the user.

With Paas the entire platform including things like the runtime, Operating system, any middleware, SQL server IIS are all managed by the provider and only the Application / Data is managed by the user.

Eventually we look at a Saas solution. This is where you are licensed access to a piece of software like Office365 where the management of the application is entirely provided by the supplier.

Catrinescu gives a good example of this using pizza. Check out his course on pluralsight.

I like to think of it as running a screening of a movie. Do it yourself, is where you hold the screening at home, and show the movie using your TV and DVD player etc. Infrastructure as a service is a bit like if you rent the room to run a screening but bring everything like the projector, DVD player and movie, Platform as a service is a bit like renting a room at the cinema, they provide nearly everything but you bring the movie. Finally, Software as a Service is like buying tickets for the cinema.

Deployment Models

Private and Public Cloud

There are two main strategies. Public Cloud and Private Cloud. If I were to guess on what Private Cloud means I would guess correctly, that in this circumstance the rented infrastructure is private to the organisation that commissioned it and not shared with other people.

With the other type the public cloud then some of the hardware can be shared between different cloud clients so the same hardware is being used by multiple people. This means you can save money especially while the application is remaining dormant.

Hybrid Cloud

A third-type enters the arena called the Hybrid which is essentially a mixture of the two with Orchestration and Automation between the two.

Community Cloud

The final type is essentially in my opinion a shared private cloud, it is called a “Community cloud”. This is where a cloud is used across an entire community of organisations, but not accessible to people outside of that community. This can be like a cloud used for government bodies, but not outside government bodies. Often when all the organisations on the cloud are from the same industry or community there are similar security concerns, data protection requirements and legal requirements which makes this really suitable to join resources.

Most Microsoft’s solutions are public cloud. Microsoft also has options for private and hybrid cloud solutions.

Azure stack connected scenarios – Hybrid
Azure stack disconnected scenarios – Private
Azure Government – Azure offerring specific to government bodies including FedRAMP, DOD, CJIS

Other Cloud Community offerings are Azure China and Azure Germany with specific requirements set to the needs to these particular countries. I assume Azure China is specific to China’s needs which require that the Azure be isolated from the world-wide internet and Germany has some Data Protection Laws that are very strict and specific.

Data Centres

Neil Morrissey in his course available on Pluralsight comments about Data Centres. A data centre is essentially a building which just hosts lots of infrastructure for providing cloud services. Naturally for security reasons they don’t publish the address of their datacentres.

Many of them include what’s called ITPACs which stands for IT PreAssembled Components. This is essentially a stack of servers and hardware with its own power supplies and coolant system. Microsoft also experimented with shipping containers of ITPACs so they could easily bring a whole one back online when one goes down but that model is being replaced now.

A datacentre generally complies with various security protocols such as FedRAMP, ISO 27001, HIPAA, SOC 1 and 2.

To enable separation, data is encrypted and kept separate from other customers. It is also stored 3 times over in each data centre for redundancy and you can also permit your data to be stored in multiple data centres for additional recovery.

These data centres consume a lot of power, but Microsoft is carbon neutral since 2012 and aims to be 100% renewable energy by 2025.

Data Regions

When you set up most services with Azure there is an option to choose where the data is stored. In the form of a “Location”. This is an area where there are a collection of Data Centres and this allows for you to choose a country and area of the country relatively close to your customers or in a place where specific laws operate. You can specify a region like UK South, Central United States, Japan West, Korea South, etc.

Some services are global and you don’t specify a region such as Azure Active Directory.

Not all azure services are available in all regions. If you want to see what is available where you can go to https://azure.microsoft.com/en-gb/global-infrastructure/services/ which will allow you to filter services offered by Azure and see what regions they are available in. Also certain VMs with certain levels of processing power might be restricted to certain regions or have different prices for different regions.

For example here I filtered for Genomics and found it’s not available in Canada for Central US regions.

Table from Microsoft website with ticks in columns where Microsoft Genomics is available. There are no ticks in the columns entitled Canada, Central US, North Central US or West Central US.

Any service where the “Non-regional” column is ticked are the ones where you are not required to pick a column as they are global services.

For more information on this, I recommend Neil Morrissey’s course on Pluralsight which is part of the Azure fundamentals AZ-900 path learning. This covers all basic concepts and information, which are relevant to Azure.

Azure Geography

This is an area that might include one or more regions. Often an entire Geography is subject to similar laws about data residency so they should mostly be entire countries where the law is the same.

Microsoft might copy data to other data regions other than the one you have selected for redundancy purposes but they would not copy it outside the Geography. This is particularly the case when you select something like Geo-redundant storage.

Region pairs

This pair is often two twinned regions, which are located over 300+ miles apart based in a single geography. They are so far apart because it allows for large redundancy against large scale issues for example Texas going without power a few months ago. If there was another data centre in a region just the other side of the state it too might be without power suffering in the strange snow-storm, which was probably caused by climate change. (Side note: Climate change is real yo! Companies didn’t want their climate damaging effects challenged, so it was cheaper to brainwash most of the US and whole pockets of the internet than actually investing in renewable energy so they released a ton of false propaganda to suggest Climate Change wasn’t real. It was real ask any scientist who works in the field and isn’t on an Oil company’s payroll).

When you select “Geo-redundant” storage then Microsoft automatically copies your data across to the other region in the Region Pair. When a disaster affects both Regions in a region pair one of the two pairs is prioritised.

Availability Zones

An availability zone is within a single Azure Region and may contain multiple data centres. Some regions just contain one data centre, but some contain 3 or more availability zones. You can organise zone redundant storage to replicate your data across different data centres in the region, but that data won’t be replicated across multiple Azure Regions, it will just remain in one Azure Region within one Azure Geography.

This is all explained thoroughly in Neil Morrissey’s course on Microsoft Azure’s Services and Concepts available via PluralSight. This April I think Pluralsight is doing an offer for them. I am not paid to recommend them, I’m just finding the courses available really useful and trying to step up my knowledge speedily and consistently with what’s required for my job.

Resource Groups

Information to follow.

Adding Azure App Insights logging to Durable Functions

Firstly, when I approached this my question was “what are durable functions”? That question is best answered by beginning with what are Azure Functions. I need to prefix this with I am not someone who is in the know. I am making these notes as I learn things and I am no expert. It is likely this will contain information that is outdated or just plain wrong. Also I don’t plan to keep it up-to-date, this is simply a dumping ground for my notes.

Azure functions are a part of Microsoft’s solution to the serverless programming paradigm through Functions as a Service (Faas). This is coding for a solution without any concern for infrastructure. You write your code and azure automatically creates a box for it to run in and uses your code to achieve the desired response / action.

Your code can be triggered in a number of ways including a timer event such as running once an hour. It can run if there are messages on a queue waiting to be processed and run for each queued item. It can also run as a result of a http request.

The result of the design of this process is that the function is stateless. No matter what happens the function would always run the same, it never remembers anything between the times that it runs and never gets into a new state where it would run any different from how it would run otherwise.

Also Azure Functions runs on a consumption-based pricing model, which means you are only charged when you’re using it. Because there’s no infrastructure you do need to pay for it. Until such a time as the function needs to run there’s no server required to sit and wait for incoming requests. Then when you receive a request Microsoft ups a container, which is probably based on a VM on one of their machines that you’re totally unaware of. The implementation details of the infrastructure is totally handle by Microsoft so you don’t experience the server and instead only pay when you need to run briefly on one. An advantage of this is that when you need lots of infrastructure because for example there are loads of messages on the queue right now, the host can up lots of infrastructure and scale to meet your needs without you needing to pay for infrastructure that might not be used again for a while.

Often an Azure functions has a binding which can easily link its output to a SendGrid, CosmosDB / blobstorage which allows for many different outputs.

So that’s Azure Functions. But what I might make a function “Durable”? Well is an extension to Azure Functions which results from trying to solve a number of limitations in the serverless paradigm.

When running the Serveless paradigm is limited due to its stateless nature. Durable functions provides a means to handle state. In order for state to be achievable in Azure functions without this extension you would need to rely on some kind of storage like blobs or databases.

Also Azure functions has difficulty handling what’s called fan out and fan in workflows where one function can execute many function and then another continues when all those functions have finished. Fan out is a description of the workflow diagram that results.

Also Azure functions have difficulty trying to handle errors when they could occur anywhere in the workflow. Without using this extension for a function to call another function, it would normally rely on message queues or http requests to trigger the additional functions. In order to handle errors a system needs to be written to allow the error to propagate such as passing back the error state to the http caller or processing a poison queue.

With durable function you can write a function, which calls other functions and waits for a response. This is known as an Orchestrator function and it calls “action functions”. The Orchestrator can then sleep while waiting for activity functions to complete. Activity functions can receive and return data. The Orchestrator function is only the workflow and does not perform any actions. So Durable functions allows you to write better workflows isolated from other code.

In order to start an Orchestrator Function running you need to write a OrchestrationClient binding which allows you to start a orchestrator running from a normal azure function or get information about an orchestration. So for example imagine you have items on a queue. A normal Azure function is bound to the queue and triggers when each item is on the queue. It then uses the OrchestratorClient binding to call an Orchestrator function which defines a workflow. As it flows through the work flow it triggers a number of action functions. Each time a function is run various App Insights records are made recording success and metrics to enable better diagnosis of issues, analysis of processing needs and costs and better feedback.

Durable functions also allows for waiting for human interaction before continuing.

Under the hood

Durable functions uses Azure Storage to implement its workflows. It will therefore need a connection string to do so. It uses Message Queues to trigger other action functions, storage tables to store the state of current orchestrations and in a format called event sourcing. Event sourcing requires that everything is stored by appending new records rather than overwriting previous records which allows for better diagnosis of issues. When an orchestrator wakes up it can then play through this list to see what parts of the work flow have completed.

Creating a Function App

Luckily Visual Studio, when you enable the workload for azure development in the VS installer, has the boiler plate for a typical function app. A function app is a container for multiple functions. You can easily deploy each function into a separate function app, but sometimes you might benefit from group similar or related functions together. In the case of durable functions where they are involved in the same workload it is likely to become useful, due to the common deployment process.

Included in the boiler plate is a proj file which declare the AzureFunctionsVersion, includes a reference to the Azure Functions SDK. Also included are some settings file such as the host.json which explains which version of Azure functions is used and what logging is done. There is also a properties folder with some server dependencies for deployment and a local version.

The boiler plate includes a sample function according to whatever you requested. So for example a Http Request based function has one of those.

You can add more functions by right clicking on the project, clicking Add and clicking New Azure Function. You will need one for the Orchestrator function.

Before you can add any durable azure function’s stuff we will need the Nuget package Microsoft.Azure.WebJobs.Extensions.DurableTask and a using directive

using Microsoft.Azure.WebJobs.Extensions.DurableTask;

Then you just add the IDurableOrchestrationClient interface as a parameter. The SDK should inject the orchestration client you need.

public static class FunctionCallsOrchestration
    {
        [FunctionName("FunctionCallsOrchestration")]
        public static async Task<IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Function, "get")]
            HttpRequest req,
            [DurableClient] IDurableOrchestrationClient orchClient,
            ILogger log
        )
        {
            throw new NotImplementedException();
        }
    }

First things first you will need to extract from the Http Request whatever data you intend to send to the function. I am not going to explain how to do that because it could be stored in any number of ways and getting data from a http Request is a different issue to working with Azure Functions, but I will include this boiler plate code for anyone that might benefit from it. It gets the string from the Http requests body, assumes that is a json encoded data object and creates the variable data based on it.

string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
            dynamic data = JsonConvert.DeserializeObject(requestBody);

Once you have your data then you can use the Orchestration Client that you injected as parameter to create a new orchestration function. If you remember you will know that this is the function that handles the work flow of your Durable Azure Function. It doesn’t do any of the actions itself it just figures out where we are in the process and orchestrates other functions to do the work, known as Action Functions. You need to pick a name which we will use when we are creating the Orchestrator for the name of the Orchestrator here, I have chosen O_RepondToName. As far as I can tell there seems to be a standard of prefixing Orchestrator Functions with “O_” and Action functions with “A_” particularly where coders are likely to have the same or similar names for each.

var orchesrtrationId = await orchClient.StartNewAsync(Orchestrators.RespondToNameConst, Guid.NewGuid().ToString(), name);

Finally it is helpful to respond with the means to get progress on the running of this orchestration. Note this uses the orchestrationId generated when the orchestration function was called and the Http Request message that was received to generate a response.

return orchClient.CreateCheckStatusResponse(req, orchesrtrationId);

Okay so that should compile, but it is not complete. When it attempts to run the function it will not find a function with the name O_RespondToName. So we need to create the Orchestrator function.

You can just create a basic static class to provide this. You can also create a static method to outline the Orchestration. It needs to have the attribute FunctionName with the name of the Orchestration function you chose earlier in this case “O_RespondToName”.

using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.DurableTask;
using Microsoft.Extensions.Logging;
using System;
using System.Threading.Tasks;

namespace FunctionApp1
{
    public static class Orchestrators
    {
        [FunctionName("O_RespondToName")]
        public static async Task<string> RespondToName(
            [OrchestrationTrigger] IDurableOrchestrationContext orchContext,
            ILogger log)
        {

            throw new NotImplementedException();
        }
    }
}

You will notice I included a couple of parameters. The most significant of which is the IDurableOrchestrationContext which we will be using. By prefixing it with the attribute OrchestrationTrigger this informs the compiler that this is an Orchestration function.

Obviously when we received the Http Request we removed a piece of data from it and passed it to the Orchestrator. We can do this with Queues as well. We passed the data to the Orchestrator when we called it so we might want to grab that data back now. We can do that with the GetInput function on the context.

var input = orchContext.GetInput<string>();

This doesn’t have to be a string.

Now for my first Activity I have chosen to call a function called “A_GetFullName”. Again I’m using the convention of beginning the Action Function names with A_ and prefixing O_ to the beginning of Orchestrator Function names. You will note that I specify the type of data that is returned, in this case a string. And once again we are calling a function that has not yet been created but we will do that next. I like to replace these function names with consts after they’re made to help link up the reference for anyone who is reading your code later.

var firstActionOutput = await orchContext.CallActivityAsync<string>("A_GetFullName", input);

Something to be aware of, here is that the await keyword works a little bit differently from how you might expect. In Durable functions this Orchestrator will queue up the Activity function to run using its connection to Azure storage (or in a dev environment azure storage emulator) and then it will record where it got to and stop running the Orchestrator so you’re not paying for functions running. The next time it runs the function it will run from the beginning to, but reaching lines like this, it will be able to determine from its records whether that Action Function has completed running and will be able to keep going through until it reaches a point where it has to wait for Action function to complete or it can return data.

Same process for second action…

var secondActionOutput = await orchContext.CallActivityAsync<string>("A_Greet", firstActionOutput);

Finally I am going to return something so I can get the data using the Durable Functions REST API later.

You can return the data you generated or just a string whatever you need.

return new
            {
                a = firstActionOutput,
                b = secondActionOutput
            };
// or
return secondActionOutput;

Now just like we did before we have an Activity or Action Function which is not yet defined and we need to define it. We can do so through the same process we did before however the parameters are slightly different. The OrchestrationTrigger is replaced with the ActivityTrigger which is not an Orchestration context but instead whatever the argument is that we had intended to pass into this function.

Here is a sample. I removed any references to my own servers and api keys replacing with just “google.com/api”. You will notice I have deliberately made distinct paths through the function where some do not rely on external servers so I can make sure that the function is working, even if the dependency is not available. This is simply for test purposed when setting up.

using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.DurableTask;
using Microsoft.Extensions.Logging;
using System.Net.Http;
using System.Threading.Tasks;

namespace FunctionApp1
{
    public static class Activities
    {
        [FunctionName("A_GetFullName")]
        public static async Task<string> GetFullName(
            [ActivityTrigger] string input,
            ILogger logger)
        {
            if (input == "Grey" || input == "Gray")
            {
                return "Graeme Chetcuti";
            }

            if (input == "John" || input == "Jonny")
            {
                return "Agent John Smith";
            }

            if (input == "neo")
            {
                return "Mr Anderson";
            }

            //Won't work don't want to reveal my details
            //Also not example of good code
            var httpClient = new HttpClient();
            var result = await httpClient.GetAsync($"google.com/api/GetfulName?name={input}");
            var data = JsonConvert.DeserializeObject<FullName>(await result.Content.ReadAsStringAsync());
            return data.fullName;
        }

        [FunctionName("A_Greet")]
        public static async Task<string> Greet(
        [ActivityTrigger] string input,
        ILogger logger)
        {
            if (input == "Graeme Chetcuti")
                return "Hello Dolores Day";

            if (input.Contains("Anderson"))
            {
                return "Take the blue pill Neo!";
            }

            if (input.Contains("Agent"))
            {
                return "Goodbye Smith";
            }

            //Won't work. Don't want to reveal any of my details.
            var httpClient = new HttpClient();
            var result = await httpClient.GetAsync($"google.com/api/GetGreeting?name={input}");
            var data = JsonConvert.DeserializeObject<FullName>(await result.Content.ReadAsStringAsync());
            return data.greeting;
        }
    }
}

So that gives us our basic Durable function. Next we need to add application insights loggin.

Adding Distributed Tracing to Durable Azure Functions Logging

Okay so one of the issues with logging these is that, as we said before the function is called a number of times. Each time the Orchestrator function is called it could end up logging a different piece of data in application insights which does not give us any continuity with regards to exceptions and how the function arrived at certain points. By adding the following code to the host.json file the logging becomes correlated with other log messages arising from the running of the same Orchestration.

  "extensions": {
    "durableTask": {
      "tracing": {
        "DistributedTracingProtocol": "W3CTraceContext"
      }
    }
  },
  "logging": {
    "applicationInsights": {
      "httpAutoCollectionOptions": {
        "enableW3CDistributedTracing": true
      } 
    }
  },

When an error occurs, this allows you to see where in the running of Orchestrations it was. This is often called distributed tracing.

Check Status Object

When we originally wrote the return statement of the function we returned a Check Status Object which does more than just check status.

When this function is called is immediately starts the Orchestration Function and returns a few URI. These include a URI for checking the status and ultimately getting the data that has resulted from the completed running of the function. Another which is for adding more information for example when a user has responded to question and the last one is to terminate a long running orchestration which is no longer needed.

All you need to do is create an object which is ready to receive this response and then use the URIs when required.

Code

I have included my code on git hub.

https://github.com/gchetcuti/experimenting-with-azure-functions

Primitive Obsession

I just learned this expression… I was complaining about the code using only basic datatypes and my boss agreed that it looked like “primitive obsession”. My reaction: What??? there’s a term for that???

A lot of the time I recognise a pattern in coding that works and I see issues with other patterns and I quickly develop rules in my head for good code. Sadly these rules do not necessarily exist in other people’s heads. One of the things I struggle with is my general assumption that everyone sees the same things I do and experiences them as I do. They don’t, I am really weird and often I need to remind myself of that.

Not speaking the lingo

A lot of the time when I try to explain the rules in my head to someone they say “that’s not a thing”. But it is obvious to me… then you end up disagreeing with someone. Here be monsters. The problem here is someone just told me I’m wrong. I can see the logic in what I am saying and when they don’t agree. Then, my brain assumes they just can’t see the logic I see, so I will show them. Then they hear me something that sound a lot like “No! You’re wrong”. Suddenly two people will fight to prove they are right even if they realise they were wrong all along.

Alternatively, when you know the special name for something, i.e “Primitive Obsession”, you just need to flash it, like it’s a detective badge or a VIP access all areas. Other devs suddenly recognise what I am talking about or otherwise look it up with a reputable source and walk away impressed.

The frustrating part is just because I might not know the special jargon name for it… it was still “a thing”. I just invented it. Just like the guy who invented it and established the name. The logic was sound, it just needed to be spoken by Martin Fowler and not me.

I guess I am trying to find a way to cultivate the understanding of logic and the ability to express it in a way that other people can understand. Sadly the only person who seemed to really communicate things well to me was the architect in an old company who couldn’t afford to pay me average wage.

Today, I learned about primitive obsession. This is where a developer sticks to the primitives of a programming language. Primitives are the basic building blocks of data within the language. For a language like C, these would be char, int, float… hopefully you get the picture. With regards to programming languages like C#, I think strings are also considered primitives too.

One of the great things about primitives is that everyone who uses the language knows how they work. They don’t need to do any reading. A string is a string and anyone who has used C# will know what a string is, unless they were doing something VERY niche in it.

Alternatively when you only use primitives then there’s a few things which I have spotted can go wrong.

A String is a String

Let’s imagine one of my most irritating issues… accidently swapping one parameter for another. Imagine you write a method and all its parameters are strings (I was dealing with one these recently). Now what if you wanted to rearrange the order of the parameters… well in places where the method was called you wouldn’t get an error message because it’s thinking login(string, string) not login(user, password). What if someone accidently wrote login(password, user) … the system does not complain.

Complex datatypes mashed together

Often a complicated datatype containing all sorts of data ends up mashed together in a string. A perfect example of this is a URI. A uri consists of a scheme (expressed as https://), a domain (such as google.com), sometimes a routing structure or directory struction (/search) and sometimes a query string (?source=hp&q=hello). The query string could also be broken down into multiple parameters such as source and q which have values hp and hello. Now imagine you want to figure out what one of those is. You need to work through massive string manipulation techniques to figure it out. For example finding the value of q in the querystring. You need to jump to the string which is after the ? then it is preceded by a ‘q=’ that either immediately follows the question mark or immediately follows an ampersand after the question mark and it ends with either the end of the string or the next ampersand. It’s starting to sound complicated because it unnecessarily is. Compare this code:

Query.Parse(uri.Query)['q']  

It would be even greater if the query string wasn’t a bloody primitive either then it would just be

uri.Query['q']

And this is all on the assumption the string is correctly formatted as a Uri in the first place. That’s another matter.

Validation

Now imagine that you spend the beginning of every method that received a password and a username as a string checking for validation. Is the password field Hashed correctly? Does it have the right check digit? Is it blank? Does the user name have an email format with an @ and a domain like it is supposed to? Well with a basic data transfer object (or a POCO class) you can leave validation to the creation of the class and just assume it is valid from then on.

Passed by reference

When you pass a method a primitive in its arguments, in most high-level languages you pass the actual data. However with complicated objects that might contain multiple pieces of data in most high level languages you pass a reference to a object. It is always possible that this data could be updated in the process and something could change. The code which is executing will always be working with the latest version of the data. But with primitives, it will be working with whatever the value was when it was passed the data.

Conclusion

So there’s a number of issues caused by using primitives for everything. Please don’t be afraid of a POCO (plain old clr object) class. A POCO class or a DTO class (data transfer object).

These classes mostly consist of a collection of primitives so you’re not far from it. They don’t have much logic in them, maybe a little validation, but they’re pretty simple and they make sure the data you’re using doesn’t get sent as the wrong argument, help keep things valid, give you simpler access to a complicated data structure. They allow you to pass things by reference which are dynamically updated when things happen in other threads. Don’t do it for the word though… do it because you see the logic.

Equivalent of a Computer Science Degree

Okay so I make no attempt to hide that I have no Computer Science degree. I am actually Law LL.B graduate. But why should a company hire me as their next developer when they have potential opportunities to hire someone who studied it at university? Well if this is the only criteria they can compare on then they shouldn’t. Hopefully my years of experience as a developer where I regularly push myself to learn new technology should really be what stands me in good stead, but often that is hard to prove.

Also how do I know I am not lacking something without a Computer Science degree? Let’s imagine I didn’t know data encryption. Chances are: I might also not know that data encryption existed and I would not know that I didn’t know it. I’ll wait while you re-read that… any more “know”s and it would be a tongue twister.

Well how can I really justify my own existence in a Computer Science role without really earning. I am flattered to have the role, but frankly to be earning above average in the UK I need to be above average. Not having a the information of the degree that is relevant to my employment doesn’t really put me above average.

Having spoken to people who study for our best universities for computer science I have managed to pull together a large syllabus which represents a full Computer Science degree. Unfortunately it is boring as hell. Too basic … but I hope a few courses down the line it will be a little bit better. For the most part I am looking at major courses and trying to find online courses particularly those on MIT and Coursera that match the sort of information I would have if I had done a CS degree.

As much as I find the courses boring I do come across some interesting information. Like for example, I use the term abstraction a lot to talk about removing the user from the implementation detail that they don’t need to know. However I wasn’t aware that the term to be stretched as far as text being an abstraction of the binary storage that is occurring in the RAM of the computer.

I had also heard that the term debugging had originated in the effect of a bug in a machine but I was not aware of Grace Hopper or that she had found a moth impeding a relay from functioning. So there was more information to be had there.

Assembly Language

So if you couldn’t tell I’m actually a computer programmer by day. By night I’m a bit of a drag mother, who loves board games, mysticism, mystic artistic expression and to engage in philosophical and religious study. (Yes I am all over the place.) But … computer programmer.

When program computers, I often find that I work with high-level languages which do a lot of stuff for me. A perfect example of this is memory management and garbage collection. So often I don’t have a good idea of what the high-level language is doing for me.

Having spoken to friends who teach computer science at some of the best universities in the world, I have found one thing to be quite consistent. They like to take a bottom up approach. They go from electronics and switches to device style programming to high-level languages. I am trying to fill a hole in me that is left by the insecurity of not having the best degree for Computer Science, Law. Law enables me to engage with the customer and fully coordinate a meeting and make sure what we deliver meets exactly what the customer said they wanted, but I am often coding without a CS degree and that’s a bit like building a house on sand at times.

I hope to fill that gap with a number of different small projects like programming arduino projects, metal coding and assembling coding. Doing an Udemy course on programming for the Atari seemed a great place to start. I also have an actual Sega Mega Drive and a course from pluralsite on the memory registers of that so I should be able to take what I learn and apply it to the mega drive… but here goes.

This is the course I am working through:

https://www.udemy.com/course/programming-games-for-the-atari-2600/

Spec

When coding in assembly language, you’re writing specifically for the hardware you have so you need to be aware of the processor you have and all the other hardware and how it can be referenced from the motherboard. This becomes a crucial part of programming in assembly.

One of the crucial parts of programming is knowing the CPU which in the case of the Atari was the MOS 6507 (a cheaper version of the MOS 6502), which had 1.19 MHz. In the Sega Mega Drive it was the Motorola 6800 after the price had come down a bit.

Atari also had the Television Interface Adapter chip (TIA). This allowed for interaction with a cathode ray tube television in place of monitor used for modern computers.

The Atari had 128 bytes of RAM in the 6532 RIOT chip (RIOT = RAM input output and timer)

The Atari is used with a Cartridge being plugged directly into the motherboard which is a ROM of 4kb.

There are different versions of the Atari, but the Udemy course is focused on the “heavy sixer” which is version of the machine which was released in 1977 which has 4 switches on the console.

CPU

The CPU has a pin to indicate it is ready for an action it receives an incoming current and it is often indicated with RDY on diagrams.

There is also an interruption request pin indicated IRQ. In using the cheaper 6507 CPU there is not IRQ pin because it is not needed. To make the 6507 cheaper than the 6502 the interruption request was removed, NMI was removed and the address bus was slight more limited in size.

Registers. These are memory inside the CPU for current. We often refer to the Atari 2600 as an 8 bit machine because it can store 8-bit values in each register (1byte).

The data bus is 8 pins (or more in a 16/32/64-bit machine) is designed to put data in and out of registers.

The address bus is 16 pins sticking out of the CPU which indicate a memory location where something might be stored in ROM or RAM etc.

There are 2 chips for tv interaction (TIA), one is for NTSC TVs and the other for PAL TVs.

Additional pins tell us whether we are reading or writing to the CPU, some are for timers, resets, power and grounding. There is also the request bus ready state pin, don’t ask me yet what this does!

The CPU we are using has 1.19 million ticks per second.

Inside the CPU we are using here is 7 special areas. The pins can be used for input an output into the various areas. Those areas are the ALU and 6 addressable registers. A register is like a very fast access memory for a CPU.

ALU

The first part is the Arithmetic Logic Unit (or ALU). This is capable of a number of very simple addition, subtraction and binary operations. For multiplication and division it might have to do multiple operations.

PC

The register marked as PC is the “Program Counter”. I think this part of the CPU indicates where the program is going to go next. It might indicate what line of code to run next for example. I am not sure about a lot of this information so don’t learn from me go to Learn Assembly Language by Making Games for the Atari available on Udemy. It’s a cheap fun course with all the information you will need and it will be organised in a more sensible order for learning.

This contains memory addresses so in our 6507 processor this is 16 bits long.

SP

The next part is known as the “Stack Pointer”. When using the stack in memory we have a pointer to indicate where the latest value in memory is. Let’s imagine you’re adding to memory like pushing to an array in JavaScript, the SP will always point to the latest value and if you pop values off the stack it will retreat to previous values.

This contains memory addresses so in our 6507 processor this is 16 bits long, but the last 8 digits are always “00000001…”.

P

This next one is the Program flags. Instead of being a binary sorted number, this is a series of binary flags which can be switched on and off to indicate anything that happened in the last calculation run by the CPU. This could have a flag on to indicate that it failed in the previous calculation for example overflow where the calculated value was too big to be represented in the binary values available.

This could include whether the result was negative or zero. This contains 8 flags so is 1 byte in size.

The right most bit is called the “Carry Flag”. It determines whether during an addition it was required to carry a flag over to the next binary number, but could not do so because there are only 8 bits the carry flag is switched to 1. For example if you take the maximum number and added one then it would carry that 1 over when it completes the number and it would be too big to save.

The second to right flag is the “zero” flag. (XXXXXXX1X where X is a number that relates to a different flag) this would indicate that the result of the previous calculation was zero.

The third to right flag is used for IRQ disabled. Since this part of the process is not used it’s not relevant to this. (XXXXX1XX).

The forth flag is BCD (binary coded decimal). This is an accurate form of calculation, but it is slow so it is not always used. It indicates whether we were using BCD mode or not.

The fifth flag from the right is the break, which indicates a break signal caused the processor to interrupt what it was doing. (XXX1XXXX). Warning this might not be correct. Learn from the course; not from me!

The 6th flat form the right is unused by the processor just ignore that value.

The 7th flag from the right indicates that an overflow occurred and the value was unable to store the result of the arithmetic operation. It can be represented by a V. An example of this is when adding to a number written in two’s complement (where the 8th digit is negative) is the positive numbers are carried over to the next column and it’s a negative number. For example 0000 0001 + 0111 1111 = 1000 0000 which means 1 + 127 = -128 so this flag is activated to note that answer might not be quite right.

Finally the 8th flag (N) indicates whether the result was a negative number. (1XXXXXXX)

X,Y and A

The X and Y registers are general-purpose registers, which we can use for storing the data that we are working with. The A register is the accumulator, which is used by the ALU for doing work on the data. When the ALU performs a calculation one of the values comes from the accumulator.

These registers are all 8 bits in the 6502 / 6507 processor.

Binary

Obviously an important part of programming for electronics is understanding how a wire essentially can have a current or not and that is its state of 0 or 1, but you also need to understand how this can be abstracted as a number.

I already knew this from my A-level and GCSE Computing. But a quick review of it was useful.

SRE

What is SRE?

These are just my notes about Systems Reliability Engineering. This is something I have chosen to study as part of my work for a company called BankBI. By all means read it if you will, but I’m not really writing for readability. This is just a notes-drop from various courses.

SRE is often described as “what happens when devs design operations”. It’s hard to say for definite, that it is one thing or another because different aspects of SRE appeal to different authors.

Often there is a lot of focus on delivering feature after feature, while assuming that once a system is up then it is going to stay that way. When has that ever happened? SRE is concerned with recognising and planning for failure. SRE involves among other things, setting goals for the reliability of a system and making sure that when the system falls short of a goal, the team focuses on reaching the goals of reliability rather than new features. Obviously there’s more to it than that, but it’s one of the key things that comes up early in many definitions.

SRE sits along side DevOps. Some people like to conflate the two, but they have distinct aims. Nearly every author is against comparing them like they are opposites and only one can be implemented. In a nutshell, DevOps gets the Sys Admins and Developers to work together and SRE gets Support team / Operations and Developers to work together. It would tend to suggest us Devs aren’t good at working with anybody since there’s all these grand initiatives in place to get us to work well with people!

SRE is a child of Google’s inner workings. For years Google kept it to themselves and then suddenly they went public.

The Problem

One way that we can define SRE is to consider the problem that we are trying to solve. We can define SRE as “a collection of principles, ideals and ideas which are brought in to solve a divide between Ops and Development”.

Why would there ever be a divide in a company? Well in this case it come because these two teams while seeming to work very closely together actually have very different difficulties and problems that they face. They face customers having very different experiences so they end up seeing customers with very different desires.

The developers will traditionally hear about the latest features wanted by customers and potential new customers. By always considering the desires for new features they will reasonably assume that customers always want new features. Their focus will be to deliver new features as fast as possible to help make the customers and to help the sales team to onboard new customers who want different features.

Operations (or Ops) are managing the system on an ongoing basis. They can see how many computing resources are required and they are often the first point of call went something goes wrong. They are often face-to-face with customers who are experiencing bugs or instability. They will likely assume that customers want stability and no bugs.

As you can see these two teams often have an very different idea of what the customer wants and SRE is the solution to prevent the potential warfare between these two factions.

In SRE you set a target for reliability and stability. When the system falls short of that target then development’s priority changes from delivering new features to dealing with stability. With DevOps the development team and the Ops team begin to overlap more.

Core Tenets of SRE

This highest priority of any SRE team or agent is the following things:

  1. Availability
  2. Latency
  3. Performance
  4. Efficiency
  5. Change Management
  6. Monitoring
  7. Emergency Response
  8. Capacity Planning

Toil

While this is not a definition of SRE it is a concept that comes up in a few of the definitions. Toil is hard work. It often refers specifically to repetitive tasks which do not require much brain to do. In SRE these tasks are usually automated to save time. Remember if it takes longer to automate it then to do it a few times you need to think about whether it is worth automating. In an environment that is always changing it might not be worth it because that might only be done a few more times.

Couch to 5k

I didn’t really want to post about this until it was showing some signs of success. But I began to work through Zombie Run 5k. I found it hard, to say the least. I began to cause knee injury and cause some muscular issues. But that’s not stopping me. I have given myself space to recover, while maintaining a regular brisk walk daily for 30 minutes and I am about to get back into the saddle. It’s been going on and off for months now. But having only done walking for a couple of weeks I am ready to go back to running again. However in doing so, I must recognise that my body is very unfit, I have high blood pressure and I need to take the course at a slower speed than most people because I need to achieve more changes in my body than most people do.

My plan at the moment is to practice my vocal exercises everyday then either walk briskly for 30 or do a zombie 5k exercise for 30-50mins (alternating days). I need to wait until I can do the full week and extra exercises before moving on to the next week. Then I get back in I can rest for a bit and on the days when I am doing the harder exercise, I will need to work through a series of exercises from Fujian White Crane School’s Kungfu system.

Including:

  1. 10 push ups
  2. 10 sit ups
  3. 10 squats (carefully to avoid knee damage)
  4. 1000 punches (batches of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1)
  5. 20 leg lifts to stretch leg flexibility
  6. 20 leg lifts to opposite side
  7. 20 leg lifts to side (with blade of foot)
  8. 20 leg lifts to side (with toes pointed up)
  9. 20 upper crane block
  10. 20 lower crane block
  11. 20 twin upper crane block
  12. 20 twin lower crane block
  13. 20 front, back, side thrusting kick
  14. 20 triple upper crane block
  15. 20 triple lower crane block
  16. 20 low, medium, high round house kick
  17. 20 upper, lower, upper crane block with supporting hand
  18. 20 lower, upper, lower crane block with supporting hand
  19. 10 Double Mad crane kick
  20. 10 Uppercut
  21. 10 Back hammer fist
  22. Shuffle forward, Twin punch, Twin palm strike, shuffle back, washing machine, grab, downside
  23. Tiger swipe
  24. Tiger strike
  25. 1st pattern

Following some minor injuries, I had to take a break from this, but I am walking every day and soon as I am off some antibiotics (today is my last day), I will begin practising running again, but I will stay at “week 2” till the end of January and “week 3” through most of February before proceeding because I could not go straight to the week 4 exercises without severe cardiovascular issues, regular muscular injury and inflamed tendons, last time. Taking it slow, but always progressing is the key to success in exercise. When I am confident with the exercise and it is getting easier, I will re-introduce the kung fu. I am also applying for an early trial of Alter Titan a similar app which turns exercise into a video game!


Okay I’m really listening to my body and trying to do week 1 nice and slowly for a few weeks which has taken me into February. I really hope I can catch up and complete this before Alter Titan is released. I want to complete it

Singing Course

So anyone that knows me. I sing… a lot. But my singing is mostly average. I find I often get moisture in the lungs, probably from being overweight and the impact this has on the heart. So I have to deal with a few issues. I hope to use this article to record my work as I go and keep me aware of whatever the last thing I was doing when I come back to the course. I find blogging helps me keep focused somehow and I like to be open with people about myself so I might as well publish the results.

Why? What’s the Application?

For the most part I just love singing and I love self-improvement, so why not? But other than the odd bit of karaoke, why might I seek out a course like this? Anyone who has seen me in drag, knows I work singing into my entertainment so there is an immediate use of this course! My voice is pretty good for a voice that isn’t coached, but it really isn’t at its full potential. Luckily for drag you don’t need to have voice that is a dead ringer for Shirley Bassey. So it has worked a little bit, but no-one wants to hear someone who is shit.

My voice does need a lot of work. For a long time I have wanted to pay for vocal coaching, but I decided before I fork out a lot of money I would try and see what I can do with a reasonably cheap course first.

What Course?

I picked a rock singing course from Udemy because I am particularly interested in techniques such a vocal fry and shouts that are more common place in rock singing. Sadly so far the course doesn’t seem that great, but it at least gives me something to work on and investigate each time and comes with exercises so I will try to withhold judgement until the end, but for now I will not mention the name of the course.

Regular Practice

Once again this is another exercise that needs to be practised a lot. In fact the course has a section called train like an athlete. So I guess this would precede my training for 5k which in turn precedes any kungfu training.

Voice Range

I find it hard to identify my “Fach” or vocal range. There are 25 different fachs to compare to and I don’t know them all. Very often my range, which I estimate to be around G3-E6 undeveloped, allows me to cover quite a few of them including: Bass (using low techniques), Baritone (using low technique), Tenor (easy), and Soprano (using resonance). I can also hit most of contralto and contratenor, but the practice pushes me into head voice. Tenor seems to be the most comfortable for me.

Stretch the Voice

Techniques for lower voice. Working with your growl, fry and subharmonic register, according to this video. Having practiced these techniques I think I need to practise them regularly to smooth it out.

To go higher and still sing with power you need to use a belting technique. Often this can be achieved by using a resonance chamber behind the nose. Unfortunately the Youtube artist, Felicia Ricci has removed most of her videos from when she was teaching belting, but I was able to find this one below where she talks about using the resonance chamber.

When I was going through her videos there was one where she helped people find the voice by saying “Nya” in a whiney child voice. (If you listen and emulate the sound from this video of the most annoying sound in the world. Then you will feel where this sound occurs.) This sound causes a vibration behind the nose. If you then try to combine this with a voice that vibrates in the chest to get rid of the nasal quality then you can use it for loud and high pitched piercing notes.

https://youtu.be/z7vWs8nrg0s

Mixed Voice

The interesting part of doing singing courses is that you really need to learn the human anatomy that is involved so you can train each muscle in isolation to allow for better singing and use all the chambers inside the body to create a resonant sound.

What is a resonant sound?

In physics resonance is where identical waves begin to overlap creating a more powerful wave. For example bridges have a natural frequency they vibrate at. That vibration is a bit like a really fast swing moving backwards and forwards. Now if you always push a swing as it moves away from you, you get a greater and greater swing movement. In some cases with bridges the wind has had that affect of pushing the vibration in a similar way and just increasing the vibration over and over.

A similar affect is created when a glass which vibrates as a natural frequency has someone sing the frequency at it which increases the glasses vibration until it vibrates so much that it can no longer hold itself together.

In singing there are different sounds created by causing resonance to occur within different air chambers within the body. Chest voice is the sound of singing when resonance occurs within the chest. Head voice uses the huge nasal cavity to create resonance. Now these different places have a different range of notes they an produce known as a vocal register. I used to think falsetto was the same thing as head voice but it is actually more open and airy with less vocal chord vibration as a result. This is a vocal mode rather than a register because it is about which parts are used rather than the range achieved (other modes include vocal fry and whistle).

With a good amount of effort you can blend these different registers together so that you can move from one voice to another seamlessly to create a single overall range. To help this process it is often worth working on the mixed voice which is the point where you are using both nasal resonance and chest resonance at the same time. This allows for an easier cross over between different registers.

One of the major issues I am hitting is that for years I have always had a lot of mucus around larynx. I will need to see if regular irrigation of the ENT passages helps.

30th Jan – more to come

Human Computers

I have always been fascinated by the novel and the universe of Dune by Frank Herbert. One of the concepts in his novel is that a long time ago AI rose up, enslaved mankind and mankind freed himself. So it is based in a time where computers are banned. Interestingly enough human computers exist called “Mentats”. These are people expertly trained to do calculations.

In my studying I was surprised in the “Imposters’ Handbook” written by Rob Conery that this already existed. People with huge books of mathematical tables designed to do loads of calculations were called computers before actual computers were built… Now that I realise at the time of writing computers were relatively new so people must have already been very aware of this concept. Perhaps he was motivated by the lack of requirements on people once the computer was added. People were no longer required to learn to participate in large computations. Like today no-one is required to remember a telephone number.

So human computers is not a new concept … interesting.

Reading Dune Prequels in Spanish

So I learned some Spanish when I was young. I used to be quite good at it, thanks to Michelle Thomas Spanish and the odd bit of practice with my Grampa who retired to Spain. I would like to chuck out all my old learn Spanish books and to do that I want to officially say “I speak, understand, read and write Spanish as well as I could ever want to”. I think that if I could say I have a 10,000 word vocabulary and I have read a few novels in Spanish then that would do and would help me clear out some of my old books, CDs and cassette tapes (yes I’ve had some books for learning languages since when Cassette tapes were still a thing).

With a new version of my favourite sci-fi novel Dune by Frank Herbert, coming out in yet another movie this December 2020 (if not delayed) and since I cannot be climbing mountains with Charita right now… I have decided to read the remaining 3 unread prequels…. but oh no… that would be too easy. I’m reading them in Spanish! Yes I do these things to myself.

I’m reading La Yihad Butleriana (The Butlerian Jihad) and when I have finished I hope to move on to La Cruzada de los Maquinas (The Crusade of the Machines) and finally La Batalla de Corrin (The Battle of Corrin). These books are written by Brian Herbet, the son of the author of the original series Dune, Frank Herbert and Kevin Anderson.

Once complete I can officially say I don’t need to have booked for learning Spanish anymore I can officially understand Spanish. So far it’s a hard job… learning words like reconnaissance, shields, flame-throwers and rocket-launchers, but I am slowly getting there! Maybe when I have finished I might remember to update this post…

Machu Picchu

Me and my best friend Charita are up for climbing Machu Picchu we have set our sights high and it’s quite a lofty goal to go along the Incan trail. We have never done anything like it before. In the mean time we are looking at climbing in the UK starting with Box Hill on 22nd March 2020 and Blencathra on 3rd April 2020.

I am a little over excited and can’t wait to climb Ben Nevis and Bein a’Chrulaiste before stopping by my plot in Glencoe woods.


Unfortunately the spread of the Coronavirus in 2020 prevented us from being able to work on this!

Third Kung Fu exam

So I completed my Third major Kung Fu exam on Sunday 2nd February 2020 and passed! I’m very glad. I am mostly impressed that I have kept this up consistently and I’m now well into my third year.

Sadly my teacher’s mother is ill and classes have been reduced to once a week so I am doing my Kung Fu training with T’ai Chi (taijiquan) once a week with a friend called Moz in addition to the Wednesday class.

Broken up by a series of 10 push-up, 10 sits up, 10 squatts, we run for 10 minutes with squatts and long jumps mid run, followed by bunny hops, kangaroo jumps, duck walking, then 100 punches, 30 stretching leg lifts ( front, opposite shoulder, side, side with toe up), 70 kicks (front thrusting, back thrusting, side thrusting, crane kicks, triple round house kicks). This usually takes 15 minutes.

After the conditioning of kung fu, we are practice Yang-style Taijiquan including, stepping, form, pushing hands and some applications. This is based on what we had learned from classes and based on a series of DVDs by Yang Jwing-Ming to augment and solidify the knowledge from classes.



Sadly due to Covid-19 in 2020 all face-to-face classes were put on hold. I decided to take up running for a bit in the hope this would help me with part of the class that I struggle to keep up with.

Learning Arabic

I always wanted to learn Arabic which was a family language as a kid. I had great difficulty learning the Arabic spoken by my family as a kid. Everytime I had a book to help me learn, my grandmother would always say the same thing “no that’s not proper Arabic. The Egyptian Arabic is the proper Arabic.” She was mostly wrong, but the truth was I didn’t really want to learn MSA, I wanted to learn my family’s dialect so I could speak to my cousins and family.

My grandmother had found that Egyptian Arabic was understood by nearly all of the Arabic speaking world partly because Egypt has such a pivotal role in distributing the media, particularly television, in her day. So no matter where she went, or who she spoke to, they understood her strange combination of Egyptian Arabic, with the odd Lebonese word and a tonne of European loan words.

The problem was most of the Arabic world had jumped on something called MSA (Modern Standard Arabic). Nearly all books on the language were focused on MSA not my family’s dialect. Getting learning resources were difficult and I settled for a few phrase-books and romanized dictionaries in my dialect and most my text books were MSA. I also began to read some basic children’s books in MSA, but what was I learning… it certainly wasn’t the language my grandma spoke. My word for “what” was “maa”, but she said “ey” and my aunt said “shu”. Bread was “khebez”, my aunt said “khobz” but gran said “3esh” (the 3 is the sound of the vowel deep in the throat made by an Arabic letter called 3ain which looks like a 3). I said “sayaara” for car and she said “ara3biya”. What the hell was going on?

The Arabic world has always had massive respect for grammatical Arabic like that which was found in the Qoran. This language is the most complicated and oldest form the language. It incorporates strange additional sounds that indicate an noun’s relationship to the sentence. Is it doing the verb? Is the verb being done to it? Is it related to preposition in the sentence? These were things you barely worried about while speaking modern sentences. It became clear however that while the Arabic world seemed to all speak different languages their respect for tradition and religion had forced them to teach a version of proper Arabic across the Islamic world that was consistent.

In European, Latin spread around and local areas developed their own way of speaking and over time these all became extremely different. They became the different romance languages: Portuguese, Spanish, Catalan, French, Italian, Romanian etc. Imagine these countries still taught their children Vulgaric Latin. Then imagine one day instead of calling their languages all these separate names they would just call them all Latin and in school they would teach them the local spoken Latin (for example Spanish Latin) and teach them a modern simplified version of traditional church Latin (Modern Standard Latin). Well, this is actually very close to what happened in the Arabic speaking world. Instead of inventing a Modern Standard Latin, they invented a modern version of the Arabic of the Qoran with some dialectal influences, Modern Standard Arabic.

Modern Standard Arabic has the respect of the Qoranic Arabic since it essentially is Qoranic Arabic, but is accessible to a modern day speaker. However the closer the Arabic is to that of the Qoran the more respect it is afforded making it’s ideal form essentially 6th century Arabic. That was what I was learning.

No wonder my words didn’t fit. I was talking about carriages and my grandma about cars. I was talking about unleavened bread and my grandma about life sustenance, overtime in my Grandma’s Arabic the word for “which” had taken precedence over “what” and soon replaced it, while my aunt’s more Levantine dialect had preferred to say “the thing that” and dropped the question word altogether until the word for thing had essentially become the question word “what”.

Learning Arabic has been the biggest lingual challenge for me because of the 4-5 languages in one not to mention the vowelless Alphabet and the fact the word “you” declines in 6 different ways, but I am glad to have had the experience I have had and frankly even though it is basically learning 4-5 languages in one, I hope to continue with renewed effort. I have picked up some of my old books and I hope to use them to the best of my ability accepting that a lot of them are MSA and eventually get some more colloquial books in my dialect before having a good clear out and keeping only the dictionaries.

See you on the other side of this hopefully transforming experience.

The student surpasses the master

Okay, he hasn’t surpassed me just yet… but I wrote in March about having a junior called Gareth. I look forward to the end of the month, where I not only celebrate his birthday with him, but also his second month in a programming role! Well done to Gareth who got his first programming role.

I have a junior!

So You may have seen my “I made it” post in 2016 when I joined the ranks of programmers, something I had been trying to do for a while. Well, it is time to turn around and give back to the communities I have formed around me and give them the opportunity that I had to seize for myself.

I have met a couple of people that wanted to become programmers and basically I vowed to help them, because I remember how difficult it was for me. First I worked with a chap for a couple of months, but sadly because of his disabilities, he felt that he just didn’t have the energy to work at it. I decided to let him go and not push him, because I really needed someone who wanted it so much, that they could work independent of me more. I recently found that in Gareth.

Gareth has been learning programming by himself and with my encouragement he has really put the effort in, completed online courses and continues to learn with me.

I am finding with Gareth that I use a lot of jargon that leaves him feeling baffled and sometimes with a full week in between sessions he forgets what he has already learned, so we have written a bullet point list of the stuff we have covered already and before each session we will quickly run through and speak briefly about the stuff in the list to remind him of what he already knows, to cement the jargon and to start each session reminding him of just how much stuff he really has learned in a very short space of time.

We also have plans for him to complete a small test project for my employer and a specific application for Dragged Around London my company. I am excited to see where this goes!

Arduino Programming

Most of the coding I do is very high level and so far removed from the physical technology I often feel like I don’t actually know the basics of what my code is doing on system level. I feel like I want to round out my programming knowledge so I’m working with a fun Arduino and I bought a collection of LEDs, resisters, capacitors, a bread board, a motor, a sensor and I think I’m going to have a little bit of fun!

My first project turned out very well. My hardware equivalent of a hello world project was a multi-coloured LED that flashed the colours of the rainbow in order combining different channels of RGB, but many more to come.

Kung Fu Foundation Complete

After months of hard work I finally managed to get my red belt. That means sparring and harder work to come. We are all very proud of ourselves and I want to take this moment to state no matter what someone’s size or physical fitness if they truly want to they can set aside some time to learn a sport. Even someone like me!

Psycho spender

I am looking into the psychology of money. It’s an interesting minefield which I don’t know why no-one looked at this before. A silly movie called Confessions of a Shopaholic briefly touched on the subject, but didn’t look at it much at all. I feel like this is something that should be taught at schools. I know people with real spending problems. I’m a major psycho-spender at times!

Why is this important because being able to pay our way through life is important. We constantly hear stories of people screwed over by society. Did you hear of the guy who was paralysed aside from being able to breath in one lung and move two fingers and one thumb. Supposedly he received a letter saying that he was expected to find a job. He was asked to find a job where adjustments could be made so he could work full time and his benefits were being reduced until he had found one.

I am now 30 and if we think I’d like to retire at 65 that makes 35 years. 35 years of 12 months until I might like to not have to go in to work anymore. If I was able to put aside £500 every month I could have £210,000. Ummm… in this day and age, that’s not even enough to buy a house in the area I live in. So I’m going to have to put more than that into it! Well, it will get easier as I get raises, but there’s always a chance I won’t get raises. I might even get fired. So I have t work on the assumption that my current salary is what I have to work with. Not easy but it will get easier when I buy a property and let a room. I might even get a buy to let second property to help me raise more money to pay off the first house quicker if that’s going well. If I can find a way to buy two houses by the time I’m 70 I should have an income of whatever 2058’s equivalent of £1000 a month coming in from the second house and I will be able to live in mine. That should be enough to keep me occupied for the last few years of my life, then when I die I can leave it to my nephew who is the most adorable 6 month-year-old you ever saw. That’s the plan, but I need to start acting now! 20-30 year olds, don’t leave this till later you’ll be broke and broken before you die and scraping the inside of a can of beans for a meal.

It was a the works of Brad and Ted Klontz that awoke me up to the scripts that are preventing me from doing this. The beliefs that are keeping me a chronic spending addict. I hope to read more of their work in the time to come.

Learning to Drive!

Finally I have passed my text. 10 years ago I failed and now I have conquered.

Yale Old Testament course

I am currently working through an incredible course published online by Yale University. It appears to be mostly the efforts of Christine Hayes who demonstrates a vast understanding of the culture within which our western religions grew up and matured. She balances many different views concerning the origins of biblical texts and presents views that many religious zealots avoid. These views often seem potentially heretic or deviating from standardized Judaism and Christianity but they are views based more on archaeological discovery than most other forms of religious doctrine.

So far with this course I have discovered the incredible similarities between the paganism of the near east, its literature and the content of the bible. The incredible similarities between Akkadian gods such as Baal and El when considered next to the god of Abraham as represented in the bible appear to reveal much of the demonstration of monotheism for the pagan masses which was going on at the time.

We have even explored multiple source theory for the bible and I reviewed the possible difference between these sources and the doctrines upon which they are based. I am somewhat sceptical about the ability of scholars to distringuish completely between different sources where E sources use the name Jahweh and J sources use the name Elohim (which is contrary to their respective definitions).

This course is incredible in its content and I can’t believe it is available for free online. I wish I could afford to buy all the books for the accompanying reading for this course but I can’t afford the money or the time and yet have determined to spend a substantial amount of time working through the material as what I learn is reward enough for the efforts of this endeavour.

For anyone who is interested in this material, click here : http://oyc.yale.edu/religious-studies/rlst-145#overview