Half-pull the lever so that the points get stuck midway between the two tracks. That should derail the trolley. Someone could conceivably still get hurt, but it improves everyone’s chances.
(What? You mean it isn’t a literal trolley that has to obey the laws of physics? Damn.)
Chars are just numbers, but yeah, an enum would work fine too, sure. The only advantage with using a char for it is that there’s no conversion needed for outputting them into strings so it’s a little easier. Less code, very readable, etc. Though yeah, thinking about it JQKA wouldn’t be numerically in the right order which could cause issues if the program did more than just implement HiLo
The best part of these threads is no matter what someone comments, at least 2 people will reply either correcting or “clarifying” the original commenter.
I can’t think of a single reason to use bash over Python. Anything you can do in bash can be done in pure Python. Unless you’re working in some embedded environment it’s a non-issue to install a Python interpreter (you certainly already have one). I would only use sh/bash for packages I’m distributing to avoid the external dependency, and then only if it’s a relatively simple script.
Because you could be on another machine that doesn’t have Python 3.X it only has 3.X-1. or you could write code for Python 3.12 and then four years later no one has 3.12 anymore.
Sometimes you need to download packages from pip but pip might not be available or you may be hitting your company’s internal pip mirror.
How often are you writing scripts that accidentally require a specific minor version of Python 3 to run? If you have dependencies, 1) you’re no longer scripting, and 2) you need to manage your runtime environment anyway.
Runtime environments can change often, if you need to install your application on a ton of PC’s you don’t want to install python version 3.X on all of those instead you could just compile it into a native binary, pip is the most unsafe hell
Python is superior for string anything (parsing, searching, manipulating). But Bash is much simpler for running existing CLI tools. Plus you should already be using Bash as a simple terminal language already, so wrapping what you’re used to into a simple script flows naturally.
Eg, if I have some admin tool for updating a user thingamajig, a common scripting need is just running that tool for every user in a file (or the output of another command). The string manipulation that often requires is annoying in bash, but running the commands is easier than Python.
If what you’re doing is essentially a few shell commands, then you may as well put it into a script. If you’re talking about how “elegant” your shell scripts are and comparing them to Python, you’re probably wrong and should be using Python.
It does sometimes happen that something in there just breaks and isn’t easy to recover. But it can also be a matter of (inexperienced) devs just deciding, fuck it, I won’t try to merge it, I’ll just copy my changes elsewhere and throw away the repo.
I have never had git get into a state I cannot get out of. Even if that is a reset, checkout or clean. And those are very rare. How are people breaking things so often.
Learn the tools you use daily, it saves you a lot of headache in thelong term.
Oh yeah, but I’m talking about the internal Git state just genuinely being broken, for example: stackoverflow.com/…/git-commit-stopped-working-er…
Ultimately, if you spend half an hour debugging that, it just starts being a waste of time compared to cloning anew.
As for how to merge, yes, one should learn that. The problem is that the complexity of the code changes adds on top of whatever insecurities you might still have with Git.
I did put “inexperienced” in braces there, because even as an experienced dev, merges are sometimes just not worth doing. In that case, you could just checkout the branch a second time, but well, still not that different.
But it can also be a matter of (inexperienced) devs just deciding, fuck it, I won’t try to merge it, I’ll just copy my changes elsewhere and throw away the repo.
Pretty sure that’s actually it. Git has a learning curve and, for example, some naive rebase not working out as intended can be scary if you don’t know what you’re doing.
I’ve been doing this yesterday. Not because Git broke, but since Intellij kept pulling invalid configs from the cache, and that was based on some kind of path identifier it seemed.
People inexperienced with git can get stuck after doing some funky checkout / rebase stuff. If you don’t know your way around git so well, I guess this is the obvious solution.
git rm -rf is only usable within the scope of the git repository and removes files in the staging area and working directory but doesnt affect untracked files or .git. rm -rf affects everything. For this case rm -rf probably would be the better option
edit: did a quick edit on the meme to change it to rm -rf since it makes more sense
rm - rf is the only version that makes sense, since the only reason to delete and re-clone is to recover from an unexpected .git/ state, and git rm won’t remove that.
One drive does suck nards, but for your double clicking; logitech has been using shitass switches to detect clicks for a while now. They sooner rather than later fail to click once. Only solution I’ve found is to replace the switches (hard mode), or keep using the logitech mouse I have from 2009.
It’s sucks, but you just gotta go for another brand. Even razer doesn’t have such a rampant double click problem.
Logitech enshitified their dominant market position by cheaping on switches - works for them, they sell more mice (if you don’t put together they’re the source of the problem and it’s not a one-off issue).
Mine is a G5, which looks like it lost the MX518’s sick ass faux metal and instead gets what I can best call “cracked lightning?”. I was too young to figure out mouse buying so the fam’s resident nerd chose that for me - I thank her to this day
I had a G5 for close to a decade and I miss that heavy little bugger. I’ve got a G502 right now and its rather good, but the max weight isn’t as heavy as my old one.
I had to replace the cable on my G5 after it frayed after about a decade, but after that it was back to it. Sorry you lost yours, and I hope you never double click on the G502!
Yep, that’s what happened to mine. The jacket frayed until the wire got out and strangled itself. My 502 is still rocking strong after 5+ years, but here’s hoping your g5 sticks around for a while, that was a great mouse.
Mine clicked just after a year :( so it’s waiting to get switches soldered cause I ain’t buying a new one but don’t have the will to do it yet cause I got my ancient G5 still. (I live in America, so doing warranty shit is a hassle, and I surmised it would fail again so I should just fix it now)
The switches do suck but they can usually be revived with contact cleaner. If you open the mouse you can spray around the switch plunger or better yet, pop off the top half of the switch case and spray the contact directly. That completely cleared up the double click on my G402 and even revived an old MX510 that was missing clicks.
programmer_humor
Top
This magazine is from a federated server and may be incomplete. Browse more on the original instance.