Skip to content

Instantly share code, notes, and snippets.

View bostontrader's full-sized avatar

Thomas Radloff bostontrader

  • Somewhere in Human space
View GitHub Profile
@bostontrader
bostontrader / OnCryptoCurrencyAmounts.md
Last active February 27, 2021 00:40
Crypto currencies frequently use numbers with uncommonly high precision. Dealing with these numbers is difficult for a variety of reasons. But there are solutions available.

On Crypto Currency Amounts

Crypto currencies frequently use numbers with uncommonly high precision. Dealing with these numbers is difficult for a variety of reasons:

  • The precision of these numbers easily exceeds the ordinary limits of software. For example, although 32 bit ints are ubiquitous, they are not big enough to do the job.
  • There are usually several layers of software working together in a stack. Figuring this out with just one piece of the stack is not enough. Our solution must satisfy all the members of the stack.
  • We must understand rounding and round-off error.
  • We must understand the difference between storage and internal manipulation of the numbers vs. presentation in a UI.

A Solution

The bookwerx-core-rust and bookwerx-ui-elm products are permeated with these issues. In this essay I will describe one particular solution and explore the choices we had and the reasoning behind the choices we took.

@bostontrader
bostontrader / webpack-elm-loader-hangs-travis-ci.md
Created July 17, 2018 07:01
webpack-elm-loader appears to hang on Travis CI

TL;DR: If this is happening to you, just add the line sudo:required to travis.yml.

After a suitable amount of pulling of hair (my own), gnashing of teeth, and general fretting, I have found a solution to a rather nettlesome issue. I have some elm code in a project that uses webpack and Travis CI. It all works fine locally, but when I tried to build it on Travis, the webpack command apparently hung without any warnings or other clues.

At first I guessed that the problem might be the fact that by default, at the time of this problem, Travis was setting me up with Ubuntu 14.04. This being a rather long-in-tooth edition by now, perhaps that's a problem. My research into how-to-specify a more recent version of Ubuntu was discouraging because apparently that was the latest edition available. I was welcome to redesign the entire CI process to use docker instead, but that sounded like work, so I contemplated further.

I next figured that perhaps the problem was between webpack and Travis. I found that if

@bostontrader
bostontrader / hello-ana-express.js
Last active August 9, 2016 00:10
Hello Authentication and Express using auth0, webtask.io, and Express.
var app = new(require('express'))();
var wt = require('webtask-tools');
app.get('/', function(req, res) {
res.end('Hello ' + req.user.name);
});
app.get('/about', function(req, res) {
res.end('About this app');
});