Mindless Rambling Nonsense
Paul D'ambra
Fangler

Adding Structured Data to a Jekyll site

Structured Data is a way of adding context to files served on the web so that computers (primarily but not only search engines) can respond to what your content means.

Google, for example, will alter and improve how your site appears in search results based on the context you give your data. And if your site is considered authoritative can use the data to build the knowledge cards it sits alongside other search results.

This blog is only authoritative for being unread but I’ve not worked with structured data and thought I’d investigate.

Using Travis CI to build a Jekyll site

I recently had a conversation where I said that I couldn’t build an AMP version of my blog because I use Github Pages to build and serve it. Github don’t allow any Jekyll plugins to run.

Later that day my subconscious prompted me to realise that, since Github pages will serve static HTML quite happily, I could use Travis CI to build a Github repository that held the source for the blog and push the static output to a second repository that Github would publish as is.

Kill If With Objects

Today I had super-fun spotting the oportunity for a refactoring and figuring out how to apply it. I wanted to think it through while it was fresh in my mind to try to cement any learning opportunity

The refactoring in question is “Replace Conditional Dispatcher with Command”.

Quoting that source the opportunity for this refactoring is when:

Conditional logic is used to dispatch requests and execute actions.

And the solution is:

Create a Command for each action. Store the Commands in a collection and replace the conditional logic with code to fetch and execute Commands.

It’s one of those subtle changes that has real power to tidy up and add to the expressiveness of your code.

If (pun intended) you aren’t familiar with it I’d definitely recommend trying it on for size by looking for an opportunity to apply it in your systems.

Powershell on Linux

MS have open-sourced powershell and made it work on many platforms. Kudos to them - I’m loving the “new MS”.

I’ve never really got powershell. Although it’s definitely an improvement on vbscript so I have used it when I’ve needed to automate windows.

But as a task approaches some ill-defined level of complexity I switch to C#, Ruby, or Node rather than writing a script. Not that those are the only options just I don’t know Perl, or Python, or $yourFavouriteTool.

As a result I have barely written any Powershell on Windows and, as I’ve done more work on Linux over the last few years, I’ve also barely written any bash.

So, while I think it’s a good thing that MS are opening up and releasing cross platform tools I was underwhelmed. But some colleagues were excited and people I think of as being *nix people too

I thought I’d spend some time to compare the two.

Real vs. Software Engineering

I just had some “fun”.

Reactotype Part 3

At the end of the last post I realised I’d sacrificed some good practice in the blind rush to make it work (i.e. worked normally like all those other guilty software engineers everywhere everyday.)

So earlier today I played with the kids to tire them out enough that I could distract them with television and write some #holidaycode because I am a good(-ish) parent.

I managed to

  • switch from using magic strings in the messagebus channel and topic identifiers
  • kill some duplication
  • and get some tests around ReactJS

Reactotype Part 2

I posted about my impressions of working with React slowly building an HTML table and banging on about it. I ended that post with one of the more memorable cliff-hangers in recent time.

Sorting and Filtering the Table

That we will leave till part two… because I introduced a relatively artifical constraint that I didn’t want the filtering control to be a part of the table.

Imagine that there will be many tables with the same filter. I don’t want to bind the filter to any one table or insist that every table has it.

At first I expected that it would force me to understand React’s components and how to compose them… instead I stumbled on something really cool #cliffhanger

Exciting! Right?

I want to add a filter control and I don’t want it to be bound to a particular table so that it can be easily re-used.

Reactotype Part 1

part one because I’ve got a feeling this is a topic about which I’ll be able to bang on.

React JS was made by Facebook to be the V in MVC. In other words it only deals with the UI. It’s sold as being fast - both for performance and development. A definitely contentious part of React is that it mushes JS and HTML together… More specifically you put HTML inside the JS not vice versa.

Fun With Structs

We had a brief conversation at work the other day about extending a type to make our code clearer…

public class MeaningfulName : MathsName
{
    public MeaningfulName(double w, double x, double y, double z) : base(w, x, y, z)
    {
    }
}

Happy Numbers

I love C# but while we’re trying to beat our deployment process into submission at work I’m only really writing Ruby and Powershell. So when a few, different articles about the Happy Numbers kata turned up on my twitter feed and I found myself with a large whisky and a sleeping family I thought I’d have a go.

The Happy Numbers kata is defined as

Choose a two-digit number (eg. 23), square each digit and add them together. Keep repeating this until you reach 1 or the cycle carries on in a continuous loop.

If you reach 1 then the number you started with is a “happy number”.

Can you find all the happy numbers between 1 and 100?

Transforming web.config values with Rake

I’ve really been enjoying using Albacore Rake instead of MSBuild at work. It’s enabled us to get everyone involved (because ugh, msbuild xml) and to improve our CI/CD pipeline.

Today we were talking about reducing the number of build configurations we have… which we only have in order to support config transforms.

Static Factory Methods FTW

It is relatively common to find (or write) a line of code like this

	var thingy = new Thingy(_someDependency, false);

Reading this line a person can know this is initialising a Thingy which takes a dependency on something… and something else is false.

I’m really lazy and easily distracted so I don’t like to have to think about anything except the one task I’m trying to not get distracted from. Having to think about what it means that something is false provides an opportunity for me to get distracted.

Websites != CMS Platform - Wrapping Up

This post is part of a series where I’m hoping to prove to myself that building a dynamic website with NodeJS is much more fun than using a CMS platform. See the first post for an explanation of why

The code can be found on GitHub

Previous Post

I’ve been banging this drum into the internet’s echo chamber for five months now and enough is enough!

Websites != CMS Platform - Better Editable Affordance with JS for great good

This post is part of a series where I’m hoping to prove to myself that building a dynamic website with NodeJS is much more fun than using a CMS platform. See the first post for an explanation of why

The code can be found on GitHub

Previous Post

In the last post a better visual affordance that a page element is editable was added. But didn’t solve the problem that notifications of success or failure were obtrusive and disconnected from the edited element.

pulsing affordance

Websites != CMS Platform - Better Editable Affordance

This post is part of a series where I’m hoping to prove to myself that building a dynamic website with NodeJS is much more fun than using a CMS platform. See the first post for an explanation of why

The code can be found on GitHub

Previous Post

In the last post I wasn’t happy with the visual affordance that a page element is editable.

editable sections for anonymous users

editable sections for anonymous users

Websites != CMS Platform - On Page Editing

This post is part of a series where I’m hoping to prove to myself that building a dynamic website with NodeJS is much more fun than using a CMS platform. See the first post for an explanation of why

The code can be found on GitHub

Previous Post

A.K.A. No More CMS-y Admin Section?

A traditional CMS framework or website has an admin section for logged in users. That section has a menu showing them which sections the user can edit and each section has a list of the pages they can edit and then the user can edit the text or upload images using a WYSIWYG editor.

Don’t fix it if it aint broken but… but… HTML5 includes the contenteditable attribute which makes (the text of) almost any element editable.

If the admin section exists (in large part) to allow editing of content and editing of content can be completed in the page itself could this replace the admin section?

Websites != CMS Platform - Promises - part 2

This post is part of a series where I’m hoping to prove to myself that building a dynamic website with NodeJS is much more fun than using a CMS platform. See the first post for an explanation of why

The code can be found on GitHub

Previous Post

So, in the last post I worked on switching some callback code to using promises with Bluebird library but as I’ve not seen much promisified (definitely a word!) code I wasn’t sure whether it was any good.

So I posted a question on the code review stackexchange asking for feedback.

Websites != CMS Platform - Promises

This post is part of a series where I’m hoping to prove to myself that building a dynamic website with NodeJS is much more fun than using a CMS platform. See the first post for an explanation of why

The code can be found on GitHub

Previous Post

A promise represents the eventual result of an asynchronous operation.

The basic idea is that you can swap in a promise where you would normally pass in a callback.

The primary interaction is that you call a method which returns a promise which will eventually return a result (it can immediately return the result if it’s available) and you chain a call to .then() onto that method call.

The call to then is equivalent to passing in the callback function.

Clear as mud?

Websites != CMS Platform - Logging in to the site

This post is part of a series where I’m hoping to prove to myself that building a dynamic website with NodeJS is much more fun than using a CMS platform. See the first post for an explanation of why

The code can be found on GitHub

Previous Post

This was the first part of the process which felt ‘hard’ so where I’ve felt the absence of a CMS platform but it’s also only the second time I’ve ever implemented authentication using NodeJS. And still only boiled down to a few hours work.

Websites != CMS Platform - Storing Data - Part 2

This post is part of a series where I’m hoping to prove to myself that building a dynamic website with NodeJS is much more fun than using a CMS platform. See the first post for an explanation of why

The code can be found on GitHub

Previous Post

The first step is always (or at least should be) to take a step back and decide what to actually do…

Websites != CMS Platform - Storing Data - Part 1

This post is part of a series where I’m hoping to prove to myself that building a dynamic website with NodeJS is much more fun than using a CMS platform. See the first post for an explanation of why

Previous Post

After a day writing DDL for a project that has manual schema versioning against MS SQL and is going through a lot of changes I feel honour bound to write a post about storing data in the Omniclopse site.

A DTO by any other name would implement ISweetSmellEquality

I’ve been thinking about what people call the objects they pass around and whether they are the right names and why… and when… and I feel like the dog running behind the television to see where the onscreen dog went - on the verge of a paradigm shifting change in perspective but not quite getting it (and possibly a bit smelly)

Testing With Browserstack and Selenium

This post is part of a series where I’m hoping to prove to myself that building a dynamic website with NodeJS is much more fun than using a CMS platform. See the first post for an explanation of why

Previous Post

Browserstack

I love Browserstack’s awesome service. It allows you to test your websites on different browsers and operating systems. Helping reduce the need to have access to physical devices for testing and reproducing bugs.

Selenium WebDriver

BrowserStack allow automation using a Selenium web driver. You can access this with Python, Ruby, Java, C#, Perl, PHP, or Node.js. It is also possible to test publicly or locally available sites using BrowserStack.

Website != CMS Platform - Displaying pages - part 2

This post is part of a series where I’m hoping to prove to myself that building a dynamic website without a CMS is comparable to building one with a known CMS. See the first post for an explanation of why

Previous Post

In his awesome book, “Don’t Make Me Think” (shameless affiliate link), Steve Krug drives home the message that time spent figuring out how your site is supposed to work is not time spent deciding to engage with your site. So, we’re not going to do any ground-breaking design work for this company web page.

Websites != CMS Platform - Displaying pages

This post is part of a series where I’m hoping to prove to myself that building a dynamic website without a CMS is comparable to building one with a known CMS. See the first post for an explanation of why

Previous Post Next Post

Setup

So, it’s relatively easy to get an Hello World page displaying…

Websites != CMS Platform

I was once complaining about having difficulty setting up a very slightly unusual feature in a Drupal site that was taking forever to achieve. The framework made so many assumptions about what I should do that it wouldn’t let me do what I wanted to.

A freelancer commented that if he was quoting on a project that had a requirement that it use a given CMS he didn’t quote any less than building from scratch. He had found it didn’t make enough difference to the effort he’d spend…

This stuck with me and matches my experience so far. (yeah, yeah, confirmation bias. I know)

Comparing MongoDb and TokuMX

TokuMX is an

“open source, high-performance distribution of MongoDB”.

On a current project we’re using MongoDB and, as the system is likely to scale fairly heavily, worrying (primarily) about storage. So, I picked up a task to compare MongoDB and TokuMX.

Astronomical Database Identfier

I dealt with an unusual requirement over the last few days. And wish I’d understood some of the more unusual ways that big numbers are handled in C#, Entity Framework, MS SQL and Oracle

Strong like a man

The death of Thatcher prompted a short conversation on Twitter which included this tweet…

Automagical search UX

So I’m building a page in a mobile app to find “things”.

Some assumptions:

  • If you’re using the app you are already familiar with the “things”
  • You’ve clicked “Find Things” and so you’re expecting, as a minimum, to type something into a box (to tell the app what things you want to find)
  • You’re a busy mofo and you don’t want to have to think

Obligatory iOS6 maps post

For years now I’ve not bothered buying a satnav because maps on my iPhone has been just good enough… sometimes a bit dodgy (once taking a route more fitted for a mountain bike) but generally serviceable.

Taking a trip from Manchester to Kettering this weekend with just my iPhone on iOS6 and the missus’ on iOS5 was eye opening. Also, bleedin’ awful… just awful - ‘drive around a roundabout twice in confusion’ awful.

I really did give it a good go but this image sums up the difficulty faced using iOS6 maps.

Y U NO SELL DOWNLOADS HOLLYWOOD

So it occurred to me that my kids might enjoy The Lion King (they like roaring). Our TV is really a computer and is hooked up to the internets allowing all kinds of iPlayer and similar streaming goodness.

I guess I’m not unusual in that when I want to find something I google it…

Is there really just an iPad market?

Disclaimer: I use and love an iPad (1). I’ve got an iPhone, mac mini, a MBP and an iMac. But I’m not an out and out fanboy - I’m a windows admin and nascent C# developer. I try to use Linux where it fits and find more places it fits all the time. And I’ve been developing an Android application.

TL;DR The transformer prime is a beautiful computer but it might be true there’s an iPad market and not a tablet market.

UPDATE

And then today Google release Chrome for Ice Cream Sandwich. BEST. TABLET. BROWSER. EVAR.

Setting up an MVC3 website using built-in membership provider

Oh wait… this is awful. AWRUCHKA. Right dry heaving done with.

It’s a good job so few websites want to authenticate users and collect data on them otherwise we’d constantly have to write the same code ove… what’s that? Oh my! Everyone is going through this.

Blackberry Desktop Software = Design Abortion

blackberry screenshot

OK, so maybe the title is an overstatement but here’s the steps to reach that mindset.

An unusbscribey follow up

So recently I blogged a bloggy thing here about unsubscribe links.

I know a lot of people are of the opinion that an unsubscribe link should just unsubscribe you and require no further action and that the whole idempotency thing is software design flim-flam and I was tempted to agree until I was introduced to the concept of pre-fetching…

How to design an unsubscribe link?!?

We send out mail to 70,000+ members of our organisation. In theory they know they’re getting it cos they’re advised when they join the organisation that we’ll send the email… yes, I know that implicit opt-ins aren’t best practice… I want to polish up our email unsubscribe flow since the amount of mail we send out is steadily climbing as we move from paper to email for more things.

Get with the program(ming)!

Twice recently I’ve hit the same problem with two different mobile phone vendor’s websites. Vodafone (displayed here) and 3. When I type a phone number I split it into three sections using white space. “nnnn nnn nnnn” that’s how I remember numbers. That’s not uncommon I don’t think…

SSH without password

I’ve resolved to learn more about linux and have been slowly boggling at how easy some tasks are in comparison to the MS world…

Recently I’ve been working on what was intended to be a small and straight-forward website that has rapidly grown to be a large behemoth that will take credit card payments.

Refactor ==fun

I’ve been using JetBrains Resharper for a while after a recommendation along the lines of “I can’t stand to write code without it now” and…

I can’t stand to write code without it now!

Odd, odd, odd login behaviour

I’ve got a mini 5101. A little HP netbook that I lurve. It runs Windows 7 and Ubuntu 10.04 with aplomb.

There's more in them thar hills...

…than just the Factory pattern.

So anyway I learn about design patterns and begin to use the factory pattern. And much like many other people I settle into a world where there are no other patterns. All is comfortable and fluffy and instantiated simply from calling code much as it was in days gone by.

Quack Quack Says The Duck now with added threading

In a previous post I advertised an application I’d made for WinMo to entertain my toddler.

Having watched her play with it and having been reminded to K.I.S.S. I’ve fixed a bug that highlighted the difference in expectations between myself and a toddler.

c# Background Worker

I’ve been meaning to get around to writing a good tutorial on c# background workers. Mainly because I use them to separate the GUI from all the heavy lifting and I always forget how to update things.

In case I never get around to it. This is about the clearest introduction I’ve ever found. Well worth a read…

Bing is not a search engine

Over the last two days I’ve been researching using Windows Deployment Services with BDD. I’ve got 4 workstations to build so I may as well investigate it right?

Quack Quack says the Duck

I’ve released a piece of software that I made for my 18 month old daughter on Codeplex http://qqstd.codeplex.com/.

It’s a small dotNet app for Windows Mobile that creates sound-image pairs by scanning a resource folder and then randomly displays one of the images. When the image is touched the sound associated with the image is played.

I developed it to occupy my daughter and teach her animal noises but the app doesn’t care what if finds so you could use pictures of family and friends and their names said out-loud; Vehicles and their engine noises or anything that enters your transom.

Anonymous methods when invoking in VB net

Well obviously not but you can get close in some circumstances.