skysight-inc/HackerNews huggingface dataset:
Generally the enum vs polymorphic class debate is actually a subset of a better known trade-off between OO style inheritance and FP style use of sum types.

The trade-off is between ease of extension in two cases:
- adding new types to the sum type / new subclasses
- adding new methods that can operate on all types / subclasses

In a classic OO design, it's easy for any client to add new subclasses that implement the same API as the existing classes. However, adding a new API means that all subclasses need to be changed.

Conversely, in an FP design, adding a new type to the sum type (a new enum value) means that all places pattern matching on the sum types (switching on the enum) need to be changed. However, adding a new operation that works with the existing types is trivial.

To give a more specific example, let's say we want to model an expression tree.

An OO design might look like this:

abstract class BaseExpression {
abstract evaluate()
subexpressions()
}
class SumExpression extends BaseExpression {
evaluate() = map(evaluate, subexpressions()).Sum()
}
class NumberExpression extends BaseExpression {
int x
subexpressions() = [x]
evaluate() = x
}

An FP design might look like

type ExpressionTree a = SumExpresssion [ExpressionTree] | NumberExpression a

evaluate :: ExpressionTree a -> a
evaluate SumExpression xs = sum map evaluate xs
evaluate NumberExpression x = x

subexpressions :: ExpressionTree a -> [a]
subexpressions SumExpression xs = map union xs
subexpressions NumberExpression x = [x]

Equivalently, an enum based design would have

enum ExprType {
Sum
Number
}

struct SumExpression {
ExprType
*void[] Subexpressions
}

struct NumberExpression {
ExprType
int x
}

evaluate(e) {
switch(e->ExprType) {
case Sum: (SumExpression)e.Subexpressions.map(evaluate).Sum()
case Number: (NumberExpression)e.x
}
}

subexpressions(e) {
switch(e->ExprType) {
case Sum: return (SumExpression)e.subexpressions
case Number: void*[]{(NumberExpression)e.x}
}
}

Now, if we want to add support for MultiplyExpression, in the OO program we add a new file and we define evaluate() for MultiplyExpression. In the FP program we have to modify the definitions of ExpressionTree, SumExpression and NumberExpression.

Conversely, if we want to add support to print an ExpressionTree, in the FP version we just add a new function in a new file and describe how to print each type of ExpressionTree. In the OO program, we need to modify the implementations of each existing BaseExpression subclass to add support for printing.
Probably "not much".
While "keep right except to pass" is technically the law here in Ontario, the de facto standard is that the middle lane is the cruising lane, the left is the passing lane, and the right is basically a second merging lane. This means that it is not uncommon to have stop-and-go traffic in the left two lanes while the right lane is still moving and mostly wide open. Drivers will frequently move right into the middle lane from the ramp even with no traffic in the right lane and not having sped up to the highway speed. It's an complete waste of resources.
Record companies and artists selling their sample stuff for millions and the original artist who made that drum solo got nothing, dying homeless in 2006.

If we worry about piracy, we should worry about this stuff too.
Yeah they're wonderful for that.

Very much like Elm (and/or Haskell). Our whole iOS architecture is inspired by the Elm architecture – it's a pleasure to work with, and Swift the language makes it feel really at home.
Design patterns are often heavily weighted towards the languages in which they were devised and don't generally apply.

Lots of the classic OOP design patterns are because Java/C++ is very rubbish.
If you made this into an open source project (even just some hacked together scripts) I would definitely take a crack at helping tweak it! Especially if you're able to do on device -- that'd be incredible. Otherwise, I'm happy to just pull out the files and do it via SSH.

Seriously though, the value of some scripts that set a baseline would be enough for many people to finish the rest of the work!
How to get a reputable service for commercial cleaning in Etobicoke?
Cleaning can be a complicated task, but mainly it can be very time-consuming. And, doing it regularly can take a huge chunk of your schedule while keeping you off from your other routine tasks. But, why should you do it daily when you can make sure months-long cleaning in only one day? Yes, you read it right, it is possible if you find the best Cleaning Services in Etobicoke. After that, you will not have to worry about this task for more than a month as it will wipe the place perfectly clean.
Slightly off topic, but what happened to "smart pens"? 15ish years ago,I had a pen that could draw on special paper, and do interesting things. I really thought that paradigm would have progressed by now. Sort of like the original optical mice needed a special pad but now can work on any surface. I like drawing on a paper notebook (I use one with a grid of dots). I'd be fine with all of the "intelligence" coming from my smartphone. Is there any progress/products on this paradigm?
Biometrics are not secrets (it must be assumed that attackers always possess all biometric data), but they can nevertheless be a good form of authentication when combined with situational awareness. If you try to use one of these hot glued fingerprints in front of a security guard, it isn't going to go well for you.

At the moment, humans are still necessary for situational awareness, but probably machines can get there pretty soon. A phone, for example, that monitors its surroundings continuously and has enough intelligence to reliably distinguish normal access by its owner from duress or the presentation of fake biometrics seems like it's within reach of current technology (though it doesn't actually exist).
(ignoring the recent move to a subscription service) The problem is you cannot tag pages for easy/effective search.

If they would add meta tags and make pages searchable by that, it would be 100% perfect.
He’s already going to college & sounds like he’s got a support system to finish. The poor financial choice is dragging it out.

He doesn’t need to go to Stanford and take out $250k loans. Cal State Long Beach is $3k per semester & financial aid or taking a campus job can reduce that further (https://www.csulb.edu/student-records/tuition-and-fees). I assume schools in other states are even more affordable.

That said, you may be right. I don’t know enough about his unique situation & goals.
Your line of questioning gives me the shivers, because it applies equally to humans. You might be intellectually aware that you're causing someone to suffer, but - unless someone else is watching - why should you care?

You say you're "not talking about morals" - what, then, are morals?
A short-list of short, grokkable, & influential CS papers
Most places I see runtime type checking, is when checking the type of incoming data, aka, Json, or if the function is a library and you are helping the callers use the correct types.
Go/java, etc all do this by default. You read an int from a in memory untyped object, and you get an error if it's not actually an int.
Exactly. This video makes that point so crystal clear: https://youtu.be/dqQw05Mr63E

Car-dependent suburbia is about imposing your car on everyone else while not allowing anyone else to impose their cars on you. It is inherently selfish city design.
Try "bread" and "fire" :)

Yes, as another user pointed out, they are part of the Google Android Keyboard.

https://news.ycombinator.com/item?id=29305546#29305835
I second this idea, if money is the main motivator. Technical colleges are cheaper than universities, and can be completed faster. They will still likely require a GED, though, prior to graduation if not prior to entry.
Really depends on the individual countries. Some countries subsidize the tracks for everyone (including freight), others just the passenger rail companies. Heck, in the EU there's even quite a few open-access operators who are fully for-profit.
Extracts from the LSE report summary:

Recommendations relating to specific commercial practices

- Declawing. We have high confidence that declawing (removing one or both of the claws from a crab before returning it back to the water) causes suffering in crabs.

- Nicking. We also have high confidence that the practice of nicking (cutting the tendon of a crab’s claw) causes suffering and is a health risk to the animals.

- Wholesale and retail. We recommend a ban on the sale of live decapod crustaceans to untrained, non-expert handlers.

- Stunning. Current evidence indicates that electrical stunning with appropriate parameters for the species can induce a seizure-like state in relatively large decapods, and that stunning diminishes, without wholly abolishing, the nervous system’s response to boiling water. We interpret this as evidence that electrical stunning is better than nothing.

- Slaughter (decapods). We recommend that the following slaughter methods are banned in all cases in which a more humane slaughter method is available, unless preceded by effective electrical stunning: boiling alive, slowly raising the temperature of water, tailing (separation of the abdomen from the thorax, or separation of the head from the thorax), any other form of live dismemberment, and freshwater immersion (osmotic shock). On current evidence, the most reasonable slaughter methods are double spiking (crabs), whole-body splitting (lobsters), and electrocution using a specialist device on a setting that is designed and validated to kill the animal quickly after initially stunning it.

- Slaughter (cephalopods). Various different slaughter methods are currently used on fishing vessels in European waters, including clubbing, slicing the brain, reversing the mantle and asphyxiation in a suspended net bag. We are not able to recommend any of these methods as humane. On current evidence, there is no slaughter method for cephalopods that is both humane and commercially viable on a large scale.
Python enums with static type-checking via Mypy are pretty pleasant, though.
> why can't we just pass around CAD data to feed CNC machines?

CAD data for products like Fusion360 or SolidWorks depend on a geometric modeling kernel, which is a complex piece of software. To do anything with that data, you need to run the kernel, and you need to run it the same way the software package does. While there is an open source kernel (OpenCascade), it's not as fully featured and in any case not compatible as the industry leader Parasolid.

To use CAD data in a printer or CNC, you'd possibly need to pay a license for the kernel, but also have the exact version available and therefore dozens of versions for compatibility, you'd have to support and debug running all those complex kernels, handle compatibility upgrades, have enough storage CPU/RAM/disk and so on. And then subtle bugs in different versions/kernels would result in different results. Imagine the support nightmare.
I am pretty sure whatever you used to type this message in has a lot of Chinese parts.
Easy...

Create something public in the area that you're interested in your new career. This will show a level of expertise in it. That level could be a neophyte or an expert, or anywhere in between.

Even if you know nothing, the sheer effort of creating something means that YOU are a person that knows something about whatever it is you created. I remember when I did not know regex. Not a tiny bit! But I remember the day someone saw a PHP program I wrote to parse something and savaged me online and so the next day I learned regex.

I've never forget that day I read that comment. But if I did not write that overly complex PHP 200+ LOC PHP code (that could be replaced with a short single line regex), and put it online, I would have never known what my problems were -- and would never become an expert at writing regexes.

Making what you're doing online public -- that's the key. That act forces you to actually get better. It's one of the more powerful acts you can do in your life -- and that's what makes the internet so powerful these days.

If you're not brave enough to do that, then continue doing what you're doing now. It's honest work and it pays the bills.

Right?
Byte Information Exchange (BIX) and CompuServe were also good online resources in the pre-Internet era.
That's clearly a stroad. 1,000 feet away from where you linked to are shops and restaurants.
This should not be news to anyone. Chaos Computer Club demonstrated almost the same technique in this 2006 video https://www.youtube.com/watch?v=OPtzRQNHzl0
There's literally 20 jobs open on Indeed right now in Indy for electricians helpers, which is basically the step to apprenticeship. Same for other trades. You don't need a school, just go do it. It's hard work but you can go out and get a job today that will lead you there. You might need a GED but it's literally just a test, go take it.
Explaining Bitcoin so you can understand it
> * Have you already had and recovered from covid giving you far superior immunity than the short-term shot-based immunity?

This one is fair

> * Are you likely to encounter covid if you rarely encounter many other humans in a rural location?

If you never leave your farm ... I don't care. If you tend to mingle with other people even sometimes, I'd already consider it pretty reckless.

> * Are you someone with high-risk of covid complication or not? That is, are you fit and healthy and young or old or fat or sickly?

This one tires me out a bit because it's been a pandemic for a while now, but it's not only yourself you are protecting by getting the shot.

> * Do you encounter regularly people who are more vulnerable like grandparents or fat people?

Again, even if you sometimes encounter vulnerable people, you should go ahead and get the shot. What exactly is the measurement here? "Oh, I cross paths with a maximum of five old people and eight overweight people a month. That's too little to care about."

IMO, all points following your first one are not good reasons to not get the shot.

Regarding the "less personal concerns", how many more shots does the rest need to get for people to stop screaming long-term safety data? Do you honestly believe that only a fraction of the people wanting to see the "long-term studies" have any idea how pharmaceutical developments usually function? What constitutes as long term? How many more times do we need to point out that no vaccine ever had any side-effects on a multi-year scale?

So yes, there may be a couple factors to consider, but most of what you listed shouldn't fly as an actual factor. It may be very engineer-y to say they have analyzed the situation and found the optimal solution, but I 100% understand where they are coming from.

Idk man, I'm tired.
My complaint with the Boox series (I had one of those as well) versus the reMarkable is that writing on a boox feels like trying to write on plastic. The reMarkable has a texture that makes it more akin to writing on paper. It really does interrupt my thought process and note-taking ability.
Overall, pretty well. I was able to make a major career shift, going from a data analyst to a software engineer in the span of about 9 months of self-directed study. I reckon this was one of the biggest positive changes in my life to-date.

On the other hand, I developed quite a bit of anxiety and felt a little lost and depressed at times.

My advice to get the most out of your time would be: make sure the other key areas of your life are stable first (e.g. relationships, geography, finances, social life).

If you change multiple major facets of your life all at once, you are running the risk of becoming a bit untethered.

That being said, maybe it's the feeling of being untethered that catalyzes the growth in the first place.
The aside section of what Starlink can do, sounds to me like the kind of thing that gives militaries sleepless nights.
> It's "closure" in the mathematical sense, not in the functionnal programming sense.

The latter being of course an instance of the former :) Your lambda uses a reference to a local variable `x`, so go follow it and transitively capture all its references, repeat until you've closed over all such transitions.

let a = // whatever
let b x = a + x;
let f x = x + b x; // closes over b and transitively over a
Excellent blog series! Very good reading for people who've been using Nix for a long time, because it gives you a clear sense of things you've likely forgotten by now
Is modern facial recognition any better or is it also considered bad to use for anything sensitive?
Perhaps it would be best if the fishmonger or grocery store seafood department worker were to pith it for you at time of sale. They can have proper training and safety equipment (a sharp knife and a cut-resistant glove), and you get an assurance of time of death.
Why not Red or White Spot?
Totally agree. But if the op is looking to jump into tech, they will need to at least have an idea of the sort of role they want, and to be aware of those different roles in an average tech company. I was trying to point out the route doesn't have to be technical if they don't have those skills today, there may well be things they are already doing that would both sit well with an employer and still be something they enjoy.

OP - feel free to ask me any questions about other roles, happy to expand. Was a product guy myself and more recently work in strategy and transformation. Since you have asked the question here (hacker news) - I have assumed a level of knowledge of the industry and roles, but happy to help you (or others!) if of use.
Tofu Dregs
Old? I worked with IBM mainframes just a couple of years ago (mid 2010s) and that's still their business model.

Need more processing power for your quarterly reports and annual stocktacking? No problem, give them a call and they'll unlock additional resources for a time (and a fee, but that goes without saying).
GoDaddy Security Breach
Yes, and I believe Taiwan has started doing something similar. That's still under 16% of all seats, and- they just started doing this in the last couple of years. They were 100% similar to the US system until very recently
Using JSON for exchanging long-lived documents is bad.
Only optical scanners would be fooled, capacitive and ultrasonic readers actually read the 3D ridges of your finger.
Are you a US citizen? Don't you get double-taxed on foreign earnings?
until you fall asleep with your phone on you.
I did it accidently about 5 years ago, structured layoff and wildly good severance package. Had enough for 3-4 years of coasting. What I found for myself personally is that I did just that, coast. I did not have any great plans to do anything. I went back to work because I was bored. Days of YT, video games, and coursework can be interesting and all but after awhile it wears thin and I personally wanted to work on something a bit more interesting. But I had no 'interesting' ideas of my own. So I got a job and borrowed someone's. I lasted about 7 months before I was ready to go back to work and started applying anywhere. Would I recommend it? Not really. It may be time to jet from this place though.
> However, he simultaneously unveiled a $1 billion US "Bitcoin bond" where half would be used to build energy and mining infrastructure, with the rest used to buy more of the digital currency

This Bitcoin bond is supposedly going to pay 6.5% interest. If Bitcoin crashes, the bond will fail and the investors lose. If Bitcoin skyrockets, El Salvador keeps the profits and the investors only get their 6.5%.

They’re also being up front about the idea that the bond itself will boost Bitcoin prices because they’ll be buying Bitcoin but not selling (aka HODLing), which drives up the price. It’s like they’re saying the quiet part out loud and forgot to pretend that it’s supposed to be a currency.

Why would any rational investor invest in this bond instead of investing directly in Bitcoin?

It feels like someone in the El Salvador government has a lot of Bitcoin investments and they’re abusing the hell out of their government situation to pump their investments to the moon. Even the hardcore pro-Bitcoin people I know aren’t thrilled about this.
You can spend all your time in "mindful" rabbit holes too : consider Wikipedia...
San Francisco is becoming the poster child for what happens when you decriminalize / remove consequences for theft.
Font Family for Software Developers
You should be made aware that the US and world are divided into classes, and you are currently in the working class. You being in the position you are currently in is the entire point of the system. It is called capitalism.

With regards to Flexport, I am not in freight particularly, but I am a programmer at a big company automating shipping and truck delivery. My total comp. this year will be $170k (low for this board) and one impetus for it is to automate people like you out of a job.

Workers at Kellogg's and some other companies organized together to better their lot https://m.metrotimes.com/news-hits/archives/2021/11/19/kello...

In terms of as an individual, keep going to school. Have a realistic idea about majors, jobs available afterward. career growth etc. Look into it all - if my career goal was to be a level 6 programmer at Google or Facebook, I would look at what I need to do to get in those companies at level 1 or 2, and then what I need to get to that preceding step, working backwards. Also be cognizant you might work with people who start their professional careers at 21, and at 35 you might have a boss who is 28, and whose other reports are all younger than them.

Also, you can learn and do MVPs on the side.

Of course, all of this is hard to do working 60 hours a week, spending time with wife and community and taking night school. It is kind of the point, you are a wage slave whose purpose is to extract profit for your freight company until you conk out and are replaced. Any kind of betterment for yourself is not a consideration, as corporate profit is all, you don't matter other then the profit you generate on the treadmill. It's the economic system we live in, capitalism.
Yes that's why I say, buy it on the operator of where you're leaving from. Doesn't make much sense trying to buy at a 3rd party.

(for DB specifically it seems that international-bahn.de can determine the price for some trips)
No, please don't do this one. It's killing the hardware and its features. It feels like you don't own the hardware as it needs to be fully unlocked at the expense of a license activation
this sort of "choice" is essentially entirely meaningless, if camera features were software unlock based they could sell all cameras with all features for the lowest price and still make money, the only one benefiting here is canon extracting maximum value.
Dogs Benefit from Time Restricted Feeding – Fight Aging
How Google designed its wildfire feature for Maps
To avoid induced demand, you need to make other modes of transport more attractive than driving.

So if there are two routes from A to B and one is longer, then the shorter route should be reserved for the modes of transports that have a higher capacity. (That usually means banning cars)

Another really good option is to have dedicated bus lanes so buses don't get stuck in traffic.

As a car driver you massively benefit if other people take the bus or bikes instead of their car. Plus you and especially the ones who are to old, young, poor, disabled to drive a car have good options of getting around.
Yes this is good advice.

RPA isn’t sexy, but it gets you some at-bats on hard technical problems. Once you’ve solved some of those, you’ve learned a few things that are probably applicable elsewhere and can start working your way up the tech ladder.

It’s never been easier to jump from being an informally trained IT generalist into a development career with exponential salary growth along the way — companies like mine have accepted the fact that qualified talent is just too expensive right now; so we need to hire for potential and invest in people or else we will have no pipeline of junior devs.
AWS Lambda pricing model explained with examples