skysight-inc/HackerNews huggingface dataset:
Show HN: A stab at building my own string diffing library
Took a stab at building my own string diffing JS package.

I built an interactive demo for TypeIt’s website (https://typeitjs.com/build-your-own) a while back. The approach I took to handle user input necessitated a way to calculate the difference between the versions of a user’s text input.

I searched around for a package to help me out and found a couple of good ones (like fast-diff), but I either didn’t really like their API or didn’t want to take on a huge new dependency. Instead, I thought I’d give it a shot myself (famous last words).

I dove into it having no real formal knowledge of the algorithmic approaches to string diffing, and so things got frustrating real fast. But then I figured out a way to build it out using JavaScript symbols to link characters that helped ease the complexity a ton. It all resulted in “striff,” which comes in at just over 600 bytes gzipped, and that I’ve been using in production for a couple of months now.

It’s a little weird looking back now, because I don’t think I’d recommend someone taking the same path in building your own, but at the same time, there’s an immense satisfaction knowing I was able to figure out a pretty reliable approach. Check it out:

https://github.com/alexmacarthur/striff
Policy is nice, but what’s the statute of limitations? If the next administration can decide to bring charges, this is no protection.
What's more convenient

$.getJSON('/my/url', function(data) {

});

or

var request = new XMLHttpRequest();
request.open('GET', '/my/url', true);

request.onload = function() {
if (this.status >= 200 && this.status < 400) {
// Success!
var data = JSON.parse(this.response);
} else {
// We reached our target server, but it returned an error

}

};

request.onerror = function() {
// There was a connection error of some sort
};

request.send();

?
That's always been the blessing and curse with JQuery. It allows you to easily filter objects but it doesn't encourage efficiency.

A lot of people don't have control over the content of their site in enterprise situations. If you're stuck using an old framework or CMS you could be beholden to someone else. And at the same time there's a lot of devs who dgaf and just ship what works.
GQ has turned to absolute trash lately. Their low grade clickbait heavy pieces are beneath the old GQ.
One thing I think American governments need to do better, if they're going to be in charge of indestructible projects, is creating an informed electorate. Much of what is in this answer is new information to me, and I'm pretty sure I'm not unusual in that way. That still doesn't fix the problem that politicians don't understand these tradeoffs, but if they could be brought to that understanding and encouraged to communicate it clearly, it would at least direct public pressure the right direction to some extent.
Computer science is a liberal arts degree
I'd have no problem with the law being changed too.

However regardless how strict the law someone "could" always abuse it anyway and some sensible level enforcement is always needed.

This isn't a panacea but responsible prosecution or lack of it is important too.
Really enjoy the fearlessness. I wanted to share my main guide for programming, my dad always told it to me it comes from KentBeck:
First, you make it run. Then you make it right.

It is a bit connected to fearlessness, because you need to be a little fearless to start something without knowing where it will go. I think fearlessness originates from a trust in oneself, and maybe the universe too haha
In the hypothetical that you're hiding from an authoritarian state, you can avoid websites because you expect this behavior.

The problem here is the app was deceptively processing contact lists without user consent, and when asked to get user consent, the dev refused. If you're a transparency- or privacy-branded app, then you doubly need to disclose this information to the user.
There is, but then you're pinning yourself to whatever bugs are in that nightly, and making the eventual upgrade that much worse.
People disagree with you here, but they obviously spend a lot of money on it because it makes them happy.
Please make your forums have a link to the actual site.
Depends if one considers compilers, linkers, networking stacks, kernel emulation, unikernels, userspace drivers, databases, GPGPU debugging systems programming or not.

Despite my opinion on Go's design, I rather would like to see people using Go instead of C for such use cases.
715-song playlist is scientifically verified to give you the chills
There is a big difference between impromptu brainstorming on the job and turning every conversation about it into said brainstorming.

I know a lot of construction workers and lawyers (for some reason), and while lawyers like a good argument (and backstabbing) off client time, neither of the groups likes problem solving or doing the professional version outside of being paid for it. Well, except for some (usually broke) newbies anyway.
I appreciate this article for brevity however wonder if it can convince someone who is not yet convinced that cryptocurrencies (at least at current stage) are more harm than good. I'd like to hear opinion of people who stil are wraping their heads around the subject.
Not gonna happen. Why? Because AFAIK all life on earth uses water as a solvent. Unless your plastic is constantly/regularly exposed to water, bacteria will have almost no chance of catabolizing it.
What Does It Mean to Be a “Good-Faith Skeptic” & When Is “Bad-Faith” Warranted
And you willfully ignore that cars enable the ultimate freedom - autonomous mobility!

That is the exact opposite of a tax and anyone who thinks of cars as a tax is participating in some of the greatest looser think around.
C++ Concepts Error Messages for Humans [pdf]
Can you explain more about how this works? Even if we're being totally cynical and seeing politics entirely in terms of who can distribute favors within their network (which I think is at best partly true), it seems to me contracts to repair or rebuild bridges could be at least as lucrative as building a new bridge.
Nurturing Continued Growth of Our Oak CT Log
Why not use fetch?
Agree, and even C got really far without traits. Traits are a lot of rope for building confusing abstractions, IMHO.
> The stigma of medications is more harmful in my mind, I feel this deeply when I read your experience of life.

Mine was a life of extremes, put simply I stopped caring about myself during that time and I poured myself into my work as I wanted to have something to show for what I felt was more than likely going to be a short Life.

I didn't think I was going to get rich doing any of that, in fact I lost money for most of it's existence and I never paid myself in order to pay everyone else and keep the lights on until we accomplished our mission statement, the only thing that saved me in the end was the skill set I developed made me marketable in fintech and I got head hunted to go work for a Megaorp.

I spent my Life doing what I wanted and lived a perilous and risky life and got addicted to the adrenaline rush and still deal with bad PTSD to this day. I take your words to heart, and I'm glad it worked, but sadly a family member who had a schizophrenic break down really early in life (teens) just passed from a heart attack this week; her health really went down hill after having been put on SSRI meds after that. But she also had substance abuse problems with alcohol, that run on both sides of her family, that exacerbated an already bad situation.

I'm devastated, I'm glad it worked for you, but honestly... I'm not sure it's as cut and dry as you make it out to be.

Back then I was trying to cope with my situation as best as I could, without medical insurance for most of that time, but I'm also the kind of person that goes to Ukraine during this situation and goes to help feed and process Ukrainians/Russians/Belarusians at the Mexican border in order to feel anything other than pain and sorrow if I have access to resources to do so. I'm not exactly seeking a medical escape to what I deal with, so much as trying to play a part in trying to accelerate the progress of the Human Condition in it's current form as I fear extinction is a real possibility.

In short, I was trying to fix my Weltschmerz with seemingly noble but self-destructive behaviours because I didn't want to give in to the often depressing and bleak realities of the World. I didn't, nor do I now, want to feel any number than I already was back then. Given your handle, I imagine you understand what that show was trying to communicate the most was about addressing mental health issues more than it was an edgy hacker show with cool realistic cut scenes.

I've since worked on it after the aforementioned situations and a friend's abrupt suicide last year: it forced me to re-evaluate my value system, and gain some perspective on my limitations.
Oh man. I was annoyed by the breakout of the second pie chart which seemed needlessly confusing. But the left one is worse for double counting everything.

And it has a typo! ("Analys"[sic]). That doesn't really bode well for how much rigor the rest of paper had, either in its creation or review(s).
There are a lot of theoretical advantages to IPv6. Every single internet endpoint can have a unique address. You will no longer need any form of NAT. Any two random connected devices can talk to each other with a simple TCP/UDP request.

Practically all of this is still very unlikely, but at least it is a step in the right direction.
Agreed, 1) it's not sharing contacts, 2) it only pings those domains if you enable the optional feature. This is exactly how I'd want the app to behave, and I honestly can't think of a better way to handle it.

Maybe caching the favicons on a server hosted by the app creator so that no matter what domain the app looks up, it looks like it's contacting FairEmail.
That's a shame.

His work on blade runner just has this timeless magic to it. The sequel ends on his motif (tears in rain) for a reason too.

I also forgot to mention that chariots of fire is truly great too.

Some parts of his music haven't aged too well, but the stuff that hasn't is sorely missed in today's film scores. Even if Zimmer is brilliant he's not a poet.
Removing large chunks of unused code feels refreshing, that is true.
Oh duh, yeah, my bad. I was tweaking stuff around and lost that property. And seems like TryInto doesn't compile away entirely. Boo.

You can write your own debug_assert! though: https://play.rust-lang.org/?version=stable&mode=debug&editio...

not as nice, but it does work. If you were doing this a lot you could macro it up, impl as a method on all the various types you want... a pain, but it is possible.
The guidance for crypto startups might be to fold and return investor money. There are a few ideas which seem "interesting" such as enterprise blockchains for bank accounting, or smart contracts for inter-bank contracts. These help large financial institutions prove to auditors that they met their contractual obligations and no funny business happened. BTC will probably stabilize as a tradeable store of value as a hedge against "unfriendly" governments.

But there is a huge sea of blockchain startups which are trading alt-coins, or providing trading analytics software/exchanges for alt-coins, or simply making coins which have vague differentiators, or whatever web3 is supposed to be. I suspect that any crypto company that doesn't have a specific use case that customers pay for will struggle for the next few years.
GameStop hasn't even launched their NFT marketplace for consumers yet, still in beta.

What do you think happens when they also replace, or meaningfully compete with, NYSE?
Quoting vel0city [0]:

From their site:

> ¹ FDIC insurance applies only to the USD reserve funds. GUSD exist as ERC-20 tokens on the Ethereum blockchain; tokens are under the user’s self-custody, and are not insured through Gemini.

So if you send them USD, they'll hold your USD in an FDIC insured account. If you hold GUSD, and it turns out GUSD is a fraud or is otherwise insolvent, your SOL.

[0]: https://news.ycombinator.com/item?id=28147244
You're right, the weight loss per calorie restricted is about the same. That's not the point, it's about feeling better, being healthier and for IF, the lifestyle makes it easier to manage your sugar intake, calorie intake and overall health.
> "hey you can be honest with me and speak your mind", but the difficult part about that is no one will take you at your word when you say that.

I'd just caution you that... If you wanna bark up that tree you better be prepared to hear what they have to say. It might not be something you actually want to hear. And you're both going to have to deal with the fallout.
Everyone failed at some point, yet most succeed.
Is a boat car an amphibious car?
I thought adjustable rate mortgages were pretty much dead after '08? Why would anyone get an ARM when rates were in the 3% range for a 30 year fixed mortgage (as they were for several years until recently)?
Yes but only the parts you need, which means better performance and job security.
Do they like shiny on a screen or shiny in lights? If the latter then a Board with little project like lighting LEDs from code or reading temperatures from a sensor. This is something tangible and they can immediately show them a goal to accomplish. Once they've done that then let them do some Linux kernel hacking.
The Enclomiphene from Maximustribe.com doesn't require injections and doesn't shut down one's own testosterone production. Always better to have body produce more of its own than get T in synthetic form.
Fortunately, his lawyer had experience from the case against the makers of "The Neverending Story".
I'm waiting for a tablet design. I use a 3k2k lcd touchscreen on the HP Elite X2 tablet and while it's a more repairable design compared to a MacBook or surface, would love something with a bit more modularity to add a larger battery or modify the casing (see https://www.reddit.com/r/ErgoMobileComputers/comments/tcwep0... )
the benefits to management, automation and ubiquitous connectivity are well covered.

with that, we get a different security paradigm. let's say i have basic needs - some IPv6 IoT devices on my home network, with a req for SSH and RDP into that network network to various servers. what are the secure-by-design type of recommendations for this new paradigm in which my devices are now default-reachable from the outside world?
>imagine how many people are going to try sleeping with tech workers for privileged access now that this is out.)

Imagine how many accounts that were otherwise evoked a "eh, thotty but passable" repose from the arbitrators are gonna get banned now.
Doing these things quickly is mostly an exercise in pattern recognition. As you memorize patterns the moves become automatic. If you need to think through the position it will take too much time. It just takes thousands of hours of play to memorize the patterns as the puzzles get more complex. I don't play a lot so it is a good day for me if I get to past 5 in puzzle rush on chess.com.

I don't know what percentage of high level play is memorization and pattern recognition vs calculation. I suppose pattern recognition instantly culls thousands or millions of branches from the decision tree, and the rest is calculation on what's left.
Show HN: Connmap – X11 widget that shows your network peers on a world map
E.g on function parameters. It's always pass by copy, there can't be an issue.
Big and true.

I don't care about the specifics, I don't care that the revision will certainly have some flaws. But it matters that anyone bothered to push for the security angels. This makes for a healthier security landscape. For more honest penetration tests. For adding more volunteers to the good side. Really, how did this even pass the usual hurdles to progress???
You're probably making the mistake of joining communities that have been embrace-extended-extinguished by slack and matrix bridges.

Users on the attacking service get full access to IRC but also additional channels. For who don't mind the insane web bloatware it's simply the least friction path to abandon irc to participate.

In my experience communities that banned these bridges have remained vibrant and active.
Yes. But the world is too complex to write perfect laws so we must always account for discretion. Writing better laws is a goal, not a solution.
Hibernating? They've been the order of the day since 1987. Sure, there's booms and crashes, but that's why we call it a cycle.
The very first mention in the PDF states "DPRK’s UN-prohibited WMD and ballistic missile programs".

So, that context. The United Nations.

You do stipulate "that the DPRK has ratified" - why does that matter? They are a member nation of the UN, so they are running afoul of the decisions of the body they are a part of.
What if our replacement hinges are dropping when stationary too?
Well read further about the background, in this case, that specific feature doesn't share the contact list, it just queries domain name. it's optional and anyone asking to show favicon for domain names in contact should expect to know that it's going to be queried in this way?

Also, Google didn't give that as the reason for the app being classified as spyware. So it's just the OP being contrarian by taking an optional feature, claiming it shares contact details when it in fact doesn't and everyone voting it up because it sounds reasonable.
Thank you for the feedback as well :)

> I'm better than most reading poorer copy but I consider your(unchanged) copy very good.

This is nice to hear/read, yet I'm a perfectionist who knows perfection do not exist. The pitch can always be improved and clarity/transparency is very important to us.

> Unfortunately without the words"audit", "WORM" and"incident search" present or prominent I'm not your market.

This proves my previous point, since we rely on Docker images to implement the monitoring/reactivity part, literally ANY workflow/business logic can be applied (but we've been told that it's hard to trust "it can do everything").

> But I could think of many thousands of publication sites longing for your tool, if those terms applied.

I'd love to get in touch with you about that, if you have time, you can find my contact info in my profile: https://news.ycombinator.com/user?id=linkdd
Problems like removing a large directory instead of a file, creating your files on random places instead of the directory you pass on, or creating more files than you intended?

The one mess you see from other languages is creating files on the wrong place (or all over the place). But not those above.
Does becoming finance QAnon really count as winning?
Idk, with a cdn and caching you're really talking about a one time 30k hit, ie, nothing. But im glad the web has adopted its innovations
That was an interesting read. Thank you for sharing.
jQuery has the best API design ever, I hope Javascript can support that natively one days.
Octave is an easy language for beginners and has excellent (less ceremony than numpy) support for linear algebra out of the box without having to learn any libraries. The point of the class isn't to teach you how to use libraries but to teach you at a high level how to use gradient descent to optimize parameterized models. Once you understand how it works, it is easy to translate what you know to run well on different systems or to use existing frameworks already implemented on different systems.
> Unless you want to be an entrepreneur and you're also ok with the idea of failing and never becoming rich from it

failing != never succeeding

In fact, I would say it's much closer to,

failing => succeeding
How Bakeries Handle Growth
10/10 both with and without iCloud Private Relay enabled. I'd forgotten I was even using private relay. ISP is AT&T.
There’s a reason HN largely misses the innovation behind crypto, and it’s fairly simple. Bitcoin is not a technical innovation; Bitcoin’s value does not come from being an interesting data structure. Bitcoins value and genius is almost entirely economic in nature and hand waiving the (very simple) cryptography and computer science involved to analyze the economics is where the sophistication and avenue for critiques would come in.

Technical knowledge gives you a menial job of auditing when it comes to Bitcoin. If you don’t have the economic sophistication and approach when discussing Bitcoin it only proves you are ignorant to what’s relevant.
I am just reading it now and it is better than anticipated.
Yup - the "cars suck" or "cars as a tax" arguments are the ultimate in weak sauce and totally discount the utter enablement of autonomous mobility that cars bring. Independent freedom of movement is beyond empowering and I can understand why cars pose a threat to the politics of many of their detractors.
We all have to buy better umbrellas to contend with flying pigs.
Well he doesn’t have a job anymore so that’s probably why.
I took it when it was still in Matlab :) Haven't used Matlab since.
Not everyone wants to be so wasteful.
Business Processes as Types, Let's Explore
> This is a combination of hardware and firmware improvements by both Intel on 12th Gen Intel Core generally and us on the Framework Laptop specifically. This is with s0ix standby, and we see ~0.4%/hour typically in Fedora 36 on 5.17.6 with the settings in our setup guide

For reference, on a Intel 11th Gen Lakefield (Lenovo X1 Fold), using a Vanilla Windows 11 Pro with the non-Lenovo Intel GPU driver downloaded from Intel Driver & Support Assistant, given the results of powercfg /sleepstudy I get a 6% of drain for 9h54 min (so about 10h) therefore 0.6%/hour in "disconnected" (no wifi activity) S0ix standby.

Before, with the official Lenovo driver, it was 0.5%/h (4h: 2% drain). I was hoping to get better results, but this isn't so bad with about 0 optimization!

S0ix has gone a long way, in both Linux and Windows.
That some people are unacceptably poorer than others is unrelated to problems caused by excessively cheap gas.

The former problem is fixed via wealth transfers from rich to poor.
I used it to help learn ML before I could start taking the classes at my university and it was enough to land me a research position at the Air Force.

Admittedly I also bought textbooks and worked through tutorials as well.
Shoutout to the greatest album released in the 2010's, Yo Yo Ma and Chris Thile's Goat Rodeo Session:

https://www.youtube.com/watch?v=d-31e8Nlujw
Yes! You can build a decompressor only version of zstd that is only 95 KB with my version of gcc.

> make -j libzstd ZSTD_LIB_MINIFY=1 ZSTD_LIB_COMPRESSION=0 ZSTD_LIB_DICTBUILDER=0 ZSTD_LEGACY_SUPPORT=0 ZSTD_LIB_DEPRECATED=0
> wc -c libzstd.so
95824 libzstd.so

Longer term, we want to offer a stripped version of the library that includes the compression code, but only includes some of our compression levels. That way you can save code size for unused compression levels.

We've optimized pretty heavily in favor of speed over code size. But we want to offer better configurability, we just need to find the time to do it. We'd happily take PRs that go in this direction!
Well, I wouldn't say it's coming.
This smacks of rhetoric, not an explanation.
Require publicly funded research to publish results publicly, instead of hiding it in paid gardens.
Eat out. I'm not sure where I read it but I recall reading that not preparing your own meals improves ones happiness in the general case.
Most consumer devices today use some variant of the "Happy Eyeballs" protocol that prioritizes v6 to one extent or another, but "races" them (if IPv4 is faster to ping for a given DNS host it switches to IPv4 for that DNS host; otherwise it prefers IPv6). Things like NAT and CGNAT naturally slow down IPv4 so many consumer networks very heavily prioritize v6 in the "Happy Eyeballs" races.
https://lwn.net/op/FAQ.lwn#content

Currently just Jonathan Corbet and Jake Edge
Braidcast, episode 01: Seph Gentle (Talking about CRDT's)