Posts
-
Jul 1, 2018
I’ve been wanting to try using containers for managing different development
environments for a while now. Docker is a well known
container software, but I’ve found it not be well-suited for
development. Singularity is an alternative that
is designed for high performance computing and not microservices. It integrates
more readily with the host OS, while being more secure than
Docker. Interestingly, in some applications Singularity containers actually
perform better than bare-metal(the native
OS). In this post I will outline what I’ve done to use Singularity for a
container-based development environment.
-
Dec 27, 2017
Updated Feb. 10, 2018
Updated Oct. 14, 2019
Just over a year ago I wrote a
post about using Emacs is a C++
IDE. Over the past year many small improvements have led me to an entirely
different configuration that I find to be much faster and easier to use.
In this post I will show screencasts of the features I’m using
and provide my entire init file at the end. There should be enough comments
in the init file to make it clear what’s going on. If not leave a comment
and I’ll try to explain.
-
Dec 9, 2017
With C++17 we finally get
if constexpr
. However, I have started running
into a lot of cases where I want a for constexpr
that is guaranteed to be
evaluated at compile time. My use case is effectively compile time
indexing of a multi-index tuple
-like datastructure. This means that
arbitrary nesting (within instantiation depth limits at least) must be
possible, and it must be possible to have an inner for loop index depend
on an outer for loop index. We will use C++14 to implement for constexpr
.
-
Dec 9, 2017
I’ve been wanting to run a Linux distro on my MacBook Pro for about 6 years
now. About a year ago I decided to give it another go and had a lot of success.
After doing some research on the topic I came to the conclusion that
Arch Linux is the most promising distro, at least in terms documentation
for MacBook Pros. To make the installation
easier I decided to go with Antergos for the installation process.
This post will cover replacing macOS on your MacBook Pro 11,4. After following
this post you will only have Antergos installed on your system.
-
Sep 10, 2017
In this post I will discuss overloading generic lambdas in C++14, using SFINAE
with lambdas, using tagged dispatch for “pseudo-SFINAE”, and finally using
overloading and SFINAE to create local type traits inside functions. All of
these are useful when writing generic code. Overloading generic lambdas,
for example, proves to be extremely useful when implementing a stream operator
for
std::tuple
. I’m sure you can think of reasons why a type trait is useful
only in the current scope and writing a struct
elsewhere for it is overkill
(e.g. checking for the existence of a member function of a template parameter).
-
Sep 1, 2017
C++17 allows parameter pack expansion inside
using
statements. This feature
is sometimes called variadic-using and the paper is
here.
Unfortunately, I found searching for “variadic using” with Google to not be all
that helpful. In this post I will provide a concrete example of what this
feature can be used for, since it might seem like a bit of a strange idea at
first.
-
Aug 24, 2017
This post is a follow up to
iterating over tuples,
but this time we do not use runtime or compile time recursion, so the
resulting code is cleaner and faster. There are two different types of
iteration, one where you keep a “state” and one where you do not. By
state I mean, for example, the partial sum of all elements already
processed in a reduction, accumulation, or fold.
Parameter pack
expansion is the fastest and preferred method of iteration. However,
it has the drawback that it cannot keep state at compile time (or at least
I haven’t figured out how, yet). That means parameter pack expansion works well
in
transform
s at compile time but not fold
s. Interestingly enough, we can
use parameter pack expansion for runtime iteration with state. This is something
I have spent a fair amount of time thinking about and I now have a solution I’m
very happy with. Let’s dive in!
-
Aug 23, 2017
A fairly common task one encounters is iterating over a
std::tuple
.
I’m going to keep this post fairly brief and go over how not to iterate
over a tuple. We’ll discuss how you should iterate over a tuple in the
next post.
-
Jan 29, 2017
We continue on our adventure of template metaprogramming. We explore
the concept of compile-time data structures such as a typelist, map,
and a set. This is done using the brigand template
metaprogramming library (TMPL). However, there are several other
options available. I outline them in a table below along with the C++
standard each requires. Giving credit where it is due, the original
inspiration for some these libraries were blog posts by
Eric Niebler and Peter Dimov.
-
Jan 14, 2017
What is template metaprogramming? Why do I care about template
metaprogramming? What is a typelist? These are the sorts of questions
I asked myself when I first started looking at template
metaprogramming seriously.
-
Jan 14, 2017
A while ago I wrote a post
on using Emacs as a C++ IDE. That setup seems
to work really well for small to medium sized projects that don’t use
certain libraries. However, I’ve found that the code completion is not
always as consistent and good as I would like. After listening to a
CppCast interview with Anastasia Kazakova I decided to try
CLion out as an IDE. Being a loyal Emacs user I was quite
skeptical initially but
always longed for a really well-developed and smooth workflow,
something that CLion promised.
-
Jul 17, 2016
An updated version of this post is available
here.
Last year I wrote a post
about using Flymake with Emacs to get on-the-fly
syntax checking. Recently I watched a cppcon lightning talk by
Atila Neves on his setup for using Emacs as a C++ IDE and was inspired
to adapt this to my own needs. In this post I will guide you through
the setup process, which will carry over to Aquamacs for the most part
too. I’ll try to note any differences as they come up. This guide will
also use Homebrew for installing some additional software,
but on Ubuntu you should be able to get it from apt. Please note that
I take no credit for this setup at all. It is all thanks to the many
developers and blog authors whose content I was able to use and
piece together. I will do my best to cite any resources as I go. I
apologize in advance for anything I missed.
-
Dec 4, 2015
Kepler’s third law in classical
mechanics states that the square of the orbital period, , of a
planet or particle is proportional to the cube of the semi-major axis
of its orbit. The classical equation describing this is
-
Nov 7, 2015
I recently started using tmux and have found that it has improved my
workflow. Being an Emacs (Aquamacs) user most of my work is done inside
Emacs with little to no need for a separate terminal. However, much of my
work requires connecting to remote systems via SSH and so I’d often have
several tabs open connected to different servers. Of course if I switched to
a different desktop these tabs would no longer be there, which was rather
inconvenient. tmux has made this aspect and my entire terminal experience
much better. Even if you think you don’t do much, I recommend trying out
tmux.
-
Jul 31, 2015
Emacs is a great tool for software development. If you’re not using
a more advanced environment than Notepad and a Terminal it may be time
for you to look at options. Two popular ones are Emacs
and Vim. Depending
on who you ask you will get widely varying responses about which is
“better”. Eclipse, Visual Studio
and Xcode are all popular options as well. Now to get
to the point. Compiling code takes time and having a built-in syntax check
is an excellent way to reduce time spent compiling. For Emacs there
is Flymake and Flycheck. As you can probably guess,
I will discuss Flymake.
-
Jul 28, 2015
Welcome! I’m starting this site to share my knowledge of physics,
experiences developing software for scientific use, and anything
else that gets me excited. I am currently
a graduate student in the physics department
at Cornell University working with Prof. Saul Teukolsky with
the SXS collaboration. My research interests are solving
Einstein’s equations using computers to study physics not available to
us here on Earth. Common examples of problems solved using numerical relativity
include binary black hole mergers, binary neutron star mergers, and jets
and acretion disk formation and evolution. Recently numerical
relativity has also been used to study quantum mechanical systems using
the so-called anti-de Sitter/conformal field theory (AdS/CFT) conjecture.
If you have not heard of AdS/CFT fear not, I will have a post on this
at some stage but be warned that it is from the view of a relativist, not
a particle physicist.
Share This Site