As you say it can be done but it's an anti-pattern to use a message queue as a database which is essentially what you are doing for these kinds of long running tasks. The reason is that their are a lot of state your likely going to want to status as a task runs and persist and checkpoint yes you can carefully string together a series of database calls chained with message transactions so you don't lose something when an issue happens but then you also need bespoke logic to restart or retry each step and it can turn into a bit of a mess.
Gifted programs aren't perfect, simply holding students accountable regardless of gifted status would be better. However skin color seems like the dumbest metric to use to hold these programs accountable and has little to do with students test scores so it's highly doubtful that managing your school based on that is going to have a positive outcome.
Just rank by date needed order on a kanban board and work your way through everything in order. If it's constant fight to meet deadlines it will be clear enough that things are backed up.
I think it has been happening for a while now cancel culture had a very negative effect on academia Jordon Peterson and Warren Smith being examples of that. I much appreciate Dr. Sam Richards who walks the fine line of trying to be centerist but he did comment recently how he does gets hate from both sides. Now I know this is going to be down voted because some will say I am both sidesing this when it's clearly one side right now. This is true I think that's however not a great argument to start a conversation. the founding fathers gave us a great foundation to work with it just takes open dialogue to convince enough of the other side that their is an actual good counter argument. The violence we have seen in the past couple months is only going to entrench positions because each side will want the result of that violence to have been meaningful furthering solidifing the separation. Currently I think American agree on the vast majority of things social media just does it's best to highlight our differences but the average person has mostly the same culture and the same day to day issues so I actually am hopeful.
The US has always been a very moralistic country. From banning alcohol and burning witches to its long struggle to accept differences (in skin color, gender or even the definition of freedom). “Cancel culture” is part of America since its foundation. It’s a moral tug of war.
It’s a different thing altogether to have the government itself weaponize “cancel culture”, however. As much as right wing people like to scream that “democrats are the same”, there’s little evidence of the same level of systemic abuse and disregard for institutions in the name of revenge (“if the left cancels, I can cancel too”). It’s a flight from moral infighting to authoritarian rule.
> little evidence of the same level of systemic abuse
You not looking for it doesn't mean "little evidence."
It's well documented that the previous administration pressured social media to silence views it didn't like, as well as instances of debanking conservative organizations.
That's not to say this administration doesn't throw its weight around, too, but to think it's only one side make you complicit in the problem.
Some individuals from the previous administration asking a donor to do something is not exactly the same thing as the president FORCING someone to do it and demanding bribes or else they’ll impose fines on the business (which he then proceeds to do anyway, eg with Nvidia)
You’re quite literally a character from the book in this post, if you think they’re equivalent (your argument is verbatim what one of the nazis interviewed uses to justify having supported hitler)
They were making large overreaches and censorship, thinking anything else also makes you a person from this book.
This report was written when Biden was still in power, it details how they did pressure companies to censor material and not just friendly suggestions:
Authoritarianism getting dialed up and voters having less power is bipartisan, this cannot get fixed by just changing one side. As long as democrats keeps ramping up republicans will feel like they have to ramp up as well, and vice versa, democrats ramp up since they feel republicans ramp up. You can't get out of this by just changing one side.
So you think “both sides are the same” and that democrats “ramping up republicans” legitimizes what the government is currently doing, all based on a report by the judiciary that’s controlled by the current administration?
Why would I think that? I just dislike how Americans refuse to criticize their own side when they do bad things and I feel that is the biggest problem you have.
Most people don't switch side over small differences, so as long as Democrats continue to follow Republicans into becoming worse and worse nothing will change.
And why do I complain about Democrats? Because you should try to convince the reasonable one, you can't change Trump, but you can maybe change Democrats. But as long as Democrats continue to play along you are doomed, if not this term it will be the next or the one after that, but at some point it will happen.
And no, no amount of "Trump is the devil, see all he has done" will make people stop voting for him. You have to improve the democrats, not throw more shit at Trump. The 2024 election was lost by the Democrats, it was not won by Trump. Trump didn't get more votes in 2024 than 2020, but he won anyway since democrats got so many fewer votes.
Maybe there’s better examples, but last time I checked some debunking examples they were well explained, unlike how political agitators complained about it. It was basically thinking they could break laws and get away with it complaining.
Go read the emails the administration was sending to Twitter demanding people be taken down left and right. Or if you want a wider view than just the US, look at what European governments demand from social media companies. It's all censorship of the right by the left, zero in reverse.
But it's true that the left does not need to overtly threaten from the top as much because they already purged all the institutions of anyone who would resist them, so they can just coordinate directly across institutional lines. They don't need to threaten when they have plenty of insiders willing to do the work for them for ideological reasons, without being threatened.
> Go read the emails the administration was sending to Twitter demanding people be taken down left and right.
They used twitter’s appeal process at the time. Twitter was never forced to take anyone down. The emails prove that, in fact. Twitter was a fairly neutral player (as much as social media platforms can be neutral) and tried to abide by US free speech rules plus their TOS (which is what extremists try to misunderstand: companies don’t have to abide by “free speech”, they’re private enterprises and have terms of use).
> look at what European governments demand from social media companies.
European governments follow European laws and require companies operating in Europe to comply. It’s not complicated.
Your worldview seems to be that anyone that’s not MAGA is “the left” and the whole world should follow American laws. That’s not how any of it works. You’re letting your brain be hijacked by fear and identity politics. It’s not healthy for you.
The Twitter files revealed the government communication to Twitter was a continuation/mirroring of communication from the previous Republican regime making requests of Twitter.
Purge? Which administration threw out all of our civil service rules and purged people as soon as they had power? Which is telling the DOJ PUBLICALLY 'there are the people you need to get convictions against because it's making us look bad? Hint, it wasn't the previous administration.
Your second paragraph is a direct indictment of the CURRENT Right wing administration, who have incorporated exactly what you condemn as part of their current plans, spoken out loud that is their plan, and have executed on this plan.
Forget the past, if what you say is bad and should be prevented, I'm here, now, agreeing with you so lets condemn this shit! We can rehash the past come next election, but let's take care of ongoing/current business today.
> there’s little evidence of the same level of systemic abuse and disregard for institutions in the name of revenge
If you think that, you've not been paying attention. Both sides doing it is disgusting and I think the right does it more than the left (at this point in time), but the left DOES do it.
Jordan Peterson is very much proof that "cancel culture" as it exists in the right's collective imagination never existed. A completely clueless guy that holds backward views from centuries past, that can still find an audience and be hailed as a "great intellectual" among the equally clueless people he appeals to.
This is a trap junior devs fall into DRY isn't free it can be premature optimization since in order to avoid copying code you often add both an abstraction AND couple components together that are logically separate. The issues are at some point they may have slightly different requirements and if done repeatedly you can get to a point that you have all these small layers of abstraction that are cross cutting concerns and making changes have a bigger blast radius than you can intuit easily.
If you notice that two parts of the code look similar, but have a good reason not to merge or refactor, that deserves a signpost comment.
If you're copying and pasting something, there probably isn't a good reason for that. (The best common reason I can think of is "the language / framework demands so much boilerplate to reuse this little bit of code that it's a net loss" — which is still a bad feeling.)
If you rewrite something without noticing that you're doing so, something has definitely gone wrong.
If a client's requirements change to the point where you can't accommodate them in the nicely refactored function (or to the point where doing so would create an abomination) — then you can make the separate, similar looking version.
I don't think it's as cut and dry as that. In my team we require 100% test coverage. Every file requires an accompanying test file, and every test file is set up with a bunch of mocks.
Sure, we could take the Foo, Bar, and Baz tables that share 80-90% of common logic and have them inherit from a common, shared, abstract component. We've discussed it in the past. Maybe it's the better solution, maybe not. But it would mean that instead of maintaining 3 component files and 3 test file, which are very similar, and when we need to change something it is often a copy-paste job, instead we'd have to maintain 2 additional files for the shared component, and when that has to change, it would require more work as we then have to add more to the other 3 files.
Such setups can often cause a cascade of tests that need updated and PRs with dozens of files changed.
Also, there are many parts of our project where things could be done much better if we were making them from scratch. But, 6 years of changing requirements and new features and this is what we have - and at this point, I'm not sure that having a shared component would actually make things easier unless we rewrite a huge amount of the codebase, for which there is no business reason.
I can understand requiring 100% test coverage, but it seems to me that requiring a test file for every file is preventing your team from doing useful refactoring.
What made your team decide on that rule? Could your team decide to drop it since it hinders improving the design of your code?
Honestly, I've never questioned it. The upside seems that yes, it could make refactoring easier. Downside, though, is not knowing where certain tests live. The command+shift+T shortcut to open the test file corresponding to a production code file is very useful to me, too.
> If you're copying and pasting something, there probably isn't a good reason for that.
I would embrace copying and pasting for functionality that I want to be identical in two places right now, but I’m not sure ought to be identical in the future.
I agree completely. DRY shouldn't be a compression algorithm.
If two countries happen to calculate some tax in the same way at a particular time, I'm still going to keep those functions separate, because the rules are made by two different parliaments idependently of each other.
Referring to the same function would simply be an incorrect abstraction. It would suggest that one tax calculation should change whenever the other changes.
If, on the other hand, both countries were referring to a common international standard then I would use a shared function to mirror the reference/dependency that they decided to put into their respective laws.
The reverse of that is people introducing bugs because code that wasn't DRY enough was only changed in some of the places that needed to be changed instead of all the places.
To me, it's the things that are specifically intended to behave the same should be kept DRY.
An obvious example of that is defining named constants and referring them by name instead of repeating the same value in N places. This is also DRY and good kind of DRY.
This is actually a particular pet pieve of mine because I worked with the Camel framework which has a lot of boilerplate in strings but if you start using constants for the common parts you now have an unreadable mess of constants concatenated together that buys you nothing.
DRY isn't an optimization of any kind, so it can't be a premature optimization. "Premature optimization" is a specific failure mode of programmers, not just a meaningless term you can use to attack anything you don't like. "Optimization" is refactoring to reduce the use of resources (which are specifically cycles and bytes) and it's "premature" when you don't yet know that you're doing it where it matters.
Indeed a trap. I'd say DRY is all about not duplicating logical components. Just because two pieces of code look similar, does not mean they need to be combined.
As an analogy, when writing a book, it's the difference of not repeating the opening plot of the story multiple times vs replacing every instance of the with a new symbol.
What are some resources for these conventions? As far as I can tell everyone else rolls their own bespoke images based off of of a projects image in order to customize the configuration.
O(1) in many cases involves a hashing function which is a non-trivial but constant cost. For smaller values of N it can be outperformed in terms of wall clock time by n^2 worst case algorithms.
For example, in applications where the sorted form can be readily maintained, a decent B+-tree tends to massively outperform a hashmap as soon as you get the streamed/non-indexed side (of what's in a way a lookup join) to opportunistically batch items:
as when you sort your lookups you can use exponential forward search (compare at exponentially increasing distances from the cursor; once you're past the target, run binary search between this now upper bounds and the previous probe point as lower bound) in your index for each next key to reduce the per-lookup cost to be logarithmic in distance from the last-looked-up key (asymptotically always better than single isolated lookups; in practice tends to cap out at 2x the cost in pathological cases if you respect page locality of B+-tree structures).
If you aren't ignorant of your LRU cache set during such, you'll get by with overall significantly fewer memory accesses to e.g. fresh DRAM pages (let alone NAND pages) than with a hashmap setup.
I've severely sped up a C++ program by replacing an `std::unordered_map` with a `std::vector` (iirc technically a pair of; for SoA purposes) by realizing that I could collect the items unordered; sort the structure; then use binary search instead of hashmap lookups. The function that I modified ran something like 3x faster as a result, and that's without anything like vectorization-friendly structures or such.
I mean, true obviously, but don't say that too loud lest people get the wrong ideas. For most practical purposes n^2 means computer stops working here. Getting people to understand that is hard enough already ;)
Besides, often you're lucky and there's a trivial perfect hash like modulo.
> What do you mean? Modulo is not a perfect hash function
It's a perfect hash function for the case where you work with ints and know the maximal min-max range beforehand; then you can modulo by the size of the range as long as it's not too large. In your example 33-21 --> mod 12
This comes up for me surprisingly often but obviously depends a lot on what you work on. It is often tempting to reach for a hashtable, but it's a lot less efficient in this case.
The challenge with big-O is you don’t know how many elements results in what kind of processing time because you don’t have a baseline of performance on 1 element. So if processing 1 element takes 10 seconds, then 10 elements would take 16 minutes.
In practice, n^2 sees surprising slowdowns way before that, in the 10k-100k range you could be spending minutes of processing time (10ms for an element would only need ~77 elements to take 1 minute).
Well, it doesn't seem that obvious, at least not to everyone, because several times I've seen people rewrite things to make it O(1) when it was actually slower for the vast majority of cases (or even all cases).
> In many cases it's guaranteed to be small or small-ish.
And in many cases it's assumed to be small, but not guaranteed. That's where the trouble lies.
A classic example is Windows using a quadratic algorithm for arranging desktop icons that caused severe performance issues when users had many icons on their desktop.
Would be more interesting if someone came at this debate from a game theory perspective with bad actors ignoring IP laws, manipulating currency values and implementing tariffs through policies that aren't directly taxing products but restricting who can play in markets. Yes tariffs are bad in a vacuum and I am not saying this article is false even when it's strawmanning some arguments to make it's case but it's seems a bit one sided and possibly nieve without including the context in which these policies are being made so I still remain on the fence as to whether tariffs can be used as leverage.
The "bad actor" strategy in question has been known for ages: it's called mercantilism. It's so old that it convinced Alexander Hamilton away from "free trade laa dee dah" so that he could enact the protectionism which eventually industrialized America.
More recently, China has been running the same playbook to great effect. It's really funny to watch the free trade crowd laud/fear the rise of China with one breath while calling the mercantilist playbook old and outdated with the next.
> It's really funny to watch the free trade crowd laud/fear the rise of China with one breath while calling the mercantilist playbook old and outdated with the next.
It mentions it in the article, which technically references Lighthizer's book passage:
" ‘A crucial mistake,’ according to Lighthizer, had been to let China into the WTO and treat it as just another country like America’s free-market allies. The result was that millions of well-paid jobs in US manufacturing disappeared, as more and more work was outsourced and offshored. "
A close examination of the passage appears to be correct: accordingly, China only met about 50% of the WTO entry requirement in the last 20 years. They were in essence, acting as a bad actor. Not only that, now they were seeking, prior to covid, to replace the current rule based trading system, with one where they got to have unlimited export to other countries, while the government suppressed wages and consumer spending internally, in order to strengthen the state. All other countries production be damned. The low wage low cost export would destroy all of the production capabilities in other countries.
And now with China openly claiming to Europe that Russia must not fail, they are blatant in their desire to destroy the western democracies, in support of authoritarian dictatorships in the world.
Global North corporations actively lobbied for China’s membership in the WTO because expanding the labor pool would lead to higher profits at the expense of the working class, and they were right.
This has created a cascading effect: rising wealth inequality has fomented distrust in institutions; this in turn has manifested as right wing populism. It’s right wing populism that is dismantling western democracies, not China.
No market is truly free. Once you have a free market it very quickly stops being free as dominant players monopolize it and shape the rules of the game causing the government to (sometimes) intervene to counter it and make it more fair, but it is never "free".
>dominant players monopolize it and shape the rules of the game causing the government to (sometimes) intervene to counter it and make it more fair
The dominant players shape it in large part by getting the government to intervene shaping rules to their benefit making it less fair. Naturally everyone with a brain hates this so there's a constant give take where the incumbent interests allow just enough competition, make the barriers to entry just barely surmountable that there's a strong enough trickle of new entrants that they can point and say "look, anyone can do it" and just enough idiots will believe it that they keep their heads.
However since it doesn't actually reason you have to be familiar enough with the subject that you can tell when it is and isn't hallucinating since it's extrapolating from those same shallow articles.