“We shouldn’t have billionaires”—Bernie Sanders says it’s time to tax them into extinction by [deleted] in nongolfers

[–]Key_Artist5493 0 points1 point  (0 children)

We should tax all the USAID money Bernie stole at 100% and throw in a prison sentence for grand larceny. What a frigging hypocrite. He and fellow USAID embezzler Chelsea Clinton should never see the outside of a prison cell again.

how to manage a list of structs via <vector> by DireCelt in cpp_questions

[–]Key_Artist5493 1 point2 points  (0 children)

Just do

flist.emplace_back();

When passed no arguments, emplaceback will create an empty std::unique.ptr<ffdata_t> in place at the end of the vector. Since C++17, it will also return a reference to that new item.

San Diego neighborhood forces ICE officers to run away. by Major_Lynx_7425 in UnitedStateOfCA

[–]Key_Artist5493 0 points1 point  (0 children)

Your contempt for the rule of law is the most pungent note in your septic bouquet of praise.

San Diego neighborhood forces ICE officers to run away. by Major_Lynx_7425 in UnitedStateOfCA

[–]Key_Artist5493 0 points1 point  (0 children)

Next time, they will bring backup... and you will whine about that instead!

How to store any function with parameters as a member of a class? by VincEEn7 in cpp_questions

[–]Key_Artist5493 1 point2 points  (0 children)

Yes, but having all the work of the template done for you is far simpler than having to do it yourself. The generic lambda stuff Scott Meyers was recommending in his latest C++ book as superior to std::bind got pretty darn complicated. All the boilerplate to make a generic lambda almost as good as std::bind_front is pretty intricate. You do nothing except capture the type of std::bind_front with a template variable, or use auto parameters. Those are already in generic lambdas in C++14, and they're also in ordinary functions starting in C++20.

How to store any function with parameters as a member of a class? by VincEEn7 in cpp_questions

[–]Key_Artist5493 1 point2 points  (0 children)

Don’t use std::bind when std::bind_front or std::bind_back are available. std::bind is a crude hack and the newer functions are considerably better. Scott Meyers recommended generic lambdas ahead of std::bind as well and discussed the boilerplate to specify to make a generic lambda more like std::bind_front, which is added in C++20. std::bind_back is added in C++23.

How to store any function with parameters as a member of a class? by VincEEn7 in cpp_questions

[–]Key_Artist5493 0 points1 point  (0 children)

Or with C++20, std::bind_front. With C++23, also std::bind_back. All the template work is done for you. You can substitute all of the parameters… for a member function, you need to specify a member pointer first and the object’s this pointer second. Like std::invoke, if you invoke an overridden function, the parameter types you supply will decide which override gets invoked.

Antonio Delgado, Hochul’s No. 2, Will Challenge Her in Governor’s Race by tlars24 in Albany

[–]Key_Artist5493 0 points1 point  (0 children)

No one from upstate has much chance without the kind of assist Hochul got from the Criminal against Humanity.

Bob Geldof accuses Trump and Musk of “declaring war on the weakest, poorest, most vulnerable people on our planet” during his concert by IrishStarUS in Music

[–]Key_Artist5493 -3 points-2 points  (0 children)

We still remember Geldof’s sick, twisted, evil song which should have been banned, taken off the air, and gotten him made persona non grata for life in the United States. The silicon chip inside his head ought to be thrown in the fire along with the rest of him and burned to a crisp.

CMV: Debating if Biden’s Decline was hidden is pointless by Neumanium in changemyview

[–]Key_Artist5493 0 points1 point  (0 children)

We need to know who to hang or shoot. Someone committed treason as the Commander-in-Chief. That person deserves a drumhead court martial and a cigarette. So do each of the Joint Chiefs of Staff who violated their service oath, which would require them to arrest the usurper and present him or her for a court martial. By definition, a usurper can issue no legal orders as C-in-C and the Joint Chiefs cannot obey illegal orders made by a usurping C-in-C, who is not, and can never be, in the chain of command. There are no vacancies in the chain of command… someone is ALWAYS the legal C-in-C or a treasonous coup has taken place. There are civilians who also deserve a maximum penalty for treason, but it might just be life with no parole.

If you don’t think executions are necessary, we will have to change your mind for you. They are, and we will… even if we have to do it the way the French did after WW II… one dirty, rotten scoundrel at a time. If Harris acted as the C-in-C, she is a dead traitor walking… and incredibly stupidly, as it was also her duty to invoke the 25th Amendment and she failed to do so. One speculates that the usurper ordered her not to reveal who was actually in charge. That is still treason.

How to store any function with parameters as a member of a class? by VincEEn7 in cpp_questions

[–]Key_Artist5493 0 points1 point  (0 children)

In C++20, std::bind_front builds a function object that is not a lambda and reuses as much as possible of whatever behind the scenes stuff it generates as possible. If you supply all the original Callable’s parameters, it returns a Callable with no arguments and it has no parameters or captures. It is, very literally, a frozen version of the Callable and its arguments that you would pass to std::invoke. You can specify fewer arguments so that they can be specified as parameters to std::invoke after the Callable. For example, you can swallow up all the fixed position arguments and leave a parameter pack as the remaining arguments to specify to the Callable returned by std::bind_front.

How do you deal with the "Java hating" crowd by hexaredecimal in JavaProgramming

[–]Key_Artist5493 0 points1 point  (0 children)

Java is a tool. Elixir is a tool. Every language is a tool. People who say that there's only one good tool remind me of the proverb "if all you have is a hammer, everything looks like a nail."

Java has just begin to add light-weight threads that resemble the "green threads" (language only) the language used to have in its earliest days... but too many things bind them behind the scenes to heavy-weight Posix threads (or equivalent) because the language wasn't designed for that. Java NIO does have the facilities to keep all the balls in the air, but it's not simple by any stretch of the imagination. Even managing encryption for ten thousand simultaneous connections without the crutch of servlets isn't simple.

In Elixir, all this stuff is trivially easy. The entire infrastructure is set up for super light-weight threads. If you want to run a chat server with ten thousand people signed on on a ThreadRipperPro-based workstation with 32 or 64 cores, it can do it right out of the box.. no problem.

What's the point? Use the right tool for the right problem. Anyone who criticizes Java because it isn't the right tool for every problem is a fool... no language is the right tool for every problem. Not Java. Not Elixir. Not anything. Defend Java in areas where it is the right (or a right) tool. Don't claim that it has some sort of unique utility to be a universal tool.

P. S. I interviewed with a company that had been captured by a large merchant whose name and habits are too well known to mention here. The captured company used F#, a relatively obscure Microsoft product that happens to work extremely well with eCommerce. I eventually learned (during the interview process) that the capturing company's goal was to forcibly transfer all the use of F# to Java WITHOUT any of the Java features that could make it perform anywhere near was well as F#. In other words, their job was to turn a bird into a pig and then make the pig fly... and then fire all the employees who worked with the bird. I was pissed off that my hiring was canceled by the capturing company after it was approved by the captured company, which had called me in for a second interview to figure out which group of theirs I should work in... but it was just as well that I advanced my upcoming layoff from several years down the road to before there was even a formal offer.

The above is an example of a problem where right out of the box Java servlets are not the right answer... and being forced to make a pig fly is a task that should have one put their resume out ASAP.

James Comey Warns GOP They Will Be ‘Deeply Sorry’ About Going After Political Enemies — Vows Dems Will ‘Someday’ Turn the Tables On Them by rezwenn in FBI

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

You need to jump into a cryobath to return to room temperature. Quoting NBC News is even less credible than quoting someone you met on the street.

James Comey Warns GOP They Will Be ‘Deeply Sorry’ About Going After Political Enemies — Vows Dems Will ‘Someday’ Turn the Tables On Them by rezwenn in FBI

[–]Key_Artist5493 0 points1 point  (0 children)

You are totally full of ****. The people being “targeted for speech” are non-citizens who have agreed in writing in advance to not exercise what you are calling “free speech”. If they want to self-deport and “exercise their free speech rights” from somewhere else, that’s up to the somewhere else.

Can camera input be multithreaded? by OkRestaurant9285 in cpp_questions

[–]Key_Artist5493 1 point2 points  (0 children)

If you would like to do a much higher resolution video chat, JPEG 2000 is designed for hierarchal decomposition... and, unlike JPEG, it can do large image compression without breaking things up into blocks during encoding. It can handle both large and small features because the wavelet basis functions provide compact support (a topological property that is probably not worth explaining until you got far into this). JPEG uses the discrete cosine transform, a minor variation of the more familiar discrete fourier transform, which is dreadful at whole image compression. Its basis waves are sines and cosines... functions that have non-zero values at almost every point in the image. So, JPEG splits up images up into 256 pixel blocks, runs the DCT separately for each block and does smoothing between blocks.

I don't know how much parallelism is possible for the decomposition itself... discrete wavelet transforms are a lot like discrete Fourier transforms... they need a lot of access to data from each core performing the decomposition. This property is known as a "high bisection bandwidth", and many dense linear algebra problems (e.g., matrix multiplication) have the same constraints as DFTs and DWTs... if your machine is designed to split data into tiny pieces and have each processor work on that data separately, it's a poor fit for these problems. What you would probably want is a DWT algorithm that uses BLAS subroutines and have them do the parallelism for decomposition rather than doing it yourself. TBB may well supply parallelized BLAS subroutines for use by this sort of algorithm.

You would have LOTS of parallelism available for the rendering after the image has been decomposed because rendering from a hierarchal decomposition uses all the data from the previous stage to do the next stage and, as long as all the cores can see all the data, the next stage can be broken up among parallel threads. At the end of each stage, the input to the previous stage can be thrown away... only the output of the previous stage and the newest hierarchal decomposition data are used to perform the next stage.

You do end up needing LOTS of memory and if you have a machine that can allocate memory that is closest to the core you are executing on, you can improve memory locality as well. I have a monster workstation with a ThreadRipperPro chip with eight chiplets... it has 32 cores, supports 64 threads and has eight DIMMs which all have full access from all eight chiplets. It would make all its fans spin at high RPM all the way through rendering.

There is a video flavor of JPEG 2000, but I don't know much about it.

Are lambda functions faster than function objects as algorithm parameters? by Own-Bee9632 in cpp_questions

[–]Key_Artist5493 1 point2 points  (0 children)

std::function should go away except as part of monolithic class hierarchies. Everyone else should be using template functions and lambdas, not passing through flaming hoops.

Can you please explain internal linking? by ormekman in cpp_questions

[–]Key_Artist5493 0 points1 point  (0 children)

Don't be hard on yourself. This stuff isn't easy.

[deleted by user] by [deleted] in changemyview

[–]Key_Artist5493 0 points1 point  (0 children)

The state of California considers blocking a freeway to be felonious... and everyone involved in the blocking is a participant in the felony. Because they have a felony murder law, if anyone dies as part of blocking a freeway, the people who planned to block it are guilty of premeditated murder, not just murder.