

It depends on whether you are printing to a terminal or to a file (and yes the terminal is also a file), and even then you can control the flushing behaviour using something like unbuffer
It depends on whether you are printing to a terminal or to a file (and yes the terminal is also a file), and even then you can control the flushing behaviour using something like unbuffer
printf
is superior and more concise, and snprintf
is practically the only C string manipulation function that is not painful to use.
Try to print a 32-bit unsigned int as hexadecimal number of exactly 8 digits, using cout
. You can do std::hex
and std::setw(8)
and std::setfill('0')
and don’t forget to use std::dec
afterwards, or you can just, you know, printf("%08x")
like a sane person.
Just don’t forget to use -Werror=format
but that is the default option on many compilers today.
C++23 now includes std::print
which is exactly like printf
but better, so the whole argument is over.
It’s way less expensive for state-sponsored hackers to blackmail your country’s official to leak backdoor keys than try to break the unbreakable crypto using a nuclear-powered GPU farm.
Sometimes I’m searching for a recipe to some obscure Linux tool and finding my own answers on Stackoverflow from ten years ago.
We have WSL, it’s good enough
As long as your byte consists of 8 bits.
Saving arbitrary metadata is the exact use case for pickle
module, you just put it together with your numpy array into a tuple. jpeg format has support for storing metadata, but they are an afterthought like .mp3 tags, half of applications do not support them.
I can imagine multichannel jpeg to be used in photo editing software, so you can effortlessly create false-color plots of your infrared data, maybe even apply a beauty filter to your Eagle Nebula microwave scans.
What, pickle.dump
your enormous Numpy array not good enough for you anymore? Not even fancy zlib.compress(pickle.dumps(enormousNumpyArray))
will satisfy you? Are you a scientist or a spectral data photographer?
Eh, who is still using paper books to learn programming languages? Every popular language has a website with online manuals.
Well, except C, because it’s crammed together with C++ on https://cplusplus.com/ and https://cppreference.com/
And socks just grow organically after 3 years of coding.
It’s a basic GIMP knowledge, really. Don’t forget to add an alpha channel to your layer after step 2, otherwise it won’t work.
What you are searching is called tiling window manager, there are several with various features.
On Gnome there is a hotkey for horizontal side-by-side windows, on Plasma there are more layout options and keyboard shortcuts, but I’m not sure if any of them has one-third tiling.
https://help.gnome.org/users/gnome-help/stable/shell-windows-tiled.html.en
awk is in a strange position between simple grep commands and full-featured Python programs. It’s powerful but too domain-specific, and if you learned how to write multiline sed scripts you don’t need awk anymore.
And yes, you can do
python -e “…”
for (really long) Python one-liners.
Tech companies spend effort on a FOSS project when either it’s their main product, or when they have no choice, it’s licensed under GPL and there are no BSD or Apache-licensed alternatives. Contributions are usually done by individual employees in their after-hours time, and most managers see it as directly benefitting their competition.
Other companies provide nothing, so it’s definitely better than average.
Nah, the kids I know learned C just fine. C is simple, C is all you need for writing kernel drivers, pointers are not that hard if you explain them well, it just feels really pedestrian compared to Python or Typescript.
It’s ultimately a question of money. Older guys with software engineering degrees and fancy salaries can spend their weekends doing free community service in the form of open-source development. Younger people have to worry about job and rent and bills, they simply don’t have that kind of free time.
Add to that the growing complexity of the software. Something that could be done by an university student before, like writing an OS from scratch, won’t be nearly as useful as it would in the '90-s, because it was already done before, now you have multiple OSes to choose from. And joining an existing software project is hit-or-miss, some are inclusive and some are an old boy club where you need to know the secret rules.
In Lua all arrays are just dictionaries with integer keys, a[0] will work just fine. It’s just that all built-in functions will expect arrays that start with index 1.
It’s called Plasma. Plaaaaaassssmmmaaaaaaaaa.
You can actually use / as a path separator on Windows in functions like fopen(), because it supports some ancient version of POSIX standard.
Ah don’t worry, if you do
fopen(file, "w")
on Windows and forget to use"wb"
flag, it will automatically replace all your\n
with\r\n
when you dofwrite
, then you will try to debug for half a day your corrupted jpeg file, which totally never happened to me because I’m an experienced C++ developer who can never make such a novice mistake.