https://pine32.be - © pine32.be 2024
Welcome! - 58 total posts. [RSS]
A funny little cycle. [LATEST]


Search 58 posts with 29 unique tags


#1716911837


[ c | lisp | BYOWL ]

Just finished chapter 13, which added flow control. Recursive functions are now possible like one that calculates the Fibonacci sequence. It is not that fast, even compared to Python but at least it works.

lzp> def {fib} (\ {n} {if (<= n 1) {n} {+ (fib (- n 1)) (fib (- n 2))}})
()
lzp> fib 25
75025

#1716581850


[ c | lisp | BYOWL ]

Almost done with chapter 11 of Build Your Own Lisp and I have finally variables (that are immutable actually) and you can do some funky stuff with them. This is maybe very basic for any lisp but I have never used a lisp.

lzp> def {arglist} {a b x y}
()   
lzp> arglist
{a b x y}
lzp> def arglist 1 2 3 4
()   
lzp> list a b x y
{1 2 3 4}

#1716490138


[ music | selfhosted ]

Another reason to host your own music, sometimes albums on Spotify are just missing a track. Like the example below from Crystal Castles. If you self-host it with Navidrome, for example, you can put whatever you want on it, whether it has been removed for legal reasons (often sample licensing) or it is unreleased. Very annoying when Spotify doesn’t even tell you that a track is missing, especially when they are such bangers.

Kept by Crystal Castles on Amnesty (I)

Side note. A great feature of Navidrome, I could just download this track with the format and bitrate I want, 320kbps mp3 in this case. De server just transcodes it on the fly for smaller download sizes. I have this track in FLAC but that file is more then 30MB, way to much to post here.

#1716107769


[ music ]

I am try a new thing for my music. Making a playlist of 50 tracks each month. I hope this will be better organized the my current setup. I am still planning on automating music sorting with AI though. Shout out to ii* for the idea.

spotify playlist sceenshot

#1715841763


[ c | lisp | BYOWL ]

Finally learning some C. I am following Build Your Own Lisp by Daniel Holden. The final code should only be about 1000 lines so it’s a small project but still a great way to learn C. I’m only on chapter 7 of 16, but so far I’d recommend it.

#1715288892


[ mb_dev | webdev ]

Finally added cache busting to mb. I should have done this long before but I only learned this technique recently. For some reason I never wondered how bigger sites did this.

For those who don’t know what cache busting is. It’s a technique used to force a web browser to download the latest version of a static file (css, img, …) instead of using a cached version. This is done by making every version of a file have a different and unique name, so the browser won’t recognize the updated file and will fetch it from the server. I have done this by adding a hash of the file to the filename, for example main-ad5d104a4a86.css.

With every version being a unique file we can update the Cache-Control header.

Cache-Control: public, max-age=31536000, immutable

This the most aggressive caching that you can configure, it tells the browser that this file will never change and that it will never need to refetch it from the server. This could be a problem for normal files but this is perfect for this usecase because we have control of the clients cache from the server.

Normally these hashes would be added at build/bundle time. But Golang doesn’t have these options so I did it at start-up of the server. Luckily Golang is very fast so it didn’t add any time to the start up (1-2 ms). The implementation works better then expected.

The perfectionist within me did try it with code-gen and it did work, see commit. But it didn’t feel clean or maintainable and was drifting from the goal of simplicity of this project, so I decided to scrap it.

#1714938699


[ music | core ]

To many “breakcore” songs sound the same, and use the same samples, with the same kind of chops. Same Same Same. The market is over oversaturated.

Breakcore is also a hard to define genre, especial with the new wave of breakcore that is most of the time just DnB. That is also why I use the label ‘core’ on this blog, for me it is a more inclusive label. That way I don’t mislabel tracks but I can still group them by the breakbeat vibe.

It know that the term ‘core’ doesn’t mean anything and that there are a lot of genres ending in ‘core’, but it makes sense in my head and this is my blog. Maybe ‘breakbeat’ would be a better label now I think about it. Ah, it is what it is and I am not going to change it.

Finally something different.

Cover Art

Cover Art

#1714410798


[ music | drain ]

New Bladee album (Cold Visions) is bad, nothing new. More trap style beats, now he just sounds like hyperpop X 83HADES. I’m not going to waste any more words on it.

Cover Art

#1714324368


[ linux ]

It’s that time of the year again. But this time I will swap for real guys, trust me :). Basic Arch install for now, I want to test out Xfce and Hyprland on an old machine first before I make the real swap. This time I didn’t use an Arch installer, I installed it all by myself.

Archlinux neofetch

#1713557458


[ mb_dev ]

We do a little refactoring.

Showing 58 changed files with 406 additions and 352 deletions.

Project structure is now much better, less global var’s etc.

#1713121703


[ rant ]

simple != easy

Golang is simple, which means that its easy to understand.

Running a marathon is simple; you just keep running. But nobody would call it easy.

So why do people call Python easy and simple? Things only seem simple until you need to do something complex. Then the complexity starts to compound.

People need to take complexity more into account when choosing a technology. The amount of magic that is happening always has a cost. You just need to consider if you will pay that cost for a certain project or if you will never run into the downside.

Simple things are not always better, to be clear. But they have their place, and recently I am leaning more towards simpler solutions. They may require more work, but at least I know that I understand most of the things that are happening.

#1712829445


[ music | hardcore ]

Hmmmmm yes, sounds

Cover Art

#1712519722


[ music | electro ]

People are sleeping on WHIPPED CREAM.

Jasiah’s vocal…

Cover Art

Cover Art

#1712417261


[ mb_dev ]

Just added metadata and updated the colour scheme for better contrast. With these two updates completed, I finally have a perfect Lighthouse score.

screenshot of perfect lighthouse score

#1712394774


[ cover_art ]

🔥🔥🔥

PAIN IS GOOD - 1 800 PAIN

cover art PAIN IS GOOD - 1 800 PAIN

#1712090133


[ webdev ]

The datalist element is pretty cool. You can make dropdown inputs that are still editable realy easy. Came in handy today.

<label>
	Choose a flavor:
	<input list="ice-cream-flavors" name="ice-cream-choice" />
</label>

<datalist id="ice-cream-flavors">
  <option value="Chocolate"></option>
  <option value="Coconut"></option>
  <option value="Mint"></option>
  <option value="Strawberry"></option>
  <option value="Vanilla"></option>
</datalist>

Source example: MDN Web Docs

#1711884999


[ mb_dev ]

Today is the first day of summer time and mb handled it correctly. I did not expect it to work correctly because I can’t recall implementing it.

I think the system will break if you change the time zone after the fact. Posts don’t store time zone data, only a Unix timestamp. Just don’t change the time zone I guess.

#1711279188


[ webdev | mb_dev ]

Finally added the RSS feed to mb. Wasn’t to difficult using the encoding/xml module of the standard lib and exactly 100 lines of code. It’s basic but it’s valid and it works. Maybe I will flesh it out if people actually use it.

[Valid RSS]

#1711234656


[ music | core ]

…Because I’m Young Arrogant and Hate Everything You Stand For

love the album title

Cover Art

#1710948563


[ webdev ]

javascript fatigue:
longing for a hypertext
already in hand

- HTMX

#1710620087


[ mb_dev | photography ]

Mb has finally support for file uploads, only images for now. Video and audio is planned, soon™. The blog is more self sufficient with this feature added, not dependent on any other services.

blue bug

photo credit: ii*

#1710601100


[ webdev | mb_dev ]

Just found out a way to add hotkeys to a website without using JavaScript.

<a href="/auth" accesskey="a" aria-hidden="true" tabindex="-1"></a>
<a href="/media" accesskey="m" aria-hidden="true" tabindex="-1"></a>
<a href="/backup" accesskey="b" aria-hidden="true" tabindex="-1"></a>

aria-hidden="true" and tabindex="-1" are there to keep screen readers happy (and to keep my Google Lighthouse score high).

These hidden elements add alt + x hotkeys. It always surprises me how many things the HTML5 spec has integrated.

Shoutout to this article for the idea.

#1710190961


[ music | hyperpop ]

Vibe, post-workout

Cover Art

#1709333288


[ golang | docker | mb_dev ]

Docker vs Native binary

Tested the backend of this blog on small VM on my desktop with both a native binary and Docker to compare performance. My desktop could have a lot of variance so this test is not that accurate. The VM has 2GB of ram and 4 cores allocated. Memory is not limiting factor as the webserver uses 20MB at most. All 4 cores are utilised but the one core is always more used then the other, I assume that this is the case because the webserver is database limited for the most part. SQLite is in some ways single threaded.

  1  [|||||||||||||||||||||||||||||||   78.5%] 
  2  [||||||||||||||||||||||||||||||||  80.2%] 
  3  [||||||||||||||||||||||||||||||||  80.3%]
  4  [||||||||||||||||||||||||||||||||||95.7%]

I used the latest version at the time of writing.

I did 3 runs of each, alternating between the two version to limit variation. I used a tool called bombardier with 20 concurrent connections for every 10 second run. The requests are made from the host machine to give the webserver the whole VM to itself. This does add extra overhead but it is the same for both versions, so for sake of comparison this is fine.

These are the averaged results for both versions.

Binary

Statistics        Avg      Stdev        Max
  Reqs/sec       262.03     152.02     913.95
  Latency       75.22ms    53.44ms      0.93s
  Latency Distribution
     50%    71.05ms
     75%   104.18ms
     90%   127.14ms
     95%   143.13ms
     99%   188.12ms
  HTTP codes:
    1xx - 0, 2xx - 2643, 3xx - 0, 4xx - 0, 5xx - 0
    others - 0
  Throughput:     3.15MB/s

Docker

Statistics        Avg      Stdev        Max
  Reqs/sec       260.70     150.30     962.85
  Latency       76.59ms    53.97ms      0.95s
  Latency Distribution
     50%    70.67ms
     75%   107.55ms
     90%   135.69ms
     95%   151.88ms
     99%   197.22ms
  HTTP codes:
    1xx - 0, 2xx - 2622, 3xx - 0, 4xx - 0, 5xx - 0
    others - 0
  Throughput:     3.12MB/s

These results are really close with a very slight edge for the binary. Only 0.5% more requests per second and 1.78% lower latency on average. This is within the margin of error for this unstable setup. But even if we would take these results as 100% accurate I still think it is worth the small hit in performance. This small hit is probably even smaller when you are using a bigger server on more native hardware.

#1709055561


[ golang ]

I am going to keep spreading Golang propaganda until everybody uses Go and then I will make my move to Elixir or OCaml.