23.04.2025 - julia.txt

It's been a few years, and now I'm trying again to learn (to love) Julia (the programming language). One very important thing which was not clear to me from the get-go, is that if you want to run a Julia file multiple times, you absolutely need to do it from the REPL. If you call it from the command line, Julia will JIT-compile everything again and again.
For example, assume there's a file time_test.jl containing only a single line,
@time using Plots
In the above example, we import Plots and measure how much time it took. Running this file three times in the shell will output
>>> julia time_test.jl
  4.839571 seconds (1.68 M allocations: 102.641 MiB, 3.99% gc time, 2.73% compilation time)
>>> julia time_test.jl
  4.732288 seconds (1.68 M allocations: 102.637 MiB, 4.22% gc time, 2.57% compilation time)
>>> julia time_test.jl
  4.592076 seconds (1.68 M allocations: 102.642 MiB, 4.21% gc time, 2.66% compilation time)
Now, if I open the Julia REPL, and run the same file three times (by calling include("time_test.jl")), I get
>>> julia
julia> include("time_test.jl")
  4.198994 seconds (1.44 M allocations: 88.602 MiB, 6.02% gc time, 3.37% compilation time)
julia> include("time_test.jl")
  0.001341 seconds (326 allocations: 18.141 KiB)
julia> include("time_test.jl")
  0.001429 seconds (326 allocations: 18.141 KiB)
Adding another library will not cause Julia to recompile entirely; only the new library will be compiled.
@time using Plots
@time using ITensors
will result in
julia> include("time_test.jl")
  0.001315 seconds (326 allocations: 18.141 KiB)
  3.173273 seconds (1.03 M allocations: 61.453 MiB, 10.38% gc time, 6.27% compilation time)
julia> include("time_test.jl")
  0.001294 seconds (326 allocations: 18.141 KiB)
  0.001292 seconds (326 allocations: 18.148 KiB)
This might be clearer to some. It wasn't to me.

12.01.2025 - sadcards.txt

Finally finished a *thing* I was working on from time to time for a while. It's a random playing card creator. For now you only open a single booster pack, and that's it, but I was thinking of ways to turn this into a game. It looks ok for a first iteration, but I might make it a bit better in the future.

20.11.2024 - enum.txt

If you want to make an enum in python, you have to make an enum subclass and write something like:
from enum import Enum

class MyEnum(Enum):
    SOUP = 0
    SUSHI = 1
    PIZZA = 2
print(MyEnum.SOUP.value)
Can you still do it if you hate importing modules? and classes? Of course you can, as long as you believe that functions can be *anything*
def my_enum(): ...
for ind, s in enumerate(["SOUP", "SUSHI", "PIZZA"]):
    my_enum.__dict__[s] = ind
print(my_enum.SOUP)
This code is also one line shorter. What's not to like?

08.11.2024 - linkroll.txt

I now have a linkroll! Check out my pile of precious internet bits here.

13.09.2024 - nan.txt

Funny thing about the not a number (nan) implementation in numpy.
>>> import numpy as np
>>> np.nan is np.NaN is np.NAN
True
>>> np.nan == np.NaN == np.NAN
False
Which makes sense, because nan is never equal to anything, but any nan *is* any other implementation of it. Moral of the story: don't assign stuff with arr[arr==np.nan]=x. It won't work. Use np.isnan(x).

01.09.2024 - rimes.txt

Created a rhyme dictionary over yonder. Works pretty much as intended: you put a word in, you get the rhymes out.

22.07.2024 - gitlog.txt

Added a new nav element: it's a list of the commit messages. I thought that they may as well be public. It also gives the impression that I write a lot of stuff, and encourages me to keep up with my goal to write more informative commit messages.

04.10.2023 - proverbes.txt

Added a collection of proverbs from the (french) Littré dictionary, which you can find online at this address. These proverbs are old-timey sounding but very fun to read, and have an enjoyable bucolic quality to them. For extra fun, I added a random proverb under the nav bar. See the collection here

26.03.2023 - celebrites.txt

Created célébrités, which uses the data from this Nature paper to pick random famous people, with a short blurb included. Useful for the "who am I?" game, mostly.

26.03.2023 - internal_errors.txt

man .htaccess can really crash your stuff

10.08.2022 - neolocutions.txt

Created néolocutions, to get some random-ordered inspiration. Split mots & expressions.

05.08.2022 - cool_words.txt

Reorganized the website, made a project directory and added a list of cool words

29.07.2022 - infinite_ways.txt

Now you can generate more choruses to Paul Simon's 50 ways to leave your lover here.

04.06.2022 - haikus.txt

Creating poetry through translation is pretty fun. Here are two pages of curated deepl-generated haikus. The first collection, and the second one.

31.05.2022 - coffeepot.txt

Apparently you can output your Blender render to SVG. pretty cool!
a coffee pot
And then you can add effects in inkscape. Pretty nice too. (it's still a vector drawing)
an affected coffee pot
You can render the whole animation. But the file size is terrible. You have to manually combine all paths in inkscape to reduce it.

29.03.2022 - date_coding.txt

Actually, the dates are a bit strange. I really don't understand coding.

29.03.2022 - recipes.txt

Fixed the PHP blogging thing. Now the dates are generated using filemtime, which means the first three posts are correctly dated to the day when I created the PHP blogging thing. But not when I wrote them. Anyway, still no thoughts, so to speak. Also check out these recipes: sfcdt.com

24.12.2021 - php_blogging.txt

Now I've got a little PHP blogging thing. Nice work!

25.05.2021 - js_genexpapp.txt

Check out my neat JS expression generator

02.05.2021 - push_to_dep.txt

I finally got git to work, it's called "push-to-deploy" and it's the hottest thing in the modern world..

01.01.2000 - this_is_my_website.txt

This is my website. I'll probably write some thoughts here.