Sourcehut: Open Source Software Development Platform

With the ubiquity of Git, there's always the question of where do I host my code? Github is obviously the dominant domain for developers but I can understand the reluctance of many free and open source software proponents to use an entirely closed source system. And with the new owners, it's an even less appealing prospect—particularly for those who have been around a little longer than Gen Z. Sure, there's a surfeit of options but the majority are, for the most part, Github clones.

This is where sourcehut—heretofore known by its abridged moniker sr.ht —shines.

It provides all of …

more ...

netcalc update: it's 2019 after all

After receiving a request from Martin on the misc@ mailing list to make IPv6 the default version for netcalc, I decided to implement my original idea of dynamically detecting which version IP address the user supplies so that no switch is necessary to discern the two. It was a trivial change but definitely an improvement. And, like Martin remarked, "it's 2019 after all." Despite the fact that IPv4 still traffics most of the Internet with approximately 75% coverage, any encouragement to implement its successor should be the default position.

I am a little surprised that IPv6 wasn't the default being taught at …

more ...

IPv4 and IPv6 CIDR Subnet Calculator

tl;dr: download netcalc—an IPv4 and IPv6 subnet calculator—to make subnetting easier.

In one of my Computer Science units last year, we did some work on subnetting. It was pretty interesting but also highly programmatic. So like any good CS student, when you have a repetitive problem to solve—such as calculating subnets—you automate the process; which I did. I first wrote a program in Python but then decided to create one in C. It was only good for IPv4, though, as that's all we worked on at university. More recently, I thought I'd expand it to include IPv6 …

more ...

Unit testing with pytest—not easily ignored

Not as easy as advertised!

Days 10–12 of the 100 Days of Code course from TalkPython is dedicated to unit testing with pytest, and has been a plenitude of information. Prior to this, I had very little experience with pytest and found it less intuitive than the language itself—at least at first. And I think this was due to trying to sophisticate the actual tests; rather than hardcoding the input and expected output of a given test for a function with the parametrize decorator, I would essentially try to rewrite the function logic in a different way to reproduce the …

more ...

100 Days of Code

Days 1–3: Working with Python's datetime module

I'm two weeks into a protracted break from school—a 6-week long holiday before term 2 commences—so I picked up a free online MIT IAP 4-week course in C and C++, and finally started a couple Python courses I bought about a year ago from TalkPython taught by Mike Kennedy. They're admittedly a little basic for my level of Python now, but I'm still learning some Pythonic fundamentals I missed as well as reinforcing good habits so it's been a sound investment of my extra free time while on term break. I completed …

more ...