Estimating the work of creating an email newsletter

I was asked to estimate the work to create an email newsletter. The work of reading email addresses and sending the mail was already in place, so all I had to do was create the HTML.
I received some visual guidance and most of the content was already present in text), so all I had to do is create one static HTML page, how hard could it be?

Boy was I wrong.

Ok, so the first HTML file I’ve sent was ok…. on my Gmail account.
…On my Office365 account it looked almost ok.
…On the Microsoft mail it looked ok’ish.
…On the MAC of the boss it looked not ok.
…On the email reader of the modern Android phone, it looked quite good, on the older Android phone, it looked like abstract art.
…On the IPhone it looked somewhat ok.
…And so on…

As webdeveloper I am used to browsers sometime implementing things different than other browsers.
But with the email newsletter the dark side of the (IE vs Netscape) past came back to live for me. Not only was it almost not possible to work CSS only so I had to fall back to the type a lot, but the differences of visualization of the HTML were surprising… and not in a good way.
This obvioulsy lead to investigating the topic more than I expected to do!

Free Microsoft Virtual machines to test software on Microsoft Edge and Internet Explorer 8 through Internet Explorer 11

So I was looking for a quick way to test my website on an older version of Internet Explorer.
And when I searched for free virtual environments I thought “Maybe searching for free Windows images is not such a good idea; I might end up at some weird place on the internet“.
But much to my surprise there actually are virtual machines to test software on Microsoft Edge and Internet Explorer 8 through Internet Explorer 11, issued by Microsoft itself.
They have a limited livespan of 90 days but for some testing this will do. And otherwise you can download a new one after this period.
You can download images for these browsers:

  • IE8 on Win7
  • IE9 on Win7
  • IE10 on Win7
  • IE11 on Win7
  • IE11 on Win81
  • Microsoft Edge on Win 10

Then, you can choose from these image formats:

  • VirtualBox
  • Vagrant
  • HyperV (Windows)
  • VPC (Windows)
  • VMware (Windows, Mac)
  • Parallels (Mac)

So whatever preference you may have, there is a download for you.

I am working with the IE11 on Win7 HyperV image, and it works like a charm.

You can download them  here:

https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/

Windows 10 quick screenshot / printscreen

Do you quickly want to create a screenshot / printscreen of your entire screen in Windows 10?
Press [windows key] [ printscreen] at the same time, that’s all there is to it.

keyboard windows printscreen 2

Press [windows key] [ printscreen] at the same time and your screen turns gray’ish for a split-second, and a screenshot is automatically saved in your default pictures folder, in the subfolder ‘Screenshots’.

screenshotfolder

Using Fullcalendar

I was looking for a calendar to use in an admin portal, to show exceptions on a given day.
So I decided to give FullCalendar (http://fullcalendar.io/) a try, and boy did it work out nice.

It took 4 steps:

  1. Create an HTML element where the calendar should be placed
  2. create the data
  3. create a little script to configure
  4. last, in my case, add a click handler to the day element to drill into the data.

So first, the HTML element:

<div id="calendar"></div>

Then step 2: the data.

My data comes from a database, and I select the following data:

{
    "id": "2016-05-02",
    "title": "119 errors",
    "start": "2016-05-02",
    "allDay": true,
    "className": "exceptionPurple"
  },
  {
    "id": "2016-05-03",
    "title": "21 errors",
    "start": "2016-05-03",
    "allDay": true,
    "className": "exceptionRed"
  },

The id is when I want to drill in on the data. I only show how many errors there are on a given day, and (see below) I hook a click event to the calendar to get all errors for a specific day, and I use the id of the event to see which day is selected.

The title holds the number of errors.

The start is the date in which the event is placed. It’s about the number of errors in a day, so it doesn’t have a start- or end time, but I set ‘allDay‘ to true.

The at the end I set the className. This (css) class is applied to the element in the calendar. In my case red means 10-20 exceptions that day, and purple 21-50. I also use other colors for no errors, 1, 2-5, 6-10, 51-100 and 100 or more.

Step 3 and 4, configure it.

This is were normally a lot of time and Googling is spent, but this one is really easy.

$(document).ready(function () {

$('#calendar').fullCalendar({
	events: '/exception/getexceptions',
	eventClick: function(calEvent, jsEvent, view) {
		toonlog(calEvent.id);
	},
	height: 700,
	//the element title contains html which gets escaped. This line sets the html content
	eventRender: function (event, element) {
		element.find('span.fc-title').html(element.find('span.fc-title').text());
	}
	});
});
function toonlog(eventId) {
	$.get('/exception/getexception/?dateinput=' + eventId, function (data) {
		$("#logcontent").html(data);
	});
}

First line in a jQuery load event, call the fullCalendar function on the element we created in step 1.
events property: this is the url of the api where the JSON (in step 2) is returned. The start- and enddate of the period is automatically sent along to this url as querystring parameters.
eventClick: the function that gets called when a user clicks on the event
eventRender: a function to use when there is html in the title (in the JSON)
function toonlog: the function which get called when the user clicks an event. This function goes to the server, gets all exceptiondata and returns it. The function then puts it in an HTML element called #logcontent.

(the toonlog functionality is left outside the scope of this article, but what it does is call to the /exception/getexception method on the server which then returns all the exceptiondata on a given day).

And then, when we add the css for all the colors

.exceptionRed {
	background-color: red;
	cursor: pointer;
}

.exceptionOrange {
	background-color: orange;
	cursor: pointer;
}
.exceptionBlack {
	background-color: black;
	color: white;
	cursor: pointer;
}
//other ones left out

this is the result (the today, next-month and previous-month buttons are automatically added):

fullcalendar

Programming for Android

Programming has long been my career but has been my hobby for even longer: Beginning with the Sinclair ZX-Spectrumin Sinclair BASIC.

zxspectrum

Later via Pascal and Visual Basic to now working with C# and JavaScript at work and some Raspberry-PI with Python and PHP in my spare time.
So if you have a smart phone that allows you to do programming in Java it’s very tempting to want to start doing so.
And indeed this is what I did…I started with a small app in order to gain some experience and to see how the Android ecosystem works. The app in question is useful for only a small number of people because in very technical terms: it shows you current data connection and connection status as well as your internal and external IP address. Its name “What’s my IP?” (check it out in Google play)
I got a taste for it so I thought of a new name under which to carry out Android app development: Greenledsoftware.

greenledlogo

More information about this and other apps can be found on www.greenledsoftware.nl

Learn Angular and JavaScript

My upcoming project is being developed with a client-side framework called AngularJS. It is currently rather popular partly through the popularity of the Singe Page Application model. (https://en.wikipedia.org/wiki/Single-page_application)

The backend relies on ASP.NET built using C#, but AngularJS is new for me so it calls for a course.

However AngularJS works with JavaScript and not with C#, and during my day-to-day work in ASP .NET MVC I use JavaScript very little.

Now and again I do something small using jQuery but I cannot do much more than the very basics.
Therefore at the top of my list was: improve my knowledge of JavaScript.

At Code School (Codeschool.com) I found a good course and I started it with much enthusiasm.
The course consists of 4 parts: 3 modules of basic knowledge and 1 of “best practices”.
Starting with Part 1 I quickly got the feeling that my lack of knowledge wasn’t as bad as I had thought. Basic knowledge about variables, scoping, concatenation and use in HTML were explained , things I already knew.

Confidently I moved to Part 2: for and while loops, prompt and confirm, if-else, functions and the array: a couple of refreshers but mainly knowledge I already have.
I was already half way through the course: actually my knowledge of JavaScript wasn’t too bad!

On to Part 3: Where things start to get a bit tougher.
Function expressions (good to know), closures, (“so closures work like this” and “oh, so that can go wrong”), hoisting (wow, I’d never thought about it), objects (object literals, I felt just like a real JavaScript programmer with objects) and finally classes, constructors and prototypes.

This last section on how to work with objects in JavaScript in particular was very educational.
At that moment I felt a little more familiar with JavaScript. The good thing about the course is that not only do you get taught theory but between the videos you can type out things to see whether you have understood. In my case that last part was very educational: If you watch a video containing theory then anything quickly begins to sound logical, but if you start coding yourself then the think tank really gets started.

And finally: JavaScript best practices
To round off the course there is a long list of topics that show the difference between good and bad code and finally a nice final exercise about numbers in JavaScript.

Starting a freelance partnership

Seven ye64f9fbe2881c9ce633366b4e8b17991fars ago I started working as a .NET freelancer. In those seven years I learned to love the advantages of freelancing and I have learned to live with its slight disadvantages. Last year however, during a conversation with Martijn Tetteroo, we wondered if we could do something about the “lonely” existence of the freelancer. “Lonely” is deliberately written between quotation marks because naturally you are not totally alone. On your projects you have colleagues and on some projects you are seen and treated as a “normal” colleague but nonetheless you can still feel a bit alone. Martijn and I both had a desire to coordinate with other like-minded freelancers about life as a freelancer: about admin, finding contracts, sharing knowledge, technical challenges, insurance, corporate ideas etc. It is also useful to be part of a professional .NETters’ club where you trust each other and where you know you can rely on each other. These sorts of topics are more easily discussed with a group of “trustworthy” fellow freelancers than with any random freelancer or a freelance colleague from 6 years ago.

Then came the idea to set up a partnership in order to make all this possible. Together we analyzed our networks and we started up last year under the name Freece with 6 members. This year we have welcomed 2 new members and so there are now 8 of us.

And was it worth the effort? The answer is a definite yes.

Every other month we will get together for a pleasant evening of chat, food, a technical presentation and to discuss all matter of subjects that we members of Freece experience. We also noticed that a collection of experienced and valued professionals has created a strong group that is greatly valued by the rest of the market. In conclusion: a freelancer doesn’t need to feel alone. So if you are a freelancer in any industry then perhaps starting a partnership is for you!

Book review of “Soft Skills: The software developer’s life manual” by John Sonmez (in English)

Summertime, on holiday, by the pool with a good book. For me that’s the bee’s knees. What book to read first is always a bit exciting? This time I had chosen to read this book by John Sonmez

I have listened to john several times on his podcasts and I have always found he usually says sensible things. And in anticipation of this review, he does the same in this book too.

This book starts with the question why this book is different from all other books.

The answer is that this book isn’t about design patterns or writing better code. It is also not about unit tests, TDD or SOLID.

No, this book is about how you can better manage your career, how to design your life, how to take control of your finances, how to keep your body in shape, how to eat well and much more.

The book consists of 71 chapters and a few appendices, divided into 7 sections.

The 1st section is about career and work
Do you think enough about these topics?
About your CV, interviews and intakes, work, working from home, professionalism?
Whether you stay in full-time employment or if you become a freelancer, whether you go on to make your own software product.

The author encourages you to do so!

A few quotations from this section: “Make sure you are a problem solver” and “Don’t be too religious about technology.

The 2nd section is about marketing yourself.
This is not only important for freelancers but also for those in paid employment: you should see yourself as a business that is hiring itself out to a client that happens to be hiring itself to one client.

The difference between a small-, large- and medium-sized business and a start-up is clearly described here.

The 3rd section is about life as a professional, with an emphasis on “continuous learning”
This section deals with the action plan “how to learn effectively”.

This will sound very basal but as an IT professional you often have to gain more knowledge, but have you already thought about how you can best do that or how do you find out what knowledge you are actually missing?

The 4th section is about productivity.
There have been many books written on this subject but if you have not yet read those this book will provide a good summary. If you have read those books this section is good revision.

Since greater productivity involves changing habits, reminding yourself of this material is absolutely necessary. Here not only is theory discussed but also the ways in which the author himself has implemented it in his own work and career.

Topics that appear are focus, the pomodoro technique and internal/external motivation.

The 5th section is about finances.
Not a section that provided me with much new knowledge but a useful part of the book nonetheless about what to do with your finances.

If like the author and I you work in IT and earn a good living you’ll ask yourself what to do with your earnings: do you spend or do you invest?

He also talks about the dangers of debt, investing in real estate and the theory behind shares and options.

The 6th section is about fitness.
An unexpected section but certainly interesting to read. Isn’t there the old saying “a sound mind in a sound body”?

Topics that appear are muscles (how to grow muscles), muscle development (3 types of muscle growth), burning fat, calories and health.

Here the author demonstrates that he knows how to succinctly describe the topics in such a way that you feel like you get a lot of information from each section and that the chapters never feel tedious.

This section also provides a good summary of the theories about this topic such as those of Weight Watchers or Herbalife.

The 7th and last section is about spirit and the conclusion of the book.
A less developed section but Chapter 67 (Building a positive self-image: Programming your brain) is definitely worth it.

An appropriate saying therefore: “failure isn’t a defect; it is the road to success.”

My conclusion
A pleasantly readable, useful and interesting book for people with an (office) job who want to be engaged with their work, their professionalism, their knowledge and their career.

Sometimes you get the feeling that you are knocking on open doors or that you think that everything sounds logical: sometimes however you only need that in order to set things in motion.

New features in Visual Studio 2015

I’ve been reading the Visual Studio 2015 releasenotes (https://www.visualstudio.com/en-us/news/vs2015-vs.aspx) and while I am waiting for the ASP.Net vNext, here are some things which I find are nice improvements:

Nameof

Nameof provides a refactoring-safe way of getting the name of e.g. a parameter, member or type as a string.
Finally a typesafe way of referencing the name of a variable!

Here’s the old code:stringformat1

 

and here is the new code:

stringinterpolation2

 

No more referencing the wrong variable name when the refactoring missed the “variabele name by string”!

String interpolation

From the docs: “An interpolated string expression looks like a template string that contains expressions. An interpolated string expression creates a string by replacing the contained expressions with the ToString represenations of the expressions’ results.”

Here’s an example:
Code before:

stringinterpolation1

Code with string interpolation

stringinterpolation2

 

And the compiler checks the expressions in the string text!

null-conditional operator

Copied from here (https://github.com/dotnet/roslyn/wiki/New-Language-Features-in-C%23-6) which contains a good explanation:

Sometimes code tends to drown a bit in null-checking. The null-conditional operator lets you access members and elements only when the receiver is not-null, providing a null result otherwise:

int? length = customers?.Length; // null if customers is null
Customer first = customers?[0]; // null if customers is null

The null-conditional operator is conveniently used together with the null coalescing operator  ?? :

int length = customers?.Length ?? 0; // 0 if customers is null

The null-conditional operator exhibits short-circuiting behavior, where an immediately following chain of member accesses, element accesses and invocations will only be executed if the original receiver was not null:

int? first = customers?[0].Orders.Count();

This example is essentially equivalent to:

int? first = (customers != null) ? customers[0].Orders.Count() : null;

Except that  customers  is only evaluated once.

Lambda Expressions in Debugger Windows

You can now use lambda expressions in the Watch, Immediate, and other debugger windows in C# and Visual Basic.
Lambda expressions are used so frequently that this feature is highly welcomed during debugging sessions!

JSON Editor Improvements

Un-minify context menu. You can right-click the JSON editor and select Un-minify context menu to un-minify any long arrays in the JSON file.

Javascript

Tooling support for AngularJS. Now, when you are writing apps using AngularJS, IntelliSense provides suggestions for Angular controllers, services, factories, directives, and animations.

Boek review van “Soft Skills: The software developer’s life manual” geschreven door John Sonmez

51WiLueukSL._SX396_BO1,204,203,200_Van de zomer, lekker op vakantie, aan het zwembad met een goed boek. Dat is voor mij goed vermaak. Welk boek als eerste gelezen gaat worden is altijd een beetje spannend. Dit keer had ik echter goed gekozen door dit boek van John Sonmez te lezen.

Ik heb John een aantal keer gehoord op zijn podcasts en ik vind dat hij vaak zinnige dingen zegt. En alvast vooruitlopend op deze review: dat doet hij in dit boek ook.

Waar dit boek mee start is de vraag waarom dit boek anders is dan alle andere boeken.

Het antwoord is dat dit boek niet gaat over design patterns of het schrijven van betere code. Ook gaat het boek niet over unit tests, TDD of SOLID.

Nee, dit boek gaat over hoe je beter je carrière kunt managen, je leven kunt inrichten, je financiën kunt beheren, je lichaam in vorm kunt houden, goed kunt eten en nog veel meer.

Het boek bevat 71 hoofdstukken en een aantal appendices, onderverdeeld in 7 secties.

De 1e sectie gaat over carrière en werken
Denk jij wel genoeg over deze onderwerpen na?
Over je CV, interviews en intakes, werken, thuis werken, professionaliteit?
Blijf je in loondienst werken of word je freelancer, of ga je een eigen (software)product maken.

De auteur moedigt je aan om dit wel te doen!

Een paar quotes uit deze sectie: “Zorg dat jij de probleemoplosser bent” en “Don’t be to religious about technology.”

De 2e sectie gaat over de marketing van jezelf.
Dit is niet alleen belangrijk als je freelancer bent maar ook als je in loondienst bent: ook dan moet je jezelf zien als een bedrijf, dat zich toevallig aan 1 opdrachtgever verhuurt.

Op een duidelijke manier wordt het verschil in werken in een klein-, groot-, middelgroot bedrijf of bijvoorbeeld een startup hier beschreven.

De 3e sectie gaat over het leven als professional, met de nadruk op ‘altijd leren’.
In deze sectie wordt ook het stappenplan “hoe leer je effectief” behandeld.

Dat klinkt heel basaal, maar als IT’er moet je heel vaak nieuwe kennis opdoen, maar heb jij nu al eens nagedacht over hoe je dat het beste kunt doen, of hoe je er achter komt welke kennis je nu eigenlijk mist?

De 4e sectie gaat over productiviteit.
Daar zijn al veel boeken over geschreven maar als je die nog niet hebt gelezen dan staat in dit boek een mooie samenvatting. Heb je hier al wel over gelezen dan is deze sectie een mooie herhaling.

Aangezien productiever worden ook het veranderen van gewoontes inhoudt is een herhaling van deze materie erg nuttig. Daarnaast wordt hier niet alleen de theorie behandeld maar vaak ook de manier waarop de auteur het in zijn eigen werksituatie heeft geïmplementeerd.

Onderwerpen die aan bod komen zijn focus, pomodoro techniek en interne- en externe motivatie.

De 5e sectie gaat over financiën.
Niet een onderdeel dat voor mij persoonlijk veel nieuwe kennis toe voegt, maar wel terecht een onderdeel van dit boek: Wat doe je met je financiën.

Als je zoals de auteur en ik in de IT werkzaam bent dan verdien je een goede boterham en zul je jezelf af kunnen vragen wat je met de verdiensten gaat doen: ga je consumeren of investeren?

Ook vertelt hij over het gevaar van schuld, het investeren in vastgoed en de theorie achter aandelen en opties.

De 6e sectie gaat over fitness.
Een onverwacht onderdeel, maar wel heel interessant om te lezen. En zegt een bekende uitspraak niet dat een gezonde geest vaak huist in een gezond lichaam?

Onderwerpen die aan bod komen zijn spieren (hoe groeien spieren), spieren kweken (3 soorten spiergroei), vetverbanden, calorieën en gezondheid.

Ook hier geldt dat de auteur de onderwerpen kort en bondig weet te beschrijven waardoor je het gevoel hebt dat je heel veel informatie per sectie tot je krijgt en de hoofdstukken nooit langdradig worden.

Deze sectie biedt een goede samenvatting van de theorie over dit onderwerp zoals deze ook door bijvoorbeeld Weight Watchers en Herbalife wordt gezien.

De 7e en laatste sectie gaat over spirit en de afsluiting van het boek.
Een wat minder uitgebreide sectie en het onderwerp moet je wel liggen maar hoofdstuk 67 (Building a positive self-image: Programming your brain) is zeker de moeite waard.

Daarnaast een mooie uitspraak: “failure isn’t defect, it is the road to succes.”

Mijn conclusie
Een aangenaam leesbaar, nuttig en interessant boek voor mensen met een (kantoor-)baan die bezig willen zijn met hun werk, hun professionaliteit, hun kennis en hun carrière.

Soms krijg je het gevoel dat er open deuren worden ingetrapt of denk je dat het allemaal logisch klinkt: soms heb je echter niet meer dan dat nodig om in beweging te komen.