MARCH 13, 2019

Next Thursday, March 21, 2019 I'll be talking about potential uses of artificial intelligence and machine learning in BIM workflows; and showing sample uses of Refinery to generate design options (and optimize them) with Dynamo and Revit.


See the schedule.

MARCH 7, 2019

🎙 A month from today, I had a conversation with Matt Jezyk, who recently left Autodesk to go work with the the group that designs and builds the car and lithium battery "Gigafactories" at Tesla. I can't express how much I enjoyed talking to Matt.


🚗 Matt talks about his rituals to slow down and stay afloat amongst all the things competing for your attention; embracing change and automation; techniques to be more creative; the rationale behind his ten-year life cycles; why he just transitioned from Autodesk to Tesla; and a lot more.


Take a look at the show notes and where to listen.

FEBRUARY 25, 2019

In trying to export my React's Redux store from index.tsx to be used somewhere else outside of the React application, I was getting an Invariant Violation: Target container is not a DOM element error while running Jest tests (with Enzyme and Webpack) in the App component (App.tsx).

I found a solution to this error for my use case, which was using the same Redux store React is using outside of React.

The error

The initial code that didn't work when testing React looked like this.

// index.tsx

import * as React from "react";
import { render } from "react-dom";
import { Provider } from "react-redux";
import { applyMiddleware, compose, createStore } from "redux";
import App from "./components/App";
import { rootReducer } from "./store/reducers";
import { initialState } from "./store/state";

const middlewares = [];

export const store = createStore(
    rootReducer,
    initialState,
    compose(applyMiddleware(...middlewares)),
);

render(
    <Provider store={store}>
        <App />
    </Provider>,
    document.getElementById("root"),
);

The solution

Separate the Redux store logic into a new file named store.ts, then create a default export (to be used by index.tsx, i.e., the React application) and a non-default export with export const store (to be used from non-React classes), as follows.

// store.ts

import { applyMiddleware, compose, createStore } from "redux";
import logger from "redux-logger";
import { rootReducer } from "./store/reducers";
import { initialState } from "./store/state";

const middlewares = [];

export const store = createStore(
    rootReducer,
    initialState,
    compose(applyMiddleware(...middlewares)),
);

export default store;
// updated index.tsx

import * as React from "react";
import { render } from "react-dom";
import { Provider } from "react-redux";
import App from "./components/App";
import store from "./store";

render(
    <Provider store={store}>
        <App />
    </Provider>,
    document.getElementById("root"),
);

Using the Redux store in non-React classes

// MyClass.ts

import { store } from "./store"; // store.ts

export default class MyClass {
  handleClick() {
    store.dispatch({ ...new SomeAction() });
  }
}

The default export

A small note before you go. Here is how to use the default and the non-default exports.

  • default export store; is used with import store from "./store";
  • export const store = ... is used with import { store } from "./store";

If you found this useful, you might want to join my newsletter; or take a look at other posts about code, TypeScript, and React.

FEBRUARY 24, 2019

Fascinated by James Paterson's virtual reality animation tool: Norman.

Hi, I'm artist and coder James Paterson.

Norman is the animation tool that I’ve always wanted. I built it in JavaScript, it runs in a web browser and lets me animate naturally in 3D using VR controllers. Here’s the source code.

To use the tool you’ll need some rather fancy VR gear, but you can also play with my animations below and enjoy the animated short, made entirely with Norman.

FEBRUARY 11, 2019

Yay! Rasmus Andersson recently added Thin and Light weights to Inter UI.

"Inter is a typeface specially designed for user interfaces with focus on high legibility of small-to-medium sized text on computer screens." It's the most similar typeface I've found to Apple's San Francisco. The best part? It's open source and free. You can find it on GitHub.

Take a look at the samples.

FEBRUARY 7, 2019

Last month, I had a conversation with Antonio García Guerra, who recently finished his PhD at the University of Oxford on nanotechnology applied to medicine. It was inspiring to hear about the physical, emotional, and informational activities that balance his life.

JANUARY 11, 2019

I'm surprised all of the faces and license plates are there. No blurring. I found this to be a great source of procrastination. Consider yourself warned.


Browse the image here.

JANUARY 2, 2019

Listen to Craig Long on how life is in the moments you didn't expect, quieting your inner intensity, helping others achieve complex goals when they don't know where to start, remote working, and disconnecting from technology.

If you're enjoying the show and want to share it with your friends, take a look at How you can spread the word.

DECEMBER 18, 2018

Here are my highlights of Deep dive into Electron’s main and renderer processes by Cameron Nokes.

[Each of these processes is] an operative system level process, or as Wikipedia puts it "an instance of a computer program that is being execute."

[…] Each of these processes run concurrently to each other. […] [M]emory and resources are isolated from each other. […] The two processes don't share memory or state.

Why multiple processes?

Chromium runs each tab in a separate process so that if one tab runs into a fatal error, it doesn't bring down the entire application. […] "Chromium is built like an operative system, using multiple OS processes to isolate web sites from each other and from the browser itself."

Main process

[I]s responsible for creating and managing BrowserWindow instances and various application events. It can also register global shortcuts, creative native menus and dialogs, respond to auto-update events, and more. Your app's entry point will point to a JavaScript file that will be executed in the main process. A subset of Electron APIs are available in the main process, as well as all Node.js modules. The docs state: “The basic rule is: if a module is GUI or low-level system related, then it should be only available in the main process.” (Note that GUI here means native GUI, not HTML based UI rendered by Chromium). This is to avoid potential memory leak problems.

Renderer process

The render process is responsible for running the user-interface of your app, or in other words, a web page which is an instance of webContents. All DOM APIs, Node.js APIs, and a subset of Electron APIs are available in the renderer. […] [O]ne or more webContents can live in a single window […] because a single window can host multiple webviews and each webview is its own webContents instance and renderer process.


See this Venn diagram of Electron (provided by the source).


How do I communicate between processes?

Electron uses interprocess communication (IPC) to communicate between processes—same as Chromium. IPC is sort of like using postMessage between a web page and an iframe or webWorker […] you send a message with a channel name and some arbitrary information. IPC can work between renderers and the main process in both directions. IPC is asynchronous by default but also has synchronous APIs (like fs in Node.js).

Electron also gives you the remote module, which allows you to, for example, use a main process module like Menu as if it were available in the renderer. No manual IPC calls [are] necessary, but what's really going on behind the scenes is that you are issuing commands to the main process via synchronous IPC calls. (These can be debugged with devtron.)

Can I make something work in both the main and renderer?

Yes, because main process APIs can be accessed through remote, you can do something like this:

const electron = require('electron');
const Menu = electron.Menu || electron.remote.Menu;

//now you can use it seamlessly in either main or renderer

console.log(Menu);

(See the full thing.)

DECEMBER 17, 2018

Afternoons can be dangerous time to be a patient.

Something happens in the TROUGH that makes it FAR MORE PERILOUS than any other time of the day!

  • You are 3x more likely to receive a potentially fatal dose of anesthesia.
  • You are more likely to die within 48 hours of surgery.
  • More cancerous growths go undetected.
  • Internists are 26% more likely to prescribe unnecessary antibiotics for viral infections.
  • Staff are 10% less likely to wash their hands before treating patients.

Sourced from Hospital of Doom, When: The scientific secrets of perfect timing

DECEMBER 15, 2018

Renée French search on Google Images

I learned about Renée because of her illustration for the New York Times microservice golang library, gizmo.

DECEMBER 14, 2018

Apple seems highly committed for all of its users to opt in with their automatic updates model. I can see the benefits and the reasons but the amount of offerings to "Turn Automatic Updates On" seems a bit excessive.

To automatically install macOS updates in the future, including apps downloaded from the App Store, select ”Automatically keep my Mac up to date.” Your Mac will notify you when updates require it to restart, so you can always choose to install those later.

DECEMBER 13, 2018

"Every decision you make taxes your brain."

DECEMBER 11, 2018

"Imagine watching a 3D hologram of a live soccer game on your living room table; you can walk around with an Augmented Reality device, watch the players from different viewpoints, and lean in to see the action up close1." Well, now this might be a way to "get rid" of television as we know it.

We present a system that transforms a monocular video of a soccer game into a moving 3D reconstruction, in which the players and field can be rendered interactively with a 3D viewer or through an Augmented Reality device. At the heart of our paper is an approach to estimate the depth map of each player, using a CNN that is trained on 3D player data extracted from soccer video games. We compare with state of the art body pose and depth estimation techniques, and show results on both synthetic ground truth benchmarks, and real YouTube soccer footage.

This is a paper from Konstantinos Rematas2, Ira Kemelmacher-Shlizerman23, Brian Curless2, and Steve Seitz24.


Open the PDF.


  1. Soccer on Your Tabletop, 2018. ↩︎

  2. University of Washington ↩︎ ↩︎ ↩︎ ↩︎

  3. Facebook ↩︎

  4. Google ↩︎

DECEMBER 7, 2018

Farsighted by Steven Johnson - Thinking, Fast and Slow by Daniel Kahneman - The Coddling of the American Mind by Greg Lukianoff and Jonathan Haidt - The Laws of Simplicity by John Maeda

A while ago, I added a list of books I've read (and highly recommend) to my Library. Today I'm starting a list of books I'd like to read next.

Let me know of any other good reads you know.


  1. Recommended by Nathan Melenbrink ↩︎

DECEMBER 7, 2018

Here's a note on how to display dialogs, alerts, and notifications on macOS with AppleScript, useful to automate day-to-day tasks you do with your machine, or even create complex programs.

(To the uninitiated, you would run this code by opening the AppleScript Editor (on macOS), pasting the code there, and hitting run.)

Dialog and Alert1

display alert "This is an alert" buttons {"No", "Yes"}
if button returned of result = "No" then
    display alert "No was clicked"
else
    if button returned of result = "Yes" then
        display alert "Yes was clicked"
    end if
end if

System notification

display notification "Have a simple day!"

DECEMBER 4, 2018

A short-form piece on the pros and cons of engaging with tasks as they come. What's your take on doing things as they happen versus processing later, in batches?

NOVEMBER 26, 2018

This summer, right before leaving Cambridge, I was extremely lucky to interview Ben Fry for the podcast at Fathom Information Design, in Boston, Massachusetts. Ben, together with Casey Reas, co-created the "Processing" programming environment back in 2001 (that's seventeen years ago), an open-source tool still in active development and used daily by thousands of designers, artists, researchers, engineers, students, and professionals from a wide variety of disciplines. Processing was a side-project Ben was working on while writing his thesis on Computational Information Design at the MIT Media Lab, which led him to found Fathom Information Design later on, a studio in Boston focused on understanding complicated data problems.


Listen to this episode.

NOVEMBER 20, 2018

After cloning a repository, you can have git not track changes you make to one (or multiple) files.

Tell Git to assume a file is unchanged

git update-index --assume-unchanged file

Tell Git not to assume a file is unchanged anymore

After this command is run, the repository continues tracking the file. It might have changes that git will want to commit.

git update-index --no-assume-unchanged file

Roll back the changes you made while the file was --assume-unchanged

In case you made changes while --assume-unchanged was on and don't want to keep the changes on the file: Roll-back to where the repository is when you want to pull or push changes.

git checkout -- file

Want to see older publications? Visit the archive.

Listen to my Podcast.