isdanni

... 127.0.0.1

Reservoir Sampling

How the algorithm works and its implementation in streaming system

Algorithm Reservoir sampling is a family of randomized algorithms for choose a simple [random sample] [without replacement of k items] from a population of [unknown size n] in a [single pass] over the items. NOTE: size n here usually cannot fit into main memory; n is unknown, revealed ove...

Notes on writing Clean Code

Reading Clean Code: A Handbook of Agile Software Craftsmanship

Finally had the time to almost finish this book ;-) Naming Use descriptive and unambiguous names; Avoid misunderstanding; (e.g. Use accountList for a list of accounts unless it is the real list data type, otherwise accounts or AccountGroup would be better); Use meaningful distinction; (e...

Setup Objective-C dev env in Ubuntu 18.04 LTS

It is perfectly fine to run Objective-C code in Ubuntu environment since Clang is available for installation as a package for most of the Linux distributions. So if you do not have a MBP like I do, and wanna get a sense of how OC code works(but not to develop an iOS application, unfortunately, si...

Design patterns in systems with limited memory

Reading Small Memory Software: Patterns for systems with limited memory

2020 so far has been a train wreck. Without any classes on campus, I did manage to spend some time focusing on learning design pattern in computer software and systems in general: a goal I set a year ago but have never had time to finish. Small Memory Software is a classic for those wishing to l...

Notes on writing elegant Golang

Full disclosure, I did’t start using Golang actively till recent months, even though I have always claimed to know it and put it in the language section on my resume(naively & shamelessly). But there is definietly a huge difference between knowing some common syntaxes and understanding the la...

Consistent Hashing

Tradeoffs & how-to in Redis

What is Hashing? Merriam-Webster: noun: “chopped meat mixed with potatoes and browned”; verb: “to chop (as meat and potatoes) into small pieces.” So basically, hashing is the mapping between data object.(general terms) The input and output values do not need to be the same type. hash colli...

Intellij IDEA for Spark w/ Scala examples

And why I don't use Eclipse for Spark

Why I don’t use Eclipse for Spark? I tried eclipse, Atom, Sublime and even Emacs before settling on IntelliJ. The reason I finally went back tp Intellij is the same like most of other Scala developers – the more stable IDE and more features. Since the Scala IDE team also showed interest to move...

Clojure in Java Developers' eyes & Lisp?

Is it easier to learn Clojure after Java & How GC/VM tuning helped

Why I decided to learn Clojure Some time ago I came across a really old blog online, in the comments someone surprisingly suggested some amazing features from another language. And, no suprise, my first encounter with Clojure. Later, one developer I followed online did a really thorough talk on ...

GCP Cloud SQL integration w/ Java Web App

MyBatis + Spring Boot: Servlet, JSP & JDBC

There are some well-known frameworks for developing the non-distributed Java web apps: ORM: Ususally for controlling the relational database(data access w\ JDBC), right now SQL-based MyBatis or Hibernate is pretty popular. MVC: Model, View and Controller. Each component interacts with one an...

Redis - Distributed Locks for Transactions

Client Handeling, access control & performance metrics

Redis is an open source, in-memory data structure store. Most people know it as database but it can also be used as cache and message broker. Redis supports 5 data types: String: most common Redis value. Binary safe so can contain any data. List: simply list of strings, can be updated on bo...