Full Width [alt+shift+f] FOCUS MODE Shortcuts [alt+shift+k]
Sign Up [alt+shift+s] Log In [alt+shift+l]
38
The Moscow mule is one of my favorite cocktails because it’s simple, easy to make and delicious. This is a guide to making the perfect Mule. The Perfect Copper Mug The copper mug is essential for a real Moscow Mule. Copper immediately takes on the temperature of the drink keeping it cold and also offering that distinctive look and feel that makes this drink unique. After trying a few different mugs and doing some research, I’ve found that the perfect mug for a Moscow mule is the Old Dutch Copper Mug. These mugs aren’t cheap but they look amazing and offer a tarnish-resistant coating so they stay that way. The Perfect Ginger Beer Cock N Bull Ginger Beer is the classic ginger beer of choice for the Mule. It’s got that perfect mix of sweetness and heavy but not overpowering ginger flavor. For a less expensive and still good Moscow Mule, Trader Joes carries their very own Triple Ginger Brew mix that is also really great. The Recipe 2 ounces vodka ( I recommend Portland Potato Vodka ) 1/2...
over a year ago

Comments

Improve your reading experience

Logged in users get linked directly to articles resulting in a better reading experience. Please login for free, it takes less than 1 minute.

More from Alex Meub

The Magic of Solving Problems with 3D Printing

3D Printing has allowed me to be creative in ways I never thought possible. It has allowed me to create products that provide real value, products that didn’t exist before I designed them. On top of that, it’s satisfied my desire to ship products, even if the end-user is just me. Another great thing is how quickly 3D printing provides value. If I see a problem, I can design and print a solution that works in just a few hours. Even if I’m the only one who benefits, that’s enough. But sharing these creations takes the experience even further. When I see others use or improve on something I’ve made, it makes the process feel so much more worthwhile. It gives me the same feeling of fulfillment when I ship software products at work. Before mass-market 3D printing, creators would need to navigate the complexity and high costs of mass-production methods (like injection molding) even to get a limited run of a niche product produced. With 3D printing, they can transfer the cost of production to others. Millions of people have access to good 3D printers now (at home, work, school, libraries, maker spaces), which means almost anyone can replicate a design. Having a universal format for sharing 3D designs dramatically lowers the effort that goes into sharing them. Creators can share their design as an STL file, which describes the surface geometry of their 3D object as thousands of little triangles. This “standard currency” of the 3D printing world is often all that is required to precisely replicate a design. This dramatically lowers the effort that goes into sharing printable designs. The widespread availability of 3D printers and the universal format for sharing 3D designs has allowed 3D-printed products to not only exist but thrive in maker communities. This is the magic of 3D printing: it empowers individuals to solve their own problems by designing solutions while enabling others to reproduce those designs at minimal cost and effort.

8 months ago 102 votes
Building the DataToaster 3000

Last summer, I was inspired by a computer that was built inside of a toaster that I saw at a local computer recycling store. The idea of a computer with the design of a home appliance was really appealing and so was the absurdity of it. It occurred to me that this would be a fun and creative way to integrate technology into my life. After thinking about it, I realized there’s also something visually appealing about how simple and utilitarian toasters are. I have major nostalgia for the famous After Dark screensaver and I think this is why. I knew now that I wanted to make my own attempt at a toaster/computer hybrid. I decided to do just that when I created the DataToaster 3000: a toaster NAS with two 3.5 inch hard disk docking stations built inside it. The hard disks can be easily swapped out (while powered off) without taking anything apart. It uses a Zimaboard x86-64 single board computer and even has a functional knob that controls the color of the power LED. I designed a fairly complex set of 3D-printed parts that attach to the base of the toaster and hold everything neatly in place. This allows it to be easily disassembled if I ever want to make any modifications and also hopefully makes the project easier to build for others. It’s a ridiculous thing but I really do love it. You can find the build guide on Instructables and the 3D models on Printables.

11 months ago 89 votes
Building a Removable Bike Basket for the Yepp Rack

I wanted to add more hauling capacity to my bike and was looking for something compatible with my Yepp rear rack. I also use my rack with a child seat (the Yepp Maxi) which has a mechanism that allows it to attach and detach easily without sacrificing safety. I was thinking it would be great to build a Yepp compatible rear basket that could I just as quickly attach/detach from my rack. I designed a removable Yepp-rack-compatible rear basket that consists of a milk crate, some plywood for stability and a 3D printed bracket threaded for M6 bolts which hold it all together. It can be attached and removed in seconds and is very secure. 3D Printed Mounting Bracket I modeled my mounting bracket after the one on the Yepp Maxi childseat. After a few iterations I was able to make it perfectly fit. I printed it in PETG filament so it was UV resistant and then installed threaded inserts for M6 bolts to attach it to the milk crate and my rear rack. 3D Print and Build Instructions You can find the 3D print on Printables and a full build guide on Instructables.

a year ago 85 votes
The Yoto Mini is Perfect

The Yoto Mini is one of my favorite products. The team behind it deeply understands its users and put just the right set of features into a brilliantly designed package. I have no affiliation with Yoto, I’m just a happy customer with kids who love it. If you aren’t aware, Yoto is an audio platform for kids with what they call “screen-free” audio players (even though they have little pixel LED screens on them). The players are Wi-Fi enabled and support playing audio from credit card-sized NFC tags called Yoto cards. Yoto sells audio players and also licenses audio content and offers it on its platform as well. The cards themselves do not contain any audio data, just a unique ID of the audio content that is pulled from the cloud. After content is pulled on the first play, it is saved and played locally from the player after that. Yoto also supports playing podcasts and music stations without using cards. Their marketing puts a lot of emphasis on the platform being “ad-free” which is mostly true as there are never ads on Yoto cards or official Yoto podcasts. However, some of the other podcasts do advertise their content. So, what’s so great about the Yoto Mini? This concept isn’t new as there have been many examples of audio players for kids over the years. What sets it apart is how every detail of the hardware, mobile app, and exclusive content is meticulously designed and well executed. Yoto Mini Hardware The main input methods of the Yoto Mini are two orange knobs, turning the left knob controls volume and the right knob navigates chapters or tracks. Pressing the right knob instantly plays the Yoto Daily podcast and pressing it twice plays Yoto Radio (a kid-friendly music station). These actions are both configurable in the mobile app. The NFC reader slot accepts Yoto cards and instantly starts playing where you left off after you insert one. It has a high-quality speaker that can be surprisingly loud, an on/off button, a USB-C charging port, an audio output jack, and a small pixel display that shows images related to the audio content. The Yoto Mini is also surprisingly durable. My kids have dropped it many times on hard surfaces and it still basically looks as good as new. Yoto understands that the physical audio player itself is primarily used by younger kids and the design reflects this. My 3-year-old daughter was able to figure out how to turn it on/off, start listening to books using cards, and play the Yoto Daily podcast each morning which was empowering for her. This was her first technology product that she was fully capable of using without help from an adult. I can’t think of many other products that do this better. Yoto Mobile App The Yoto team understands that parents are users of this product too, mostly for managing the device and its content. Yoto has built a very good mobile experience that is tightly integrated with the hardware and provides all the features you’d want as a parent. From the app, you can start playing any of the content from cards you own on the player or your phone (nice if your kids lose a card), you can set volume limits for both night and day time, you can set alarms, and configure the shortcut buttons. You can record audio onto a blank Yoto card (which comes with the player) if your kid wants to create their own story, link it to their favorite podcast or favorite music. The app even lets you give each track custom pixel art that is displayed on the screen. Audio Content By far the most underrated feature is a daily podcast called Yoto Daily. This ad-free podcast is run by a charming British host and it is funny, entertaining, and educational. My kids (now 4 and 7) look forward to it every morning and the fact that it’s daily free content that is integrated directly into the Yoto hardware is amazing. To me, this is the killer feature, as my kids get to enjoy it every day and it’s always fresh and interesting. Yoto licenses content from child book authors, popular kid’s shows, movies, and music (recently the Beatles) which are made available in their store. I also discovered that Yoto does not seem to lock down its content with DRM. My son traded some Yoto cards with a friend and I assumed there would be some kind of transfer or de-registration process but to my surprise, they just worked without issue. Conclusion The Yoto Mini is a delightful product. The team behind it thought through every detail and made it an absolute joy to use both as a child and parent. I’m impressed at how well the Yoto team understands their users and prioritizes simplicity and ease of use above all else.

a year ago 79 votes
How To Quiet Down Your 3D Printer

When I first got my 3D printer, I built an enclosure to protect it from dust, maintain a consistent temperature, and minimize noise. I was surprised to find that the enclosure didn’t reduce noise that significantly. I then placed a patio paver under my printer, which made it noticeably quieter, but it was still audible from other rooms in my house. Recently, I found the most effective noise reduction solution: squash balls. These balls are designed with varying bounce levels, indicated by colored dots. The “double-yellow dot” balls have a very low bounce, making them ideal for dampening vibration, which is the primary cause of printer noise. I found an existing design for squash ball feet, printed it, and hot glued them evenly under my patio paver. My current setup includes the enclosure, patio paver, and squash balls under the paver. Now, the printer is so quiet that I actually can’t tell if it’s running, even when I’m in the same room. Occasionally, I will hear the stepper motors, but that’s rare. Most of the time I need to open the enclosure to make sure it’s still printing.

a year ago 44 votes

More in programming

If Apple cared about privacy

Defaults matter

21 hours ago 5 votes
first-class merges and cover letters

Although it looks really good, I have not yet tried the Jujutsu (jj) version control system, mainly because it’s not yet clearly superior to Magit. But I have been following jj discussions with great interest. One of the things that jj has not yet tackled is how to do better than git refs / branches / tags. As I underestand it, jj currently has something like Mercurial bookmarks, which are more like raw git ref plumbing than a high-level porcelain feature. In particular, jj lacks signed or annotated tags, and it doesn’t have branch names that always automatically refer to the tip. This is clearly a temporary state of affairs because jj is still incomplete and under development and these gaps are going to be filled. But the discussions have led me to think about how git’s branches are unsatisfactory, and what could be done to improve them. branch merge rebase squash fork cover letters previous branch workflow questions branch One of the huge improvements in git compared to Subversion was git’s support for merges. Subversion proudly advertised its support for lightweight branches, but a branch is not very useful if you can’t merge it: an un-mergeable branch is not a tool you can use to help with work-in-progress development. The point of this anecdote is to illustrate that rather than trying to make branches better, we should try to make merges better and branches will get better as a consequence. Let’s consider a few common workflows and how git makes them all unsatisfactory in various ways. Skip to cover letters and previous branch below where I eventually get to the point. merge A basic merge workflow is, create a feature branch hack, hack, review, hack, approve merge back to the trunk The main problem is when it comes to the merge, there may be conflicts due to concurrent work on the trunk. Git encourages you to resolve conflicts while creating the merge commit, which tends to bypass the normal review process. Git also gives you an ugly useless canned commit message for merges, that hides what you did to resolve the conflicts. If the feature branch is a linear record of the work then it can be cluttered with commits to address comments from reviewers and to fix mistakes. Some people like an accurate record of the history, but others prefer the repository to contain clean logical changes that will make sense in years to come, keeping the clutter in the code review system. rebase A rebase-oriented workflow deals with the problems of the merge workflow but introduces new problems. Primarily, rebasing is intended to produce a tidy logical commit history. And when a feature branch is rebased onto the trunk before it is merged, a simple fast-forward check makes it trivial to verify that the merge will be clean (whether it uses separate merge commit or directly fast-forwards the trunk). However, it’s hard to compare the state of the feature branch before and after the rebase. The current and previous tips of the branch (amongst other clutter) are recorded in the reflog of the person who did the rebase, but they can’t share their reflog. A force-push erases the previous branch from the server. Git forges sometimes make it possible to compare a branch before and after a rebase, but it’s usually very inconvenient, which makes it hard to see if review comments have been addressed. And a reviewer can’t fetch past versions of the branch from the server to review them locally. You can mitigate these problems by adding commits in --autosquash format, and delay rebasing until just before merge. However that reintroduces the problem of merge conflicts: if the autosquash doesn’t apply cleanly the branch should have another round of review to make sure the conflicts were resolved OK. squash When the trunk consists of a sequence of merge commits, the --first-parent log is very uninformative. A common way to make the history of the trunk more informative, and deal with the problems of cluttered feature branches and poor rebase support, is to squash the feature branch into a single commit on the trunk instead of mergeing. This encourages merge requests to be roughly the size of one commit, which is arguably a good thing. However, it can be uncomfortably confining for larger features, or cause extra busy-work co-ordinating changes across multiple merge requests. And squashed feature branches have the same merge conflict problem as rebase --autosquash. fork Feature branches can’t always be short-lived. In the past I have maintained local hacks that were used in production but were not (not yet?) suitable to submit upstream. I have tried keeping a stack of these local patches on a git branch that gets rebased onto each upstream release. With this setup the problem of reviewing successive versions of a merge request becomes the bigger problem of keeping track of how the stack of patches evolved over longer periods of time. cover letters Cover letters are common in the email patch workflow that predates git, and they are supported by git format-patch. Github and other forges have a webby version of the cover letter: the message that starts off a pull request or merge request. In git, cover letters are second-class citizens: they aren’t stored in the repository. But many of the problems I outlined above have neat solutions if cover letters become first-class citizens, with a Jujutsu twist. A first-class cover letter starts off as a prototype for a merge request, and becomes the eventual merge commit. Instead of unhelpful auto-generated merge commits, you get helpful and informative messages. No extra work is needed since we’re already writing cover letters. Good merge commit messages make good --first-parent logs. The cover letter subject line works as a branch name. No more need to invent filename-compatible branch names! Jujutsu doesn’t make you name branches, giving them random names instead. It shows the subject line of the topmost commit as a reminder of what the branch is for. If there’s an explicit cover letter the subject line will be a better summary of the branch as a whole. I often find the last commit on a branch is some post-feature cleanup, and that kind of commit has a subject line that is never a good summary of its feature branch. As a prototype for the merge commit, the cover letter can contain the resolution of all the merge conflicts in a way that can be shared and reviewed. In Jujutsu, where conflicts are first class, the cover letter commit can contain unresolved conflicts: you don’t have to clean them up when creating the merge, you can leave that job until later. If you can share a prototype of your merge commit, then it becomes possible for your collaborators to review any merge conflicts and how you resolved them. To distinguish a cover letter from a merge commit object, a cover letter object has a “target” header which is a special kind of parent header. A cover letter also has a normal parent commit header that refers to earlier commits in the feature branch. The target is what will become the first parent of the eventual merge commit. previous branch The other ingredient is to add a “previous branch” header, another special kind of parent commit header. The previous branch header refers to an older version of the cover letter and, transitively, an older version of the whole feature branch. Typically the previous branch header will match the last shared version of the branch, i.e. the commit hash of the server’s copy of the feature branch. The previous branch header isn’t changed during normal work on the feature branch. As the branch is revised and rebased, the commit hash of the cover letter will change fairly frequently. These changes are recorded in git’s reflog or jj’s oplog, but not in the “previous branch” chain. You can use the previous branch chain to examine diffs between versions of the feature branch as a whole. If commits have Gerrit-style or jj-style change-IDs then it’s fairly easy to find and compare previous versions of an individual commit. The previous branch header supports interdiff code review, or allows you to retain past iterations of a patch series. workflow Here are some sketchy notes on how these features might work in practice. One way to use cover letters is jj-style, where it’s convenient to edit commits that aren’t at the tip of a branch, and easy to reshuffle commits so that a branch has a deliberate narrative. When you create a new feature branch, it starts off as an empty cover letter with both target and parent pointing at the same commit. Alternatively, you might start a branch ad hoc, and later cap it with a cover letter. If this is a small change and rebase + fast-forward is allowed, you can edit the “cover letter” to contain the whole change. Otherwise, you can hack on the branch any which way. Shuffle the commits that should be part of the merge request so that they occur before the cover letter, and edit the cover letter to summarize the preceding commits. When you first push the branch, there’s (still) no need to give it a name: the server can see that this is (probably) going to be a new merge request because the top commit has a target branch and its change-ID doesn’t match an existing merge request. Also when you push, your client automatically creates a new instance of your cover letter, adding a “previous branch” header to indicate that the old version was shared. The commits on the branch that were pushed are now immutable; rebases and edits affect the new version of the branch. During review there will typically be multiple iterations of the branch to address feedback. The chain of previous branch headers allows reviewers to see how commits were changed to address feedback, interdiff style. The branch can be merged when the target header matches the current trunk and there are no conflicts left to resolve. When the time comes to merge the branch, there are several options: For a merge workflow, the cover letter is used to make a new commit on the trunk, changing the target header into the first parent commit, and dropping the previous branch header. Or, if you like to preserve more history, the previous branch chain can be retained. Or you can drop the cover letter and fast foward the branch on to the trunk. Or you can squash the branch on to the trunk, using the cover letter as the commit message. questions This is a fairly rough idea: I’m sure that some of the details won’t work in practice without a lot of careful work on compatibility and deployability. Do the new commit headers (“target” and “previous branch”) need to be headers? What are the compatibility issues with adding new headers that refer to other commits? How would a server handle a push of an unnamed branch? How could someone else pull a copy of it? How feasible is it to use cover letter subject lines instead of branch names? The previous branch header is doing a similar job to a remote tracking branch. Is there an opportunity to simplify how we keep a local cache of the server state? Despite all that, I think something along these lines could make branches / reviews / reworks / merges less awkward. How you merge should me a matter of your project’s preferred style, without interference from technical limitations that force you to trade off one annoyance against another. There remains a non-technical limitation: I have assumed that contributors are comfortable enough with version control to use a history-editing workflow effectively. I’ve lost all perspective on how hard this is for a newbie to learn; I expect (or hope?) jj makes it much easier than git rebase.

7 hours ago 3 votes
Many Hard Leetcode Problems are Easy Constraint Problems

In my first interview out of college I was asked the change counter problem: Given a set of coin denominations, find the minimum number of coins required to make change for a given number. IE for USA coinage and 37 cents, the minimum number is four (quarter, dime, 2 pennies). I implemented the simple greedy algorithm and immediately fell into the trap of the question: the greedy algorithm only works for "well-behaved" denominations. If the coin values were [10, 9, 1], then making 37 cents would take 10 coins in the greedy algorithm but only 4 coins optimally (10+9+9+9). The "smart" answer is to use a dynamic programming algorithm, which I didn't know how to do. So I failed the interview. But you only need dynamic programming if you're writing your own algorithm. It's really easy if you throw it into a constraint solver like MiniZinc and call it a day. int: total; array[int] of int: values = [10, 9, 1]; array[index_set(values)] of var 0..: coins; constraint sum (c in index_set(coins)) (coins[c] * values[c]) == total; solve minimize sum(coins); You can try this online here. It'll give you a prompt to put in total and then give you successively-better solutions: coins = [0, 0, 37]; ---------- coins = [0, 1, 28]; ---------- coins = [0, 2, 19]; ---------- coins = [0, 3, 10]; ---------- coins = [0, 4, 1]; ---------- coins = [1, 3, 0]; ---------- Lots of similar interview questions are this kind of mathematical optimization problem, where we have to find the maximum or minimum of a function corresponding to constraints. They're hard in programming languages because programming languages are too low-level. They are also exactly the problems that constraint solvers were designed to solve. Hard leetcode problems are easy constraint problems.1 Here I'm using MiniZinc, but you could just as easily use Z3 or OR-Tools or whatever your favorite generalized solver is. More examples This was a question in a different interview (which I thankfully passed): Given a list of stock prices through the day, find maximum profit you can get by buying one stock and selling one stock later. It's easy to do in O(n^2) time, or if you are clever, you can do it in O(n). Or you could be not clever at all and just write it as a constraint problem: array[int] of int: prices = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8]; var int: buy; var int: sell; var int: profit = prices[sell] - prices[buy]; constraint sell > buy; constraint profit > 0; solve maximize profit; Reminder, link to trying it online here. While working at that job, one interview question we tested out was: Given a list, determine if three numbers in that list can be added or subtracted to give 0? This is a satisfaction problem, not a constraint problem: we don't need the "best answer", any answer will do. We eventually decided against it for being too tricky for the engineers we were targeting. But it's not tricky in a solver; include "globals.mzn"; array[int] of int: numbers = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8]; array[index_set(numbers)] of var {0, -1, 1}: choices; constraint sum(n in index_set(numbers)) (numbers[n] * choices[n]) = 0; constraint count(choices, -1) + count(choices, 1) = 3; solve satisfy; Okay, one last one, a problem I saw last year at Chipy AlgoSIG. Basically they pick some leetcode problems and we all do them. I failed to solve this one: Given an array of integers heights representing the histogram's bar height where the width of each bar is 1, return the area of the largest rectangle in the histogram. The "proper" solution is a tricky thing involving tracking lots of bookkeeping states, which you can completely bypass by expressing it as constraints: array[int] of int: numbers = [2,1,5,6,2,3]; var 1..length(numbers): x; var 1..length(numbers): dx; var 1..: y; constraint x + dx <= length(numbers); constraint forall (i in x..(x+dx)) (y <= numbers[i]); var int: area = (dx+1)*y; solve maximize area; output ["(\(x)->\(x+dx))*\(y) = \(area)"] There's even a way to automatically visualize the solution (using vis_geost_2d), but I didn't feel like figuring it out in time for the newsletter. Is this better? Now if I actually brought these questions to an interview the interviewee could ruin my day by asking "what's the runtime complexity?" Constraint solvers runtimes are unpredictable and almost always than an ideal bespoke algorithm because they are more expressive, in what I refer to as the capability/tractability tradeoff. But even so, they'll do way better than a bad bespoke algorithm, and I'm not experienced enough in handwriting algorithms to consistently beat a solver. The real advantage of solvers, though, is how well they handle new constraints. Take the stock picking problem above. I can write an O(n²) algorithm in a few minutes and the O(n) algorithm if you give me some time to think. Now change the problem to Maximize the profit by buying and selling up to max_sales stocks, but you can only buy or sell one stock at a given time and you can only hold up to max_hold stocks at a time? That's a way harder problem to write even an inefficient algorithm for! While the constraint problem is only a tiny bit more complicated: include "globals.mzn"; int: max_sales = 3; int: max_hold = 2; array[int] of int: prices = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8]; array [1..max_sales] of var int: buy; array [1..max_sales] of var int: sell; array [index_set(prices)] of var 0..max_hold: stocks_held; var int: profit = sum(s in 1..max_sales) (prices[sell[s]] - prices[buy[s]]); constraint forall (s in 1..max_sales) (sell[s] > buy[s]); constraint profit > 0; constraint forall(i in index_set(prices)) (stocks_held[i] = (count(s in 1..max_sales) (buy[s] <= i) - count(s in 1..max_sales) (sell[s] <= i))); constraint alldifferent(buy ++ sell); solve maximize profit; output ["buy at \(buy)\n", "sell at \(sell)\n", "for \(profit)"]; Most constraint solving examples online are puzzles, like Sudoku or "SEND + MORE = MONEY". Solving leetcode problems would be a more interesting demonstration. And you get more interesting opportunities to teach optimizations, like symmetry breaking. Because my dad will email me if I don't explain this: "leetcode" is slang for "tricky algorithmic interview questions that have little-to-no relevance in the actual job you're interviewing for." It's from leetcode.com. ↩

19 hours ago 3 votes
ARM is great, ARM is terrible (and so is RISC-V)

I’ve long been interested in new and different platforms. I ran Debian on an Alpha back in the late 1990s and was part of the Alpha port team; then I helped bootstrap Debian on amd64. I’ve got somewhere around 8 Raspberry Pi devices in active use right now, and the free NNCPNET Internet email service … Continue reading ARM is great, ARM is terrible (and so is RISC-V) →

19 hours ago 2 votes
Stumbling upon

Something like a channel changer, for the web. That's what the idea was at first. But it led to a whole new path of discovery that even the site's creators couldn't have predicted. The post Stumbling upon appeared first on The History of the Web.

2 days ago 9 votes