Personal Programming Notes

To err is human; to debug, divine.

WITH Clause in SQL

I am pleasantly surprised that Vertica SQL supports WITH clause, as documented here. WITH syntax as a standard is only defined in SQL-99, also called Common Table Expressions. Therefore, I do not usually expect WITH clause since it is a fairly recent feature in most SQL dialects. For example: WITH clause support is only added into SQLite since Feb 2014.

In summary, the WITH clause allows us to arrange sub-queries in a SQL query in order of human logic. This will make our query much easier to read: we can read from top to bottom like reading a story (i.e., literate programming).

Mocking Current Date and Time in Python

In this post, we looks into unit testing some calendar utilities in Python. A requirement for unit testing those is to “mock” current date and time, i.e., overriding those returned by today and now methods with some specific date values (e.g., a date in future).

AWS: Developing With Amazon S3

Amazon Simple Storage Service or S3 is a simple, scalable web services to store and retrieve data. This post talks about basic concepts of buckets and objects in S3, basic and advanced operations on objects in S3, and standard development considerations when working with S3 using SDK.

AWS: Overview of Services

Amazon Web Services (AWS) is a collection of web services that deliver computing resources (hardware and software) to end-users over the Internet. Not all AWS are equal but for AWS beginners, we usually don’t know which are more important and which are secondary, supporting services. Personally, I am initially overwhelmed by the number of services offered as well as large amount of documentation associated with each service.

This post documents my understanding on some key AWS services and concepts. In this post, AWS concepts and services can be divided into layers. Those layers, from bottom up, are:

  • AWS Infrastructure: Physical data centers and physical network connections.
  • Infrastructure Services (IaaS).
  • Platform Services (PaaS).