skysight-inc/HackerNews huggingface dataset:
> For example, a map should normally return an Optional<ValueType> when you try to retrieve a key's association. However, there may be special cases where you know that a key is present (maybe it is a constant map, maybe you just set the value of that key etc).

Both of these cases are still pretty big code smells.

1. Just don't use constant maps. Instead of doing this:

const myConfig = new Map<string, int> {
"height": 72,
"weight": 160,
};

[...]

var height = myConfig["height"].matchOptional(
ifNull: () => 0,
ifValue: i => i,
);

...use a constant structure (with an anonymous type):

const myConfig = struct {
height: 72,
weight: 160
};

var weight = myConfig.weight;

You can verify whether height or weight are null at compile time this way[1].

2. If you just set the value of the key, instead of doing this:

dictionary[word] = getDefinition();
let definition = dictionary[word].matchOptional(
ifNull: () => "",
ifValue: d => d,
);

...do this:

let definition = getDefinition();
dictionary[word] = definition;

I'm aware that I'm playing fast and loose with the syntax of our pseudo-language, but note that avoiding the optional will is terser and simpler than using the optional and eating the null case--this is true in most cases in most strongly/statically-typed languages. Not only do you learn to lean on the type system in a strongly/statically-typed language, but if the syntax is well-designed, it makes it easier to lean on the type system than to not lean on the type system.

[1] You may say, but what if I'm loading from a file? The common pattern is to load a config from a file as a map, and then load it into a struct, setting defaults, like so:

const defaultHeight = 72;
const defaultWeight = 160;

JsonObject configJson = json.loadFile("config.json");

const config = struct {
height: configJson["height"].matchOptional(
ifNull: defaultHeight,
ifValue: v => v.asInt(notInt: v => throw Exception("Invalid height \"{}\" in config.".format(v)))
),
weight: configJson["weight"].matchOptional(
ifNull: defaultWeight,
ifValue: v => v.asInt(notInt: v => throw Exception("Invalid weight \"{}\" in config.".format(v)))
};

You eventually hit cases with user data where you can't handle it (hence the throwing exceptions) but this pattern allows you to fail early, and with descriptive error messages.
This analysis is definitely wrong, it's discussed in textbooks too. You need to seriously, properly consider the risk of the investment, and if your model of the stock price is that it gently drifts with the market while yielding 5%, then that's just wishful thinking on your part.
The U.S. Government funded smartphones which come with pre-installed malware
As usual with code principles/guidelines, it's about knowing when to apply them, and how much to apply them. In the particular scenario discussed in the article, I think the better option would have been something in between.

I think most devs go through learning phases with code guidelines, code patterns and the like, when they first hear about them, actively trying to crowbar them into every line of code, even if it results in more complex code - because they treat these things as laws, rather than guidelines.

IME, good devs eventually grow out of this, and from experience are much better able to apply guidelines and patterns when it's "suitable" to do so.

This problem is sometimes exacerbated by management, who like to focus on metrics. For example, a project I recently worked on used SAST (SonarCloud), with all sorts of arbitrary restrictions enabled: less than 3% duplicated code, minimum 90% test coverage etc. Predictably, it helped make the code more complex than it needed to be, and led to mock-heavy unit tests that didn't seem to actually test anything - they existed only to satisfy SonarCloud (and ergo, management).
That's pretty neat: https://space-invaders.com/flashinvaders/
No, the millions is not backed by bonds. It is a complex topic, but Brazil stopped their inflation by issuing a new currency and implementing price controls.

Much of economics depends on expectation, there is nothing inherently logical about any of it.
Unsliced cheese is dangerous - that's your argument?
Doesn't Lyft know the real names of these drivers by the time they're on the road? If people are offended by other people's given names then they're the ones in the wrong, not the people named "Dick Cummings".

When are we going to grow up and realize that the mere appearance of words like "dick" and "cum" don't hurt anybody?
The ocean cleanup device is absolutely terrible for floating marine life.
And then leave.
from the tweet:

Simple message of "plastic = bad" that can lead to complete plastic bans has potential to backfire & create larger env impacts.

Because:

– food packaging is important in preventing food waste

– plastic alternatives can have larger environmental impacts.

Links:

https://www.bbc.com/news/science-environment-51040155

https://ourworldindata.org/faq-on-plastics#are-plastic-alter...

2018 article:

https://news.sky.com/story/amp/plastic-doesnt-reduce-food-wa...
Write what you don't know
Or maybe make it easier, less annoying to use.
Dark Patterns After the GDPR
Weight, there is an inverse relationship to lift for single wing (*copter) crafts. Once that dji lands, the drone would need to add power which either it doesn’t have or will kill its battery before ending its mission. The DJI won’t know the direction the drone is going so it can’t “add lift” in a meaningful way. Also you have no idea of the blade configuration and you may not even be able to land atop these things!

A better option is to outfit the DJI with a thermal or nightvision lens and have it track the drones. Also a DJI is probably a bad choice if the drones are industrial in nature and larger than the DJI (thus faster and longer lasting power source).

I’ve thought about being that rogue drone operator for 5 years now, but the one thing that always stops me is forensic analysis. Shoot one of those drones down, do some part analysis to see who manufactured it and when, where it was sold etc and you whittle your search area down to a few thousand people. Not hard for the FBI/DHS/FAA/FCC to figure out who you are. Let me say this differently, if this where a question of national security the drone operators would be found within days
In the eighties and before this did not seem to be a problem.
How to Build a Command-Line Tool with Node.js – A Step-by-Step Guide
> does that seem fair

It seems the very definition of equitable.

(That said, I do think that the restitution amount can be adjusted, and courts do that. I object to the idea that 0% is appropriate.)
std::map and std::set are famously terrible, for that reason: https://youtu.be/fHNmRkzxHWs?t=2695
That's good, but that's arguably lower-level than httpx.
Ok, but web?
Uncertainty is absolutely key everywhere decision making has an impact on human lives.

Detecting if we see an expresso or a cappucino, sure fine.
But uncertainty on a CT scan would be extremely valuable just to avoid people (even trained professionals) falling into the common bias of trusting the output.

Say the model outputs 90% chance of nothing, 10% chance of a deadly condition that needs to be investigated ASAP. Doctors are often overworked and tired and can miss it. Knowing where the certainties and uncertainties of the model lies would allow the doctor to compare that to its own training "Ah but it didn't at all judge based on X and Y" and limit decision machine based on "trusting the algorithms".

This is a similar problem that rating system based on just a number of stars are facing, you need to read the comments and the why just to filter out astroturfing.

Coming back to ML, this is why I think more emphasis should be given to LIME [1], SHAP [2] and also Microsoft's Explainable Boosting Machine [3] which ironically is not a gradient boosting algorithm but a Generalized Additive Model (i.e. like GLM but Squared instead of Linear)

[1] https://github.com/marcotcr/lime

[2] https://github.com/slundberg/shap

[3] https://github.com/interpretml/interpret
Corporations give private citizens power they should not have over their neighbors in a democracy.

HR can filter at mass, keeping people from work they enjoy. Advertising has social agency warping effects. And at scale we spend our time prioritizing paid speech. Policing valid speech at scale is how authoritarian states work.

“This is how you view the problem, how you design the solution, and how you speak to people. Or you don’t get to have shelter & eat.”

Sir, yes sir.

“Profits (or some other ideological target) must go up this quarter!”

Sir, yes sir.

Not allowed to truly question what happens if AI that can schedule hair appointments isn’t developed. Computing/engineering effort we know is destined for the bin as hardware changes. Seems economical.

That’s hardly a behavioral model for a free society.

Nah sorry. We have friendly oligarchs, and looking at Google’s shifting culture and the Amazon warehouse situation that’s been going on for years... very superficially friendly.

Political power is emotional. It fades generationally as people retire, or we could term limit officials.

A big enough pile of dollars means you can generate more faster than you can spend what you need to in order to stay on top.

Ownership is the root of political theory in America. And a smaller and smaller group really own anything.

And the powers that be know that: they’ve read it in academia’s papers and philosophers notes. If the public took ownership of the manner of production (IMO themselves not factories) and stayed home for a week, politics would be shifting real fast.

We keep looking at history to learn about us. Is it any shock we keep developing top down authoritarian structures when we’re casually fetishizing their previous existence? What was becomes hard to look beyond when continually referencing the material. Wonder what humanity could look like if future people read about past people living differently.
JavaScript Map Function Explained – A Deep Dive
I constantly see devs applying DRY in ways that conflict with the “single responsibility principle”. It’s like they just stop at DRY because it’s a simple concept to understand and relatively easy to defend . I’ve seen people essentially labeled as heretics for suggesting that DRY (and any other SOLID principle) should not be blindly applied to every piece of code.
Strange, the story has been quite the opposite for me, Since I moved to Arch Linux I only had one minor breakage (bluetooth) that was fixed in a day, whereas in Ubuntu I cannot count how many times an update or a PPA broke something.
Having several office locations is a downside: It impairs communication, collaboration, and maintaining a single culture.

IMHO there are two valid reasons to multiply locations (apart form having tens of thousands of employees): (1) acquisition of another company, and (2) expanding into another geographical market.

But do avoid multiplying small offices.
Many 50's and 60's movies that covered many Sci Fi aspects we reinvented time and time again. Actually most of those involved invaders from space, so expect the term "space invaders" got used in many a movie line by the local towns foke - though I don't believe IMDB allows you to search film scripts, that would be cool.
I'm hopeful about Crystal filling this niche in the future.
Outsystems is superior than any of these.
Even in landfills, plastics pollute water and soil via phthalates and Bisphenol A.

https://www.unenvironment.org/news-and-stories/story/plastic...
I challenge you to find a C “boot camp.”

In fact doesn’t this point to a gap in the marketplace? Where are my “IOT ALL THE THINGS / 5G / Edge” bootcamps? Where are the “leetcode” challenges that talk about proper sampling rates for an 8-bit A/D converter, or implementing a closed loop PID in a 16-bit architecture?

I suspect that that’s what the Grandparent comment is commenting on — there’s so much talking about the former and so little talking about the latter - even if every computer engineer graduating from a ABET-certified institution is these skills.
"How I now make 2x/month by posting a thread about how I make x/month"
In my experience with biglaw (a single top 10 firm), their IT and in particular information security was top notch. Having a lot of available capital to work with probably helps.
RHEL and CentOS are not targeting the same users as Arch.

Distros targeting the same desktop needs are Ubuntu, Mint, Debian-flavors, Fedora, Gentoo, ...

In corporate environment for critical software you would get a contract with an on-call duty and you would only have a limited choice fo supported distros.
If you're not interleaving insertions and lookups, then a sorted vector can be really good.

If you need to interleave insertions and lookups, but don't need to traverse in sorted order, then a good hash table (not std::unordered_map) is normally the best option.

You only need a tree if you need traversal in sorted order and interleaved insertions and lookups, which is pretty uncommon. Even then you are almost always better off with a B-tree than a red-black tree.
How could they compare Apple to a "liberal China"?

That must be insulting to employees and users alike, but also everyone who appreciates capitalism.

The writer should have their head examined.
Samsung’s removable-battery smartphone is coming to the US for $499
“When enough of us act as consumers not to buy polluting products, producers will respond to products not selling by producing less.”

This argument bothers me a great deal. It takes a simple solution (regulation) and turns it into a complicated distributed solution (convincing the majority of consumers to make the right decision) prone to disinformation campaigns, green washing, confusion, and simple lack of attention.

We have governments for reasons. This is one of those reasons. They need to do their job and stop using our behaviour as an excuse for inaction.
> For instance I will never understand the people who buy plastic-wrapped pre-sliced "salami"

Well, if I don't buy it presliced from the butcher I always buy packaged presliced milano salami, because it's nearly impossible to slice it thin enough with a knife. There is also not really a difference in quality. Both products are imported from Italy anyway.
Google Stadia even works on an E-Reader [video]
To me, clean code is a separate concern from coherent interfaces. Your change changed the interfaces and although I don't have deeper context, I personally prefer the simpler original interface. Have good interfaces first, then use clean code principles to handle implementations
The OP mentioned companies play a kingmaker role by owning the platforms on which elections are won and lost. The implication is that they can directly and disproportionately influence the government, such that the government is their tool and not the people’s tool, as in a bonafide democracy.

The question isn’t whether the government or corporations have more power, it’s whether corporations or the people control the government and in which proportions.
Linear Logic and Permutation Stacks – The Forth Shall Be First (1993)
Cool resource! I just started down this path as a strict requirement for my next career move. It would be awesome to include job listings and requirements for people that want to find a job at a climate focused company.
A real effort to protect the information related to users using a website or webservice is not a trivial effort. Extensive re-architecture and forethought is required in order to fully comply, or at least that's the amount I estimate it would require to be fully GDPR-compliant.

Small firms won't be able to take on the cost, which will hurt new businesses.
The notional constitutional safeguards of states become eroded over time (n.b., interstate commerce, mass data collection) and the overreach of states is more potentially damaging to its citizens than getting locked out of a platform on which you built a business.

States are not meant to be corrupt in this way, and have several avenues for reform by will of the people. Companies benefit from a dictatorial stance, and therefore the only effective recourse against unjust treatment is partial or total destruction.

>Political power can be spent over and over. Dollars can only be spent once.
Credit is a thing.
Going to jail isn’t one of the main risks of being a CEO of a company like Boeing. It certainly shouldn’t be a likely one if things are being done correctly.
What here is disputing the above comment? Is OP from Asia or something?
Brin and Page’s early views on advertising
Race is not a uniquely American concept. The Germans were the ones who first came up with the idea of a Caucasian race back in the 18th century. You're not wrong though, we should use White European instead since that's what it means today.
I’ve never heard of this. Why?
We need a law that bans all single use plastic. We should only allow one or two forms of plastic that are guaranteed recyclable and make everything else compostable.
Here’s an interesting 2019 New Yorker article about Ocean Cleanup

https://www.newyorker.com/magazine/2019/02/04/a-grand-plan-t...
We really like 'hard' cheeses and hard is literally rock hard. Getting it sliced is practical. Even adults have trouble slicing cheese that hard themselves (I can do it, but then again, I used to run a metal workshop ;) ).
> You haven't contributed to the basis of what other coders used.

What fraction of us can claim they have, really? Most developers work at the application layer, the last one. The more foundational your stuff is, the less of it there is, because it is reused everywhere.

For similar reasons, very few people work on massively popular software. Most work on software that have only a couple users, or even just one (typically one corporate user). Very few people are famous, because fame is fundamentally scarce.

Implying that every programmer worth their salt should have produced code other programmers use is just not realistic.
> seeing your code being rewritten after a week is no fun, and it's a huge blow to your confidence as well.

The people doing the rewrite benefit from your work though. They might would have done the initial writing "worse" than you did.

It is good to have fresh views. I agree it is good to communicate, too.
If you wish to read it that way you are welcome to.
Internet of Things devices require companies that offer value through longevity. That’s why you need to look at an IoT device that calls home as either a short term investment (cheap) or we if the company has a viable exit strategy to be bought by a larger org. I think new companies will only thrive where there is innovation possible. That rules out most eavesdropping devices (Amazon) and video doorbells are pretty much owned by the big boys.
You may do many things right in the US, except the fact that you still rank the countries into first, second and third!
Seattle public library has a cafe area that I thought could be turned into a bar/dance area at night also...
Hey, cool idea! A couple questions:

1. How will blatta behave if we have Intercom or Drift already in use on a site, will it sit nicely side by side or cause UI issues? Also, sometimes sensitive information can be reported in bugs, might be good to mention how you handle sensitive info on your site.

2. It would also be nice to add this into apps as a URL link (for me I mostly build apps, so I could use an app focused version of this). Is that something you're thinking about?
Understanding Neurotypicality (2006)
Bad PR for Spectrum is likely nothing new.
The Power of Defaults
Wow, what a fantastic resource. Thanks for sharing!
Indeed.

Although doing nothing at all would also be much better than invading a country and causing the deaths of more than a million people.
Go 101
In the eighties and before people cutting themselves while cutting hard cheese was pretty common.

Just like you can cut your meats yourself, you can slice your bread yourself and so on this is mostly a convenience, but in case of hard cheese if you've never tried slicing Old Dutch you maybe should try it first.

Even the stores can have trouble slicing it. Anyway, no need to take my word, just buy some if you can and give it a shot, and let me know how it worked out. Using a cheese slicer isn't going to work either, you'll need a very sharp knife and a steady hand and it will take a lot of force.
I'm guessing the answer is you've gone vegan, but I gotta ask... eggs, milk, cheese and meat? how do you do get them without packaging?
I think a better process is to discuss with the other dev, talking through how you think it could be improved. They (or sometimes you!) can learn something that will lead to improved in the future.

It's a bit like that analogy about giving a man a fish vs a fishing rod.
Low unemployment isn’t worth much if the jobs barely pay
> I think we should reflect more deeply about spaces, and how modern society is losing them. nowadays, practically every exchange involves money, products, services. if a space doesn't make sense in an economic sense, it tends to disappear.

I agree. This article parallels a discussion I've been having with some friends lately...

If you're interested in being a part of that reflection, evaluating how technology helps or hinders us from forming more meaningful relationships, I'm gathering a discussion group online specifically to answer these sorts of questions. It's called VC3 (https://vc3.club) and our sole goal is to have an intellectual conversation in this area. If this interests you, we would love to have you along!
Chinese court rules...

Do any of us have any clue how Chinese copyright law works? It's probably not the same as American copyright law. What are the requirements set out by Chinese law to be copyrightable?
>The monkeys will ruthlessly suppress any evidence

Yeah, I would even say that from the following part "are inconsistent with Boeing values, and the company is taking appropriate action in response."

The Monkey will fire the clown, while still being employed and probably not being hold responsible for the shit they have done.

Management liability at its best.
How to Startup Founders finance the transition between employee and Founder?
There are lots of blogs, articles, and posts giving advice for early-stage startups, but I haven't seen any that provide insight or advice into how a Startup Founder financially affords to make the leap between employee and Founder.

How does a Founder who is currently employed by a company, with rent, bills, a car, and some debt finance the leap? What happens directly after they quit their job? How do they have the money to lease office space and keep up with their other financial committments? This is an important question to me because it's also relevant to Co-Founders.

Surely the answer isn't "The founder must be financially independent and have savings", "The Founder resigns to a life of semi-homelessness and poverty", or even "The Founder works full time despite potential legal IP issues with their current employer, works every spare minute they have, then launch a MVP until the fledgling company brings in revenue enough to pay themselves a living wage"? How does the common Founder, who exists in a normal world with normal worldly constraints, make the financial leap to being an independent product owner?
I was a FreeBSD desktop user for many years, but lack of Docker support was one of my drivers for switching to Linux. Being able to run containers without a random Linux VM is just so much easier. Linuxulator sort-of did that on FreeBSD for a while but it just wasn't maintained and just rotted.
Yup. The street bazaar in Amazon is quickly turning into a hawkers market where you have to know you’re buying a fake Rolex and negotiate accordingly. The problem is that no one in the general public knows this.

A cursory glance around AliExpress shows SD cards with “decorative” labels - and straight up fakes. The problem you get is that any joe blow can buy from Ali- resell on Amazon or elsewhere - and be truthful in saying that he was trusting his seller.