Matthew Petroff

mpetroff.net · Personal blog · on HN since 2012

Matthew Petroff writes about hardware and web tinkering, including a Kindle weather display, Amazon Dash teardowns and pre-calculated line breaks for HTML.

What HN saysHN links it for the pre-calculated line breaks post, which commenters discuss in terms of Knuth-Plass justification, and for the Kindle weather display.
19HN people shared it
14linked it in comments
8stories submitted
26story points
3 years agolast shared
2012people per year2026

Most-shared posts

  1. 1
    Kindle Weather Display [2012]
    4 people · 3 points · first shared 2015 · discussion on HN
  2. 2
    New Amazon Dash Button Teardown (JK29LP)
    4 people · 3 points · first shared 2016 · discussion on HN
  3. 3
    Pre calculated line breaks for html css
    4 people · first shared 2020
  4. 4
    Amazon dash button teardown
    3 people · first shared 2015
  5. 5
    Scanner Modifications to Scan Large Documents (2013)
    2 people · 3 points · first shared 2019 · discussion on HN
  6. 6
    Kindle Weather Display
    1 people · 12 points · first shared 2012 · discussion on HN
  7. 7
    Hilbert Curve Cake
    1 people · 3 points · first shared 2019 · discussion on HN
  8. 8
    Color cycle survey: preliminary order ranking results
    1 people · 1 points · first shared 2019 · discussion on HN
  9. 9
    Preliminary Color Cycle Set Ranking Results
    1 people · 1 points · first shared 2019 · discussion on HN
  10. 10
    Color cycle survey update
    1 people · first shared 2020
  11. 11
    Discernibility of rainbow colormaps
    1 people · first shared 2019
  12. 12
    Pre calculated line breaks demo
    1 people · first shared 2020
  13. 13
    Figure caption color indicators
    1 people · first shared 2020

What HN people wrote when they linked it

mpetroff · 2020-07-28
It's possible, but the markup is very, very messy. I made a proof-of-concept by hand a couple months ago [1], but it would require quite a bit more work to automate it. It's probably best to just wait for browsers to implement CSS Text Module Level 4, which includes a property for enabling use of better line breaking algorithms. [1] https://mpetroff.net/files/pre-calculated-line-breaks-demo/
gwern · 2024-04-02
One immediately wonders about using it in browsers, but I looked into this a fair bit and concluded that there doesn't seem to be any viable approach still if you have real web content (rather than short toy blog posts), care about performance, and want Knuth-Plass: https://gwern.net/design-graveyard#knuth-plass-line-breaking But props to https://mpetroff.net/2020/05/pre-calculated-line-breaks-for-html-css/ for a cool hack bypassing all the JS issues entirely. :)
odyssey7 · 2023-12-22
The comment is invalid CSS to apply the Knuth-Plass algorithm in rendering an HTML article. Knuth being a perfectionist’s perfectionist, TeX uses this algorithm to determine optimal line breaks to provide for better text justification. Here’s a discussion of hacks to achieve the algorithm’s results on web pages and an upcoming CSS feature as of 2020. https://mpetroff.net/2020/05/pre-calculated-line-breaks-for-html-css/
mellosouls · 2020-02-16
I remember a similar looking project from a few years ago fwiw: https://mpetroff.net/2012/09/kindle-weather-display/ Another, inspired by that: https://shkspr.mobi/blog/2020/02/turn-an-old-ereader-into-an-informati… A little off topic, but for anybody interested in doing something for themselves, there are various "smart mirrors" that aren't e-ink, but use a tablet screen behind a mirror. Eg. https://www.instructables.com/howto/smart+mirror/
walrus01 · 2019-08-02
For anyone interested in weird low cost embedded devices, I suggest googling for Amazon dash button teardowns. There's some interesting choices made in their components and spec. https://mpetroff.net/2016/07/new-amazon-dash-button-teardown-jk29lp/ https://www.edn.com/design/consumer/4460866/Teardown--Designing-the-se… There is also this thing, the Amazon wand: https://www.edn.com/design/consumer/4460319/Teardown--Amazon-Dash-Wand…
TeMPOraL · 2017-12-06
Yeah, I find it hard to believe this device could be sold for $4.99 at a profit, if you count up BOM, assembly and logistics related to sending it. But given that some posters mention Amazon actually gives you $4.99 back for the first purchase, they must not be caring. Anyway, here's a teardown I found: https://mpetroff.net/2015/05/amazon-dash-button-teardown/ Now a surprising thing that I didn't know before - this thing has a microphone on board. Yes. Yet another Internet-connected microphone. Apparently used only to configure the button via ultrasound, but I wonder how hard would be to repurpose it...
tyingq · 2017-07-30
That's what Amazon's IoT button is. A more expensive Dash button that you can control. https://aws.amazon.com/iotbutton/ "Control", though, doesn't mean source code for the device, but rather, programmatic control over the endpoint (Lambda, etc). "You can code the button's logic in the cloud " The first gen STM32 based Dash buttons were hackable[1], but Amazon changed to a different platform (ATMEL[2]) and locked them down. [1]https://learn.adafruit.com/dash-hacking-bare-metal-stm32-programming/c… [2]https://mpetroff.net/2016/07/new-amazon-dash-button-teardown-jk29lp/ Supposedly, though, you can associate your existing, regular Dash button to a different product: https://www.amazon.com/gp/aw/help/id=201730790
mrb · 2016-08-01
Note that Amazon rolled out a second revision of the Dash button that is 4x more energy efficient: "I measured the new Dash Button’s energy usage to be 4.3±2.2 J per activation and the original Button’s energy usage to be 16.4±0.1 J per activation." Source: https://mpetroff.net/2016/07/new-amazon-dash-button-teardown-jk29lp/ Although the Dash is still much over-engineered: for every activation it has to establish (I believe) an HTTPS session and exchange a few requests with Amazon servers. A much dumber wifi button sending a single packet should be able to use 1/10th of this energy.
homero · 2016-07-31
Yes and yes https://mpetroff.net/2016/07/new-amazon-dash-button-teardown-jk29lp/ New one also uses 4x less power, cheaper battery lasts twice as long
netsharc · 2016-06-13
This guy did that (sort of, but he keeps the Kindle running): https://mpetroff.net/2012/09/kindle-weather-display/ , does the Kindle have a power-on timer?
evan_ · 2016-05-12
This is interesting, since from teardowns it looks like there's literally just a AAA battery in there: https://mpetroff.net/2015/05/amazon-dash-button-teardown/
esaym · 2015-08-17
Sounds cool, easy, and cheap. Not sure what I would do with it. Here is a tear down: http://mpetroff.net/2015/05/amazon-dash-button-teardown/ I can't find how long the battery lasts and with only one AAA, it might not be that long.
masonhensley · 2015-06-17
Neat, reminds me that I want to turn an older one into an uptime / analytics monitor sorta like this: http://mpetroff.net/2012/09/kindle-weather-display/

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close