For anyone interested in implementing Hobby's algorithm in their own projects, I recommend the paper "Typographers, programmers and mathematicians, or the case of an aesthetically pleasing interpolation" by Bogusław Jackowski [0]. It was my primary reference when working on the code for the examples in the blog post, and I found it easier to understand than Hobby's original paper. I mention this paper in a comment in the linked source code but it looks like I left it out of the post itself so figured I should share it here.
HN user
jake-low
[ my public key: https://keybase.io/jakelow; my proof: https://keybase.io/jakelow/sigs/m1D79qyEwJ_5gwQC1bV2rHMIeMofOzCiAGSL9hSlM1c ]
Hi Raph! I'm the author of the blog post. I actually read your PhD thesis when I was working on this project and trying to wrap my head around splines. It was a huge help to me in understanding the landscape of the field and how to think about and compare different classes of splines. Just wanted to say thanks!
It depends on the definition of a “day” that you use, but due to Mercury’s elliptical orbit sunrises and sunsets are weird. [1] It takes 59 Earth days for the planet to revolve once around its axis, but from the surface it takes 176 Earth days to observe the sun making a complete circuit of the sky.
There are a number of rich text editors that model documents as a flat array of characters and a separate table of formatting modifiers (each with an offset and length). Medium's text editor is one of them. This post [1] on their engineering blog introduced me to the idea, and I think it's a good starting point for anyone interested in this topic.
ProseMirror (a JavaScript library for building rich text editors) also employs a document model like this. The docs for that project [2] do a good job of explaining how their implementation of this idea works, and what problems it solves.
[1] https://medium.engineering/why-contenteditable-is-terrible-1...
Very cool that the author had a custom keyboard made with their keymap printed on it.
Personally I like being able to type math symbols on occasion but don't do so often enough to benefit from a custom keyboard layout that I'd then have to memorize. I didn't have a good way to do this until about a year ago, when I learned about Espanso [1] which is a cross-platform text expander. I installed it and set it up to substitute various (vaguely LaTeX-inspired) macros to UTF-8 strings. For example, typing the following keystrokes
x = R cos(:phi) sin(:lambda :minus :lambda:nought)
becomes x = R cos(φ) sin(λ − λ₀)I chose ':' as a prefix for all my macros but this is just a self-enforced convention; you can configure a substitution for any sequence of keystrokes. Since I gave all the characters names that made sense to me, I don't have to think much when I type them.
A few of the substitutions I get the most mileage out of:
- The Greek alphabet, both upper and lowercase (:theta → θ and :Omega → Ω)
- Double-struck letters for numerical sets; e.g. :RR → ℝ
- :infinity → ∞
- :neq → ≠
- :pm → ±
I don't think it's generally possible. The FIPS code just identifies the county (the first two digits are the state, e.g. 06 for California) and the final three identify a county in that state. So technically that column is redundant with the "county" and "state" columns; I suspect they've included it to make joining this dataset to other data that might use different name-formatting of counties/states easier.
ZIP/postal codes are generally smaller (in the county I live in there are almost a hundred ZIP codes). I'm not sure they're even guaranteed to be entirely within one county either. We tend to think of ZIP codes as boundaries but they're actually delivery routes (which if you squint can be converted into boundaries by joining the properties that those routes serve together).
You might be interested in this article: https://carto.com/blog/zip-codes-spatial-analysis/
This is phenomenal. I've been scraping the data from primary sources for just Washington state for the past week [0], in order to make this chart which I hacked together last weekend [1].
[0] https://github.com/jake-low/covid-19-wa-data
[1] https://observablehq.com/@jake-low/covid-19-in-washington-st...
Doing this for just one state was a pretty substantial effort. I imagine there are multiple people at the Times who are spending several hours a day reviewing and cleaning scraped data (seems every couple of days some formatting change breaks your scripts, or a source publishes data that later needs to be retracted).
The Times dataset appears to contain per-county case and death observations in a time series, going all the way back to the first confirmed U.S. case in January in Snohomish County, WA. This makes it by far the most comprehensive time series dataset of U.S. COVID-19 cases publicly available.
Some people in this thread linked to the Johns Hopkins CSSE dataset; I've looked at this data but it doesn't go back very far in time for the U.S., and the tables are published as daily summaries with differing table schemas which makes them hard to use out of the box. For some days earlier in March, "sublocations" aren't even structured (for example the same column contains, "Boston, MA" and "Los Angeles County", making it very hard to use). No disrespect to the team behind the JHU dataset; it attempts to cover the whole world since the outbreak began which is an incredible and difficult goal. But for mapping and studying the outbreak in the U.S., the Times dataset will likely be the best choice right now.
Huge kudos to the New York Times team for making this data freely available.
This is pretty neat. A week or so ago when "MathJax turns 3.0" was on the frontpage [0], I followed a link to this very thoughtful comment [1] from 2019 by svat about the landscape of math typesetting on the web. Since then I've been thinking a little bit about MathML and how compilers from other more input-friendly formats to MathML might encourage wider adoption. So I'm excited to see this library.
I've heard of AsciiMath before but hadn't ever had a chance to play with it, so I appreciated the live demo on the project website. One thing I noticed is that AsciiMath uses whitespace around operators to determine binding order.
For example (AsciiMath on left, TeX on right)
f(x) = x+1 / 2 ≡ f(x) = \frac{x + 1}{2}
f(x) = x + 1/2 ≡ f(x) = x + \frac{1}{2}
When there's equal spacing around neighboring operators, normal order of operations seems to apply.This seems fairly intuitive, but might not scale to large, complex equations as well as TeX's bracket syntax does. Nonetheless, I think I like it for simple equations.
Question for the author: you mention on the page that Mathup supports an input language inspired by AsciiMath [2]. What are the differences? Does Mathup accept a subset of AsciiMath, or are there cases where the syntax diverges? And if the latter is the case, what motivated devaiting from AsciiMath's syntax?
[0] https://news.ycombinator.com/item?id=22582343
[1] https://news.ycombinator.com/item?id=19347737
[2]: There's a typo in this phrase on your page, BTW: "insipired" has an extra "i"
This looks like a great new introduction to D3. It uses Observable as an interactive playground for D3 example code, which I think is an ideal environment for teaching concepts like these. I hope this will help more folks get started in visualization.
If anyone hasn't given Observable a try yet, I highly encourage you to do so. It's more than just "IPython/Jupyter but for JavaScript" — it's reactive, like a spreadsheet. You define "cells" of JS code that are automatically re-evaluated whenever one of their dependencies (another cell) changes.
It's an amazingly productive programming environment. These days, most of my JavaScript projects start off as Observable notebooks because it's such a great platform for experimentation. And I find myself wishing for Observable's features whenever I'm developing in other languages.
I know reactive programming is nothing new, but Observable has been my first opportunity to use it regularly, by "backporting" reactivity into one of the languages I work in most often. Being able to use it for prototyping and visualization for the past couple years has given me a really warm, fuzzy, "what-a-time-to-be-alive" feeling.
The markup for the callout buttons/links on the example page [0] is just <a href="#"><em>Button text</em></a> (for outlined) and <a href="#"><strong>Button text</strong></a> (for filled). That's a pretty creative solution that I definitely haven't seen before.
Giving opinionated styles to unclassed HTML elements is definitely not the right fit for every website. But, given this project's goal of being a minimalist, quick-start stylesheet that requires no classes, I think this use of `a em` and `a strong` selectors to create button-y links is pretty ingenious.
Hi HN. I built this over the weekend to visualize the spread of COVID-19 infections in my home state of Washington.
I was frustrated that the DOH data and SeattleTimes maps only showed the current point in time, which made it difficult to answer the question "is social distancing working?". So I scraped previous days' published tables from the Internet Archive, set up a script to scrape new data from the DOH website as soon as it's published, and built a visualization that lets you scrub back and forth along the timeline to see the extent of the outbreak.
Code is available in the page (it's an Observable notebook) and data is available on GitHub [0]. Let me know if you're interested in using the data and I'll be happy to help you get started; there are other data tables in the archived HTML pages that I haven't scraped and converted to CSV yet, but in theory they too could be extracted and visualized.
This is a great paper! Thank you for sharing it. I'm not an expert by any means in color theory, but I found the paper both accessible (great diagrams!) and compelling.
Fascinating read.
Nelson’s ideas of an open universal hypertext system is in many was incredibly prescient of our modern web. But one thing he (and others) got wrong(1) is the concept of backlinks: the ability of a user to see, for any page, a list of other pages (including those by other authors) which link to it.
It’s hard for me to imagine what the web of today would look like with this feature. Ignoring the (probably insurmountable) technical problems, I wonder what would happen if backlinks became available to web users today. How would it change the way we interact with and design websites?
(1): perhaps “foresaw differently” is more charitable since Nelson acknowledges that many systems do not include the feature and is arguing that the system of the future should.
Not GP, but I suspect they’re referring to this terminal emulator:
I think what this is saying is that the area of the focus indicator needs to be 300 pixels, not that the longest side needs to be 300 pixels. So for your button, using a 150px by 2px underline (e.g. with “border-bottom”) would be acceptable since the area of that underline is 300 pixels. But making it only 1px thick wouldn’t be okay since then the area would be 150px.
Folks who enjoyed this article may also be interested in this one [0] from The Atlantic, published in 1982, which chronicles the rise of the diamond industry during the 20th century.
[0] https://www.theatlantic.com/magazine/archive/1982/02/have-yo...
I find that some lenses have a different look on-axis versus off-axis, either leading to ugly smearing, or pretty twirly bokeh.
This is indeed pretty interesting. It seems like double-Gauss lens designs like the Zeiss Planar and Biotar are especially prone to this kind of distortion. There's a Russian copy of the 58mm Biotar called the Helios 44 that's popular on eBay for this reason (lots of people use an adapter to put it on a MFT camera and shoot video with it).
Previous discussion: https://news.ycombinator.com/item?id=20901264
In case anyone reading this in the future cares, I learned that Chrome 49 was the last release to support Windows XP and Windows Vista [0]. Google dropped support for these operating systems in April 2016 with the release of Chrome 50.
[0] https://www.ghacks.net/2015/11/11/chrome-support-for-windows...
I don't know what's up with 61 or 63, but perhaps there's a similar story there.
Definitely agree about the loss of precision. It's also a problem for machine readability and SEO. The solution I like is using the HMTL5 <time> element for semantic markup of timestamps. If you do something like this:
<time datetime="2019-10-11T13:53:36.861" title="Fri Oct 11 2019 13:53:36 GMT-0700">2 minutes ago</time>
Then you get what in my opinion is the best of both worlds: machine readable timestamp in the datetime field, human-friendly detailed timestamp as a tooltip (the title field shows when you hover over the element), and relative time as the default display. Bonus points if your React component or ERB template or whatever switches from relative time format to absolute for the inner text when the timestamp is older than a day or so.For what it's worth, I just subscribed to your newsletter. I read your last couple of posts and I think they're great.
Native speakers don't have exclusive rights to give advice on how to communicate. I really hope you'll keep writing.
The sentence only has a few translations on Tatoeba [0], if anyone would like to contribute.
Huh, thanks for that, I never thought of the --- as being part of the YAML (as a document divider); I always thought of it as being part of the Markdown (as a horizontal rule).
I agree with you that it's cute to be able to parse YAML frontmatter by streaming the file to a YAML parser that's been instructed to stop after the first document... but it makes me all the more uneasy about frontmatter as a concept. Call me old fashioned, but I want my files to contain just one kind of syntax.
For what it's worth, TOML [0] has been around for a few years. It's intended for configuration data and borrows some ideas from INI files. The +++ thing is just Zola's way to have you tell it whether you put YAML or TOML inside the "front-matter" of the post. +++ and --- to denote front matter isn't a standardized thing, as far as I know; it's just a convention that a lot of static site generators seem to follow. +++ in particular for TOML might have come from Hugo (that's at least the first place I encountered it).
I grepped the minified source code included in the page, and it looks like the project was built using React.
React isn't opinionated on how you should handle component styling, and so the community has experimented a lot [0] with different solutions to managing CSS for components.
One approach is to have the component set its own inline styles in the render function. This makes it easy to have the component's styles to be "reactive" to its props (arguments), e.g.:
function MyButton({ importance }) {
return (
<button style={{ color: importance === "high" ? "red" : "grey" }}>
Click me!
</button>
);
}
In my opinion, Christopher “vjeux” Chedeau makes the most cogent argument [1] for why this way makes sense. It's worth a read; even if you end up disagreeing with the conclusion.A related solution is to use classes, not inline styles, but to use a CSS framework such as Tachyons [2] where the included classes are small, single-purpose styling utilities like "serif" (applies font-style: serif) and "br-pill" (adds rounded borders).
[0] https://github.com/MicheleBertoli/css-in-js#features
[1] https://speakerd.s3.amazonaws.com/presentations/2e15908049bb...
Somewhat off-topic, but this is a great example of a problem with StackOverflow/StackExchange that a lot of folks pointed out in a thread yesterday [0]: the accepted answer is terrible but is shown at the top, and a much better answer (with clear community consensus, given the vote counts) is below it. Why not show the best answer first?
I’m also a believer in keeping research and writing a little separated so I don’t end up writing more backstory than actual story. Personally I use a self-hosted wiki (Dokuwiki) for my research and exploratory writing, and use Ulysses as my premier writing application when I’m getting down prose.
This is an interesting perspective that I hadn’t encountered before.
It seems that in recent years narrative-format journalism has become more popular. I wonder if some of this can be attributed to journalists switching from traditional pen-and-paper note taking to electronic solutions, and consequently reducing the cognitive separation between the research notes and the actual story.
This visualization from the same source answers your question:
https://ourworldindata.org/where-are-children-dying
In summary, it's highly disproportionate, with rapidly industrializing nations in Asia representing a huge portion of the decline in child mortality.
Thank you for sharing this; I find the technique refreshingly simple.
You may have seen people achieve this with a more complex headless Chrome-based solution, but for many sites, this will be perfectly fine!
Can you elaborate on the difference between using wget and a heavier solution? I assume the main difference is that a headless browser can execute JavaScript and then serialize the resulting DOM back to HTML, allowing you to build sites in client side frameworks (React, Vue) and then make static versions of them for deployment. Are there other benefits of using a full browser vs. simply using wget?
Used judiciously, ligatures can help make code more readable, not less. Consider JavaScript's == and ===, and their inverses != and !==. I personally find them difficult to visually distinguish on occasion (especially the negative forms). Fira Code [0] replaces them with two-bar and three-bar equals signs (something like =, ≠, ≡, and ≢, only wider; see the link for a screenshot). I personally find these easier to distinguish from one another at a glance. I'm sure it's not for everyone, but in my opinion at least these ligatures improve readability.
I'm generally a fan of Practical Typography, but this post is unnecessarily condescending. It's sort of laughable to claim that "this isn’t a matter of taste" when users are making this choice in the privacy of their own editors.