Installing Docker
Quick notes on installing Docker on various platforms:
Read More →Social links and a link to my CV.
Public datasets:
Quick notes on installing Docker on various platforms:
Read More →This question on Stack Overflow was a fun challenge: extract the markers off an embedded Google Map.
Read More →The R version of my Desert Island Docker talk. Similar idea to Desert Island Docker: Python Edition.
Read More →Over the years that I’ve been dabbling in public speaking I’ve generally developed a talk, presented it once and then moved on. However, I’ve noticed other speakers who give the same (or similar) talk at different events, where the talk evolves and improves over time.
Read More →From time to time I want to extract the table of contents from a PDF. Here’s how I do that using simple shell tools.
Read More →
The {emayili} package has adapters which make it simple to send email via a variety of services. For example, it caters specifically for ZeptoMail, MailerSend, Mailfence and Sendinblue. The latest version of {emayili}, 0.8.0 published on 23 April 2024, adds an adapter for Mailtrap.
The key to successful backtesting is to ensure that you only use the data that were available at the time of the prediction. No “future” data can be included in the model training set, otherwise the model will suffer from look-ahead bias (having unrealistic access to future data).
Read More →
Are you trying to build and push a Docker image from GitHub Actions?
Read More →
The Two-Fund Separation Theorem introduced by James Tobin, a Nobel Prize-winning economist, is a fundamental concept in investment theory. It addresses how investors can optimally allocate their assets. In an efficient market an optimal portfolio is a combination of a risk-free asset and a market portfolio.
Read More →
Sprinkling status messages across you code using print() statements can be a good temporary fix for tracking down issues in your code.
But it can get messy and there’s no way for you to selectively disable them. Sure you can redirect output to a file or /dev/null but this is an all-or-nothing solution. How about disabling some messages and retaining others?
This is where the logging module comes into its own.
Setting the values of one or more parameters for a GARCH model or applying constraints to the range of permissible values can be useful.
Read More →
The two quantities we have been modelling (the time-dependent average and standard deviation of the returns) represent respectively the (potential) risk and reward associated with an asset. The relationship between these two quantities is implicit in the GARCH model. However, sometimes the return depends directly on the risk. A variant of the GARCH model can take this explicit relationship into account.
Read More →
Most often when you are creating a new Docker image it will be based on one of the standard Docker base images like ubuntu, alpine, python or nginx. But sometimes you might want to truly roll your own image. Starting with literally nothing. From scratch. Tabula rasa.
Is this a “good” model? How to validate a model and determine whether it’s a good representation of the training data and likely to produce robust and reliable predictions.
Read More →
In general a parsimonious model is a good model. A model with too many parameters is likely to overfit the data. How do we determine when a model is “complex enough” but not “too complex”?
Read More →
The models we have been looking at do not differentiate between positive and negative residuals: both errors are treated the same. However, this does not align with reality, where the volatility resulting from a large negative return is higher than that for the corresponding positive return.
Read More →
In the previous post we assumed that returns had a normal distribution. This assumption implied that the distribution was symmetric and a positive return was as likely as the corresponding negative return. In reality this assumption is just not true and returns are asymmetrically distributed.
Read More →
A GARCH (Generalised Autoregressive Conditional Heteroskedasticity) model is a statistical tool used to forecast volatility by analysing patterns in past price movements and volatility.
Read More →
In the previous post we loaded stock data into R and then calculated return volatility, both for the entire time series and shorter intervals. We saw that volatility is not constant but can change appreciably with time. One way to get a clear view of changes in volatility is by calculating them using a moving or (“rolling”) window.
Read More →
I’m going to be writing a series of posts which will look at some applications of R (and perhaps Python) to financial modelling. We’ll start here by pulling some stock data into R, calculating the daily returns and then looking at correlations and simple volatility estimates.
Read More →The current version of PyInstaller (6.5.0) doesn’t play nicely with the boto3 package. Here’s how to fix it.
I’ve hit my head against this issue from time to time, so it seems like I need to document the solution somewhere for each reference.
Read More →
A collection of books read by my father, Frank Collier, for Tape Aids for the Blind. Dad was always an enthusiastic and patient reader. One of my earliest memories is of him reading to my sister and me in bed each morning. In retirement he devoted many hours to reading and editing books for Tape Aids for the Blind.
Read More →
In the previous post Traefik was compared to NGINX. Now let’s take a look at a few simple Traefik setups. We’ll focus on specifying the host and port.
Read More →
I’ve come across Traefik in a number of questions on Stack Overflow recently. I regularly use NGINX as a reverse proxy and sometimes find it to be a little obscure. Having an alternative would be helpful.
Read More →
I have seen a few questions on Stack Overflow relating to building a simple standalone Next.js app in a Docker image. Here’s one way to do it.
Read More →
There are many tools for generating CSS selectors and XPath expressions. However, short of using them in your code, how can you quick test them? In this post I’ll show how you can use your browser’s Developer Tools to establish that your CSS or XPath is doing what you intend.
Read More →
The parse() function from the html-react-parser package converts HTML strings into React elements. It allows you to take HTML and render it as if it were JSX. This can be particularly useful when you’re working with content that comes as HTML from external sources (such as a CMS) and you want to include that content in your React components. It can also be used to filter and modify the React elements.
In a previous post we looked at how to import content from Medium. Another potential source of content is an RSS feed. In this post we’ll see how RSS content can be imported into a Gatsby side.
Read More →
In a previous post we looked at how to use AsciiDoc Markdown to author content for a Gatsby site. Another approach to handling Markdown content is MDX, which is “Markdown for the component era”. In this post we’ll see how to integrate MDX into a Gatsby site.
Read More →
Suppose you want to redirect paths beginning with @ to a specific user page. For example, the @datawookie path would take you to the user page for handle datawookie.
There are probably a few ways to do this, but one approach would be to use dynamic routing.
🚀 TL;DR
Show me the code. Look at the 27-dynamic-users branch. This site is deployed here.
First let’s set up the user page at src/pages/user.jsx.
Is my code secure? This is something that we should all be thinking (if not worrying) about. A thorough security audit would be the ideal, but what if you don’t have the skills or resources for that? Well, there are some tools that will at least get you part way there.
Read More →You might need to run a Selenium crawler in a GitLab CI pipeline. Here’s how to get that set up.
Read More →
In a previous post we used WordPress as a CMS for a Gatsby site. We can do something similar with Medium.
Read More →
Gatsby and Tailwind are a formidable combination for putting together a robust and attractive site. Throw Docker into the mix and you also have robust and reliable deployments. Here’s how to set that up for a minimal site.
Read More →
Want to use Tailwind CSS with your Next.js site? Here’s how to get that set up. Also how to wrap the whole project in a Docker image.
Read More →
Class name mangling (or hashing) is becoming increasingly prevalent. There’s no need to let it slow you down though. This is how you can deal with it.
Read More →In the interests of full disclosure, I know very little (very little indeed!) about .NET. But I do enjoy figuring things out. In this post I’ve documented what I learned when trying to connect a simple .NET application to MySQL using Docker Compose.
We’re going to try to do this using Docker as far as possible, which will allow me to avoid having to set up .NET on my local machine.
Read More →
Not everybody is comfortable crafting web pages directly in JavaScript, HTML or even Markdown. Often content writers are more productive in an environment like WordPress. What if you want to develop your site using Gatsby but allow content writers to still craft their content in WordPress? No problem! You can use WordPress simply as a Content Management System (CMS), then pull the content through into your Gatsby site.
In this post we’ll look at how to set up a Headless WordPress CMS as a source of content for Gatsby.
Read More →
Populating the <head> tag might not be the most scintillating component of building a web site, but it’s an important one to get right. Gatsby’s Head API provides a flexible mechanism for doing this and supersedes the functionality from React Helmet.
It’d be cool to be able to voice chat to other players on the Minecraft server. There are a few ways to implement this, one of which involves setting up and connecting a Discord server.
Read More →
The original Java Edition of the Minecraft Server that we installed previously implements all of the basic server functionality required for multiplayer Minecraft. But perhaps this is not enough. What if you want to customise the server by installing plugins? In that case you need to install a more sophisticated server forked off the original. The PaperMC Minecraft Server provides a lot of bells and whistles not present in the original.
Read More →
A quick review of the year.
Now onto a few interesting articles from this week, mostly announcements of new versions.
Read More →
When I containerised Selenium crawlers in the past I normally used a remote driver connection from the crawler to Selenium, running a separate Docker image with Selenium and accessing it via port 4444. This has proven to be a robust design. However, it does mean two containers rather than just one, leading to a higher maintenance burden and elevated resource requirements.
What about simply embedding Chrome and ChromeDriver directly into the crawler image? It requires a bit more work, but it’s worth it. The critical point is ensuring compatible versions of Chrome and ChromeDriver.
Read More →
With a local or remote SSH tunnel the ports on both the local and remote machines must be specified at the time of creating the tunnel. But what if you need something more flexible? That’s where Dynamic Port Forwarding comes into play.
Read More →
Interesting articles from the week that was:
Read More →
Local and remote SSH tunnels serve the same fundamental purpose: they make it possible to securely send data across an unsecured network. The implementation details are subtly different though. A local SSH tunnel acts like a secure bridge from a local machine to a remote server. It’s ideal for accessing services on the remote server which aren’t publicly exposed. Conversely, a remote SSH tunnel reverses this direction, forwarding traffic from the remote server back to a local machine (or another machine).
The critical distinction between the two is the direction of the connection between the remote and local machines.
Read More →
In the previous post we looked at how to set up a collection of static redirects via the vercel.json configuration file. Now we’re going to explore a more flexible and dynamic alternative using Edge Middleware.
In the previous post we set up a Minecraft server on Ubuntu. Now we’re going to install the Minecraft client and connect to that server.
Read More →
I’m not a gamer, but I have an offspring who is deeply obsessed with Minecraft. I set up a Minecraft server for her so that she can play with her friends online in a safe environment.
Read More →