I’ve never seen palm kernel oil listed as a food ingredient. It seems to be most commonly used in cosmetics.
This is a mix up on why certain oils are on the current “oils to avoid” list. Palm oil gets a bad reputation mainly because of environmental issues with how it's grown, not because it's unhealthy. But all these concerns get lumped together in the “bad oils” list.
> It may seem trivial to make that glass that separates your finger from the electronic engineering that powers your ability to access the internet, but it’s difficult.
Out of all examples one could pick, this is the worst, as Corning Gorilla glass is actually made in the USA (Kentucky), and used by all other manufacturers.
While you are correct about color perception, I don't see the link to a 'lack of humanness in programmer thinking'. It's not an inherent trait to software engineers. The entire field of HCI, interaction design and everything around how we deal with digital colors are fully focused on the human experience.
Maybe a reminder that computer science != programming.
You've misunderstood the example. The `scores` channel aggregates scores from all players, you can't close it just because one player leaves.
I'd really, really recommend that you try writing the code, like the post encourages. It's so much harder than it looks, which neatly sums up my overall experience with Go channels.
It’s not entirely clear whether the author is describing a single or multiplayer game.
Among the errors in the multiplayer case is the lack of score attribution which isn’t a bug with channels as much as it’s using an int channel when you needed a struct channel.
In both examples, the HandlePlayer for loop only exits if .NextScore returns an error.
In both cases, you’d need to keep track of connected players to stop the game loop and teardown the Game instance. Closing the channel during that teardown is not a hurdle.
Hi! No, I think you've misunderstood the assignment. The example posits that you have a "game" running, which should end when the last player leaves. While only using channels as a synchronization primitive (a la CSP), at what point do you decide the last player has left, and where and when do you call close on the channel?
I don't think there's much trouble at all fixing the toy example by extending the message type to allow communication of the additional conditions, and I think my changes are better than the alternative of using a mutex. Have I overlooked something?
Assuming the number of players are set up front, and players can only play or leave, not join. If the expectation is that players can come and go freely and the game ends some time after all players have left, I believe this pattern can still be used with minor adjustment
(please overlook the pseudo code adjustments, I'm writing on my phone - I believe this translates reasonably into compilable Go code):
type Message struct {
exit bool
score int
reply chan bool
}
type Game struct {
bestScore int
players int // > 0
messages chan Message
}
func (g *Game) run() {
for message := range g.messages {
if message.exit {
g.players = g.players - 1;
if g.players == 0 {
return
}
continue
}
if g.bestScore < 100 && g.bestScore < message.score {
g.bestScore = message.score
}
acceptingScores := g.bestScore < 100
message.reply <- acceptingScores
}
}
func (g *Game) HandlePlayer(p Player) error {
for {
score, err := p.NextScore()
if err != nil {
g.messages <- { exit: true
}
return err
}
g.messages <- { score, reply }
if not <- reply {
g.messages <- { exit: true }
return nil
}
}
}
I don't think channels should be used for everything. In some cases I think it's possible to end up with very lean code. But yes, if you have a stop channel for the other stop channel it probably means you should build your code around other mechanisms.
Since CSP is mentioned, how much would this apply to most applications anyway? If I write a small server program, I probably won't want to write it on paper first. With one possible exception I never heard of anyone writing programs based on CSP (calculations?)
> Since CSP is mentioned, how much would this apply to most applications anyway? If I write a small server program, I probably won't want to write it on paper first. With one possible exception I never heard of anyone writing programs based on CSP (calculations?)
CSP is really in the realm of formal methods. No you wouldn't formulate your server program as CSP, but if you were writing software for a medical device, perhaps.
This is the FDR4 model checker for CSP, it's a functional programming language that implements CSP semantics and may be used to assert (by exhaustion, IIRC) the correctness of your CSP model.
I believe I'm in the minority of Go developers that have studied CSP, I fell into Go by accident and only took a CSP course at university because it was interesting, however I do give credit to studying CSP for my successes with Go.
Adding an atomic counter is absolutely a great solution in the real world, definitely, and compare and swap or a mutex or similar totally is what you want to do. In fact, that's my point in that part of the post - you want an atomic variable or a mutex or something there. Other synchronization primitives are more useful than sticking with the CSP idea of only using channels for synchronization.
> layoff plans must be communicated ahead of time. Minimum 30 days notice, usually much more
In the United States, employers with more than 100 full-time, non-probationary employees must provide 60 days notice of most planned layoffs[0]
> - LIFO principle for layoffs, newest employees are let go first. Stack ranking not possible
This is functionally equivalent to a stack ranking in that it is a forced-distribution scheme. It is just based on a single factor that is outside of the employee's control. Say what you want about stack ranking, but people do have a large degree of control over their job performance.
> Any kind of discrimination is forbidden
In the United States any kind of job discrimination against members of protected classes[1] in illegal. Even inadvertently disparately impacting[2] members of a protected group is illegal.
> In the United States, employers with more than 100 full-time, non-probationary employees must provide 60 days notice of most planned layoffs[0]
This seemed quite surprising to me, and from reading your reference, I don't think it's nearly as broad a protection as it seems to me like you're stating it. the law seems to apply to companies that you describe, but the types of events that they need to provide notice for don't seem like "most planned layoffs" to me; the employee guide lists the following as potentially being covered:
• A plant closing (see glossary)—where your employer shuts down a
facility or operating unit (see glossary) within a single site of employ-
ment (see glossary and FAQs) and lays off at least 50 full-time workers;
• A mass layoff (see glossary)—where your employer lays off either
between 50 and 499 full-time workers at a single site of employment
and that number is 33% of the number of full-time workers at the sin-
gle site of employment; or
• A situation where your employer (see glossary) lays off 500 or more
full-time workers at a single site of employment
I don't think most layoffs in the US are due to shutting down an entire office, a third of an office with at least 150 people, or 500 people from the same office. I'd expect most layoffs to either be much less concentrated in a single location or not large enough to hit the defined thresholds.
Plant closings involving 50 or more employees during a 30-day period.
California law has:
Plant closure affecting any amount of employees. Layoff of 50 or more employees within a 30-day period regardless of % of workforce. Relocation of at least 100 miles affecting any amount of employees. Relocation of a call center to a foreign country regardless of the percentage of workforce affected.
> In the United States, employers with more than 100 full-time, non-probationary employees must provide 60 days notice of most planned layoffs[0]
I'm not sure how that works, because I've been at a US company that did layoffs and they suddenly announced the layoff saying the impacted employees would be notified within a day.
Except for France and other European countries, where they announced the beginning of the process meaning the number and list of people let go wasn't decided yet (it would have been illegal).
There's no such thing as a protected group in US law - a protected class means a certain property of someone that employment decisions can't depend on, not a value of that property.
First, I'll say it is pretty common to use the terms interchangeably. I don't think anyone was confused by what I wrote, or that your "clarification" was in any way helpful. See, for example, these legal groups using the term "protected group" in relation to US employment law:
Secondly, I used the phrase "protected group" referring to disparate impact, and here, your assertion (to the extent it has any validity at all) is simply incorrect. The entire idea is to ferret out subtle acts of discrimination that have an outsize impact on a group consisting of members of a protected class, and in the case law you see the phrase "protected group" used explicitly. For example:
On the contrary, the ultimate burden of proving that discrimination against a protected group has been caused by a specific employment practice remains with the plaintiff at all times (Watson v Fort Worth Bank & Trust, 487 US 977 - Supreme Court 1988[0])
Companies in the US have been blatantly discriminating against some classes for years, and now must turn around and blatantly discriminate against other classes now (based on the current ‘anti-DEI’ stance). Racism and sexism in hiring in Europe and Asia has always been a thing, and quite blatant too.
it’s also a bit baffling that someone who’s been at the company longer than myself could have an advantage simply for being born before me, or for applying before me.
Is work performance not a key deciding factor? One could argue that’s absurd.
I don’t think the way it’s done in the U.S. is “right”, but i don’t think what you listed is right either.
Layoffs are for companies to reduce the size of their workforce and lower operating costs, skill distribution remains the same – there are various exceptions to ensure this.
If some employees are underperforming they should already be on their way out. That also is a process protected by law (no at-will employment here), otherwise layoffs would just be an excuse to expedite firings without going through the necessary steps. In short, being employed assumes you can perform at a satisfactory level, which makes sense to me. The flipside is that hiring is a much bigger commitment as people are not disposable.
Voluntary severance packages are usually offered ahead of layoffs, and include compensation based on years worked, so things can balance out a little.
The whole regulations are more about the social impact. Younger employees have an easier time re-arranging their lives and finding new jobs, are less likely to apply for welfare, and still have time left to switch careers, so this benefits everyone.
>Layoffs are for companies to reduce the size of their workforce and lower operating costs, skill distribution remains the same – there are various exceptions to ensure this.
But since this subthread is discussing LIFO layoffs, the problem is that generally the last in is also the lowest paid - not always of course - but if so it means that to hit your operating cost point you might need to reduce more people than you would if you could pick and choose.
If it’s the rule, everyone knows it. There is no guessing about randomness or hidden variables, and ultimately less favoritism than a line manager coming up with a stack ranking.
Looking at the larger picture, what otherwise tends to happen is that older people get pushed out. Then we have a massive issue of them ending up unemployed because nobody wants to hire them. This is compounded by the retirement age being pushed further and further away.
It's not about being fair to the individual, it's about producing a better outcome for society. In this case, saving money on welfare (that's also in great measured pooled across society, not an individual account).
Parents being able to take sick days to care for their kids, or 50yo being able to take leaves to take care of their dying 80yo parents are also unfair to kids in their 20s just starting out.
Then again, if we did have a random lottery that required all employees (up to and including the CEO) to participate, then perhaps we'd see fewer layoffs...
Thank you for sharing this important information. What does a company in the Netherlands do when an employee is underperforming? Do they get "PIP'd" like Amazon? Then, eventually let go with some standard severance package?
I can't talk about the Netherlands but if it's like France: the process is very different in the case of layoffs, where you want to reduce the workforce for economical reasons (e.g. shrinking revenues), and firing an individual employee. In the first case employees are not let go on the basis of the performances.
Firing individual employees for performances or because they made a serious offense is a different completely process. Whether they get a severance package or not depends on the reason of the firing.
Yes and no, as it is a difficult process because employer needs to prove it is not their fault that employee is not performing. To begin with you need to collect data over time, so pip is kind of a choice you’d go through to start collecting detailed info, then it might be that a simple course could help solve this if it is a knowledge based issue, then maybe there is another job in the company the employee could switch to, etc. Without any doubt employers do not like the process, it is easier to eliminate positions instead because it is not technically firing.
"Annual, billed monthly" is the deception. That's not a common thing and most users just see it as normal month-to-month billing. Annual billing still having a discount just adds to the confusion.
Annual, billed monthly cannot be a deception the way it is phrased. Lots of contracts work like that, even my phone/electricity bill and they have been like that forever.
The issue, if you look in one of the links posted in the comments, is that some years ago they didn't mention this specifically. They made you believe it was a monthly subscription and when you canceled it, the termination fees were really high. You know, like those old contracts using 4pt fonts for the important stuff :)
Not really the case for user-facing applications. Proxies can time out, detecting stalls is hard, reconnection is expensive, TCP slow start means higher latency, the overhead is huge for small messages. Implementing it properly is not trivial, the WebSocket standard was created precisely to improve on those shortcomings. Good for you that it works for your case, though if all you need is to listen to a stream you might also be better served by SSE.
I was asking since Socket.io, for example, takes care of file uploads, reconnection, the whole HTTP upgrade flow, and is extremely easy to use, both on client and server. On top of that it can fall back to long-polling if WS is not available.
This is a mix up on why certain oils are on the current “oils to avoid” list. Palm oil gets a bad reputation mainly because of environmental issues with how it's grown, not because it's unhealthy. But all these concerns get lumped together in the “bad oils” list.
reply