Tuning the IPython Terminal Prompts

The problem

I like the IPython terminal for all its colors and syntax completion but what I really cannot stand is getting told all the time that this line is an input and the other one right after is an output.

Its an interactive terminal.
I know that the one line is the input and the other line right after is the output.
I just typed those lines in.

Enough ranting IPython has been around for some time now and would not have gotten its superp reputation and wide spread acceptance if there was not a tweak to be made.

Python Multi File Modules

The problem

The basic problem obviously is that I have a very distinct and opinionated way to think about modules and Python’s own opinion doesn’t make it easy to get it done the way I think is best.

Installation of NodeJS on RaspberryPi - Keep it Simple

Googling for “install nodejs raspi” I get millions of blog post telling me how to best install NodeJS on a RaspberryPi. Well and this is yet another.

The blog posts often explain how to get the newest version and results range from proposing version 6.x.x up to version 12.x.x as newest - some using a browser, some using the command line interface.

I think: Its all to complicated. Raspian already comes with a NodeJS version available via package manager. So, my humble advise to future me and to all those tinkerers big and small: Go tinker some more and use whichever NodeJS version is available via apt.

sudo apt update
sudo apt upgrade
sudo apt install nodejs -y
node -v
## v10.15.2

Wikipedia Page View Statistics Late 2007 and Beyond

The {wikipediatrend} package

Simple Tabulations Made Simple

The {tabit} package

Using httr to Detect HTTP(s) Redirects

The Summary

In this short note I will write about the httr package and my need to detect whether or not an HTTP request had been redirected or not - it turns out this is quite easy. Along the way I will also show how to access information of an HTTP-conversation other than the actual content to be retrieved.

Re-exporting the magrittr pipe operator

… or how I stoped worrying and wrote a blog post to remember it ad infinitum.

Magrittr’s pipe operator is one of those newish R-universe features that I really want to have around whenever I put some lines into an R-console. This is even TRUE when writing a package.

So the first thing I do is put magrittr into the DESCRIPTION file and add an __imports.R file to the packages R/-directory with the following lines:

#' re-export magrittr pipe operator
#' @importFrom magrittr %>%
#' @name %>%
#' @rdname pipe
#' @export

These lines import and re-export the pipe operator (%>%) therewith allowing to use it within my package but also beeing able to use it interactively whenever the package is loaded.

Best of all these lines will also ensure passing all package checks (CRAN complient) and preventing any “The following objects are masked from …” messages.

Last but not least the file name “__imports.R” serves two purposes (1) making the it appear at the very beginning of an alphabetical sorted lists of file names and (2) second giving it a speaking name to inform - however reads the file name - that some R “Imports” are most likely happening inside.

Happy coding!

PS.: Those lines above require the usage of roxygen2 as documentation framework.

Robotstxt Update - v0.6.0 on CRAN

I just got the news from the CRAN-team that the robotstxt version update 0.6.0 was accepted and now is available.

The robotstxt package aims at working with robots.txt files from within R by providing a parser as well as a permission checker - and some convenience goodies working behind the scenes.

This new version switches the default checking backend from an pure R implementation (done by myself) to a C++ implementation (done by Moz and wrapped by Bob Rudis) that is both executing much faster and also much more rigourous in interpreting the the standard (RFC). While it was hard to throw away so much of my own work it also is very liberating to now have to maintain lesser code and leaving the package with the feeling that it now is in a better state (more robust) than before.

Thanks CRAN, thanks Bob, thanks Moz.

Up and Running

Finally, I finished my search for a new framework to handle my personal webpage. You know something that would not involve too much semi-automatic pasting content into placeholders while all the time having it look like some second hand page from the late two-thousands.

I found it and I am happy so far: A Jekyll page with a simple but solid and elegant design by Niklas Buschmann.