Fat Jars with Excluded Dependencies in Gradle

In this post I will outline how to build a jar in Gradle that includes all project dependencies, a so-called “fat jar”. However, this implementation will allow you to selectively exclude certain dependencies from the packaged jar. The motivation for this came while using Apache Storm, where any dependencies must be bundled in the jar, but the Storm libraries themselves are provided by the runtime environment and thus must not be bundled.

(more…)

Read More

Splitting the Transaction Cost

Suppose someone (A) is transferring you (B) $1,000 (or pounds, or yen, or whatever), and there is a 5% transaction fee, but you want to split the fee evenly between the two of you. Easy, that’s a total fee of $50 so $25 each, right? Close, but not quite.

In that case A would transfer the original $1,000 plus their half of the $50 fee, for a total of $1,025. However, now the total fee charged has risen to $51.25 ($1,025 * 5%), because the total transferred amount went up from $1,000 to $1,025. B would receive $973.75 ($1,025 – $51.75), making their share of the fee $26.75 ($1,000 – $973.25). In order to correctly calculate this, we need to do a bit more maths.

(more…)

Read More

Danish Meatballs

My super simple recipe for Danish meatballs, or “Frikadeller” as they’re called in Danish.
Nothing special, but someone asked for it, so I’m leaving it here.
According to my dad, who gave me the recipe, this batch makes about 12, though I have never counted.
Normally in Denmark we’d serve this with a healthy portion of white potatoes and gravy, but you can have it however you like.

Meatballs, with big chunks of onion.
Meatballs, with big chunks of onion.

(more…)

Read More