a tumblelog
week 34, 2020

Usage of the Heap Data Structure in Go (Golang), with Examples

Heap is one of the powerful data structures, which optimizes the access to minimum or maximum value within a collection. In this post, we will go over the main characteristics of the data structure itself and understand how we can make use of it with Go (Golang) programming language with the usage heap package from the base library of Go.

Source: Usage of the Heap Data Structure in Go (Golang), with Examples, an article by Tugberk Ugurlu.

Common Python Packaging Mistakes

I think we can all agree that packaging a Python project is harder than it should be. With numerous guides & tutorials out there, people still make mistakes. Some of these mistakes break a project, some just make it less attractive, and some even cause a project to step on the toes of other projects.

As the admin of the wheel-analysis and -browsing site Wheelodex, I see a number of poorly-built wheels each morning as I peruse the day’s new entries. This eventually motivated me to create check-wheel-contents — a program for scanning a wheel for many of the below problems plus several others — in an attempt to get people to clean up their wheels, yet still the poorly-packaged projects persist.

In yet another attempt to get people to fix their broken packages, here now are some of the more frequent types of mistakes I see — along with advice on how to avoid & correct them — in no particular order.

Source: Common Python Packaging Mistakes, an article by John T. Wodder II.

Metaprogramming with Proxies

Proxies enable us to intercept and customize operations performed on objects (such as getting properties). They are a metaprogramming feature.

Source: Metaprogramming with Proxies an article Dr. Axel Rauschmayer

Writing better Code

In Joel Spolsky’s blog post “The Joel Test: 12 Steps to better Code”, he describes a test composed of twelve simple yes-no questions. For a yes you get one point. 10 points are acceptable and 12 are perfect. If you have less than 10 points, you will get in trouble with your software – sooner or later.

Source: Writing better Code, an article by Daniel Gerlach.

Paper: A fork() in the road

A review of Baumann et.als paper on limitations of the fork system call present in UNIX operating systems.

Source: Paper: A fork() in the road, an article by Daniel Näslund.

Thoughts on macOS Package Managers

A couple of months ago, I uninstalled Homebrew and migrated my configuration to MacPorts. I’ve been doing a lot of thinking about the state of package management on macOS, and here’s what I’ve come up with based on my experiences using both and interacting with their development communities.

Source: Thoughts on macOS Package Managers, an article by Saagar Jha.

Dynamic SSL Certificate Storage in HAProxy

When you route traffic through an HAProxy load balancer, you gain the ability to terminate SSL at the load balancer. HAProxy encrypts communication between the client and itself and then sends the decrypted messages to your backend servers, which means less CPU work on the servers because there’s no encryption work left to do. HAProxy adds extra SSL functionality too including SNI for choosing the right certificate, ALPN for negotiating the application protocol, OCSP stapling for prefetching certificate revocation statuses, and settings for disabling obsolete versions of SSL and TLS.

Source: Dynamic SSL Certificate Storage in HAProxy, an article by Nick Ramirez.

(Very) Basic Intro to Lattices in Cryptography

Lattice-based cryptography has been coming into the spotlight recently. In January 2019, Many of the semifinalists in the NIST post-quantum-cryptography competition were based on lattices. Lattice based cryptography has promising aspects that make it a contender for the basis of cryptographic security in a post-quantum world.

Source: (Very) Basic Intro to Lattices in Cryptography, an article by Lane Wagner.

What's New In DevTools (Chrome 86)

  • New Media panel
  • Capture node screenshots via Elements panel context menu
  • Issues tab updates
  • Emulate missing local fonts
  • Emulate inactive users
  • Emulate prefers-reduced-data
  • Support for new JavaScript features
  • Lighthouse 6.2 in the Lighthouse panel
  • Deprecation of “other origins” listing in the Service Workers pane
  • Show coverage summary for filtered items
  • New frame detailed view in Application panel
    • Frame details for opened windows
  • Elements and Network panel updates
    • Accessible color suggestions in the Styles pane
    • Human-readable X-Client-Data header values in the Network panel
    • Auto-complete custom fonts in the Styles pane
    • Consistently display resource type in Network panel
    • Clear buttons in the Elements and Network panels

Source: What's New In DevTools (Chrome 86), an article by Jecelyn Yeen.

A deep dive into the official Docker image for Python

The official Python image for Docker is quite popular, and in fact I recommend one of its variations as a base image. But many people don’t quite understand what it does, which can lead to confusion and brokenness.

In this post I will therefore go over how it’s constructed, why it’s useful, how to use it correctly, as well as its limitations. In particular, I’ll be reading through the python:3.8-slim-buster variant, as of August 19, 2020, and explaining it as I go along.

Source: A deep dive into the official Docker image for Python, an article by Itamar Turner-Trauring.

Analyzing Python Code with Python

One of the special things about software engineering as a profession is the possibility of ars-poetic work: part of our work is building tools that target our own work; perhaps a few surgeons around the globe can design and meld their own scalpel, but for software engineers building our own tooling is a day to day reality.

Source: Analyzing Python Code with Python, an article by Rotem Tamir.

React.js cheatsheet

React is a JavaScript library for building user interfaces. This guide targets React v15 to v16.

Source: React.js cheatsheet.

Python Knowledge Graph: Understanding Semantic Relationships

Knowledge Graphs are very powerful NLP tools and advanced studies in the field of Knowledge Graphs have created awesome products that are used by milions of people everyday: think of Google, Youtube, Pinterest, they are all very important companies in this field and their knowledge graphs results are spectacular to analyze and use.

Source: Python Knowledge Graph: Understanding Semantic Relationships, an article by Marius Borcan.

An Easy to Understand Monad Guide

Monads are a powerful construct that can make your code safer and easier to understand. Still, a proliferation of Monad tutorials that try to build up to them from other Functional Programming concepts makes what is otherwise a simple concept difficult to understand.

Source: An Easy to Understand Monad Guide, an article by Aaron Meltzer.

Haskell mini-patterns handbook

This blog post contains a structured collection of some programming mini-patterns in Haskell with the detailed description and examples, some small “quality of life” improvements that would help everyone on their developer journey.

Source: Haskell mini-patterns handbook, an article by Dmitrii Kovanikov and Veronika Romashkina.

Implementing traceroute in Go

If you’ve fiddled with networks you must be familiar with the famous traceroute tool. Its a script that traces the path to a host and prints info on every hop it encounters.

Source: Implementing traceroute in Go, an article by Lakshay Kalbhor.

Container processes shouldn't run as root!

Docker containers, and containers as a whole, are really just a regular program wrapped in some extra protections provided by the kernel (namely cgroups etc) to create isolation, and other interesting features.

Unlike VMs, containers run closer to the host operating system, so close they use the same kernel, meaning it’s even more important to protect it.

Source: Container processes shouldn't run as root!, an article by Jake Howard.

An Introduction to Functional Design

Functional programming doesn’t need to be complex, confusing, or theoretical.

Instead, functional programming can be simple, natural, and practical, helping you solve problems with more power and more joy than ever before.

A key to unlocking this potential is understanding functional design, a framework for applying functional programming to real world problems that I have been teaching at Ziverge as well as on my Patreon mentorship program.

Source: An Introduction to Functional Design, an article by John A De Goes.

tumblelog has been added to StaticGen

Last Saturday I noticed that my pull request (833) to add both versions of tumblelog to StaticGen had been merged.

tumblelog entries on StaticGen
tumblelog entries on StaticGen.

I am very happy to have tumblelog added to StaticGen. Today I noticed that already one visitor had visited the GitHub repository of tumblelog via the StaticGen website.

Description page for the Perl version of tumblelog
Description page for the Perl version of tumblelog.

Thank you Zach Leatherman for the merge!

Understanding recursive queries in PostgreSQL

Many people consider recursive queries a difficult topic. Still, they enable you to do things that would otherwise be impossible in SQL.

This articles gives a simple introduction with examples and shows the differences to Oracle’s implementation of recursive queries.

Source: Recursive queries in PostgreSQL, an article by Laurenz Albe.

Why I switched from Vim to Emacs

I have been a loyal Vim user since, well, I don't even remember any longer. Over the years, I tried other editors, but Vim commands and keyboard shortcuts are second nature to me, so much so that I ended up doing :w every time I wanted to save in another application. So, for a long time, I stuck with Vim for all my note-taking and writing. By combining Vim with Markdown syntax, I could easily export my notes to any format for other uses or sharing with my colleagues.

I've always enjoyed working in a terminal, but I usually needed other applications for my email, calendar, and tracking the time I spend on various tasks, which I like to do for numerous reasons. I tried different cloud solutions, kanban boards, and email clients, but I kept looking for a way to do it all in a terminal. I tried some great projects for time tracking and kanban on the command line—but there was always something missing in my workflow. That is until I read an article about using Org mode in Emacs.

I had tried Emacs before and found out there are even more commands and keyboard combinations to keep track of in Emacs than Vim! However, every time I read an article explaining different ways to use Org mode, it seemed like Emacs was the solution I was looking for. So I made another venture into the world of Emacs.

Source: Why I switched from Vim to Emacs, an article by Jimmy Sjölund.