• 0 Posts
  • 43 Comments
Joined 2Y ago
cake
Cake day: Mar 25, 2022

help-circle
rss

I’m not sure, but I think that might have been part of the joke, seeing all the comments here.



Is there any situation where you’d want to remember the opcodes? Disassemblers should give you user-friendly assembly code, without any need to look at the raw numbers. Maybe it’s useful to remember which instructions are pseudo instructions (so you know stuff like jz (jump if zero) being the same as je (jump if equal) making it easier to understand the disassembly), but I don’t think you need to remember the opcode numbers for that.

Edit: Maybe with malware analysis where the malware in question may be obfuscated in interesting ways to make the job of binary analysis harder?


they break with monospacedness

The IDEs I’ve used had the ligatures be of the same character width as the original operator.


Why are you casting to void*? How is the compiler supposed to know the size of the data you are dereferencing?


I wouldn’t trust ChatGPT with teaching me about some tool. It in my experience very convincingly spews out stuff it invented, and if one is still learning I can see it being hard to spot those errors. I use it to fix syntax errors in SQL queries, though, since I can’t be bothered to try understanding the not-so-helpful error messages I get with my queries, and because if chaptgpt tells a lie it will be caught by my syntax checker.

So, I guess you can use it, if you always assume it to be trying to mislead you until proven to the contrary.


Is xml really that unreadable for machines? I enjoy xml as a format, because I can generally just convert it to an s-expression and easily manipulate it as a tree.


I don’t remember the last time I had to worry about the compression. I simply run tar xf myfile.tar.whatever and it works every time.


Some people use tabs for indentation and spaces for alignment. It kind of gets the pros of tabs (user configurable indent-width) and the pros of spaces (alignment). That doesn’t work in Python where you can’t align stuff and the interpreter doesn’t allow mixing tabs with spaces, but in other languages it is a possible style.


With all the takedowns (open source or otherwise) occurring lately

Am I out of the loop? Were there any big controversial takedowns recently?


That’s not true though. You can get the backtrace and other useful information from the coredump mentioned by the error message by loading it with gdb. Not as good as attaching it to a living process, since you can’t see step-by-step what happens leading up to the error, but still quite useful.


I wrote this after I learned about attempts to use Scheme as the lingua franca of Web in the early 90s. Someone told me S-Expressions are bascilly XML and well, he’s right.

https://lemmy.ml/comment/8713988

Was it this exchange? :D


I appreciate your answer, but I mentioned systems programming, because I was more interested in languages that do not rely on a garbage collector.


To be honest, XML can be considered to just be a more verbose version of s-expressions. It is easy to convert between XML and SXML.


I also leave every firefox tab open until I run out of RAM, at which point I use the “close tabs to left” button, moving some tabs that I still want to check out to the right beforehand. On firefox, one can simply use the list all tabs button to easily navigate or search through all tabs, so no memorization is needed (or just type the title of the document in the address bar and it will just switch to the tab if you have it open).


What memory-safe systems programming languages are out there, besides Rust?


Languages like C have a preprocessor. The preprocessor preprocesses the source code before compiling it. The C preprocessor, copy-pastes code from other files into the current file (#includes), erases code (#if if the condition is false), and expands macros (e.g. you have #define MAX(x, y) ((x) < (y) ? (y) : (x)), it replaces every use of that macro with the definition of that macro: a += a * MAX(b, c)a += a * ((b) < (c) ? (c) : (b)). There are also general-purpose preprocessors (or macro processors), that are not tied to a specific programming language however. m4 is one of them and GNU autotools make extensive use of them to generate their configuration and make files. What preprocessors allow one to do is write a template, and then generate a result, based on your needs.


Is there a link to the original post? I want to see the replies. Unfortunately I can’t find it.


I’m sorry, I think I’m missing something. What’s wrong about sharing the inputs? I thought the only thing problematic was to release a solution before the leader-board is full.


Embarrassingly for someone whose native language is german, I often use the masculine when the neuter should have been used, because they feel the same to me. I never was taught any formal grammar in german, though, so that might play a role.


I always thought they should be singular to be closer to the names we give entities and relations in a entity-relation diagram.


Does the OOM killer actually work for anyone? In every linux system I’ve used, if I run out of memory, the system simply freezes.



Cool. Is this made with L-systems?


I’m looking for a german dub of The Last Unicorn. The only torrent I found no longer has any seeders. What private tracker could have it and is it worth it to join a private tracker to just relive a childhood memory?


What environment are you using that has a hardcoded tab size?

Microsoft Windows’ Notepad. I have sometimes used that when on a public computer.


The opposite is true, though. If you use tabs for indentation and spaces for alignment, you can adjust the tab width without destroying alignment. That’s the big benefit of the tabs-for-indentation-spaces-for-alignment mix.

You can’t do that with only tab characters, you can’t even align stuff with tabs because it has variable width.



For any interested Vi(m) user, one can install evil-mode to get vi keybindings in GNU Emacs.


packaging woes

Even with tools like Poetry?


CSVs are the easiest to work with if you are unfamiliar

A disadvantage with this is, if you ever want to collaborate with someone else using version control, it will increase the amount of merge conflicts, because multiple strings will be on the same line.


git add -p is great to know, but IMO one shouldn’t rely on it too much, because one should strive committing early and often (which eliminates the need for that command). Also using git add -p has the risk of accidentally not adding some code that actually belongs to the change you are trying to commit. That has happened to me sometimes in the past and only later do I see that the changes I commited are broken because I excluded some code that I thought didn’t belong to that feature.


Same for merge conflicts. I’m not sure you can even resolve them on the CLI

How are they solved when using a GUI? When using cli, it simply tells auto-merging failed and you can open the conflicting files in a text editor and solve the conflicts, then add them and continue the merge.

Managing branches: perhaps I’m a little too ott but I keep a lot of branches preserved locally, a GUI provides a decent tree structure for them whereas I assume on the command line I’d just get a long list.

git log --graph --all --oneline

There’s also --pretty, but it uses a lot of screen space.

Managing stashes: unless you just want to apply latest stash (which admittedly is almost always the case) then I’d much rather check what I’m applying through a GUI first.

You can attach a message when stashing with -m.

And you can check them out by doing git checkout stash@{1} or similar.


It is only used by 3%!? Wasn’t it at around 30% some years ago (not counting netscape)? This comes really as a surprise to me because in my circles even around half of non-tech inclined windows users use firefox.

Why did it lose so many users?


Today I learned that some torrent clients provide a built-in torrent search engine.



But it is in no way worse than javascript in that regard, though?

I don’t think static typing in Python is really so essential. I see it above all as a scripting language, so its applications don’t benefit as much from static typing as other languages do.

Maybe a better hypothetical python would have used some kind of type inference system, like in haskell, which allows for static typing while still allowing to write code unencumbered from types and stuff, but I really think, for Python’s target domain, its type system is actually adequate or good. Maybe its documentation could benefit from type hints, though.


I haven’t worked with any 1-based indexing languages, but I can’t really see how it could be problematic. The only advantage I see about 0-based indexing is the simplicity in how the memory address is calculated. Just arr + index × sizeof(member) which I think even has its own MOV instruction on x86. But besides that I can’t see any more advantages. With 1-based indexing I see the advantage of the number of elements also being the index of the last element of the array, avoiding off-by-one errors when writing. Though, again, I’ve never used a 1-based indexing language.


If by «loosely typed» you mean weakly typed, then that’s not true. Python is a dynamically and strongly typed language. Attempting to do an operation with incompatible types will result in a TypeError.

>>> "3" + 9
Traceback (most recent call last):
  File "", line 1, in 
TypeError: can only concatenate str (not "int") to str

You may be thinking of the following, but this only works because the __mul__ and __add__ methods of these objects have been written to accept the other types.

>>> "A" * 4 + "H"
'AAAAH'

garbage collection

I don’t think Rust has a garbage collector.