That’s the only reason i don’t think this is real
- 0 Posts
- 72 Comments
Lightfire228@pawb.socialto Programmer Humor@programming.dev•Most programmers just google it anyway6·28 days agoThis is genius
I run Arch, so docker was the easiest method of installation.
Rather than try and figure out how to install a .deb manually (and lose package manager perks)
Vscode and dotnet core (5+) work well on linux
You can also run SQL Server via docker
Lightfire228@pawb.socialto Programmer Humor@programming.dev•What's stopping you from writing your Rust like this?2·2 months agoIf you do that, you lose formatting and comments every time you load the source from disk
As much as this hurts,
yeet;
as an aliasthrow;
is hilarious
The technology behind the registry is fine (which is what I think @VinesNFluff meant)
But it’s execution in Windows was ass
In theory, a configuration manager with DB-like abilities (to maintain relationships, schematic integrity, and to abstract the file storage details), isn’t a bad idea
But the registry as it is today is pure pain
Sanity checks
Always, always check if your assumptions are true
- am i even running the function?
- is this value what i think it is?
- what is responsible for loading this data, and does it work as expected?
- am i pointed at the right database?
- is my configuration set and loaded in correctly?
I’ve been running Linux for 4 years, but this still hurts to read
I mean, you just need to look at the conflicting files, fix up the code, then stage those changes and pop a new commit
There’s no “special” merge conflict resolution commit “type”
As for fixing the code itself, I usually look at what changed between both versions, and then re-author the code such that both changes make “sense”
Lightfire228@pawb.socialto linuxmemes@lemmy.world•My heart goes out to shell programmers who have to support posix sh1·3 months agothat is a little more complicated
p.communicate()
will take a string (or bytes) and send it to the stdin of the process, then wait forp
to finish executionthere are ways to stream input into a running process (without waiting for the process to finish), but I don’t remember how off the top of my head
from shutil import which from subprocess import Popen, PIPE, run from pathlib import Path LS = which('ls') REV = which('rev') ls = run([LS, Path.home()], stdout=PIPE) p = Popen([REV], stdin=PIPE, stdout=PIPE) stdout, stderr = p.communicate(ls.stdout) print(stdout.decode('utf-8'))
Lightfire228@pawb.socialto linuxmemes@lemmy.world•My heart goes out to shell programmers who have to support posix sh1·3 months agonushell is pretty good. I use it for my main shell
although, i still prefer writing utilities in python over nu scripts
Lightfire228@pawb.socialto linuxmemes@lemmy.world•My heart goes out to shell programmers who have to support posix sh35·3 months agojust use python instead.
- wrap around
subprocess.run()
, to call to system utils - use
pathlib.Path
for file paths and reading/writing to files - use
shutil.which()
to resolve utilities from yourPath
env var
Here’s an example of some python i use to launch vscode (and terminals, but that requires
dbus
)from pathlib import Path from shutil import which from subprocess import run def _run(cmds: list[str], cwd=None): p = run(cmds, cwd=cwd) # raises an error if return code is non-zero p.check_returncode() return p VSCODE = which('code') SUDO = which('sudo') DOCKER = which('docker') proj_dir = Path('/path/to/repo') docker_compose = proj_dir / 'docker/' windows = [ proj_dir / 'code', proj_dir / 'more_code', proj_dir / 'even_more_code/subfolder', ] for w in windows: _run([VSCODE, w]) _run([SUDO, DOCKER, 'compose', 'up', '-d'], cwd=docker_compose)
- wrap around
I’m more talking about theory than practical.
I’ve not developed anything in C/C++, so I don’t know practical uses for a double pointer, aside from multidimensional arrays, or arrays of pointers
My point was that, conceptually, pointers to pointers is how most complex data structures work. Even if the C representation of said code doesn’t have a
int**
somewhere
The distinction is meaningless in the land of Opcode’s and memory addresses
For example, a struct is just an imaginary “overlay” on top of a contiguous section of memory
Say you have a struct
struct Thing { int a; int b; Thing* child; } Thing foo {}
You could easily get a reference to
foo->child->b
by doing pointer arithmetic*((*((*foo) + size(int)*2)) +size(int))
(I’ve not used C much so I’ve probably got the syntax wrong)
Mostly because at the lowest level of computing (machine code and CPU instructions), pointers are the only method (that I know of) of any kind of indirection.
At the lowest level, there are 2 types of references:
- CPU registers
- memory addresses (pointers)
Every higher level language feature for memory management (references, objects, safe pointers, garbage collection, etc) is just an abstraction over raw pointers
Pointers themselves are really just abstractions over raw integers, whose sole purpose is to index into RAM
With that in mind, pointers to pointers are a natural consequence of any kind of nested object hierarchy (linked lists, trees, objects with references to other objects, etc)
The only other kind of indirection would be self-modifying machine code (like a Wheeler Jump). But the computing world at large has nixed that idea for a multitude of reasons
“I’m sorry Dolores, I must not tell lies”
I’m not sure that’s their intended design. Old pull-tab cans actually had a ring for you to pull them off (similar to “easy open” soup cans of today)
I’d imagine that as the tab shrunk and changed from pull to a lever action, the “ring” was left as a vestigial design (as a form of skeuomorphism)