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.

programmer_humor

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

PrettyFlyForAFatGuy , in I meant to type "npm run dev"... What will happen now?

Your code will be minified and your git history deleted

cheddar , in Companies updating their websites
@cheddar@programming.dev avatar

Also:

they: you can find the solution for your problem <a href=“/some-link”>here</a>

clicks on the ‘here’ link

404

OldWoodFrame ,

This happened at my work with internal docs as we switched from an ancient intranet to a new service that had a ton more features but no backwards compatibility so all the pages got updated to PDFs with helpful links that went nowhere and it caused chaos for like 3 months.

Forester , in Alcohol is my way to turn myself on and off again
@Forester@yiffit.net avatar

And what email are you sending us in from?

Outlook

And which Outlook email account are you sending that from

Outlook

For your Outlook account does it say something like [email protected]?

No it just says Outlook

subignition ,
@subignition@fedia.io avatar

"What do you tell someone to type when you want them to send you an email?" should work if the person has irl or phone social connections, which is still the case for a lot of older folks

Zoop ,

Outlook.com, duh!

Forester ,
@Forester@yiffit.net avatar

I’m glad you get it!

Forester ,
@Forester@yiffit.net avatar

You would think that wouldn’t you? However you may be surprised to learn, they responded with outlook.com

subignition ,
@subignition@fedia.io avatar

I'm not surprised, just disappointed.

smeg ,

“Email address” is the phrase you’re looking for!

Forester ,
@Forester@yiffit.net avatar

Yes no clearly clearly. I never would have tried that. Thank you for your insight. I don’t know how I would have missed that. No clue just pure flabbergasted over here

s12 , in COMEFROM

PLEASE COMEFROM 🏷

JCreazy , in Someone escaped the Matrix

As I get older, farming seems more enjoyable than dealing with technology. Sometimes it’s nice to just slow down.

azertyfun ,

The kind of farming that makes any money isn’t slow work.

It is, however, tangible work with tangible results. Unlike spending months changing the polarity of nanoscopic silicon structure for the non-appreciation of an utterly clueless salesperson whose braindead ideas will have left the world in a worse state than you found it despite anyone’s best efforts.

I should seriously get into woodworking. Kidding. Sorta.

match ,
@match@pawb.social avatar

remember when you would type a few lines of code and then a widget would appear immediately and you’d feel a tiny spark of emotion?

Rentlar , in What the heck is a god dang cloud?

Do ah look lack ah know hwat a Onedrive is?

bamfic , in Happens all the time

i dislike rust, but have to give them credit for helpful error messages. not quite racket level but impressive

crispy_kilt ,

What made you dislike it?

bamfic ,

the syntax.

henfredemars , in Naming is hard

It’s even funnier when something like this happens to me and our IT guy goes I don’t remember installing that version…

goferking0 ,

Probably didn’t, it’s microsofts dumb roll out of their updated with functionality removed deployment

Dhs92 ,

Took them almost a year to add the ability to open .eml files in the new client.

Fuck_u_spez_ ,

That’s because the new one is just the existing web app that loads inside an Edge instance so they were basically starting from scratch. I realized that when I discovered I couldn’t open the new version on my laptop that I had uninstalled Edge from.

Oh, and MS is killing the old version. Joy.

DumbAceDragon , in Not really sure whether S-expressions or Python indentation-based scoping get more hate...
@DumbAceDragon@sh.itjust.works avatar

I don’t get why people hate semantic whitespace. The whitespace would be there anyway, and if anything it’s easier to read as long as you avoid 15 nested if statements, and you’re not using a dynamically typed abomination like python.

S-expressions are a hack because the Lisp devs didn’t know how to make an actual compiler, and instead had the users write the syntax tree for them. (For legal reasons I am being facetious).

In all honesty, I can understand the reason people love s-expressions, but to me they’re just unreadable at a glance.

Traister101 ,

Semantic whitespace is awful because whitespace (something that you can’t actually see) has meaning in how the program runs. Braces { } for scopes gives you the ability to easily tell at a glance where a scope ends. Whitespace doesn’t allow for that. Especially, especially when you can accidentally exit a scope (two new lines in a row with Python) and it’s not actually an error (Pythons global scope). Yeah formatters and linters make this less of an issue but it sucks… Languages with legible symbols for scoping are significantly easier to reason about, see end symbols in Lua.

isVeryLoud ,

I literally can’t see whitespace, it gives me headaches looking for it. With brackets, I can get bracket matching in my IDE.

yogsototh ,
@yogsototh@programming.dev avatar

S-expressions are a hack because the Lisp devs didn’t know how to make an actual compiler, and instead had the users write the syntax tree for them. (For legal reasons I am being facetious).

Just for anyone thinking you are serious; en.wikipedia.org/wiki/M-expressionI love how S-expression existed.

McCarthy had planned to develop an automatic Lisp compiler (LISP 2) using M-expressions as the language syntax and S-expressions to describe the compiler’s internal processes. Stephen B. Russell read the paper and suggested to him that S-expressions were a more convenient syntax. Although McCarthy disapproved of the idea, Russell and colleague Daniel J. Edwards hand-coded an interpreter program that could execute S-expressions.[2] This program was adopted by McCarthy’s research group, establishing S-expressions as the dominant form of Lisp.

Corbin ,

And for anybody thinking of implementing M-expressions, look at Wolfram Mathematica, which is the only popular M-expression-oriented language. It turns out that high-level graph-rewriting semantics are difficult to make efficient! (If you want to try, you might also want to look at GHC or other efficient graph-rewriters to see what the state of the art is like outside Planet Wolfram.)

aniki , in Not really sure whether S-expressions or Python indentation-based scoping get more hate...

<span style="color:#323232;">I love python:
</span><span style="color:#323232;">     Fight me IRL.
</span>
Tamkish ,

fine i will take the bait: thats 5 spaces

Barbarian ,
@Barbarian@sh.itjust.works avatar

As long as the next line also has 5 spaces, that’s fine. Python only complains about inconsistency, not the exact number of spaces/tabs.

Buddahriffic ,

Make, on the other hand… Ugh.

smeg ,

What, you don’t like tabs and spaces being syntactically different?

Buddahriffic ,

(Sarcasm/deadpan detected but I’ll respond anyways).

Not when they are visibly the same and the spaces have no other meaning in that context.

Not to mention tabs being annoying in general because of how badly it works to adjust the distance of tab stops. That doesn’t really affect this particular case, but it’s why I generally use spaces instead of tabs.

Most of the annoyance is from vim recognizing that spaces are an error in makefile recipes but still using them unless I copy paste a tab in, including when I hit enter on a line that is using a tab already. It matches the indentation but uses spaces instead of tabs. I’m sure there’s a way to adjust vim config to fix this, but I have yet to acquire the esoteric knowledge required to do so.

ugo ,

If by vim you mean neovim


<span style="color:#323232;">vim.api.nvim_create_autocmd(“fileType”, {
</span><span style="color:#323232;">    group = file_type_group,
</span><span style="color:#323232;">    pattern = “make”,
</span><span style="color:#323232;">    command = “setlocal ts=4 sts=4 sw=4 noexpandtab”,
</span><span style="color:#323232;">})
</span>

Slap this in your config, done

Buddahriffic ,

Nah, it’s just vim in my work env. But thanks anyways, I appreciate that you tried!

Thcdenton , in Let's do micro service

Dude just start with a monolith and part it out as you scale. Of course microservices are a waste of time if you build them right off the bat.

fidodo ,

It’s just not worth it until your monolith reaches a certain size and complexity. Micro services always require more maintenance, devops, tooling, artifact registries, version syncing, etc. Monoliths eventually reach a point where they are so complicated that it becomes worth it to split it up and are worth the extra overhead of micro services, but that takes a while to get there, and a company will be pretty successful by the time they reach that scale.

The main reason monoliths get a bad rap is because a lot of those projects are just poorly structured and designed. Following the micro service pattern doesn’t guarantee a cleaner project across the entire stack and IMO a poorly designed micro service architecture is harder to maintain than a poorly designed monolith because you have wildly out of sync projects that are all implemented slightly differently making bugs harder to find and fix and deployments harder to coordinate.

agressivelyPassive ,

I still have to find a name for this disease, but it’s somewhat like “you’re neither Google nor Netflix”.

Everything has to be Scalable™ even if a raspberry pi could serve 200 times your highest load.

I’m currently involved with a “micro service system”, that has very clear, legal requirements, so we know exactly, how much load to expect. At most, a few thousand users, never more than 100 working at the same time on very simple business objects. Complex business logic, but technically almost trivial. But we have to use a super distributed architecture for scalability…

lemmyvore ,

I’m guessing you already got an answer for that though when you asked about it.

Could be either “oh you’re right let’s not do that”, or “because we want to design for horizontal scalability rather than vertical in case the demand grows later”, or “the client has requested and it’s paying for this feature” and so on.

agressivelyPassive ,

It’s because they think it’s what you’re doing for a large project. Simple as that. There’s no future demand, the client doesn’t care, and I’m not right because they said so.

sushibowl ,

Micro services always require more maintenance, devops, tooling, artifact registries, version syncing, etc.

The initial transition is so huge too. Like, going from 20 to 21 services is no big deal, but going from 1 service to 2 is a big jump in the complexity of your operations.

lemmyvore ,

Micro-services and monoliths sit at opposite extremes though. There are other takes in-between, like multiple services (not micro) for example.

rtxn , in I still don't get buffers

Gee, X11! How come your mom lets you have THREE clipboards?

whats_all_this_then OP ,

Wait is that an actual thing?

rtxn ,

Yes. X11 replaced X10’s obsolete cut buffers (which can be modified by any process) with state-of-the-art selections. There are three selections in X11: a primary, a secondary, and a clipboard.

In modern desktops, the primary selection is overwritten every time you select some text (including in the terminal), which makes its content very ephemeral. You can paste it with the middle mouse button.

The secondary selection is generally not used, but it’s present in the specification, and you can use xclip -selection secondary to access it. Wayland doesn’t seem to have a secondary selection.

The clipboard selection is what most people understand to be THE clipboard. You have to write to it explicitly (through a keyboard shortcut, API, or CLI tool), and its content persists until it is overwritten, explicitly cleared, or the X server is killed. While the primary and secondary can only contain text, the clipboard can contain many kinds of data.

whats_all_this_then OP ,

Okay I had no.idea. So on Plasma, I’m guessing when I copy anything, it’s writing it both the primary selection, and the clipboard selection and that’s how it stays in the clipboard manager thingy?

rtxn ,

Not exactly. When you select a text and copy it, the two selections will end up containing the same text, but you can write to either selection without affecing the other by using an API, e.g. a website’s “copy to clipboard” button, or xclip/wl-copy.

Clipboard managers with a history feature are an altogether different layer on top of the standard selections. Plasma’s clipboard manager only cares about the clipboard selection, and even then, there are exceptions (e.g. copying a password for KeepassXC doesn’t save it in the history).

stepan ,

Plasma has a setting to synchronize selection and clipboard or something like that.

QuazarOmega ,

In modern desktops, the primary selection is overwritten every time you select some text

( °O°)
You just opened a whole new world for me, it works in Wayland too

JoYo ,
@JoYo@lemmy.ml avatar

then theyre all ignored by x-clip

xD

Miaou , in The IT experience?

My current company’s IT team does not know what CAMM RAM is, does not recognise an nvme ssd inside a laptop, and still talk to us like we’re idiots. I hope you guys here are better than them!

lqdrchrd ,

The worst. Our IT is outsourced to some bottom-of-the-barrel garbage company, and they both have no idea what they are doing and work in a different timezone, so you have to wait a working day for responses like ‘did you try turning it off and on again?’. Everyone just emails the head of IT with their issues, which defeats the whole point of the system.

Ephera ,

Same. At some point, I learned that the bottom-of-the-barrel garbage company, that does our IT support, is apparently one of the most successful IT support companies on the planet.

I guess, the way to get there, is to not actually provide IT support. You just have to get paid for it.

lightnsfw ,

Yea, hire a bunch of underpaid undertrained peons to take support calls from the rest of your underpaid untrained peons. If an exec has a problem they get to bypass the helpdesk and go straight to someone that knows what they’re doing so they never see how bad things are. $$$

Linkerbaan ,
@Linkerbaan@lemmy.world avatar

CAMM RAM is nowhere near mainstream yet so that’s understandable. NVME should be known though.

Don’t forget to praise them every day for your company not spontaneously combusting.

lud ,

Yeah, its specification was finalised only 6 months ago.

ryannathans ,

I don’t even think there’s a laptop that uses it yet

akakunai ,

Hell, even Dell who came up with the standard chose to switch to soldered memory on the brand new XPS laptops instead of using their own CAMM standard ^because ^money.

ryannathans ,

If they just installed decent memory from factory you wouldn’t need swappable memory modules

Linkerbaan , (edited )
@Linkerbaan@lemmy.world avatar

When something isn’t in mass production yet it costs a ton extra to make so I’m going to do a hot take and give Dell a pass.

Also soldering remains unbeatable when it comes to making the thinnest and lightest device possible.

Miaou ,

My laptop and I are very real! At least my laptop, from last year (a dell as someone mentioned). I even got to know how you screw one in and out since my IT basically told me to go fuck myself when I had to upgrade my laptop.

Miaou ,

Oh but it did burn down too! Turns out that installing Microsoft product on everything does not protect you from cyber attacks (rather the opposite).

But now I’m protected from the very dangerous UDP packets the machines we sell send, much safer.

WhereGrapesMayRule , in Unicode

I would have sex with this bumper sticker.

Imgonnatrythis ,

Sir, This is a Wendy’s parking lot.

WhereGrapesMayRule ,

You’re just making it worse.

DreadPotato ,
@DreadPotato@sopuli.xyz avatar

You’re just making it worse better.

RavenFellBlade , (edited ) in Life Hack
@RavenFellBlade@startrek.website avatar

I’d love to know what this would actually do.

Edit: Thanks for the responses and lively discussion!!

BombOmOm ,
@BombOmOm@lemmy.world avatar

Assuming the accounting system this thing links with both does not protect from SQL injection attacks (many don’t, despite it being easy to protect against) and also has a table named “Bills” with a field named “amount”; what this would do is go through every single Bills record and half the value in the amount field. This would completely fuck the system, particularly when it came to billing and tax filing as the numbers for accounts billing and receivable wouldn’t even come close to matching each other. The accounting department would have a hell of a time fixing the damage.

not_that_guy05 ,

EOM recon will be a bitch.

Aquila ,

Need to throw a rand() in there to make it less easy to unfuck

Gork ,

In the amount/2 term?

Mic_Check_One_Two ,

Yup. Rand() chooses a random float value for each entry. By default I believe it’s anywhere between 0 and 1. So it may divide the first bill by .76, then the second by .23, then the third by 0.63, etc… So you’d end up with a completely garbage database because you can’t even undo it by multiplying all of the numbers by a set value.

proper ,
@proper@lemmy.world avatar

Satan?

Buddahriffic ,

Also, by dividing by a number between 0 and 1, you increase the amount it looks like it billed. So income will look like it’s higher than outgoing funds, which will raise suspicions of embezzlement. And if someone actually is embezzling, whatever accounting tricks they’ve been using to hide it might just stop working because everything might need to be examined with a fine tooth comb. “Oh, the billing numbers aren’t right, and also it turns out the invoice numbers aren’t right either. Billing issue was tracked to a hack, but what’s going on with these invoices?”

affiliate ,

if you’re trying to be malicious, wouldn’t it be better to multiply by Rand() instead of divide by Rand()?

assuming there are a decent number of recorded sales, you’d end up seeing many of the calls to Rand() returning values very close to 0. so, if you’re dividing by those values, you’d end see lots of sales records reporting values in the thousands, millions, or even billions of dollars. i feel like that screams “software bug” more than anything. on the other hand, seeing lots of values multiplied by values close to 0 would certainly look weird, but it wouldn’t be as immediately suspicious.

(of course a better thing would just be to use Rand() on a range other than [0,1])

lightnsfw ,

Couldn’t they just *2 all the bills from before this was ran and straighten it out?

dfc09 ,

I imagine they could if they knew exactly what you did and when, but if it doesn’t get discovered until later and nobody knows what happened, it would probably be a bitch to figure out

T156 ,

It seems like it would be fairly easy to find. All you need to do is find out where the price drops massively, and work backwards from there, since it doesn’t change the code going forward.

SchmidtGenetics ,

Pretty sure it would be obvious to anyone working there that chicken tenders are $10 not $5. Even a quick glance at any single bill would show the issue.

DrJenkem ,
@DrJenkem@lemmy.blugatch.tube avatar

No it would change the value of all past bills, future bills would still be correct.

SchmidtGenetics ,

And anyone who looks at a past bill would see half price tenders.

DrJenkem ,
@DrJenkem@lemmy.blugatch.tube avatar

No. The bill given to the customer would still show the correct amount.

And if anyone looked at previous bills from the backend, they would see normally priced chicken tenders. The total for the bill would be wrong though.

SchmidtGenetics ,

Bill

2x orders chicken tenders $10 =20

Bill total $10 - 20/2 = 10…

Huh… I wonder what the issue is……

DrJenkem ,
@DrJenkem@lemmy.blugatch.tube avatar

Yeah, obviously the issue can be discovered. My point is that it’s not going to be immediately discovered by the cashier or a customer. It’ll probably not get discovered until the accountant comes by and notices the discrepancy.

dan , (edited )
@dan@upvote.au avatar

does not protect from SQL injection attacks (many don’t, despite it being easy to protect against)

Every modern database library automatically protects against SQL injection, usually by using prepared statements (where the query with placeholders, and the placeholder values, are sent as two separate things). so a system would have to be written extremely poorly to be vulnerable to it.

This post is just a joke as developers should hopefully be aware of the OWASP top 10 security vulnerabilities.

Edit: Bad developers will do bad things, but any reasonable developer should be well aware of these risks.

r00ty Admin ,
r00ty avatar

Well no. If the programmer uses prepared statements, they are protected. If they use a prepared statement but actually just put their own unsanitized statement in there and execute it, it's not protected.

Now, I'd like to say it is 2024 and everyone should be using AT LEAST prepared statements for security. I've seen people doing some scary things in my time, and that includes quite recently.

dan ,
@dan@upvote.au avatar

Bad developers will do bad things, but most DB framework documentation points people towards the right way to do things, which is why I said it’s not common any more.

DrJenkem ,
@DrJenkem@lemmy.blugatch.tube avatar

Bad developers are common though. And good documentation won’t stop a bad developer from doing a bad thing.

I agree that SQLi isn’t as common as it once was, but it still very much exists.

trxxruraxvr ,

Every modern database library automatically protects against SQL injection,

No. Every modern library allows using prepared statements, but very few (of any) force using them. If the developer doesn’t use them the libraries won’t do shit to protect you.

dan ,
@dan@upvote.au avatar

What I meant is that not many people write raw SQL in product code any more, other than for analytical purposes (which are often in a system like Apache Airflow rather than in product code). ORM systems have mostly taken over except for cases where you really need raw SQL for whatever reason.

psud ,

Practically every dev learnt SQL and it’s really easy to put hands crafted SQL in code so it’s an easy mistake to make

ricecake ,

Oh sweet summer child.

First, injection attacks are third on the owasp list, although they do roll xss into it too, which changed the name, since “shit sanitization on input” and “shit escaping before use” are the cause of both.
owasp.org/Top10/A03_2021-Injection/

Secondly, SQL injection is freakishly common and easy. I don’t know of any database libraries that prevent you from directly executing an SQL literal, they just encourage parameterized statements.

I have personally run into plenty of systems where people build SQL via string concatenation because for whatever reason they can’t use an orm or “proper” SQL generator.

You can find them in the wild fairly often by just tossing ’ or 1=1;– into fields in forms. If it gets mad in a way that doesn’t make sense or suddenly takes forever, you win!

Don’t do that though, because it’s illegal.

dan ,
@dan@upvote.au avatar

Secondly, SQL injection is freakishly common and easy.

Do you have any recent examples of major SQL injection holes?

DrJenkem ,
@DrJenkem@lemmy.blugatch.tube avatar

https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=sql+injection

And without giving away specifics, I’ve personally found SQLi vulns in the wild within the last 5ish years.

ricecake , (edited )

securityweek.com/millions-of-user-records-stolen-…

darkreading.com/…/critical-security-flaw-wordpres…

tenable.com/…/cve-2023-48788-critical-fortinet-fo…

www.cisa.gov/news-events/…/aa23-158a

nvd.nist.gov/vuln/search/results?form_type=Advanc…

You can fiddle with the nvd search settings to find whatever severity score you like, or filter by execution parameters.

nvd.nist.gov/vuln/detail/CVE-2024-1597

That one was a treat when I check under critical, since it’s an injection attack that can bypass parameterized query protections for the database driver, which is why “defense in depth” and “always sanitize your fucking inputs” are such key things to remember.

I hope that provided what you’re looking for, and maybe increases your awareness of SQL injection. 😊

dan ,
@dan@upvote.au avatar

Great comment. Thanks!

Kerb , (edited )
@Kerb@discuss.tchncs.de avatar

its an sql injection attack.
its rather unlikely that it works in a modern app.

assuming this would work,
it injects a command in the sql database.

it is assumed that the app runs a sql querry with the input field as a parameter e.g.
INSERT INTO “bills” (item, ammount, tip) VALUES (“steak”, “20,00 $”, “content of the custom tip goes here”);

the semicolon indicates the end of the querry,
so the the text would cause the app to run an unfinished querry, and then start a new querry that messes up the content of the bills table.

some_guy ,

Further: xkcd.com/327

RavenFellBlade ,
@RavenFellBlade@startrek.website avatar

Is that Bobby?

diffcalculus ,

Nothing. For one, it won’t let you enter letters. Two, the table structure to these POS systems are more nuanced than a simple bills table with am amounts field.

It’s amusing and all, but it’s not something you can do.

Source: work with, and develop around, these types of POS systems.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines