A sleepy fox wearing a starry witch's hat
Home | About | Blog | Contact Me |

French Republican Calender Bot

7/7/22
The French tricolor in front of a twitter blue background. In front is a clock showing decimal time, and a smaller inset face showing standard time. A faint shadow of a guillotine can be barely seen

It's finally here, the thing nobody asked for!

So a couple of months ago I was listening to Mike Duncan's Revolutions podcast, the section on the French Revolution in particular.

I don't want to get into my opinions about the French Revolution too much because

  1. That's not what this blog post is about, and
  2. We'd be here all day

So putting that aside, one thing I will say is that I can't help myself, I find the French Republican Calendar simply charming as an idea.

And, looking for a project to build, stumbled on the idea of having something that would help me keep track of today's date in the French Republican Calendar.

Normally I would whip this out as a quick console project but I don't love the ux of console apps all that much (as quick as they are to make). But I also didn't want to make a fully integrated GUI app either. Honestly I wanted to make something that I could set, forget, and only check as often as I felt like it.

And that's when the idea of a twitter bot struck me. It's perfect. And getting experience with the Twitter API seemed like a good thing to have.

"I'll just make a twitter bot." That was me. That was how I sounded. Naive and optemistic.

This project took three times as long as I anticipated for two major reasons. Calendars, and Twitter. Which are the only two parts of the whole project so what does that tell you about my estimates?

First, calendars. It turns out that converting one date into another date is... Hard. Like. Really really hard. I naively thought that this was as simple as "count the number of days since x, then divide." It should have been that simple. It really, really wasnt.

For reasons I don't fully understand my equations kept coming back wrong somehow, it would get the date right but the year was off, it would get the right year but then the month wouldn't be right. I kept checking and rechecking my code and as best as I could tell it was so close, it wanted to be the right date so bad. But in the end I couldn't figure out why my simple "take number of days and divide repeatedly" trick wasn't getting me anywhere. I wanted it to be that elegant of a solution, but I gave up on that idea.

In the end what saved this project was me finding the Repubcal library online, which handles the date conversion for me. It uses the ephem library to run actual astronomical calculations to get the precise start and end of each republican year and day.

Oh, yeah, that's a thing, if you weren't aware, Republican years are defined as beginning on the Autumnal Equinox. Personally I love that for a lot of reasons but yeah it did make this whole project way harder.

Anyways, now I had a working script that could scream out a text string with today's date converted into the French Republican Calendar. Neat! Now I need to get it to scream it into the internet and not just my console.

I'll admit this one is entirely on me. I misunderstood the sign-up instructions for Twitter API access and botched the whole deal. I deliberately set up a separate twitter account for the bot, and even made a custom art and banner for it. I was really excited to show it off. However I signed up for dev access on my main twitter account. Which meant the keys I had got me access to my main twitter account, but not the bot account. So I couldn't use those keys to post to it. That minor set back basically killed my whole enthusiasm for the project.

Then the French Presidential Elections were happening and I will not be shy about saying that in the tension of Marine Le Pen potentially becoming President of France, I was really concerned about publicly working on and promoting a project romanticizing anything French.

I decided to shelve it. Thank God, Le Pen lost, but I was already frustrated with not being able to sign my twitter bot up for API access because I'd already signed up using my main account and had to unvalidate my phone number on that account to use it again with the bot account and.

I just put it off for like a couple of months. Then one night, spontaneously, while I was looking for another project to work on, I decided to go and fix that issue that I'd been putting off and finishing this damn thing. And to my delight, it worked. I finally got it working.

And now it's here! A bot that does nothing anyone needed! Now you too can know today's date in an obsolete and objectively useless calendar! Isn't it great! =D

Honestly I can't help myself, I am delighted every time this thing manages to post to Twitter. It's fantastic.

I plan to maintain this for the forseeable future, and maybe add features. It'd be nice if it also integrated the Rural Calendar (which is a whole deal but trust me it's half the charm of this calendar).

I'm also going to write up a separate page on my website to show off completed projects like this one, and to provide a sort of "FRC Bot FAQ" for people going "what the hell is this?"

Anyways, please enjoy this twitter bot celebrating a silly little calendar. There may be things about the French Revolution we need to bring back... But this one is definitely not one of them. Okay. That's it. Au revoir~

A Card Sorting Experiment

6/18/22
A demo of a card sorting game. A row of shuffled playing cards is set on a green background. An arrow moves between the cards, then one is picked and moved to the center top of the screen. Then the rest of the cards are divided into two piles to the left and right, based on their value being lower or higher than the chosen card.

So I have a bit of a confession to make.

At my last job the most enjoyable part, the best fun I had, was alphabetizing the documents. Just hand sorting a cabinet full of files.

No. Seriously.

It was the perfect kind of work for tuning out at a workplace where I had to be constantly 'on' for customers and everyone else, but also I take great pleasure in the joy and satisfaction of sorting and organizing things.

Sorting the files was relaxing and easy to do, and I was good at it because I had a method. I used QuickSort. Yes, for real, I really sat down and manually did a computational sorting algorithm on physical files at a desk. And it was glorious.

So I wanted to make something that would simulate that kind of experience. And I had the thought of playing as a postal worker sorting letters. Then, suddenly, the whole concept came to me. A game about sorting algorithms.

It starts simple, with bubble sort and insertion sort. But as it goes on, you get more and more letters, you have to sort through them more efficiently. But you also unlock the ability to use more efficient sorting algorithms. You can quick sort and bucket sort and pigeonhole sort.

It's a game that is about relaxing, gentle, repetitive, satisfying tasks, but also that teaches you about how sorting algorithms work, and thus a little bit of educational value in computer science. That's still hip, right?

I threw this demo together in about a week. It's got the basic idea down, but it's got some problems as well.

The biggest being that I used playing cards as the thing to sort in this demo because it seemed an easy-to-implement approach to the concept. I didn't consider that, when attempting to sort efficiently, playing cards are terrible.

They have a numerical value printed on them, but the suits are also ranked, and the suits come in two colors. Worse, the colors don't mean "high value" and "low value." Spades are the highest rated suit, and clubs are the lowest.

And so the only thing telling them apart is the shape of the suit, which at monitor resolutions with the size of playing cards I was using is horribly illegible.

It still manages to be kind of fun and satisfying, but ideally the things you are sorting in a game based on this concept would be bigger, more readible. Additionally, instead of having "suit and value" determine ranking, the things should all be ranked according to a single value which is easily readible.

Going with the original post office theme, there's the option of sorting everything alphabetically by name of recipient (which doesn't make sense for a post office), numerically by street number (which also doesn't make sense for a post office), or by zip code (which feels odd for my as an American, however Irish postal codes are all unique by design, so it might be the most viable solution).

Another disappoointment is that I couldn't figure out how to make sure the algorithm didn't break if the player made a mistake. That is, if the player sorted something by mistake, it would be really difficult to "undo," so I just don't allow the player to make one. Which feels like cheating on my part, but with how rudimentary the controls are I didn't want to risk the whole algorithm going wrong. In a more final version, maybe the player would be able to make mistakes and fix them? Or maybe the player would be prevented from making mistakes but would face some penalty. Because right now, as you see in the gif towards the end, mashing both left and right is the optimal strategy.

However, I also did a bubble sort implementation that took about a day to write and by god that one was way more fun. So I'm not ready to give up entirely on this idea, I think it has potential. At the very least it has the potential to make a very satisfying and distracting toy for me.

I don't know what to do next with this though. I want to try and find another algorithm to implement. Because it's not just about what algorithms can I program, but specifically how do I make the algorithm something the player can control? That's the rub.

I'm thinking about Heap sort next but I don't exactly know how to represent that visually. It seems like a fun challenge though.

Also, for those wondering, yes, the playing cards are in Cyrillic. I didn't pay attention when picking the card sprites. Whoops. >>;

Hellow

6/8/22
An icon of a sleepy fox wearing a starry witch's hat

You watch a small fox step her way through the dark forest and sit at your feet.

Hellow.

So, this is my first blog post, which can only mean that my website is now live. And here it is. Ta-da.

Yeah, alright, it's not all that much, but it's what is going to go here that I'm most excited about.

I have so many ideas that I wanna work on, so many projects, but I'm the kind who likes to work on things in waves, off and on.

As you can imagine, that means without a reason to finish something on a set deadline, it can take me a while to finish making something.

So, this is my compromise. Now I can feel free to work on stuff in whatever order I want, and people can see the progress I make, not just when I finish something. Hooray.

This website itself is still a work in progress. Not only do I intend to keep posting blog posts with updates on new projects, but I'm probably going to keep tweaking the design here and there to make it look better.

Some things you can expect... eventually

  • A better way to send me emails
  • Real blog posts not just announcing the website.
  • Possibly blog posts will be their own webpages? at some point?

Anyways that's all for me. Check this webpage to see if I update it with anything. Or not. I'm not your mom.

laters

The fox scurries off into the bushes. The leaves rustle, and then... silence.