skysight-inc/HackerNews huggingface dataset:
In fact, modern x86 CPUs know that the result of "x XOR x" is independent of x, and use this fact to optimize operations that would otherwise have a dependency.
They're more expensive to manufacture. They basically triple the number of LED "filaments" you'd find in a similarly-rated bulb, allowing them to run everything well below "max" spec, reducing heat (increasing longevity) and allowing the LEDs to operate at a much more efficient point (less lumens per individual LED, but drastically lower consumption).
Even so, that's contextual. What may be thought of as hurtful in one culture could be considered merely honest in another. Ignoring the things could get lost in cultural translation is an unfortunate way to miss the forest for the trees.
India has a fake jobs problem
Getting Started with Petal
Yeah. Coming from the US, I usually get an international data plan from my carrier and use it sparingly. (And it's often expensed anyway.) But for longer trips on my own nickel, I'll get a local SIM card.
Will your PR get merged?
Related discussion https://news.ycombinator.com/item?id=25779323
Unless the professional miner can pay all her bills with BTC, it is very much relevant.
Texture Compression on Apple M1
> Reason 1: It's decentralized. Regular social media platforms like Facebook have a single point of failure. If their servers go down, your content goes down with it.

Recently had a discussion broken into nonsensical fragments because one of the participants was banned.

> Reason 2: It can't be censored. Even if everything someone says is controversial nonsense, it is still in his good right to express his thoughts.

Only the admins have rights on their servers, as it should be. And if you run an instance which doesn't publicly state that it blocks right-wing servers, you'll be blocked by some of the big players, a move which is another step that the wider Fediverse is taking towards silencing a lot of speech. Granted, I don't want to hear most /any of it, but the author has conveniently omitted mention of this emergent behaviour.

> Reason 4: It respects your privacy

Admins can read everything you post on their instance, including DMs.

>Reason 5: It's all about the community

Until you say the wrong thing in the earshot of the wrong user and find yourself banned, with no idea why and silence when you try to follow the procedure to regain access. I've never tiptoed around a service like I do the Fediverse.

I like the Fediverse. It's full of interesting people and discussions, art and humour and folk exchanging ideas but it's the utopia demonstrated by the Star Trek: The Next Generation episode "Justice". One wrong move and there may be no discussion about what you may have done wrong, no questions as to what your speech meant, the justice is simply executed. At least there's always another instance, until user reputation is added.
Ask HN: How many of you use Julia for machine learning in the real world?
Inspired by this thread[0], and having only worked with Python and Scala for real projects, we haven't experimented a lot with Julia.

Do you do actual projects for real clients with Julia? How was your experience? What do you like the most, and what are the "if it just did that X"?

We're building our machine learning platform[1] to handle most of the low level tasks we did manually over the years in our projects, and we mostly focused on Python.

- [0]: https://news.ycombinator.com/item?id=25820457

- [1]: https://news.ycombinator.com/item?id=25802764
That's not what I meant. I meant if time is not fundamental, then there must be a time-free formulation of the laws of physics and also the universe itself must fundamentally work without time. I can somewhat - but certainly not fully - wrap my head around a time-free formulation of physics for specific situations and recovering time from that as an emergent phenomenon. But thinking about the universe as fundamentally time-free just breaks my brain, I can not overcome the thinking that change happens over time while the truth is probably closer to time emerges from change, roughly speaking. I guess because we are so used to reductionism, thinking about things as the sum of their parts and how they work, we or at least I struggle when something is not decomposable. But time seems to fall into this category - if there is a single isolated particle, then there is no time, it only shows up once there is a composite system and relations between its parts can change.
> The reason Sweden doesn't do regular health checks of the population is because there is no good scientific evidence that it has any effect. And that if a person feels healthy, they most likely are.

I think this is naive: there are a number of reasons people in Sweden don't easily get health-checks, and among these are certainly cost-saving, where the healthcare representatives who you need to contact before speaking to a doctor or nurse act as gatekeepers to the system. This 'rationing' of resources can sometimes have dire consequences, as happened to a former colleague of mine, who was denied the in-person checks he needed and almost died as a consequence.

There's also an enormous amount of peer-pressure in Sweden to be skinny, fit and actively go to the gym several times each week. A fat person is an extreme rarity in Stockholm. Couple this with an ingrained cultural 'guilt-complex' instilled in everyone not to be a 'burden' on anyone else, and the health-service is suddenly transformed into an 'emergency-only' institution.

Naturally that may be seen as a positive - although for some people it may have bad outcomes. It certainly contrasts with my extended family in Spain, who have tests for every possible malady at all times. But otoh that seems to work pretty good too, as one of my uncles died last year at the age of 102.
> There are a few patently false lies on the internet which are taken as examples of fake news - but they have very few supporters.

Very true. What's interesting though is how many supporters there of the idea that extremely large quantities of people 100% "hook, line, and sinker" buy into such fake news stories - based, ironically, on fake-news-like articles assuring us (with specious evidence, if any) that this is the true state of reality.

The world is amazingly paradoxical if you look at it from the proper abstract angle.
"Of the inmates who took the survey, 1 in 4 said they were the product of foster care."

I really wish people understood the long term effects of childhood trauma, and I hope parents can be considarate, prepared, loving and financially stable before having children.
Mobile Apps Are No Longer a Good Idea for Startups
> I don't generally do things that my friend would consider offensive, if they are actually my friend.

> I don't do things that I know would hurt my friends.

These two statements seem like they could be in conflict with each other. Suppose your friend has a methamphetamine addiction, but they consider it offensive for you to bring it up. Do you not bring it up ever because it's offensive to them?
I wrote the underlying 3D library, but React isn't my specialty, so I don't know if this is deemed best practice. Seems to work though and is nice and extensible, allowing the API to be proxied if and when the component changes
Some things that used to be exclusive are no longer exclusive.

And they scale poorly.

Every museum and monument in Western Europe suffers from this problem.

Sometimes there are tricks. If there's a "City Pass" that lets you skip lines, it can be a great value. Sometimes showing up early in the morning or late in the evening is a great strategy. It sounds like the latter is the case in Venice.
Self closing tags are perfectly valid in HTML 5 and there's nothing wrong with using them. Even if the parser ignores them, they're still useful for the reader. HTML 5 does not require you to close your paragraph tags either but most people still do it because tag soups are hard to understand.
IMO NixOS has the right stalebot settings[0]. It was discussed thouroughly in the RFC, as to choose the right information text and other actions by the bot. For example, the bot will only mark the issue/PR as stale and will never close the issue or lock it. Issues are only ever closed by humans.

The information text they came up with is quite a bit longer than the ansible one[1]. I think this is a very important point when adding such a bot, otherwise the user will be left helpless.

[0]: https://github.com/NixOS/rfcs/pull/51

[1]: https://github.com/NixOS/nixpkgs/pull/92254
> Is there an architecture with on-device authenticators where you don't have to trust the device manufacturer? The use of SE/Keystore is a red herring here, no?

I was trying to draw a distinction between the OS (which could in principal be built from a trusted set of source code) and the firmware controlling the tamper-proof SE/Keystore.

In the case where the SE/Keystore is controlled by something like the Intel Management Engine, that distinction might be meaningful, but you're probably right that in general if you don't trust the device manufacturer then it doesn't matter how the SE/Keystore is implemented or managed.

Moreover, I suppose if you trust the OS to be doing what it's supposed to, the only things a malicious SE/Keystore can do are cause a denial of service or fail to keep your secrets (in the worst case by broadcasting them with a hidden antenna).
Tooth implants also come as "kits".
You can get the same level of freedom with manual labor. I don't know where you live, but here, contractors make a shitload of money. Especially plumbers are in high demand.
There will always be monopolies in a capitalist system with little to no oversight or loosely enforced antitrust regulation. Tech is no different than oil, glasses, or diamonds.

If we're forced to have monopolies, I'd rather have them within my jurisdiction and forced to give a shit about local context of their operation than one that's on the other side of the globe and managed by people that never even stepped foot within my jurisdiction.
Allergy sufferers as well.
We do know exactly the conditions required for MCAS activation. And we do know those conditions should never be encountered during a fare carrying flight. Any pilot who deliberately puts their aircraft into conditions that result in MCAS activation should be prosecuted.

Pilots should never come close to stalling during fare carrying flight. Therefore the MCAS should never activate during routine flight.
Let's try an example with n=4:

1 ^ 2 ^ 3 ^ 4 ^ A[0] ^ A[1] ^ A[2] ^ A[3]

It might be early in the morning and I am missing something, but it has n-1 as its last index. Any insight is appreciated :)

Edit: There is a missing number in the array, thus its last index is n-2. Thanks for the correction, OP.
How Graphics Worked on the Nintendo DS
I can see this, however despite everything, Roman Republic survived for over 500 years. And nowadays governments have not just military but also sophisticated tools for censorship of information. I can't see anything changing for China or Russia in the next 100 years, sadly.
"In addition, there are comparatively few cases in programming where we XOR. Sure, it happens in things like games quite a lot, but the main use is actually _cryptography_"

I'd be curious if that's actually true. I know XOR is used for non-cryptographic checksums, parity bits, maintaining key traversal order for associative arrays, overflow detection, etc. Lots of general purpose "stuff" that isn't cryptography.
> (A jab at searches for extraterrestrial life that maintain oxygen as a key criteria)

I am not aware of any searches that have oxygen as a necessary condition for life and I doubt they exist.

It is not even considered a very good biosignature[1][2] because there are potential abiotic process that can replenish it, but it can be used as a biosignature, but that would work for life even if the life does not use oxygen, so using oxygen as a biosignature is not saying that life needs oxygen.

[1]: https://en.wikipedia.org/wiki/Biosignature#False_positives
[2]: https://www.liebertpub.com/doi/full/10.1089/ast.2017.1727
I swear this dude interviewed me once.
Compilers can optimize "a != b" to "a xor b" if they know that both operands are 0 or 1. There are crazy many expression rewriting rules.
Hey, I didn't know this. I'm glad they shared it. Maybe instead of being a jerk, you could say:

"Yes, as a matter of fact it's the canonical way..."
Infinitesimal over 100,000 years? I'm not losing any sleep over it personally, but that's a long time.
Parler website back on line sort of
(n+1)%2 = if (n+1) is divisible by 2 then 0 else 1 = (n+1) & 1 = ~(n & 1)

((n + (n % 2)) // 2) % 2 = ((n + (n & 1)) >> 1) & 1 = ((n & 2) >> 1) ^ (n & 1) = (n ^ (n >> 1)) & 1

In human terms, that means XOR of 1, 2, ..., n is:
(if (n is divisible by 2) then n else 0) + (if ((if (n is divisible by 2) then n else n + 1) is divisible by 4) then 1 else 0)

Or, as code: n * ~(n & 1) + (n ^ (n >> 1)) & 1

Phew! Can this be made any simpler or smaller?

1 ^ 10 = 11, 11 ^ 11 = 0, 0 ^ 100 = 100, 100 ^ 101 = 001, 1 ^ 110 = 111, 111 ^ 111 = 0, 0 ^ 1000 = 1000, ...

----

If you have some time, take a pen and a paper and think it through, you'll really like it...
You are wrong. Just try it out yourself. TFA actually explains why it still works even in that case.
HR doesn't always win though; Github's head of HR "resigned" (or was resigned) this Saturday after having inappropriately fired an employee the week previous. It seems the employee has been reinstated.

https://github.blog/2021-01-17-update-on-an-employee-matter/
Why does mov'ing a constant end up having overhead?
I've started renting wifi hotspots instead. A new sim screws up iMessage too much.
julia> (1:3)[begin+1:end]
2:3

it exists
Thanks, that sure clears things up!
With regard to number 4. I always assumed everyone had this ability, it's only in the last few years I've realized this wasn't at all the case. I was discussing study techniques with an anatomy and physiology prof, they were the first to really clue me in that it wasn't typical to just 'see' the entire human structure in detail. It has it's ups and downs for sure though, not sure how people get by without it to be completely honest. The obvious perk is tinkering with mechanical items or woodworking, can essentially create an exploded part view with full manipulation/rotation of parts, extremely useful in the drafting stage. It looks fairly close to the hologram view from the 1st Iron Man movie [0], just a lot more vivid. It didn't register that it was a hologram the first time I saw the film as a kid, I just thought that was his mental image. It seems like a skill to me more than something I was born with though, biased of course, and I have gotten better at utilizing it in my day-to-day work. For one example of non-obvious utility, through a lot of practice, I am now able to read a function module, then keep the screen state of that function in the corner of my vision, almost like having a floating monitor, biggest difference is that I'm able to update the image on command to whatever I need just by thinking. The biggest issue I have with this, and why I'm still looking forward to high-res VR goggles to do the same thing, is the issue of interruption. It takes a lot of effort to build the state of 6 or 7 'screens' and it takes 1 stupid slack message to bring the tower down. The programmer interrupted comic strip [1] is something that I've passive aggressively had to print out and hang next to my desk.

[0] https://i2.wp.com/medialist.info/wp-content/uploads/2018/10/...
[1] https://heeris.id.au/trinkets/ProgrammerInterrupted.png
>LEDs from Dubai

These LEDs were invented by Philips, a Dutch company, and probably manufactured in China. Gulf states love having impractical things to brag about though:

https://hackaday.com/2017/10/16/dubai-police-test-quadcopter...
Why Combustion Is Exothermic
Wil had the ability to block people, mute people, mute words, mute regex, mute entire instances... If he didn't agree with the moderation of the instance he chose, he was free to find another or even start his own.

Nothing about how the userbase acted restricted his ability to use the platform, publish content or engage with content in any way. He just got annoyed by it, then got banned by an instance admin.
Indeed, including your employer
If your company does this, you just have to give up on clearing the notification badge. You'd have to click on each individual "team" and then hover over each team's new message long enough that Teams is convinced you've read it. There might be a "mark all as read" button somewhere but Microsoft certainly doesn't make it easy to find.
Slightly disappointed at the "two missing values" solution:

First: one needs to realize that you can solve the "missing number" problem just as well with sums. So, if you're trying to find the "one missing number" between 1 and n, you simply subtract all values from n*(n+1)/2 (the sum of all said numbers) and you end up with the missing one. (using wrap-around semantics, you don't even need to have more bits of memory than you need for the xor solution!)

Second: A common way to solve a problem with two variables is to build a system of two equations. One can compute, in a single pass, what is "a+b" and "a^b" ; solve the system, and you get both variables with no additional lookups. Now, it's true that if you get a carry from the addition, this problem might not be solvable...but, if you can afford one extra bit for the potential carry, you're all set.
I don’t know what point you’re trying to make. I’m simply saying that (American) conservatives get uncomfortable if you point out how often they end up standing beside literal neo-Nazis, which you can easily see on display in the comments for this article.

> Conservative Jews also hate Nazis.

Tell that to Stephen Miller.

Also, vindicated means “proven correct”.
Reducing the lifecycle cost per lumen is one of the essential variables in making indoor farming viable
Wondering at what value of n the closed form solution uses fewer cycles than n xors, since that’ll end being the follow-up question :)
Oh, ok, thanks for the info.
React Components in Active Admin
Not to downplay the issue in Europe but there are 111 inmates per 100,000 people in the EU.
In the US it's 698.

That shows the amplitude and the spread of the carceral problem in the US.
One thing that honestly puts me off of some HN threads is the breathless "it's full of stars" comments where people take one press release and their minds go to some near-future utopia where everything is perfect and nothing hurts.
But there are only 3 items in the array (for example 1, 2 and 4). So the last valid index is 2.
How India created a digital blueprint for the economies of the future
For whatever reason, I haven't accumulated any real life friends with strong interests in hacker type stuff. I can have a full house of people and feel lonely without checking in on some of my online social circles.
A = { 1, 2, ... , k, ..., n-1, n}, for 1<=k<=n, and we're given integer n.

sum({1..n}) = n(n-1) / 2

sum(A) = n(n-1) / 2 - k

k = n(n-1) / 2 - sum(A)

Is the interview question looking for a "clever" solution? I'm confused as to why someone would ask this question in an interview? It seems like the more challenging question would be "Find a method of summing a range 1..n in less than O(n) time/space complexity." [edit] I have a dumb. This calculation can happen in O(1). Because of n(n-1)/2, we know the sum of the range, no need to examine each value in the range. [/edit]

Or, even more fun, limit the functions/instructions the interviewee can use (ex, some 4 or 5 instructions of x86/WASM/etc. machine instructions, max 1 or 2 registers, etc.) to complete the task.
Nobody wants to see the XOR solutions. These questions are really basic and only filter out the non-programmers. Any decent programmer should be able to solve all of these without a problem.
No I think that’s what I’m saying. When raising the issue that using multiple dispatch this way is premature abstraction that has intrinsic costs, all I get is the religious pamphlet about multiple dispatch.
It's actually not that hard to monetize browser extensions, and I think this is changing as the quality of extensions gets better — people are more willing to pay for software that solves their problems, regardless of the format. Here's an extension that makes $38k / month! https://www.indiehackers.com/podcast/187-jordan-oconnor-of-c...

And here's one that made at least $100k: https://www.indiehackers.com/product/css-scan/100-000-in-rev...
This is shameful - authorities knew the vaccine was en route to being made available towards the end of last year. COVID has been a persistent nightmare for many localities for the past 10 months. Nobody planned for this?

I can't help but feel that the media is responsible for this also - when being informed that vaccines were on the way in the 2nd half of last year, they resoundingly pooh-poohed it and refused to consider the possibility, instead preferring to wallow in the world's misery. It's good for their advertising!

Really shameful all around.
As someone who has had the opportunity to go, I would gladly accept the tracking / privacy intrusion for a short visit. Well worth it IMHO, and happy to support making travel to these sort of rare gems more sustainable and possibly even more enjoyable. My pro tip: go in the winter. You’ll have the place mostly to yourself.

https://www.dropbox.com/s/x4c73z3xi3ca630/IMG_8157.JPG?dl=0
This has to be one of the most absurdly elitist (or patronising?) comments about HTML I've had the pleasure of reading.

Who is this 'we' you speak of?
Where I live, the lowest I've seen in 10 watts and that's too bright for my taste - hopefully these are widely available soon.
>instead on relying to 1000s of half-ported apps, with shared functionality on Windows and Mac, and horrible cross-platformy UIs

Most people I know day to day who insist on Macs spend all their days using Chrome, VSCode and Slack with little else.

The days of the Mac UI apps built by passionate Mac developers being the Mac advantage are over. People like myself who still use native Mac software like TextMate, Safari, Transmit for the Mac UI are absolutely a small and shrinking minority.

I think while Apple has been looking the other way to iOS the past 10 years this moat of MacOS better 3rd party app experience through native ui frameworks has been completely eroded and now most MacOS users are just doing their work via Chrome wrappers.
For lot's of other fun bithacks, see: https://graphics.stanford.edu/~seander/bithacks.html
How my boss changed my life by promoting EQ in the workplace
Our managers are the reason we stay or leave the company (most of the time). They have the power to lift - or bring down - our morale. This article shares the story of a woman who was saved from burnout by her boss. Check it out and subscribe to get weekly content on management, productivity, and leadership.
Ah. I was about to make an edit to my comment as you are correct :) Thanks!
I’m going to be that jerk today: why is it noteworthy that you can do this? It reminds me of the “HTTP server in one line” which essentially executes a pre-made HTTP server that’s part of Python’s standard library. Writing glue code that is small is a sort of expected feature. Writing one without depending on your stdlib is what’s hard.

Edit: just checked on one of my projects. Looks like about 600 lines of C for an HTTP server that only uses stdlib’s memory allocation and string manipulation functions as well as socket IO. For an additional 20 or so it works over HTTPS. That was rather difficult to write and I’m sure has at least two bug I am not seeing. See http.c and server.c in https://github.com/ipartola/hawkeye