I recently wanted to ingest a line-delimited JSON file into Postgres for some quick data exploration. I was surprised when I couldn’t find a simple CLI solution that parsed the JSON and loaded each field into its own column. Every approach I found instead inserted the entire JSON object in a JSONB field. Here is my solution.
Postgres introduced the JSONB type in version 9.4 with considerable excitement. JSONB promised to marry a favorite relational database with the noSQL world, permitting data to be stored in the database as JSON without the need for re-parsing whenever a field is accessed. Moreover, the binary storage format permits indexing and complex queries against the stored JSON blobs. This data format embodies the flexible schema and was readily adopted at Fraight.
Two months ago I purchased a GPS device and associated service plan from SPOT. Today, upon trying to cancel the service, the customer service representative informed me that I had accidentally enrolled myself into a 1 year, $250 contract and that I was unable to cancel. He told me that if I blocked the monthly charges against my credit card that they would report the debt to a collections agency. I was initially upset but soon realized it was a great opportunity to talk about ethics in software engineering.
The other day at work, one of my colleagues was frustrated that he was unable to encode nested objects in a query string and still maintain a readable URL. I went home that night and coded up a simple solution to this problem, and I thought I’d share it here today. This Github repo contains specs and the solution code.
I’ve conducted about 100 technical interviews over the past 6 months for a software development recruiting company called Triplebyte. I’ve also been doing consulting work, which has required me to take numerous technical interviews. It’s interesting contrasting the experiences to identify what works and what doesn’t.
Every Triplebyte interview begins with the candidate coding a short game. We have a series of steps, and each step precisely defines simple requirements for the program to handle. I can generally tell a couple minutes into the 2 hour interview whether the candidate will be successful. There are certainly outliers (as well as mechanisms to prevent bias), but in general, I can quickly ascertain how well a candidate stacks up technically. So then, it begs the question, why is it so hard to hire engineers? The answer is, most of us are doing it wrong.
I’m currently contracted to create a web service using some data from a third party Angular application. I worked off a proof of concept codebase that used Chrome’s new Puppeteer API to scrape this site. I strongly regret not starting from scratch.
I posted my article Build Your Own Regex Engine on Reddit the other day, and one of the commenters claimed that the implementation should be trivial to break. Since I had already tested my program against a customized suite of tests, the remark got me thinking about how I could further increase my confidence in the correctness of my program. One extremely low cost however effective strategy for identifying faults in software is known as fuzzing.
A client approached me with a puzzling problem:
At Fraight, we have an omnisearch interface backed by an Elasticsearch datastore. The interface allows users yo type a freetext query and get a list of database records sorted by relevancy. At it’s core, this is a simple problem: if the user types in
Joe, return all people whose name contains the word
Joe. And indeed, returning all the
Joe's in the system is trivial; the problem is that we worked hundreds, possibly even thousands of
Joes. How do we identify the particular
Joe that we care about?
My inspiration for this blog post came from this video where Dan Abramov walks through the source code to react-redux
As frontend web developers, it’s not uncommon that we follow well-specified patterns - often blindly. The frontend landscape is changing rapidly, and sometimes there isn’t time to investigate why we use a specific pattern; we just know we should.
One widely used pattern in react-redux applications looks like this
I’ll assume you know how to implement this pattern, but why do we use it and how does it work under the hood?