I have been doing common string operations incorrectly for most of my career, and I suspect you have too. Take this truncation function: public static string Truncate ( string value , int maxLength ) { return value . Length > maxLength ? value . Substring ( 0 , maxLength ) : value ; } Looks fine. Here’s what it does with a string containing an emoji: var hello = "hello! 👋 nice to meet you"…
AvroTools is a collection of tools, written in C# to work effectively with the Avro schema and serialization file formats. Features AvroTools supports the following features that are improvements upon the largely Java-based implementation provided by Apache. Compile Avro IDL to an Avro Protocol . Compile Avro IDL to Avro Schema . Generate C# classes for protocols and schemas. The generated code is…
Get WiFi is a small Preact website that generates QR codes to connect to WiFi in the browser. It is currently hosted at getwifi.link . Unlike some similar websites, the QR codes are entirely generated in the browser. Primarily the website was intended as a learning experience. Not only for building certain features and to become familiar with some npm packages, but also to keep bundle sizes as…
Is my ID Leaky? is a simple Preact website that detects whether an identifier could reveal more information than intended. The site is currently hosted at ismyidleaky.com . It is currently capable of detecting the following: Common integer identifiers ULIDs v1 UUIDs v7 UUIDs K-Sortable Unique Identifiers MongoDB ObjectIds Snowflake IDs , including support for various platforms. To summarise, the…
Tanstack Query is a popular library for managing browser API requests and their associated state. One useful feature it provides is a query cache, preventing unnecessary network requests for the same resource. By using the @sjpnz/query-shared-worker-persister package, it is possible to share this cache across multiple tabs and windows. The sharing of a cache is possible due to a SharedWorker that…
The grConvert package is an R package for conveniently converting popular vector image formats (PostScript, PDF and SVG) into valid input formats for the grImport and grImport2 packages. It was developed as part of the 2013 Google Summer of Code. The key problem that grConvert aims to solve is that grImport requires PostScript images whereas grImport2 requires SVG images to import vector images…
The grImport2 package is an R package for importing vector images to be drawn within an R plot. It was developed as part of the 2013 Google Summer of Code. It improves upon some of the limitations of the grImport package and more comprehensively reproduces vector images in R. It can import any SVG image that has been generated by the Cairo graphics library. To ensure that this has been performed,…
Hexagonal binning is a technique used to show the density of a large number of points. We can encode the density of the data in two ways. The first of which is by colour, this means that more dense areas of the plot are encoded with darker hexagons. The second is where we set the area of each hexagon to correspond to the density within its locality. This means that more dense regions have larger…
This example is a tool created to ease model diagnostics when building ARIMA time series models. There are three key parameters of interest: AR(p), Differencing (d), and MA(q). When building models that have been constructed using these parameters, plots showing the autocorrelation (ACF) and partial autocorrelation (PACF) functions are very useful for assessing whether the constructed models are a…
This interactive LOESS smoothing example is one of the key motivating examples in my thesis. LOESS smoothing is a commonly used technique that allows for a trend to be made visible in a noisy dataset. The key parameter of interest is the “span” parameter that determines the size of the spanning window used for local regression. By setting a higher value of “span”, more data…
This example starts off by showing a plot of european cities. Each of the cities are positioned so that the distances between each of them approximate the distances between them by road. The source of the data comes from the “eurodist” dataset, distributed with R. The positions of the cities are calculated using multidimensional scaling. The cmdscale function was used to perform this…
The VIT (Visual Inference Tools) package creates animations that are used for teaching statistical concepts such as bootstrap confidence interval construction, permutation testing and confidence intervals. One of the animations it can create is used for teaching the concept of sampling variation. This example differs from the LOESS and ARIMA examples because it requires far more coordination once…
During my Masters year I worked on a thesis entitled “Dynamic, Interactive and Reactive Statistical Graphics for the Web”. The product of my thesis is a cohesive link between the powerful interactive and graphical capabilities of a web browser, and the statistical graphics and computing engine provided by R . My thesis is available on ResearchSpace or on this website by clicking the…
The TimingManager library is a tool written in JavaScript used to apply animations in a web browser. It is not concerned with creation or modification of animations, it delegates those tasks to R via the animaker package. Primarily TimingManager is focused on assigning actions to existing animations, then playing animation sequences using either a declarative or frame-based approach. In other…
For the past couple of years I have been maintaining GOMstreamer so that those who wanted to watch the GSL could do so without the need for the GOM Player. This was particularly useful for those on Linux or OSX who could not install the GOM Player (which only somewhat reliably worked on Windows). After a short while I realised that Windows users would also find value in avoiding the installation…
The selectr package for R parses CSS Selectors and translates them to XPath 1.0 expressions. It was originally an R port of the cssselect package for Python but now supports additional selectors. Development occurs on GitHub in the selectr repository. The main purpose of this package is to make working with (X)HTML and XML documents easier within R. The XML and xml2 packages are typically used…
This software, iNZight , is a GUI for R used for exploratory data analysis. It is intended to be used by undergraduate statistics students. Much of iNZight was written by Dineika Chandrananda. I maintained iNZight and developed extra components with some assistance from David Banks. The project is led by Dr. Chris Wild . Current development occurs on GitHub in the iNZightVIT repository. A basic…
Along with Garrett Grolemund , Ben Stevenson and under the guidance of Dr. Chris Wild , I helped develop Visual Inference Tools . It is a GUI for R, used for teaching high school and undergraduate students statistical concepts by using animation. These concepts include bootstrapping, randomisation testing and confidence intervals. I was formerly the maintainer of this R package. Development occurs…
Rainbow is a lightweight syntax highlighter implemented in JavaScript. I have added support for the R language and ported the pastie theme (with a few minor differences) from Pygments to Rainbow. These changes have been incorporated by Craig Campbell in the Rainbow GitHub repository . Due to the limitations of JavaScript’s implementation of regular expressions, highlighting R output (like…
The latest version of ESS now includes support for knitr . This script is no longer necessary. During my recent switch from vim to Emacs I discovered what a wonderful tool ESS is. It was fantastic for writing Rnw documents using Sweave , but seeing as I’m currently attempting another switch, from Sweave to knitr , I wanted support for that. After a quick look at the ESS source code, I was…
The purpose of getSVGFonts() and setSVGFonts() is to provide a means of controlling the appearance of text within a web browser. The usage of the functions are defined as follows: getSVGFonts () setSVGFonts ( fontStacks ) Normally in R a user can apply a specifc font using something like grid.text("hello, world!", gp = gpar(fontfamily = "Helvetica"))) to draw text using the Helvetica font. Often…
Upon returning back to my desktop after a small period of absence I needed to boot into my Windows VM via VMware Workstation (7.1.4 build-385536). Due to recent kernel updates in Debian Testing (to kernel version 3.0), VMware modules broke. Unfortunately any attempt to build these modules was unsuccessful. VMware should be able to provide point releases or at least patches to allow for compilation…
The arrayQualityMetrics package, authored by Audrey Kauffmann and Wolfgang Huber, can produce a report on microarray quality metrics. Within these reports is a scatterplot of principal components. The plot features interactivity by way of increasing the size of a point once it is hovered over. arrayQualityMetrics produces this plot through the use of the SVGAnnotation package. An attempt has been…
A type of animated, interactive graphics was famously presented to the world by Hans Rosling of the Gapminder Foundation in a TED talk . The bubble plots that were presented clearly showed changes for several variables over time. Paul Murrell produced an animated ggplot2 plot based on the Gapminder bubble plots. This demonstration is perhaps more informative as it separates countries into…
A type of animated, interactive graphics was presented to the world by Hans Rosling of the Gapminder Foundation in a TED talk . The bubble plots that were presented clearly showed changes for several variables over time. Paul Murrell has produced an animated ggplot2 plot based on the Gapminder bubble plots. We can see that over time, for all continents, the general trend is that as the number of…
To animate complex units, use the animUnit() function in gridSVG. Documentation on animUnit() is available in a draft article . The function grid.animate() provides a user the ability to perform animation on graphics objects. This is accomplished using SMIL animation and SVG’s <animate /> element. While it is the case that all properties of graphics objects can be animated, if support is…
This documentation may lag behind the latest version, use the documentation provided with the package for up to date information. The function grid.garnish() allows a user to add arbitrary attributes to grid graphics objects. These attributes are then applied to the SVG element that the graphics object translates to. This is most useful for adding JavaScript event attributes to grid graphics…
This documentation may lag behind the latest version, use the documentation provided with the package for up to date information. The function grid.hyperlink() enables the use of hyperlinks within an SVG image. By clicking an SVG element that contains a hyperlink, one can visit another web page. This can be useful to link elements within an SVG image to associated data sets and resources. The…
This documentation may lag behind the latest version, use the documentation provided with the package for up to date information. The function grid.script() allows the inclusion of JavaScript text or files within an SVG image. When used in conjunction with grid.garnish() , grid.script() can define the behaviour of the SVG document with regards to interactivity. The usage of the function is defined…
gridSVG is a package for R that turns a grid plot into an SVG image. Under the supervision of Dr. Paul Murrell I undertook both an honours project, and a Masters thesis developing gridSVG. A basic illustration of how gridSVG differs from the built-in SVG device is shown below. The key advantage of using gridSVG is that new animated, interactive graphics can be produced more easily and…
With the addition of the <svg> element to the HTML language in HTML5, we can provide even more ways of interacting with an SVG image. Here I will be demonstrating how the Stock Ticker example can be modified to provide useful interactivity via HTML5. The first step involved is to simply copy the SVG output from gridSVG, and insert it directly into your HTML document. This method means we treat the…
A demo I have produced is that of a stock ticker. It draws lines representing the stock prices of a few companies over one year. I sourced the pricing data for well-known tech companies from Google Finance . The idea behind this demonstration is to show how animation can be applied to time series data, in particular with line graphs. We can see how the lines appear to “draw” themselves…
A series of bootstrapping animations designed by Dr. Chris Wild and built in R by Keng Hao Chang are available for viewing. These animations are useful for the purpose of teaching students statistical concepts using a more visual and engaging approach than using static graphics. Although frame-by-frame animations were available, an attempt has been made by Paul Murrell to replicate the…
We can demonstrate basic interactivity in gridSVG by drawing a plot that produces tooltips. These tooltips appear whenever the mouse hovers over a graphical element in the plot and the text within the tooltip features the name of the grid graphics object that produced the element. This tooltip demonstration was largely borrowed from Paul Murrell’s gridDebug package, specifically with regards…
This project is now inactive . Visit GOMtv to watch GSL streams from now on. The GOMstreamer tool is used to allow Windows, OSX and Linux users to watch the GOMtv GSL via VLC . GOMstreamer was originally based on the prior work of Tomas Herman but has been updated to work on newer seasons’ streams, along with the addition of new features. Note: This requires a GOMtv account to work and the…
I was recently asked by a friend to add a module to the nginx web server that is serving both of our websites. Due to the fact that nginx statically links all of its modules into one binary, we cannot accomplish this in the typical Debian manner, i.e. something like apt-get install nginx-modulename . Because Debian doesn’t provide builds that have the module he wanted, I had to apply the…
After spending my summer working with R I have become very familiar with its lesser-known features. An area which is rarely explored is how flexible function calls can be. This post will explore the various behaviours of function calls in R. To start off we shall observe how R function calls can behave much the same as they do with most statically typed languages, where the arguments to the…
I was fortunate to undertake a summer studentship with the University of Auckland’s Department of Statistics over the summer of 2010–2011. My project was entitled “Software for the Normal Laplace Distribution”. The purpose of this project was to improve upon the functionality present in the NormalLaplace package that was available via the Rmetrics group on R-Forge . What…
Over the summer of 2009–2010 I undertook a summer studentship at the University of Auckland Department of Statistics . The project I undertook was to create a new package called GeneralizedHyperbolic based on David Scott’s HyperbolicDist package. What the GeneralizedHyperbolic package does is it provides functions for use with the generalised hyperbolic distribution and related…
Note A repository has been put up on GitHub with my solution. The repository is unlikely to be in a usable state. During the middle of 2009, the web-based Git hosting service GitHub held a content recommendation contest . The idea was to create an algorithm that would recommend a set of repositories that a user might be interested in. I attempted this contest although I wasn’t exactly…
This is the personal website of Simon Potter. I am currently a Software Developer at TaxLab . Previously I’ve worked at the following companies: Starshipit Zip Datacom RLDatix (formerly RL Solutions) IQVIA (formerly IMS Health and Cegedim) Prior to this I undertook an MSc in Statistics (by thesis), BSc (Hons) in Statistics and a BCom/BSc in Information Systems, Computer Science and…