Wednesday, November 20, 2019

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) after installing macOS Big Sur

I've installed macOS Big Sur! This means breaking everything my development environment again.

If you get this error:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

   Exiting due to failure

You'll need to install the XCode development tools again with the following command.

xcode-select --install

Monday, March 18, 2019

Drawing economic models on macOS with GraphSketcher (using free open source software!)

I didn't think blogging about university assignments from yesteryear would be popular; to use economic parlance, I thought the demand curve for my posts would be as flat as sales of Windows Phones. When I wrote my blog series about chess data structures in ANSI C89, I didn't think anyone would read it voluntarily, but my posts seem to have found a niche audience of CS students who have chess simulator assignments due the next day.

Today I've decided to write about economics. Anything economics posts I write should be timeless, because none of the questions or answers have changed in last 129 years since Alfred Marshall's Principles of Economics.

Marshall's Principles of Economics (1890).
Amazon did not exist in the year 1890 so students
had to purchase over-priced textbooks in person.

If you're an economics student, you're going to have to draw a lot of models. If you have a Mac, there's only one tool you need for drawing models: GraphSketcher. This is a free and open source tool that was originally designed by The Omni Group (the team behind OmniGraffle or "not quite Visio for Mac").

Download: GraphSketcher for Mac

Here are some tips for High Distinction success.
  • Don't use the graphing function in Microsoft Excel. You'll spend too much time trying to create the "correct" source data to generate curves, and you've only got till morning to submit your assignment.
  • Don't use Photoshop. You'll spend too much time messing around with layers, and trying to crack Photoshop.
  • Label your axis. Specify the unit of measurement too, e.g. Private spending ($ billions)
  • Work out the order of magnitude required to illustrate your point. In macroeconomics, the quantity of money at which you want to analyse curves is "large". You're not going to be able to analyse changes of private spending vs. real GDP at $500,000 to $600,000: you'll typically be working at the magnitude of hundreds of billions of dollars. Leave the microscopic $2 MR=MC magnitudes to microeconomics. Before you start drawing, calculate the order of magnitude that can illustrate your point, then figure out the quantities you need.
  • Use big dots and letters to draw attention to "before and after". Tell the story with your model. In the first example below, A is the normal level of private spending/real GDP. B is what happens when we private spending is reduced, and C is what happens when it's increased.
  • Use arrows to explain the story. The lecturer/TA marking your assignment is a busy person: they are trying to trying to test whether you and 250 other students understand a particular economic model. They will spend one second looking at your graph to judge your knowledge. If private spending goes up, does this student have the first clue about what happens to real GDP? You may know the answer, but can you demonstrate this using only a graph? In the example below, it's clear that when (C+I)0 shifts upward to (C+I)2, this intersects GDP curve at a higher level. We indicate this with arrows that tell the story for us: an upward arrow for the (C+I) curve shift, and a right arrow for the real GDP shift.
  • Put a zero on your graph. No zero? One mark deducted!
I've uploaded some of my old macro graphs to get you started.
  • Aggregate expenditure/output approach [download]
  • Consumption Schedule graph [download]
  • Investment demand curve with shifts graph [download]
  • Investment demand curve graph [download]
  • Net Exports schedule graph [download]
  • Increases in price level graph [download]
  • Inflationary gap graph [download]
  • Built-in stability graph [download]

Aggregate expenditure/Output approach [download]
Consumption Schedule graph [download]
Investment demand curve with shifts graph [download]
Investment demand curve graph [download]
Net Exports schedule graph [download]
Increases in price level graph [download]
Inflationary gap graph [download]
Built-in stability graph [download]

Saturday, January 19, 2019

The no-nonsense guide to baby accessories

tl:dr; Many baby accessories are a waste of money. If you want to spend money to make parenthood easier, use Uber Eats. The only thing worth buying is a baby camera, and that's to help YOU and not the baby.

If you're a first time father, baby accessory manufacturers will attempt to exploit your inexperience and feelings of inadequacy to sell you products you don't need. Why? Because you're the perfect target! You want the best for your newborn but don't have the experience to tell the difference between what's necessary and what isn't. The reality is that most high-tech baby gadgets are technology in search of a scared parent with money.

Babies do not need $300 Bluetooth socks. 

That statement may sound ridiculous to anybody who isn't a father. But holding your first child gives you an overwhelming urge to help them as much as you can, even if it means paying through the nose for a product that only delivers a marginal impact. When I read the Wikipedia article on Sudden Infant Death Syndrome/SIDS, my inner lizard brain was terrified and wanted to spend to eliminate the risk. But I realised the most effective way of mitigating this problem wasn't with my wallet: it was to minimise the amount of toys and blankets that were in the baby's sleeping area.

Paul's biased opinion.

I'm not a fan of YouTube baby accessory reviewers: many of them are sponsored. For the record, I'm not sponsored by anyone and I don't have any affiliate links. You'll have to look these up on Amazon yourself. Let's start with what you don't need.

To quote the Hitchhiker's Guide to the Galaxy: don't panic!

Stuff babies don't need
  • $300 Bluetooth socks. Your baby does not need $300 Bluetooth socks that monitor their heart rate/oxygen/breathing.
  • More than one set of designer baby clothes. I'm no biologist but if I recall my first year of fatherhood correctly correctly, my baby vomitted and defecated a lot. It was a fools errand to have them dressed in designer baby clothes. Any designer logo becomes less stylish when it's covered in literal shit. Some designer brands with more subtle and classy patterns have a good resale value on local parents groups.
  • iPad. There's plenty of time for your baby to be addicted to the iPad after the age of 2. For now they need the two things you can't buy, which is attention and time.
  • Electronic bottle steriliser. A microwave steriliser is cheaper, won't break, and doesn't consume a precious power socket.
Things you definitely do need.
  • Philips Avent milk bottles. These are the Rolls Royce of bottles. The lid can be opened and closed by a parent operating on zero sleep. The lids have interchangeable teats so they can be reused as your sweet and lovely baby grows into a moody toddler.
  • Microwave bottle steriliser. You'll be cleaning baby accessories a lot. I recommend the microwave steriliser. No brand stands out for me.
  • Dummy. You'll need to take the shotgun approach: buy one of each and see which your baby likes. Once you've found one your baby likes, buy at least 4 more immediately. If not, you risk your baby getting attached to a dummy that is no longer manufactured.
  • Dummy holder. You will lose any dummy that is not attached to your baby with a dummy holder. 
  • Suits. Bonds Wondersuits are incredible, truly a great Australian product. It's a baby suit with a single zipper which makes it easy to take on and off a wriggling baby. The quality is high enough to be reused by the next few kids.
  • Baby wraps. Buy 4.
  • Braun ear temperature measurement. Ear-measurement thermometer are the most accurate and doctors will trust your measurements. Any temperature you measure with a head thermometer will be disregarded by your doctor as inaccurate. I recommend the Braun ThermoScan 7, or whatever the newest edition is.


I recommend two prams: a travel pram that can take punishment, and a cruiser for when you want your baby to sleep.
  • Travel pram: BabyZen YOYO2. This is the best travel stroller on the market because it can fold and fit easily into the trunk of a car. For the amount of money it costs, I wish it was more aesthetically pleasing to look at. It must have been designed by a mechanical engineer: 10/10 for usability, 10/10 for durability, 6/10 for comfort, and 3/10 for looks. If you need to travel internationally, count the amount of children you have (e.g. 2) and buy that many YOYO2s.
  • Cruiser: Stokke Xplory 6. This pram looks like it was designed by Steve Jobs. My experience is that the Xplory series has a good resale value.


Every minute longer your baby sleeps can be used to play video games. Therefore I'd recommend picking a cot with an automatic rocking function and white noise. 
  • Happiest Baby Snoo. This cot looks like it was designed by Steve Jobs. The resale value is excellent, I actually sold mine after a year for profit. The Snoo has some neat features like dynamic speed based on a baby crying, but our baby was too sensitive for these features to be useful. 
  • 4Moms mamaRoo. My baby preferred this equally to the Snoo. It isn't as stylish.

Other items

  • Baby Pillow: Shotgun approach applies. Buy a lot, find one that works.
  • Baby Camera: Buy a camera with 2-way microphone that works with your chosen smartphone and home automation ecosystem. Baby cameras are more for parent's sanity rather than child's safety. You won't need them after after year 1.

Parenting is already tough without unnecessary clutter and relentless marketing pressure trying to convince you that you absolutely need to buy every gadget in the book. But let's be real, most of these products are designed to extract money from your wallet in exchange for a solution to a manufactured problem. I hope this guide reframes the question away from "What product should I buy?" and toward a mindset grounded in understanding a problem and providing a solution that delivers sanity and peace of mind. Best of luck, fellow parent.