What are you coding?

Wait Day 25 part 2 doesn’t exist??? Or do I need all previous stars for the final puzzle?
I just finished part 1 now because I ran out of time yesterday.

I am currently missing

  • 15.2 too lazy me
  • 21.2 though I know how now thanks to clues from mastodon
  • 24.2–not enough time but I have an approach I know will work eventually. Just a bit of fiddling

All these need a bit of quiet time and today is not that day. More family xmas. More eating.

3 Likes

Yes, 25.2 is traditionally “have 49 stars”.

4 Likes

Still fiddling around with both 24.2 and 21.2 but my brain isn’t all here today.

Instead I started a new python/flask/Sqalchemy project… I’ve been making printed calendars for everyone in our local inner circle for years. One of my friends suggested yesterday that it would be cool to have a surprise image every day of the year–after I “complained” that I had more images than I could fit in a calendar.

So I have written the tiniest python web app I can think of: if the date is in the past and the year exists display an image that is in the images folder that corresponds to calendar-year-dayofyear.jpg

Allow navigating to previous images… prevent peeking to future images :wink:

I am too tired today though to do much more than the basic setup of everything. But I really like the idea. Also might want to try and add a birthday list.

4 Likes

And I have finished a working MVP and deployed it to my server. Can’t show off. I am considering putting a basic password protection up or eventually doing something with login. Those are personal pictures including pictures with minors…

I have done a few retro images to show off to my friends today and uploaded the first 17 pictures for the next few days :slight_smile:

I have tons of ideas for features to add for now it displays a single image for a day and has prev and next buttons to navigate to previously uploaded pictures. It prevents looking at future pictures :slight_smile: I can read exif data and have put captions as titles on the page and the date the image was taken.

Depending on how it is received I will keep programming on it. Currently the code is only available on my gitea. I might consider adding it to my github repo… but not today. I now need to do some prep for tonight’s party I promised to bring a salad and some treats.

5 Likes

I did a low pressure catch up with Advent of Code 2015 (the first one I tried was 2018, the first one I did at all well at was 2019). Without the pressure of a daily problem, I was able to take more time to fiddle with the code and do things right. Good fun.

4 Likes

I’ve been working on converting some Python code for performing FFT/DSP into C++ to run on the Raspberry Pi Pico.

I’m somewhat regretting not using MicroPython as that would have probably made it trivial but I wanted to stretch my C++ skills and to play with things like DMA.

Most of my time so far has been spent figuring out how to do all the matrix multiplication stuff that you get for free with numpy. Eventually I’ll get to the blinky lights bit.

5 Likes

Someone put together a cheatsheet for the matrix library I’m using with the equivalent MATLAB commands. Bless them.

My MATLAB is a bit rusty, even after 5 or 6 years of using it sporadically for work, but it’s a good launching off point.

4 Likes

Today has been refactoring and unit testing so not much forward progess with the code.

I use CMake for a project at work but getting it working with VS Code and the Pico ecosystem feels like a different set of hurdles to jump. I have however managed to separate my code into some libraries and implement some basic unit tests for those libraries so I’ll call that a win.

The aim here being to build confidence in the FFT/DSP/matrix maths without having to do it on the Pico itself.

4 Likes

Apparently what I am coding in at the moment is Typst, a layout engine…

OK, define “a layout engine”. I want to produce a pretty document (as a PDF). I want to do layout with columns and tables of contents and stuff like that. I’ve been using LibreOffice so far, but LibreOffice is basically a word processor, not a DTP package, and it creaks a bit on large and image-heavy documents. What normal people do in this situation is run InDesign or Pagemaker, and there’s even a Linux package that can do this kind of thing - “Scribus” - but I really don’t get on with the idea that everything is defined by mouse clicks and drags. I want to say “page is this size, margins are that size, lay out two columns with this much gutter”. and have that stick for the rest of the article.

So this kind of layout engine takes a mixture of text to print and formatting instructions (in effect a program in a very specialised language) in a plain text file (plus images); one could regard it as a more modern version of TeX or Troff. There is one publication in particular that I’ve been working on that stretches LibreOffice rather hard, and after a few days of bashing at it Typst handles its special formatting needs quite well.

You can pay Typst to use their web site, but they also have what I really want, which is code I can run locally that doesn’t depend on any external services. I just typst compile FILENAME and out pops the PDF.

I’ve been saying for at least a couple of years that I wasn’t writing up various role-playing stuff because I didn’t have the layout system I wanted. Well, no excuses, now I do.

7 Likes

Ooh, I like this and had not heard of it before.

1 Like

Good to know there are Sequels. It has been ages since I needed LaTeX but I never know …. currently my documents tend to be Word or Confluence but both suck in their own unique ways.

2 Likes

Presumably you also need to feed it font files, and it extracts font metrics from them?

1 Like

Yes, but it runs on standard ttf/otf rather than needing a special format.

2 Likes

Another night, another C++ implementation of some functionality you get for free in numpy/MATLAB

Somewhat surprisingly I actually managed to trawl my brain for something I did at university a couple of decades ago. I only needed the first stage, creating and applying the Gaussian filter. I was amazed when the right answer popped out without too much hassle.

Another piece of the puzzle down.

4 Likes

Well I got all my unit tests working so moved over to the micro-controller and almost immediately ran out of RAM. :upside_down_face:

I shouldn’t be surprised as I’m generating some very large matrices in the calculations I’m doing. Makes sense as to why the original implementation offloaded that processing to a PC.

Might need a bit of a re-think.

4 Likes

Have you tried porting the project to a universe with a more simple reality? Could reduce complexity quite a bit.

3 Likes

Couldn’t sleep last night thinking about this.

In my testing so far, the biggest matrix uses about 192kB of memory. It is however incredibly sparse with a predictable arrangement. I’ve managed to extract only the populated bits as separate matrices and the memory needed is now about 8kB.

And my unit tests still pass! Fingers crossed it’ll run on the micro-controller now.

5 Likes

It runs*!

*Enough for me to find some more issues. At least these aren’t RAM-related.

6 Likes

At least for now I have added Typst to the languages in which I’m doing the (formerly Perl) Weekly Challenges. They’re usually not super hard problems, which is good, because I’m now doing each of them in twelve languages.

Yes, that’s Typst the layout engine. One of the things I like about it is that it’s honest about being a programming language too.

5 Likes