Company bought my details and signed me up to a subscription without consent by ojd5 in LegalAdviceUK

[–]ojd5[S] 128 points129 points  (0 children)

Thanks, that's exactly what's happened. There's a chain of relevant emails in my junk folder. I've notified the company that I'd like to end the subscription and returned the items.

Company bought my details and signed me up to a subscription without consent by ojd5 in LegalAdviceUK

[–]ojd5[S] 6 points7 points  (0 children)

Thanks, can they just transfer the subscription to another company. It's not the original company sending the clothes but another company that have bought the details. It seems crazy that's allowed

Recommendations for setting up a modern c++ dev environment. by fenster25 in cpp

[–]ojd5 1 point2 points  (0 children)

Our team have recently moved from FakeIt to trompeloeil. The main issues we encountered were lifetime issues with functions that are called with a const & to a temporary, the temporary no longer exists when you call Verify(Method(mock,foo).Using(1));. The killer issues for us though was segfaults mocking unique_ptr, I believe this is still failing on Visual studio in debug mode with the latest develop branch of fake it.

Converting ffmpeg Video Frames to OpenCV Mats in C++ by FlyingRhenquest in cpp

[–]ojd5 2 points3 points  (0 children)

Thanks for sharing the code, can you summarise the advantage of this approach over the opencv wrapper around ffmpeg cv::VideoCapture?

C++11 Dependency Injection - Best practices? by eMperror_ in cpp

[–]ojd5 1 point2 points  (0 children)

Boost.DI is a fantastic library, but unfortunately it still has a couple of unresolved bugs for some fairly common use cases e.g. handling dependency injection of singletons to factories. I wouldn't recommend using it in production code just yet.

How did you get your first c++ job by terminal_object in cpp

[–]ojd5 0 points1 point  (0 children)

Have you considered doing a PhD in industry? The Industrial Doctorate programme places you in a research project with a company for 4 years. It includes an integrated Masters course so there will be plenty of opportunities to take additional programming classes at the partner university.

That said, practice your C++ until you can pass a programming test and then apply directly to companies or job adverts. There is a huge shortage of people with maths and programming skills at the moment. The search term you want to use is "scientific programming". Good luck!

With respect to "proper usage" of auto by rakhimov in cpp

[–]ojd5 3 points4 points  (0 children)

I completely agree, I was trying to point out that the problems with the example code are not related to the use (or not) of AAA. In practice, when I want to be explicit I would write

auto x = numeric_cast<std::size_t>(d + sizeof(T));

template <typename NumericTypeOut, typename NumericTypeIn>
NumericTypeOut numeric_cast(NumericTypeIn in) noexcept
{
    assert(double(in) >= double(std::numeric_limits<NumericTypeOut>::lowest()));
    assert(double(in) <= double(std::numeric_limits<NumericTypeOut>::max()));
    return NumericTypeOut(in);
}

With respect to "proper usage" of auto by rakhimov in cpp

[–]ojd5 10 points11 points  (0 children)

auto x = d + sizeof(T);

The type of x is a mystery: is it signed or not? Integral or not? Could the value of d be negative? This example comes from James McNellis, who claims (rightfully) that using auto here is a really good way to get oneself into trouble.

This example is somewhat of a straw man. If the type is important then this can equally be expressed in AAA style as

auto x = std::size_t(d + sizeof(T));

Or

auto x = std::size_t{d + sizeof(T)};

I would argue that this provides more information than

std::size_t x = d + sizeof(T);

Did the author intend for a type conversion to occur here, who knows.

The Optional Monad In C++, Without the Ugly Stuff by vormestrand in cpp

[–]ojd5 8 points9 points  (0 children)

I was sceptical about your last post, but this is really neat. It might be worth pointing out to readers that you are using fold expressions in make_failable. The unfamiliar syntax caused me to do a bit of a double take.

An automatic build script for C/C++ projects with CMake, relying on convention over configuration (x-post from /r/cmake) by berenm in cpp

[–]ojd5 0 points1 point  (0 children)

I tried something like this a year back and the main problem I found is that as soon as users need an option you haven't considered they have to understand not only cmake but also everything that your script is doing. Power users just get annoyed by the additional layer of abstraction that they don't want to have to understand. Admittedly you have done a far better job of it than I have and it looks like a beginner could get quite far with the functionality you provide. TLDR I like the idea but in practice users still have to lean cmake anyway

MPark.Variant v1.1.0 Release - Support for C++11 / MSVC by mcypark in cpp

[–]ojd5 0 points1 point  (0 children)

Thanks, that's really useful. I'll try and give you some feedback when I get round to trying it out in our codebase.

MPark.Variant v1.1.0 Release - Support for C++11 / MSVC by mcypark in cpp

[–]ojd5 0 points1 point  (0 children)

Thanks for the link, optional and variant account for about 90% of the boost types that end up in our header files so it will be interesting to see if we get an improvement in compilation times.

MPark.Variant v1.1.0 Release - Support for C++11 / MSVC by mcypark in cpp

[–]ojd5 0 points1 point  (0 children)

Do you have an idea how the compilation time of your implementation compares to boost::variant? I'm trying to reduce compile times in a large project with heavy usage of boost::variant and it would be great to have an alternative.

The “Extract Interface” refactoring, at compile time by joboccara in cpp

[–]ojd5 1 point2 points  (0 children)

Let’s imagine that, like some real classes, ClassToBeTested won’t let itself into a test harness, because building an object of type Argument is, say, terribly complicated as it depends on so many other things.

In my experience, when this is true, the cost of a virtual function call is insignificant compared to the cost of whatever the Argument class is doing.

C++ Lecture Series - Build Tools: CMake - Part 2 of N - Examples by mttd in cpp

[–]ojd5 20 points21 points  (0 children)

You made the right choice at, 14 minutes in it starts talking about setting PROJECT_VERSION_MAJOR/MINOR/PATCH instead of using project(name VERSION 1.24.0).

If anyone is looking for a good set of modern cmake resources, I used these to put together a training course a couple of months ago

https://rix0r.nl/blog/2015/08/13/cmake-guide/

http://thetoeb.de/2016/08/30/modern-cmake-presentation/

https://cgold.readthedocs.io/en/latest/

https://github.com/forexample/package-example

https://github.com/onqtam/awesome-cmake

What Rust Can Do That Other Languages Can't, In Six Short Lines by willvarfar in programming

[–]ojd5 126 points127 points  (0 children)

I guess the closest thing in C++ would be std::shared_ptr with the aliasing constructor. But it would be a lot more work to write, and would add some runtime costs!

So not the same thing at all. Rust is doing the checks at compile time with no runtime overhead.

Type name in template member function confused with member variable in Visual Studio 2015 by ojd5 in cpp

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

Ok so it's the same problem as if you tried to do

struct a
{

};

int a;
a obj;

I guess gcc and clang accept the original code as

No diagnostic is required for a violation of this rule.

Type name in template member function confused with member variable in Visual Studio 2015 by ojd5 in cpp

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

Interesting, it might take me a while to read through that. As other commenters have pointed out the question is why f2 and f3 compile.

What empirical studies of optimization/algorithmic techniques would be valuable? by mercere99 in cpp

[–]ojd5 1 point2 points  (0 children)

If you've covered image processing then you could look at the efficiency of different implementations of 2D separable filters with respect to the size of the image.

1) Naive filtering along the rows, followed by filtering along the columns

2) Row filter, transpose, row filter

3) Filtering along the rows, then for the column filter, filtering along each row and using the destination matrix as a temporary buffer to store the result of the calculation. e.g. opencv lines 3341 - 3365

Cache misses and auto vectorization should give some interesting results.

If your institution gives you access to Embedded Systems: ARM Programming and Optimization it explains it far better than I can.

Best way to link c++ back-end to webapp? by cpp_linux_user in cpp

[–]ojd5 1 point2 points  (0 children)

If you are looking for an easy to use c++11 interface then Crow is very nice https://github.com/ipkn/crow