More from Jim Nielsen’s Blog
I’ve long wanted the ability to create custom collections of icons from my icon gallery. Today I can browse collections of icons that share pre-defined metadata (e.g. “Show me all icons tagged as blue”) but I can’t create your own arbitrary collections of icons. That is, until now! I created a page at /lookup that allows you to specify however many id search params you want and it will pull all the matching icons into a single page. Here’s an example of macOS icons that follow the squircle shape but break out of it ever-so-slightly (something we’ll lose with macOS Tahoe). It requires a little know how to construct the URL, something I’ll address later, but it works for my own personal purposes at the moment. So how did I build it? Implementation So the sites are built with a static site generator, but this feature requires an ability to dynamically construct a page based on the icons specified in the URL, e.g. /lookup?id=foo&id=bar&id=baz How do I get that to work? I can’t statically pre-generate every possible combination[1] so what are my options? Create a “shell” page that uses JavaScript to read the search params, query a JSON API, and render whichever icons are specified in the URL. Send an HTML page with all icons over the wire, then use JavaScript to reach into the DOM and remove all icons whose IDs aren’t specified in the page URL. Render the page on the server with just the icons specified in the request URL. No. 1: this is fine, but I don’t have a JSON API for clients to query and I don’t want to create one. Plus I have to duplicate template logic, etc. I’m already rendering lists of icons in my static site generator, so can’t I just do that? Which leads me to: No. 2: this works, but I do have 2000+ icons so the resulting HTML page (I tried it) is almost 2MB if I render everything (whereas that same request for ~4 icons but filtered by the server would be like 11kb). There’s gotta be a way to make that smaller, which leads me to: No. 3: this is great, but it does require I have a “server” to construct pages at request time. Enter Netlify’s Edge Functions which allow you to easily transform an existing HTML page before it gets to the client. To get this working in my case, I: Create /lookup/index.html that has all 2000+ icons on it (trivial with my current static site generator). Create a lookup.ts edge function that intercepts the request to /lookup/index.html Read the search params for the request and get all specified icon IDs, e.g. /lookup?id=a&id=b&id=c turns into ['a','b','c'] Following Netlify’s example of transforming an HTML response, use HTMLRewriter to parse my HTML with all 2000+ icons in it then remove all icons that aren’t in my list of IDs, e.g. <a id='a'>…</a><a id='z'>…</a> might get pruned down to <a id='a'>…</a> Transform the parsed HTML back into a Response and return it to the client from the function. It took me a second to get all the Netlify-specific configurations right (put the function in ./netlify/edge-functions not ./netlify/functions, duh) but once I strictly followed all of Netlify’s rules it was working! (You gotta use their CLI tool to get things working on localhost and test it yourself.) Con-clusions I don’t particularly love that this ties me to a bespoke feature of Netlify’s platform — even though it works really well! But that said, if I ever switched hosts this wouldn’t be too difficult to change. If my new host provided control over the server, nothing changes about the URL for this page (/lookup?id=…). And if I had to move it all to the client, I could do that too. In that sense, I’m tying myself to Netlify from a developer point of view but not from an end-user point of view (everything still works at the URL-level) and I’m good with that trade-off. Just out of curiosity, I asked ChatGPT: if you have approximately 2,000 unique items, how many possible combinations of those IDs can be passed in a URL like /lookup?id=1&id=2? It said the number is 2^2000 which is “astronomically large” and “far more than atoms in the universe”. So statically pre-generating them is out of the question. ⏎ Email · Mastodon · Bluesky
Here’s a screenshot of my inbox from when I was on the last leg of my flight home from family summer vacation: That’s pretty representative of the flurry of emails I get when I fly, e.g.: Check in now Track your bags Your flight will soon depart Your flight will soon board Your flight is boarding Information on your connecting flight Tell us how we did In addition to email, the airline has my mobile number and I have its app, so a large portion of my email notifications are also sent as 1) push notifications to my devices, as well as 2) messages to my mobile phone number. So when the plane begins boarding, for example, I’m told about it with an email, a text, and a push notification. I put up with it because I’ve tried pruning my stream of notifications from the airlines in the past, only to lose out on a vital notification about a change or delay. It feels like my two options are: Get all notifications multiple times via email, text, and in-app push. Get most notifications via one channel, but somehow miss the most vital one. All of this serendipitously coincided with me reading a recent piece from Nicholas Carr where he described these kinds of notifications as “little data”: all those fleeting, discrete bits of information that swarm around us like gnats on a humid summer evening. That feels apt, as I find myself swiping at lots of little data gnats swarming in my email, message, and notification inboxes. No wondering they call it “fly”ing 🥁 Email · Mastodon · Bluesky
I recently got my copy of the Internet Phone Book. Look who’s hiding on the bottom inside spread of page 32: The book is divided into a number of categories — such as “Small”, “Text”, and “Ecology” — and I am beyond flattered to be listed under the category “HTML”! You can dial my site at number 223. As the authors note, the sites of the internet represented in this book are not described by adjectives like “attention”, “competition”, and “promotion”. Instead they’re better suited by adjectives like “home”, “love”, and “glow”. These sites don’t look to impose their will on you, soliciting that you share, like, and subscribe. They look to spark curiosity, mystery, and wonder, letting you decide for yourself how to respond to the feelings of this experience. But why make a printed book listing sites on the internet? That’s crazy, right? Here’s the book’s co-author Kristoffer Tjalve in the introduction: With the Internet Phone Book, we bring the web, the medium we love dearly, and call it into a thousand-year old tradition [of print] I love that! I think the juxtaposition of websites in a printed phone book is exactly the kind of thing that makes you pause and reconsider the medium of the web in a new light. Isn’t that exactly what art is for? Kristoffer continues: Elliot and I began working on diagram.website, a map with hundreds of links to the internet beyond platform walls. We envisioned this map like a night sky in a nature reserve—removed from the light pollution of cities—inviting a sense of awe for the vastness of the universe, or in our case, the internet. We wanted people to know that the poetic internet already existed, waiting for them…The result of that conversation is what you now hold in your hands. The web is a web because of its seemingly infinite number of interconnected sites, not because of it’s half-dozen social platforms. It’s called the web, not the mall. There’s an entire night sky out there to discover! Email · Mastodon · Bluesky
Read more about RSS Club. I’ve been reading Apple in China by Patrick McGee. There’s this part in there where he’s talking about a guy who worked for Apple and was known for being ruthless, stopping at nothing to negotiate the best deal for Apple. He was so aggressive yet convincing that suppliers often found themselves faced with regret, wondering how they got talked into a deal that in hindsight was not in their best interest.[1] One particular Apple executive sourced in the book noted how there are companies who don’t employ questionable tactics to gain an edge, but most of them don’t exist anymore. To paraphrase: “I worked with two kinds of suppliers at Apple: 1) complete assholes, and 2) those who are no longer in business.” Taking advantage of people is normalized in business on account of it being existential, i.e. “If we don’t act like assholes — or have someone on our team who will on our behalf[1] — we will not survive!” In other words: All’s fair in self-defense. But what’s the point of survival if you become an asshole in the process? What else is there in life if not what you become in the process? It’s almost comedically twisted how easy it is for us to become the very thing we abhor if it means our survival. (Note to self: before you start anything, ask “What will this help me become, and is that who I want to be?”) It’s interesting how we can smile at stories like that and think, “Gosh they’re tenacious, glad they’re on my side!” Not stopping to think for a moment what it would feel like to be on the other side of that equation. ⏎ Email · Mastodon · Bluesky
Dan Abramov in “Static as a Server”: Static is a server that runs ahead of time. “Static” and “dynamic” don’t have to be binaries that describe an entire application architecture. As Dan describes in his post, “static” or “dynamic” it’s all just computers doing stuff. Computer A requests something (an HTML document, a PDF, some JSON, who knows) from computer B. That request happens via a URL and the response can be computed “ahead of time” or “at request time”. In this paradigm: “Static” is server responding ahead of time to an anticipated requests with identical responses. “Dynamic” is a server responding at request time to anticipated requests with varying responses. But these definitions aren’t binaries, but rather represent two ends of a spectrum. Ultimately, however you define “static” or “dynamic”, what you’re dealing with is a response generated by a server — i.e. a computer — so the question is really a matter of when you want to respond and with what. Answering the question of when previously had a really big impact on what kind of architecture you inherited. But I think we’re realizing we need more nimble architectures that can flex and grow in response to changing when a request/response cycle happens and what you respond with. Perhaps a poor analogy, but imagine you’re preparing holiday cards for your friends and family: “Static” is the same card sent to everyone “Dynamic” is a hand-written card to each individual But between these two are infinite possibilities, such as: A hand-written card that’s photocopied and sent to everyone A printed template with the same hand-written note to everyone A printed template with a different hand-written note for just some people etc. Are those examples “static” or “dynamic”? [Cue endless debate]. The beauty is that in proving the space between binaries — between what “static” means and what “dynamic” means — I think we develop a firmer grasp of what we mean by those words as well as what we’re trying to accomplish with our code. I love tools that help you think of the request/response cycle across your entire application as an endlessly-changing set of computations that happen either “ahead of time”, “just in time”, or somewhere in-between. Email · Mastodon · Bluesky
More in literature
I grew up fetishizing a university education. I knew no one in my family or in my working-class neighborhood who had “gone to college,” as the common phrase had it. In my experience, that status was confined to doctors and teachers. My father was a high-school dropout. Higher education seemed like a gift reserved for the anointed, whether by wealth or genius. Naturally this inspired a strain of suspicion and resentment. After high school, I applied, without assistance, to two universities – Harvard and Bowling Green State University in Ohio. My naiveté was stunning. The state school accepted me and after three years I dropped out. It was probably my generation that first came to believe everyone should go to college. I no longer think that’s the case, especially because a university degree no longer signifies a true education. I’ve known too many degree-holding alliterates and even border-line illiterates. Robert Conquest chooses his words carefully in Reflections on a Ravaged Century (1999): “Not all young, or old, people are susceptible to education.” Conquest’s analysis of education is interesting. His formal education at Oxford was excellent and he became a gifted historian, poet, novelist and all-around man of letters – a rare breed today. He bolsters his argument with allusions to Edward Gibbon and Marcus Aurelius. Some young people are, Conquest writes, “more or less uneducable. Others have had a good education by the time they are eighteen, or even younger, but have neither the desire nor the bent for ‘higher’ education.” This confirms my observation that some of the brightest, most well-read people I’ve known are degreeless. “For people can be educated, cultured and so forth without having been to university at all," Conquest writes, "as with dozens from Benjamin Franklin to Winston Churchill, from Shakespeare to Einstein, to say nothing of the great women writers of the nineteenth century. Nor is this only a matter of genius. Even erudition is possible outside academe, a point illustrated perfectly by Gibbon himself, the greatest of historians, who did indeed attend Oxford briefly when fifteen years old, from which (as he tells us) he got nothing. What all of them had was, in the first place, reading. We all know dozens of people, especially from an older generation, who are as much at home in these worlds -- except in special fields—as their Bachelored and Mastered and Doctored acquaintances.” It’s always a pleasure to meet and talk with an autodidact, a self-directed learner, as opposed to a formally educated pedant or drone. Often the former is motivated by love of learning; the latter by status, money, fashion, indifference. Of the amateur class, Conquest writes: “No doubt these were naturally inclined that way, or else brought up in circumstances where it was taken for granted. And, of course, they must have had some sort of preuniversity education that puts them above many university entrants, or exiters, these days. I think of such people (at random) as Julian Symons, or Roy Fuller, or V S. Pritchett, or Iain Hamilton, the editor of the London Spectator (who left school at sixteen to work in a clothes shop), and of other major figures in literature and journalism.”
Jonathan Gould on how Talking Heads transformed rock music The post Once in a Lifetime appeared first on The American Scholar.
"All our lives we perform tasks while waiting for something to click into place. For somewhere to put our love."
Thomas Parker is a longtime reader and frequent commenter on this blog. On Monday’s post he recalled a passage he thought may have been the work of George Saintsbury. Unable to track it down for attribution, he quoted from uncertain memory: “Nothing pains me more than the contempt with which people treat second-rate writers -- as if there were room in life for only the first-rate.” Dave Lull tells me the writer in question may have been not Saintsbury but a comparably situated critic in French literature, Charles Augustin Sainte-Beuve, who has little standing in literary circles today, at least in the English-speaking world. Dave identified this sentence, though not the source, as Saint-Beuve’s: “Nothing is more painful to me than the disdain with which people treat second-rate authors, as if there were room only for the first-raters.” Clive James devotes a chapter to Saint-Beuve in Cultural Amnesia (2007). Dave quotes James, in part: “The student should be slow to join in the denigration. Sainte-Beuve really was the greatest literary critic of his time, even though he sometimes gave too much praise to mediocrity, and not enough to genius.” I would distinguish “second-rate” status from “mediocrity,” though James continues: “Sainte-Beuve certainly had a gift for slighting the gifted while rabbiting on endlessly in praise of mediocrities.” No writer is minor while we are paying attention to his work, enjoying it, admiring it, sharing it with other readers. Every serious reader agrees that Swift and Tolstoy are major writers – “first-rate” – whom we are obligated to read if we wish to be fully literate. That’s easy. But what about their contemporaries; say, Matthew Prior and Nikolai Leskov? Who would wish to miss the latter’s novella “Lady Macbeth of the Mtsensk District”? “Second-rate” is better than “thirteenth-rate,” and even thirteenth may be worth pursuing. In her life of Siegfried Sassoon, Journey from the Trenches, Jean Moorcroft Wilson says Sassoon shared with his friend Edmund Blunden an interest in “the neglected by-ways, a taste which reflected their literary interests as a whole. Though both had a proper respect for the major writers of the past, it was the minor figures who intrigued them.” “Minor,” I suspect, is not a qualitative term, precisely. It ought to be used carefully, with discretion and due respect. After all there’s a class of writers judged unimportant by the usual standards, by the usual people – minor (such a patronizing word), un-engagé, witty rather than weighty, blithely indifferent to literary fashion and significance. The English seem to specialize in this species. Think of Sydney Smith, Walter Savage Landor, Maurice Baring, Saki, Walter de la Mare, Lord Berners and Henry “Chips” Channon. The unlikely alpha male of the bunch, the major English minor writer is, of course, Max Beerbohm. Among his friends was another, the New Jersey-born British essayist and critic Logan Pearsall Smith, a writer whose resistance to pigeon-holing and portentousness defines him. All of these writers are entertaining, sometimes even wise. I would read any of them before I would the latest, much-heralded tour de force.
How contemporary art reflects our waning belief in progress.