16 KiB
title | description | date | draft | tags |
---|---|---|---|---|
All my projects to date | A description of everything I've done albeit minimizing the fails and shortcomings | 2025-07-10 | false |
I'm writing this so I have one place where I've described all of my projects, in future I may make this a section of the site rather than just a post but for now this will do.
Note for future me, the markdown sucks because you wanted to have semantic HTML here and didn't know how to get markdown to generate <article>
or <section>
elements, you'll find the proper markdown under the /projects
directory.
Binghamton Better Bus HackBU 2024
See also: My blog post on HackBU 2024
The what
Binghamton better bus in both of it’s iterations is a web app to find a route from point to point in Binghamton using both the Broome County bus system as well as the OCCT bus system.
The HackBU iteration made use of the live maps available (at the time) to acquire the needed information about the bus systems.
In the 24 hour hackathon I was able to get a setup where I could input a start and endpoint and get a route which could be a layover at Binghamton University, the downtown bus terminal or in theory no layover with a single bus. The one and only heuristic used was walking distance.
What was learned
I learned some of the intricacies of the polyline algorithm and how the two bus live map APIs worked.
Demo video
Binghamton Better Bus v2
See also:
The what
Binghamton better bus in both of it’s iterations is a web app to find a route from point to point in Binghamton using both the Broome County bus system as well as the OCCT bus system.
V2 is basically the same as the hackthon version but done over a semester for a class instead of just 24 hours for a hackathon (see the links).
However it manages bus route data differently than the hackathon version. The OCCT data still came from the live map api however rather than making a request every time data was needed this iteration simply had the JSON data from some responses saved and used that. The Broome County data came from GTFS that Broome County makes publically available. Note: the live map provider for Broome County disappeared between the HackBU iteration and the start of this iteration.
The end result of this project was a system where start and endpoints could be input and the system would calculate a route between points (I forget if it factored in time) which wouldn’t necessarily need to layover in statically set hubs but didn’t factor in Bus direction.
What was learned
- anything which is the output of a program should not be checked into the version control system that output is a build artifact, something which should be generated on/pre startup or something which should be generated on demand.
- Barring genuinely hard problems the first unit (probably week) of work on a project should be scoped to whatever the MVP is.
- If I’m working in a team which I want to get things done and nobody has taken charge by the end of the first unit of work I need to take charge.
- If in a team where I’m in charge I should never assume responsiveness (responding to communication and getting work done) from any team member regardless of prior knowledge.
Demo video
This Blog
See also:
- Blog revamp
- (Outdated) How this website was made
- (Outdated) Setting up CD for this site
- Every other blog post on this site
The what
This blog is a place where I write thoughts mostly but not always about software. The static site generator, Pagwin’s Site Builder (PSB), and frontend code were done by me.
The static site builder doesn’t do anything too crazy right now, however I intend to rewrite it to handle markdown and restructured text(RsT) itself. With that new power I’ll then have it handle syntax highlighting, footnote/aside creation and table of contents creation.
Meanwhile the frontend code was done to try and maximize semantic HTML and aesthetics while also being a reasonable print. I have some Open Graph tags so links to it in social media look okay and I have an Atom feed so people who care to track updates have a way to do so though I plan to create an XSLT transformation for that Atom feed so people who click the RSS icon aren’t confused.
Also one last thing is that I use close to no Javascript, at present it’s for easy syntax highlighting and in future I expect I’ll use it for positioning footnotes/asides to the right vertically aligned with the thing referencing them.
What was learned
Quite a bit about HTML and CSS.
Visual/demo
You’re looking at it.
Comments Backend
The what
I worked on making a HTTP service which returned HTML snippets which allowed for comments which I intended to add to my blog but didn’t due to email being annoying and deciding that comments didn’t add much.
If I remember correctly this was intended to use HTMX to minimize the need for page reloads without needing a bunch of javascript.
What was learned
At the time besides probably realizing that I should’ve had the service use an SMTP connection instead of some specific API and with hindsight that I should’ve used sqlite rather than PostgreSQL for that project.
Raft implemention in C++
The what
In my undergraduate algorithms class an assignment we had was to pick an algorithm, implement it and write about the algorithm. I chose Raft. I also choose to implement Raft in a sans io style or maybe it was an inversion of control style idk.
Description of Raft
Raft is a consensus algorithm which ensures that a consistent log is maintained across many nodes.
Analogy, imagine a bank wants to track the amount of money in each customer’s account but they don’t want this tracked on just one computer. So they have multiple computers that communicate with each other to do this.
Notably each computer doesn’t just change variables willy nilly, instead they keep a log of everything that’s happened and using that log figure out what the current state of things is.
In the Bank analogy this log would probably contain things like.
- Person A deposits x dollars
- Person A withdraws x dollars
- Person A transfers x dollars to Person B
So a log like
- James deposits $10
- Mary deposits $20
- James transfers $5 to Alex
- Mary transfers $7 to James
- Alex withdraws $4
would end up with James having $12 in his account, Mary having $13 in her account and Alex having $1 in his account.
I won’t go into detail of how this is log is kept consistent between all the nodes here because
- you can read about how in the Raft paper
- When I wrote about how this works for that algorithms class it was 3 pages which is too much writing for this context
In summary though the nodes pick a leader and the leader transmits log entries to other nodes, keeps track of what log entries are known by a majority of nodes with log entries which aren’t known by the majority being deleted as needed and a new leader being elected as needed.
What was learned
Tests are good, for non trivial software they should be added sooner rather than later. With that in mind sans io/inversion of control is great because it makes testing much easier.
Oh also I got more comfortable with CMake and CTest.
C++ std::map
partial implementation
The what
C++ has something called std::map
as a part of the
standard library. I implemented a subset of the functionality present in
std::map
for a class I took in college.
This was done via a red-black tree which was a pain in the ass to deal with due to me not knowing how red black trees worked at the start and making the mistake of having the root node be a special case.
What was learned
Doing anything with graphs in languages which aren’t trace garbage
collected is painful and making the root node
std::optional<Node>
while all chidren are
std::unique_ptr<Node>
is a bad idea due to it
basically mandating code duplication.
C++
std::shared_ptr
partial implementation
The what
C++ has something called std::shared_ptr
as a part of
the standard library. I implemented a subset of the functionality
present in std::shared_ptr
for a class I took in
college.
What std::shared_ptr
does is that it holds a pointer to
something on the heap and a counter to track how many
std::shared_ptr
s for that pointer exist, when that number
hits 0 the pointer is freed. Compared to manually needing to keep track
of whether anything is using a pointer it’s reasonably nice.
What was learned
I won’t go into detail but I did not finish everything needed for this assignment. The simple lesson which I will undoubtedly need to relearn over and over again is that I shouldn’t procrastinate, things can be harder/take longer than expected.
Fraction Generator
See also: The blog post about this
The what
This was a project I did for fun which generated a bunch of fractions by starting with 2 seed fractions, adding them toegether like vectors and then repeating for all adjacent pairs of fractions over and over again until a desired number of fractions were generated.
A bottleneck caused by misusing insertion into a Vec
made things slow until it was removed.
What was learned
- Rust’s
async
functionality is not a great fit for recursive computation. - Be careful with stdlib functionality, it can occasionally be used to footgun
- Initial solution should be as simple as possible and then expanded in the natural direction of complexity for speed (or the direction indicated by benchmarking) rather than done for speed from the start.
Pagwin’s Program Instantiator (PPI)
The what
PPI is a program that I can use to create new projects, either from a git repo or via some program.
The commands and git repos are specified in a toml file like shown below.
[subcommands.skeletons]
cpp = ["https://git.pagwin.xyz/Pagwin/Cpp_template", "main"]
[subcommands.scripts]
rs = "cargo-quick"
npm = "npm-quick"
js = "vite-quick"
hs = "cabal-quick"
[patching]
prefix = "/home/pagwin/.local/share/patches/"
[patching.cmd_patches]
I forgot about that patching section so that might be something unfinished oops.
What was learned
Libgit2 isn’t very reliable so using the git
cli is
generally preferred for things like this.
Romance (HackBU 2023 project)
The what
Romance was a CI/CD pipeline which I made for the 2023 HackBU hackathon. If I remember correctly it was a git hook which read a config file to figure out which docker container(s) to run. I also had time to build a not great looking web ui for it.
What was learned
This is probably one of the earlier instances of me working on something with a very tight deadline where I found that constraint made me worke more effieciently than I normally do. This takeaway is something which I don’t think I’ve fully internalized yet but it is something I will occasionally stumble into under the right circumstances.
Small echo
The what
This was a project made for fun in highschool where I made a bunch of programs which read from stdin and output to stdout in various programming languages.
The reason this is of note is because one of those languages was assembly.
What was learned
Linux syscalls/x86 assembly.
Exploration of xv6 x86 code for operating systems class
The what
For my operating systems class I explored the x86 version of the xv6 operating system’s codebase a bit.
For this class we implemented a few syscalls and implemented a scheduler.
What was learned
It was interesting to understand the guts of how schedulers and syscalls work on the kernel side of the operating system.