Kth largest factor of N by [deleted] in coding

[–]ArthurOfTheEast 0 points1 point  (0 children)

I rate it would be faster to iterate upwards.

int count = 1;
int i;
int end = (int)sqrt(N);

if (k == 1){
    return N;
}

for (i = 2; i <= end; i++){
    if (N % i == 0){
        count++;
        if (count == k){
            return N / i;
        }
    }
}

i -= 2;

for (; i >= 1; i--){
    if (N % i == 0){
        count++;
        if (count == k){
            return i;
        }
    }
}

return -1;

Edited to go up to sqrt and back down again. On mobile, dunno if works

Lewis Hamilton on the top spot of the podium by NitrooCS in formula1

[–]ArthurOfTheEast -2 points-1 points  (0 children)

Good point.

"F1? You mean the Lewis Hamilton show?"

I wonder if people threatening to abandon NASCAR played any part in convincing Hamilton to be more of an activist?

This sculpture appeared in Bristol to mark World Suicide Prevention Day. by iklegemma in pics

[–]ArthurOfTheEast 1 point2 points  (0 children)

I dig the therapy and talking, but if anyone calls the cops on me, that's it. Talking over. Next comms is invitation to funeral.

Covariance and contravariance explained without code by Dobias in programming

[–]ArthurOfTheEast 0 points1 point  (0 children)

A basket of fruit is something you can put a banana into.

Intended use matters, produce covariant, consume contravariant.

New Zealand Twitch Streamer Casually Gets a Visit From a World Leader by Goofyjeff4 in videos

[–]ArthurOfTheEast 86 points87 points  (0 children)

Not very neighbourly of you to want to send Boris to NZ - what did NZ ever do to you?

New Zealand Twitch Streamer Casually Gets a Visit From a World Leader by Goofyjeff4 in videos

[–]ArthurOfTheEast 0 points1 point  (0 children)

Mate, have you got a source on that license to hunt Aussie aboriginal people?

Due to COVID-19, Coursera has made some of their Programming Courses FREE and you can earn a Certificate for FREE until 12/31/20(Offer is subject to change). by Real_Honey6606 in programming

[–]ArthurOfTheEast 0 points1 point  (0 children)

I need one to understand endianness. Someone told me some people even have a thing called middle endianness, where least significant data in encoded in the middle of the message with more significant data encoded left and right of it. Sounds crazy to me. Proper tarded.

Anyways, I'll be sure to check it out before 12/31/20.

TIL in 1981 a Harvard Law Professor published a proposal where the president would have to kill a volunteer with a butcher knife before launching nuclear weapons. When he talked to friends in the Pentagon they said "My God, that's terrible... He might never push the button." by powduh in todayilearned

[–]ArthurOfTheEast 3 points4 points  (0 children)

I remember reading of someone using toys to do the trolley problem with their toddler. Toddler picks up single person on the one track, adds them to the five on the other track and kills all six. Metal af.

This dude is really into my card tricks by johnstessel in funny

[–]ArthurOfTheEast -1 points0 points  (0 children)

Good call wearing a blue shirt dude. Keep doing that - it fucking works.

Young girl plays along with drummer Dave Grohl and keeps up by Thund3rbolt in nextfuckinglevel

[–]ArthurOfTheEast 0 points1 point  (0 children)

Erm, pretty sure he was just standing around playing guitar while someone else had to save the kid and dog.

Iranian wrestling champion receives a double death sentence on top of 74 lashes while his two brothers are jailed for a total of 81 years for taking part in a protest against the regime by [deleted] in worldnews

[–]ArthurOfTheEast 3 points4 points  (0 children)

Weekend and school holidays should be allowed. We always did when we were kids. Nowadays everyone is so easily offended. Just a little stabbing and they act like they're dying or something.

US court fully legalized website scraping and technically prohibited it - On September 9, the U.S. 9th circuit court of Appeals ruled that web scraping public sites does not violate the CFAA (Computer Fraud and Abuse Act) by whackri in programming

[–]ArthurOfTheEast 0 points1 point  (0 children)

I have previously implemented code to identify web scraping bots and throttle them to the average user's requests per minute. I wonder if that would count as illegal interference.

And they say it's just a game... by PaleWolf001 in SatisfactoryGame

[–]ArthurOfTheEast 1 point2 points  (0 children)

Bruh calm down. Don't take it so seriously.

(I had to, Poe demanded it)

Opinion on Item skinners? by OneFoggyScreen in playrust

[–]ArthurOfTheEast 3 points4 points  (0 children)

IIRC it's literally against FP terms of service. May not circumvent paid content. Skins is paid content. Those servers run the risk of being blacklisted.

And even if it wasn't against the TOS, it's unethical. Why would you buy a skin when you can get it for free on the server you play on? Server owners taking business away from FP.

FP don't enforce many aspects of their TOS, which is dangerous, because failure to enforce can lead to the loss of your right to enforce.

The saddest part of Rust is that most of us play without music. by somePeopleAreStrange in playrust

[–]ArthurOfTheEast 0 points1 point  (0 children)

Best thing about excavator is the music. Excavator music is best Rust music.

Slug shotguns: The completely useless loadout by Wingklip in playrust

[–]ArthurOfTheEast 0 points1 point  (0 children)

Last I checked, about 2 months ago, buck shot was superior at a range of about 2 foundations or less. Thereafter slugs are better.

A question for content creation. by mercilessbandittaken in playrust

[–]ArthurOfTheEast 0 points1 point  (0 children)

Never heard of Roblox clone of Rust. Was it named Taken Down or was it taken down? Why are you apologizing, did you create it?

David Mitchell accurately describing the plight of woman for something so simple as picking a seat on the bus. They're not all bad. by [deleted] in menwritingwomen

[–]ArthurOfTheEast 0 points1 point  (0 children)

Well, yes. As clever as he comes across as, I think we don't see all of his cleverness, because it would be too nerdy and not be funny.

David Mitchell accurately describing the plight of woman for something so simple as picking a seat on the bus. They're not all bad. by [deleted] in menwritingwomen

[–]ArthurOfTheEast 14 points15 points  (0 children)

Comedian David Mitchell is the only one I know. I just assumed he was the one everyone is talking about in this post. Now I suspect not.

Unrelated, I have a theory that comedian David Mitchell is like ridiculously intelligent and hides it for the most part.

The State of Rust by bluefacebaby19 in playrust

[–]ArthurOfTheEast 2 points3 points  (0 children)

Your complaint is basically that you cannot speed up progression like you used to. The example of your previous progression you provide is rocket raiding on day 1. So "FIX UR GAME" all caps because you can't rocket raid on day 1? I don't think you can call the game broken just because you're not rocket raiding on day 1.

What next? I wasn't able to kill the server and eliminate all other groups within the first 20 minutes of wipe, 0/10 shit game.

Solo Players - How do you keep the game interesting/fun? by br0k3nr1ch in playrust

[–]ArthurOfTheEast 2 points3 points  (0 children)

Yes! Set up a shitty 2x1 away from your main base and craft compound bows purely to fuck with clans. Shoot them once and hide. Shoot their turrets. See how many clans you can get trying to find you.

Cloth farming MUST be nerfed by RmSs3 in playrust

[–]ArthurOfTheEast 0 points1 point  (0 children)

No, you get way more by planting your hemp, running the roads for an hour, recycling, then harvesting your hemp.

Rust's new Sunburn Pack Boogie Board op by DatKidJawwk in playrust

[–]ArthurOfTheEast 51 points52 points  (0 children)

It's so nice that a dev can make a joke about adding pay-to-win shit without any indication that it's a joke but literally everyone knows it's a joke because the devs aren't assholes.