Midnight strikes, I lose the wager, woken by a screeching pager, Scarlet hue means issue’s major, major OOMing on the node. SSH into the victim, tail and grep per playbook’s dictum, ‘Til revealed is cache eviction as what crumbled ‘neath the load. Run a dump of heap and threading, start the steps for shedding load. Who hath merged this wretched code? Bleary eyes see…
Much of Scala’s power comes from its flexibility and generality as a language. You can mold it quite extensively to suit your particular problem domain or coding style. The downside of this is that Scala can sometimes be permissive and accommodating to a fault. You often hear Haskell or F# users attest to a sense of “if it compiles, it works” – in my experience this is not…
I’m happy to publicize a little project I’ve been working on recently: 1Poshword , a PowerShell client for the 1Password password manager. Code is available at https://github.com/latkin/1poshword . You can read the full details in the project README, but I’ve included the demo screencast and basic bullets below. Cross-platform (Windows/OSX/Linux, PowerShell v3.0+) agilekeychain…
There is a page in the Hugo documentation that describes how to use MathJax to embed nicely-typeset mathematics in one’s Hugo-generated site. For my own site, I took this as a starting point and made a few improvements. Here’s how I do the math typesetting in this blog. Authoring I author my posts in Markdown, where the bulk of the content is plain text. When I want to include…
This is a bug/curiosity in PowerShell that I stumbled upon a few years ago, but never wrote up. The behavior hasn’t changed significantly in the intervening verions, so now I’m finally getting around to a quick blog post. Here’s a chart detailing the runtime of 4 different PowerShell approaches to de-duplicate a collection - i.e. filter an input collection to just its unique…
As part of the small minority of devs at my company who primarily run Windows, I’m accustomed to working around occasional Unix-specific behaviors in our build and deployment systems. Cygwin makes most stuff just work, I can fix simple incompatibilities myself, and as a last resort I can always boot into OSX for a while if needed. One oddity that took me quite some time to diagnose, though,…
This blog started on wordpress.com back in February of 2012, then in November 2013 I moved it to a hosted WordPress.org site here at latkin.org . WordPress is quite nice, but it seemed like it was a bit heavyweight given my very basic needs. I’ve wanted to slim down the site and get more hands-on for a while, now. Over the past few weeks, I’ve been migrating the entire blog to the Hugo…
It’s pretty straightforward to do basic benchmarking of a single, self-contained piece of code in .NET. You just make a Stopwatch sandwich ( let sw = Stopwatch.StartNew(); <code goes here>; sw.Stop() ), then read off the elapsed time from the Stopwatch. What about measuring the throughput of a data pipeline? In this case one is less interested in timing a single block of code from start to…
I’ve recently had reason to do a bit of work with JNI . Throughout the course of this work I had to do quite a lot of Googling in order to figure out how to properly manage the caching of various JNI objects used by my C++ code. Some JNI objects can be safely cached and re-used at any point, while others have limited lifetimes and require special handling. Obtaining JNI objects through JNI…
Pentago is a favorite board game of mine, which I used to play regularly with coworkers during lunch (and occasionally during not-lunch). The rules are very simple, and casual games can be played in just a few minutes, but it’s deep enough to still be satisfying if you’re willing to put some thought into your strategy. In 2009 I wrote a computer player for Pentago in C#, and even…
The near-complete obviation of nulls is perhaps the most frequently- (and hilariously- ) cited benefit of working in F#, as compared to C#. Nulls certainly still exist in F#, but as a practical matter it really is quite rare that they need to be considered explicitly within an all-F# codebase. It turns out this cuts both ways. On those infrequent occasions where one does need to check for nulls,…
Working on the command line with Powershell, much of the time I have the luxury of dealing directly with rich .NET objects. If I need to sort, filter, or otherwise process cmdlet output, I have easy access to typed properties and methods right at the prompt. Often, though, I’ll need to wrangle plain text, perhaps from a log file or the output of an executable. In these cases an intermediate…
5 years ago today, I sent the following bug report to the Powershell team. From: Lincoln Atkinson Sent: Thursday, April 01, 2010 10:33 PM To: PowerShell Discussions Subject: Problem with get-date Hey experts, maybe you can help me with this issue. Get-Date seems totally broken for me. I've tried it multiple times with all different parameters, but it's just not working in my environment. I'm still…
For Christmas this year, I got myself a fun mathematical gift: a set of 10 non-transitive dice , namely Grime Dice ! You can get your own set here . Behold their dicey splendor: These dice possess the fascinating property that their winning relationships (in the sense of “winning” = “rolls a higher number > 50% of the time”) are non-transitive. i.e. if die A wins against…
By now, most everyone is aware of Pi Day , celebrating the famous mathematical constant on 3 ⁄ 14 . On this day each year, students and math enthusiasts eat pie and engage in light-hearted -related activities. Then there is e Day , a day for commemorating the equally-important-if-somewhat-less-famous constant on 2 ⁄ 7 . The activities are similar, though it’s less clear-cut what…