HNHacker News
TopNewBestAskShowJobs

jdnier

2,542 karma · joined January 8, 2009

submissionscomments
jdnier··on Pendulum: Python Datetimes Made Easy
I saw this library mentioned in a StackOverflow comment. I hadn't run into it before. Wondering if anyone has experience using it.
jdnier··on PostgreSQL: Backend Flowchart
https://wiki.postgresql.org/wiki/Backend_flowchart#optimizer...

Genetic query optimizer optimizer/path evaluates all possible ways to join the requested tables. When the number of tables becomes great, the number of tests made becomes great too. The Genetic Query Optimizer considers each table separately, then figures the most optimal order to perform the join. For a few tables, this method takes longer, but for a large number of tables, it is faster. There is an option to control when this feature is used.

jdnier··on Recording Tom Waits (2004)
I had forgotten that one. Here's another that shows some of the complexity of his voice and melody-making: https://www.youtube.com/watch?v=0Ow45kTJqhg
jdnier··on Addicted to vaped nicotine, teenagers have no clear path to quitting
I remember an interesting summary posted on HN back in 2013 about nicotine and tobacco. This was before vaping became popular, but the case he made was that nicotine is actually not very addictive on it own, but seems to reinforce addiction in the presence of other compounds found in tobacco (e.g., MAOIs). Lots of primary sources given.

So what else is in vaping liquid?

"Nicotine as a useful stimulant" (gwern.net)

https://news.ycombinator.com/item?id=6457772

jdnier··on Progress launch timelapse seen from space
This is just breathtaking. The music makes it feel overly cinematic, but it's real—no CGI.
jdnier··on British astrophysicist overlooked by Nobels wins $3M award for pulsar work
Don't miss her first-hand account of her discovery (from 2009): https://www.theguardian.com/lifeandstyle/2009/jul/25/astrono...
jdnier··on Firefox 62.0 Released
That this was the the first thing listed did not make me very interested in reading on.

Favorite browser modification: set default page to about:blank

jdnier··on Pygmy: Open-source URL shortener in Python
My company does the same, and it can be convenient.

Twitter's public link shortener, t.co, is one of the worst, imho, because it ubiquitous (so you can't just treat all t.co short links as junk) and yet they make it really difficult report spammy short links. Often these short links get used outside Twitter's platform.

jdnier··on Pygmy: Open-source URL shortener in Python
Have you given much thought to how this link shortener might be abused? Your https://pygy.co/ example site doesn't provide an abuse contact, for example. That doesn't help when someone sets it up deliberately to host spammy links, but providing a default abuse contact page might be a good general step to raise awareness that link shorteners are often abused, and that anyone using the project responsibly should be prepared to handle abuse complaints.
jdnier··on Carbon dioxide toxicity and climate change: a serious unapprehended risk
I'm blocked from the PDF link. This may be the same article, although it's dated 2016: https://www.semanticscholar.org/paper/Carbon-dioxide-toxicit...
jdnier··on Regexper – Regular expressions visualizer
Horizontal scroll would be useful.
jdnier··on Regexper – Regular expressions visualizer
Complex regexes do render (must escape "/").

https://regexper.com/#%5B%5E%3C%5D%2B%7C%3C(!(--(%5B%5E-%5D-(%5B%5E-%5D%5B%5E-%5D-)-%3E%3F)%3F%7C%5C%5BCDATA%5C%5B(%5B%5E%5D%5D%5D(%5B%5E%5D%5D%2B%5D)%5D%2B(%5B%5E%5D%3E%5D%5B%5E%5D%5D%5D(%5B%5E%5D%5D%2B%5D)%5D%2B)%3E)%3F%7CDOCTYPE(%5B%20%5Cn%5Ct%5Cr%5D%2B(%5BA-Za-z_%3A%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)(%5BA-Za-z0-9_%3A.-%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)(%5B%20%5Cn%5Ct%5Cr%5D%2B((%5BA-Za-z_%3A%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)(%5BA-Za-z0-9_%3A.-%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)%7C%22%5B%5E%22%5D%22%7C'%5B%5E'%5D'))(%5B%20%5Cn%5Ct%5Cr%5D%2B)%3F(%5C%5B(%3C(!(--%5B%5E-%5D-(%5B%5E-%5D%5B%5E-%5D-)-%3E%7C%5B%5E-%5D(%5B%5E%5D%22'%3E%3C%5D%2B%7C%22%5B%5E%22%5D%22%7C'%5B%5E'%5D')%3E)%7C%5C%3F(%5BA-Za-z_%3A%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)(%5BA-Za-z0-9_%3A.-%5D%7C%5B%5E%5Cx00-%5Cx7F%5D)(%5C%3F%3E%7C%5B%5Cn%5Cr%5Ct%20%5D%5B%5E%3F%5D%5C%3F%2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, Where Cancer Warnings Abound, Coffee Is Next in Line
Yep, bought a set of non-toxic chalk pastels for my son and found the generic "know to cause cancer" warning. I had to go to the manufacturer web site and look up the MSDS report. Turns out the white chalk (presumably) contains Titanium Dioxide—you know, what makes some sunscreens white. It wasn't clear if nanoparticles are the concern or just that TiO2 is just on the list.
jdnier··on A prime number whose binary representation looks like a giraffe
Nice results at 192 (also three giraffes) and at 256 (four giraffes).
jdnier··on A prime number whose binary representation looks like a giraffe
Playing with the wrap width (in this case 94), you'll see a small herd of giraffes instead. (This is the prime from the reddit article, rather than your smiley face. Easier to see white on black.)

    100000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000
    000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000111
    110000000000000000000000000000000000000000000000000000000000111111000000000000000000000000000000
    000000000000000000000000000011111110000000000000000000000000000000000000000000000000000000011111
    111000000000000000000000000000000000000000000000000000000001000011110000000000000000000000000000
    000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000
    011110000000000000000000000000000000000000000000000000000000000000111100000000000000000000000000
    000000000000000000000000000000000011110000000000000000000000000000000000000000000000000000000000
    000111100000000000000000000000000000000000000000000000000000000000011111000000000000000000000000
    000000000000000000000000000000000000111110000000000000000000000000000000000000000000000000000000
    000011111100000000000000000000000000000000000000000000000000000000000111111100000000000000000000
    000000000000000000000000000000000000011111111100000000000000000000000000000000000000000000000000
    000000111111111100000000000000000000000000000000000000000000000000000011111111111000000000000000
    000000000000000000000000000000000000000111111111111000000000000000000000000000000000000000000000
    000000001111111111111100000000000000000000000000000000000000000000000000111111111111111100000000
    000000000000000000000000000000000000000011111111111111111000000000000000000000000000000000000000
    000000001111111111111111110000000000000000000000000000000000000000000000111111111111111111000000
    000000000000000000000000000000000000000011111111111111111110000000000000000000000000000000000000
    000000001111111111111111111000000000000000000000000000000000000000000000011111111111111111100000
    000000000000000000000000000000000000000001111111111111111110000000000000000000000000000000000000
    000000000111100001111111110000000000000000000000000000000000000000000000011110000011111111000000
    000000000000000000000000000000000000000001111000000111111100000000000000000000000000000000000000
    000000001111100000011111110000000000000000000000000000000000000000000000110110000000110111000000
    000000000000000000000000000000000000000011011000000011101110000000000000000000000000000000000000
    000000011001100000001110111000000000000000000000000000000000000000000001100110000000111001110000
    000000000000000000000000000000000000000110011000000011100110000000000000000000000000000000000000
    000000011001100000001100011000000000000000000000000000000000000000000000110010000000100001100000
    000000000000000000000000000000000000000001001000000110000110000000000000000000000000000000000000
    000000000011100000010000011000000000000000000000000000000000000000000000001110000011000001100000
    000000000000000000000000000000000000000000011000011000000110000000000000000000000000000000000000
    000000000001100001100000011000000000000000000000000000000000000000000000000111001100000001100000
    000000000000000000000000000000000000000000011100110000000110000000000000000000000000000000000000
    000000000001010011000000010000000000000000000000000000000000000000000000001100000000000011000000
    000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
    000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
    000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
    000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
    000000000000000000000000000000000000000000000000000000000000001000101101001
jdnier··on The curious case of high blood pressure around the world
Recent studies have, in fact, shown that dietary salt has a significant effect on blood pressure for many people, and on endothelial function for everyone.

https://nutritionfacts.org/video/sodium-and-arterial-functio...

jdnier··on Breakthrough Listen Project to Observe Interstellar Object ‘Oumuamua
"Oumuamua is now about 2 astronomical units (AU) away... At this distance, it would take under a minute for the Green Bank instrument to detect an omnidirectional transmitter with the power of a cellphone."

That's pretty impressive.

jdnier··on Introduction to Hierarchical State Machines
Thanks for this. Also, recent a HN discussion about State Charts, https://news.ycombinator.com/item?id=15835005

which led me to David Khourshid's worthwhile "Infinitely Better UIs with Finite Automata" presentation, https://www.youtube.com/watch?v=VU1NKX6Qkxc

and the article "You are managing state? Think twice", http://krasimirtsonev.com/blog/article/managing-state-in-jav...

jdnier··on Learn to use Awk with hundreds of examples
A regex can be used effectively to tokenize XML-like markup, including a lot of HTML—sometimes called shallow parsing. https://stackoverflow.com/a/6638578/234823

Attribute value minimization would be one limitation, since that regex is for XML, but it's a more robust approach than writing naive "<x>.*</x>"-style regexes.

jdnier··on A Little Story About the `yes` Unix Command
On my Macbook with way too much running, I get about 800MiB/s in Python2 with your script, but 1.12GiB/s with this Python3 script:

    import sys
    
    s = b'y\n' * 1024
    
    write = sys.stdout.buffer.write
    while True:
        write(s)
    
    # 1.12GiB/s
Plain old yes comes in at 22Mib/s.

The Python3 docs say to "use the underlying binary buffer object" when reading or writing binary data.

https://docs.python.org/3/library/sys.html

jdnier··on Floating Point Visually Explained
A search engine will also show that the use of the word "mantissa" in relation to floating point numbers is discouraged in favor of "significand".

"it is an abuse of terminology to call the fraction part a mantissa, since this concept has quite a different meaning in connection with logarithms"[1] –DEK

[1] https://en.wikipedia.org/wiki/Significand#Use_of_.22mantissa...

jdnier··on How Differential Steering Works (1937) [video]
Wikipedia on Jam Handy (olympic swimmer as well as educational film maker): https://en.wikipedia.org/wiki/Jam_Handy
jdnier··on Our Minds Have Been Hijacked by Our Phones
A great quote from the article: "Advertising is the new coal. It was wonderful for propping up the internet economy. It got us to a certain level of economic prosperity, and that’s fantastic. And it also polluted the inner environment and the cultural environment and the political environment because it enabled anyone to basically pay to get access to your mind.
jdnier··on Toyplot – A plotting toolkit for Python
Is that a style decision? I haven't seen that before. Seems confusing.
jdnier··on Show HN: The JavaScript Way, a book for learning modern JavaScript from scratch
Works in Firefox, not in Chrome (at least on MacOS).
jdnier··on How an autistic writer changed the way novelist David Mitchell sees his own son
Some excerpts from his first book give a sense of the depth of his (Naoki's) internal experience: https://www.youtube.com/watch?v=VhPKpte3E78
jdnier··on MicroPython running “bare metal” in the browser via unicorn.js
Google Translate translates that (DE->EN) as "damage cucumber".
jdnier··on Paxos in 25 Lines
Ugh, so I did. Here's the link: https://github.com/bringhurst/tlaplus/blob/master/examples/P...
jdnier··on Paxos in 25 Lines
Or if you're interested in the opposite of pseudocode, here's a TLA+ spec for Paxos.

Related to yesterday's TLA+ video post https://news.ycombinator.com/item?id=13918648

← PreviousPage 5 of 13Next →