Welcome to my blog!
I’m a postdoctoral researcher in cosmology, currently working at the University of Geneva.
Occasionally I’ll write something here.
-
Running recoll on Android
If you just want to skip to the TL;DR version of running recoll on Android, click here. I have used the recoll information retrieval software for quite some time now for searching through my ever-growing collection of documents (mainly PDF and DJVU files) on the desktop, and it has proven to be quite reliable in quickly finding a paper or boo... Read More
-
Another way to prove the sum of squares formula
One of the things you learn may have learned in your undergrad studies (or sometimes in high school) is the formula for the sum of first $n$ numbers is given by: \[\sum\limits_{k = 1}^n k = \frac{n (n + 1)}{2}\] The usual proof goes along these lines: observe that the first and the $n$th term have the same sum as the second and th... Read More
-
Dynamically listing writable properties in Python
I’ve recently taken the monumental undertaking of refactoring my cosmology code, COFFE, and building a semi-decent, user-friendly Python wrapper for it in Cython. In the first iteration of it, I’ve decided to just shove all of the parameters (which the C version reads from a parameter file) into a single class (cue Pylint complaining abou... Read More
-
The curious case of 3D projectile motion
Alternatively, how there’s appears to be a “phase transition”-like phenomenon for a special case of 3D projectile motion What do projectile motion and phase transitions have in common? More than meets the eye it seems! Motivated by my last post, I was kind of curious to see what happens when we try to solve the same problem in 3D. Sin... Read More
-
Projectile motion: what is the longest trajectory?
This is an interesting problem I’ve stumbled upon while reading up on classical mechanics the other day. The question goes as follows: Suppose that we fire a projectile from the ground with initial velocity $v_0$, at an angle $\varphi$ with the horizontal plane. What is the initial angle at which the projectile has the longest traje... Read More
-
Handling credentials in Python
Logins to online services, and online banking in particular, seem to be becoming increasingly more elaborate; depending on the particular service I’m dealing with, I always run into (in my opinion) nonsensical security measures and obfuscation attempts that just make the login procedure as cumbersome as possible. To provide an example, one of my... Read More
-
The apocalypse problem
I’ve recently been going through the book Cracking the coding interview (6th ed.), and an interesting problem was stated there (abridged for brevity): In a new post-apocalyptic world, the world leader decides that all families must have one girl, or face massive fines. If all families continue to have children until they have one gi... Read More
-
Inserting uncommon characters in Xelatex projects
This was enough of an annoyance for me that it warrants a short post in case anyone else encounters a similar issue. The problem Let’s say you want to (for whatever reason) insert a particular Unicode character into a Xelatex project, but when you compile the document, the compiler complains with something like this: Missing character: Ther... Read More
-
Creating standalone Latex math images
Just like many others working in the natural sciences, I too have been using Latex since forever, just because it’s the only mature solution for typesetting math in a more or less sane way. For the longest time though, I’ve been looking for a way to create just images of math expressions in a simple way, without necessarily having to go throu... Read More
-
A brief introduction to working with remotes
This is meant to be an introductory tutorial, primarily aimed at scientists, about using SSH along with other utilities (notably Tmux and x2go) to make working with remote machines hopefully a bit more pleasant. Following the tradition of 1000+ page technical books titled “Short introduction to X”, this introduction is anything but brief; thi... Read More
-
Trimming a string with Bash
Note: the below solution should actually work on all POSIX-compatible shells (including Bash and Zsh). The problem Let’s say we have a piece of text that looks like this: this string has whitespace everywhere why and the task is to delete all of the leading and trailing whitespace characters, that is, trim t... Read More
-
Packaging a Latex project
The problem Whenever I’m working on a LaTeX project, I inadvertently end up with a bunch of files scattered throughout the project directory. Usually, not all of them are actually used to build the final document, and I’d like a way to package the project without any unnecessary files, so I can submit it to arXiv or somewhere else. The ... Read More