@mcc@mastodon.social
@mcc@mastodon.social avatar

mcc

@mcc@mastodon.social

glitch girl

This profile is from a federated server and may be incomplete. Browse more on the original instance.

mcc, to random
@mcc@mastodon.social avatar

Man though wouldn't it be really funny if a duck liked milkshakes

mcc,
@mcc@mastodon.social avatar

Imagine how cute it would be to watch the duck enjoying its milkshake

mcc,
@mcc@mastodon.social avatar

I have just learned that ducks cannot drink milkshake. All along we have been excoriating the duck, when in truth, the duck was a victim and the truly problematic one was the person feeding the duck the dairy products in the first place. I am crushed by this realization :(

mcc,
@mcc@mastodon.social avatar

@DanadasGrau I don't know what duck butter is. Let me check Google.

…huh! Huh! Well, okay.

mcc, to random
@mcc@mastodon.social avatar

You can now wear gigantic gauntlets on your giant hands. https://mastodon.social/@unormal/112022621325453491

mcc, to random
@mcc@mastodon.social avatar

More cursed C# questions!

We have a P/Invoke method. We want it to pass through a function pointer from the C# to the C side.

We say:
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
public delegate void Callback();

We make that an argument of our P/Invoke method:

[DllImport(Dll, CallingConvention = CallingConvention.Cdecl)]
public static extern void RegisterCEventHandler(Callback c);

If we have a method, we say: RegisterCEventHandler(MethodName);

This works so far. But then—

(1/2)

mcc,
@mcc@mastodon.social avatar

For reasons, we need to not call RegisterCEventHandler directly. We need to call a C#-side RegisterEventHandler() that does some setup. Now there's a question: What signature does RegisterEventHandler have? We think it ought to be RegisterEventHandler(Action c). But when we pass our Action to RegisterCEventHandler, it says: "cannot convert from System.Action" to "OurClass.Callback".

What do we do from here? What magical type does MethodName have, if it isn't Action?

(2/2)

mcc,
@mcc@mastodon.social avatar

Note, you MIGHT ask: Why not just take a OurClass.Callback as the argument to RegisterEventHandler? And the reason we can't is getting this working is a prelude to writing a templated void RegisterEventHandler<T> (Action<T> c), and in this case, we really will need to know what T is :(

There is some magic type that MethodName has before being converted to Action<T> that is compatible with that "public delegate void" type. What is it?

(3/2)

mcc,
@mcc@mastodon.social avatar

It turns out to be very difficult to google for "How do you pass an Action<> to p/invoke?"

futurebird, to random
@futurebird@sauropods.win avatar

Can anyone tell me why that thing bros talk about too much that starts with a B and rhymes with loins is up recently? Without attracting any bots … please?

mcc,
@mcc@mastodon.social avatar

@futurebird It is very easy for someone with many 'oins to manipulate the price of 'oins, and there seem to be no laws preventing this that anyone is following. Amy Castor in this article https://amycastor.com/2024/02/21/the-halvening-is-coming-what-this-means-for-bitcoin/ claims the current reason for the high price is manipulation in advance of a protocol-mandated event called "the halvening" in April, which will meaningfully reduce the financial benefits of running a miner.

mcc,
@mcc@mastodon.social avatar

@futurebird I cannot confirm or deny this theory. I also don't understand why a reduction in their pay would be desirable to perform a pump right before the reduction happens, but 'oin miners do many things that seem illogical to me.

mcc, to random
@mcc@mastodon.social avatar

Filed a "security advisory" issue on Github yesterday and was slightly? surprised to discover you cannot see the security advisories you yourself have submitted. It makes sense they go into some separate queue but I'd have expected I'd have access to the queue for purposes of my own submissions, if for example I wanted to add additional details. Maybe I'm missing something.

mcc, to random
@mcc@mastodon.social avatar

Say I have an API that takes a callback, and I have two functions, one for callbacks with arguments and one for nullary callbacks. I must do it this way. What naming choice would you use to distinguish the two variants? I feel like "nullary" is obscurantist

whitequark, to random
@whitequark@mastodon.social avatar

systemverilog having a normal one

mcc,
@mcc@mastodon.social avatar

@whitequark I'm sorry but could you please clarify the meaning of the phrase "infinite word"

mcc, to random
@mcc@mastodon.social avatar

"This language sucks and is for babies", said my wife (after a full day of writing C++)

"Joe Biden said that and everybody got angry", I said.

"If there's one subject I'm willing to trust Joe Biden on, it's memory problems", she replied.

mcc,
@mcc@mastodon.social avatar

Before you get angry at my wife for failing to Vote Blue No Matter Who you should be aware she is Canadian and (1) cannot vote in our elections and (2) under the Treaty of Ghent is legally allowed to burn down the White House

mcc,
@mcc@mastodon.social avatar

Anyone who's been following me on Mastodon for the last couple weeks has been seeing me posting nonstop about cursed C# and anyone who's been following my wife on Cohost for the last couple weeks has been seeing her post nonstop about cursed C++ and like, one or two people, Zandra and Katelyn maybe, follow both of us on both of these sites and may be by now having a slow dawning realization that all of these posts are about the same program

mcc,
@mcc@mastodon.social avatar

@glyph @jason it seems to me the government buys a lot of software and picking winners of whatever kind can have wide ranging effects. I have not read the white house document.

mcc,
@mcc@mastodon.social avatar

Update: Okay so I've been doing some reading on Wikipedia and it turns out the Treaty of Ghent actually says the Canadians have to stop burning down the White House. What the fuck! That's so boring! I regret the error.

mcc, to random
@mcc@mastodon.social avatar

"rail" is a cross between rain and hail. "light rail" is when it's railing but not very heavily

mcc,
@mcc@mastodon.social avatar

"BRT" is the sound it makes when a large piece of rail lands on a car windshield

mcc, to random
@mcc@mastodon.social avatar

deleted_by_author

  • Loading...
  • mcc,
    @mcc@mastodon.social avatar

    @cliffwade Thanks, that's interesting. One problem is that this appears to be an attempt to modernize GMail's design and what I'd most prefer is for it to be less modern

    mcc, to random
    @mcc@mastodon.social avatar

    In c#, sizeof(T) returns a int32, not a UIntPtr/nuint.

    mcc,
    @mcc@mastodon.social avatar

    @slyecho Oh. That's very useful, thank you

    mcc, (edited )
    @mcc@mastodon.social avatar

    Okay there turns out to be a solution but I can't tell if it makes the situation more or less cursed https://mdon.ee/@slyecho/112019623778803567

    mcc, to random
    @mcc@mastodon.social avatar

    For the last year I've been semi-daily posting "What I'm Listening To Today" links in this thread:

    https://mastodon.social/@mcc/108199886340178151

    The thread is now so long it is increasingly breaking Mastodon, so I am making a new thread, starting here.

    To recap, here's the entirety of the year-one thread in the most impractical possible format: A YouTube playlist containing 246 songs and running for just over 47 hours:

    https://www.youtube.com/playlist?list=PLLIjft6ja7DP_GwDs3XuTbiFmHYTwJWa7

    mcc,
    @mcc@mastodon.social avatar

    What I'm listening to today: "Sleepless", Soul Coughing

    Gosh, I love Soul Coughing. Nobody before or since has ever quite nailed their particular bizarre formula.

    Here's my favorite S.C., from "Irresistible Bliss", the album where they couldn't get their regular producer and M.Doughty talked everyone into a stripped-down sound. It's a quiet lounge song that hits like a truck; if you listen to it on a setup with a real subwoofer it will literally make your walls rattle.

    https://www.youtube.com/watch?v=wLDRgFDcsDc

  • All
  • Subscribed
  • Moderated
  • Favorites
  • bokunoheroacademia
  • tacticalgear
  • rosin
  • Youngstown
  • InstantRegret
  • khanakhh
  • slotface
  • everett
  • GTA5RPClips
  • kavyap
  • thenastyranch
  • DreamBathrooms
  • rhentai
  • Durango
  • HellsKitchen
  • magazineikmin
  • tester
  • normalnudes
  • ethstaker
  • cisconetworking
  • mdbf
  • osvaldo12
  • cubers
  • relationshipadvice
  • lostlight
  • Leos
  • modclub
  • sketchdaily
  • All magazines