Hi! A simple website where I put down some thoughts, code-related cheat sheets, book reviews, and concepts from physics and data science so that I don’t forget :)
Creating custom VSCode tasks
For this blog I’m using a plugin to display citations called hugo-cite. Unfortunately, this requires the citations to be stored in a CSL-JSON format, while most of the time I only have bibtex files. Converting one into the other is not so difficult (I have a script for that), but it gets boring to do this manually often. Just like all editors/IDE’s, VSCode has a way to simplify this process using tasks.
[Review] Can hallucinations made by large language models help in discovering new drugs?
A review of the paper: Hallucinations Can Improve Large Language Models in Drug Discovery by Yuan et al.
Custom matplotlib styles
Creating custom matplotlib styles is apparently super easy! For this blog I gathered all the matplotlib parameters and added them to a file called orange_dark.mplstyle. You’re supposed to put this inside the .matplotlib folder in your home directory, but for some reason that didn’t work out for me, so I put it inside the root of this blog folder and refer to it with a full path.
Now, if I want to make a simple plot, I can just do this:
Is hype all you need?
The last decade saw a few AI scientific breakthroughs that enabled the whole AI development to boom. For example, realizing that AI thrives on large amounts of data and GPUs (see e.g. (Citation: Vaswani, 2017Vaswani, A. (2017). Attention is all you need. Advances in Neural Information Processing Systems. )). Large language models had the problem for a long time that they were difficult to train, because (1) they couldn’t be trained properly on GPUs, and they suffered from something called catastrophic forgetting.
profiling time and memory using pytest
I was reading about a new benchmarking framework for quantum control software called Benchpress. Looking through the code, it seems to be built upon the
benchmark
plugin for pytest
. If you want to quickly benchmark your code, it’s quite easy to do with pytest-benchmark
…[Review] Can LLMs make trade-offs involving stipulated pain and pleasure states? - Keeling et al.
Can AI feel pain and pleasure? A study on the sentience of large language models.
[Review] Don’t Do RAG: When Cache-Augmented Generation is All You Need for Knowledge Tasks - Chan et al.
A better way of doing RAG? I don’t think so…
[Review] Sur la dynamique de l’électron - Poincaré
Around the same time as Einstein’s paper on relativity, Poincaré a similar paper…
[Review] [8/10] Fei-Fei Li’s The Worlds I See
A short biographical book by Fei-Fei Li, basically the founder of modern AI. She was the first visionary to realize that AI needs a lot of data to become useful. She started a very ambitious project with ImageNet, which was a database with over a million images, all labeled and categorized. She was also one of the first to heavily make use of the mechanical turk program to have a lof of people work in parallel labeling images over the course of a few years.
Managing multiple hugo versions
Some tips on managing multiple hugo versions between projects
Using git bisect to find a bug
Oops, you broke something but don’t know when? Use git bisect!
Auto activating conda environments when moving between projects
A simple script to automatically activate conda environments when moving between projects
Supercharging your terminal with fish and starship
Some cool enhancements to your terminal
[Review] [8.0/10] Richard Feynman’s Six not so easy pieces
In a small second hand store I was browsing books and there I saw this book for only €1.50! It’s a distillation from a few chapters from his famous The Feynman Lectures and concern special and general relativity. As a physicist both the author and the topics excite me, so I managed to read through it quite quickly. For non-physicists I wouldn’t recommend the book as it is quite technical (though everyone online contradict me), but for anyone either studying or have studied physics it’s a good read.
[Review] [5/10] Nick Bostrom’s Superintelligence
The book explores the idea of “superintelligence”, an intelligence that is above that of human in all regards. Nick tries to be rather complete in his exploration and defines different types and aspects of superintelligence, and then explores the implications for our future. Initially I was quite excited with the book. It seemed to be quite diverse and in-depth, and it was written right before the large-language-model boom.
Unfortunately, the book is quite dense and technical and I found it difficult to read.
[Review] [7/10] Kazuo Ishiguro’s Klara and the sun
A science fiction book based in a time where children grow up with an AI best friend. They are there to comfort the children, help them develop and give them strength and security to tackle the adult world once they grow up. We follow the robot friend Klara, and their human friend Josie, throughout Josie’s childhood. Through the eyes of Klara we learn about the world they live in, the social interactions between humans and AI and her observations act as a looking glass and a reflection on our own society.
How to pass custom prompts to langchain chains
Some examples of how to pass custom prompts to
load_summarize_chain
and load_qa_chain
Google Scripts to label GitLab related emails
How to use email headers to filter and label email notifications from GitLab.
Unit testing - Classical vs. London Approaches
A small post about the need for unit for unit testing in software projects, and the differences between London-style and Classical-style unit-testing.
Debugging gitlab pipeline docker containers
Sometimes a pipeline that is running on GitLab has unexpected behavior, but how do we access the docker image so that we can debug locally?
[Review] [7/10] Brené Brown’s Daring Greatly
Shame and vulnerability defines who we are and how it shapes our future. Although everyone has experience with shame and vulnerability, everyone understands it in a different way. Brené defines it as the fear of not belonging. Daring Greatly offers valuable lessons on shame’s role in work cultures and personal lives, underscoring the need for empathy and mindfulness as tools for navigating shame and fostering healthier connections.
Git ahoy! A Pirate’s Tale of Version Control
Yo-ho-ho and a bottle of Git! Follow the daring exploits of Captain Blackbeard’s rum-soaked crew as they navigate treacherous seas, correct their plundering mistakes with cunning commits, and master the art of version control on their ship, the Jolly Git Committer.
[Review] [9/10] Steve Magness’ Do Hard Things
“Do Hard Things” explores the misconceptions surrounding toughness. Using anecdotes from his experience in running together with the latest scientific results, Steve Magness teaches us how to “cultivate real toughness”. Right away Steve dismisses the conventional wisdom that harsh coaching and tough parenting characterized by verbal and physical abuse, produces real toughness. More often than not, such approaches act as filters rather than effective training methods.
All about type hinting in Python
What is Type Hinting? Type hinting is a feature introduced in Python 3.5 that allows you to annotate the types of variables, function arguments, and return values. It provides optional typing to the Python language without actually enforcing the types at runtime.
Type hints are used to indicate the expected types of variables and functions, making your code more explicit and self-documenting. They help you catch potential type-related errors early and improve code development and maintainability.
Getting rid of ‘fatal: The current branch has no upstream branch’ in git
How to stop Git from nagging about missing upstream branches by automatically setting the upstream for all new branches.
Mocking context managers with pytest
Mocking functions and methods for unit testing is not so hard, but mocking context managers can be tricky, as sometimes you will need to mock the
__enter__()
method as well…Some tips for using VS code for python development
A small (but growing) list of useful tips when developing python in VS code.
Easy data-scraping using REST API and request package
Often when webpages provide a friendly interface to download data, the data itself is fetched using a REST API. Most web browsers can easily intercept the request, which you can modify and edit. This is convenient if you want to use Python to download a lot of data, or if you want to set up an automated data download pipeline.
Here’s a quick step-by-step guide on how to do so.
[Review] [7/10] Pete Wu’s De bananengeneratie
Pete Wu’s book ‘De Bananengeneratie’ takes readers on a journey through his personal experiences growing up as a Chinese-Dutch in the Netherlands. Pete was born and raised in the Netherlands, but his Chinese heritage often made him feel like an outsider. He struggled to find his identity as someone who was ‘Chinese on the outside, white on the inside’, which he termed as being a ‘banana’.
[Review] [6.5/10] Matt Parker’s Humble Pi
Matt Parker some of us know from his appearances on the YouTube channel numberphile and on his personal YouTube channel standupmaths. Matt created a collection of funny situations and unexpected mistakes in the real world, that originate from math mistakes. It is a fun read to spend a few evenings, but unfortunately for me most of the problems I already knew.
Some highlights:
The oldest known maths error was found on an old Sumerian clay tablet that was made between 3000 and 3400 BC.
The $s$–$d$-model
The spin-density of conducting electrons in a magnetic medium can be obtained from the the
$s$
–$d$
model. Using the spin-density of these electrons we obtain equations describing the motion and relaxation of magnetic moments.A derivation of the Kubo formula
A short derivation of linear response formulas from a Keldysh-framework.
Magnetism in two dimensions
In recent years a promising opportunity appeared that can push spintronic devices to a two-dimensional limit. Eliminating one dimension has the practical benefit of reducing the size and energy consumption of spintronic devices.
Spintronics and the limitations of every day electronics
In today’s society electronic devices are heavily incorporated in everyone’s daily life. The everlasting desire to make our computers run faster, necessarily leads to smaller and smaller electric components. Where in the early 70s a single computer chip could host up to a few thousands of transistors, today the number approaches tens to hundreds of billions and soon will reach a fundamental limit.
Managing git ssh-keys for multiple accounts on GitLab and GitHub
If you only have one account for every git repository provider, for example, one for
www.github.com
and one for www.gitlab.com
, you will need to add the following to your ssh-config file…The Query Likelihood Model
One of the central ideas behind language modeling is that when a user tries to produce a good search query, he or she will come up with terms that are likely to appear in a relevant document. In other words, a relevant document is one that…
Copy large amounts of files over ssh
To copy large amounts of files over ssh you have a few options. The slowest option is using
scp -r
to recursively copy each file one by one, but it is faster and more convenient to first tar or gzip your home directory, copy it over to…How to ssh over WiFi between two machines running wsl
We first follow a tutorial by Scott Hanselman where we will use Windows’ openSSH to handle ssh connections and set the default ssh shell to be bash on wsl.
Setup ssh on your machine Choose one of your two machines to be the host. On the host, we need to first check if OpenSSH.Server is installed. Open powershell with elevated rights and run the following
> Get-WindowsCapability -Online | ? Name -like ‘OpenSSH*’ Name : OpenSSH.
elements
Table of contents Table of contents Text Code Python C/C++ Bash Tables Text Some example text
Code Python def foo(): print ("This is a python function") C/C++ void foo(){ prinf("%s\n", "This is a C function") } Bash # This is a bash command cd dir && echo $PWD; # Return exit 0; Tables Pages Elements 1 Text 2 Code 3 Tables