02 Apr 2020

Is Cache-Control Header for Client or Server?

My little note on HTTP caching Where or how do we handle the caching? A (web) system have a lot of tier. Client-Side Caching Browsers cache the data in its local storage Intermediary Caching Intermediaries are something between client and server (RFC7230) like proxy or gateway. Cache mechanism is handled by Nginx, Varnish or another caching-proxy. Server-Side Caching Backends cache... Read More
17 Jul 2019

GoDoc Pattern

Today I just write more Go code than it should be. I just working with go framework called Typical-Go. It’s only beginning although already started a few months ago. In its process, I try to make a pattern to how to write good GoDoc, however, I think GoDoc should be flexible without restriction. So I abandon the idea but still... Read More
17 Jun 2019

Unit Testing using GIVEN-WHEN-THEN Template(Part 1: Introduction)

Writing a unit test sometimes is not easy and take more times than expected. One of the common methods to help in writing a good test is the Given-When-Then template. The template itself is part of Behavior-driven development (BDD). What is Unit Testing? “Unit” can be defined as the smallest complete part of something. In this case, “unit” is a... Read More
11 May 2019

2019 Resolution

“Year resolution in mid of May!?” Why not? Last two years is a tough year for me. Plan after plan. Disappointment to another disappointment. I never really ask anything for myself or anyone. I even never really expect something, just want to do my job best. But this year, I really want to be something different, to became a better... Read More
18 Apr 2019

Golang Json.Marshal() return null for empty slice

Today I found out that json.Marshal() weirdly return null for empty slice but make sense. var slice []string b, _ := json.Marshal(slice) fmt.Println(string(b)) // print `null` The workaround is to initiate empty slice using make() function. var slice []string slice = make([]string, 0) b, _ := json.Marshal(slice) fmt.Println(string(b)) // print `[]` I thought make() will make fixed length slice and... Read More
01 Apr 2019

Live on

Life means to be growing. The best way to grow is to make something. Something is not easy to make, You need motivation. The best motivation emerge when meeting people. Meet sincerely, engage with a clear mind Therefore be meditate always. When the sparks come out, don’t be doubt. Run… Fly… Catch it up with the whole body. But don’t... Read More
14 Sep 2018

Code for Living

From what’s I see, Information Technology is both massed and messed. It indeed solves many world problem, but it doesn’t mean any problems at all. In fact, it brings even more (other) problem. Information Technology became a single point of failure by itself. Trend after trend. Best practices keep coming to the plates like in a big buffet. How come... Read More
07 Aug 2018

Microservice Overview

The last couple of weeks is busy weeks (for some people) in our company because we conduct a series of workshop for undergraduate students. Apparently, I volunteer to give over one or two topics of knowledge sharing. One of the topics I brings is overview of microservices, a popular and fancy architecture.x So I would like to reshare here to... Read More
17 Jan 2018

Pairing and Test Driven

Information Technology is philosophical and full of opinion. You can’t tell what is right until it’s really not working. Design principle most likely a religion for some people. I have witness many of technical debate and sometimes as fierce as fight to death. And most common holistic practice today on development probably pair programming & TDD. No one dare it... Read More
25 Dec 2017

Ruby or Java or Golang

In our company, we adopt microservices architectural and it’s allowed us to decide our own programming language and technology stack. And these are 3 most chosen language: Ruby, Java, Golang. Which one is better for microservices? None. I always believe that choice of language and architecture design decision is subjective based on knowledge, experience and preference of developer. Even design... Read More
20 Dec 2017

Tree Walk Interpreter

“If you don’t know how compilers work, then you don’t know how computers work. If you’re not 100% sure whether you know how compilers work, then you don’t know how they work.” — Steve Yegge Like a fews week ago I did research about interpreter for some DSL project. However things happened, and I got crashed away from the project.... Read More
14 Dec 2017

RESTful Revisit

Sometimes I got opportunities to interview new candidate and I always asking “What is RESTful? What different between between RESTful and Non-RESTFul?” Surprisingly not many can explain it even though they already used it on their previous company. RESTful is one of style or architectural design for Web API. It’s stand of Representational State Transfer. Today RESTful become best practice... Read More
12 Dec 2017

Memory in Go

Few weeks ago I got opportunities on GoJakarta where I speak about basic concept on memory management, pointers and garbage collector. On first part, I give some briefing information of classic stack and heap allocation. Golang already have Escape Analysis and we can use that to check when variable move from stack to heap. The next part is pointers. I... Read More
15 Sep 2017

Dummy Query for Postgres

What I meant by dummy query is the query that doesn’t need table. This kind of query is may useful for unit testing. Query 1: This is working for most sql SELECT 'Anto' as name, 12 as age UNION SELECT 'Linda', 9 UNION SELECT 'Mike', 10 Query 2: SELECT * FROM (values ('Anto', 12),('Linda', 9), ('Mike', 10) ) AS q... Read More
13 Sep 2017

$JAVA_HOME without JDK

I try run some jar file on my user laptop and found that terminal java version is different with mac OS version. Downloading JRE is not helping because it’s not set environment variable $JAVA_HOME This instruction may help to set $JAVA_HOME without downloading JDK. Go to System Preference > Java Check or update your java version on Update tab On... Read More
27 Aug 2017

DBeaver and Byte Order Mark

So I got this csv file generated by dbeaver to trigger some automation task but my code can’t process it. The file is perfect until I open it on excel and I see this . So this is the culprit. Actually it’s quite famous and known as Byte Order Mark (BOM) Unicode text can optionally start with a byte order... Read More
25 Aug 2017

Use 'Actions' as Table Name

Naming is one of hard things in computer science and I TOTALLY AGREE. Not only make a good, descriptive and cool name is hard, but wrong name bring you bad luck. This is one of my rails story. I have entity (table/model/active record/whatever you called it) named as Suspension. This name not longer good make sense for our scope, so... Read More
23 Aug 2017

to_json VS JSON.parse()

One thing about ruby that I love (or hate) that we can literally read it aloud on conversation language and programmatically still working. 3.times do # something end However for handling json type, we should noted that "quoted text" actually valid json format therefore we can’t casually write s.to_json to convert text to json object but instead use JSON.parse() s... Read More
23 Aug 2017

Mustache & ENOENT

Failure/Error: request_body = Mustache.render(body,data) Errno::ENOENT: No such file or directory - ./mustache.mustache This error lead me to 2 hour for finding the solution. So the problem is because I change the variable type from string to JSON. It’s seem that Mustache(1.0.5) can’t render json type, so we need to generate json string first. request_body = Mustache.render(JSON.generate(body),data) ENOENT is stand of... Read More