skysight-inc/HackerNews huggingface dataset:
> That said, you can only use the +1/-1 optimization when you are searching for a particular element, so you can no longer use a function that returns true/false; you need a third state to distinguish equality. So it's also not as theoretically "pure" as I would like. But not only is it less pure, it's also not applicable to other real problems (see the followup post: https://blog.tylerhou.io/posts/binary-search-revisited/).

Why do you need a third state? The spec for your binary search says that it returns the first non-green element. A common spec for binary searches on arrays is that it should return the first element that is not < needle, and your blog includes an example of using your generalized binary search this way. I think a working binary search for arbitrary functions on integers that uses this "optimization" follows:

# search [lo, hi) for the least integer x with !is_green(x)
# or hi if they are all green
# or lo if you pass in a malformed interval
def binary_search(lo, hi, is_green):
while hi > lo:
mid = lo + (hi - lo) // 2
if is_green(mid):
# we will definitely return a value greater than
# mid, since mid is green.
# let's only look at elements past the known-green ones.
lo = mid+1
else:
# hi is the greatest value we can return,
# even though we'll never look at it,
# so mid is a good value for hi here
# (in particular, if hi==lo+1, then mid==lo, and
# the above branch can set lo=hi before we exit
# the loop and return lo)
hi = mid
return lo

# Usage.
binary_search(0, len(array), lambda i: array[i] < 6)

It seems like the difficulty you encountered with this approach is to do with the fact that you'd like to use an invariant in which you have at least one red and at least one green element. If you relax that self-imposed requirement then you can apparently delete half of the code.

Edit: I had a hard time articulating the invariant for the above binary search, which I commonly write for arrays only. I think it's "Given an interval [lo, hi) in which elements monotonically 0-or-more green then 0-or-more red, and given that (-inf, lo) is all green and that [hi, inf) is all red, let's find the least red element." This is a surprising amount of complexity, but I guess I'd rather have the complexity in the English description of the invariant than in the code. If someone has a more concise rationale for shoving both red and green mids out of the interval under consideration, that would be swell.

In your followup article, you have:

if left >= right:
return 0
if not is_green(left):
return 0
if is_green(right):
return right + 1

This is a bit weird. It seems like if I give you an all-green interval of length 0, 1, or 2, I should get 1-past-the-end in all of those cases, but here we get 0, 0, and 1-past-the-end. It's weird to get 0 if our interval is all-green [999,999] then get 1001 if we ask about all-green [999,1000]. It also seems like if I give you an all-red interval like [-1000,1000], you shouldn't return 0, since that element has a lot of red elements before it.
Adobe. The successful software company behind Photoshop and After Effects among many others, did not have a terrible track record for fixing Flash bugs. This is another lie.
I've heard of this, but I don't think it makes any difference at all. I don't even mind the low level petty corruption, it actually is a way to reduce the influence of other factors like caste, religion, etc when dealing with government officials.
The pipelines from Russia through Ukraine are still flowing energy into western Europe. Producer and transit countries have diligently avoided pipeline disruption.
Can't imagine it's hard to find a hosting provider in one of the other 194 countries.
Isn't enhanced pointer precision on windows just mouse acceleration? Even stretching the definition, it's certainly not AI or AI-adjacent
How do you suggest that lower and middle class people find stuff on the internet (Google) or can afford phones (Android)? How do you suggest small companies take advantage of a global distribution network and unknown authors get their books published (Amazon)? Who has done more to commoditize computers to make them affordable than Microsoft and Google? Amazon raising wages to $18/hour lifted wages for everyone. Yes the “evil monopolies” have done good also.

I purposefully left out Facebook. I don’t see how they have been a net good for society. I also left our Apple, since they don’t focus on the “lower and middle income”.
Pre supplements: Feeling lethargic and often sick, not shaking off coughs.

Our Doctor diagnosed Vitamin D deficiency.

Post supplementation (and D levels returning to normal), sick far less often with lower severity + increase in energy levels [to normal]

EDIT: Clarified energy increase is to normal.
But this might break the beautiful visual design.
Also don't miss that one DAB multiplex takes the space of about 10 FM stations.
> The Flash Player sucked pretty hard on macOS. It was slow, buggy, the fans would go nuts and Adobe didn't care.

This is a thing that literally never happened. No one said anything like this until after "Thoughts on Flash"
Certainly. They were also optimising for positive reviews in newspapers and magazines, which were also typically based on a short period of use.

I don't remember seeing this one on the usual lists of forms of market failure, but it's real.
I try not to have distractions so I can focus on the work.
Email, call your Ukrainian embassy. DM them on Twitter. Tons of options.
In my recipes I write `%C` or `%F`, the `°` isn't really necessary I find.
Lol wot
It's the only vitamin or supplement that the NHS advises to be taken by large segments of the population.
There was a lot of UX research that went into colour selection, including for airplanes. It's unfortunately hard to track the papers, but usually things like base colours went into norms and requirements so even if people didn't know why, they followed the results of the research.
The point was not that Linux is grandma-friendly as an OS, the point was that you do not necessarily have to delay installing it until you get a new computer, and may even negate the need for a new computer (certainly it's added years to various laptops in my orbit).
Maybe I misunderstand what experiences you are looking for, but if you go to itch.io and choose HTML5 do you not see the things that used to be made in Flash?
I’ve had some users that definitely needed a “dolt” button……
Ding ding. The reason I love hn!

Never heard of that book and from the wiki entry it sounds amazing and hopefully not prescient.
Low Fi electronic music, white noise (Serverroom, Coffeeshop Noises, that kinda thing), Classical music.

Depends on my mood and the kind of task.
>> The designers observed that a few users seemed to stumble at the point that the dialog was displayed, clicking "Cancel" when they should have clicked "Do It", but it wasn't clear what they were having trouble with.

Let me tell ya... people are still having problems with this. Red/green buttons, "OK" instead of "Do it"... doesn't matter. We're dealing with apes here, people. Goddamn apes.
I do think a valid criticism of web development at the time is that it was waaay too dependent on Flash, and I think the state of HTML/CSS/Javascript is a lot better for not having the Flash crutch.

Still, the reason that websites had Flash at all is that it was easy to create a beautiful experience - admittedly, only for those on macOS and Windows.
How do you implement this? I am a relatively new programmer and would love to to implement this on my own phone/ workspace
I'm all in for this units, finally on mobile that navigation bar would not screw up webapps
could you point to that literature?
Snowden strikes me as an egotistical idealist who wanted to be a hero. I think he thought he could make a difference, that the American people would rise up, and he would be able to return in glory. When he had to choose between his life and his integrity, he chose to forego martyrdom, which is completely understandable.
> These were lies

It would be helpful if you could point out specifically which of these two elements were lies. Because they look like truths.
Professional Bickering
I consider that to be factually correct. How would you describe the group which advocates for mask mandates?
Diomede Islands
Totally. Sugar is the Cigarettes of our time, no doubt. My mother's gastric bypass at 50 saved her life. She took artifical sweateners for 20yrs thinking they would help her control her weight but in reality all they do is keep you conditioned to the rush. She regained weight after her initial surgury but has finally been able to kick the sugar and has kept it off long term - now 67. She has the same problems with skin flaps; even though she keeps loosing weight she doesnt get the apperance changes because of it.
My point is that Russia is not a totalitarian country, unless you stretch the definition of the word to accommodate your personal belief not founded in reality.

You say 'allowing freedoms' as if it is not exactly what makes a difference between totalitarianism and not.

You can take it for what you will and call me a liar but I know what I am talking about. Equipment seizures and office searches are a threat but then they were happening for years already, the editor in chief was jailed at least once and is basically on the run -- but the newspaper still has the license, operates and is popular in the region (well, among those who read newspapers) and its site is alive and well (hosted outside Russia, probably). I know people who work there officially and saw photos of the latest issue.

I have seen democratic countries, I have seen totalitarian countries, I have seen Russia. I have no emotional attachment to Russia and it is at the very bottom of the list of where I might choose to live, but it is not totalitarian yet. Economist's Democracy Index concurs, Wikipedia's definition of totalitarianism concurs. You may be living in your own world (or a world created by the propaganda in the media you consume, which is probably weaker than Russian propaganda but still, sorry to break it to you, exists).
It’s also a bundle of anything - including tobacco, which is where fag comes from. Derived from the same root as “fasces” and therefore fascism.
GP phrased that quite ambiguously but I think he meant "Reading the news is not the problem". At least by reading the second sentence that's the only logical interpretation.
> I suggest vitamin D 2000 IU a day

Anyone know how long I'd need to stand in the sun to get the equivalent of this? I live in the tropics.
Bitcoin Surges for Second Day with Crypto in Demand as a Haven
Whenever people mentioned Linux UX and computer knowledge I always feel like I should evangelize that Zorin OS is alive and well, now at Zorin Core 16.

I use it for my parents, after they got fed up with Windows warnings and pop-ups for Windows 10 upgrade.

I am not sure they full understand they are using Linux, they just assume it is a 'free' windows version.
I dislike twitter's infinite scrooll,Paginated is more usefull than infinite scrooll.
Huh I bet this guy also could have mixed things up.

https://twitter.com/hjbertschi/status/1500689422114861057
https://twitter.com/Hromadske/status/1500586028100423684
Current events are, arguably, a refutation of soviet ideals (for all that they were often broken) and even practice - Putin explicitly talks in points related to Tsarist Imperial Russia, and a core argument of his invasion is that Ukrainians aren't a separate nation with separate language, and Ukraine "isn't a real country".

Things that, for all the oppression, were accepted and obvious part of USSR - there was Ukrainian SSR, not Ukraine as region of Greater Russia. Even with effective forcing of Russian language for all technical uses, even Stalin at his worst dealt with USSR as union of many nations, even if some artificially created from displaced people (in order to create single-nation autonomous regions).
Communism was not built, as an ideology, on the hatred and total destruction of an ethnic group. Stop with the false analogies please.
Not everyone is going to get those benefits, though.

I've been so deficient that I literally hurt. I had trouble sleeping due to the back/neck pain and had to take breaks while cooking food. Supplements took care of the pain and the extreme lack of energy, but I've never been "energetic".

The best way to describe this, really, is that if I had taken supplements before, I'd have prevented undue lethargy and tiredness. What actually made me get sick less often was not working with the public nor with children, and I never really had trouble shaking off disease when I did get sick. (I ended up deficient due to moving to a northern climate).

At best, supplements help me keep a level of normal.
1. Good Problem domain knowledge and versatile "T-shaped" breadth/depth of Solution Domain technologies.

2. Good communication skills to interact with Clients/Marketing/Sales/Management/Peers/Juniors.

3. Actual varied work experience e.g. Code Complete has a line like "actual 10 years experience and not 1 year experience repeated 10 times".
There are a few different definitions of veganism, the word itself isn't very old and has often been used to describe not just the a plant-based diet, or abstaining from all animal products, but the philosophy behind it.

This is one of the reasons why currently "plant-based diet" is gaining traction, to take the emphasis off the word vegan because it's been connected to the animal rights and ethics of the vegan movement. [1]

[1] https://web.archive.org/web/20150611163242/http://www.tampab...

> " I taught cooking classes for the national non-profit, Physicians Committee for Responsible Medicine, and during that time, the phrase "plant-based diet" came to be used as a euphemism for vegan eating, or "the 'v' word." It was developed to take the emphasis off the word vegan, because some associated it with being too extreme a position, sometimes based exclusively in animal rights versus a health rationale."
This way I don't need to sign in or remember cookies.
We're not being a little too cute. If you are supposed to be able to access YouTube from Firefox or Chrome, then you are also supposed to be able to access it via youtube-dl, given all of those are HTTP clients. Saying otherwise would be setting a dangerous precedent of trying to legislate which HTTP clients are allowed and which are disallowed.
If I remember correctly, vitamin D is produced by the body when it gets sunlight.

Sounds logical to me that we have more and more problems with lack of vitamin D as we are more and more in the house and not in the sun due to how labour and our daily life changes.

At least for me that's a reminder to get out sometimes and get some light.
Implementing Chaos in Big NFT Collections
To be honest, Putin isn't much obsessed about Soviet era...
In German I’d recommend “was jetzt” from Zeit.de
How about adding some positivity news sites instead of the tiresome WAR WAR DEATH CRYPTO WAR COVID GOSSIP?

https://www.positive.news/

https://www.goodnewsnetwork.org/

https://www.onlygoodnewsdaily.com/

etc etc.

I am so tired of life at the moment and this constant barrage of negative things I have no control over is too much.
> “varsity” is just a 17th century shortening of “university”

This one doesn't really fit here, as the "obvious" etymology is the correct one.
Dude. I wrote a piece of software for a company that takes online signups, and then matches them to customers who purchase things in the store. Many years ago they asked me to write a report that output local customers who had signed up online, but never bought anything.

The database table for transactions is called `trans`. So the report I coded was labeled "No_trans_customers".

Last year I get a call from the company CEO -- can we rename this report? Apparently someone saw the name of it and freaked the fuck out.
I don't really see a difference, as a consumer. If the AV sits at the kernel level or between userspace and kernel, it's still sitting below userspace and can do whatever it wants to the system. Sure, if I trust the kernel is better written than the AV software, I may have a few extra guarantees, but that is not a given and anyway it doesn't mean I can confidently run an AV I think may be poorly written.

It overall seems like a more complex solution that has more chances of being wrong. I would bet the core reason Apple did it was control to lock down their own control of your OS, not any security reason. Perhaps it also simplifies their development somewhat, if they can rid of some stability guarantees for some in-kernel APIs that AV would have needed.
So there are these bars that swing out from the frame. The bottom one holds the lock while the top one holds the seat tube. I wonder if you strike the top one with a sledgehammer right by the pivot point, would it shear the bolt that holds that tube to the frame? Could be a quick attack.
I stand corrected. These methods are indeed even better when you can't think of more examples.
I've been following this very interactive map:
https://www.scribblemaps.com/maps/view/The-War-in-Ukraine/09...
As if parents are home all day with their babies and young children.
Sunlight isn't enough in most northern hemisphere places for vitamin D. Or when you have darker skin.

Plus intense sunlight carries the risk of cancer.
> Giving a baby something with meat in it once a week when they start feeding, once a month after 2 years (or more often) will fix most diets.

That's a pretty exceptional claim, that's not something I believe without a source.

> For example, a vegan diet with >60% fruit (or fruit and grains), will cause amino acid shortages. Too little fruit, of course, causes Vitamin C shortages.

And a meat based diet that doesn't include fruit, or very little has issues too.
Kubernetes CRDs: What They Are and Why They Are Useful
Seb Lee-Desile built a laser version of Duck Hunt a few years back

Played it at a conference and it was good fun!

https://twitter.com/sassquad/status/847564268404748288
The physical control panels were arranged to keep contextually related controls together, then trained so you knew by heart how to move around the control room.
Does the NHS say all other vitamin supplements are a waste; or is vit-d the only one they actively endorse?

Can you share link if you have it? I would love to something from an authority like NHS about what vitamins are worthwhile.
Hyperinflation in the Federal Republic of Yugoslavia
Keep in mind the only thing tested is Vitamin D3 supplementation, it's not the same as synthesizing Vitamin D3 through sunlight. It might be worth reading the paper to see if sunlight exposure was even controlled for.

To answer your question, though, it depends on your skin tone and your location. It could be about 5 minutes if you're very fair skinned.
Came across this reading back comments: https://news.ycombinator.com/item?id=30515418
Why? Honestly, who cares? I'd rather have a dashboard of my personal health metrics to start my day with - that way I know how to improve my life and how things are going for me.

Just 5 metrics I want to know every day:

1. Sleep hours / sleep rating for the previous night (good, ok, bad)

2. Projected personal net income this week (total incoming - total outgoing expenses)

3. # New users of my SaaS startup

4. Project company net income this week (total incoming - total outgoing expenses)

5. Birthdays of family / close friends today & this week
Libli, tiny Matrix client for building public libraries
On Building Scalable Systems
It's not that simple. The angle of the sun needs to be such that the UV B isn't absorbed by the atmosphere. I believe the dminder app can track this and account for other things like altitude.
Interesting, thanks for sharing! I spent a few minutes playing around with it and it, it seems to target a different niche from Flash. You can't make games with it, only animations for games you'd make in something else.

There's no brush or pencil tool, only a very bezier-oriented Pen tool. You're supposed to take the results and integrate them into your game/app using one of their various cross-platform integration libraries. So you'd still have to use something else to make the game, this would just help you make animations (and maybe art, if you like bezier curves).

Still, in an era of "render your vector art to bitmaps and dump them in Unity" it's nice to see a tool that does realtime rendering of vector-art animation :)

It doesn't seem like it would be too hard to use this to make a HTML5 game (they provide a wasm module for playback of assets) but it's definitely a ways off from a fully integrated solution (and they don't currently seem interested in that aspect).
Ask HN: How does one go about bringing a hardware product to market?
How does one go from an idea to a sellable product?

I have various ideas, not especially "high tech" more assembling of off the shelf components to create novel products that I think may be useful (I have a need for these myself). So I could build a prototype myself (despite being a software person). After that what? How do you find out about manufacturing costs and options? Marketing is another side, but I have an idea about that.

Are there any good guides out there?
I frequently listen to DnB and neurofunk. It's a self-fulfilling prophecy. I get nostalgia of 2008 keygens blasting dnb at full volume. The cliché aesthetic of early 2000s programming/hacking is just very appealing to me.
How can this be explained from an evolutionary perspective? Weren't people more hairy in the not-so-recent past?

I can understand someone with a dark skin moving North gets problems, but otherwise, where do these issues come from?
still less easy to throw out, and less separation from legal life and 'anti putin talks'
This is generally correct, but it’s often better to go to the user rather than bringing them in. People can have quite different reactions in their own homes, especially if they have specific setup needs, than in a research lab.
By this logic, should we consider antivaxers as people-friendly, because fetal tissues are used in vaccine development?
My understanding is that Apple were actually working with Adobe to develop Flash for the iPhone during the iPhone's development, but that Adobe were unable to meet Apple's quality (bugginess, crashing, etc) and power budget (A major restriction on the first iPhone - competitors didn't even think it was possible with current technology) targets. It was only at that point that Apple cut ties and went a different route.
I'm not aware of any community of disabled people or disabled person who finds the usage of the term "Disable" offensive in any context.

I've never actually heard any controversy over the word "Disabled" EXCEPT in the specific context of it being used to refer to disabled people (person-first vs identity-first language debate, but that's a digression)

There's quite a long history people arbitrarily deciding they speak on behalf of all disabled people and know that language must change to protect their dignity and feelings. Inclusive language is actually plain language, since that's the easiest for people with certain disabilities to understand, so the inclusive thing to do is to avoid arbitrarily stigmatising words.
I think maybe this was true five years ago, but at some point they decided to turn the screws and really ramp up advertising. I don’t follow their financials but I assume the site was self sufficient with far fewer ads than today, and that now they are extracting profit (rents) from their established behemoth. Of course I could be wrong.
What is the most probable root of 'mas' then?
Global Consultancies Quit Russia
I assume by "religious" you mean Christian. Before Europe became Christian, it wasn't secular, it followed a wide variety of other religions just as devoutly.
eat food, don't take supplements

supplements will destroy your liver