December 25 2025

Huge news. Going to take the next semester off and work for a startup as a founding intern from like Jan to July. Working on vision models in AI so brushing up on that and grinding a bit of deepml. Also looking to learn CI/CD through github actions and integrating docker and whatnot. overall pretty interesting tech will be starting in like a week. Not allowed to share the overall idea but vision systems in ML have come pretty far and I am going deep in understanding the models and seeing if I can pretrain something myself and deploy it with great results. Looking at pose estimation and other emerging tech from arxiv papers to see if we can get in the cutting edge of something.
Other than that I have also been working on a new project called dotcash. TLDR, its a decentralized stablecoin. crypto is super scammy and everyone i talked to in that space is a lil weird and not super tech focussed, so I got a bunch of C++ programmers to join me on this project. its going to be an open source project but the basic idea is, instead of having a coin like USDC in which you have to centrally manage a reserve of US dollars, why not have an on chain reserve of BTC/ETH or whatever big existing crypto and employ a delta neutral strategy to make sure the price is stable.
I had this idea because I thought the core blockchain tech was interesting but the crypto space is full of scams and whatnot and needs more like tech and programming nerds to work on cool projects. I saw this project called hyperliquid created by this guy Jeff who is from a HFT firm, and he seemed like the start of a new crypto revolution where smarter people enter the space and create cool products. On the back off of hyperliquid, which is a decentralized exchange, i think it is possible to have this stablecoin which can do this delta neutral strategy on the backend. The implications are limitless but it all depends on execution and an idea can only go so far.
You can check out the project at dotcash. If anyone is interested, they can also contribute.

November 9 2025

Good news. we won div 2 regional ICPC content for the mid atlantic region. maybe i can lock in more and do div 1 next year. It was a lot of fun though and it helped me learn the ways to solve some of these tricky problems. You do need a lot of math skill. I have been into reading a lot, and audiobooks are just really op. Also started a bunch of other projects, like im back into opengl for C++, doing the crypto project, working on some RTOS and GPU stuff.
I have branched out a lot, simply trying to improve C++ skills generally but also trying to find the things I find most interesting so I can lock in on them.
RTOS seems quite interesting so maybe I can try and do something related to that.

October 31 2025

Getting back into streaming. Got interested in cryptography and like bitcoin stuff and I wanna see if i can write one rq from scratch. kind of a distraction but like ehh it seems kind of fun so lets see. the industry is hella scammy right now so I am not tyring to go down that path but the core technology and motivations seem really cool although the crypto bros are not that cool lol.
I also finished reading 1984, banger book obviously.
Currently reading House of Huawei, really good insight into the workings of Huawei, history of how Ren Zhengfei built it post cultural revolution and stuff. he was part of PLA but somehow was free market. interesting that Deng Xiaopeng, although he did tianenmen massacre was like vital for china to improve economy and he embraced free markets and privatization and stuff. very interesting.
Also reading the book, only the paranoid survive by andy grove former ceo of intel. another banger fr. he seems to love strategic inflection points he says it over and over and over again. but like its interesting, he goes into the pentium processor math issue and like transitioning from the memory business into microprocessor and the fierce competition from the japanese etc. im reading more books but now but im not as locked in on programming so this streaming stuff is an attempt to lock in again.
also need to grind leetcode so yeah, school is going okay but i need to still finish UC applications. overall i needa lock in basically.

October 14 2025

Did not win VThacks, project was a little too controversial. I thought computer vision frontend would be cool but it did not work out, maybe we took a little too much risk for a chill hackathon. Demo here - ezclapChainVision Demo
Working towards reading more books and cutting back on random youtube podcast stuff.
Audiobooks from libby and hoopla seem to be the way.
Reading 2008 Financial Crisis - George Soros, 1984 George Orwell, and Apple in China by Patrick Mcgee.
Hopefulyl i can keep up and finish these books.
Need to lock in on ML. Lower level ML, like vision models and understanding math behind ML seems crucial. Andrew Ngs lectures are just linear algebra mostly. Should lock in on those lectures.
Also interested in ML infra stuff like GPU and embedded stuff so look into that and figure out what is better for you etc.
Finally, I REALLY need to lock in on the UC apps. procrastinating those for ages, and i have to get it done if I wanna transfer.
Also need to get back into leetcode stuff, idk how im gonna grind all of this need to get disciplined
been platying hella chess though

September 22 2025

Back after a long break. Been slightly burned out but I am back on it. Working on learning linux internals (going fine for now) focussing on the perf application and how it uses perf_event_open syscall etc etc. I have also been working more on crackmes.one and reverse engineering.
Don’t know what i should be focussing on. I need to get back soon to the prof im getting advice from lowk I have been slacking on that. Cloud computing cs class is interesting but it seems to be for these enterprise software type stuff and I am not the biggest fan of it. I am looking to get back into machine learning and explore robotics a little bit more as well.
(maybe spreading myself too thin)
also writing the UC application hope that goes well so I can transfer back to CA.
I am gonna keep this a little simple from now on to keep sustainable and stop posting a lot of ss for proof and just explain learnings.

June 25 2025

Working on learning tools like gdb and improving my vim skills. Currently working on the 8086 emulator which you can find on github. It is taking some time to implement because I am try to be thorough and do it in the most efficient way I can find and not the less performant intuitive way. It is really interesting and I really wanna be able to write a simple program that I can run on my 8086 emulator. That would be sick imo. Also made gvim my permanent text editor and I use it instead of visual studio and everything and its awesome. no nvim though cuz it seems too complicated
I also have floatterm set up so I dont need to leave this page and be locked in on programming. I feel more aligned with C/C++ in terms of programming languages and can see myself doing GPU programming and some low level machine laerning in python in the future. I dont think web dev is my thing but unfortunately it seems to pay the best.

June 18 2025

Been working on low level reverse engineering once again as it helps me understand C/C++ better. Just using stuff like gdb and radare2 to see if I can smash the stack and escalate privelegs on a linux machine based on that. It is surprisingly not too complicated, provided you disable a bunch of safety settings for the stack. But if there is some executable with root permissions in your linux system that happens to have some input field buffer that is properly not checking for bounds, its extremely simple to smash the stack and redirect the address to execute your own code, which could be to make you root or whatever. Its quite fun and im getting better at that.
“Smashing the stack for fun and profit”

June 5 2025

Made some decent progress on the os. Initialized the PIC and IDT and got interrupts working. Internal software interrupts and IRQs are now triggered properly. I may have not set up the bootloader properly because there are some memory mapping issues. Some variables randomly get initialized to zero and I am using some temp fixes but need to get that working.
Set up a debugging env using GDB and that has been super helpful in debugging and looking through and probing values and it was super fun to do. QEMU + GDB are really just amazing tools.

May 28 2025

Need to journal more.. Anyways been working on the OS. Now working on interrupts. We finished setting up the bootloader, which essentially switches to protected mode and jumps to the kernel. In the bootloader, we also set up a basic GDT that segments the memory into code and data for user-mode and kernel-mode. We then implemented our own C functions in the kernel and got printf working. Was able to print some basic stuff to the screen and also got the cursor working.
The cursor was drawn directly by the hardware instead of the bios, and to do this I had to get outb() and inb() working so I can interface with the IO directly and send bytes to it. I also set up the Interrupt Descriptor Table and the associated stuff with it. Took a while to understand how interrupts work in the context of osdev but its quite interesting. Unfortunately I am not sure if the code works because I can’t test it yet. For interrupts to work, it needs something called the PIC, or APIC in modern systems. This is a separate hardware component that will receive interrupts as it is inefficient for the CPU to continuously poll devices for interrupts. Currently in the process of setting up the PIC so I can send some interrupts and see if it works.
From there I can work on writing some keyboard drivers to get it working on the OS.
Some visual stuff to represent progress:

May 18 2025

Making OS complicated af. But im not deterred, however I need to start from basics. Reading through OSTEP and Do Haung’s OS from 0 to 1. Im also working on bit manipulation and how to work with that cause it seems kind hard.
To extract specific bits from a byte or any sequence of bits, you apparently have to create a bit mask. Only then can you like extract the bits.
Here is the code for perf aware programming (decoding 8086 instructions). This is not done yet and there is a lot of stuff I still need to decode that I am working on.
#include <iostream> #include <fstream> #include <vector> #include <iterator> #include <unordered_map> unsigned char extractBits(unsigned char curr, int startBit, int endBit) { unsigned char mask = ((1 << (startBit - endBit + 1)) - 1) << endBit; return (curr & mask) >> endBit; } struct instruction { unsigned char opcode; int direction; int wordSize; unsigned char mod; unsigned char reg; unsigned char rm; }; instruction decodeInstruction(std::vector<unsigned char>& buffer, int byteIndex) { instruction decoded; unsigned char currByte = buffer[byteIndex]; decoded.opcode = extractBits(currByte, 7, 2); decoded.direction = extractBits(currByte, 1, 1); decoded.wordSize = extractBits(currByte, 0, 0); byteIndex++; currByte = buffer[byteIndex]; decoded.mod = extractBits(currByte, 7, 6); decoded.reg = extractBits(currByte, 5, 3); decoded.rm = extractBits(currByte, 2, 0); return decoded; } int main() { std::ifstream input; input.open("many_reg.bin", std::ios::binary | std::ios::in); std::vector<unsigned char> buffer((std::istreambuf_iterator<char>(input)), {}); input.close(); std::vector<instruction> all_instructions; for(int i = 0; i < buffer.size(); i += 2) { instruction decoded = decodeInstruction(buffer, i); // std::cout << std::bitset<6>(decoded.opcode) << decoded.direction << decoded.wordSize << std::bitset<2>(decoded.mod)<< std::bitset<3>(decoded.reg) << // std::bitset<3>(decoded.rm) << '\n'; all_instructions.push_back(decoded); } const unsigned char REG_OPCODE = 0b100010; bool reg_dest = false; // Need to add the w field to check the word size (Assuming its always full for now) std::unordered_map<unsigned char, std::string> reg_map = { {0b0000, "al"}, {0b0001, "ax"}, {0b0010, "cl"}, {0b0011, "cx"}, {0b0100, "dl"}, {0b0101, "dx"}, {0b0110, "bl"}, {0b0111, "bx"}, {0b1000, "ah"}, {0b1001, "sp"}, {0b1010, "ch"}, {0b1011, "bp"}, {0b1100, "dh"}, {0b1101, "si"}, {0b1110, "bh"}, {0b1111, "di"}, }; // In the future if you need to add other stuff just make a struct // Also add more stuff to the map for(int i = 0; i < all_instructions.size(); ++i) { if(all_instructions[i].opcode == REG_OPCODE) { std::cout << "mov"; } if(all_instructions[i].direction == 1) { reg_dest = true; } all_instructions[i].rm = (all_instructions[i].wordSize == 0 ? ((all_instructions[i].rm << 1) | 0) : ((all_instructions[i].rm << 1) | 1)); all_instructions[i].reg = (all_instructions[i].wordSize == 0 ? ((all_instructions[i].reg << 1) | 0) : ((all_instructions[i].reg << 1) | 1)); std::cout << " " << reg_map[all_instructions[i].rm]; std::cout << ", " << reg_map[all_instructions[i].reg]; std::cout << '\n'; } return 0; }

May 16 2025

I havent been posting too often cuz of tests and stuff. I started looking into low level development and asm. Im looking to code my own bootloader for 8086 and I think the initial bootloader operates on 16 bit in real mode or smth and then it boots into 32 or 64 bit for the OS depending on the system. I am going to work on this. Right now I am learning asm to code this up and learn it. On a side note, casey muratori’s course on perf aware programming is awesome as it dives into all these details for just programming anything in general, not for anything specific in building bootloaders. I think that course will be more relevant after I have built some projects in C++ and have a solid understanding of the language.
I was able to write some basic stuff in asm after learning it. Its pretty interesting how the BIOS first checks for the location in memory 0x7c00
; Instructs code to be in 16 bit mode because bootloader runs in real mode bits 16 ; Specifies where in memory the program starts, allowing offset calculations org 0x7c00 section .text start: xor ax, ax mov ds, ax mov si, my_string print_loop: lodsb or al, al jz load_kernel mov ah, 0x0e int 0x10 jmp print_loop load_kernel: mov ah, 0x02 mov al, 0x01 mov ch, 0x00 mov cl, 0x02 mov dh, 0x00 mov dl, 0x00 mov ax, 0x1000 mov es, ax mov bx, 0x0000 int 0x13 jc disk_error ; Jumping to the kernel jmp 0x1000:0x0000 disk_error: cli hlt exit: cli hlt my_string: db "Hello ASM", 0 ; Puts 0's in the part where we dont have any code because bootloader is 512 bytes times 510 - ($-$$) db 0 dw 0xAA55
This is the basic bootloader I did. I was originally thinking about making it switch from real mode to protected mode but it was too much work so I decided to write a basic kernel in 16 bit. Will work on it more and see if I can get anywhere. I need to look for solid resources and I am looking to read OSTEP first.

April 29 2025

Solved an awesome problem on codechef called unlock the safe where there were multiple cases I had to check for. Here is the code
#include <cstdlib> #include <iostream> #include <vector> std::string solve(int n, int k, std::vector<int> init, std::vector<int> target) { int diff = 0; std::vector<int> extras; for(int i = 0; i < init.size(); ++i) { int moves = std::abs(init[i] - target[i]); int temp = std::min(moves, 9 - moves); int max = std::max(moves, 9 - moves); diff += temp; extras.push_back(max - temp); } diff = k - diff; if (diff < 0) return "NO"; else if(diff % 2 == 0) return "YES"; else if(diff % 9 == 0) return "YES"; else { for(int i = 0; i < extras.size(); ++i) { if(diff - extras[i] >= 0 && (diff - extras[i]) % 2 == 0) return "YES"; } } return "NO"; } int main() { std::ios::sync_with_stdio(false); std::cin.tie(NULL); int t; std::cin >> t; while(t--) { int n, k; std::cin >> n >> k; std::vector<int> init; std::vector<int> target; for(int i = 0; i < n; ++i) { int a; std::cin >> a; init.push_back(a); } for(int i = 0; i < n; ++i) { int a; std::cin >> a; target.push_back(a); } std::cout << solve(n, k, init, target) << '\n'; } }
The first few cases where quite easy to figure out but then I had to think about the alternative routes scenario and it got a bit complicated. I eventually figured it out with some help and implemented it myself but I am not sure if it is the most optimal. The extras array adds some more runtime but I think it should be okay. I also worked more on trees because I suck at it and sort of figured out how diameter of a binary tree problem works.
First misconception of this question is that you are trying to find the diameter through the root node, but its just the largest diameter through any node. So you have to check for every node. Maintaining a global diameter variable is apparently the way to go, because your dfs algorithm is going to return the height of each node so yeah. Here is the code. I get the idea but I still don’t fully get it because its recursion so I will have to come back to it eventually
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {} * }; */ class Solution { public: int maxD = 0; int dfs(TreeNode* root) { if(root==NULL) return 0; int leftT = dfs(root->left); int rightT = dfs(root->right); maxD = std::max(maxD, leftT + rightT); return 1 + std::max(leftT, rightT); } int diameterOfBinaryTree(TreeNode* root) { dfs(root); return maxD; } };

April 25 2025

After failing IMC Prosperity 3, and getting #120 after being #34, im back on the leetcode grind.
Trying to do reorder list problem 143 today. I forgot how to reverse a linked list so I learned that again.
Implemented a full Node* and linked list in C++ with all functions. Starting working on implementing sorting. Here is the code for linked list.
#include <iostream> struct Node { int val; Node* next; Node(int x) : val(x), next(nullptr) {} }; class SinglyLinkedList{ private: Node* head; public: SinglyLinkedList() { head = nullptr; } ~SinglyLinkedList() { clear(); } void insertFront(int val) { Node* newNode = new Node(val); newNode->next = head; head = newNode; } void insertBack(int val) { Node* back = new Node(val); if(head == nullptr) { head = back; return; } Node* temp = head; while(temp->next != nullptr) temp = temp->next; temp->next = back; } void deleteFront() { if(head != nullptr) { Node* temp = head; head = head->next; delete temp; } } void deleteBack() { if(head == nullptr) { return; } if(head->next == nullptr) { delete head; head = nullptr; return; } Node* temp = head; Node* prev = nullptr; while(temp->next != nullptr) { prev = temp; temp = temp->next; } prev->next = nullptr; delete temp; } bool search(int val) { Node* temp = head; while(temp != nullptr) { if(temp->val == val) return true; temp = temp->next; } return false; } void clear() { while(head != nullptr) { Node* temp = head; head = head->next; delete temp; } head = nullptr; } int size() { Node* temp = head; int res = 0; while(temp != nullptr) { ++res; temp = temp->next; } return res; } void print() { Node* temp = head; while(temp != nullptr) { std::cout << temp->val << " "; temp = temp->next; } } }; int main() { SinglyLinkedList list; list.insertFront(10); list.insertFront(20); list.insertFront(30); list.insertFront(40); list.insertFront(50); std::cout << list.size() << '\n'; std::cout << (list.search(10) ? "Found" : "Not Found") << '\n'; std::cout << (list.search(100) ? "Found" : "Not Found") << '\n'; list.deleteFront(); std::cout << "after delete: "; list.print(); list.deleteBack(); std::cout << "after delete: "; list.print(); std::cout << "size after deletions: " << list.size() << '\n'; list.clear(); std::cout << "List after clearing: "; list.print(); return 0; }

April 14 2025

Nothing special today. Worked on some problems for projecteuler.net. Very good resource. Found out how to get multiples of 3 and 5 in C++. Its super easy but it gets progressively harder. Here is the code.
int threeAndFive(int x) { int sum = 0; for(int i = 0; i < x; ++i) { if(i % 3 == 0 || i % 5 == 0) sum += i; } return sum; }
Need to work more on making observations in leetcode to find patterns. Also need to work more on drawing out solutions and better identifying patterns because im struggling on some basic tree problems. Still need to do faster mental math.

April 13 2025

Not gonna yap so much gonna keep it brief. This week mostly worked on learning BFS and DFS.
BFS, its basically just navigating a tree line by line. You have to use a queue (from what I learned) to use it. You basically push the root node and then pop node, add the left and right nodes to the queue and repeat this process.
For DFS, you have to use recursion again, the basic code looks kinda simple.
int dfs(NodeTree* root) { if(root == nullptr) return 0; dfs(root->right); dfs(root->left); }
This is pretty intuitive but need to work on more problems to make sure I understand it fully.
I did a bunch of tree problems while at leetcode club and also learned basic backtracking.
Best resource still seems to be Main Page - Algorithms for Competitive Programming. And the strat still seems to be to work on problem for maybe 10 minutes and look at hints till you can solve it.
Also worked on some quant questions. I need to learn to do lightning fast mental math and also faster daily typing for programming and regular stuff.
Learned faster Euclidean way to find GCD:
int fastEuclidean(int a, int b) { if(b == 0) return a; return fastEuclidean(b, a % b); }
The time complexity for this solution is
O(log(min(a, b)))
through Lame’s theorem. If you get smart enough in math one day, come back to figure out why this works.

April 6 2025

Binary Trees
Binary Trees are basically non-linear data structures that are really good for recursion. There’s various types of binary trees (balanced, degenerate, unbalanced etc..), all of them having different qualities. I did Leetcode 226 and 104, which is inverting a binary tree and finding max depth for a binary tree to understand this data structure better.
Both are pretty easy problems but I struggled a bit on both of them.
Both problems involve recursion, which was the bottleneck in solving the problem cuz I suck at recursion.
Inverting a binary tree
The way you do this question is actually kind of straightforward I just complicated it too much. First thing to notice is that you return
root
. This means that your recursive loop just changes the structure of the binary tree and does not return anything that is going to be calculated. All the recursion problems I had seen do something like
recursive_function(n+1) + recursive_function(n-1)
so this kind of tripped me up.
Another tip for recursion with binary trees is to think about the smallest tree, and how you would just do it for that. After figuring out the base algorithm, you can add the recursive part to it. In this case for inverting a binary tree for a simple tree, you would do:
TreeNode* temp = root->left; root->left = root->right; root->right = temp;
Now you need to add the base case. This is very important. If the tree has NO CHILDREN you would just return nullptr. If it has one child, you still need to switch it, but the node that goes through the algorithm will run into an error. To mitigate this you need to have this if statement.
if(root == nullptr) { return nullptr; }
So when the recursive loop enters a node that is null, it does not run into an error.
These are the main things. The full code is:
TreeNode* invertTree(TreeNode* root) { if(root == nullptr) return nullptr; if(root->left == nullptr && root->right == nullptr) return root; TreeNode* temp = root->left; root->left = root->right; root->right = temp; invertTree(root->right); invertTree(root->left); return root; }
The recursion part is just
invertTree(root->right)
and
invertTree(root->left)
. I just had to do it individually, I was tripped up on this because of the things I mentioned above. The code is fairly straightforward just need to think a lil harder.
Max Depth of Binary Tree
I am gonna keep it brief cuz im yapping too much and this is unsustainable.
For this question, I just need to find the max depth of a binary tree, very self explanatory.
This code is even more easy, here it is:
int maxDepth(TreeNode* root) { if(root == nullptr) { return 0; } if(root->left == nullptr && root->right == nullptr) { return 1; } return 1 + max(maxDepth(root->left), maxDepth(root->right)); }
The base case is very similar to the last problem, except in this case you return 0 and 1 respectively.
The depth is simply the max of the depth between the left and the right node. That is what the last line is doing, its finding the depth of the left and right subtree and then taking the max of that, because thats going to be your answer. But it’s recursive so it does it for every subtree. Remember the tip on thinking about what algorithm it would be for the simplest case.
You add one to count for the root node itself. You return 1 if both children are nullptr, but if one of them is a nullptr and the other is a node, it will throw an error so we have the
root==nullptr
case to prevent this.

April 4 2025

Binary Exponentiation
Computing ana^n is a O(n) operation in programming cuz you need to do a * a * a … n times. Instead you can use binary exp to do this process faster. Here’s how it works:
Essentially if the exponent is even we do a(n/2)2a^{(n/2)^2} and if it is odd a(n/2)2aa^{(n/2)^2} * a.
You might also wonder why not use base 3 or base 4 or any other base, because it might reduce the computations faster, but its also expensive because with each iteration you have to do more multiplication. For example, if you do base 3, then on each operation you will have to perform a cubic operation which is not optimal.
This was the solution in code
#include <iostream> long long exponent_iterative(long long a, long long n) { int res = 1; for(int i = 0; i < n; ++i) { res *= a; } return res; } long long binpow(long long a, long long b) { long long res = 1; while (b > 0) { if (b & 1) res = res * a; a = a * a; b >>= 1; } return res; } int main() { int in; std::cin >> in; std::cout << exponent_iterative(2, in) << '\n'; std::cout << binpow(2, in) << '\n'; return 0; }
Omitted recursion cuz i hate it (still figured it out but im jus a hater).
Another interesting thing is the
b & 1
operation they used in their solution. You can check if a number is odd or even with this trick. Since binary numbers are in base 2, every number is going to be a power of 2, so everything is going to be even except for 202^0, which is 1.
If you add any even number with one, it will turn odd. So you can just check the last bit of the integer / long long, to see if that bit is on or off. If its on, then you have an odd number and if its not, you have an even number.
Also the
b >>= 1
was also interesting cuz this shifts the bits by one. This is the same as dividing the value by 2, and omitting the remainder. Since everything in binary is in powers of one, this has the effect of doing that.