Blog
Custom org-sitemap-function
post-Org 9.1
Published:
I have been lugging around an old version of org-mode (9.0 to be specific) in the git repo which builds this website for a number of years now. I decided to do this because I had a custom org-sitemap-function
to generate the landing page for my blog, but org 9.1 introduced a breaking change to the org-publish API.
I have now finally come around to fixing this issue and making my website compatible with modern emacs and org-mode versions higher than 9.1. However, porting my old sitemap function was… surprisingly difficult? So just in case someone is looking up my original post these days, this post contains a sitemap-function
which will work in 2022.
Emacs Config Redux
Published:
I used to keep a HTMLized version of my Emacs config on this website for folks to browse. However, during my last larger config overhaul, I changed things up so much that simply exporting one file and putting it on the website was not possible anymore and the link to my config silently 404'ed.
Since then, I have received multiple requests to re-upload the config file. I kept promising folks that I would one day get to doing that. That day has now finally come.
Took a few hours of cleanup and writing, but the config is now back online in all its glory. There is also extensive commentary, in case you are interested.
Beamer Poster templates using (some) Purdue Colors
Published:
During the Advanced LaTeX workshop we taught at Purdue last week, I announced that I would share my poster design using the beamerposter package and a similar design as the slides. I finally came around to uploading a few examples to my GitHub account (thanks for being patient, everyone)—you can find them here.
Towards a better Integration of the Julia REPL in Emacs
Published:
It is not a secret that I am a fan of both Emacs and the Julia language. Even
though I have not been working with Julia a lot recently, I still try to keep
up to date with the language and use it in my research and other projects
whenever it fits. It should also not be a secret that I am a big fan of the
Emacs Way™ of working with interpreted languages, which involves the idea of
controlling a REPL without leaving the editor. It was for those and other
reasons that I initially hacked together julia-shell-mode (See my blog post
about it here), but if you take a closer look at the open isses in GitHub and
the overall lack of commits, you might sense that I have lost interest in this
package. Of course, the reality behind my lack of enthusiasm for
julia-shell-mode
is a little more complicated.
ZeroMQ Pub/Sub Hello World
Published:
It's been a while since I posted some new content on here. This is mostly because I've been quite busy trying to be an academic at Purdue. This blog will get an update soon with a few publications!
Anyways, I've been working a LOT with C++ recently, side-by-side with (and guided by) my labmates Tomo and Stephen. (Expect a post about the perfect emacs setup for C++ development soon, but here's a hint: it involves the usual suspects rtags and ycmd) As part of our project, I am currently surveying a few methods for inter-thread and inter-process communication, which seems to be what ZeroMQ was created for.
Beamer templates inspired by the official Purdue University colors
Published:
I've gotten a few requests to share my custom Purdue-themed beamer templates
recently and I finally came around to clean them up, put them in individual
.sty
-files, and upload them to GitHub.
The GitHub repository contains some examples to use the two templates I have
been using for talks and presentations over the last few semesters. The first
(and IMHO better) template is beamer-purdue-gold
and the title page looks
like this:
Reducing the size of GNOME 3.20's titlebars
Published:
GNOME 3.20 has made it into the official Arch Linux repositories and with it
came—as usual—some sort of breakage. I personally find the default width of
the titlebars repulsive, and I used a small CSS hack to fix them. This broke,
but thanks to reddit, I managed to fix it. Put the following in
~/.config/gtk-3.0/gtk.css
(create the file if it does not exist):
Extending your X11 Desktop using VNC
Published:
I love multihead setups and I am a thrifty grad student. Today, this combination lead to an interesting and fun Saturday morning project. I figured out how to add an additional monitor to my dual-monitor set-up, which is already a little convoluted.
Let me clear things up: My main setup currently consists of a Thinkpad with its lid closed connected to two monitors (one over VGA, one over DisplayPort). Since my laptop has no third physical display connector, I had to get creative in order to add a third physical monitor to my set-up.
I use a cheap DisplayLink adapter at home for exactly this reason, but unfortunately the official dirvers are buggy and the whole set-up is generally very unreliable. So, with me being the thrifty grad student that I am, I did not want to shell out another $30 for a piece of hardware that doesn't even really work.
What I ended up doing is pretty neat.
Some matrix multiplication tricks
Published:
The first two are sort of obvious:
We want to multiply some matrix \(\mathbf{A}\) with some diagonal matrix
\(\mathbf{D}\). Instead of carrying out a bunch of multiplications by zero, we
replace the matrix multiplications by a for
loop and elementwise
multiplication. In other words,
Blogging using org-mode (and nothing else)
Published:
Update this blog post for an
updated org-sitemap-function
and an updated project definition. I'm
leaving this post up to preserve history.
As you can tell, the look of this website has changed significantly—and it was about time for that. In case you didn't know, this site used to be hosted on http://web.ics.purdue.edu/, which provides free webspace for Purdue students. I used to generate the static HTML pages from plaintext markdown files using the Python-based static site generator Pelican. It worked well for a while, but I ended up having a few issues with that setup:
- The host was painstakingly slow to reach from anywhere but the Purdue networks
- Pelican would just break sometimes, providing me with nothing but some cryptic Python exception messages
- The website did not use TLS and loaded a lot of external content over an unencrypted HTTP connection, causing it to render incompletely when using HTTPS Everywhere
- I prefer Org-mode over the fragmented Markdown syntax for writing plaintext documents
- Source code blocks are prettier in Org-mode
So, of course, I looked for an alternative.
Julia + Emacs = Success
Published:
Julia is an interesting new scientific programming language. I haven't used it much in the past, but I believe that it has the potential to be a very fierce FOSS competitor to MATLAB. When I tell friends and colleagues about Julia, my punchline is usually: "It looks and feels like MATLAB, but it's as fast as C."
I'd like to start using Julia more for things like Monte-Carlo simulations and other technical programming tasks, but I am spoiled rotten by the comfort of MATLAB-emacs. I have gotten so used to interacting with a live REPL from my text editing buffer that I do not want to miss it with any other language. Julia ships with an official Emacs mode, but the support for an interactive Shell within an Emacs buffer is almost non-existent. So I sat down for a few hours this weekend and built the Julia-shell mode that I would want to use.
Cue julia-shell-mode
.
SSH Usernames
Published:
I love SSH. It's the most convenient and secure way to manage multiple machines over the internet. It allows me to access my desk machine or my home server from anywhere in the world. It calms my paranoid side with features like SSH Tunneling. In short, SSH is one of my favorite tools.
But the Internet is an interesting place.
Variable-width Serif Fonts when editing plain text in Emacs
Published:
I edit a lot of \(\LaTeX\) documents using AUCTeX in Emacs. Since I believe that
serif fonts like Times New Roman are a lot easier to read than monospaced
fonts, I wanted to be able to view and edit text in an emacs buffer using a
variable-width, serif font. After 20 minutes of elisp hacking during lunch, I
came up with toggle-serif
, a small elisp function that does exactly what I
want.
When invoked, toggle-serif
changes the default font family of the buffer to
Liberation Serif. The only problem I had was that I wanted to preserve the
default monospace fonts for some faces, for example verbatim code snippets or
markup commands.
ctmpmon
Published:
Sometimes, especially when I run intensive simulations on one of my machines, I
want to be able to keep an eye on the temperatures of my CPU. lm_sensors
gives me this functionality on my arch linux systems, and the ArchWiki has a
great intro page on it.
My Emacs configuration
Published:
I finally created some acceptable CSS to publish good-looking HTML files using
org-mode
. Since my emacs configuration file is a literate program contained
in an org-mode
file, I can now put it on the web for the world to see. This
is it.
Best, Dennis
Update See here.
: The link above hasn't worked for years. I finally got back to uploading the config again.Remotely updating iTunes and MPD at the same time
Published:
Like many other people, I enjoy listening to music. I have aggregated a reasonably large (~90 GB) library of digital music over the years, and, of course, my favorite way to listen to it is MPD.
Right now, I'm running MPD on my "media center" computer hellboy2
, which
(surprisingly?) is a MacBook running OSX Yosemite connected to an HDTV. Before
I switched to MPD again (this is actually my second switch to MPD; I used it
around 8 years ago on my first Linux systems), I used iTunes to manage my music
library. One advantage of iTunes (and the main reason why I cannot stop using
it) is that iTunes on a Mac is probably the most dependable way of syncing
music to an iPod. This is the sole reason why I still want all of my music to
be indexed by iTunes.
Creating beautiful polar coordinate plots in MATLAB
Published:
For a problem that I'm currently working on, I found myself having to visualize
some antenna patterns using MATLAB. To create polar coordinate plots, MATLAB
offers the polar
method, which is unfortunately quite limited in
functionality. For this reason, Duane Hanselman created mmpolar
, which brings
MATLAB's extensive handle graphics capabilities to polar plots.
I wanted to create some antenna pattern plots with a light grey background and
white grid lines, a color theme which is heavily inspired by Stanford's seaborn
library for python/matplotlib. One problem that I faced was that mmpolar
by
default sets the color of the axis tick labels to the color of the axis grid
lines. This meant that whenever I set the grid lines to be white, my tick
labels would disappear in the white figure background, which was obviously
quite undesirable.
I wrote a small patch to fix this problem: It adds a TickLabelColor
property
to each axis, which can be different from the GridColor
property, which
controls the grid line color. Specifically, to set the color of the angle axis,
I can now set the TTickLabelColor
property and to set the color of the
amplitude axis, I can set the RTickLabelColor
property. Much better.
The results look like this:
Editor Macros
Published:
Something really interesting happened to me over the course of the last few weeks: I switched from using a combination of tmux, vim, and the fish shell for my daily computing needs to doing everything and more in emacs!
I can already see some readers of this make faces and scream out profanities and other nice things in disgust: "You are such a heretic!", "How could you become one of them?", "You officially joined the dark side", "We have to stop being friends now."
But wait… Let me explain myself. Emacs is actually quite a pleasure to use.
The fish shell
Published:
I've been using zsh
with a few customizations for quite a while now and I can
honestly say that I would never go back to just using plain bash (although that
is not entirely true: I do my scripting in bash, since bash is the common
denominator amongst many *nix systems).
Some of the things that I liked about zsh
include better tab completion and
interactive syntax highlighting. I also configured my prompt to show the
current status of a git repository, if the current directory contains one. Some
of these customizations felt like a bunch of hacks, but they worked just fine.
Today I stumbled across the fish
shell, which, unlike zsh
, breaks backward
compatibility to bash, but advertises itself as a "smart and user-friendly
command line shell for OS X, Linux, and the rest of the family."
Creating a custom Linux Live USB environment
Published:
In the advanced C programming class that I assist in teaching, we are holding interactive programming exams. That means that every student is tasked with constructing a C program in a time frame of a about 2 hours. Students have access to GCC, Valgrind, as well as the Emacs and Vim text editors (we are staunch proponents of religious freedom).
One hurdle in holding programming exams is the problem of cheating: Nowadays, every computer at any computer lab is connected to some kind of network, which would make it easy for students to share files or look up hints and answers to problems on the internet. Our solution to this problem involves booting the lab computers from a USB drive which contains a customized, lock-down version of Linux, combined with the aforementioned tools and assignment files.
No one man should have all that power
Published:
I apologize. The title is pure clickbait. This post is not about Kanye West (or Malcolm X). But I promise, it will be interesting! (And it will have something to do with the word 'power')
One reason I started this website for is to explain things to myself in a somewhat coherent form. My reasoning is that if I can take a concept and write it up in publishable form, I will have truly understood and digested it. So today's topic is the power method for approximating the dominant eigenvector.
"But why?" is the question that everyone should be asking by now and I wouldn't blame you. One of the answers is that it's cool, it's interesting, I want to understand it, and Google and Twitter use it every day for multiple things. It's always cool to learn things about the internals of Google and Twitter, right?
All roads lead to Rome
Published:
Is there such a thing as ideomatic C? I'm not sure: I hear Python people talk about ideomatic Python a lot (although I'm probably still very unpythonic most of the time), and I'm convinced that functional programming in languages like Haskell and Lisp approaches the task of programming with fundamentally different ideoms than an imperative language like C. But I haven't really witnessed many conversations about the concept of ideomatic C.
Why am I asking this? This semester of EE264, the advanced C programming course for undergraduate electrical engineers at Purdue (where I am the TA), is being taught by a Lisp hacker. Which is awesome, because the Lisp-y way of problem solving is sometimes quite different from the way I would approach a simple problem.
Hello, World!
Published:
Hello World! This is my first blog post! I can use this as a test on how to use the math and the code view feature. The math environment takes the \(\LaTeX{}\) syntax, which always makes me happy. This is inline math: \(2x + 15 = 9\).
This is the equation environment:
\begin{equation} \label{eq:test_eq} X(\omega) = \int_{-\infty}^{+\infty} x(t) e^{-j\omega t}\ \mathrm{dt} \end{equation}Seems to be working!