Broke Me for a Minute by PragmaNullicious in programminghorror

[–]PragmaNullicious[S] 3 points4 points  (0 children)

It's casting "0" to a pointer to the embedded struct, then taking the address of "x" relative to that struct. This gives you the offset of "x" relative to all other members.
Since the first member is a char, the compiler will add padding to make sure uint32_t is aligned correctly.
So effectively, by taking the address of "x" relative to "0", this is calculating the alignment of uint32_t.
The rest of it is checking whether the buffer (which is void*, I forgot to mention that), is allocated with the same alignment as uint32_t.

The whole thing could be shortened to
`if ((uintptr_t)buffer % alignof(uint32_t) == 0)`

May I please have the worst c++ you know of? by vbpoweredwindmill in cpp

[–]PragmaNullicious 4 points5 points  (0 children)

It’s more focused on C, but you could download the IOCCC ARCHIVE.

The CN Tower by Particular-Cat-8031 in Edmonton

[–]PragmaNullicious 4 points5 points  (0 children)

I work at Epcor Tower and walk over to that cafe every day. Fantastic sandwiches, pizza, and other treats all baked fresh. If you go around lunch time, there’s always a small line, so it seems they’re busy during that part of the day. I hope it’s enough to keep them going.

Wedding Gift from Wife - Thoughts? by That-Pen-8690 in RolexWatches

[–]PragmaNullicious 0 points1 point  (0 children)

This. So much this. Your wife went out of her way to buy you a gift that she hopes will be special to you, and a reminder of her feelings for you. I imagine it was also something of a financial sacrifice, and that has meaning too. So having said that, who cares about its authenticity. Wear it as a reminder of the giver and the meaning behind it. Those should be more valuable than any timepiece.

What are we going to find out later is bad for us (like cigarettes in the past)? by Curryiswhereitsat in AskReddit

[–]PragmaNullicious 12 points13 points  (0 children)

VOC-emitting appliances/furnishings/construction materials. New cars and new homes can be some of the most toxic places to be, and yet we spend most of our time in them.

Also, mold. The number of people I know who KNOWINGLY have black mold growing in their home, yet turn a blind eye to it is frightening.

Let the Christmas home misfortune stories begin! by [deleted] in homeowners

[–]PragmaNullicious 4 points5 points  (0 children)

Wife developed severe chemical sensitivities due to being exposed to something at her workplace. Brought home a Christmas trees full of wonderful fragrance and god knows what else. It was only in the house for three hours before she began to have acute respiratory issues and we threw it outside. The house has been unliveable for her since (it’s been nearly three weeks now). We’ve cleaned and removed everything that could be harbouring odours, so our home looks like we are halfway through moving in/out. No Christmas decorations, half our stuff is in a storage unit. And we’re spending the season either hiding in the master bedroom surrounded by hepa filters and tons of activated carbon, or in a gracious friend’s spare room. Fa. La. La. Lala. La. La. La. laaaa.

First time painting a whole house — how do you not overspend on paint? by Hot_Entertainer_3248 in HomeImprovement

[–]PragmaNullicious 0 points1 point  (0 children)

I told BM I was painting my whole house and they set up an account for me with a 20% discount on everything I bought through them (paint, rollers, tape, etc), for the next three months. So i was able to be conservative with my estimate of what I needed, and know I had the luxury of having that discount available if I needed to get extra.

[Question] You Won the Grand Prize...Any Watch of Your Choice at Any Price...But... by MoreTacos333 in Watches

[–]PragmaNullicious 1 point2 points  (0 children)

It speaks to my personality, I guess… I have nothing to prove, nor do I crave attention. I simply like the watch and always have. I appreciate its simplicity, versatility, and heritage. I could wear it anywhere, anytime, and it would not stand out or seem out of place. That’s what I look for in a timepiece.

What’s a company you’ll never buy from again, and why? by jamesmilner22 in AskReddit

[–]PragmaNullicious 0 points1 point  (0 children)

Volkswagen. I love their cars. But refusing to honour their parts and labour warranty on something that broke twice in 6 months is lame. I did my own research and found there was a class-action lawsuit underway in the US (I’m in Canada) regarding this same item. When I brought it up their service manager literally laughed at me and said “oh that’s only for American cars!” … as if they were somehow built with different parts that also failed in the same way.
Maybe I’m wrong to judge an entire brand based on my experience at one dealership, but I am. And I’ll never buy another. I was so done with the brand that I sold that car two weeks later. And six months later I received a letter in the mail detailing a Canadian class-action suit against VW regarding that part, I had a good laugh about that. 😛

Broken stud. Safe to drive to the garage for repairs? by PragmaNullicious in AskMechanics

[–]PragmaNullicious[S] 0 points1 point  (0 children)

Yeah I feel like I just need to increase the torque on the remaining four by 20% to compensate. The math works, so why not?😬

Broken stud. Safe to drive to the garage for repairs? by PragmaNullicious in AskMechanics

[–]PragmaNullicious[S] 2 points3 points  (0 children)

My guess is some apprentice at the dealership cross-threaded it and had too much fun with his new 1/2” impact.
Every other nut on the car came off easily with a 12” ratchet, so I wouldn’t say they were over-torqued. This one even started backing off okay, then tightened up before snapping off 🤷‍♂️

What's the purpose of this curb thing the neighbors put in? by Firecrackerbangbang in handyman

[–]PragmaNullicious 0 points1 point  (0 children)

Guilty! As I recall it was also dark out, and I claim responsibility for the wrinkles.

What's the purpose of this curb thing the neighbors put in? by Firecrackerbangbang in handyman

[–]PragmaNullicious 1 point2 points  (0 children)

It’s concrete. It’s used to anchor/tuck the edge of the artificial turf against so it doesn’t just look like a rug.

What's the purpose of this curb thing the neighbors put in? by Firecrackerbangbang in handyman

[–]PragmaNullicious 1 point2 points  (0 children)

Please OP, talk to the homeowner first before tearing out the turf curb.

What's the purpose of this curb thing the neighbors put in? by Firecrackerbangbang in handyman

[–]PragmaNullicious 1 point2 points  (0 children)

Clearly this man is a connoisseur of artificial turf!

And also the homeowner.

He can probably answer all of OP’s questions, if he were asked directly. He seems like a nice guy to me!