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.

crony , in I don't believe Auto Save feature in any software
@crony@lemmy.cronyakatsuki.xyz avatar

:w

:w

:w

:w

:w

i

esc

:w

:w

:w

:w

Average day in (neo)vim

fylkenny ,

You can use :wq only once

victorz ,

So choose wisely. All other editor instances must remain open forever.

Vash63 ,

*per open file

dukatos ,

:x

noeontheend ,

My biggest (mostly) irrational internet pet peeve is the proliferation of people suggesting “:wq” when “:x” is strictly better.

calzone_gigante ,

I use quake style terminals, and often start writing a file and completely forget about it and turn off the computer, and only remember what i left behind when i find the random recovery files around, so :w a lot is quite useful for me.

kender242 ,
@kender242@lemmy.world avatar

Quake? The FPS? I’m confused, though I knew a little about Linux

calzone_gigante ,

Yes, on classic fps you could spaw a console that will drop down from the top os the screen, some terminal emulators allow you to do that.

I like it because then i have the terminal always open that i just draw from the top of the screen with a keypress

On KDE i do that with Yakuake, and on gnome with tilix

Dehydrated ,

You can also use Guake on GNOME or basically on any desktop. I’ve also use it on Cinnamon and it’s really nice.

pkill ,

not mapping semicolon to colon

lel

Commiunism ,

:w before ZZ just to make sure

Anticorp ,

Make all changes

:wq!

Force that bitch!

SorryQuick ,

Is there any reason to use :w other than it being the default? I have mine mapped to CTRL-S and it makes sure to keep me in insert mode if I was in insert mode. Feels way faster and easier to spam than the 4 key presses it takes to execute “:w”.

crony ,
@crony@lemmy.cronyakatsuki.xyz avatar

I’m just used to it and I’m keeping ny time in instert mode at minimum.

marswarrior ,
@marswarrior@lemmy.world avatar

https://lemmy.world/pictrs/image/1c57b14b-6e5c-4f78-ba91-cddfaaaf55a1.png
This will allow you to ctrl+s to save. I tried to add this in a backtick code line/block but it removes part of the syntax.

crony ,
@crony@lemmy.cronyakatsuki.xyz avatar

Sorry but I’m already used to :w stoo much and a lot faster with it than ctrl+s

GBU_28 , in It's that time of the year again!

No closing semicolon, anyone got any extras to throw on this thing?

epyon22 ,

; found this in the back for you should still work though

db2 ,

Can confirm.

Moops , (edited )

At the very least I’d try to clean up that fuzzy condition on behavior to anticipate any bad or inconsistent data entry.

WHERE UPPER(TRIM(behavior)) = ‘NICE’

Depending on the possible values in behavior, adding a wildcard or two might be useful but would need to know more about that field to be certain. Personally I’d rather see if there was a methodology using code values or existing indicators instead of a string, but that’s often just wishful thinking.

Edit: Also, why dafuq we doing a select all? What is this, intro to compsci? List out the values you need, ya heathen ;)

(This is my favorite Xmas meme lol)

mp04610 ,

behavior is an ENUM.

moroni ,
@moroni@lemmy.ca avatar

That’s a table scan, right there. Naughty.

krotti ,

Honest question, which ones wouldn’t it work with? Most add a semicolon to the end automatically or have libraries and interfaces saved me a million times?

jaybone ,

Usually with libraries like jdbc or whatever and prepared statements you don’t need the semicolon.

GBU_28 ,

Other reply s accurate but it’s always a good practice to include the semicolon else you can get

“Bobby tables’ed” look that xkcd comic up

krotti ,

Wouldn’t that still apply, if you can inject straight SQL, such as “query’ OR 1=1?”

docAvid ,

I’m not sure how including a final semicolon can protect against an injection attack. In fact, the “Bobby Tables” attack specifically adds in a semicolon, to be able to start a new command. If inputs are sanitized, or much better, passed as parameters rather than string concatenated, you should be fine - nothing can be injected, regardless of the semicolon. If you concatenate untrusted strings straight into your query, an injection can be crafted to take advantage, with or without a semicolon.

GBU_28 ,

Yep it would only work if you didn’t sanitize a user input string in this case ‘nice’

They could write ‘’; drop table blah;

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

Need to normalize the database. I would add a join to a BehaviorTypes table.

Edit: or, if the only options are naughty or nice, make it a boolean.

takeda ,

You need semicolons if it is a script with multiple commands to separate them. It is not needed for a single statement, like you would use in most language libraries.

mellejwz ,

If you don’t use a semicolon directly in MySQL it won’t do anything until you add it.

takeda ,

In the MySQL client console where you can run multiple commands.

If you add semicolon in language library commands such as fetch() you will get an error.

fmstrat ,

Can we get a SIMILARITY?

angelsomething , in Works on my machine

Literally why docker was invented

takeda ,

Yeah, it “solved” the “it works on my machine” by bundling the machine with the code.

youtu.be/0uixRE8xlbY

Opafi ,

Man, I really was interested in that topic, but that guy really can’t do talks.

takeda , (edited )

What about this? youtu.be/5XY3K8DH55M

Also I created this repo to create a reproducible sec environment for myself. I added other languages, but personally work mostly with python. It is basically resonating for handling all the boiler plate:

github.com/takeda/nix-cde

For packaging in docker I started to use nix2container project as it gives me a greater control over layers. So for example when I package my phyton app I typically use 3 layers:

  • python and it’s dependencies
  • my application dependencies
  • my application, which is very tiny compared to other two, so there is great reuse of the layers

The algorithm mentioned in the video also helps a lot with reuse, but the above is more optimized by frequency of how things typically change.

BTW: today I discovered this github.com/astro/microvm.nix I haven’t play with it yet, but in theory it would let me generate a microvm image (in similar fashion to generate a docker container) which would let me to run my app natively as a tiny VM on EC2 for example, and use only minimum necessary of a typical OS to run it.

SpeakinTelnet ,
@SpeakinTelnet@sh.itjust.works avatar

I have a love/hate relationship with docker. On one side it’s convenient to have a single line start for your services. On the other side as a self-hoster it made some developers rely only on docker meaning that deploying the stack from source is just an undocumented mess.

Also following the log4j vulnerability I tend to prioritize building from source as some docker package were updated far later than the source code was.

Zikeji ,
@Zikeji@programming.dev avatar

The Dockerfile is essentially the instructions for deploying from scratch. Sure, they most likely only exist for one distro but adapting isn’t a huge chore.

You can also clone the repo and build the container yourself. If you want to update say, log4j, and then attempt to build it, that’s still entirely possible and easier than from scratch considering the build environment is consistent.

SpeakinTelnet ,
@SpeakinTelnet@sh.itjust.works avatar

If I’m updating the source code already I might as well build my service from it, I really don’t see how building a docker container afterward makes it easier considering the update can also break compatibility with the docker environment.

Also adapting can be a pita when the package is built around a really specific environment. Like if I see that the dockerfile installs a MySQL database can I instead connect it to my PostgreSQL database or is it completely not compatible? That’s not really something the dockerfile would tell me.

evranch ,

I really don’t see how building a docker container afterward makes it easier

What it’s supposed to make easier is both sandboxing and reuse / deployment. For example, Docker + Traefik makes some tasks so incredibly easy and secure compared to running them on bare metal. Or if you need to spin up multiple instances, they can be created and destroyed in seconds. Without the container, this just isn’t feasible.

The dockerfile uses MySQL because it works. If you want to know if the core service works with PostgreSQL, that’s not really on the guy who wrote the dockerfile, that’s on the application maintainer. Read the docs, do some testing, create your own container using its own PostgreSQL or connecting to an external database if that suits your needs better.

Once again the flexibility of bind mounts means you could often drop that external database right on top of the one in the container. That’s the real beauty of Docker IMO, being able to slot the containers into your system seamlessly due to the mount system.

adapting can be a pita when the package is built around a really specific environment

That’s the great thing about Docker, it lets you bring that really specific environment anywhere and in an incredibly lightweight manner compared to the old days of heavyweight VMs. I’ve even got Docker containers running on a Raspberry Pi B+ that otherwise is so old that it would be nearly impossible to install the libraries required to run modern software.

kratoz29 ,
@kratoz29@lemm.ee avatar

I love Docker because it is the only sane method to selfhost shit with my Synology NAS, and I love my Synology NAS because it is the only Linux interaction that I have (from my old MacBook Pro).

ohlaph ,

Docker has been a savior.

kurwa ,

Now we just need to run docker inside the browser

eatyourglory ,

Ah-ah! Now that’s progress!

some_guy , in Instructions were unclear:gotta be precise with that anotating tool

Had someone verify that wifi was working because he could see his neighbors’ networks. Airplane Mode was enabled. Dunno what he thought he saw.

Same thing with a colleague. The guy told him that he was definitely connected to wifi. It took a lot of probing to confirm that wasn’t true.

Some people just can’t provide valid feedback nor follow simple instructions. I kinda feel like those individuals shouldn’t be allowed to use computers to do their jobs. If you can’t master just pass the basics, sorry. Here’s a pencil and a pad of paper. You can either work the longer way or you can consciously put in the effort to learn this stuff enough for us to help you when you need it.

My own father, who had a doctorate in mechanical engineering: “Now click the Apple menu.” “What’s that?” “It’s the menu that’s an Apple logo in the top left corner of the screen.” “I don’t have that.” “Yes, you definitely have that.” “No, I don’… oh there it is.”

I’m not calling anyone stupid. More that I’m saying people convince themselves that they can’t learn and then shut down.

WeirdAlex03 ,
@WeirdAlex03@lemmy.zip avatar

I mean in fairness to the first one, on most systems it is possible to turn wifi back on without turning off airplane mode (there is in-flight wifi after all)

CanadaPlus ,

I think that’s the trick, right? 1% of a perfectly normal person’s attention looks a lot like a really dumb person. This certainly goes for tech, but also for any number of other fields.

some_guy ,

Insightful. I was commenting about a VIP wrt a power dialog on a mobile device and posited that the reason they didn’t understand a thing must be that they don’t read before dismissing it. I would even say that’s half of 1% of their attention and that makes complete sense. The other 99.5% is focused on the things they consider more important.

01189998819991197253 ,
@01189998819991197253@infosec.pub avatar

Had they read the message, it would have saved them a lot of time waiting for the solution that would have been near instantaneous otherwise. But their 0.5% is more important to them than your 99.5%. Hopefully they’re really good at bringing money into the company, because their ability to save labor money for the company is abysmal.

some_guy ,

Hopefully they’re really good at bringing money into the company, because their ability to save labor money for the company is abysmal.

I was asked to drive 80m to reboot a device when I’d said the previous day that rebooting would fix it (it was a phone; there’s almost no real troubleshooting on the platform). I kept quiet about how financially irresponsible the request was. When I got there, the phone was already turned off for other reasons. At least I got to listen to podcasts while I drove there and back.

01189998819991197253 ,
@01189998819991197253@infosec.pub avatar

And hopefully you got paid for mileage…

nyan ,

Except that 80 metres is only a few carlengths . . .

01189998819991197253 ,
@01189998819991197253@infosec.pub avatar

I read it as miles. If some_guy meant meters, then that would add such a new level of comedy to it hahaha

nyan ,

I’m aware that he probably meant miles, but he still used the wrong abbreviation (should have been mi). Gotta be careful about that kind of thing, although I’m not sure what the tech anecdote equivalent of the Mars Climate Orbiter would be. Someone taking it too seriously, like I’m doing here, probably. 😅

sukhmel ,

To be fair, sometimes the message appears unexpectedly right where you were going to click, and you dismiss it without being able to read.

Maybe some messages should really appear with a dismissal button disabled for several seconds

gamermanh ,
@gamermanh@lemmy.dbzer0.com avatar

kinda feel like those individuals shouldn’t be allowed to use computers to do their jobs. If you can’t master just pass the basics, sorry. Here’s a pencil and a pad of paper.

My wife had her HR rep get pissed at her just yesterday for sending an email to her boss and other higher-ups asking why assistant managers at her company can’t use the computers theyre on all day properly. She had asked for a screenshot of something so she could see what the other person was seeing and they replied with “I can’t do that idk how” and thought that was acceptable?

Luckily the other higher ups told HR to shut up and that she was only mad because it’s her job to ensure basic computer literacy and she clearly didn’t.

People 100% get into the mindset that “well, I already know the basics, so anything I don’t know is advanced user shit so I can’t learn it” and it’s infuriating

some_guy ,

Wow. It’s so easy to get that info from a web search that I’d argue that the response is evidence of the person not doing their job. Good on your wife for calling bullshit and the same for the higher ups who defended her position.

Blackmist ,

Pretty much most of the screenshots I get these days are a photo of somebody’s screen taken on a phone.

Makes me long for retirement or at least a giant solar flare.

graphito OP , (edited ) in Instructions were unclear:gotta be precise with that anotating tool
@graphito@beehaw.org avatar

a tech illiterate old friend of mine in his 60s got tasked with changing his simcard for new one. But the network just didn’t appear. Long story short after 3 hrs of headbashing I asked him to send me the photo of simcard itself

that was a valuable afternoon for my humility

nano-simcard rotated 90 degrees forcefully inserted into standard size simcard frame which is missing micro size simcard frame

alt text: nano-simcard rotated 90 degrees forcefully inserted into standard size simcard frame which is missing micro size simcard frame

note the right side of simcard frame bulging out

for confused in terminologyhttps://ae04.alicdn.com/kf/HTB1z8.sLFXXXXbpXFXXq6xXFXXXQ.jpg

PlexSheep ,

What am I seeing?

graphito OP ,
@graphito@beehaw.org avatar

alt text is added, cheers

JCreazy ,

I used to work at a phone repair shop. The amount of people that put Sim cards in their brand new phone without the tray. We would have to take the phones apart to get their Sim cards out.

graphito OP ,
@graphito@beehaw.org avatar

And when it doesn’t work, they ram it HARDER

and then people wonder how porn stereotypes can be harmful

vox ,
@vox@sopuli.xyz avatar

I’m literally scared of disassembling stuff over like plastic clips while people just feel ok with ramming stuff in like that wha

vaionko ,

Isn’t the “standard” sim card in you pic actually mini-sim? While the standard one is credit card-sized? I think I have a phone somewhere that takes a credit card sized sim actually.

hch12907 ,

To be fair, most people here probably have a mini SIM as their first SIM card.

bolexforsoup , (edited ) in They never let me

spoilerasdfasfasfasfas

sudo ,

Client: “How much is this disaster recovery plan going to cost me?”

Me: “A hell of a lot less than when you don’t have (valid, tested) backups and need them”

FreshLight , in Unicode

It’s like… WE , the viewers have the wrong encoding. Only we don’t know how the owner of the sticker feels about Unicode. They themselves know exactly how they feel about it.

I like that.

VirtualOdour , in Uh...oh...

6 in 10 Americans believe any old nonsense as long as you present it with confidence.

AngryishHumanoid ,

I don’t believe you because the end of your sentence wasn’t emphatic enough. Period. Mic drop.

BleatingZombie ,

73% of numerical statistics go unverified

backhdlp ,
@backhdlp@iusearchlinux.fyi avatar

If you put a decimal in your statistic, it becomes 82.6% more believable.

Anticorp ,

71.2% of all statistics are made-up on the spot.

dalekcaan ,

“You can pretty much come up with whatever quote you want and pretend someone famous said it. Nobody checks anyway.”

-Sun Tzu

Ironfacebuster ,

"This guy is speaking straight facts"

  • George Washington
caleb , in Every language has its niche

As a Rails engineer with 14 years experience, I can say the place that should be in the 3rd panel is Shopify. They employ so many ruby and rails core committers and directly fund a good many rails gems, and ruby community infrastructure it’s insane. They’re also directly funding the development of things like the YJIT and speed enhancements to MRI itself.

Then there’s all the other places I know or worked at built on Ruby where my other long tenured ruby friends work.

  • Gusto
  • Airbnb
  • Clearbit
  • Stripe
  • Github
  • Gitlab
  • Bold Penguin
ComradeKhoumrag ,
@ComradeKhoumrag@infosec.pub avatar

Ruby was recommended to me by my comparative programming languages professor. I haven’t picked it up, but there were memes that this professor was so good at programming he was secretly built by the university in C++ to teach students how to write better code.

merc ,

It’s worth learning Ruby to understand some of the tricks you can do in programming languages.

Did your prof also recommend others like Lisp?

Lulzagna ,

Basecamp

rambaroo ,

Aha asks for Ruby on rails experience in their job listings, so they must be using it as well

Kidplayer_666 , in X is just better!

Sure X isn’t a hot mess unlike wayland… sure…

jwt ,

X has been tepid for at least a decade.

crossmr , in Every Family Dinner Now

Being a programmer is a lot like being a tradesperson. A tradesperson has a lot of flexibility in what they can do. They can work for a company, work freelance, or start their own business.

Programming gives you the same flexibility, the most important bit being that you can do it for yourself.

AI is going to struggle with larger complex tasks for a long time coming. While you can go to it and say 'write me a script to convert a png to a jpg' you can't go to it and say 'Write me a suite of tools to support business X' or 'make me a fun and creative game' A good programmer isn't going to be out of work for a long time.

xmunk ,

Most of the work software developers do is comprehending the problem, formulating a solution that addresses the problem, and doing it in a maintainable, performant, and security conscious manner.

I think AI can write a killer isEven() method, I think it’s shit at everything I listed… it’s extremely shit at being security conscious, any dev can tell you that it’s easier to write code and confirm it’s following best security practices then it is to review someone’s code and confirm it’s following best security practices… I think AI actively makes it harder to have confidence in security.

The first real part of my job I think AI will help with is performance tuning. We’re not there yet but I think we’re not unimaginably far from being able to give an AI a working but slow function and have a computer spin up a million randomized test inputs and outputs… then start scrambling the algorithm in a plethora of ways and testing the performance while confirming that the test cases pass.

Then again, you’ll need to confirm the algorithm is still secure - but I think the realm of performance is the first place we’d see a tool that I’d demand a license for.

ForgotAboutDre ,

All the AI does is match the request to solutions it was trained in.

It just stackoverflow in your ide. It has a little more flexibility in answering and isn’t as corrupted by SEO result when googling the equivalent answer. Its not informed and thinking.

The optimisation problems you are talking about is the process that is used to make AI models in the first place. I think you want an AI to configure optimisation routines for you rather than build the test cases and variables yourself. Or you want some system that implement all the individual components better, but an AI that can optimise the entire thing isn’t coming about soon. It would need to trained on very similar software. In which case you should just use that better software.

someacnt_ ,

Basically any pro-AI argument seems to go “it will achieve AGI”. So funny that lots of people buy that, forgetting how hard a general intelligence is.

nickwitha_k ,

I want AGI to be a thing. I see little evidence that OpenAI et al are going that way. Pretty sure it’s mostly hype to distract from wholesale theft of IP for profit.

someacnt_ ,

Ah, me too. Should have specified OpenAI

4am , in isEven API

Incoming trademark lawsuit from iSeven, the API that tells you if a number is seven or not

call_me_xale , in JavaScript's days are numbered

Bold of you to assume no one will come up with a replacement date library rather than just getting rid of JS.

__init__ ,

It’s javascript. We’ll have gone through 275,760 new datetime libraries before then, it’ll be fine.

towerful ,

String based date processing

Redkey ,

Of course! There’s already a proposal for a replacement Temporal object.

LPThinker ,

It’s not just a proposal, it’s already fully defined and almost completely implemented - I believe they’re just waiting on a standards update from ISO for time zone stuff.

Rogue , in Quantum Lock suspends sales due to developers losing access to source code

Why not just give it away for free? It always seems odd to me that games just disappear rather than being allowed an elegant death of old age.

Fribbtastic ,

Probably depends on the background as well. They could have hardware running (multiplayer server) that gets so little activity that there is no benefit and only loses them money.

It also doesn’t look like the game has steam integration.

ICastFist ,
@ICastFist@programming.dev avatar

Then why not release the binaries for running such server? I’m sure a group of people could figure out how to decompile and make a change so the game attempts to connect to a different master host

Fribbtastic ,

Well, i mean i would be all for that but in reality it might not be that easy. It could rely on dependencies that are proprietary that cannot be shipped or provided with the project.

It could alone be that the connection is hard coded in the game itself so instead of just booting up the server and being able to play you would now have to do something to the game itself too that it finds your server. Nothing really that cannot be addressed, I mean people could do that with ragnarok online private servers but not something your normal gamer could do.

towerful ,

If they weren’t using VCS, I bet they have creds embedded in the source.

Aatube OP ,

I'd doubt that this has creds, though. IIRC Steam multiplayer generates its own creds.

some_guy ,
armchair_progamer , in Googling

“I’ve got 10 years of googling experience”.

“Sorry, we only accept candidates with 12 years of googling experience”.

Mango ,

I have like 18 years experience googling boobies.

MHanak ,

Boobling

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