Resources

Spelling Is Next to Godliness

Spelling and grammar are very important. However, when in a rush, we tend to neglect these important aspects. Search engines and humans readers usually don’t appreciate content that includes spelling or grammatical errors. This notion also applies to your code repository… As such, let’s automatically spell check and fix our codebase with misspell! Spell Check cd my-code-repository/ ~/bin/misspell -w . git commit -am "fixed spelling" -w: Overwrite file with corrections Note: Be careful with overzealous fixes!

Admonition Blocks: Making Your Documentation Stand Out

Documentation doesn’t always have to be boring. Admonition blocks draw the reader’s attention to important notes and warnings that may not directly fit as part of the flow of the text. As I often prefer to write long-form reports and documentation in LaTeX, awesomebox and alertmessage are my go-to packages for admonition blocks. Several simple examples may be found below. % !TEX program = xelatex \documentclass{article} % dummy text for examples \usepackage{lipsum} % admonition blocks around text to inform/alert readers \usepackage{awesomebox} % or without using xelatex \usepackage{alertmessage} \begin{document} % awesomebox \tipbox{\lipsum[2]} \notebox{\lipsum[3]} \warningbox{\lipsum[4]} \cautionbox{\lipsum[5]} \importantbox{\lipsum[5]} % alertmessage \alertinfo{\lipsum[2]} \alertsuccess{\lipsum[2]} \alertwarning{\lipsum[2]} \alerterror{\lipsum[2]} \end{document} Tip Box

Interprocess Communication with Redis

There are many methods to communicating between processes. Many methods work best when only using a single programming language, while others require custom packets and parsing. Simplicity is key and Redis is an efficient solution. Redis is an open-source in-memory database project implementing a distributed, in-memory key-value store. Start Redis Server We will be using a Docker Redis container to run the Redis server. docker run -d --rm --name my_redis -p 6379:6379 redis -d, --detach: Run container in background and print container ID --rm: Automatically remove the container when it exits --name string: Assign a name to the container -p, --publish list: Publish a container’s port(s) to the host Client Installation This quick tutorial will focus on Python, so let’s install the recommended package.

Using MS Word to Check LaTeX Documents

Microsoft Word has great spelling and grammar checking. Use pandoc to convert the LaTeX document to docx and double check your work. pandoc INPUT.tex -o OUTPUT.docx

Testing Python Packages with Docker

Package management is hard. Sometimes in Python package development, your local (development) environment may behave a little differently than a deployment target. Below is a simple method I use to replicate a clean environment and test Python package installs and tests. docker run -v `pwd`:`pwd` -w `pwd` python pip install . docker run -v `pwd`:`pwd` -w `pwd` python python setup.py install docker run -v `pwd`:`pwd` -w `pwd` python python setup.py test First, we bind the current directory to our container (-v) and switch our working directory (-w).

Big Parenthesis in a LaTeX Equation

\begin{equation*} \left( \sum_{i=0}^{n}{i} \right) \end{equation*} $$\left( \sum_{i=0}^{n}{i} \right)$$ \left( and \right) automatically expand to fit the material between them

Great Looking LaTeX Tables

No colour No vertical gridlines No fills No borders No bolding Left align text Right align numbers Align titles with data Resize columns to data Use consistent precision \documentclass{article} % \toprule, \midrule, \multicolumn \usepackage{booktabs} % unit formatting \usepackage[per-mode=symbol]{siunitx} \begin{document} \begin{table} % use consistent precision \sisetup{round-mode=places,round-precision=2} % center table in text \centering % make a good descriptive caption \caption{My caption.} % labels must come after captions \label{table:my-table} % resize boxes help fit tables inside 2-column formats % \resizebox{\columnwidth}{!

My Favourite LaTeX Packages

% english hyphenation \usepackage[english]{babel} % for accented characters, load before csquotes \usepackage[utf8]{inputenc} % recommended with babel; \enquote{} \usepackage{csquotes} % for \graphicspath \usepackage{graphicx} \graphicspath{{./fig/}} % \toprule, \midrule, \multicolumn \usepackage{booktabs} % unit formatting \usepackage[per-mode=symbol]{siunitx} % siunitx match IEEE font weight \sisetup{detect-weight=true, detect-family=true} % \FloatBarrier for stopping floats in REFERNCES section \usepackage{placeins} % linked references \usepackage{hyperref} % citations % https://www.sharelatex.com/learn/Bibliography_management_in_LaTeX \usepackage[ style=ieee, doi=false, isbn=false, url=false, ]{biblatex} \addbibresource{kuka-collaborative-poke.bib} % easy referencing, must be loaded last!

Stop LaTeX Floats and Figures from Appearing in References Section

% \FloatBarrier for stopping floats in REFERNCES section \usepackage{placeins} ... ... ... \FloatBarrier \printbibliography \end{document}

Convert Images in a Directory

for i in *.png ; do convert "$i" "${i%.*}.jpg" ; done convert: convert between image formats using ImageMagick A simple bash for-loop for convert many images at once.