jkeisling/hacker-news-corpus-2007-2022 huggingface dataset:
Tests with random inputs can be much easier to write. For example here's a test for a single hard-coded example:

public bool canSetEmail() {
User u = new User(
"John",
"Smith",
new Date(2000, Date.JANUARY, 1),
new Email("john@example.com"),
Password.hash("password123", new Password.Salt("abc"))
);
String newEmail = new Email("smith@example.com");
u.setEmail(newEmail);
return u.getEmail().equals(newEmail);
}

Phew! Here's a randomised alternative:

public bool canSetEmail(User u, Email newEmail) {
u.setEmail(newEmail);
return u.getEmail().equals(newEmail);
}

Not only is the test logic simpler and clearer, it's much more general. As an added bonus, when we write the data generators for User, Email, etc. we can include a whole load of nasty edge cases and they'll be used by all of our tests. I've not used Java for a while, but in Scalacheck I'd do something like this:

def genEmail = {
val genStr = arbitrary[String]
.map(_.replace("@", ""))
.retryUntil(_.nonEmpty)

for {
user <- genStr
domain <- genStr
tlds <- Gen.listOf(genStr)
} yield (user + "@" + (domain :: tlds).mkString("."))
}

Even using the default String generators, this still gives pretty good examples, e.g.

scala> genEmail.sample
res1: Option[String] = Some(뀩貲㳱誷Ⓣ壟獝鈂ᗘ䮕鹍尛斿績線孞왁궽偔ቫ﯃쥑瞴䒨䏵艥꿊狿냩쩈簋㷡泪伺鑬鮘䦚벛妹乘饡㙧ꐤ큫ᯕ肳铬呢ூ靪୒틯鏱滄㧄Ｐ莶寕상䐀鹭ᚿ㌤ᇹ䶂攔ꅥ㶓⽌ꅂ뀏뛶盏⍸㇗ɧ⇽줓嵛@퇐䎁鱎馉琿䏍㔰蘿⠶㘮큵휕炠᭑㯠ꇷ氕瑤镦碋䓯鄓헛㥝籆찷舊⸦䁜⯞௵籋㟨㨴鯅鿸刡㽴ﮈ耾刏碓辁亁ᦨ氦ব꧓ꌝ飖䒱찮刍ฤ﯉⯛ஃ颰溯쨚ই媐䄇延醴熜䢐필㉕徫澬폁횱坠줊埬າ⟂.὆蹵箅䀈떥喹뭡㘺ꐟ⯉쉂㯻牏䢺梘쭸칹总⻎恵꣥ﴈ宎嶲ꎮ쌊䯧挤ꓯ⻯ꢠ鏿㰔操駚樅졇੩풻殜ᶝ팱.瘽៣뿔뱡䞿愝滠蛊妏뷩먰⦹挸긖᩿㣽ﮀ嫶ꚸ㗃鈴䇡⋥梏ڝ晡烡.줼欺ࠞ娫 )

The other advantage is that automated shrinking does a pretty good job of homing in on bugs. For example, if our test breaks when there's no top-level domain (e.g. 'root@localhost') then (a) that will be found pretty quickly, since 'tlds' will begin with a high probability of being empty and (b) the other components will be shrunk as far as possible, e.g. 'user' and 'domain' will shrink down to a single null byte (the "smallest" String which satisfies out 'nonEmpty' test); hence we'll be told that this test fails for \0@\0 (the simplest counterexample). We'll also be given the random seeds used by the generators.
> However, carrying guns is technically legal as long as you pass a psychological, psychiatrial and practical exams, and pay for the license which renews periodically, as well as buying the gun from a legitimate source and registering it's make, model, and other details in the national database.

RAND did an analysis on the effectiveness of various gun regulations and found that background checks and mental illness evaluations were the most effect measure that can be implemented:

* https://www.rand.org/research/gun-policy.html

Add in child-access/safe storage laws, and those are the top three for reducing problems, generally.

I have no issue with private ownership of firearms, but there needs to be some kind of basic filter, because there are too many people that either (a) are sloppy with safety, or (b) have poor impulse control, to allow a free-for-all:

* https://twitter.com/well_regulated_

And that's just for ownership in private: IMHO there should be an extra filter if you want to conceal carry (CCW). Say, having a score of >80% in IPSC/IDPA.
Sorry, my comment was dumb lazy sarcasm. The joke was more around class/OOP as I read it.
Yeah but just about nowhere did XP properly, though many places claimed to in the late 90s, early 00s whenever it was the extreme hotness. It was one of those peculiar cults everyone talked up, but just about no one understood or had even read the book.

One place I was at did everything, including onsite customer etc. In context pair programming managed to stay enjoyable for the entire time and they didn't seem to have high turnover. It actually kept on feeling more productive. I was there around a year (contract). I never encountered it again so can't comment if that was sheer luck or the people (or project) they happened to have...

There was a spell when every job ad seemed to want to claim it, but basically picked pair programming and two to five of the bullets and handwaved or ignored the rest. Or merged it with plenty of old school waterfall project management, Gantt charts, random bits of UML or some other tangent. I guess I'm not surprised so many ended up hating everything around XP and pair programming as it took many forms. It made for a few surreal interviews after that one encounter of an employer who'd adopted it fully and properly.
I lived 10 years without a car and having one now is awesome. I choose to live in suburbia because I want quiet. Having a car is complimentary.

I can now purchase heavy groceries and get them home without tipping someone etc.

I exercise less but having a backyard with privacy, a car, and peace and quiet is what I want at this stage in my life.
A bit OT, but I really wish HN supported markdown in comments - with the current system, I often find it difficult to format as I intend, especially while on mobile.
> The Tesla Cybertruck and this are built by people who don't drive pickups and don't know why people really drive pickups. $125k and can only tow half of what a $30k F-150 can? For real?

Why do you think towing is so critical? The point of a pickup is that the load carrying is integral - that's what the bed in the back is for. If you're towing you don't need a pickup.
Another article: http://humanplanet.com/timothyallen/2011/03/living-root-brid...
Just to clarify - for me the San Francisco East Bay Concord area includes Walnut Creek, Pleasant Hill, Alamo, Martinez, Pittsburgh, Antioch, Danville, San Ramon, Dublin, Oakland, Berkeley and the like. Silicon Valley, San Jose, Marin County tend to be too far to make it work well.
Ok this is a great article... but what is Flockport stuff? I'm kinda shying away from Docker since their move from LXC... This looks really neat!
The transaction volume increased tenfold from 5 million to 50 million Dollars per day over the last two years. I would love to know how much of that are useful Dollars, i.e. people buying stuff and paying for services, as opposed to speculation, moving coins around for the sake of it or mining coins and selling them to pay the electricity bill.
The fact you have an opinion on what's reasonable for MS to do is fucking comical.

How much do you know of the inner workings of MS? The great internet arbiter.
The thing is, even if it's true for the one scheme I suggested, unless you know the format a password will be in you can't aim directly for that scheme, meaning you can't limit the number of possibilities that much.

I could pick a password that is "coRInStaNdr3ws19@90" which is my first name, my first school, my year of birth, and a few capitals/numbers/special characters. If an attacker knows that's my type of password then it might make it easier for him, but 'corin' isn't in dictionaries (sure they might think to find out my name and add it as a dictionary word), and I doubt "st" and "andrews" would be. Realistically, unless I give away my rough password format, they won't be able to narrow it down and will be left with a password that's just as hard to crack as if it was completely random.
What's the logic of putting 'YouTube: ' in the title yet using a URL shortener for the link?
As far as I know, you don't need releases and upgrade functionality to make use of the code-upgrade hooks. It simply works without them.

Releases and upgrades do make it simpler to synchronize what needs to be taken down in what order, restarted, left alone, etc. But simple updates are still doable without that.
No. They likely mean capitalism, as capitalism comes with politics and ideology.

Hard to generate an AI when bright young minds have their schooling, medical, public libraries, social welfare systems, to name a few, degraded beyond all repair to shave a few billion off of the balance books.

It is capitalism's endgame, much like a UFC match without a referee.
Unless of course it's Caltech, which breaks both rules.
Well, not that I get to deal with PR departments very often, but I much prefer one that has a sense of humor over one that hasn't.
So, a sort of Sapir-Whorf hypothesis for the programming domain. It certainly feels true; living and breathing a language like Erlang would probably make one think very differently about what's possible than someone immersed in Fortran.
>the argument "these words have meant the same thing for a long time" doesn't mean that the word is therefore okay to use

Nobody said that. The etymology was only brought up to show that 'man' being gender neutral is not a neologism that can be easily argued against.

I don't know why you brought up slurs at all. Using a term that focuses on a gender or race does not imply insulting anyone.

If you enunciate clearly you can probably use "negro" without upsetting anyone, and only getting odd looks for such an out-of-fashion term. Mentioning race is not where the social baggage is.
People kill game characters all the time, even when it's not part of the game. See RollerCoasters being ploughed into waiting crowds for one example. Or not being able to kill the child characters in FallOut3 for another.
How do you handle package management? I just couldn't get things to go my way. Either it worked on Windows or Mac, not both.

What flavour of Emacs are you using on Windows?
The article mostly lost me with two points:

* It claims to be a compiled language "like C++ and Java" - not making a distinction between targeting multiple hardware platforms and targeting a cozy VM.

* It ties itself strongly to the Java ecosystem.

So, I guess I might consider it in the 'nicer Java' category - and it does seem nicer than Java, subjectively - but not outside of that ecosystem.
> the other lesson from FP: overly complex abstractions are also very bad

Lisp, in its persistent failure to achieve world domination, has been teaching us this lesson for over 60 years now!

Infinitely powerful languages are fun and, yes, powerful. But as soon as the project has more than one or two people in it, they also result in runaway complexity that will hurt the product far more than any gains in expressibility.
At my firm you're forbidden from getting root access, docker is not allowed, podman is.
Before twitter, it was. I mean, there still were flame wars, toxicity and negativity, but they weren't amplified and influential as they are now. I don't remember a case where a toxic mob on Usenet ruined somebody's life. Maybe there were such cases, but I can't think of one. But I can readily name cases almost daily where the same happens with toxic mobs on Twitter. Toxicity existed before, but now there are amplification and focus mechanisms that turn it especially vile and hurtful, and twitter is one of them. And no amount of censorship will ever change any of it.
I think the issue with inequality that bothers many people includes an extra feature, how difficult it is for someone to move between percentiles of wealth. If it were easy to join the top 10% in wealth via intelligence, grit, and hard-work, I doubt many would be bothered by even deeper inequality than the USA currently has. However, if it is both difficult to move up the wealth ladder and highly unequal, it is a recipe for social unrest.
B. I've been contemplating a mechanism based on mandatory minimum paid vacation days per year - fed provides free access to the money, corps borrow it or whatever to earn some interest -- but corps must pay employees a minimum days off per year (a large amount -- like 1-2 months per year)

The value of currency and debt has diverged too far from quality of life concerns -- days off seem a direct way to inject quality of life capital into the system and, I think, could prove an investment able to unearth very new and effective social transformation capabilities ... as well as a new shared basis from which to renegotiate and rebalance our social contracts.
> Your view must be skewed by privilege of having stable currency. Currency of my country lost 250% of its value over last 7 years. It's not bitcoin-level volatile, but close to it. Thankfully I have an option to use USD to hoard money, but that option is not something that's given, in many countries you just can't exchange for fair price.

> I agree that for someone living in US or EU there's no much point using BTC.

This is quite a tenuous argument however.

First, currency is only intended to be stored for as long as necessary to purchase the necessities of life or value preserving investments. Losing 250% of value over 7 years is an inflation rate of 14% annually, a hair over 1% per month. At the end of each month you're left with 99% of the value you started the month with. That's sub-optimal but certainly not a dealbreaker if everything else were stable and functional.

The early 1980s in the US had similar inflation rates [1].

Assuming your country isn't sanctioned you could have dropped that money into all sorts of safe havens.

Further, the issue is of course transaction fees. They're about $20 each right now, and the only place those fees are palatable are rich countries with stable financial systems. In countries without stable financial systems they're prohibitively expensive. You can avoid that with Layer 2, but of course, Layer 2 offers none of the benefits you seek with Bitcoin in the first place. Exchanges are centralized, trustful and censorable.

It genuinely, truly meets the needs of nobody who isn't speculating.

It's basically the "ruined fresco" of payment methods. From a distance it looks right but as you zoom in you realize mistakes were most definitely made. [2]

[1] https://www.usinflationcalculator.com/inflation/historical-i...

[2] https://www.npr.org/sections/thetwo-way/2012/09/20/161466361...
Apart from (and also emphasising) what others have already mentioned: American English (AE) is a rhotic English accent, essentially meaning that the letter 'r' is pronounced when it occurs at the end of a syllable (whereas with many British English or Southern hemisphere accents it isn't).

The Dutch 'r' phoneme sounds similar to the AE one. Hence, Dutch English speakers will naturally sound more American even if they don't have an actual American accent (which might indeed very well be the case due to said influence from American TV shows).
Google public shares are class A and class C. And because the world is upside down, the class C shares which don't vote trade at a slight premium.
Oh cool, can you eat it?

How about 95% of economy: education, houses, food, heating, electricity, fuel? What about industrial goods: Bricks, steel?

But oh, you can now live in poverty unable to afford cancer treatment with a TV.
What I wonder reading that article is what freedoms people like Thiel perceive are missing from his life - he is successful, immensely wealthy and living in what most people would regard as a free country.
I agree that it would be a little cleaner, because it would express the intention better (the fact that you're simply giving out the same error). However, the type would be wrong:

Yeah, this is correct. This would be wrong:

func map<U>(f: T -> U) -> Result<U> {
switch self {
case let .Value(value):
return Result<U>.Value(Box(f(value.unbox)))
case let .Error(error):
// self is Result<T>, but the return type must be Result<U>
return self
}
}

As for efficiency: like you mention, enum are value types. For this reason, they're passed by copy! So even returning self would return a copy of self, not the same instance :)
The Mac App Store is a ghetto. It's completely neglected by Apple. I'm not sure who they imagine to be the target audience -- maybe it works for mobile-style game experiences, I wouldn't know, but it's certainly no good for professional apps.

Important issues with sandboxing were never resolved. Meanwhile existing APIs keep being moved to the restricted list, so as a developer you can't even count on your product being able to stay on the Mac App Store.
I don't know the answer to your question, but even if we assume it is. Why do you ask? This is just one of many tradeoffs between the two languages. Do you think the number of lines of code is particularly important in this case for some reason?
I don't entirely agree with this.

There's a lot of low hanging fruit, especially in languages like C and C++, where a slight code modification can make a difference in run time, with zero impact on code readability. Here's one example:

Using:

size_t len = strlen(myString);
for (int i=0; i<len; ++len) { ... }

Over:

for (int i=0; i<strlen(myString); ++len) { ... }

The second for loop is potentially O(n^2) because strlen needs to scan the entire string every time through the loop, where the first for loop computes strlen once. It's possible the compiler can optimize so that only one strlen is used in the second case, but it's not guaranteed. Probably it doesn't matter, but it will start to slow down once this function is called with longer strings and/or inside tight loops.

They're almost the same, so why ever use the slower one?

And C++ is even worse with destructors and copy and move constructors being called all over the place for people who aren't careful.
There were several different leaks or attacks from multiple actors, one of which has signs of being an inside job, but not all do. I recommend reading this analysis of the events for one perspective on the complexity of the situation: https://np.reddit.com/r/worldnews/comments/2puo8h/bittorrent...
I'm not nearly as convinced that 'franchises' are a bad thing. Certainly, there's some serious cash cows there, and some of the franchise movies are mediocre movies. But they're no more or less mediocre than the all-original movies that filled the production slots before them. There's about a hundred movies released by the major studios a year; How many can you name from any given year? Five? Ten?

What franchises represent, to me, is the new search for continuity. The world is changing faster, relationships are getting more tenuous. Moving around, finding new friends, new places to hang out and eat and drink and be merry; All these things have been enabled by the internet and the sharing economy. I moved to a new town about 3 months ago, I eat out every night and I've eaten at precisely two places twice: A korean joint I like because it's named for Psy's masterpiece, and an indian place a former coworker recommended. The rest of the time, I've been trying new things, searching for the 'perfect' meal, never satisfied. In this search for novelty, something has been lost.

There's a reason why you see so many tumblr handles of the form 'harrypotterlover21' and 'twilightfan32'. People identify with these stories and universes, and find their sense of connection and emotional stability with them. It's no longer specific people that you have a connection with, but a grouping based on a shared interest; perhaps one that belies a mindset?

It ties into, as well, the current trend of TV shows to be long-form entertainment. We want to see characters grow and establish themselves. 1 1/2 hours isn't long enough. 3 hours rarely is. Franchises allow stories to be told iteratively. That's a good thing for movies and art. There's nothing special about the traditional runtime for a film that makes it more artistic; that's just how long humans are willing to sit down and focus on one thing at a time.
The fact that componentDidMount only gets called on the client seems like it would make it a good place to hook up progressive enhancement after rendering a basic isomorphic version on the server (e.g. a <select multiple> which you enhance with dynamic features only when JavaScript runs on the client) - for server rendering, it would be too late as you only get one render and need to do everything up front.

I've been playing [1] with isomorphic forms using react-router - it uses a static willTransitionTo() hook on the constructor of components which do route handling for the equivalent of request handling, which seems to work well in the limited cases I've tried so far.

For API requests, you can use a request library which has the same API on client and server - superagent and axios seem to work well.

[1] https://isomorphic-lab.herokuapp.com/addthing
Was Ruby a dependency of the prior version?
This is just some writer who could easily do her job in a cave. Collaborative efforts require as few barriers to collaboration as possible. Some of us like to participate in things that are larger than we might be able to facilitate entirely on our own.
+1. If the cool kids don't want to listen to you in school, don't whine, find something more interesting to say to them.
This is true for every app in the list except Matrix, which is distributed.
I feel like this is only possible once the product and product-market fit have been established; the fire has started burning on its own and you can start stepping back and just stoke the fire
No, I’m saying don’t call CRAN a “threat to reproducible science” and then make your solution a CRAN package
Good point. The inconvenience to other is probably what i was worried most about but that is probably more their problem then mine
There are actually dozens of arrests and plenty of evidence, self incriminating evidence floating around the social media. It remains to be seen what the outcome of these arrests will be. If they're arrested and let go it would be indeed weird and inviting for more of this in the future.
Ranked-choice voting. The two party system causes this weird sports mentality where people vote for the jersey/party rather then a candidate that actually represents their views
> all the other mass media outlets

All? C'mon.

You can make the argument that MSNBC is a mirror of Fox News in terms of coddling its viewers, but if you're calling NPR or the New York Times "fact-free," you're only betraying your own ignorance of journalism standards.

Investigating facts and reporting them clearly is a solved problem. There are people who go to universities to study how to do this well, then go to work for institutions committed to doing this well. Their words should be treated differently than the words of some idiot with a Twitter account or a personality on an infotainment TV show.
Video is a terrible format for anything requiring the reflection and nuance of politics. People need to read at their own pace, stop and make their own judgements, and re-read parts to make it all make sense. Video is a firehose that keeps attention instead of letting you _think_.

Leave it for entertainment and deep documentaries. If we had no more news channels and nightly programs, I think we'd both be happier and better informed.
TL;DR The founder of Gumroad fired all his employees and replaced some with and rehired some on contract.
Gumroad does not provide benefits like healthcare.
Your hourly rate gets cut cut in half after you work more than 20 hours a week.

The article is a nice way of saying that the founder largely just collects rent while putting minimal resources into the business.
No, you're not alone. For lunch I drive to the park, eat my sandwich while listening to NPR, then get out and go for a solitary walk in nature. It's a lot more refreshing than sitting and talking with the same co-workers I share the rest of the day with.
Unless you can show me a "property right" under a scanning-tunneling microscope, I submit to you that they're an arbitrarily-defined concept. And as such, it's not "sophistry" to assume one definition of the concept, and proceed from it in a series of logical steps. In this case, the assumption is that the law creates the property right, and the law can take it away, under certain conditions. That's the "forfeiture" part.

"Corruption" refers to when a public entity doesn't follow its own rules. Following a self-consistent set of rules, the premises of which you reject, is not corruption.
It should open outward, not inward. Then, it takes up zero space internally, and even provides a sun-shade awning when opened.