Nate Woods

Nate Woods

Nate's Musings

Welcome to my blog! Below you will find a collection of thoughts, concepts, projects and ideas that I have posted over the years.


golang iterators

Go 1.23 Paginated Collection Iterator

What if had a standard REST API with multiple collections of items and you wanted to load them all?

Microsoft’s API design guide represents paginated collections with the following structure:

{ // first page loaded from https://api.example.com/items
    "value": [
        { "id": "1", "name": "item1" },
        { "id": "2", "name": "item2" }
    ],
    "@nextLink": "https://api.example.com/items?$next=<opaque>"
}

Wouldn’t it be nice to write a for loop to iterate over all the items in the collection like this?

type Item struct {
    ID   string `json:"id"`
    Name string `json:"name"`
}

func fictitiousExample() {
    for item := range LoadCollection[Item]("https://api.example.com/items") {
        fmt.Println(item)
    }
}

With a little extra trickery, you can!

Published: continue reading »


golang iterators

Go 1.23 Iterators

Reading Why People are Angry over Go 1.23 Iterators (or having thePrimeagen read it) stirred the following idea.

I think this little adapter converts what thePrimeagen was thinking about with “iterable interfaces”, to what Russ Cox (rsc) and the go team are actually planning on using in go 1.23: functional iterators.

type Iterable[V any] interface {
    Init()
    Next() (V, bool)
    Done()
}

func New[V any](core Iterable[V]) iter.Seq[V] {
    return nil // TODO
}

Published: continue reading »


javascript canvas

Cursor — Weekend Project

Recently, I was nerd sniped by a YouTube short about a Reddit post that showed a rotating cursor. I thought it was a neat idea and wanted to see if I could implement it myself. So, I spent a weekend creating a cursor that points to the direction your mouse is moving. Little projects like this allow me to test my skills and learn new things. Hopefully, you will find this project interesting and maybe even learn something new.

Cursor Demo

Published: continue reading »


tree javascript

Dots QuadTree

Some of you may have noticed the background of this website and how it kinda looks like animated clusters of stars. This is a project I have been tinkering with for a while as a way to play around with Canvas, data-structures and performance optimization techniques. Over this post, I will introduce this project, walk through a few versions of it, and show how it has improved over time.

Published: continue reading »


linux python

GPS Backed NTP Server

This post covers all the nitty gritty details on how to configure a GPS backed NTP server (and a few stumbling blocks I found along the way).

Published: continue reading »


css javascript web development

Optimize for the Web

In a world of broadband internet and fast hardware, optimizing websites and web applications can seem like a meaningless task. But what can the extra code you are sending your clients really cost? After reading In Defense of Optimization Work, I set out to revamp this very website, just to see how much cruft could be removed.

Published: continue reading »



collaboration CRDT

Convergent Document Collaboration

While working with Workiva, teammates and I designed and implemented a method for “Convergent Document Collaboration” using CRDTs. After operating with success, our legal team helped us produce a patent to help protect Workiva’s Intellectual Property.

Published: continue reading »



algorithms testing release

Pipelines Testing and Release Strategy

The operating cost of modern data-centers is the primary concern when considering “cloud” based algorithms. These data-centers contain numerous machines that run distributed, graph based algorithms in order to fully take advantage of the available resources. We attempt to lower the operating cost of such systems by leveraging the graph structure during the testing phases of of a software release cycle. Applying this technique involves modifying typical system hypervisors and the ability to support a multi-staged environment. We use the term multi-staged to concisely describe any composite environment consisting of a development environment, a QA environment, a staging environment and the production environment. We verified this result by running a sample application on both architectures and measuring operating cost of the underlying systems. Our tests confirm, for this case, that operating costs can be reduced significantly by this modification of data-center hypervisors.

Published: continue reading »





btc startup PHP Angular

SubmitCoin

SubmitCoin was started to enable the crypto currency community to gain the ability to spend Bitcoin easily. Debuting at the StartUp Weekend Missoula Montana event SubmitCoin has moved forward to expand the offering and now has offices and representatives in Missoula, MT and New York City, NY.

SubmitCoin

Published: continue reading »








visuals

JavaScript Calendar

This simple script is derived from jszen’s blog. While he has done lots of great work, you will see my script has no use with double for loops. This greatly improves the speed at which this script can execute and simplifies the algorithm substantially. Also, I added the ability to scroll through the months, NBD.

Published: continue reading »



Linux server issues: iNodes

When the df  command reports that you have plenty of disk space, yet you continue to receive several “not enough disk space” errors, your issue is probably with iNodes.  Verify this is your problem by seeing that the df -i command returns 100% usage on a particular drive.

For me, this usually occurs when an application creates a ton of small files in a single directory.  In order to find all these files, I started at the root with the command mentioned below and looked for the most files and drilling down and repeat.

Published: continue reading »



hack why?

Just got hacked + linux search

That was fun! Turns out somebody exploited two of my WordPress Plugins, which have now been restored or deleted.

This hack was luckily, mostly unsuccessful since the hacker(s) were script kiddies and couldn’t figure out how to make nsTView work on this system, rendering its remote management capabilities useless.  To be fair, they needed some smarts to navigate the WordPress system, but I have a feeling they just attacked with an auto-hacking script.

Published: continue reading »


RC car to WiFi Car (Beginner Robotics)

When I was a senior in high school we (classmates) were asked to come up with a senior project.  Having always wanted to dabble with robotics and control systems I proposed the idea project of building a WiFi controllable RC car.  Our idea was simple enough, take an RC car, rip all the “guts” out, load with our custom build hardware and software.

Using a toy car as our base we soon found a multitude of problems at the time, most of which resulted from a budget of $0.

Published: continue reading »


chrome

How to restart Google Chrome

Being an excessive tab user, I am often run out of memory on my machine. Realizing I need to close a few tabs (around 73) I do so, but that pesky flash memory just doesn’t want to be returned to the operating system. The only way to free the used memory would be to close chrome completely, and lose all the opened tabs. The other option is to wait for Google to push an update and use the ‘restart chrome to update’ option. This works sometimes, but like the rest of America, waiting isn’t really in my dictionary. Fortunately there is a way to restart the browser and save all your lovely tabs.

Simply navigate to chrome://flags/ (sorry no link, chrome doesn’t let you link to that page for security reasons).

Published: continue reading »


Make your own Linux commands!

Have you ever wished there was a short Linux command for several lengthy piped commands, or even a script, that is often used? (Of course you have, lets be honest here!) Fortunately for you, there are two ways to do such a thing.

Published: continue reading »




hack

Stop the snow - online that is!

Short rant with a short fix today.

BACK-STORY: While browsing the wonderful Internet this holiday season, I have noticed a few sites adding a particular ‘Snowing’ script that provides a nice and graceful snowing effect.  Unfortunately, for those of us nerds who are tab-whores, you know who you are, having a JavaScript intense process on one tab, kills the entire system by eating up valuable system resources.  Fortunately, there is a fix, as seen below!

INSTRUCTIONS: This method uses JavaScript injection, which consists of typing code straight into the address bar of a web browser and executing it by ‘navigating’ to that page.

Published: continue reading »


journalism why?

Newspapers - a thing of the past

Seen in the last page of today’s Helena Incorrect Independent Record is a half-page ad for the the quality information newspapers have to offer.  To prove this, the same ad shared a link to www.newspaperproject.org, which does not have anything to do with newspapers.  In fact, the domain was for sale.  Such a fine example of good, quality journalism.

Published: continue reading »


hack jQuery

Hacking Pandora and a better internet

Ads and that stupid ‘Are you still listening’ button are constant annoyances while trying to enjoy the wonderful custom playlists. Both of which are removable, just don’t talk to loud or they will figure something out to make this difficult (note the absence of links to Pandora from this article). Note: these instructions are meant for Google Chrome, clearly a superior browser, but that’s another story.

Published: continue reading »


college presentation

Web Analytics for Database

Alright, so a undergraduate thesis is not that big of a deal, but it is a fairly large undertaking. I have spent a lot of time, already, working on this particular thesis, but I just started this blog so I will skip the early humanities of my thesis work.

Published: continue reading »







artificial intelligence

Computer Vision RSU

This summer, I researched license plate recognition, or more specifically, license plate localization. The process of license plate recognition consists of two main parts. With an input of a live video feed or static pictures, first find a license plate in the picture (license plate localization) then convert the sub-image to plain text. My work is based off of Shen-Zheng Wang and His-Jian Lee’s work in A cascade Framework for a Real-Time Statistical Plate Recognition System. The main focus of their work was to grab as many possible license plates in a picture and eliminate possibilities later using properties of a license plate and conditions of surrounding areas of license plate.

Published: continue reading »


×