View Posts for Software Engineering
-
I Built A Distributed Real-Time Monitoring and Alerting Platform in 2017
I used to work on Datacenter Monitoring circa 2015. I automated the heck out of my job. One of the last projects I delivered there was a Distributed Real Time Monitoring and Alerting Platform, written in Java. I will build it once again with the help of AI in Rust.
It was an incredibly complex system with 5 different roles, technically 4 layers. I spent around 6 months building the system and was incredibly proud of it. It worked like a charm, very fast, high performance, exceeded my wildest dreams, when ...
-
Rust Crates, Error Handling: Thiserror vs Anyhow
I wondered what's the difference and when to use them
Thiserror and Anyhow are both extremely popular and useful error handling crates in Rust, but they serve fundamentally different purposes, primarily based on whether you are writing a library or an application (binary).
Breaking it Down
thiserror- For Defining Specific Error Types (Libraries)- Purpose: To easily create custom, specific error types (usually enums) for your library. It helps you define what errors your library can produce.
- Mechanism: Uses ...
-
C5Store for Rust
C5Store for Rust
C5Store is a Rust library providing a unified store for configuration and secrets. It aims to be a single point of access for your application's configuration needs, consolidating values from various sources (like YAML files), handling secrets securely via built-in decryption, and allowing dynamic loading through providers.
The core idea is to simplify configuration management in complex applications by offering a hierarchical, type-aware, and extensible configuration layer.
Key Features
... -
I Created A Database that uses CASPaxos as the Consensus Layer but exposes Redis
Uh yeah, so it took <1 day to do it. The second day, I added recovery. A node can go offline, as long as there is a quorum the cluster will chug along, when it comes back online then it can recover from its peers.
A lot of what I did was above my level of coding, clearly I used alchemy to do this. It's not a joke. I implemented all of Redis' data structures and can send commands to do exactly what Redis does to this database. The recovery mechanism is just one of those things that made sense.
I have more feat...
-
Project Star-Spangled Phoenix #3: Development Video
Roast of The Republic is the official name of this marvelous creation.
Information
Roast of the Republic: Power Play is a casual online multiplayer card game focusing on strategic American political dominance. Players deploy cards on a shared board establishing territorial control, tactical upgrades and disruptive actions all in a bid to obtain the most influence.
Key features
- Wacky caricatures of historical political figures from US history
- Uniquely Patriotic American Music
- Capture the board with Contribut... -
Leet Code Solution 4 - Median of Two Sorted Arrays
4. Median of Two Sorted Arrays, Hard
Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.
The overall run time complexity should be O(log (m+n)).
Solution, Typescript
function findMedianSortedArrays(nums1: number[], nums2: number[]): number {let medianIdx = [];let totalCount = nums1.length + nums2.length;let firstMedianIdx = Math.floor(totalCount / 2);if(totalCount % 2 == 0) {medianIdx.push(firstMedianIdx-1);medianIdx.... -
Leet Code Solution 987 - Vertical Order Traversal of a Binary Tree
987. Vertical Order Traversal of a Binary Tree, Hard
Given the root of a binary tree, calculate the vertical order traversal of the binary tree.
For each node at position (row, col), its left and right children will be at positions (row + 1, col - 1) and (row + 1, col + 1) respectively. The root of the tree is at (0, 0).
The vertical order traversal of a binary tree is a list of top-to-bottom orderings for each column index starting from the leftmost column and ending on the rightmost column. There may be mult...
-
Leet Code Solution 9 - Palindrome Number
Palindrome Number
Given an integer x, return true if x is a palindrome, and false otherwise.
Solution, Typescript
function isPalindrome(x: number): boolean {if(x < 0) {return false;}let remainder = x;let placeValue = 1;let val = 0;while(remainder > 0) {let digit = remainder % 10;val = val * 10 + digit;if(val > x) {return false;}remainder = Math.trunc(remainder / 10);}return val === x;};I totally one shot submitted this ...
-
Leet Code Solution 8 - String to Integer (atoi)
String to Integer (atoi), Medium
Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer.
The algorithm for myAtoi(string s) is as follows:
Whitespace: Ignore any leading whitespace (" ").
Signedness: Determine the sign by checking if the next character is '-' or '+', assuming positivity if neither present.
Conversion: Read the integer by skipping leading zeros until a non-digit character is encountered or the end of the string is reached. If no digits were read, then the resu...
-
WASM Will Take Over Containers
I've been looking into WebAssembly lately and I say it is the future of containerization. I mean, I've always been a fan of Docker and Podman, but WASM? It's a whole new ballgame. Imagine compiling your favorite language (Rust, Go, C/C++—you name it) into a tiny binary that boots up in milliseconds, all without the baggage of a full-blown OS. That’s what WASM brings to you. No more BS.
WASM is the New Kid on the Block
Here's the deal: WASM was originally created to supercharge web apps, but it’s now breakin...