Monte Carlo simulations (or methods) is the technique of applying randomness and the Law of large numbers to the solution of various scientific and engineering problems. One of its first documented uses was by Stanislaw Ulam and John von Neumann for nuclear weapon simulations after WWII [1]. In this post I want to provide examples of some simple uses of Monte Carlo simulations. We'll start with the classical example of calculating the value of \pi by throwing darts. Estimating pi Suppose we take a square board and inscribe a quarter of a circle into it. We then proceed to throw darts at the…
Like many programmers, I find Alexis King's Parse, don't validate article fascinating, because it gives a name to an idiom that seems familiar and important - one I've observed and used in the past without naming it explicitly. This post is a review of the "Parse, don't validate" pattern applied to the Rust programming language (the original post uses Haskell). I was particularly interested in finding educational examples of this pattern in the Rust standard library and other well-known projects. Without repeating the original article (please read it first!), here's the gist of it. Consider…
This is part 7 in a series of posts on writing concurrent network servers. In this part, we discuss how the challenges described in earlier parts are tackled in the Rust programming language. All posts in the series: Part 1 - Introduction Part 2 - Threads Part 3 - Event-driven Part 4 - libuv …
Expedia Group Technology — EngineeringCombine a GraphQL schema, hints and a LLM to generate contextual GraphQL mock responsesPhoto by Samuel Vazquez somewhere in New ZealandA product developer on our navigation header team spent an afternoon hand-typing a 200-line GraphQL JSON mock response so they could keep building the UI while a resolver was pending to be implemented. The schema changed the next morning. We threw the mock away. That is the boring tax on every GraphQL prototype: mocks that drift, fixtures that rot, frontends blocked on backends, and demos slipping because nobody wanted to…
How a branch-free loop and byte-space arithmetic let GitHub case-fold every byte of code search at >45 GiB/s on a single core. The post Don’t stop early: Case-folding source code at memory speed appeared first on The GitHub Blog.
I started as a Java developer, but for some time now, I have broadened my horizons. Recently, I thought about how early languages were dedicated to a single target and platform, and now they are broadening their focus. In this post, I want to write down my thoughts in the hope that it may be useful to others, probably to my future self. Definitions You may have been wondering about the title terms.
One of the major shifts in developer ergonomics has been the introduction of functional pipelines to most popular languages. A pipeline is a chain of operations on a set of data that transforms the data into another shape or value. It is made functional by using lambda functions as the primary way of specifying behavior. git ls-files | grep -o "\.\w*$" | sort | uniq -c Linux has always been built around this idea; programs accept text input and produce text output. This allows you to chain programs together with pipes (|). The above example finds all tracked files in a git repo, then matches…
Announcing Crafting Lambda Functions in Rust, a new book that guides you through building efficient, reliable, and cost-effective AWS Lambda functions using Rust, written by Luciano Mammino and James Eastham. Learn why Rust and serverless are a perfect match. Early access is now available at rust-lambda.com!
This article walks through the challenges of cross-compiling a Rust web app from a Mac Silicon machine to an x86 Docker container using musl, RusTLS, multi-stage builds and other techniques to produce a small container image.
Optional Google Analytics helps us understand visits. Microsoft Clarity records masked interactions to improve the site. Optional tools stay off unless you choose them. Privacy details.