News for hackers. Stuff that matters.

zeroimpl

Re:Why Do We Keep Reading the Great Gatsby? on Wednesday January 20, 2021 @01:21AM (#25843120)
I loved reading, but hated every book I had to read in high school. Just couldn't relate to them. Only later did I realize most of them were pretty good and meaningful.
Is it common in the Windows world for you to be able to copy software which you purchased on one device onto another device and expect it to work? Last I checked DRM is still the norm over there. Note that if the OS didn’t do this, you can bet the app developers would be including their own anti-piracy checks in the apps.
Re:Apple Fixes Bagel Emoji (2019) on Saturday January 09, 2021 @02:43PM (#25703872)
A good bagel doesn’t need filling, nor even to be sliced. A few sesames on top is perfect.
Re:GNU Units on Wednesday January 06, 2021 @05:51PM (#25663800)
Agreed. Why they wasting our time pointing out it’s “non-linear” when this statement is only true for some definitions of linear? Just pick a non-ambiguous word, or add an asterisk and footnote.
Re:Rust is now overall faster than C in benchmarks on Sunday January 03, 2021 @05:14PM (#25625736)
That's the whole point of the metaphor - comparing apples to apples is good, apples to oranges is bad.
Re:Ask HN: Is Near Infrared LED light therapy fake science? on Wednesday December 30, 2020 @09:22PM (#25588894)
I’m not sure about near-infrared specifically, but I’m certain that shining light on yourself at “good” wavelengths can be beneficial. Specifically the use of a 10000 lux led panel to mimic the sun in the morning definitely helps with seasonal affective disorder on gloomy days.

The logic behind IR light is entirely plausible too. Light is energy, it’s not like photosynthesis is the only way an organism can leverage light.

They were not acquitted for the first murder, they served the full sentence. Then later subsequently threatened to murder the same individual whom they had supposedly already murdered.
> By defaulting to its search engine instead of Google on its devices, Apple will open itself to monopoly criticism from competition commissions in a variety of markets.

So if they use their non-monopoly share of the phone market to form a real competition against Google’s actual monopoly on search, that will be frowned upon?

64-bits is plenty as long as you code it properly. The ids should be generated as part of the INSERT statement itself. This means in the rare case which has a duplicate id generated, you will get a primary key error and the transaction will fail. In most cases this means user gets an error message and retries.

If the above leads to any serious application problems, then you've got a lurking bug already, because you never know when there may be a network outage for example, and this would have the same effect.

Re:Quantum supremacy, now with BosonSampling on Friday December 04, 2020 @10:15AM (#25303121)
Various groups donated masks to China in January, what's your point?

Outside of China, nobody was talking about needing masks until March. I'm pretty sure the author is talking about the fact that by March, China had already produced tons of new masks but average people in the US couldn't access them because they were being reserved for health care workers.

That's precisely why there is a control group.
Re:Notepad++ 7.9.1 – pour Samuel Paty on Thursday November 19, 2020 @08:43AM (#25149321)
30% of free is still free.
Re:Update to Git changes the default of init.defaultBranch to main on Wednesday November 18, 2020 @10:55PM (#25146046)
Is there any evidence that the submitter of the code did not want to make the change? It seems quite possible that the contributor wanted to make this change and volunteered their time. If that’s the case, the complexity of the change should not be relevant. The only complexity to consider is the downstream complexity. And besides, the change seems to be a one-liner plus find-and-replace in thousands of unit tests. Could probably have been done in a matter of minutes.

I am just speculating of course and maybe they were very unhappy to have to do this.

Re:Update to Git changes the default of init.defaultBranch to main on Wednesday November 18, 2020 @07:45PM (#25144836)
I'm of the perspective that people arguing against these changes are bullying. The changes are easy to make, represent goodwill and inclusivity, and yet people with nothing to gain or lose are saying no. That's bullying.
Re:Krebsonsecurity.com has an expired SSL certificate on Tuesday November 17, 2020 @09:16PM (#25132429)
I'm pretty sure that most people, upon having one of their certs expire, do not find the private key and release it publicly. In fact they often generate a new cert from the same key...
Re:Git is too hard on Tuesday November 17, 2020 @08:51PM (#25132278)
They could have added namespaces to branch names. Right now branch names are just a free-for-all. Instead, if they insisted that branch names are always prefixed with "username/", then you wouldn't need forks and anybody could freely submit code to any project. PRs would become MRs.

I believe this is how most Git repos are managed within organizations. I'm not sure why public repos need to require users to fork things to propose changes.

And isn't this basically how Github works internally anyways? (eg https://news.ycombinator.com/item?id=24882921)

Re:Git is too hard on Tuesday November 17, 2020 @06:23PM (#25131251)
Not just that, they seem to suggest Github created Git...

> the quality of the tech that is Git is a testament to GitHub being able to make it this far in the tech space

But in reality, Github makes Git more complex, because now you have to understand the concept of forks. Not only is there your local copy and an origin, there is a 3rd repository in play.

Re:Git is too hard on Tuesday November 17, 2020 @06:10PM (#25131149)
How so? git handles binary files at least as well as any other VCS from what I’ve seen.
Re:macOS Big Sur on Friday November 13, 2020 @09:19AM (#25082355)
A better comparison would be: Hammers are designed for striking nails, but some customers have figured out they work well for cracking walnuts, so as a hammer manufacturer we should avoid using toxic ingredients such as lead.
Re:Feedback wanted: CORS for private networks (RFC1918) on Wednesday November 11, 2020 @04:18PM (#25063097)
Agreed - this HTTPS everywhere madness needs to stop as there are still valid use-cases for HTTP and no user-friendly workaround for enabling access to local IP addresses via HTTPS.
Re:Feedback wanted: CORS for private networks (RFC1918) on Tuesday November 10, 2020 @10:58PM (#25055370)
You cannot make an AJAX call from an HTTPS site to a HTTP site on a local IP address.

One of the internal web applications I develop (which is hosted over HTTPS itself) has to workaround this by doing the connection from the browser to the local IP address over HTTPS, but upon detecting HTTPS cert errors it opens a popup and walks the user through the process of adding an exception to connect anyways. Once that popup closes, then the AJAX request gets retried and succeeds.

While this works for an internal application, it would be unacceptable for any consumer product.

Re:Feedback wanted: CORS for private networks (RFC1918) on Tuesday November 10, 2020 @10:44PM (#25055297)
But what about those vulnerabilities is specific to being on a private network? If we can find a public website with the same vulnerability, will we start enforcing stricter CORS requirements everywhere?
Re:Flying squirrels glow pink thanks to fluorescence on Monday November 09, 2020 @08:57AM (#25034827)
> Low-light conditions are relatively rich in ultraviolet light, and UV vision is generally thought to be important to nocturnal animals.

Clearly there is not enough UV light at night to activate the glow in most cases, as otherwise people would notice. Also since it’s actually glowing pink, not sure what this could have to do with UV vision.

I wonder why nighttime would be rich in UV light though. I’d have guessed that IR light would be a better pathway to night vision, since warm bodies generate IR regardless of the time of day.

Re:The Remarkable Number 1/89 (2004) on Friday October 30, 2020 @12:12AM (#24939078)
I discovered this in my late teens and thought it was super cool and made me want to understand more about repeating decimals. After playing around for a bit I realized you could form arbitrary repeating decimals by dividing by 9, 99, 999 etc. So for example, 1/7 = 142857/999999. Or written another way, 999999/7=142857.
Cases allow personalization, are easy to wash, and frankly plastic feels nicer to hold then metal. Even without edge-to-edge screen, most people are going to add a case around the thing, so you might as well optimize by shrinking the extra borders as much as possible. Are we really sacrificing anything here? That’s an odd choice of word.
Re:Time for a WTF MySQL Moment on Wednesday October 07, 2020 @12:07AM (#24705205)
The other key to understanding this is that multidimensional arrays in Postgres are not simply arrays of arrays like typical programming languages. That’s why you can’t do things like array_agg on an array column.
Re:Why I am building permapeople.org on Tuesday October 06, 2020 @07:46PM (#24703801)
I grow tomatoes and some herbs on my balcony. It’s fun and they taste better, but it is clearly orders of magnitude less efficient than basically any alternative. I pay about $10 for supplies and many hours worth of labor to produce maybe $40 worth of produce.
Re:Escaping strings in Bash using !:q on Sunday October 04, 2020 @04:51PM (#24682169)
Yes the example in the article and parent comments ought to be referred to as escaping, not quoting. Most of the time, quoting with single quotes leads to something far easier on the eyes.

Here's an example function for quoting from stdin:

    function bashquotesingle() { 
        printf "'"; 
        sed "s/'/'\\\\''/g"; 
        printf "'"; 
    }
Though it does have a bug, at least on macOS, where sed adds a trailing newline. (See https://stackoverflow.com/questions/13325138/why-does-sed-ad...)
Re:Reasons Revealed for the Brain’s Elastic Sense of Time on Friday October 02, 2020 @08:57PM (#24668573)
Not saying I agree with GP but there are 2 distinct notions of time. One is related to durations, and the other is absolute time (aka wall time). Clocks measure wall time, not durations. Cellular processes probably don’t care about wall time.
Re:Things I Was Wrong About: Types on Sunday September 27, 2020 @09:16PM (#24611879)
I think the usefulness of type annotations is directly related to whether you are using classes.

In JavaScript or PHP, it’s usually easy to figure out if something is meant to be an int, string, array or object (yes we’ve probably all done “1”+1=>”11” before, but it’s very rare).

But if you are using classes, it’s very useful to distinguish at coding time which exact class an object is. Often you’ll end up with multiple classes with similar sets of properties, and it’s imperative to know which one is being used so you call the right methods.

Older »