skysight-inc/HackerNews huggingface dataset:
My favourite C string function is snprintf:

• It takes a buffer size and truncates the output to the buffer size if it's too large.

• The buffer size includes the null terminator, so the simplest pattern of snprintf(buf, sizeof(buf), …) is correct.

• It always null-terminates the output for you, even if truncated.

• By providing NULL as the buffer argument, it will tell you the buffer size you need if you want to dynamically allocate.

And of course, it can safely copy strings:

snprintf(dst_buf, sizeof(dst_buf), "%s", src_str);

Including non-null-terminated ones:

snprintf(dst_buf, sizeof(dst_buf), "%.*s", (int)src_str_len, src_str_data);

And it's standard and portable, unlike e.g. strlcpy. It's one of the best C99 additions.
> when it is told from another perspective?

The difference is that the other perspective is wrong, and ours is much closer to being correct (even if it still has problems).

So that is why your statement is silly.

And before you say it, no, I do not care about any of your arguments about cultural relativism.

I am perfectly happy, saying that people who, for example, want to kill gay people, have morals that are wrong, and that our morals, which are that we shouldn't do that, are correct.

Are you able to do that?
This sounds bizarre to me. If Apple feels so strongly about this position then why is there any position for discussion on this matter at all?

For example, my employer is strictly a work from office company. I disagree with that position but they were always clear about this at all times: safety permitting employees will return to the office. Never was there any confusion. You can talk about this all you want and disagree about it but the employers position is still clear and everybody knew this at all times.
Because most work cannot be broken down into ideally independent tasks.
Yet we now have rock bottom
interest rates and a 0% reserve requirement.
Crowdfunding Backer Patented My Project (2018)
Can you give some examples? IIUC there are builtins (macros/functions that couldn't be expressed in the language) but no keywords. There are lots of syntax elements that could be keywords like ' (quoting) but I am not aware of any true keywords.
It paints her as dreaming of murdering her and asking a friend to "take care of her"
1/10th of their employees and any bay area tech company believe that the corporation must "use its platform" to amplify any arbitrary topic

So you either lay down the internal law or have these indefinite squirrel conversations

It's pleasant when they all quit in "defiance". Makes it easier to get a bonus.
Does Starlink actually harm animal navigation through stars? I thought the issue at hand were light pollution.

Actually, I got around the paywall[0] and ctrl+f starlink returns 0 results.

[0] https://www.printfriendly.com/p/g/3wNvrw
“Badness” is not a property of the object, it is created by the perceiving subject. What AI does is an attempt at scaling the prevention a particular notion of “badness”, that suits its masters. In other words Twitter is just pushing another value judgement to the entire world.

Even the value of “no one should get offended” is subjective, and in my opinion makes a dull, stupid world. Ultimately it is a cultural power play, which is what it is, just don’t try to dress it in ethics.
Well that's just stellar. I've been using https://github.com/fnesveda/ExternalDisplayBrightness on my Intel and sorely missing it for M1.
Copyright Troll Richard Liebowitz Keeps on Losing in Court
And a global health pandemic that's harder to peg than inflation
I think the pandemic changed things a lot more than we give it credit. A lot of jobs were all of a sudden remote and could be done well remotely. I think we are seeing employee preferences shift to remote work if it's possible. If there are remote-friendly opportunities, employees will definitely be leaning towards that in the future.
I wonder if a country with different libel laws would help her? For example, I've heard it's easier to sue for libel in the UK than in the US.
retraining does not work https://www.theatlantic.com/education/archive/2018/01/the-fa...
>the examples of cultures out-competing and replacing others through technology are rare

Alexander the Great - phalanx with resulting spread of Greek culture over all the Middle East, Roman Empire - countless advantages over the cultures they dominated, Vikings - sea faring ships and navigation, Columbus+/Americas and the whole colonial period across the world, ...
That's why you should evaluate the cost/benefit, like I said.

> If your goal is to avoid undefined behavior/potential security headaches, then C should be entered into after careful consideration of cost/benefits. There are better alternatives for some projects but not others YMMV.
The other perspective of this is that luck is "hard work meets opportunity" or that "you make your own luck" or "you miss 100% of the shots you don't take".

There was a conscious choice made to go to a meet-up (networking) and going to a career fair (or conference or further meetups) where you could run into people you've networked with in the past. Without that choice, none of the downstream lucky events would have mattered. So you can acknowledge the role of luck in those uncontrollable downstream aspects (T-shirt, career fair meetup) while also acknowledging what OP's role in creating that situation.

You're not "unlucky" if you had decided to play video games instead of going to either the meetup or the career fair. You could be unlucky if you did both of those and the opportunity never arrived. The former is (bluntly) making excuses about somebodies lack of success.

Or you can just say that someone was lucky to not be born in a country where they're forced into military conscription as a child at which point everyone is back to being lucky. It's all a matter of what you decide to focus on and what perspective you bring into things looking forward or backwards.
I thought we'd all decided the Chad way was the best way to do strings in C.

https://github.com/skullchap/chadstr

Maybe not though. Issue #6 is unresolved.
Agreed.

The Rust Embedded folks saw what was coming and chose Matrix even back when it wasn't nearly as good as it is now.

One of the things about the voting to make the choice was that a lot of people gave an informal thumbs down on alternatives to their main choice. Discord came in for a HUGE amount of thumb downs. No other option even came close.

For some reason, a lot of people fail to estimate how many people really loathe Discord.
Many of these companies invested tons of money in commercial real estate and can’t afford for that to have been a bad investment. Apple is a great example. They built a spaceship.
The current headline is: "Cuomo begs businesses to return to NYC after devastating shutdown"

The article is full of some funny quips, too:

> "So let me get this straight..when Republicans have been saying this that means they are science deniers trying to kill people, but when @NYGovCuomo finally says this today then he is a genius who should write another book about his incredible leadership?" Rep. Lee Zeldin, R-N.Y., tweeted. "Did I get that right?"

> "Brilliant strategist... it's incredible that no one thought of this months ago!" Donald Trump Jr. joked in response.
That stuff about mandatory email encryption is nonsense. Nothing in GDPR impacts on the way a normal mailserver operates.

And if you're running a mailserver, then you've got a retention policy. Either it's your policy, or it owns you.
My twin brother and I shared a bedroom from birth until we left for college at 17. Exactly what different environmental factors can you identify between us that would have made him chunky at 15 when I wasn't? Or that made him not enjoy exercise and sports like I did from the age of 8 onwards? Are you going to admit that it pokes massive holes in your univariate theory, or simply continue to double down? Perhaps my side of the room had a dramatically different climate than his, right? It's as if your brain ignored the obvious to continue to support your absurdly simplistic genetic determinism.
Game over for other animals was the developer of cognitive abilities and invention of speech. That allowed humans to kill all competing predators and megafauna, even without fire.
And at some point he is bound to be right desu.
Does the gamma solution lower the power use like a proper brightness reduction? And if so, by the same amount?

Did you ever attempt to reach out to Apple about how this should be implemented on the new kernel? I would hope there's some forum for this kind of question still.
I strongly encourage employers mandating a return to office in NYC to publicly announce it. Makes it straightforward to identify where to source new remote talent from.
The Tyranny of the Extroverted
Yes. Even better, a good database will avoid traversing the blocks and path, when the key is close enough to the previous lookup's hint, making all but the first lookup in a nearly-consecutive sequence take O(1) instead of O(log N) where N is the size of the tree, and runs of n nearly-consecutive operations take O(n + log N) instead of O(n log N).
Nothing but FUD here.
> If Amazon is close enough to automating these jobs, then it will likely just automate it and fire whoever it can.

They will do this anyway. The reason it mattered for elevator operators is that you had to convince a bunch of end users that it was reasonable to self-operate the elevator after they had been trained for years to have an attendant, and you probably had to modify the deployed elevators all over the city--which weren't owned by and one party but had been installed by various buildings--to have additional safety features. Amazon can replace out how Amazon works internally and I would have no clue.
I'd buy more often from smaller businesses if it didn't take most of them 3 days to merely put the shipping label on the box, let alone actually ship it. Amazon is top dog because they know people want a shot at getting items on the same day or next day. Almost no other online business can match that besides maybe Walmart, but they're vastly inferior and their fast shipping rarely pans out.
If they hired a contractor to work on this, the $3500 prize would get them 1-2 days work. At the same time, I can easily see someone interesting in this area investing time in it for the challenge. Doing a hackathon as a source of income is probably not too common.
Anywhere that this format is a variable, you probably already screwed up. C allows that, but if I see it that's getting flagged in my review.

So long as the format string is a literal you needn't care how it works.

Now, one of the places where C makes this nastier than it needed to be is that C built-in types are silly, and so any non-trivial program is using better fundamental types like uint32_t (or the more succinct u32), for which the built-in formatter offers no syntax. So you end up writing format strings like "There are "PRIu32" dogs\n" using macros to bring in the appropriate specifier for your literal. Blergh.
It's a fair point that there's some buying for store of wealth, but if that's the problem, address it, not something else. Amsterdam (my city) for example fines for homes left empty, either you live there, rent it out, or get fined. It should be quite easy to set penalties such that the incentive flips. There's plenty of property management + insurance products, to make the task of renting out carefree and riskfree compared to leaving it empty and paying fines.

But beyond that I find it's a minor problem that gets broad attention in the media. There've been lots of studies around vacancies, but they usually don't amount to anything close to the media narrative.

For example, most real estate investors discount their expected rental income by 10% for expected vacancy, because they know tenants come and go, it takes time to find/review/place new tenants, some tenants fall through, and sometimes there's a no alignment between a tenant leaving and a tenant being available on short-term. 8 or 10% is a very standard industry figure people often use for quick calculations. In the US I think the average is about 7% for example.

Now if you find that 1 in 20 homes, in a particular high-class area known for vacancy, of a particular city known for this problem discussed intensively in media/politics, are vacant... that's entirely within normal parameters. That's 5%, and supposedly it's the most incendiary piece of data they could find.

In other words, quite normal figures that have a straightforward solution (>3 or >6 month vacancy leads to hefty pentalties/fines/taxes). I'm not saying the problem is completely non-existent, but it's not that big a deal as people often think and repeat.
That is a flat out lie.

Please, do bring evidence for the claim that "almost everyone" considers equity as "equality of outcome".

And no, you do not have "equal chances" right now. Nor do you get "equal treatment". It depends on money, skin color, religion, sexual orientation, and many other factors.
> if that string can be a number, that's obviously what was intended

Maybe that would be a reasonable assumption in a world where programmers were omniscient and never made mistakes. In practice these "do what I mean" rules just tend to make it easier for poorly-specified programs to produce nonsense without signaling that anything is wrong. If your program intends to add two numbers and one of the inputs turns out to be a string then someone gave you bad input; the right solution to that is to report an error, not continue with bad data. Perhaps it's only an accident that the string happens to look like a number this time. Maybe it wasn't intended to be a number at all, and some parameters got swapped or an input file was corrupted.

Also, that rule is too broad. The string "5" could be treated as a number, sure, but so could "five" or "⑨" or "¾". So why is "five" + "⑨¾" an error and not 14.75 (or even "14¾")? If you want to accept number-like strings as numbers, fine, but there should be an explicit process where the programmer defines exactly what form the input can take and how to perform the conversion to a number. Implicit conversions skip that step and expose the internal defaults of the language to the end user.
You reap what you sow, Cuomo.
He's got some radical notions but always seems to make pretty good predictions.

For instance, in that video he's calling for a six in Southern California in the next six days.
Based on the downvote patterns in this thread, it's pretty obvious CCP trolls with HN accounts are highly active.
Reminds me a bit the "501 games in 1" handheld consoles :/

"Playdate stated that they were interested in including games by underrepresented developers and game makers, at least one game by a woman, as well as games by queer, trans and non-binary developers."

Uugh, just focus on the games...
How has he not been impeached already?

https://nypost.com/2021/06/15/cuomo-nursing-home-order-cause...

https://www.nytimes.com/2021/03/04/nyregion/cuomo-nursing-ho...
I recently got my endorsement in under 8 hours. There’s a great discussion board on https://discourse.tnvisaforum.org/ forum.

Definitely recommend the visa, given that it has a great guide by TechNation.io
But then you're undermining your own hard compile time check, wherein specific files or areas of the project could fall through the cracks and continue to used supposedly "banned" functions.

I'd argue doing it globally but as warning would be a better alternative than doing it file by file.
I've had a wonderful time with PNPM ever since switching for a couple of projects - installs are near instant, and my hard drive is no longer stuffed with a million installs of the same package in different places.

I always thought it was weird that npm didnt use a central store on your hard drive for your packages and instead just duplicated them everywhere, and i always thought it was even weirder that yarn didn't change this behaviour, but maybe i'm missing something.
Right, if it makes Apple less competitive then Apple leadership has to deal with that.

They're betting on that not being the case (at least not enough to change one of their defining work-culture tenants -- face to face, in-person work is more productive and innovative). Only time will tell.

But work is not typically a democracy and there's time for consensus and if it doesn't go your way, you can leave or stay and commit.
Is facebook still relevant these days?

I deleted my account in 2008, I think the most useful feature it had for me was the "market"-something, a group or app where one could sell second hand items.
Not for me but maybe a friend
He just wants to bring back tenants for his cronies at all costs...
I'm not supporting Apple's position. But I don't think they'll have any trouble finding people so long as they pay premium salaries.
I wonder if we're in PROD, STAGE, QA or DEV?
waves humanly
https://en.wikipedia.org/wiki/Craig_Murray#Ambassador_to_Uzb...
He should have been impeached six months ago.
DDC is great - I remember saving a Samsung 193P monitor (no buttons and controlled by a proprietary driver that only worked on WinXP) that had its brightness set unusably low by its prior owner. I also remember someone using DDC scripts as a KVM solution by switching the monitor inputs programmatically.
In addition to the "last match" effect mentioned in the thread, I wonder if this has to do with who wins which medal. Maybe the people winning bronze are more often doing better than they expected, while the people winning silver are more likely to expect that they might have been able to win gold.
> The "just stop buying amazon" arguments never made sense to me in the first place, because most people who use it are the ones budget-stretched in the first place. A lot of rural communities have no other viable options for some items as well.

They've become the new Walmart, they killed off all other options so now its the only place left for a lot of people.
All of the data that can be used to identify a person are precisely defined?

Or is it that all of the identity data that someone can be held legally accounted for are precisely defined?
I don't think this is a fair argument. Sure, the shirt probably isn't appropriate for a business casual environment, but that doesn't change the fact that this behaviour is sexual harassment: made worse by the fact that the recruiters are acting from a position of power.

It's also worth pointing out that these events occurred at Black Hat, in Las Vegas: what passes as acceptable business attire there is not the same as what would fly in an office, and I guarantee there were plenty of people wearing far more risqué shirts without facing any harassment.

It's easy to try to pin some responsibility on the woman here, but that ignores the fact that this sort of language and culture is extremely common at Black Hat and DEFCON, and a shirt like she was wearing would not have been out of place at the conference. Hell, I wouldn't be surprised if she won the shirt at the conference.

From the year before, here [0] is a sign from the vendor area at Black Hat, featuring an underwear clad model with the caption: "You know you're not the first... but do you really care?"

Similarly, to this day, DEFCON, held one week after Black Hat, and likely the largest security conference in the world, still holds a "Hacker Jeopardy" competition, featuring strippers who remove their clothing as contestants answer questions correctly.

I only say all of this because I think a lot of context is being lost in this article, by people who haven't been to these conferences: the women's shirt wouldn't have been what singled her out here, her gender was, and for the recruiters to harass her for that is unacceptable.

[0] https://twitter.com/secitup/status/497140864708116481
The same reason SF elected Chesa Boudin. NY's best days are behind it.
The Democratic Machine is very much alive in the Empire State
Introduction to Heredocs in Dockerfiles
> ...when you work in the office and thus have to reside near the office.

I don't think most people pick their residence based on their work location. My company's office is in the downtown of a major metro, and yet the majority of my coworkers are located far from the city core, often 30+ minutes commute by car -- and two colleagues who commute 90 minutes each way on the extreme end.

There are much stronger factors influencing people's choice of residency, such as familiarity, proximity to friends and family, recreational opportunities, nightlife, etc.

Which, to my mind, answers your question:

> Given the choice and the preference for city life, would they choose a lower cost city where they could afford more space?

I would venture to guess that for the vast majority of people, the answer is no. Few people are willing to uproot their life for a bit more space.
You can turn A->B, B->A into A->I,B->A + A.I=B and that does avoid a circular dependency.

A->B means a depends on B, A->I means A depends on an interface, and A.I=B means that B is set as the implementation of the I interface that A depends on.

I’m on mobile so that was the best I could come up with. Try it out using Swift though, and that can be translated pretty directly.
So, suddenly, lowering carbon emissions isn’t that important anymore
The lefty problem is why I'm baffled that languages like Hebrew or Arabic that write right to left exist at all. Surely most people are righties, and writing systems would be written with that in mind.
> There's also the option of using both a length AND a null terminator.

I first encountered that idea in this classic Joel on Software post, which rather put me off the idea of using them in production:

> Notice in this case you’ve got a string that is null terminated (the compiler did that) as well as a Pascal string. I used to call these fucked strings because it’s easier than calling them null terminated pascal strings but this is a rated-G channel so you will have use the longer name.

https://www.joelonsoftware.com/2001/12/11/back-to-basics/
don't understand why it's down voted. seems to be a valid argument. care to clarify?
I’ve turned down 2 offers that were advertised as remote but the but the managers gave off “management by walking around” vibes, and turned down another that paid 10k less for remote.

(I’m more than full time employed and I’m being picky)
> Later, as a consultant, my first project was on some dying database system that needed to be kept alive a short while longer. In this case, I'd learned already, that you don't have to always accept your circumstances as they are. I politely complained to management that this is not what I was hired for and did not match my skills, and was transferred to a way more interesting and career rewarding project.

If it looks like a cost center, it's a waste of your time.
True, but... the shirt quite deliberately made that innuendo. It's a bit more understandable to make the joke immediately after seeing the innuendo.

Still unfortunate. But understandable.
I really like this approach - I forget CSS has native variables now (maybe it has had it for a while?) and always think of scss's $variables.
> trailblazing engines of innovation

There is a very real possibility that allowing 100% remote work could very well prevent them from being "trailblazing engines of innovation". So many things start as adhoc idea's from a random discussion that would never have happened without being in the same location.
That is certainly part of the problem, but a bigger earlier problem is voting mechanisms. Voting mechanisms put those algorithms on steroids and increase the potential for echo chambers.

Worse than that voting mechanisms reward bad behavior. They discourage replies for fear of lost karma and as a convenience to those can’t be bothered to use words whether for cowardice or ignorance.