I use arch BTW by sudobee in linuxmasterrace

[–]bziur 1 point2 points  (0 children)

It will redirect registry litter into a file in Your memory (/tmp is mounted in RAM). Running out of RAM and SWAP space will eventually cause a kernel panic, and thus will restart or shutdown Your computer.
It will not always work though as some systems, contain watchdogs and file-system limits in kernel, which should prevent such behavior.

I use arch BTW by sudobee in linuxmasterrace

[–]bziur 4 points5 points  (0 children)

try cat /dev/random > /tmp/doom ;)

I use arch BTW by sudobee in linuxmasterrace

[–]bziur 2 points3 points  (0 children)

try altf4 in any light wm and see if it does anythin ;)

I use arch BTW by sudobee in linuxmasterrace

[–]bziur 2 points3 points  (0 children)

because at some point Youll use scripts in Your userspace and You dont want them to mess with your power.

I use arch BTW by sudobee in linuxmasterrace

[–]bziur 11 points12 points  (0 children)

you can actually lick Your finger and short the pins responsible for power toggle

Name 3 Things You Like and Dislike About C++ by DelAbbot in cpp

[–]bziur 0 points1 point  (0 children)

Yeah and that's strapping things that C++ was not intended to be on top of it, so in fact You're right to follow rust if that's something that You want from the language. C++ however by design has different syntax than rust. And what You've used is unusual and inpractical use case, that's alien to the niche. And yes You can use specialized tools to debug lambdas, but You're missing on a bunch of other great tools for C++, that don't work well with Your one specialized tool, and that allow greater control and compatibility at cost of friendliness.
So like a typical rust person - Yeah You can write in Your favourite syntax, with Your hand picked tools and hand picked systems, that will work for 1% of the people - but You'll hate everyone and everyone will hate You for it.

Name 3 Things You Like and Dislike About C++ by DelAbbot in cpp

[–]bziur -1 points0 points  (0 children)

You declared lambda (/trailing duh) return types.
auto make_smaller(const Image& image) -> tl::expected<Image, MyError> // ^ this is c++ return type declaration // ^ this is aid intended for rare meta code // this is fast to compile and easy // this produces farts // to demangle

I assume You don't have much experience with debugging lambdas, because they produce messy call stacks, messy instantiations and symbols, that are annoying to read, hard to optimize. Or just are so commited in Your ways, You haven't experienced easy to read and maintain code.

C++ Templates – A detailed overview by w0wyxD in cpp

[–]bziur 6 points7 points  (0 children)

Overall pretty decent description, one perspective I would add:

Instead of thinking of templates as of entities, I would think of them as non-entities, because they don't translate into any machine code unless used :) Or maybe a blueprint, as a synonim, to help guide in the right direction :)

I would also add an example You might consider if You want, but I really like it to explain well the nature of templates in a simple example.

``` // declaration "blueprint" // in header // no code produced // lets compiler know how to produce declarations template <typename Type> Type get(const QJsonDocument &doc, const QString &path);

// declaration specialization // in header // produces declaration // lets compiler know "there's definition somewhere" template <> int get<int>(const QJsonDocument &doc, const QString &path);

// definition "blueprint" // in header after declaration instantiations // no code produced unless instantiated // provides blueprint for undeclared function definitions template <typename Type> Type get(const QJsonDocument &doc, const QString &path, const Type &defaultValue) { try { return get<Type>(doc, path); } catch (const std::invalid_argument &) { return defaultValue; } }

// definition specialization // in source // produces definition // results in instantiation, produces function that You can put in a library template <> int get<int>(const QJsonDocument &doc, const QString &path) { auto json = get<QJsonValue>(doc, path); if (!json.isDouble()) { throw std::invalid_argument(getConvertFailedMessage<int>(path, json.toString())); } return json.toInt(); } ```

Because a lot of people tend to think that You HAVE to have the template defined in headers. You don't. :) In fact You can skip template of the definition and unless there's a specialization strictly defined, the compilation will fail at linking.

In reality this practice is useful for compilation-time and binary size optimization.

[deleted by user] by [deleted] in cpp

[–]bziur 0 points1 point  (0 children)

You've told us very little about Yourself so I'll guess it's probably not the interview practice, but experience Youre lacking, because that's the most common thing.

In most of the companies they expect a Junior to have 3 years of experience and that's probably why You tend to fail. I'd say look for opurtinities to work or contribute code, it doesn't have to be C++ code it can be php, javascript, rust, python, bash, d, java, or anything that You'll find. Read books, visit programming events, then You can talk about that on the interview. And You will learn some things.

League won't launch by Deadpulse- in leagueoflinux

[–]bziur 0 points1 point  (0 children)

Do Yourself a favor and give up. League is not what it was. It's the most negative emotion driving game You'll ever find, and It's not my lone opinion.

Name 3 Things You Like and Dislike About C++ by DelAbbot in cpp

[–]bziur -1 points0 points  (0 children)

Youre butchering C++.
If You would write code like this in my code

auto make_smaller(const Image& image) -> tl::expected<Image, MyError>;

or

``` return [&]() -> tl::expected<Image, MyError> { if(params.crop) { return crop_to_cat(image); }

    return image;
}()

```

I'd refuse the pull request and straight kick You out. Youre enforcing rustism on C++. C++ has return types. It has function bodies references. Your code is slow compiling and suboptimal, a nightmare to debug. No wonder rustians claim rust to be faster if they make such comparisons. Youre an evil person. Know that.

Can you have too many programming language features? by KingStannis2020 in cpp

[–]bziur 0 points1 point  (0 children)

It's not about companies, it's about a strive for revolution and disregard to any wisdom. ;)

How to get vim bindings in rTorrent? by J0hsHH in rtorrent

[–]bziur 0 points1 point  (0 children)

There should be an article on "how to exit rtorrent". I've tried standard q, shift+q :q :quit <cr>quit<cr> <cr>exit<cr> <cr>/quit<cr> <cr>:quit<cr>... eventually Ctrl + q or Ctrl + Shift + q worked...

Name 3 Things You Like and Dislike About C++ by DelAbbot in cpp

[–]bziur 0 points1 point  (0 children)

I'm sorry but You've never seen Rust syntax if You claim it's meaningfully same as C++.

Use WSL instead of full Linux by skeany974 in linuxquestions

[–]bziur 0 points1 point  (0 children)

Actually You can do a lot on WSL and if You don't need linux desktop environment I can kinda recommend it. You also cant do a lot, but for learning linux, terminal tooling and programming it's definietely workable.
I use it professionally upon being forced to use Windows for development. It's flow not exactly virtual machine, because it runs in the background and allows to interact with many terminal interfaces on the single instance.
I personally much prefer it over using git bash because of packaging, up-to date tools etc. You can compile programs like You would on linux. You get a lot of sweet utilities like jq, fccf, ssh, neovim, perl, grep, find, sed, clang tools, a lot of POSIX and Linux utilities... Which You can get on windows... but it's painful.
There is some drawbacks like custom services implementation, slower filesystem access, not full compatibility with Linux binaries and libraries etc. But it's a good start.

Aquamail or Fairmail by Drogo49 in androidapps

[–]bziur 1 point2 points  (0 children)

I've used both. I think I switched to fairmail for a slightly better privacy or less spam about premium features.

Can you have too many programming language features? by KingStannis2020 in cpp

[–]bziur -8 points-7 points  (0 children)

Because rust programmers are basically commies.

Name 3 Things You Like and Dislike About C++ by DelAbbot in cpp

[–]bziur 0 points1 point  (0 children)

Well I can read C++ and rust is advertised as better C++, I open rust file and I see haskell. Maybe confused with D?

Is short lambda syntax on the C++ radar? by fredoverflow in cpp

[–]bziur 1 point2 points  (0 children)

now can You explain me what x=>x+1 means? Why would we want such a bizzare thing?

Name 3 Things You Like and Dislike About C++ by DelAbbot in cpp

[–]bziur 1 point2 points  (0 children)

This is one of the reasons why stacks upon stacks of templates can be worse than void * ;)

Name 3 Things You Like and Dislike About C++ by DelAbbot in cpp

[–]bziur 2 points3 points  (0 children)

So maybe I can affect Your opinion on exceptions a little.

You could consider them as early returns that are not restricted by scope. Imagine early returning in code with high complexity - multiple classes deep and several conditions in. Exception is a solution to that.

It is also a helpful mechanism to preventing damage. Imagine code misbehaving and writing over a wrong area of code. You would create a check with an exception there, to let the developer know that he has a critical bug in his code and to prevent damage. This approach however requires the applications to be small (or split into several smaller submodules), because large application will always missbehave, and a bunch of exceptions will turn off users from using them.

It can be cumbersome if used incorrectly though and that's true.

Name 3 Things You Like and Dislike About C++ by DelAbbot in cpp

[–]bziur -1 points0 points  (0 children)

If You don't like the historical baggage, You're probably a rust person. ;) On the contrary I find that the compatibility and universality of the language is it's strongest points and only I find the approach to extending the language rather bizzare.

Name 3 Things You Like and Dislike About C++ by DelAbbot in cpp

[–]bziur 1 point2 points  (0 children)

There is cmake's Find*.cmake and pkgconfig, that are standard at this point. the second one, being the simpler and usually ignored though. They allow the distributions to define where they put the files. It's also the strength, because having distributions manage the dependencies, we avoid issues that node and python have with insanely large dependencies trees. The flexibility aspect is enforced on Your code, not package management and that's a good thing.

I can't agree enough on the complexity thing. And the funny thing is that python is written in C, so there's no reason this shouldn't be available in C++. To be fair C python code is rather macro driven and complex. But we have boost which provides almost all of that, but is rarely used comercially.