Tableau via PowerShell, Part 2: Saving Changes

This is part 2 of my mini-series on exploring Tableau workbooks with PowerShell. If you missed it, you should read Part 1: Opening Workbooks, before continuing.

Welcome back! Last time I showed you how to open a Tableau workbook (TWB or TWBX) in PowerShell so you could start exploring the raw XML. Today I’ll show the next logical thing, saving the changes you make.

If you are only opening TWB files, then saving your changes couldn’t be easier. Since TWBs are just XML files we can simply write it to a file, like so.

Continue reading

Go Beginners: Iota Enumerations

Enum constants in Go have a super power. As opposed to C# where you only have two options for enums, either you assign each value yourself or let the compiler increment each value by one, Go has a third option.

Auto-incremented enum in C#

enum Example
{
     One = 1,
     Two,
     Three
}

Go’s third option is that you can make use of repeating expressions. This works because of Go’s iota enumerator. The best example can by found in the Effective Go docs.

Continue reading

Tableau via PowerShell, Part 1: Opening Workbooks

In this mini-series I’m going to show you some cookbook style examples for using PowerShell to explore your Tableau workbooks. Follow along, this is going to be fun!

Tableau workbooks (TWB files) are just XML files. Packaged workbooks (TWBX files) are just ZIP files that contain a TWB and various assets, like data extracts for example.

This is wonderful because it means it is very easy to go spelunking through workbook files without a guide.

Continue reading

ERRORLEVEL is not %ERRORLEVEL%

DO use IF ERRORLEVEL 1 ECHO error level is 1 or more to check for errors in your batch/command line scripts.

DO NOT use IF %ERRORLEVEL% NEQ 0 ECHO error level is not equal to 0.

Most of the time %ERRORLEVEL% will be what you expect but it isn’t guaranteed. %ERRORLEVEL% is simply an environment variable like any other. It just happens to fallback to returning the ERRORLEVEL value if an environment variable with that name isn’t defined.

Continue reading

First Steps in Go: A Scoreboard App

Mostly I just read about new programming languages. Call it a hobby. Only once in awhile am I struck with enough interest to want to try something out on a real project. Go is the most recent of such interests. As someone who loves a lot about Node.js, I’m looking forward to seeing how Go compares and whether it solves my Node and JavaScript pain points.

Scores is my first app in Go. It is a very simple scoreboard app for “tracking personal records between friends”. You define a record like “max push-ups” and you create a scoreboard for it. The scoreboard is specific to your group of friends or “team”.

Continue reading

Does your business need a website?

A friend got me thinking about this today. Does a business' website design matter? Does a business even need a website?

The answer strongly depends on the type of business we are talking about. If the business offers digital services of any kind, then obviously they need a website and their design is going to play a huge role in their success. The real interesting discussion begins when we talk about brick and mortar businesses that don't offer any digital services.

Continue reading

Initiation into mechanical keyboard geekdom

A laptop style short keyed keyboard has been my instrument of choice for years now. They are easy to type on and fast. I gave up the stock Dell keyboards years ago for a bare bones Logitech.

Old Logitech keyboard

A few months ago I started digging into mechanical keyboards. They had caught my attention and suddenly I really wanted one. I was ready for a new keyboard, as you can see my Logitech is positively filthy. Why clean it when you can buy a new one, right?

Continue reading

Non-enumerable properties in JavaScript

It isn’t very common in the wild but JavaScript (as of ES5) does support non-enumerable properties. That is to say, objects can have properties that don’t show up when you do a for...in loop over the object or use Object.keys() to get an array of property names.

I spent way too long tonight figuring out why a property was not being included in the JSON.stringify() output because I didn’t remember that this was possible. You see, stringify() works by enumerating the object’s properties. So it makes sense that non-enumerable properties would be ignored.

Continue reading

Substack's philosophy of small things

Those of you who follow the Node.js community at all will recognize substack as one of the most prolific package authors on NPM. You have probably also picked up on the fact that he is a big fan of small packages.

I ran across this interview the other day and I think substack communicates his “small things” philosophy well. Simply put, the UNIX philosophy works. Do one thing, do it well, and it will stand the test of time.

Continue reading

Google Chrome and WOFF font MIME type warnings

If you are getting warnings like Resource interpreted as Font but transferred with MIME type font/x-woff in Google Chrome then it means your web server is serving the font with the wrong MIME type.

It took awhile for the WOFF font format to get an approved MIME type so there are several variations hanging around.

  • font/x-woff
  • font/woff
  • application/x-font-woff

Thank God an official type was finally decided on, application/font-woff.

Unfortunately, Google Chrome (as of 26 beta) still expects you to use application/x-font-woff and doesn’t recognize application/font-woff as a valid MIME type. This has been fixed in the WebKit trunk but hasn’t been merged into Chrome yet. The Chromium bug report has been closed so it should be coming soon.

Continue reading