97 things every programmer should know

O’Reilly have put their “97 Things Every Programmer Should Know” project online. Contributions appearingĀ  in the book are available under a Creative Commons license. You can read them at http://programmer.97things.oreilly.com/wiki/index.php/Contributions_Appearing_in_the_Book.

I like “97: Write Code as If You Had to Support It for the Rest of Your Life“.

 

Test Driven Development or Test Last Development

Computer Bug,I found this on my keyboard this morning! :-)Here’s an interesting read which points to a September 2016 study which compares Test Driven Development versus Test Last Development. It said:-

The conclusion of the original study is that TDD does not affect testing effort, external software quality, and developers’ productivity when compared to TLD.

Read more ›

Tagged with: , , ,

Pokemon Go released in UK

Pikachu

Pikachu

Woohoo – Pokemon Go has been released in the UK. And it’s not asking for full access to my Google account either.

Tagged with: ,

Registers

Registers got announced at Sprint 16. I’ve been part of the team working on them.

Read more ›

Tagged with: , ,

Processing CloudFront logs

If you want a nice graphical view of who’s hitting your CloudFront edge servers, then you can use GoAccess.

On a Mac, it’s as simple as

$ brew install goaccess

If you configure CloudFront logs to drop logs to an S3 bucket with a prefix, you can download all the directories using something like CyberDuck, and then save and run this script to parse them all:-

#!/bin/bash
 
# CloudFront stores it's web logs to a bucket with a prefix.
# 'brew install goaccess' - to install the web log parser prior to use.
# Download all the directories in the CloudFront logs bucket.
# Run this script to process all the logs in the subdirs, creating a HTML report
# for each CloudFront distribution.
 
for d in */; do
    cfdist="${d%?}"
    echo "$cfdist"
    gunzip -c "$cfdist"/*.gz | goaccess -a --time-format %H:%M:%S --date-format %Y-%m-%d --log-format %d\t%t\t%^\t%b\t%h\t%m\t%^\t%r\t%s\t%R\t%u\t%^ > $cfdist.html
done

# CloudFront stores it’s web logs to a bucket with a prefix.
# ‘brew install goaccess’ – to install the web log parser prior to use.
# Download all the directories in the CloudFront logs bucket.
# Run this script to process all the logs in the subdirs, creating a HTML report
# for each CloudFront distribution.

for d in */; do
cfdist="${d%?}"
echo "$cfdist"
gunzip -c "$cfdist"/*.gz | goaccess -a –time-format %H:%M:%S –date-format %Y-%m-%d –log-format %d\t%t\t%^\t%b\t%h\t%m\t%^\t%r\t%s\t%R\t%u\t%^ > $cfdist.html
done

Tagged with: , , ,

Storage reduction

4gb hard drive next to 64gb microsd card

Storage Reduction

I’ve been going through my boxes of stuff I’ve collected over the years. And here’s an example of how technology has progressed – on the left is a 3.5″ IDE hard drive with a capacity of 4gb. The orange thing on the right is a 64gb micro SD card.

Tagged with: , , , , , ,

Create and serve a Zip archive from within DropWizard

Zip by Stefano Mortellaro

Zip by Stefano Mortellaro

Do you want your DropWizard app to create and serve a zip archive to users? If you’ve got a lot of data then you should periodically create an archive and store it on a CDN for people to download. But if you’ve got a small amount of data, then here’s some code to do it.

Read more ›

Tagged with: , ,

Updated my HTML Validator

I’ve been procrastinating on my HTML Validator project. But no fear – I’ve now released v2.0.0.

Version 2 uses w3.org’s new HTML checker (it all changed when I wasn’t looking!), and I’ve modified it so it’s more suitable for use as an automated check. Specifically, you can specify a set of URLs as command line options, and it returns an error code if errors were detected (so you could fail an automated build for instance).

If you’re after more complicated behaviour (such as logging in before navigating to a page), fork the code and change the Selenium parts.

Head on over to GitHub to get it.

Tagged with: , , , ,

Interprocess Akka

Akka allows for interprocess communication (be it on the same machine or elsewhere).

Read more ›

Tagged with: , , ,

Quick demo of Akka

Akka helps develop concurrent and scalable systems using a message-passing mechanism. It supports Scala and Java and there’s also an Akka.NET project. I’m investigating it to see how well it works when you have hundreds or thousands of workers in an application. There’s been some demonstrations on using it with the Google Compute Engine too. But for now, I’ve got a simple console application which runs locally as an introduction.

Read more ›

Tagged with: ,
Top