Readit News logoReadit News
akovaski commented on That XOR Trick (2020)   florian.github.io//xor-tr... · Posted by u/hundredwatt
akovaski · 2 months ago
The partitioning algorithm to find two missing/duplicate numbers is clever, I wouldn't have thought of that. It should also work if you have a list with 1 missing and 1 duplicate, yeah? You'd probably have to do an extra step to actually find out which number is missing and which is a duplicate after you find the two numbers.

> If more than two elements are missing (or duplicated), then analyzing the individual bits fails because there are several combinations possible for both 0 and 1 as results. The problem then seems to require more complex solutions, which are not based on XOR anymore.

If you consider XOR to be a little bit more general, I think you can still use something like the partitioning algorithm. That is to say, considering XOR on a bit level behaves like XOR_bit(a,b)=a+b%2, you might consider a generalized XOR_bit(a,b,k)=a+b%k. With this I think you can decide partitions with up to k missing numbers, but I'm too tired to verify/implement this right now.

akovaski commented on Second study finds Uber used opaque algorithm to dramatically boost profits   theguardian.com/technolog... · Posted by u/c420
alwa · 2 months ago
I wonder if it uses Significant Location Change monitoring—which apparently works around “Always Allow” location permissions, and would be consistent with allowing location “once” or “while using the app” (which Lyft, I believe, requires as part of delivering its actual service). It also might explain why only SFO: is SFO one of your Apple-determined-and-enumerated “Significant Locations”?

https://developer.apple.com/documentation/corelocation/clloc...

(Edit: annoyingly, the parentheses are part of the URL. I don’t know how to encode them to make HN’s link parser happy, so you may have to add them by hand if you follow the link.)

(Edit 2: fixed, duh--thanks @akovaski!)

akovaski commented on Show HN: Unregistry – “docker push” directly to servers without a registry   github.com/psviderski/unr... · Posted by u/psviderski
pbh101 · 3 months ago
This is probably an anti-feature in most contexts.
akovaski · 3 months ago
The ability to push a verified artifact is an anti-feature in most contexts? How so?
akovaski commented on The curious case of shell commands, or how "this bug is required by POSIX" (2021)   notes.volution.ro/v1/2021... · Posted by u/wonger_
zahlman · 3 months ago
> No, let's just try it out (I've put both the Python and the plain sh -c invocations):

  > python2 -c 'import os; os.system("-x")'
  > sh -c -x
  sh: -c: option requires an argument
I can't reproduce this in Python (including my local 2.7 build), only using sh directly. Going through Python, `sh` correctly tells me that the `-x` command isn't found.

But now I'm wondering: how is one supposed to use `which` (or `type`, or `file`) for a program named `-x`, supposing one had it?

akovaski · 3 months ago
> I can't reproduce this in Python (including my local 2.7 build), only using sh directly.

Same for me. It looks like the POSIX folks accepted the author's suggestion in 2022 and system() in glibc was updated in 2023.

https://sourceware.org/git/?p=glibc.git;a=blobdiff;f=sysdeps...

  #include <stdlib.h>
  int main(void) {
      system("-x");
      return 0;
  }
...

> [pid 172293] execve("/bin/sh", ["sh", "-c", "--", "-x"], 0x7ffe221d2f58 /* 76 vars */) = 0

akovaski commented on Instagram Addiction   blog.greg.technology/2025... · Posted by u/gregsadetsky
akovaski · 3 months ago
I recently had a few nights where I stayed up way too late watching YouTube shorts, which are about 1 minute each, on my desktop. I'd notice that an hour had passed, tune back into YouTube, then another hour had passed.

Now that I've recognized the pattern, I've decided to stop scrolling through shorts; watching a short without scrolling is fine. I also setup a systemd service to pause media and lock my screen every 30 minutes after bedtime. The screen lock may be overkill, but I have a bad record of digging too deep into subjects at night, so I think it will still be beneficial.

akovaski commented on Private Japanese lunar lander enters orbit around moon ahead of a June touchdown   phys.org/news/2025-05-pri... · Posted by u/pseudolus
wil421 · 4 months ago
Didn’t IBM and others use it before Apple? IBM iSeries came out before the iMac. I think a few companies were using small e and i at the time for the “cool” factor. Intel jumped on the bandwagon after the iMac, IIRC.
akovaski · 4 months ago
IBM rebranded AS/400 to iSeries in 2000, which is after the iMac came out.

https://en.wikipedia.org/wiki/IBM_eServer

https://en.wikipedia.org/wiki/IMac

akovaski commented on Starting July 1, academic publishers can't paywall NIH-funded research   nih.gov/about-nih/who-we-... · Posted by u/m463
burkaman · 4 months ago
Yes, this same guy is helping "to cut more than 40% from NIH’s 2026 budget and pare its 27 institutes and centers down to just eight." - https://www.science.org/content/article/new-nih-director-def...

He has already fired over a thousand NIH employees and frozen or cancelled billions in grants in his first couple months on the job.

While we're talking about NIH, here's a fun game: try going to https://www.nih.gov/ and putting gender in the search box. Play around and see how many Forbidden Words you can discover!

akovaski · 4 months ago
> try going to https://www.nih.gov/ and putting gender in the search box

Compared to their other actions of censorship, this is such a small thing, but for some reason this in particular makes me distressed. Possibly because it shows how paranoid they are about letting out any information that goes against their narrative; that they're willing to do stupid, reckless things to control the narrative; that they enforce obedience to their ideology at all levels. It just seems like the entrance to a dark future.

It feels like they're trying to rewrite history... Which is a term I searched the Internet for, and funnily enough the first result was a blog post from the current White House administration. https://www.whitehouse.gov/presidential-actions/2025/03/rest... (My other worry is that everything they accuse of others is a projection of their own intentions onto others. This seems less absurd every passing day. Otherwise this would be laughable.) So I guess the White House is explicit in they they're rewriting history to the True history. Thank you so much. Finally, we can be united under ONE Nation, ONE Truth, and ONE God. Sorry, I got a bit over-excited there.

For time travelers: searching for "gender" just directs you back to nih.gov, instead of directing you to the search results page.

akovaski commented on The great Hobby Lobby artifact heist   meghanboilard.substack.co... · Posted by u/diodorus
flocciput · 5 months ago
Is it just me or has HN as a whole become... more Christian lately? A lot more defensive comments here than I would've expected, and I've seen in other threads people actually openly recommending religion/Christianity specifically as something that solved their problems. What's the deal here? I would've thought this would be a relatively atheist/agnostic community, if not one that eschews discussion of religion entirely.
akovaski · 5 months ago
I don't know about HN in particular, but I do feel like religions have significantly boosted their online proselytizing in the last 5-10 years.

My suspicions:

* The normie barrier has continued to lower, so more traditional and progress-reluctant religious people are now connected to social media.

* Some sects may be intentionally targeting online communities, just like they target IRL communities for converts. Beliefs that don't require a devotion of forcing the belief itself upon others will naturally fade into the background. Beliefs that don't claim to solve your problems will also fade into the background.

* Social media algorithms prefer religious posts. Religious posts often invoke some sort of emotional response. Religions are some of the oldest memes after all.

All of this is just a gut feeling based on the religious material I've been exposed to on the web. I think it's fairly consistent with how religions have spread throughout history. Secularism is squashed unless you specifically fight for it, which itself may require a kind of religious fervor.

This is possibly the natural result of any human community growing large enough. There will be those who ask unanswerable questions, and there will be those who have the answers to those questions. Those who need order, and those who need to order.

akovaski commented on Use Long Options in Scripts   matklad.github.io/2025/03... · Posted by u/OptionOfT
ashu1461 · 5 months ago
Reminds me of our code having llm generated regular expressions which are impossible to understand and the only way you can tweak it is giving it to llm to change.
akovaski · 5 months ago
Folks, remember record your LLM prompt in a comment so that your regex can be validated.

u/akovaski

KarmaCake day320May 4, 2014View Original