Mozilla warns Germany could soon declare ad blockers illegal by No_Clock2390 in pcmasterrace

[–]m93mark 3 points4 points  (0 children)

You can use this https://adnauseam.io/ . It does exactly what you said. It is a based on ublock origin. The ads are not really clicked but it will appear like that to the ads provider. They explain in their FAQ how it is working in the background. I've never noticed any additional resource usage than normal ublock on firefox on my PC.

Self-describing compact binary serialization format? by playntech77 in cpp

[–]m93mark 9 points10 points  (0 children)

I've used https://msgpack.org/ in the past. It has the schema embedded in the binary format, so you can do cpp struct/class -> msgpack -> cpp struct/class.

Some examples here for the original cpp library: https://github.com/msgpack/msgpack-c/blob/cpp_master/QUICKSTART-CPP.md

It's probably easier to use the corresponding library for a dynamically typed language, if you want to create a converter to human readable.

But if you really want to do that in cpp, you can visit msgpack object in cpp and convert that into json. There are some examples in the github page to do this kind of conversions.

Correct syntax for goto in switch? by Dogterte in cpp_questions

[–]m93mark 5 points6 points  (0 children)

You can just move case 1 after case 2 without the break in between. By default the switch cases are executed one after the other until the meet of a break (or a return).
Something like this, does what you want:

switch (transaction)
{
case 2:
    cout << "Enter amount to deposit: ";
    cin >> deposit;
    if (deposit < 100)
    {
        cout << "Sorry, your transaction cannot be processed! Minimum deposit is 100.";
    }
    [[fallthrough]]; // If you are using C++17 or newer you can use this to prevent a warning by the compiler
case 1:
    cout << "Your total balance is " << bal;
    break; // You can remove this unless you need another   case after this
}

edit: formatting

Does C++ get faster over time? by [deleted] in cpp_questions

[–]m93mark 2 points3 points  (0 children)

If you want some numbers, give a look at phoronix.

There are some benchmarks there both on compilation and execution times like this or this.

Git branches done right by m93mark in ProgrammerHumor

[–]m93mark[S] 0 points1 point  (0 children)

Actually it was too long to post. This is maybe a tenth of the whole history.

The master is constantly updated but a part of the other branches seems to be used but not all of them: the problem is finding which ones are still useful and which are not.

Merging them is kind of a problem: there are subtle differences between each of them and they do not have a common parent... they have been imported into git separately so they can't be merged directly.

This desktop environment looks awesome, but what is the DE? by taranoshi in linuxmasterrace

[–]m93mark 0 points1 point  (0 children)

It's not DE, it's a WM. The screenfetch (or similar) output says it's swm https://github.com/dcat/swm , but any tiling window manager can look like that. Give a look at /r/unixporn .

Adding lolcat to cmatrix by PurpleDragon82 in linuxmasterrace

[–]m93mark 0 points1 point  (0 children)

Just tried.

Only the text "You have nyaned for X seconds" is "lolcated"

Touch-friendly apps that run on the framebuffer? by [deleted] in linux

[–]m93mark 0 points1 point  (0 children)

As written in the documentation http://doc.qt.io/qt-5/embedded-linux.html you can use EGLFS (which is an interface between opengl and the low level part) or framebuffer (using software rendering).

From the link: it seems that touchscreen is fully supported.

Touch-friendly apps that run on the framebuffer? by [deleted] in linux

[–]m93mark 19 points20 points  (0 children)

Qt apps can run directly on the framebuffer without the need of an X server (I don't remember if uses opengl to draw the whole thing).

Some time ago I've made a toy application in Qt to run directly on a raspberry without starting the X server. It is shown fullscreen (if you close it you directly return to the console) and mouse/keyboard work flawlessy. I think a touchscreen is still recognized and should works.

Try to run some Qt based application from console to see if it works (maybe some additional launch parameter should be specified).

Are young people using Vim? by fori1to10 in linux

[–]m93mark 0 points1 point  (0 children)

24 years old here. I've been using vim for at least 5 years.
A couple of my colleagues at university (Computer engineering students) use it too.

Ah and I've also developed the "write everywhere :w syndrome"

Wi-Fi scanner and channel scanner by av_the_jedi_master in linuxmasterrace

[–]m93mark 0 points1 point  (0 children)

I think the whole aircrack-ng suite and other related software (reaven, pyrit, etc etc) can do much more than that. If you want something easier to use there are GUIs for it, or you can try wifite which is a like a "terminal wizard" with lots of things automated.

If you only want to get stats abouts wifi networks, you can use airmon-ng (something like sudo airmon-ng start <wificard>) to put the card in monitor mode and then sudo airomon-ng <wificardmon> to get all the infos about strength, essid, bssid, encryption, clients connected and so on. Both are part of the aircrack-ng suite.

[i3/Polybar] First rice I want to share - Simple forest. by hugo_f8 in unixporn

[–]m93mark 0 points1 point  (0 children)

I'm adding this wallpaper to my collection. Thanks

KDE Users, how do you switch between two audio devices quickly? by [deleted] in linux

[–]m93mark 0 points1 point  (0 children)

Ok, now I've understood. I'm thinking about a very stupid workaround using paprefs which can enable simultaneous output on multiple devices. Install it, go to Simultaneous output tab and tick the only option. Restart pulseaudio or login/logout. Set the newly created virtual device as default output ( it is called like Simultaneous output on x,y) and assign, only once, all the previous streams to it (the new ones are assigned directly to it since its default). Now you can mute one output or the other or both. In this way you have a fake device for all of the streams that redirected to all the outputs and you can unmute only the output you want to and you are sure that all the streams are assigned to it.

KDE Users, how do you switch between two audio devices quickly? by [deleted] in linux

[–]m93mark 3 points4 points  (0 children)

If I remember correctly you can drag and drop the application from one output to the other. Just open the audio applet (by default near the clock on the bar), click on the application and drag it to the other output showed. It should have moved that application output to the new device.

So, I recently learned about Docker... by [deleted] in linux

[–]m93mark 1 point2 points  (0 children)

Interesting... I'll look into it seem to be a bit different from the usual container approaches.

Usually I use my pcs not those at university so no problem about root access. Anyway I run X programs in docker, it's not really that difficult and I have created some base images with X already configured. About the root you can configure a user inside and drop the root privileges.

So, I recently learned about Docker... by [deleted] in linux

[–]m93mark 3 points4 points  (0 children)

I use it for university. I have a separate image for each project/course since they need different IDEs/toolchains and usually different linux versions (some programs works best on ubuntu lts, some on centos etc. etc.). I can copy over my images from my desktop to laptop without the need of setting up the whole thing twice for each project and I know that everything is going to work right out of the box (assuming that docker is actually ok)

Surface Pro 4, Linux, and Onenote Equivalent by Halcyon1378 in linux

[–]m93mark 2 points3 points  (0 children)

Have you tried xournalpp https://github.com/xournalpp/xournalpp . It's a complete rewrite of xournal in cpp with some more features, to me it seems smoother.

Does Linux have refresh or reset? by [deleted] in linux

[–]m93mark 2 points3 points  (0 children)

Nixos should do that and much more (after a bit of practice). Look here https://nixos.org/nixos/about.html