week 08, 2021

Troubleshooting a stuck process

I was recently troubleshooting an issue where a process seemed to be stuck, not making any progress. Eventually I was able to track down the problem, but along the way I found a few quick ways to start gathering information about a running process.

Source: Troubleshooting a stuck process, an article by Josh Mcguigan.

Creating serendipity with Python

We've been experimenting with breaking up employees into random groups (of size 4) and setting up video hangouts between them. We're doing this to replace the serendipitous meetings that sometimes occur around coffee machines, in lunch lines or while waiting for the printer. And also, we just want people to get to know each other.

Which lead to me writing some code. The core of which is divide n elements into groups of at least size g minimizing the size of each group. So, suppose an office has 15 employees in it then it would be divided into three groups of sizes 5, 5, 5; if an office had 16 employees it would be 4, 4, 4, 4; if it had 17 employees it would be 4, 4, 4, 5 and so on.

Source: Creating serendipity with Python, an article by John Graham-Cumming.

PureScript and Haskell

In this post I’ll compare and contrast my experiences writing the same program in Haskell and PureScript. The application I built was “real” enough to have some interesting design challenges. They included:

  • Exposing an HTTP endpoint
  • Parsing and generating JSON
  • Full-text search

Source: PureScript and Haskell, an article by Drew Olson.

An Interactive Guide to CSS Transitions

The world of web animations has become a sprawling jungle of tools and technologies. Libraries like GSAP and Framer Motion and React Spring have sprung up to help us add motion to the DOM.

The most fundamental and critical piece, though, is the humble CSS transition. It's the first animation tool that most front-end devs learn, and it's a workhorse. Even the most grizzled, weathered animation veterans still reach for this tool often.

There's a surprising amount of depth to this topic. In this tutorial, we'll dig in and learn a bit more about CSS transitions, and how we can use them to create lush, polished animations.

Source: CSS transitions and hover animations, an interactive guide, an article by Joshua Comeau.

Contexts and structs

In many Go APIs, especially modern ones, the first argument to functions and methods is often context.Context. Context provides a means of transmitting deadlines, caller cancellations, and other request-scoped values across API boundaries and between processes. It is often used when a library interacts — directly or transitively — with remote servers, such as databases, APIs, and the like.

Source: Contexts and structs, an article by Jean de Klerk and Matt T. Proud.

Stop Using Icon Fonts

The introduction of the @font-face CSS at-rule allowed web designers to specify custom fonts with which to display text. By 2011, all major browsers supported it. This gave birth to the idea that fonts composed of pictograms, like Wingdings, could be used in place of raster images on the web. Considering that real SVG support across all major browsers didn't become stable until early 2020, icon fonts were the defacto way to add vector-based icons on your web site.

But icon fonts on the web were fundamentally flawed from the beginning. And now, with full SVG support at our disposal, it's time to put a stop to their use, once and for all.

Source: Stop Using Icon Fonts, an article by Michael Irigoyen.

How to manage your Linux command history

You probably know about using the up and down arrow keys to scroll through your Bash history, but did you know that there's a lot more to Bash history than just repeating commands? There is much more to the story. Or, should that be much more to the history? In either case, the history command is one of those obscure commands that is powerful and handy to know on at least a basic level. This article will take the mystery out of Bash history to make it a more friendly sysadmin tool.

Source: How to manage your Linux command history, an article by Ken Hess.

Fuzzy Name Matching in Postgres

A surprisingly common problem in both application development and analysis is: given an input name, find the database record it most likely refers to. It's common because databases of names and people are common, and it's a problem because names are a very irregular identifying token.

The page "Falsehoods Programmers Believe About Names" covers some of the ways names are hard to deal with in programming. This post will ignore most of those complexities, and deal with the problem of matching up loose user input to a database of names.

Source: Fuzzy Name Matching in Postgres, an article by Paul Ramsey.

With software development teams growing in size, many developers utilize static code analysis tools to mitigate code smells and find bugs and vulnerabilities. While code correctness cannot be automated, code quality maintenance can be made possible through these static code analysis tools. It helps Teams to identify bugs and anti-patterns in the early stage of development.

Static code analysis tools analyze the code on every commit or pull request and point out potential code-quality, security, and style issues before the reviewer points them out. In this article, we will be reviewing 7 of the renowned Python code review tools as your perfect fit, which will make your decision-making process easier for choosing the best one.

Source: 7 Best Python Code Review Tools Recommended by Developers, an article by Saif Sadiq.

So, You Want To Understand Monads?

I was just reading an article in which a poor soul was trying really hard to explain to the reader what a monad is and failing miserably because he himself did not truly understand it. Out of mostly a desire to help him, I thought it might make sense to write an article that allows people to understand the intuition behind monads first without going into crazy functional language syntax.

Source: So, You Want To Understand Monads?, an article by Anurag Mendhekar.

Git is my buddy: Effective Git as a solo developer

At this point, most developers use Git as a tool for collaboration. We have our rote-learned commands to pull, commit, and push. And of course, there's that one coworker who knows a bit more about Git than everyone else, who helps get us back on track whenever our local repos end up in a strange state.

But what if I told you that Git can be a valuable tool without ever setting up a remote repository? I'm not just talking about having a working version of your code base to roll back to if you mess something up, although there's that too. Used correctly, Git can help to structure your work, identifying gaps in your test coverage and minimizing dead code.

Source: Git is my buddy: Effective Git as a solo developer, an article by Mikkel Paulson.

The Pretty JSON Revolution

Wouldn't it be nice if more JSON tools supported a truly pretty JSON format? Demand options for truly pretty JSON now! Viva la revolucion!

If only it were that easy. JSON format has become wildly popular over the last decade easily passing XML as the format of choice. For us humans JSON is much easier to read than XML if the JSON is properly formatted. Sadly most tools for viewing or formating JSON seem to be stuck on one of two formats. One format is the single line format and the other is a simple expanded format. There are other options though with some tools.

One tool that offers more options is the oj application which is part of the golang OjG package. The oj application will be used to illustrate the range of JSON formats from the ugly up to the beauty of pretty JSON. Follow along and try out your favorite JSON sample on each step.

Source: The Pretty JSON Revolution, an article by Peter Ohler.

Go is not an easy language

Go is not an easy programming language. It is simple in many ways: the syntax is simple, most of the semantics are simple. But a language is more than just syntax; it’s about doing useful stuff. And doing useful stuff is not always easy in Go.

Source: Go is not an easy language, an article by Martin Tournoij.

JSON With Commas and Comments

JWCC is a minimal extension to the widely used JSON file format with (1) optional commas after the final element of arrays and objects and (2) C/C++ style comments. These two features make it more suitable for human-editable configuration files, without adding so many features that it’s incompatible with numerous other (deliberate and accidental) existing JSON extensions.

Source: JSON With Commas and Comments, an article by Nigel Tao.