Mailund on the Internet

On Writing, Science, Programming and more

Books

I enjoy writing and I’ve written bunch of books by now. Mostly about R programming, but also on a few other topics.

When I’m working on a book I haven’t sold yet, I usually put the draft on Leanpub where you can get it for free until it is done. Once I’ve sold a book, I have to pull it from Leanpub, but it is a good way to get an early copy, and a good way for me to get feedback while writing. If you get a draft there, then please let me know what you think and how I can improve it.

Right now, I’m working on The Joys of Hashing (see below for a description). It will be out next year and I still have some editing to do and one more chapter to write. Since I have already sold this book, you cannot get it on Leanpub any more.

Another book I am working on is Introduction to Computational Thinking. This covers various algorithms and some topics on how computers work and how you represent data on a computer. This is a longer book that started out as lecture notes. I have already written the chapters I need for my own teaching, but I still have a long way to go before the complete book is done. I upload new chapters as I finish them, so have a look at it.

Below are a complete list of my finished books (plus books that will soon be published).

The Joys of Hashing

Build working implementations of hash tables, written in the C programming language. This book starts with simple first attempts devoid of collision resolution strategies, and moves through improvements and extensions illustrating different design ideas and approaches, followed by experiments to validate the choices.

Hash tables, when implemented and used appropriately, are exceptionally efficient data structures for representing sets and lookup tables, providing low overhead, constant time, insertion, deletion, and lookup operations.

The Joys of Hashing walks you through the implementation of efficient hash tables and the pros and cons of different design choices when building tables. The source code used in the book is available on GitHub for your re-use and experiments.

What You Will Learn

  • Master the basic ideas behind hash tables
  • Carry out collision resolution, including strategies for handling collisions and their consequences for performance
  • Resize or grow and shrink tables as needed
  • Store values by handling when values must be stored with keys to make general sets and maps

Who This Book Is For

Those with at least some prior programming experience, especially in C programming.

Shops

[ Amazon ] [ Apress ]

Domain-Specific Languages in R

Gain an accelerated introduction to domain-specific languages in R, including coverage of regular expressions. This compact, in-depth book shows you how DSLs are programming languages specialized for a particular purpose, as opposed to general purpose programming languages. Along the way, you’ll learn to specify tasks you want to do in a precise way and achieve programming goals within a domain-specific context.

Domain-Specific Languages in R includes examples of DSLs including large data sets or matrix multiplication; pattern matching DSLs for application in computer vision; and DSLs for continuous time Markov chains and their applications in data science. After reading and using this book, you’ll understand how to write DSLs in R and have skills you can extrapolate to other programming languages.

What You’ll Learn

  • Program with domain-specific languages using R
  • Discover the components of DSLs
  • Implement metaprogramming with DSLs
  • Parse and manipulate expressions

Who This Book Is For

Those with prior programming experience. R knowledge is helpful but not required.

Shops

[ Amazon ] [ Apress ]

Functional Data Structures in R

Errata

Get an introduction to functional data structures using R and write more effective code and gain performance for your programs. This book teaches you workarounds because data in functional languages is not mutable: for example you’ll learn how to change variable-value bindings by modifying environments, which can be exploited to emulate pointers and implement traditional data structures. You’ll also see how, by abandoning traditional data structures, you can manipulate structures by building new versions rather than modifying them. You’ll discover how these so-called functional data structures are different from the traditional data structures you might know, but are worth understanding to do serious algorithmic programming in a functional language such as R.

By the end of Functional Data Structures in R, you’ll understand the choices to make in order to most effectively work with data structures when you cannot modify the data itself. These techniques are especially applicable for algorithmic development important in big data, finance, and other data science applications.

What You’ll Learn

  • Carry out algorithmic programming in R
  • Use abstract data structures
  • Work with both immutable and persistent data
  • Emulate pointers and implement traditional data structures in R
  • Build new versions of traditional data structures that are known

Who This Book Is For

Experienced or advanced programmers with at least a comfort level with R. Some experience with data structures recommended.

Shops

[ Amazon ] [ Apress ]

Metaprogramming in R

Learn how to manipulate functions and expressions to modify how the R language interprets itself. This book is an introduction to metaprogramming in the R language, so you will write programs to manipulate other programs. Metaprogramming in R shows you how to treat code as data that you can generate, analyze, or modify.

R is a very high-level language where all operations are functions and all functions are data that can be manipulated. This book shows you how to leverage R’s natural flexibility in how function calls and expressions are evaluated, to create small domain-specific languages to extend R within the R language itself.

What You’ll Learn

  • Find out about the anatomy of a function in R
  • Look inside a function call
  • Work with R expressions and environments
  • Manipulate expressions in R
  • Use substitutions

Who This Book Is For

Those with at least some experience with R and certainly for those with experience in other programming languages.

Shops

[ Amazon ] [ Apress ]

Advanced Object-Oriented Programming in R

Learn how to write object-oriented programs in R and how to construct classes and class hierarchies in the three object-oriented systems available in R. This book gives an introduction to object-oriented programming in the R programming language and shows you how to use and apply R in an object-oriented manner. You will then be able to use this powerful programming style in your own statistical programming projects to write flexible and extendable software.

After reading Advanced Object-Oriented Programming in R, you’ll come away with a practical project that you can reuse in your own analytics coding endeavors. You’ll then be able to visualize your data as objects that have state and then manipulate those objects with polymorphic or generic methods. Your projects will benefit from the high degree of flexibility provided by polymorphism, where the choice of concrete method to execute depends on the type of data being manipulated.

What You’ll Learn

  • Define and use classes and generic functions using R
  • Work with the R class hierarchies
  • Benefit from implementation reuse
  • Handle operator overloading
  • Apply the S4 and R6 classes

Who This Book Is For

Experienced programmers and for those with at least some prior experience with R programming language.

Shops

[ Amazon ] [ Apress ]

Functional Programming in R

Errata

Master functions and discover how to write functional programs in R. In this concise book, you’ll make your functions pure by avoiding side-effects; you’ll write functions that manipulate other functions, and you’ll construct complex functions using simpler functions as building blocks.

In Functional Programming in R, you’ll see how we can replace loops, which can have side-effects, with recursive functions that can more easily avoid them. In addition, the book covers why you shouldn’t use recursion when loops are more efficient and how you can get the best of both worlds.

Functional programming is a style of programming, like object-oriented programming, but one that focuses on data transformations and calculations rather than objects and state. Where in object-oriented programming you model your programs by describing which states an object can be in and how methods will reveal or modify that state, in functional programming you model programs by describing how functions translate input data to output data. Functions themselves are considered to be data you can manipulate and much of the strength of functional programming comes from manipulating functions; that is, building more complex functions by combining simpler functions.

What You’ll Learn

  • Write functions in R including infix operators and replacement functions
  • Create higher order functions
  • Pass functions to other functions and start using functions as data you can manipulate
  • Use Filer, Map and Reduce functions to express the intent behind code clearly and safely
  • Build new functions from existing functions without necessarily writing any new functions, using point-free programming
  • Create functions that carry data along with them

Who This Book Is For

Those with at least some experience with programming in R.

Shops

[ Amazon ] [ Apress ]

Beginning Data Science in R

Discover best practices for data analysis and software development in R and start on the path to becoming a fully-fledged data scientist. This book teaches you techniques for both data manipulation and visualization and shows you the best way for developing new software packages for R.

Beginning Data Science in R details how data science is a combination of statistics, computational science, and machine learning. You’ll see how to efficiently structure and mine data to extract useful patterns and build mathematical models. This requires computational methods and programming, and R is an ideal programming language for this.

This book is based on a number of lecture notes for classes the author has taught on data science and statistical programming using the R programming language. Modern data analysis requires computational skills and usually a minimum of programming.

What You Will Learn

  • Perform data science and analytics using statistics and the R programming language
  • Visualize and explore data, including working with large data sets found in big data
  • Build an R package
  • Test and check your code
  • Practice version control
  • Profile and optimize your code

Who This Book Is For

Those with some data science or analytics background, but not necessarily experience with the R programming language.

Shops

[ Amazon ] [ Apress ]

The Beginner’s Guide to Markdown and Pandoc

Markdown is a markup language; the name is a pun. Markup languages are used to annotate text formatting information, typically with a stronger focus on semantic information than direct formatting as you would do with WYSIWYG (what you see is what you get) formatting. With markup languages, you might annotate your text with information about where chapters and sections start, but not how chapter and heading captions should be formatted. Doing this decouples the structure of a text from how it is visualised and makes it easier for you to produce different kinds of output. The same text can easily be formatted as HTML, PDF, or Word documents, with various visual styles, by tools that understand the markup annotations.

Pandoc is a tool for translating between different markup languages, such as LaTeX, HTML, and Markdown. I use it for formatting the books I write. This booklet describes how. I will tell you how to write manuscripts in Markdown and translate them with Pandoc into different output formats. I will not describe all the functionality that Pandoc provides, only how it can be used to write papers and books in Markdown. If that is something you are interested in, The Beginner’s Guide to Markdown and Pandoc will get you started.

Shops

There are only e-books of this books because I self-published it and because the print-on-demand option probably isn’t worth the cost. To read it, I would recommend using the Kindle app or a tablet rather than a Kindle; an actual Kindle doesn’t display code particularly nicely.

[ Amazon ] [ iBooks ] [ Leanpub ] [ Gumroad ]

The Beginner’s Guide to Git and GitHub

You have heard about git and GitHub and want to know what the buzz is about. That is what I am here to tell you. Or, at least, I am here to give you a quick overview of what you can do with git and GitHub. I won’t be able, in the space here, to give you an exhaustive list of features—in all honesty, I don’t know enough myself to be able to claim expertise with these tools. I am only a frequent user, but I can get you started and give you some pointers for where to learn more. That is what this booklet is for.

Shops

There are only e-books of this books because I self-published it and because the print-on-demand option probably isn’t worth the cost. To read it, I would recommend using the Kindle app or a tablet rather than a Kindle; an actual Kindle doesn’t display code particularly nicely.

[ Amazon ] [ iBooks ] [ Leanpub ] [ Gumroad ]

The Beginner’s Guide to Todoist

One of the most surprisingly simple tools to increase your productivity and reduce your stress is the todo-list. Too often, we’re overwhelmed with how much we have to do, but by breaking down a complicated project into simpler tasks and then keeping a list of these tasks in the form of a todo-list, you end up getting more done in a calmer way. In fact, as you offload the job of remembering tasks from your active memory to a todo-list, you effectively reduce your stress levels and give yourself more control of your projects and life. This guide describes how to do this using Todoist, the todo-list app that works seamlessly across every device and platform and which has been praised as a life-changing app by The Guardian, USA Today, the New York Times, The Wall Street Journal, Forbes, Lifehacker and more. Inside, you’ll learn the best tips and techniques for using Todoist so you can start living the calmer, more productive and more organized life you’ve always thought you were capable of but never had the chance to achieve.

Shops

There are only e-books of this books because I self-published it and because the print-on-demand option probably isn’t worth the cost. To read it, I would recommend using the Kindle app or a tablet rather than a Kindle; an actual Kindle doesn’t display code particularly nicely.

[ Amazon ] [ iBooks ] [ Leanpub ] [ Gumroad ]