Casting shared pointers in C++

Here’s a note on my experience with casting a base class shared pointer to a derived class pointer.

Continue reading
Posted in Uncategorized | Leave a comment

Notes on Reservoir Sampling

Reservoir sampling is a useful technique when sample k items for a large data sets.

In this post I outline some ideas on how it works.

Continue reading
Posted in Uncategorized | Leave a comment

How to trim text in List of Figures / Tables (Latex)

Sometimes we have really long texts in the list of figures and list of tables part (\listoffigures, \listoftables). The text correspond to the captions of the figures and tables.

We can trim the text using an optional argument to the \caption command.

\caption[short text to show in list of figures]{longer text to show next to the figure.}

I learned this trick from the following post

https://tex.stackexchange.com/questions/152239/custom-text-in-list-of-figures

Posted in Uncategorized | Leave a comment

Get Pylint to work with Python 3 programs

Here’s my note on getting Pylint to work with Python3. The issue is that I also have Python2.7 installed on the machine. As a result, when I just run “pylint python3_program_name.py”, the script gives “invalid syntax” errors.

One trick I did was to use the following command instead

python3 -m pylint python3_program_name.py

This seems to triggers the pylint for Python3 as it executes the pylint with python3. The “-m” option runs library modules as a script.

I got the hint from this post here (https://www.reddit.com/r/learnpython/comments/822qsc/running_pylint_for_python3/).

I also just realized that pylint is also doing static code analysis and can detect many errors statically like a compiler, which is very cool!

Posted in Uncategorized | Leave a comment

Reducing space in latex

Some useful tricks I learned from past collaborators.

Continue reading
Posted in Uncategorized | Leave a comment

Spell Checking for Latex

This is a post summarizing my experience performing spell check for my latex files.

Continue reading
Posted in Uncategorized | Leave a comment

Learning Tensorflow 2.0

Some notes on learning how to use Tensorflow 2.0

Continue reading

Posted in Uncategorized | Leave a comment

Resources on Polyhedral Compilers

Here’s are some useful resources for learning about polyhedral compilation.

Continue reading

Posted in Uncategorized | Leave a comment

Reading C / C++ Types

Some notes on reading C and C++ types (go right, and then left, then right … )

Continue reading

Posted in Uncategorized | Leave a comment

C++ Early vs Late Bindings

This is a note on early (static) binding vs late (dynamic) binding in C++.

Continue reading

Posted in Uncategorized | Leave a comment