If small numbers are much more frequent, it’s better to return early. Really, you should gather statistics about the numbers the function is called with, and put the most frequent ones at the top.
- 0 Posts
- 26 Comments
prime_number_314159@lemmy.worldto Showerthoughts@lemmy.world•Punishment for financial crimes should be proportionate to the average yearly income.2·9 months agoI would swear I’ve seen an annual figure, but I’m not finding it.
https://www.bls.gov/news.release/wkyeng.t01.htm shows the weekly figure, and $1165 times 52 fits with $60k/year. Sorry I don’t have a nicer is source
prime_number_314159@lemmy.worldto Showerthoughts@lemmy.world•Punishment for financial crimes should be proportionate to the average yearly income.2·9 months agoFYI, the median personal income for a person working full time, year round is just above $60,000 in the US, so 1 million dollars of crime might only deserve 16 years, 8 months.
JPMorgan Chase has paid out $30,000,000,000 in fines over the last 20 years or so. That means if you apply similar logic to companies, their executive team owes up to 500,000 years in prison collectively, which is only 3,000 years per member of the senior leadership team.
prime_number_314159@lemmy.worldto Showerthoughts@lemmy.world•There exists a position inside the earth where it is possible to cook a perfect pizza just by leaving it there1·1 year agoIn the area I live, this would mean you could be standing right next to the pizza cooking bore, and still be outside of the delivery range.
prime_number_314159@lemmy.worldto Showerthoughts@lemmy.world•If "Master/Slave" terminology in computing sounds bad now, why not change it to "Dom/Sub"?1·1 year agoI’ve seen a few projects rename during major version upgrades, when everyone has to read the release notes and make changes, anyways.
Plenty of old deployed systems may continue using master/slave terminology, and of course some projects will stick to that language even decades in the future, but it was once more prevalent than it is now, and that declining trend looks like it will continue.
prime_number_314159@lemmy.worldto Showerthoughts@lemmy.world•If "Master/Slave" terminology in computing sounds bad now, why not change it to "Dom/Sub"?62·1 year agoI think very few people mind changing it, and a few people want it changed, so it’s slowly shifting across various use cases. I’ve only discussed the change from master/slave terminology with one person that affirmatively supported the change, and they didn’t know that there’s still slavery in the world today.
I don’t know what to make of that, other than to say ending human slavery ought to be a higher priority than ending references to it.
prime_number_314159@lemmy.worldto Selfhosted@lemmy.world•ICANN approves use of .internal domain for your networkEnglish3·1 year agoYou can just issue new certificates one per year, and otherwise keep your personal root CA encrypted. If someone is into your system to the point they can get the key as you use it, there are bigger things to worry about than them impersonating your own services to you.
prime_number_314159@lemmy.worldto Programmer Humor@programming.dev•Quantum Lock suspends sales due to developers losing access to source code35·1 year agoI think you’re reading more into the statement than is there. Their studio was founded the same year this game released, with only one of the two founders described as a programmer. I’m pretty sure they mean “we” as in “the two guys that founded the studio”.
prime_number_314159@lemmy.worldto Memes@sopuli.xyz•"30 minutes or it's free" back then was wild10·1 year agoDrivers rushing to make the deadline lead to some deaths, which was followed by lawsuits. I don’t remember if there was a huge payment from one of those, but I know a bunch of pizza places have chosen not to risk it.
prime_number_314159@lemmy.worldto Showerthoughts@lemmy.world•No one has predicted the end of the world in a while.2·1 year agoThey were going to fire up the LHC to open a dimension, which can only happen when the moon is casting a shadow 6000 km away. Then aliens… or something.
Real everyone-eats-ice-cream-and-dances-all-day hasn’t been tried either. Just because you describe a set of circumstances doesn’t mean those circumstances can exist, and it especially doesn’t mean they can be stable long term.
Scarcity is a fact of nature. You cannot rationally distribute scarce things without knowing people’s preferences, so you either need to continuously solve the economic knowledge problem (which requires a huge state apparatus, which will be taken over by a dictator), or a means of exchanging goods between people to better suit their preferences (at which point you have invented capitalism).
prime_number_314159@lemmy.worldto Memes@lemmy.ml•Never seen a Camel walk through the eye of a Needle.23·1 year agoI talked to one of the authors of the New American Bible, who told me the text is a mistranslation, and it’s more like “harder than putting a rope through the eye of a needle”, which would’ve been an idiom familiar to the fishers in the area.
It means “impossible”, which is suitable because the things Jesus called for you to do make a rich person into a not rich person, as far as material wealth goes.
prime_number_314159@lemmy.worldto Programmer Humor@programming.dev•As someone not in tech, I have no idea how to refer to my tech friends' jobs9·2 years agoIn my mind, the line is that an engineer is someone that can commit a crime by doing their job incompetently. If the only things at risk are your job and your pride, that’s a different thing.
“I program all day, so there’s a lot of trial and error. My friend is a negligent civil engineer, so there’s a lot of error and trial.”
prime_number_314159@lemmy.worldto Programmer Humor@programming.dev•As someone not in tech, I have no idea how to refer to my tech friends' jobs17·2 years agoI’m a Senior Computer Software Developer Programming Engineer, or SCSDPE (which is pronounced Skuzz-Deep), and I will be irreparably miffed if you get it wrong.
For your convenience, I also accept “that guy that sits weirdly close to the water fountain”, “hey”, and “paid keyboard user”.
They’ve finally found their silicon mates.
prime_number_314159@lemmy.worldto Memes@lemmy.ml•[OC] Anyone else insist on using the generic name for all meds?14·2 years agoRobert Downey Jr is the name brand, Tony Stark is the generic name. Hollywood producers certify there’s no functional differences between the two products.
prime_number_314159@lemmy.worldto Piracy: ꜱᴀɪʟ ᴛʜᴇ ʜɪɢʜ ꜱᴇᴀꜱ@lemmy.dbzer0.com•Study finds anti-piracy messages backfire, especially for menEnglish102·2 years ago“You wouldn’t put on a tricorn hat, would you?”
I actually would, if I could find a nice one…
“…and leave your job to sail the seas?”
… That’s an option? I didn’t even consider-
“And you certainly wouldn’t drink rum, and fire cannons, and carry a saber and tell silly parrot related puns.”
buys a tricorn hat
prime_number_314159@lemmy.worldto Memes@lemmy.ml•Everything I need is still in in the old settings windows that haven't changed in 23 years16·2 years agoAI answer: Type the setting into the start menu search bar. The first result will be the setting you’re looking for.
I’m ignoring many factors for the sake of being able to answer. There are some kinds of heating, especially using burning fuels that are nearly 100% efficient, but we don’t know why it needs to get to that temperature, or how long it needs to stay that hot - so even if the transfer of heat is 100% efficient, this computation may underestimate the actual needs.
A 1.5" long number 8 wood screw has slightly more than half the holding strength when it is driven by a hammer into 2 3/4" pine boards, relative to the traditional rotating the workpiece approach, but takes only about 1% of the time to install. You can very easily add a second screw to achieve the desired strength, while often gaining resistance to torque in the workpiece.
Meanwhile, 3D printed screws usually break when struck with a hammer, so they’re no good for this approach.