A list of puns related to "Wheel factorization"
One of my favorite algorithms to demonstrate the advantages of lazy fp is the wheel factorization algorithm.
In Python, translating pretty directly from Wikipedia pseudocode it looks like this:
def wheel_factor(n: int) -> int:
inc = [4, 2, 4, 2, 4, 6, 2, 6]
for prime in [2, 3, 5, 7, 11]:
if n % prime == 0:
return prime
test = False
k, i = 7, 0
while not test and k * k <= n:
test = n % k == 0
if test: return k
k += inc[i]
i = i + 1 if i < 7 else 0
return n
In Haskell, it's a lot clearer to understand, since infinitely cycling a list is really easy:
wheelFactor :: Int -> Int
wheelFactor n =
fromMaybe n $ find ((==0) . rem n) (takeWhile ((<= n) . (^2)) testLS)
where testLS = 2 : 3 : 5 : 7 : zipWith (+) (cycle incr) (drop 3 testLS)
incr = [4, 2, 4, 2, 4, 6, 2, 6]
I've started learning OCaml just yesterday and I'm wondering what the idiomatic way to write this algorithm is. I tried doing it the Haskell way with Streams but I don't think it will work similarly. It would probably pretty simple to translate the Python to pure OCaml by turning the loops into functions, but I'm sure there's a better way.
Can anyone give an example?
edit: fixed haskell
The website finds prime numbers and rotates around 'checking' if the next number is prime or not. The prime numbers were turned red. It started a spiral. I remember it being very mesmerizing. (It's the math nerd in me coming out)
I owned a 2019 Tesla Model 3 Performance for roughly two years and 15,000 miles. I'm going to distill my key learnings and experiences here, in an attempt to educate others on EVs and reach some form of closure. My ownership could best be summed-up as a love/hate relationship, ending with crazy used car values offering me the out I'd been quietly seeking. Clearly, I decided EVs aren't for me - at least, not yet. I'm not a "paid big oil shill" or someone who's trying to short the stock, as I'm sure some of the Tesla nuts will claim. I'm just a car enthusiast (disclaimer: not an engineer) standing at the same crossroads as the rest of you, wondering what sounds future children will make long after (if?) our beloved bureaucrats outlaw the ICE.
Everything I'm writing here is based on my own unique tastes and preferences. How the pros and cons balance out at the end is entirely up to you. And that's fine. Choice is great. Note that this post centers on Battery EVs (BEVs) at the time of this writing, which comprise the vast majority of EVs on the road today.
And yeah. This got way longer than I anticipated. But it was cathartic for me and I hope it's at least somewhat useful to someone out there.
I'll start with what ultimately sold me on the car - Immense, instant power. The war in the "pure acceleration" category is pretty much over - just take a look at Jason Cammisa's video with the Model S Plaid vs. the BMW M5 CS and Cadillac Crazy. They're not even on the same planet. Not only is the acceleration brutal, but it's consistent (everything else held constant - more on that later). Look up any number of 0 - 60 videos on YouTube, and you'll notice that the times are all remarkably close, especially if there are multiple runs in the same video.
And how could they not be? Software and traction control are fundamental to EV operation. Adjustments take mere milliseconds. The amount of "stuff" involved between your right foot and the tires is a joke compared to an ICE car. And it's basically idiot-proof - even with the Track Mode dialed to 100% hoon in my TM3P, it was nearly impossible to make a mistake. You just put your foot down and the car takes care of the rest, with literally zero drama.
And all of this performance comes with no mechanical sympathy. I never felt an ounce of it, flogging my Model 3 - there's really nothing to "break" mechanically in the way of the drivetrain. The ent
... keep reading on reddit β‘Round trip commute is 60Km a day for work so something with decent gas mileage would be ideal. I have side gigs in the weekend that means I need to tow tools/lumber around. I like higher ground clearance and 4 wheel drive for Canadian winters. I need penalty of space for hunting/fishing trips. Any advice?
Also would swapping out the 32bit board with a bigtreetech v2 board have any benifit.
Thanks so much, trying to jump into the water, just not sure where or how
I'm looking to get some opinions on the best setup for my situation. I'm planning to full-time RV in the near future and have been going back and forth between a 5th wheel and a Class A motorhome. I like a lot of aspects of both. I want to be able to bring along my 2017 HD Street Glide motorcycle too.
What I'm interested in getting opinions about is considering the motorcycle and the fact that I currently have a 2014 Ram 1500 that will be paid off in another year which setup would be the most ideal?
Setup #1: Motorhome
With this setup, I would be able to tow my current vehicle behind it and then get a lift for my motorcycle. This would put me in a better situation financially by my calculations because I would only be paying for the motorhome loan which can have longer terms than a normal auto loan to help with the monthly cost.
Setup #2: 5th Wheel
With this setup, I have to trade-in my truck for a full ton dually truck which will probably be around $50,000 for what I would want which is around $1,000/mo roughly then I would have to get the 5th wheel which if its a toy hauler will be around $80,000 and probably around $700/mo roughly.
So it would seem if I was going to be in it for around $1,750/mo in loan payments, I could score me a pretty nice diesel pusher for that price or save some monthly and get a not-as-nice DP.
What are some of your opinions on this if you were faced with this situation?
Do your worst!
TLDR: In order to have the cool effect, the show is overdramatizing things and I think it will end up hurting it big time and being canceled out in the long run I'm afraid.
Focusing on "Who" instead of "Why" is an artistic choice of course, which was made by Robert Jordan at the very beginning of the series. I don't remember exactly when that is revealed without a doubt since it's been a while since my last reread, but shouldn't be more than 100 pages in.
We know who is the Dragon Reborn. We are shown on the very first page the devastation he can bring to the world. We know the prophecies, and there is a deeply ingrained fear in most people, for the Dragon Reborn as he heralds the coming of the apocalypse so to speak. We understand the scale.
I'm not going to suggest the story as a whole is without any flaws of course. But no matter how I rack my brain for bad adjectives for the WoT books, I would never have thought the word "cheap" to describe its flaws. But focusing on "Who is the Dragon Reborn" instead of delving into "Why is Dragon Reborn so feared" is what makes this cheap. They are trying to go with "cool" instead of trusting in the source material for the storytelling aspects. And we can see multiple examples of this throughout the first season. I'll name a few:
Episode 1: Lan walks into Winesprings Inn looking intimidating and, lets be frank, like an idiot, then Nynaeve goes "Name yourself stranger". Not "Who are you" or "What do you want"... Seriously, who talks like that?
Episode 2: Nynaeve is able to track Lan... Ok ok, it's not Lan now, but it's Moiraine because she has a "tell" that Lan didn't know for the last however many years, because of.. reasons? Oh, also the Dragon Reborn could possibly be a woman now I guess.
Episode 3: Nynaeve had Marine training obviously. A random darkfriend in the middle of nowhere pulls a Terminator, and hates the world so much, and is so well versed in philosophy she is on par with one of the Forsaken's in that department.
Episode 4: The followers of Logain can sneak into a camp full of warders and Aes Sedai to bowshot distance. Nynaeve goes Super Saiyan.
Episode 5: Lan falls for Stepin's ploy (ok), then literally runs in SLO-MO to find him in his own pool of blood.
Episode 6: Oath Rod shenanigans. Really? You are establishing an organization that is shown that they can not lie, but they are required to take oaths for staying true to their word? And all that unnecessary drama of going off-script
... keep reading on reddit β‘Fleet-Cardinal Krenn watched from the bridge of his flagship as the planet below burned, and he was pleased. The cities of the Unworthy made for the perfect inaugural pyre for the renewal of the Holy Endeavor. They would continue to serve Kra as they had before the Mortification.
He shook his head in thought as he remembered those days. He had been a child when their Endeavor had first begun.
Initially, the Chosen's Holy Endeavor had met with success. Over a period of twenty years, a dozen unclean worlds had been discovered and cleansed, ready for the servants of Kra to purify. Three species of his Unworthy Children had even been fully extinguished! A triumph!
Kra had been pleased by his Chosen Children's attempts to aid his Great Servants, and rewarded them greatly. As their Endeavor progressed, His Great Servants had purified five unclean worlds very close to the Home Systems, each a blank slate, ready to be remade in the image of Kra's greatest work, Krathig-yar.
New homes and resources for the Chosen.
Then, disaster had struck. A large group of Unworthy species had been encountered, that worked together. They began coordinating their forces with others to oppose righteous cleansing. But the true depth of their depravity was revealed when they began employing unholy synthetic life against the Chosen; Thou Shalt Not Create Life, For That Is The Domain Of Kra.
The Chosen had despaired, as their fleets had been destroyed, corrupted by the Unworthy's unholy familiars, and been pushed back to the Home Systems.
It had taken what became known as The Mortification to stop them, so named because it was both a humiliation and a penance. Humiliated by their defeats at the hands of the Unworthy, The Chosen had thrown themselves at their enemy in the millions, using ramshackle, quickly built ships with as little automation as possible to prevent corruption.
It had required the sacrifice of twenty percent of their population to stop the Unworthy, but they had done it. He remembered, as a young priest-captain, watching from the bridge of his ship as their enemy finally withdrew.
The massive funeral pyres on the surface of Krathig-yar after.
Two decades of salvaging and rebuilding their fleet.
But this time, they would not fail. The Mortification had purged the weakness from the Cho
... keep reading on reddit β‘It really does, I swear!
For context I'm a Refuse Driver (Garbage man) & today I was on food waste. After I'd tipped I was checking the wagon for any defects when I spotted a lone pea balanced on the lifts.
I said "hey look, an escaPEA"
No one near me but it didn't half make me laugh for a good hour or so!
Edit: I can't believe how much this has blown up. Thank you everyone I've had a blast reading through the replies π
Theyβre on standbi
Buenosdillas
Pilot on me!!
>When I had slept with three or four girls this way, I asked Nagasawa, βAfter youβve done this 70 times, doesnβt it begin to seem kind of pointless?β
>
>βThat proves youβre a decent human being,β he said. βCongratulations. There is absolutely nothing to be gained from sleeping with one strange woman after another. It just tires you out and makes you disgusted with yourself. Itβs the same for me.β
>
>βSo why the hell do you keep it up?β
>
>βHard to say. Hey, you know that thing Dostoevsky wrote on gambling? Itβs like that. When youβre surrounded by endless possibilities, one of the hardest things you can do is pass them up. See what I mean?β
>
>βSort of.β
I think about this passage from time to time. Itβs from my favorite novel, Norwegian Wood by Haruki Murakami.
Iβm turning 29 next month and Iβve slept with almost 200 woman so far. Iβve been feeling slightly nostalgic lately and I stumbled upon this subreddit. So I guess Iβm venting a bit. Posting this on a throwaway account..
In the past week, I slept with 5 different women and Iβm seeing someone else in a few hoursβ¦
Some proof if youβd like haha: https://imgur.com/a/ntJE9LW
I met a few of them off dating apps recently, and the others I see once in a while. Last week, my best friend asked me, βDonβt you ever get tired of it?β And thatβs when I smirked and repeatedβ¦ βWhen youβre surrounded by endless possibilities, one of the hardest things you can do is pass them up.β And then I added that I was still young and single! Iβm a bachelor! Why shouldnβt I date around? He laughed and said, βFair enough.β
When I think about this passage, itβs just a fleeting observation that never changes the way I live my life. If only I came across it as an extrinsic shock that shook up my reality! But humans are goddamn creatures of habit. At times, I dimly think about how I canβt keep living this way.
βββ
Iβm Asian American. Iβm like 5β7 or 5β8 and I donβt come from money. I do well for myself, but I wouldn't say I'm well off. So height or money doesn't really play a factor here.
I was born here in the states and moved to New York when I was 18. When I was 20, I dated this 26 year old. That relationship fell apart after we travelled together to Paris. You learn a lot about your relationship when you travel with your partner for the first time.
βYou donβt know what you want,β sheβd always tell me. I was heartbroken as hell when it ended and
... keep reading on reddit β‘Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.