Category Archives: Computers

Clean Code

Clean code is code that looks like it was written by someone who cares. Software is meant to be soft – changeable, malleable. Well architected code is easy to change. Not every change takes 6 months. Software is about two … Continue reading

Posted in Computers, programming, Software | Leave a comment

Authenticating to Google Cloud SQL with IAM Credentials

Cloud SQL is a managed service in GCP where Google will run and manage MySQL, Postgres or SQL Server for you. A user can authenticate to Cloud SQL in two ways: Using IAM has few advantages I believe. Say you … Continue reading

Posted in Computers, programming, Software | Tagged , , | Leave a comment

How to read/write HDF5 files in Java

there are 2 things you need for this: WARNING: You will need JDK 20 because the Java wrapper has been compiled with JDK 20 (when I wrote this blog post). If you have earlier version of JDK you will get … Continue reading

Posted in Computers, programming, Software | Tagged , | 1 Comment

How to stop postgres server on MacOS

This post describes how I was able to stop pg 14 server on macos that I installed from EDB website. The commonly described solution is to use brew but that did not work for me. E.g., when I ran following … Continue reading

Posted in Computers, programming, Software | Tagged | Leave a comment

Postgres timestamp without time zone vs. timestamp with time zone

the difference between these two is nicely illustrated by below example: What it means: timestamp without time zone ignores any time zone offset specified when inserting data. So it doesn’t matter whether you are inserting ‘2011-01-01 00:00:00+03’ or ‘2011-01-01 00:00:00-03’. … Continue reading

Posted in Computers, programming, Software | Tagged | Leave a comment

TypeScript: Pros and Cons

TypeScript is a popular language these days and a hugely successful project as evidenced in latest SO Developer Survey. Another feather in the cap for Anders Hejlsberg for whom I have great respect. I myself make my team use it … Continue reading

Posted in Computers, programming, Software | Tagged | Leave a comment

How to read/write HDF5 files in C#

There are 2 things you need for this: I won’t go into details of .net installation. Let’s get started. The HDF5 library can be installed on Mac in two ways: Method 1: Using brew (I don’t recommend it). sample install … Continue reading

Posted in Computers, programming, Software | Tagged , | Leave a comment

Testing MySQL SERIALIZABLE Isolation Level

This post illustrates testing MySQL’s (version 8.0.30 was used in the tests) SERIALIZABLE with the 3 examples given on Postgres wiki. Black and White MySQL handles this correctly. Below is the sequence of events: In summary, the second transaction is … Continue reading

Posted in Computers, programming, Software | Tagged | Leave a comment

Illustrating write skew in Postgres with Repeatable Read (Snapshot Isolation)

In this post we will see write skew in action using Node.js, Postgres and Sequelize. We will use the example given in wikipedia where there are two accounts (tables) V1 and V2 with a single balance column. The tables are … Continue reading

Posted in Computers, programming, Software | Tagged , , | Leave a comment

Handling Postgres Serialization errors in Sequelize

When using the REPEATABLE READ or SERIALIZABLE isolation levels, you should be prepared to handle serialization (error code 40001) and deadlock failures (error code 40P01) in your code. Well this is how you do it: where That’s it for this … Continue reading

Posted in Computers, programming, Software | Tagged , | Leave a comment