There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

lemmy.ml

Sunny , to youshouldknow in YSK about SiftRSS, an RSS Feed Filter that allows you to include, exclude and even use regex to control your RSS feeds. It even works for podcasts!

Super neat ! 🙌

Also, might just be me, but the

looking at Reeder on X devices.

The X for me is just a box with an X inside of it. Not sure what it’s supposed to be there.

Stovetop ,

Usually when I see things like that I assume it is supposed to be Apple. MacOS has the Apple logo embedded in system fonts and for some reason people just use it online as if everyone is on an Apple device.

UckyBon ,

Is this an X for you too? Because that would be funny (it’s Twitter’s logo).

Sunny ,

Yeap, still the square box with an X inside of it.

Stovetop ,

I see a Chinese character I don’t recognize, with the radical for fire in it.

GenderNeutralBro ,

It’s an Apple logo. It only exists on Apple devices. emojipedia.org/apple-logo

Probably better to use the generic red apple if you want to use an emoji: emojipedia.org/red-apple

BoisZoi OP ,
@BoisZoi@lemmy.ml avatar

On Apple devices, it will appear as the Apple Logo: You can have it change a term to it with the following link: https://www.macrumors.com/how-to/type-apple-logo-mac-iphone-ipad/

pineapplelover , to piracy in Gog games has now become a invite only site

Everybody getting fomo here hee hee

corsicanguppy , to memes in Another Advertising

‘Advertising’ isn’t a countable like ‘whopper’ or ‘advertisement’. That’s like saying ‘seven trafficks’.

zea_64 , to programmer_humor in You can certainly change it. But should you?

It makes more sense if you think of const as “read-only”. Volatile just means the compiler can’t make the assumption that the compiler is the only thing that can modify the variable. A const volatile variable can return different results when read different times.

fl42v OP ,

I thought of it more in terms of changing constants (by casting the const away). AFAIK when it’s not volatile, the compiler can place it into read-only data segment or make it a part of some other data, etc. So, technically, changing a const volatile would be less of a UB compared to changing a regular const (?)

Scoopta ,
@Scoopta@programming.dev avatar

const volatile is used a lot when doing HW programming. Const will prevent your code from editing it and volatile prevents the compiler from making assumptions. For example reading from a read only MMIO region. Hardware might change the value hence volatile but you can’t because it’s read only so marking it as const allows the compiler to catch it instead of allowing you to try and fail.

humbletightband ,

I will not tell my kids regular scary stories. I will tell them about embedded systems

suzune ,

When you program embedded you’ll also dereference NULL pointers at some point.

More...Some platforms can have something interesting at memory address 0x0 (it’s often NULL in C).

humbletightband ,

I was thinking about telling them how in embedded systems it’s a good practice to allocate the memory by hand, having in mind the backlog, but yours will come first

Scoopta ,
@Scoopta@programming.dev avatar

In amd64/x86 kernel space you can dereference null as well. My hobby kernel keeps critical kernel structures there XD.

mox , (edited )

AFAIK when it’s not volatile, the compiler can place it into read-only data segment

True, but preventing that is merely a side effect of the volatile qualifier when applied to any random variable. The reason for volatile’s existence is that some memory is changed by the underlying hardware, or by an external process, or by the act of accessing it.

The qualifier was a necessary addition to C in order to support such cases, which you might not encounter if you mainly deal with application code, but you’ll see quite a bit in domains like hardware drivers and embedded systems.

A const volatile variable is simply one of these that doesn’t accept explicit writes. A sensor output, for example.

TheEntity ,

The very notion of “less of a UB” is against the concept of UB. If you have an UB in your program, all guarantees are out of the window.

fl42v OP ,

I mean, changing a const is itself a questionable move (the question being whether the one doing it is insane)

QuaternionsRock ,

I’ve never really thought about this before, but const volatile value types don’t really make sense, do they? const volatile pointers make sense, since const pointers can point to non-const values, but const values are typically placed in read-only memory, in which case the volatile is kind of meaningless, no?

zea_64 ,

Maybe there’s a signal handler or some other outside force that knows where that variable lives on the stack (maybe through DWARF) and can pause your program to modify it asynchronously. Very niche. More practical is purely to inhibit certain compiler optimizations.

rooster_butt ,

They do in embedded when you are polling a read only register. The cpu can change the register but writing to it does nothing.

QuaternionsRock ,

That seems like a better fit for an intrinsic, doesn’t it? If it truly is a register, then referencing it through a (presumably global) variable doesn’t semantically align with its location, and if it’s a special memory location, then it should obviously be referenced through a pointer.

Conyak , (edited ) to memes in until we meet again!

That is 100% true in a capitalist society. You are measured by your ability to produce.

Edit: Apparently this needs some clarification. You are measured by your ability to produce for your owner.

masterspace ,

It’s also true in the woods, if you don’t do anything useful you’ll just die.

Kwakigra ,

Not true. If I have a group of people and they believe I’m extremely wealthy I don’t have to do anything but promise to share my wealth with them according to how much I value them, making them compete with each other for my affection. This counts as work and it takes skill but I wouldn’t say that doing this is useful.

kamen ,

… or by your ability to steal from others and getting away with it.

Kwakigra ,

This is wishful thinking. People are not paid according to their productivity, although it is a minor factor. People are paid accordingly for a variety of factors including region, negotiating ability, charisma, job demand (the more a job is objectively helpful the less it is paid because people are willing to do it for its own merits), and network if they are commoners. If they are born into the ruling class or have amassed enough wealth to live through arbitrage, there is no requirement to produce anything other than the idea that you are productive.

The owner doesn’t pay proportionally to their worker’s ability to produce, they pay according to how little they can get away with since in order to profit it is necessary to minimize expenses. If two employees are important but the less productive employee refuses to work for less than a certain amount and the more productive employee is satisfied with what they’re being paid, the less productive employee will be paid more.

poopsmith , to programmer_humor in You can certainly change it. But should you?
@poopsmith@lemmy.world avatar

If you have a memory-mapped peripheral where there’s a readonly register, I could see it being const volatile.

Lexam , to programmer_humor in You can certainly change it. But should you?

When you set the port speed to no negotiate.

FruitfullyYours , to programmer_humor in You can certainly change it. But should you?

I’ve used it in the past when having flash memory blocks that could change but you need the compiler to put them into flash memory and not RAM. It’s mainly to get the compiler to stop assuming that it can optimize using the default value.

Restaldt , to programmer_humor in You can certainly change it. But should you?

const…ish

Synthuir ,

constn’t

Slotos ,

I’m giggling like a kid that finally got the candy from the top drawer. It’s beautiful.

dandelion , to memes in And I'll vote for him again
@dandelion@lemmy.blahaj.zone avatar

I’m out of the loop - who is the person with the “Plus” hat? Maybe the same person as in this meme?

Grayox OP ,
@Grayox@lemmy.ml avatar

That would be Dale Earnhardt

dandelion ,
@dandelion@lemmy.blahaj.zone avatar

Thank you! Is there a reason Dale Earnhardt is in these memes? Is he a leftist Nascar driver? (Maybe your video will answer my questions, but I don’t have the time to watch an hour long video essay right now, though I’m quite interested and hope to in the future, thanks for the link!)

I see he died in 2001, so all the reasons I could think of as to why he’s in two memes representing the Left are falling short …

EvacuateSoul ,

He was going left his whole career.

dandelion ,
@dandelion@lemmy.blahaj.zone avatar

omg 🤦‍♀️

XEAL , to programmer_humor in You can certainly change it. But should you?

What is the context of the original image?

isVeryLoud ,

Could be simply a way to make sure the button never moves again. I would have simply taken out the knob, personally.

octobob ,

I work on industrial controls. Very likely that the switch is momentary, meaning it’ll go back when released.

Sometimes there’s a little piece of plastic in them to remove the momentary setting, but this works too lol. Fuck it, it’s maintenance.

isVeryLoud ,

That actually makes sense, thank you for the tidbit!

Still kind of an overkill solution haha

hstde ,

It could be about sending a message.

A missing knob is easy to fix. Bolting a wrench to the housing holding the knob in place is very explicit. It screams “don’t touch”

isVeryLoud ,

Idk to me it screams “solve this puzzle and win a free wrench” /s

I like the creativity of it, and it does solve the problem in a way that’s user-safe. I thought of removing the knob because that’s what I do with my barbecue as I store items on the grill when not in use. Remove knobs, put on grill, close barbecue, cover.

Omega_Haxors ,

Idk to me it screams “solve this puzzle and win a free wrench” /s

What too many video games does to a mfer 😄

Fubarberry ,
@Fubarberry@sopuli.xyz avatar

I’m sure they just needed a way to lock the selector knob to the primary position, and didn’t want to rewire it.

octobob ,

Drills and taps two holes, adds a metal strap, and sacrifices a tool to save a 5 minute fix of jumping over the contact with a 2" piece of wire lmfao

Fubarberry , (edited )
@Fubarberry@sopuli.xyz avatar

A lot of people won’t touch electrical, and the problem with modifying the wiring is you need to be able to clearly document or show what was changed in case it needs to be reversed later.

This is ugly, but it’s immediately obvious how to reverse it to anyone who looks at it. And that pipe wrench probably wasn’t being used anymore anyways. I doubt they tapped the holes, those are probably just self-tap screws that both drilled the hole and cut the thread as they screwed in. No one will call this an elegant solution, but if it works it works.

octobob ,

“documenting the change” is a pipe dream.

If you’ve ever worked in maintenance, active production, etc, you’ll be lucky to even have schematics. And trust me, there are a lot of hacks of people fucking with controls for 30+ years straight that soooo much of it is full of “fixes” like this, whether it’s something pushing a button in, or pieces of metal instead of fuses, or wires jumping over what’s “in the way” like whole safety systems and e-stops, contactors forced to run, etc etc etc.

wise_pancake , to programmer_humor in You can certainly change it. But should you?

Some people hate that C is dangerous, but personally I like its can-do attitude.

“Hey C, can I write over the main function at runtime?”

Sure, if you want to, just disable memory protection and memcpy whatever you want there! I trust you.

It’s a great attitude for a computer to have.

mox ,

This is sometimes practical, too. For example, hooking and extending functions in compiled code that will never be updated by the original author, while preserving the original executable/library files.

huginn ,

You can do that in memory safe languages too. Kotlin extension functions, for example.

RonSijm , (edited )
@RonSijm@programming.dev avatar

Extension functions are not the same at all. Extension functions are syntactic sugar. For example if you have an extension function like


<span style="color:#323232;">public static class ObjectExtension
</span><span style="color:#323232;">{
</span><span style="color:#323232;">    public static void DoSomething(this object input) { }
</span><span style="color:#323232;">}
</span>

You can call that function on an object by doing object.DoSomething() - Yes. But underneath it’s the same as doing ObjectExtension.DoSomething(object)

That function does not actually become part of the object, and you can’t use it to override existing functions

A closer example of how to do something similar in a memory safe language would be - in C# - using something like Castle DynamicProxy - where through a lot of black magic - you can create a DynamicProxy and fool the CLR into thinking it’s talking to an object, while it’s actually talking to a DynamicProxy instead. And so then you can actually intercept invocations to existing methods and overrule them

Generally overruling existing functions at runtime is not that easy

huginn ,

Ah my bad, misunderstood the use case.

I thought you were talking about keeping an unmaintained library intact but building onto it.

I thought C was a really dangerous way to use that syntactic sugar pattern. Actual manipulation of the bytecode to maintain and extend a compiled binary is wild

mox ,

Actual manipulation of the bytecode to maintain and extend a compiled binary is wild

Just wait until you learn about machine code. :)

huginn ,

I do have a degree in this. I am aware.

This is sometimes practical, too. For example, hooking and extending functions in compiled code that will never be updated by the original author, while preserving the original executable/library files.

Your original comment made it seem more like extensions - extend and preserve. That’s the misunderstanding.

When I said it’s wild to manipulate bytecode I means “wow that’s a terrifying practice, I would hate to check that PR”

mox , (edited )

Fair enough. What threw me is that you said “bytecode”, which is generally not used when referring to hardware machine instructions. My original comment is about patching the in-memory image of a running program or library, replacing machine instructions in order to intercept certain calls and extend their behavior.

I thought my phrase “compiled code” would convey this, but I guess nowadays bytecode-compiled languages are so common that some people assume that instead.

huginn ,

Yeah and part of this is that the domain I’ve been working in for years now is very far from machine code, and I’m probably overly lax with my language here.

The result of being in very corporate app dev - I’m usually talking in much higher level abstractions. My bad on conflating bytecode and machine code

mox ,

Ah, corporate work. I hope they’re treating you well.

huginn ,

Different strokes - some would find what I’m doing hell. I personally love it.

The 260k/yr salary may help alleviate the pain.

wise_pancake ,

That actually sounds pretty cool

Sometimes what I’d like to be able to do is treat part of an app as a core and the rest like user provided scripts, but written and evaluated in the host language and not running an embedded scripting language like lua with all the extra burden.

E.g. you have an image editor and you want the user to be able to write native functions to process the image. Or you have a game engine and you want to inject new game code from the user without the engine being a compiler or the game logic being bundled scripts.

RonSijm ,
@RonSijm@programming.dev avatar

You’d probably use a different approach for that. Like you’d make your program dynamically load all the .dlls in a “plugins” folder -

Then you’d provide some plugin interface for the users to create plugins, for example:


<span style="color:#323232;">public interface IImageEditorPlugin
</span><span style="color:#323232;">{
</span><span style="color:#323232;">    public void BeforeImageEdit(int[,] imageData);
</span><span style="color:#323232;">    public void AfterImageEdit(int[,] imageData);
</span><span style="color:#323232;">}
</span>

And then you can load plugin classes from all the dlls with dependency injection, and execute them though something like this:


<span style="color:#323232;">public class ImageEditor(IEnumerable<IImageEditorPlugin> plugins)
</span><span style="color:#323232;">{
</span><span style="color:#323232;">    public void EditImage(int[,] imageData)
</span><span style="color:#323232;">    {
</span><span style="color:#323232;">        foreach (var imageEditorPlugin in plugins)
</span><span style="color:#323232;">        {
</span><span style="color:#323232;">            imageEditorPlugin.BeforeImageEdit(imageData);
</span><span style="color:#323232;">            // Do internal image edit function
</span><span style="color:#323232;">            imageEditorPlugin.AfterImageEdit(imageData);
</span><span style="color:#323232;">        }
</span><span style="color:#323232;">    }
</span><span style="color:#323232;">}
</span>

This is a very simple example obviously, normally you’d send more meta-data to the plugins, or have multiple different interfaces depending on the kinda plugin it is, or have some methods to ask plugins when they’re suitable to be used. But this way a user can provide compiled versions of their plugins (in the same language as the core application) - instead of having to provide something like lua scripts

SubArcticTundra ,
@SubArcticTundra@lemmy.ml avatar

Agreed. It’s a very adult approach. C hands you a running chainsaw and whatever happens after that is your responsibility. It is also your responsibility to decide when it’s not the right time to use C.

mindbleach ,

C is dangerous like your uncle who drinks and smokes. Y’wanna make a weedwhacker-powered skateboard? Bitchin’! Nail that fucker on there good, she’ll be right. Get a bunch of C folks together and they’ll avoid all the stupid easy ways to kill somebody, in service to building something properly dangerous. They’ll raise the stakes from “accident” to “disaster.” Whether or not it works, it’s gonna blow people away.

C++ is dangerous like a quiet librarian who knows exactly which forbidden tomes you’re looking for. He and his… associates… will gladly share all the dark magic you know how to ask about. They’ll assure you, oh no no no, the power cosmic would never pull someone inside-out, without sufficient warning. They don’t question why a loving god would allow the powers you crave. They will show you which runes to carve, and then, they will hand you the knife.

5C5C5C ,

You have a talent for metaphor.

AVincentInSpace , (edited )

Rust is like a paranoid overprotective guardian. A “mom friend”, of sorts. Always the designated driver of the group, keeps you from staying up too late, stops you from eating things that might be choking hazards without proper precaution, and so on and so forth. You’ll never meet a person more concerned with your health and safety – until, that is, you say the magic word “unsafe”. Suddenly the alter ego that their hypnotist implanted gets activated, and their entire demeanor changes on a dime. BMX biking? Bungee jumping? Inline assembly? Sounds like a great idea! Let’s go, man! Rules are for NERDS! Then the minute the unsafe block ends, they’re back to normal, fully cognizant of the adventure they just went on and thinking absolutely nothing of it. “Whitewater rafting with you guys was really fun, especially the part where Jason jumped into the water and I went after him! I’d best go get the first aid kit, though – that scrape he got when he did that looks like it might get infected. I know he said it didn’t hurt, but better safe than sorry!”

They kinda scare you when they’re like that, if you’re honest.

mindbleach ,

I tried thinking of one for Rust, and ‘the mom friend with a safeword’ is alarmingly accurate.

The secret basement is never locked. It’s fine to go down there, alone. You’ll only be scarred on the inside.

It’s when you go down together that all bets are off.

derpgon ,

I loved C/C++ in university, finally the damn piece of rock we forced into thinking was doing exactly what I told him to do, no more and no less.

humbletightband , to programmer_humor in You can certainly change it. But should you?

I see a Java programmer evolves into a C programmer

otter , to newcommunities in New invertebrates community over at Mander!

Subscribed :)

Feel free to promote on !communitypromo as well!

quinacridone OP ,
@quinacridone@lemmy.ml avatar

Cheers!

Harbinger01173430 , to memes in until we meet again!

I suppose it was the same back in the ancient times but you had to ask the saber kitty if you were worthy of passing your genes or not. /S

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • lifeLocal
  • goranko
  • All magazines