Coffee has always been my drug of choice, but when I stumbled upon a neat book about coffee I became inspired to rebuild my dilapidated espresso machine.  The espresso machine had long seen its day and not even a good cleaner could do the trick.  I began the arduous process of disassembly; made possible by the small buzzsaw on my dremel and a proprietary tri-wing screw bit I had to order online (they really don't want you to open the thing).  Upon tearing the machine apart, I found that the sour taste of the coffee had been caused by a gunky build-up of the espresso machine cleaner I used and a burnt, crumbly piece of plastic that had gotten wedged in the inlet chamber.  After a thorough cleaning and liberal discarding of unnecessary parts, I was left with the following:





I scrapped most of the plastic pieces that weren't critical to functionality.  Unfortunately, the bottom of the group head was made of plastic and part of the frame that I tossed. The group head is the cylindrical part that your portafilter fits into and is kind of an important part.  Call upon... 3D printer!
Group head (aka Brühkopf)

Group Head Design
I used a free software called OpenSCAD for building the design.  With OpenSCAD you define the model using their coding language; mouse is only for navigating through your design.  It may seem kind of intimidating at first but after some quick tutorials (and I mean quick) it was quite easy to get the hang of.  Using the language (rather than mouse) forces you to be extremely precise in your measurements, something that is usually important when designing something to fit into the real world.  The basics of the OpenSCAD language allows you to define shapes (cube, cylinder, sphere) and apply operations upon them (translate, rotate, scale).
For example the following creates a simple cylinder with height 10 and radius 5:
cylinder(h=10, r=5, center=true);
If you wanted to create an oval shape instead, you would scale it non-uniformly:
scale([1,2,1])
{
    cylinder(h=10, r=5, center=true);
}
You can use the difference operation to remove pieces that you don't want.  In this case I've removed a cube from the cylinder:
difference()
{
    scale([1,2,1])
    {
        cylinder(h=10,r=5, center=true);
    }
    cube([5, 5, 11], center=true);
}
You could even remove a piece of the piece you're removing and so on... (diff-ception):
difference()
{
    scale([1,2,1])
    {
        cylinder(h=10,r=5, center=true);
    }
    difference()
    {
        cube([5, 5, 11], center=true);      
        sphere(5.5);
    }
}

You can see how this could get messy quick.  Just like with normal code, occasionally you need to refactor and simplify the design to make it elegant and manageable.
The final design











The biggest problem that I found when building something that will fit into a real-world thing, was testing it.  How do I make sure that the screw hole I placed using my imprecise measuring tape was in the correct location?  A 2 millimeter wide hole just a millimeter off would prevent the entire thing from fitting.  The solution (without a bunch of trial and error) was to calculate the measurements in multiple ways and check that the results matched.  
For example, the screw hole x,y coordinates were first approximated (orange lines) by measuring the distance of the screw hole from the center (h) and measuring the distance from one screw head to another (2y).  Then you can use the Pythagorean theorem to find the x distance (apologies for surfacing any repressed high school memories).  To double check your measurements, you can measure the distance from the far tip of one screw head to the other and draw a circle in OpenSCAD using this as the diameter.  If your original measurements and high school math are correct, the line should fall directly on the tip of the screws. Huzzah!  It's not infallible but it does give you a bit more confidence before printing the thing.

I went to the maker lab at Microsoft to commandeer one the many 3D printers for a couple hours.  The lab is a nerd heaven with seven 3D printers, soldering stations, laser cutters, beer on tap, a giant radial drill, and pieces of old projects littered around the room (most notably a human sized robot with boxing gloves).  I don't know about you but beer, lasers, and robots sounds like a damn good time to me.


Some of the makerbot 3D printers
Raspberry Pi monitored plant
Rocky Roboa

Engineering Porn
The satisfying part finally came when the screws lined up with the threading and the portafilter rotated snugly into place.

Dat snap though
Macchina della Morte
Testing the machine was not as straightforward as I had anticipated.  The first couple attempts were a failure due to the portafilter not forming a perfect seal with the rubber gasket.  Keep in mind that an espresso machine works by shooting pressurized steam through tamped coffee.  A typical espresso machine will build up 9 atmospheres of pressure when pulling a shot.  That's 10 times the pressure of a consumer pressure cooker!  I mistakenly designed the group head to fit the portafilter, but the gap actually had to be a bit undersized to apply enough pressure on the gasket to form a good seal.  Imagine the fun of trying to unplug a pressurized bomb while it shoots jets of steam and boiling water out the sides; at you and the exposed electrical wires.  After tightening the group head down further to form a good seal, the machine becomes slightly more terrifying as it's now allowed to build up even more pressure.  I don't think that the PLA plastic that the group head was printed out of is intended to withstand high temperatures and pressure simultaneously.  It was a fun project, but after my close encounter with face melting trajectories, I decided that buying a new espresso machine would be cheaper than skin grafts.  If I ever "gift" you an industrial looking homemade espresso machine, it's most likely a passive-aggressive way to unfriend you.

More Reads
What's the worst that could happen with a pressure cooker?
I added the part I designed to thingiverse if you're interested in making your own 3rd degree burn machine.




A bitcoin puzzle is equivalent to finding the correct key to a lock out 200 quintillion (10^18) keys.  Given the key, you can quickly tell whether it fits in the lock, but to find the key yourself would be a nearly impossible feat.  

With bitcoin, the block chain is the public ledger that contains the history of all previous solutions.  Each new puzzle (lock) contains a reference to the previously solved puzzle.  Once someone solves the puzzle, they present their solution to the community.  The community can verify that the solution is correct and that it properly adds on to all previous solutions.  Upon validating a solution, each entity adds it to their version of the block chain.  At any point in time, there can be multiple puzzles available to solve.  Each puzzle would lead to a slightly different history which could cause subsets of the community to temporarily have different records of the proper history.  This discrepancy is resolved once a new solution is presented.  Whichever branch has the longer history is chosen to become the official correct branch.

Great ideas are similar to the keys of a bitcoin verification puzzle.  Ideas are difficult to come up with, but are easy to verify once they are presented to you.  

In this analogy the human brain acts as a copy of the block chain containing a complete history of the previous solutions.  When presented a new idea, we compare it to all of the previously validated ideas and decide to accept it if it matches.  If it matches, we broadcast this idea which is then accepted by people who have block chains with similar histories.  In the case where we find a block chain which is longer that doesn't match up with our current history, we (should) discard the history of solutions which do not match and accept the new, longer history as the current best.  For a history to be "longer" in this analogy, implies that the chain of ideas is better able to explain the universe.  Unlike the solutions to bitcoin puzzles which can travel around the globe in hours, ideas have historically taken generations to spread before becoming widely accepted.

Buy some bitcoin using CoinBase!
https://www.coinbase.com


Learn more about how the bitcoin system works

Faking Reality

Consciousness (whatever the hell it is) is created by the pattern of neurons firing in our brain. As time elapses, the neuron firing propagates through your brain. At each time frame, the state of the neurons changes with respect to the previous time frame.  The current state is a function of the previous state and the additional sensory-input neurons.  Without novel input (from your senses), the existing neuron firing pattern would eventually diminish to nothing, similar to an echo in a canyon.  If consciousness were to be simulated by a computer system, the computer (a digital machine) would have to replicate the brain in discrete frames of time.  At real time t the simulated brain would be in state a.  Some real time later (t+n), the computer would finish its computation and store the neurons in state b.  Whether n is a nano-second or a week, the simulated brain would experience time passage in exactly the same way.  It's experience is defined by the states, whose input is entirely disconnected from the outside world.  Today, computers store their state using transistors and electricity.  To the same effect, these states can be represented with any other substrate and the computation would be the same. Therefore, if the computation was made by humans using pencil and paper and occurred over hundreds of years, the simulated consciousness would be none the wiser.

Infinity, the wish granter
Think of the billion of sperm that you (in sperm form) competed against just to take birth.  One could incorrectly conclude that because the chances of you winning the race are so minuscule, it must have been by some divine intervention that you were "chosen" to be the sperm that made it.  This biased misconception (pun intended) is created by the fact that the sperm that didn't make it, are not given the consciousness to wonder this question.  The same effect can be seen with the propensity of our universe to create conscious life.  Since the probability for conscious life to happen by chance in our universe is so infinitesimally small, using the same flawed logic we can conclude that the creation of the universe must have been guided by some divine hand.  A much more likely explanation is that there are an unimaginable number of universes, many which are not conducive to life, leading to a small percentage of them having some form of life and consciousness.  In the many universes which life and consciousness does not exist, no one exists to wonder why that universe did not lead to conscious life.  This is called the anthropic principle.  It is likely, by this anthropic principle, that there exists an infinite number of universes.  Using the same logic that lead us to the anthropic principle, we can deduce that given an infinite number of universes, even the most unlikely events are guaranteed to happen.  Flying humans, lava rainbows, real-life Pikachu.  No matter how improbable for a universe to exist containing these things, infinity will always make them happen.

Immortality in the dust
I can come up with any scenario that has some non-zero probability of playing out, and by the anthropic principle logic and assumptions, I can show that it will happen.  For example, I could think of any possible configuration of select grains of sand on the beach and guarantee this will exist at some point in time in some universe.  As I showed previously, the exact material that is performing the simulation of a brain is independent to the experience of the brain.  Combining these two ideas together we have achieved immortality. Imagine the grains of sand to be in state a, and sometime later to be at state b.  We know this will occur in some universe by the anthropic principle and we know that it will produce conscious; our consciousness.

Cred
This radical idea appeared in Greg Egan's fictional novel, Permutation City.  The story describes a futuristic world where our computation has advanced to the capability of simulating human brains and touches upon its social and existential implications.

Further reads
Permutation City - $3 ebook
Why we're most likely living in a simulation - A proof

Quantum Suicide


Ads are a necessary evil.  Digital content such as web services and phone apps provide a helpful service to the consumer, and in return the consumer provides an equally valuable service to the developer: viewing advertisement.  


Viewing Advertisement is Paying Money


The benefits of advertisement are complex; even if ads don't correlate to direct sales, it increases brand awareness.  It's difficult to put a price on viewing ads, but some companies already have.  Often products will offer an ad-free experience if the user is willing to pay a fee.  For example, pandora.com allows the user to listen to music free of ads by paying for a monthly subscription.  Amazon provides an ad-free kindle device if the consumer is willing to pay an extra $20.  The amount of money that the service should charge you to remove advertisement should be the amount of profit that they can make off of you viewing that advertisement.  This means that there is an exchange rate between the viewing of advertisement and currency.  Viewing ads follows the same economic laws as regular currency.  In the case that a service requires us to view too many ads, we quickly switch to a service which provides the same benefits but with less advertisement.  Without monopolies, the ad viewing conversion rate will reach an equilibrium state.



Ad Viewing as a Service (AVaaS)


The service of viewing an ad is no different than any other service that you can provide to earn a profit.  A consumer and service provider agree to make a trade of services; one provides the ability to listen to music, and the other provides the service of viewing advertisement.  Replace "viewing advertisement" with "building a chair".  Pandora.com will allow you to access their content, if you build them a chair every month.  In the case that you don't want to build a chair every month, you can instead give pandora.com the amount of money that they could have sold that chair for.  


AVaaS Theft


Since viewing an ad is your way of paying money, forcing you to view an ad without providing a service in return is morally equivalent to stealing from you.  In the case that Geico flies a banner behind an airplane through your city, each citizen that views this ad is paying some currency with absolutely no service provided in return.  It may not seem like much out of your pocket, but it adds up when multiplied by each citizen.  If the revenue generated from the ad is not feeding back into providing you a service or reducing the price you pay for a service, you're probably getting cheated.  The next time you see an advertisement, think about the service that the company is providing you in return.



Can sounds in frequencies outside the audible range of humans damage our ears?


Unsurprisingly, damage to the ear is not caused by the frequency of sound, but by the decibels (volume).  This means that sounds that you can't hear can still be damaging to your ears.  The audible frequency range to a human is typically from 8 Hz to 22kHz.

Turn your volume up and play this sample of a tone at 15kHz:


Hurts your ears, right?  Unbeknownst to you, I have been playing a 22kHz tone (barely outside human hearing) at the same volume since you've been on this page.  Both tones can be equally damaging when listened to at a high enough volume for a long enough duration.  Imagine a new age of computer viruses that instead of stealing your credit card info, they silently make you go deaf by blasting in tones inaudible frequencies.  So quick, close the page before it's too late!

We all know that with great risk, we have an opportunity of great reward. When investing financially throughout one's life, people tend to make larger gambles early in their career, and invest more cautiously later in their life. It's not that the younger investors are more naive; it's the smart decision to make. The benefit of the risk is the high reward that may put you at an advantage for the rest of your life.  If that risk does not pay out, you still have the rest of your life to recover such that you may only be at a slight disadvantage from where you would have stood otherwise.  


How does financial risk apply to the literal perilous risks of a youth?  The reward is the opportunity to learn and advance socially; while the risk could even include death.  "But hold on", you may say.  "This analogy is entirely flawed...  If we were to die, there is no ability to recover like you could with a financial investment gone sour."  The catch is that the analogy is not applying to ourselves as humans, but applying to ourselves as genes.  Richard Dawkins has unfurled evolution as a beautifully simple concept which revolves around the goals of the gene, and not the individual.  “Individuals are not stable things, they are fleeting. Chromosomes too are shuffled into oblivion, like hands of cards soon after they are dealt. But the cards themselves survive the shuffling. The cards are the genes. The genes are not destroyed by crossing-over, they merely change partners and march on. Of course they march on. That is their business. They are the replicators and we are their survival machines. When we have served our purpose we are cast aside. But genes are denizens of geological time: genes are forever.” - Richard Dawkins, The Selfish Gene.  If you are to think of our bodies as the currency and the genes as the investor, the analogy falls into place.  In the case that an over-risky youth dies early, the parents still have time to create more "currency" for their genes.  We'll call this the "child replacement effect".  It sounds heartless that our genes who we live and die for should treat us this way, but keep in mind that these are mindless machines acting purely on probability.  


Still, there are many other factors which effect risk as you age.  For example, after passing through your teenage years, you're more likely to have offspring to take care of.  Your offspring have half of your genes; so to take life threatening risks not only puts the genes in your body in danger, but prevents you from caring for the genes in your offspring.  


So if there are other factors which could affect your risk with age, how can we be certain that the child replacement effect has any weight in the matter?  If you turn the problem around it states: if your parents are more likely to have an additional child in the (unfortunate) event of your death, then your genes will design you to be more risky.  To see why this is true we will convert the problem to an estimated value equation.  Your siblings carry half of your genes on average.  Your parents have an x% chance of having another child in the case of your death and a y% chance in the case that you live.  Let's assume x=55 and y=40.  Under these conditions, if you were to die, 7.5% (.5*(.55-.4)) more of your genes will exist compared to the alternative situation where your parents do not subscribe to the "child replacement" strategy.  If you went to Las Vegas and the casino claimed to pay you back 7.5% of your losses if you are to go bankrupt, then of course it makes sense that you will play slightly more risky than you would otherwise.  Obviously you don't want to go bankrupt (or die), but from your gene's perspective, it's still not game over.  


Conversely, assume that the child replacement strategy does not exist.  Imagine that you're balancing an equation where the goal is to maximize the amount of genes we pass on in the long run.  The knob we're tuning dictates how much risk we should take.  It's easy to see how turning the knob too much one way or the other will offset the balance away from the maximum.  After we have it perfectly balanced, imagine that now we introduce the child replacement strategy.  The child replacement strategy gives slightly more motivation for our death, which implies you can afford more risk than you're currently tuned for and would throw the equation off balance.  To re-balance we must adjust the knob in the favor of more risk.

All that we need to do now is show that the child replacement strategy is practiced.  In 2004, a devastating tsunami ravaged Indonesia, killing 170 thousand citizens.  The 9.2 magnitude catalyst earthquake was literally felt across the entire earth.  A tsunami can provide unique statistical data in that it's unbiased to a victim's social status and can be isolated to a single point in time (unlike death from war or famine).  Researchers found that mothers who suffered the death of their child were "37 percent more likely to have another child by 2009 regardless of the child’s age" (NBER Working Paper No. 20448).  Numerous other tragic events provide similar evidence, ranging from genocide (Heuveline and Poch 2007) to earthquakes (Finlay 2009), all showing an increase in fertility rate with those exposed to the disaster.

It's difficult to directly measure the magnitude of the child replacement effect, however we can be sure it exists.


This is a small application of the theories described in the classic novel, The Selfish Gene.  
Understanding the world from the gene's perspective is a fundamental tool for reasoning about human psychology, grasping the simplicity of evolution, and unraveling the meaning of our very existence.  Why do cuckoo bird eggs mimic the look of other bird species?  Why does menopause exist?  What is the difference between our genes and a virus?  I highly recommend you to add it to your reading list!

To simplify the complex world around us, we often attempt to make it discrete.  These discrete measurements help us reason about things without the need of complicated calculations.  However, because our world is continuous (not discrete), occasionally we come across seemingly paradoxical situations when we near the boundaries.

One such example are the time-zones we divide our globe into.  How can it be that by traveling a couple feet, from one timezone to the other, you could gain or lose an hour's worth of time?  It doesn't make sense.  The world doesn't tick like the hand of a clock; it slowly rotates leaving no room to draw any lines.


Imagine what the world would be like if we used the actual time.  Both time and location would become relevant when planning anything.  When traveling for an appointment in the west, we could leave a bit later; east, a bit earlier. This may seem impractical, but I can imagine in the future, as our dependence upon technology increases, it could be seamless.  Below is a map giving you the actual time of any location you click.  Note that this time is based on the current UTC which may or may not line up with your current daylight savings.



Your actual time: