How to Use Java BigDecimal: A Tutorial
This document serves as a primer on financial math issues and as a tutorial on the use of BigDecimal in general

Currency calculations require precision to a specific degree, such as two digits after the decimal for most currencies. They also require a specific type of rounding behavior, such as always rounding up in the case of taxes.
java  math 
13 days ago
Effectively Using Iterators In Rust
In Rust, you quickly learn that vector and slice types are not iterable themselves. Depending on which tutorial or example you see first, you call .iter() or .into_iter(). If you do not realize both of these functions exist or that they do different things, you may find yourself fighting with the compiler to get your code to work. Let us take a journey through the world of iterators and figure out the differences between iter() and into_iter() in Rust.
28 days ago
What PostgreSQL has over other open source SQL databases: Part II
we'll look at data manipulation and retrieval, including indexing, virtual table features and query capabilities. For this series, we looked at what makes PostgreSQL stand out from other open source SQL databases, namely MySQL, MariaDB and Firebird.
4 weeks ago
Constraint Solver
In CAD software, we often want to express constraints, e.g.

Point a is 10 cm from point b
Line g is perpendicular to line h
Line t is tangent to arc c
haskell  math  algo 
4 weeks ago
System shock
A story of a 25-year-old font coming back with a vengeance
design  typography  fun 
4 weeks ago
The magic kernel
The “magic kernel” is a method of resampling images that gives amazingly clear results (free of “aliasing” artifacts, free of “ringing”, and free of “width beat” for thin features) yet is lightning fast (the simplest version only requires a few integer additions and bit-shifts).
5 weeks ago
a tale of software maintenance: OpenSSL and EVP_CHECK_DES_KEY
In case you need an OpenSSL anecdote to scare your co-workers with...
fun  security 
6 weeks ago
The More Things Change
whenever I look at the code for websites that use Flux, I’ve just felt…well, weird. I felt like I’d seen this pattern before, that I had stories of that way be dragons1 even though it was all “new,” but I couldn’t quite put my finger on why I felt that way.

… Congratulations! We’ve just designed Windows.
javascript  react 
6 weeks ago
Web Fonts Performance
Web fonts are great. They are also be really bad for front-end performance because they block rendering. You may have experienced this on a slow cellular network. Staring at a blank page is no fun, especially when the content has already loaded.

This talk explores why browser have placed fonts on the critical path, and how we can work around this while still delivering a good user experience. It also takes a look at what the future will bring to web font performance: preloading hints, the font-display property, and HTTP/2.
css  webdev 
7 weeks ago
Polymorphism for dummies - Haskell for all
This tutorial explains how polymorphism is implemented under the hood in Haskell using the least technical terms possible.
7 weeks ago
Surprisingly Turing-Complete
Pokemon Yellow: “Pokemon Yellow Total Control Hack” outlines an exploit of a memory corruption attack which allows one to write arbitrary Game Boy assembler programs by repeated in-game walking and item purchasing.
7 weeks ago
A vim Tutorial and Primer
There are dozens of vim references online, but most of them either go ninja straight away, or start basic and don’t go much deeper.

The goal of this tutorial is to take you through every stage of progression—from understanding the vim philosophy (which will stay with you forever), to surpassing your skill with your current editor, to becoming “one of those people”.
7 weeks ago
Processes a scanned document of text to clean the text background
8 weeks ago
A simple spectrometer can be built from a CD and a box.
Cut a slit on one side of the box. Place the CD on the other side with about 60 degree angle. Look down into the openning on the box. The slit should not be too wide, otherwise the spectrum lines will be blurred. It should not be too narrow either, otherwise the spectrum is too dim. I use a 0.2mm wide slit.

structure of the CD spectroscope
8 weeks ago
Counting Objects
Two years ago, if you cloned a large repository from any Git host, you probably found yourself waiting several minutes before data started being sent to your machine, while the server proudly announced that it was "counting objects".

However, if you try to clone the equivalent repository hosted on GitHub.com today, or on a GitHub Enterprise instance, you'll notice that data starts being sent immediately and the transfer is only limited by your available bandwidth to the server.

Inquiring minds may wonder: What are these objects, why did you have to count them every single time, and why are you not counting them anymore?
git  algo 
9 weeks ago
On Go, Portability, and System Interfaces
I've been noticing more and more lately that we have a plethora of libraries and programs written for Go, which don't work on one platform or another. The root cause of these is often the use of direct system call coding to system calls such as ioctl(). On some platforms (illumos/solaris!) there is no such system call.
golang  unix 
9 weeks ago
Stupid Template Tricks: Template Assembler
In this post, we'll build a simple x86 assembler C++ template metaprogram. The assembler will run at compiletime and generate machine code that can be run in as part of the compiled program, similar to inline assembly. We'll define a simple embedded domain specific language directly in C++ to express our assembly programs. By building the language directly in C++, we get a lot for free, such as powerful type checking and macro-like operations, and the syntax is not as horrific as you may imagine.
9 weeks ago
Some guiding principles for handling gender on forms.

The number one step is interrogating WHY you need a user's gender at all. 99% of the time, you really don't. So don't ask, full-stop.
9 weeks ago
« earlier      
accessibility admin algo android apple audio c clojure content css culture design devops django dotnet elixir emacs ember erlang fun gc git golang graphics hardware haskell indieweb java javascript latex math monads mongodb music mysql nethack networking ocaml photoshop php pl postgres privacy prolog python react redis ruby rust scala security smalltalk svg swift talk tools typography unicode unix via:macdrifter via:sunpig via:tlockney video vim webdev windows wtfjs zfs

Copy this bookmark: