Welcome to my website! I’m Jonathan Y. Chan (jyc, jonathanyc, 陳樂恩, or 은총), a 🐩 Yeti fan, 🇺🇸 American, and 🐻 Californian, living in 🌁 San Francisco: the most beautiful city in the greatest country in the world. My mom is from Korea and my dad was from Hong Kong. I am a Christian. My professional endeavors include:

a failed startup (co-founded, YC W23) that let you write Excel VLOOKUPs on billions of rows;

Parlan was a spreadsheet with an interface and formula language that looked just like Excel. Under the hood, it compiled formulas to SQL then evaluated them like Spark RDDs. Alas, a former manager’s prophecy about why startups fail proved prescient…

3D maps at Apple, where I did the math and encoding for the Arctic and Antarctic;

I also helped out with things like trees, road markings, paths, and lines of latitude!

various tasks at Figma, which had 24 engineers when I joined;

… including copy-paste, a high-fidelity PDF exporter, text layout, scene graph code(gen), and putting fig-foot in your .fig files—while deleting more code than I added!

Blog

From Towards a Liberatory Technology by Murray Bookchin, writing under the pseudonym Lewis Herber (emphasis mine):

Thus far every social revolution has foundered because the peal of the tocsin could not be heard over the din of the work-shop. Dreams of freedom and plenty were polluted by the mundane, workaday responsibility of producing the means of survival. Looking back at the brute facts of history, we find that as long as revolution meant continual sacrifice and denial for the people, the reins of power fell into the hands of the political “professionals,” the mediocrities of Thermidor. How well the liberal Girondins of the French Convention understood this reality can be judged by their effort to reduce the revolutionary fervor of the Parisian popular assemblies—the great sections of 1793—by decreeing that the meetings should close “at ten in the evening,“or, as Carlyle tells us, “before the working people come. . .” from their jobs. The decree proved ineffective, but it was well aimed. Essentially, the tragedy of past revolutions has been that, sooner or later, their doors closed, “at ten in the evening.” The most critical function of modern technology must be to keep the doors of the revolution open forever!

How Americans Used Time in 1965

From How Americans Used Time in 1965 by John P. Robinson, published in 1977:

Numbers are minutes spent per day (out of 1440 total).

Employed Men

ActivityMinutes
Radio4.62
Television97.93
Conversation12.18
Outdoors4.14
Total Mass Media145.52
Total Leisure100.95

Employed Women

ActivityMinutes
Radio4.28
Television62.78
Conversation17.04
Outdoors0.97
Total Mass Media96.46
Total Leisure116.06

Unemployed Women

ActivityMinutes
Radio2.11
Television95.90
Conversation27.50
Outdoors1.77
Total Mass Media137.13
Total Leisure158.84

El Chombo - Chacarron

🎶 Ihni binni dimi diniwiny anytime
Ihni binni dimi dini one more time
Or ihni binni diniwiny anytime
Oh, Ihni binni dini one more time 🎵

Unlike the old empires

Because of you – because you sacrificed so much for a people that you had never met, Iraqis have a chance to forge their own destiny. That’s part of what makes us special as Americans. Unlike the old empires, we don’t make these sacrifices for territory or for resources. We do it because it’s right. There can be no fuller expression of America’s support for self-determination than our leaving Iraq to its people. That says something about who we are.

From Remarks by the President and First Lady on the End of the War in Iraq.

Democracy in Francophone vs. Anglophone Africa

…there is credible evidence from the same scholarly sources that articulate the unwillingness or inability of francophone sub-Saharan African nations to embrace these new forms of governance apparently because the status quo serves the interests of the political leaders of these countries and their external mentor-France. The various economic, cultural and security arrangements that France established with its former colonies in Africa in the 1960s have enabled the French to maintain unprecedented influence in the domestic and external affairs of nations such as Cameroon, Ivory Coast and the Democratic Republic of Congo, in over fifty years after independence. Sustained by institutions such as La Francophonie and France-Afrique, French leaders since De Gaulle have supported African leaders, even if those leaders were engaged in practices that stymied efforts at democratic transitions and transparent governance, as long as French strategic interests (political, economic and cultural) were advanced (Martin 1997). By contrast, the British have not sought to exert undue influence in the internal affairs of its former colonies in Africa and have largely left leaders and citizens of those nation to embrace the kinds of democratic transitions that are compatible with their values and historical experiences. It is against this background that this paper proposes a thorough re-examination of American support for democratic transitions in Africa in large part because it was American leadership (with the support of its western allies) that stimulated, energized and supported the movements for transitions across Africa in the early 1990s (Kpundeh 1992).

(Emphasis mine.)

From Ngwafu, Peter A. (2016) “U.S. Support for Democracy in Africa: Discrepant Orientations of Anglophone and Francophone Africa towards Democratic Practices, Good Governance & Human Rights,” African Social Science Review: Vol. 8: No. 1, Article 2. Available here.

Senator McCarthy

… when reelected, McCarthy gained the chairmanship of the Senate Committee on Government Operations, a position he used, according to biographer David Oshinksy, “to undermine government morale, damage numerous reputations, and make America look sinister in the eyes of the world.”

From The Eleanor Roosevelt Papers.

The most effective marker

We have all become very marker-prone, but shouldn’t we nevertheless admit that, in the end, despite all we try to do, the most effective “marker” for any intruders will be a relatively limited amount of sickness and death caused by the radioactive waste? In other words, it is largely a self-correcting process if anyone intrudes without appropriate precautions, and it seems unlikely that intrusion on such buried waste would lead to large-scale disasters. An analysis of the likely number of deaths over 10,000 years due to inadvertent intrusion should be conducted. This cost should be weighted against that of the marker system.

From Expert Judgement on Markers to Deter Inadvertent Human Intrusion into the Waste Isolation Pilot Plant.

Emulated Android device can't connect to network; cold-booting

I was working on an Android app when the virtual device in the Android Emulator on macOS suddenly stopped being able to connect to the network. Using the in-device menus to restart network adapters didn’t help. Restarting the device also didn’t help.

I fixed it by using these commands to “cold boot” the emulator:

emulator -list-avds
# INFO    | Storing crashdata in: /tmp/android-jyc/emu-crash-34.2.14.db, detection is enabled for process: 30346
# Pixel_3a_API_34
emulator @Pixel_3a_API_34 -no-snapshot-load

See which props are changing with React.memo

This is very simple, but it doesn’t seem to come up when I search.

If you a have a component rendered with React.memo and are trying to figure out which prop is causing it to re-render:

export const Foo = React.memo((props: FooProps) => {
  // ...
});

… you can (ab)use React.memo’s second parameter, propsAreEqual.

/**
 * Lets you skip re-rendering a component when its props are unchanged.
 *
 * @param Component — The component to memoize.
 * @param propsAreEqual — A function that will be used to determine if the props have changed.
 */
function React.memo<(props: ArticleCardProps) => React.JSX.Element>(
  Component: (props: ArticleCardProps) => React.JSX.Element,
  propsAreEqual?: ((prevProps: Readonly<ArticleCardProps>, nextProps: Readonly<...>) => boolean) | undefined
): React.MemoExoticComponent<...> (+1 overload)

The default propsAreEqual argument compares each prop with Object.is. We’ll do the same but also log when a prop changes:

export const propsAreEqualWithLogging = <T>(prevProps: any, nextProps: any) => {
  const keys = new Set([...Object.keys(prevProps), ...Object.keys(nextProps)]);
  let out = true;
  for (const key of keys) {
    const equal = Object.is(prevProps[key as keyof T], nextProps[key as keyof T]);
    if (!equal) {
      console.log("Δ", key);
      out = false;
    }
  }
  return out;
};

export const Foo = React.memo((props: FooProps) => {
  // ...
}, propsAreEqualWithLogging);

Now we’ll get log messages when a prop changes:

Δ bar

Easy!

Gould had a pronounced aversion to what he termed “hedonistic” approaches to piano repertoire, performance, and music generally. For him, “hedonism” in this sense denoted a superficial theatricality, something to which he felt Mozart, for example, became increasingly susceptible later in his career. He associated this drift toward hedonism with the emergence of a cult of showmanship and gratuitous virtuosity on the concert platform in the 19th century and later. The institution of the public concert, he felt, degenerated into the “blood sport” with which he struggled, and which he ultimately rejected.

Gould believed that the institution of the public concert was an anachronism and a “force of evil”, leading to his early retirement from concert performance. He argued that public performance devolved into a sort of competition, with a non-empathetic audience mostly attendant to the possibility of the performer erring or failing critical expectation; and that such performances produced unexceptional interpretations because of the limitations of live music. He set forth this doctrine, half in jest, in “GPAADAK”, the Gould Plan for the Abolition of Applause and Demonstrations of All Kinds.

From the Wikipedia article on Glenn Gould.

Fun

is the card of the week.

I'm computing the week number by dividing the number of days we are into the year by 7. This gives a different week number from ISO 8601. Suits are ordered diamonds, clubs, hearts, spades (like Big Two, unlike Poker) so that red and black alternate. On leap years there are 366 days in the year; the card for the 366th day is the white joker. Karl Palmen has proposed a different encoding.