Golang “Set” Data Structure Example

Golang does not have built it sets. Basic functionality can be mimicked using maps with empty struct{}. Another option is to use a Boolean value, but empty struct does not use any space and therefore more efficient. Another benefit of empty struct is that Boolean value can be set to true or false, which could … Read more

Work Hard and Advertise

I recently watched the following speech by Arnold Schwarzenegger: It had a lot of good points, but one quote by Ted Turner really stood out for me: Early to bed, early to rise, work like hell, and advertise Mr. Schwarzenegger then went on to explain the meaning of the second half of this quote. It’s … Read more

One Year Without Self-Promotion

One year ago I decided to stop self-promoting this blog. Previously I would spend a lot of time submitting my links to Social Media sites such as Hacker News and Reddit. It was taking up a lot of my time and attention. I even got a warning from Hacker News admin for repeatedly submitting links … Read more

Group Log Data by Timestamp in Python with Pandas

I often find myself with logs in the following format, exported in CSV. First column is timestamp in milliseconds, second column is timing for some request, also in milliseconds. Often I’d like to see the min, max and average request time, group by day and hour. Here is how to get this insight using Pandas … Read more

Attach Remote Debugger to Jar File and Scala REPL

I was investigating a bug that would only happen in production and wanted to attach a debugger to a particular workflow. I could have run the entire application and attached remotely, via: In my case, I wanted to invoke a specific method and see what happens via Scala REPL. Turns out it’s pretty easy to … Read more

How to Rollback WordPress 5 to older version

Update: 2021 I am now happily using new editor I usually update my WordPress as soon as I can for security reasons. I tried WordPress 5 and I did not like it. My main complain is that I write in WordPress using Markdown and it is not well supported in WordPress 5. My posts were … Read more

Adding Ammonite REPL to Scala For Ad Hoc Testing

Ammonite is an interactive REPL for Scala, kind of like ipython is for Python. I usually use IntelliJ IDE for Scala (which has a REPL and debugger among other things). Ammonite is great replacement though, when I don’t want to start up full blown IDE. It’s really easy to get started with Ammonite. First it … Read more

Analyzing 200,000 Deleted Tweets with Spark, 40 Billion Comparisons

My wife and I were watching Jack Ryan, where John Krasinski is playing an FBI analyst. I wanted to be like him, so I began to look for things to analyze. In the past I’ve done text analysis for comments left on Mark Zuckerbergs Facebook post, which I described in I Tried To Virtually Stalk … Read more