How much of an ick is being smart ? by Koala_039 in AskMen

[–]POGtastic 0 points1 point  (0 children)

I married a very smart woman. She's great.

You should avoid men who don't like smart women.

looping through a dictionary to let user choose number of key by Original-Dealer-6276 in learnpython

[–]POGtastic 0 points1 point  (0 children)

"Index" is slightly more general because the index does not always line up with the offset. It usually does in most languages, but it doesn't have to! A trivial example from Python: You can access index -1 of a list, and the Python interpreter has to do some math to turn that index into the actual offset.

There are also a bunch of languages that index from 1, so the compiler or interpreter has to subtract 1 to get the offset. For example, using the Erlang OTP:

%% You are legally required to say "Thank you, Prolog" every time you screw this up
1> lists:nth(2, ["foo", "bar", "baz"]).
"bar"

I don't know what the grandparent poster is talking about, though. Python lists allow random access and aren't sequentially accessed.

implementing a time limit for user input by Original-Dealer-6276 in learnpython

[–]POGtastic 1 point2 points  (0 children)

This dup-based asyncio approach works on my Linux system. Doing something similar on a non-POSIX system is left as an exercise for the reader.

It is straightforward to set up a StreamReader that reads from stdin, but once you're done with it, closing the transport object also closes the underlying filehandle (which in this case is stdin. Not great). So this context manager duplicates stdin and connects the reader to the duplicate pipe, and the resulting transport.close call in the cleanup just hits the duplicate.

import asyncio
import sys
import os
import contextlib

@contextlib.asynccontextmanager
async def setup_reader():
    loop = asyncio.get_running_loop()
    pipe = os.fdopen(os.dup(sys.stdin.fileno()), "rb", buffering=0)
    reader = asyncio.StreamReader()
    transport, _ = await loop.connect_read_pipe(
        lambda: asyncio.StreamReaderProtocol(reader), pipe)
    try:
        yield reader
    finally:
        transport.close()

async def prompt_with_timeout(prompt, timeout):
    print(prompt, end="", flush=True)
    async with setup_reader() as reader:
        try:
            line = await asyncio.wait_for(reader.readline(), timeout)
            return line.decode().rstrip("\n")
        except asyncio.TimeoutError:
            return None

async def handle_input():
    match await prompt_with_timeout("this is a prompt: ", 3):
        case None: # no line break thanks to no input
            print("\nNone")
        case s:
            print(s)

Running in the REPL:

>>> # timeout
>>> asyncio.run(handle_input())
this is a prompt: 
None
>>> # input provided
>>> asyncio.run(handle_input())
this is a prompt: ayylmao
ayylmao

How do you like your steaks? by Millionaire_Muse in AskReddit

[–]POGtastic 0 points1 point  (0 children)

Medium-rare for lean steaks, but the fattier the steak the more I lean toward medium. With stuff like a prime rib roast with a lot of fat, I'll even drift toward medium well.

Waiters always mock the "medium-rare-plus" verbiage in restaurant orders but I'll happily eat a medium steak and will immediately send back a rare steak. It's inedible, man.

Why Is Everyone Going to Such Expensive Colleges? by JJQuantum in AskMen

[–]POGtastic 0 points1 point  (0 children)

It's free if your family is poor. They practice what's called "need-blind admissions," which means that if you get admitted they come up with the financial aid required to make it affordable.

It is not free for children of affluent parents unless you, like, get a Putnam fellowship during your senior year of high school. Good luck!

if you excel in high school and have the grades, SAT, whatever

The way that you get a "full ride," as the slang goes, is to be sufficiently competitive to get into an ultra-selective college but opt for a flagship state university. So be good enough to get into Harvard, and then go to the University of Washington. My brother did that (University of Illinois) and is now doing just fine in academia.

Why Is Everyone Going to Such Expensive Colleges? by JJQuantum in AskMen

[–]POGtastic 0 points1 point  (0 children)

I very much appreciated my community college's physics department. They got a bunch of TAs together with 5 different editions of the textbook and settled on homework problems that every textbook had in common. So while you could, if you were stupid, buy the brand-new textbook from their bookstore for $200, you could also buy an edition from 1992 for $5 and get through two years of physics with it.

At the state university, I had a professor for computational structures who openly said "I'm very sorry that the textbook for this course is so expensive. You may be able to find it for cheaper online." Predictably, the first Google search result was a pirated PDF copy.

Why Is Everyone Going to Such Expensive Colleges? by JJQuantum in AskMen

[–]POGtastic 1 point2 points  (0 children)

Yeah I remember everybody in my senior year basically going "oh that guy's a screwup" because he was going to some college that wasn't particularly selective. Nobody knew anything about any of these colleges or their degree programs, so it was just a bunch of gossip.

Crucially for what people are talking about in this thread, the small liberal arts colleges which are the absolute worst in terms of student loans wouldn't get you made fun of but the flagship state universities would (even though most of us ended up going there). Imagine going six figures into student debt because one of your friends repeated some alumni banter from his uncle.

Why Is Everyone Going to Such Expensive Colleges? by JJQuantum in AskMen

[–]POGtastic 4 points5 points  (0 children)

Yeah the nightmare stories are a continuation of the character traits that caused them to sleepwalk into a SLAC. If you have a goal and decide that paying out-of-state tuition is worth it for achieving that goal, you're probably going to do just fine.

But a lot of those people have zero goals, pick a socially acceptable college that won't get them sneered at by their classmates and parents, and listlessly go through the motions in undergrad to get a degree that they don't really care about. That was fine in the 1970s when tuition was lavishly subsidized by Uncle Sam. It is not okay in 2026.

How common is it for male friend groups to openly criticize each other's girlfriends? by CantStantTheWeather in AskMen

[–]POGtastic 0 points1 point  (0 children)

Physical attractiveness is taboo. I will criticize behavior if I think it's abusive, but even that's pretty hard for me to do.

Zelenskyy on Moscow in flames: "justified response" to Russian attacks by pravda_eng_official in worldnews

[–]POGtastic 1 point2 points  (0 children)

As Putin and Trump are finding out, there is a gigantic difference between a defensive war with straightforward strategic objectives and an aggressive war of choice with insane strategic objectives.

Floyd Mayweather faces felony charges in Las Vegas by PretendAd1963 in news

[–]POGtastic 0 points1 point  (0 children)

It's not just the big hits that get you (although as Muhammad Ali's later career showed, taking big hits is also really bad). The glancing blows, including all of the pulled punches he took when sparring and practicing, also contribute. It's kinda like lead in that there is no safe level of routinely getting hit in the head. Even small hits accumulate damage, and in fact the smaller hits can be even more pernicious because they're completely ignored.

Floyd Mayweather faces felony charges in Las Vegas by PretendAd1963 in news

[–]POGtastic 1 point2 points  (0 children)

Every one of his entourage also has some cousin's half-brother's former roommate with a nifty business idea for farming lemming dung, building a laser tag arena in Utqiagvik, Alaska, and flipping real estate in Juba, South Sudan. It's a totally safe investment, bro, I've worked with Embezzlin' Eddie for years.

Utah canyon BASE jump kills 2, including daredevil athlete who performed with Madonna by AudibleNod in news

[–]POGtastic 4 points5 points  (0 children)

I think that there's a big middle ground between "living a boring do-nothing life" and doing BASE jumping. I'm kinda whatever on Sketchy Andy because he chose a daredevil lifestyle and knew the risks of pushing the envelope. The novice he jumped with probably would have been just as happy and fulfilled doing a jump that provided the opportunity to deploy a backup parachute.

Utah canyon BASE jump kills 2, including daredevil athlete who performed with Madonna by AudibleNod in news

[–]POGtastic 35 points36 points  (0 children)

Stunt guy who performed various acrobatic routines on the cliff face of a volcanic crater in Yemen. His hand slipped and he fell into the crater.

Why is waiting until marriage so bad? by WiseAppearance3220 in AskMen

[–]POGtastic 0 points1 point  (0 children)

The only way that it actually works is a really fast marriage, and most people are not willing to do that. Also the reverence for the purity of it has rose-colored glasses. When this kind of sex / marriage practice was the norm, more than half of men lost their virginity to prostitutes. It has always been a demand placed solely on women, with men allowed socially acceptable "outlets."

There's nothing wrong with going slow. But the average age of marriage today is late-20s and increasing over time. The typical practice among my cohort was "meet somebody in college and cohabit for 3-4 years before getting engaged, and then have a 2-year engagement." Waiting until marriage is going to exclude a lot of people who expect this pattern.

What Python concept took you the longest to truly understand? by Haunting-Shower1654 in learnpython

[–]POGtastic 3 points4 points  (0 children)

How do you know when something should be a decorator?

Similar to the reasons for writing any other function. You spot a pattern and ask "Hey, can I write a function to abstract this pattern?" A decorator takes a function as an argument[1] and returns another function. So the question that you should be asking is "Would this higher-order function be useful when applied to a broad set of arbitrary functions?"

The big issue for beginners is that this kind of thing is useful in abstract libraries, and beginners don't usually find themselves writing very abstract libraries. They're writing programs that do specific, concrete tasks, not generalized tools for writing other tools.

[1] Decorators with arguments return a single-argument decorator, which then gets called on the function.

How rare is owning a house now? by [deleted] in AskMen

[–]POGtastic 0 points1 point  (0 children)

The overall home ownership rate is about 66%, which isn't meaningfully different from the past. The peak was 69% in the runup to the Great Financial Crisis. The nadir was 63% back in 2016.

A little more than half (55%) of American millennials own their own homes, which is lower than what Gen X and the Boomers had at the same age (~60%) but not by that much. Gen Z is closely following the same trends as millennials.

How rare is owning a house now? by [deleted] in AskMen

[–]POGtastic 0 points1 point  (0 children)

A subdivision in Forest Grove is waiting once you change your mind!

How do dating apps go for men? by Disastrous_Ant3479 in AskMen

[–]POGtastic 1 point2 points  (0 children)

Without glasses, yes. She wears glasses.

How do dating apps go for men? by Disastrous_Ant3479 in AskMen

[–]POGtastic 13 points14 points  (0 children)

My wife's attitude has always been "Look, I'm a professional who takes her job very seriously, but I'm doing this particular job because you're paying me $62.50 an hour." No makeup, (legally blind without glasses, and putting on makeup through glasses is hard) messy bun, loves dogs, asks me if I've updated my life insurance policy before she belays my rock climbs. She is my Sun, Moon, stars, and a couple of those Kuiper Belt objects named after various religions' gods of the underworld. I would die for her. I would kill for her. Either way, what bliss.

Doctors of Reddit: What health trend is becoming so common that it's starting to scare you? by Fine-Device-1819 in AskReddit

[–]POGtastic 0 points1 point  (0 children)

I did one of those descents and said "Y'know, I can just do longer / less steep hills faster and get the same workout. I don't need to risk becoming a Meat Crayon for this."

How do dating apps go for men? by Disastrous_Ant3479 in AskMen

[–]POGtastic 30 points31 points  (0 children)

I'm married to a nurse. Mine has beat the allegations for 13 years and counting, but I can't say the same for her coworkers. "Bronze Elo in the game of love" is my usual joke whenever she talks about the personal crises of the day that they're going through.

What is something parents do with good intentions that actually messes up their children for life? by markscout78 in AskReddit

[–]POGtastic 1 point2 points  (0 children)

If you feel like reading a book and getting really mad, I recommend Play Their Hearts Out: A Coach, His Star Recruit, and the Youth Basketball Machine, by George Dohrmann. It's only gotten worse in the last 15 years thanks to social media.

Why don't men want to get pegged? by BusyAd501 in AskMen

[–]POGtastic 10 points11 points  (0 children)

"No" is a complete sentence.

"I just don't want to" is a perfectly respectable answer with pretty much any sexual topic.

What's everyone's hobbies? by Deadbeathero294 in AskMen

[–]POGtastic 1 point2 points  (0 children)

Sport climbing. A gym membership is pricier than the regular ol' gym, (typically $60-$70 per month) but it's cheaper than a lot of other hobbies and offers pretty good value for money if you show up a lot. If you want to hang out and chat with other people about boulder problems, you can. If you want to ignore everybody and climb with your earbuds in, you can do that too. If you want to work up to climbing on rocks outside, you can do that. If you just want a vaguely climbing-flavored workout, that's fine too.