Building a D3 Binary Tree

Tldr: I built an animated binary tree following the lessons learned from the D3 course on Frontend Masters by Shirley Wu as well as Brian Holt’s Introduction to Computer Science. Play with the tree here: https://bl.ocks.org/benlhy/83a93740449b29ab731184bd233c9994/8f68c0d8ed273ac075102a5e7af886559d80eb81 Randomly generated tree A binary tree is a type of data structure that sorts new values. Each node in a binary tree has two children, the left is always smaller than the parent node, while the right is always larger than the parent node. By following this rule, a binary tree is constructed. ...

April 19, 2020 · 2 min

Notes on The Lean Startup and The Mythical Man-Month

Lean Startup Get ahead of the opinion If you have an idea but you don’t have the product, it is easier for people who are evaluating you to criticize the idea because the white space has not yet been filled in yet. At this point a project is more likely to face opposition, criticism, and non-constructive feedback because everyone has their own idea about what to do next. The discussion can sometimes get mired in technicalities. So what should you do? ...

March 22, 2020 · 2 min

How I built a YNAB-like budget in Google Sheets

Budgeting is useful for me to take note of how much I spend a month. If I had to estimate how much I spend, I can be off the actual amount by as much as half. I tried a few apps and methods to keep track of my finances. In particular, I really liked You Need A Budget (YNAB) because it is simple to use and offers integration with your bank account, so you can track your finances without having to spend additional effort recording every transaction. I also liked Mint for it’s simple interface. ...

March 22, 2020 · 10 min

Cross Origin Resource Sharing Woes (CORS)

Ever come across this situation? You want to pull an HTTP API into service on your website. You test it happily on your local machine with Python or Postman, but then when you convert the code into javascript and try to use it in the browser… boom. You get hit with error messages that look like this: preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. ...

December 7, 2019 · 2 min

Towards automatic generation of EAGLE parts

Library creation in Eagle is often a tedious affair, which is why I avoid it as much as possible, often going out of my way to find preexisting libraries to integrate into my own mylib.lbr. But searching for these libraries can be hit or miss, and the quality is variable. You can get some really good libraries from Sparkfun, Adafruit, or that excellent microbuilder.lbr, but you might just as likely not find any parts especially if you are using an uncommon part. So what do you do? Often I trudge back to EAGLE and reluctantly start to create my parts. I start have to overcome some activation energy before I can really get down to building the board. ...

November 26, 2019 · 8 min

STM32Cube IDE

The newest and best IDE for STM32 development. Why STM32? Since it is essentially a rebrand, my post on using Atollic and STM32 still stands. The STM32Cube IDE is ST Microelectronics first offering of an in-house IDE under the CubeMX branding. Having an IDE that is supported by the manufacturer has many benefits, including tighter integration with core products and better software documentation. Just see Simplicity Studio’s implementation The STM32Cube IDE is essentially a rebrand of Atollic Studio and brings the CubeMX perspective in as a default view instead of having it as an additional add-on. This is good because I really liked working with CubeMX, but it is horrible on HighDPI screens and so I was stuck with Atollic Studio’s add-on, which occasionally caused the IDE to crash. ...

October 12, 2019 · 2 min

Silicon Labs EFM8 'Bee' Series

Silicon Labs offers a series of 8-bit microcontrollers that specifically target certain use cases. They come with excellent documentation and a breathtaking amount of example code to get every feature and aspect of the microcontroller working. When you combine this with an affordable J-Link enabled development board and a gorgeous, cross-platform, Eclipse-based IDE, you practically have your next project built. Tldr; this should be your next 8-bit project. Who should care? If you are looking for the next step from Arduino, I strongly recommend Silicon Labs EFM8 series of microcontrollers for two reasons: ...

October 3, 2019 · 8 min

Padauk Microcontrollers: Exploration and Usage

Exploring and using the 3 cent microcontroller. Impression: A legitimate replacement for simple use-case projects. Idly I decided to research what is the cheapest microcontroller you can get and develop with, and I came across a Hackaday post regarding precisely this topic. Tim from [coldcpu] has put in a decent effort at categorizing the cheapest microcontrollers available, along with their associated pros and cons. In another separate Hackaday post, someone used a Padauk microcontroller to bit-bang the WS2812b protocol. ...

September 28, 2019 · 18 min

Design Analysis - Simple Clock

You see these clocks everywhere. They hang on walls of kitchens and offices, quietly ticking away, keeping count of the time left in the day. One of these clocks in my house recently failed so I decided to take a closer look at the inner mechanisms of a clock. If you think about it, a clock is not a simple task, especially with how it is presented: three rotating pointers on a single shaft, all turning at different speeds. If you directly drive one pointer, say with a motor, how would you put another axis of rotation through the same vector? The solution, as it turns out, is to just wrap shafts around each other. ...

September 22, 2019 · 4 min

Design Analysis - Bluetooth Button

Recently I got my hands on an intriguing device. It was described to me as a Bluetooth Button, but I couldn’t figure out how it worked because no instructions were provided. It was given out at an event, which meant that this was quite a low cost device. I decided to take it apart for analysis. Research There are several iterations of these devices floating on the market. One of them is the iTag device, or the camera shutter Bluetooth device. These devices are available from eBay or Aliexpress from $3 to $1. From some online chatter, it seems like dollar stores actually stock these devices. Because they are so cheap, some people have repurposed them as single purpose buttons, for example, to track inventory or to activate a device remotely. ...

August 31, 2019 · 5 min