{code that works}

by Sadique Ali

Looking up Enum types and values in Postgres

Posted on Thu, May 9, 2019

In this blog post, we will explore how Postgres stores Enum types and how to query for Enum types and their values. Postgres’ Enum, like their counterparts in many programming languags are data types that allow only a predefined set of values to be assigned to them. An interesting difference is that compared to programming languages, Postgres does allow blanks within the values of Enums.

Viewing Sequence ownership information in Postgres

Posted on Tue, May 7, 2019

This blog post is an exercise in identifying all the sequences in a PostgreSQL database that is associated with a table column via an OWNED BY relationship. Figuring out how to do this was harder than it should have been and this journals my understanding of it.

Understanding trailing @ processing in SAS input

Posted on Sat, Mar 23, 2019

One of the first things I noticed when I started poking around in SAS code is that the input statement is very powerful, flexible and hence sometimes hard to understand. It can read pretty much anything in to a dataset as long as you tell it what to do. The use of trailing @s to take control of how SAS advances the input pointer is a powerful technique to read from input files where the data is laid out in non-standard formats.

Importing the SASUSER datasets in SAS Studio

Posted on Sat, Mar 23, 2019

I have been playing around with SAS for the last two weeks. I started with a SAS University Edition running on a VirtualBox instance on my MacBook, but soon realized that it was way more convenient to use a SAS OnDemand account. Having made the switch, I realized that all learning materials made references to and used examples with datsets from a library named SASUSER. It was not clear how to get these datasets and use them in SAS Studio.

My talk at GraphQL Summit 2018

Posted on Sat, Nov 10, 2018

I had the opportunity to give a talk at GraphQL Summit 2018 about the experience of introducing GraphQL for our Payments API at Braintree. It was well received, as far as I could tell - I received a lot of nice feedback and had great conversations with members of the community. The slides are available here on SpeakerDeck. I will update this post with links to the video of my talk when it becomes available.

Formatting Java Instant for resolutions

Posted on Sat, Jun 9, 2018

I have had to look up how to format Java’s Instant with a given resolution - for example in microseconds or nanoseconds. After fiddling with various formatters, I was happy to finally get this right.

FreeBuilder plugin for IntelliJ

Posted on Sat, May 5, 2018

My work uses FreeBuilder extensively to generate the Builder pattern for Java classes. In addition to this, we use the generated Builder classes to deserialize the data calsses using Jackson. After a while it became tiresome to type @FreeBuilder and class Builder extends ... everywhere. So I decided to write and IntelliJ IDEA plugin that does it for me.

Command line clients for gRPC - polyglot

Posted on Fri, Apr 6, 2018

Polyglot was the second gRPC client that I looked at. One of the things that I liked about it is the fact that it does not need users to generate protoset files. It generates the protoset files in flight every time it runs. This, combined with the fact that it is written in Java does have a disadvantage - every time the client makes a call, it has to fire up a JVM, generate protosets and make the request.

Command line clients for gRPC - grpcurl

Posted on Wed, Apr 4, 2018

We are in the middle of considering replacing JSON over HTTP with gRPC for communication between our internal services. One of my concerns about this was how we would be able to debug and poke around things in a world where we will no longer be able to use cURL. I have been looking at cURL like command line utilities we can use to replace most of the capabilities, if not all of cURL. So far, I have looked at grpcurl, grpc_cli and polyglot .In these blog posts, we will try and compare these tools.

A Jackson and FreeBuilder quirk

Posted on Fri, Mar 23, 2018

Jackson is a great tool to have in your tool set if you deal with JSON or XML. It facilitates easy serialization and de-serialization to and from Java classes with a convenient annotation based interface. With the same set of annotations, we can achieve both XML and JSON serialization and de-serialization. With Jackson’s data-format-xml it is even possible to give the same Class a different JSON and XML representation.