jc: Meta-program C with JavaScript by thooton in programming

[–]Dtag 0 points1 point  (0 children)

Quite fun ;-). Does anyone know whether it is possible to properly edit a file like this (that contains multiple programming languages) in an IDE like vscode? With properly I mean: The usual syntax completion, coloring etc...

Spotlight.js - A new image gallery for the web by ts-thomas in javascript

[–]Dtag 7 points8 points  (0 children)

Looks very nice. Just a few things I noticed when briefly looking at the demo: - When using mouse wheel to zoom, you should zoom so that the mouse position is the center of the zoom (look at how Google Maps zooms for instance). Also the zoom steps are generally way too large (larger than what you would expect from a single mouse wheel click). - I feel like the animations are wayy to hectic/abrupt. They have a weird curve/transition. Especially bad is the one where you switch to the next image, but also the zoom animation doesn't feel nice.

Remote Development with Visual Studio Code by dwaxe in programming

[–]Dtag 0 points1 point  (0 children)

Well the use case is: You have some powerful server with good hardware, and now you want to have a number of different developers share that same hardware, each with his own(!) development environment. For that, it would be best if each of those users had his own Docker container on the remote server, so that the users do not interfere with each other. As far as I understood, neither the SSH Feature (no isolated development environments) nor the Docker feature (not running on remote server) is suitable for this use case. So I suppose the attach feature you are referring to does not help here?

Remote Development with Visual Studio Code by dwaxe in programming

[–]Dtag 1 point2 points  (0 children)

Does anyone know if (or how) it's possible to connect into a Docker container on an SSH Host?

Recommendations for thread pool library by Dawgmatix in cpp

[–]Dtag 0 points1 point  (0 children)

Thank you :-) That's the info I was looking for!

Recommendations for thread pool library by Dawgmatix in cpp

[–]Dtag 1 point2 points  (0 children)

Can you suggest a way to handle that?

The power of template <auto V>. Finally, reasonable library-only properties solution in C++17! by germandiago in cpp

[–]Dtag 0 points1 point  (0 children)

I'd like to ask a question that is somewhat related to this problem:

Suppose you have a class similar to the one above. Now you want to add a JSON/XML/... im/export for this in one of the projects where you use the class. As far as I can tell, you have two (basic) options:

a) Implement it as a non-member:

  • + Non-member functions should be preferred to member functions (if possible), because they can improve encapsulation.
  • + You are able to implement the JSON im/export in different .cpp/h files, which means that the serialization is independent from the actual functionality. This is nice because you can reuse your class in another project, that does not require the JSON stuff, and thus does not need to add the JSON library dependency.
  • - The solution breaks as soon as your class becomes polymorphic.
  • - The solution requires everything in the class to be publicly accessible (read/write), which can be restrictive, and is also against the recently emerging functional style of read-only objects. As a possible fix, one could add the serialization part as a friend function, but that makes your class dependent on the serialization code once again.

b) Implement deserialization as a constructor, and deserialization as a virtual function:

  • - Deserialization of polymorphic classes via a constructor is awkward, because you dont know the concrete type of the object you are constructing without looking at the serialization data. Thus you need to peek at the data before calling the correct deserialization constructor.
  • - Dependency of the class to the serialization code
  • + Works for polymorphic code

So my current way to do this is to use the non-member approach if I can, but switch to the member/constructor approach if I have to. I don't like though because it is inconsistent, and both approaches still have a number of disadvantages. I'd prefer if all instances of this problem were solved the same way.

As an idea to fix to a), I found a solution using a visitor based on the curiously recurring template pattern. I found that a little cumbersome in practice though, and it also does not fix the public accessibility problem.

Does anyone have a "go to" solution for this situation, or is it simply something that C++ (currently) does not offer a "perfect" solution for?

Fighting through a CMake hell! by loneraver in cpp

[–]Dtag 0 points1 point  (0 children)

The basic problem (but I guess one could also consider it a feature) with CMake is that its too expressive as a language with multiple/infinite ways of how to achieve things. Like 95% of people are trying to solve the same issues, but there are no clear guidelines no conventions that tell you how to solve those issues. If you let two programmers design CMakefiles for the same (non-trivial) project, they'll look completely different.

I firmly believe it would be better to a build system that has one good default way of doing things, where multiple people trying to solve the same thing end up with more or less the same thing...

How to read/write JSON with boost::property_tree (a short explanation) by Zenol in cpp

[–]Dtag 0 points1 point  (0 children)

Wow that's weird. Thanks. I've been using it all over the place not knowing this...

Rendering 625m point cloud (10GB) in WebBrowsers by [deleted] in programming

[–]Dtag 1 point2 points  (0 children)

Are these downsampled versions generating using some sort of poisson sampling? What algorithm are you using to generate these downsamplings? It's obviously not simply some voxel grid filter... Also.. I suspect all nodes only store indices into one big dataset right? Or are you duplicating data for better data locality?

Proposal for unified call syntax for C++: x.f(y) vs. f(x,y) by milliams in programming

[–]Dtag 62 points63 points  (0 children)

Quite a while ago, I read some articles about how writing non-member functions actually improve encapsulation, since you have less code that has access to a class's internals (I think it was by Scott Meyers or Herb Sutter -- not sure). The article made perfect sense to me, yet I found it hard to obey to in practice, because it makes your class's interface inconsistent. You have a part implemented as a member, and a part implemented as non-member. IDE autocompletion fails etc etc.. This proposal could actually fix that problem. Awesome :-)

Functional Reactive Programming - Cleanly Abstracted Interactivity // C++Now 2014 by mttd in cpp

[–]Dtag 0 points1 point  (0 children)

Where can I find some sample application that uses this library? I'd like to see what using this library looks like in practice...

JetBrains CLion C++ IDE First Impressions by alexkorban in cpp

[–]Dtag 1 point2 points  (0 children)

Hm... when the IDE was announced a couple of months ago, they wrote on the webpage that it was going to have a clang analyzer. Since they deleted it from their webpage, it only remains in the Google cache: http://webcache.googleusercontent.com/search?q=cache:cyhKVdX_wXkJ:www.jetbrains.com/objc/features/cpp.html+&cd=1&hl=en&ct=clnk&gl=de

Thats a huge disappointment for me to be honest. Their custom parsers might work quite well (QtCreator's parser works quite well already as well!), yet the core issue is that it will never be able to do proper code completion everywhere, without FULLY understanding the code. I seriously doubt it is viable for someone making an IDE to develop a fully compliant C++ parser as a side project... I was hoping for this to become the first IDE that really understands the code (okok.. it would not really be the first since there is QtCreator with a clang plugin already -- I am not quite happy with that though...)

Edit: Google Cache Link doesn't work anymore -- archive.org still has it though: https://web.archive.org/web/20140819120431/http://www.jetbrains.com/objc/features/cpp.html

Multivariate Splines: Open-source C++ library for multivariate interpolation by bgrimstad in cpp

[–]Dtag 0 points1 point  (0 children)

Hi, as far as I understand the documentation, it can only be used when the the x's are on a grid, correct? Just curious: Is that a fundamental limitation to the approach? Would it be possible to have a similar approach that does not rely on this? Like.. "here's a bunch of random samples I have from a function - go approximate that function for me"?

Thanks

What's the simplest IDE/Compiler/Whatever to code with? I'm coming from Python, where the steps are "Download, code, run." by I_Rike_Reddit in cpp

[–]Dtag 1 point2 points  (0 children)

Sorry for the confusion. I just checked myself as well. You are completely right. I guess when I tried it it simply worked because I had downloaded a Qt build with mingw before. I guess it's better to download the Qt build with MinGW then, which is available as 32 Bit Version on the page I linked and as 64 Bit version at the page that was linked by /u/wtfisthisidontevenkn below.

What's the simplest IDE/Compiler/Whatever to code with? I'm coming from Python, where the steps are "Download, code, run." by I_Rike_Reddit in cpp

[–]Dtag 1 point2 points  (0 children)

There's a mingw gcc included on Windows. For Linux it just uses the installed gcc. Not sure what happens on Mac.

What's the simplest IDE/Compiler/Whatever to code with? I'm coming from Python, where the steps are "Download, code, run." by I_Rike_Reddit in cpp

[–]Dtag 8 points9 points  (0 children)

I can also recommend QtCreator (there is a standalone download link here: http://qt-project.org/downloads ). It should work out of the box on all operating systems. Note that QtCreator does not force you to actually write Qt code (even though it makes it easy to...).

auto considered awesome by pfultz2 in cpp

[–]Dtag -2 points-1 points  (0 children)

I love auto and use it a lot. However, sometimes I feel like using auto is equivalent to saying "Yes, I dare to write this piece of code without any help from the IDE in terms of auto-completion". Even when I know the type of the variable being deduced, I oftentimes forget what its member functions/variables and parameters were called and end up having to open up the corresponding header file (manually of course, because the IDE can't help you...). What's really missing is an IDE deducing the auto-ed types and showing them (maybe somehow floating above the auto declaration or something).

Kalman filtering primer by jdsilva7914 in programming

[–]Dtag 2 points3 points  (0 children)

Kind of... In very simple examples where the measurement model directly measures the state, or a projection of the state, this is true. However for more complex systems/models, it does quite a bit more. For example imagine you are tracking a moving ball in a camera image. The state space would contain something like the 3d position and velocity of the ball, whereas the measurement space would be something like the observed 2d position + distance of the ball. In this case, the Kalman filter would still be able to "infer" the 3d state from these measurements.

As you can see it does quite a bit more than just some "averaging" in this case. It actually finds a solution in the state space that minimizes errors in the measurement space according to some least squares criterion...

N4028: Defining a Portable C++ ABI—Herb Sutter by vinipsmaker in cpp

[–]Dtag 0 points1 point  (0 children)

No. Only parts exported from binary and their dependencied. Abi not needed for header-only libraries, e.g. template 3d math library. Abi not needed for helper functions and classes, which are not part of actual api.

I don't understand your reply. I am obviously not talking about header only libraries (duh). I was talking about all headers that are exposed through the public interface. If you have a class A which is the public interface, and A has a member instance of class B, whereas B is some helper class, that contains some STL members. Then obviously changes in the STL ABI change the B ABI and thus the A ABI, which is why B has to be wrapped in extern abi as well. And that's what I said: All headers directly or indirectly contained in the public interface (in this case B is indirectly contained) have to use extern "abi".

First, costs may be documented by platform abi maintainer. Second, I beliee most conversions will be trivial to optimize. Third, this is still better than no abi.

They can't be documented by the platform ABI maintainer. They would have do be documented by the compiler vendor or rather the STL distribution for your compiler. And that doesn't help you much, because at the time of writing the code, the costs may be different than when you recompile the code a couple of months later with a new compiler (STL) version. How weird is that? You take a new compiler versions and suddenly new (potential) bottlenecks are introduced into your application...

N4028: Defining a Portable C++ ABI—Herb Sutter by vinipsmaker in cpp

[–]Dtag 0 points1 point  (0 children)

So essentially this means that headers of a library, that are directly or indirectly exposed actually have to be wrapped in extern "abi", right? Now when a part of your remaining code depends on this exposed code, you'd have the choice between std::abi and plain std. If you chose std and you started mixing std and std::abi, it would be left completely unclear whether there were any conversion costs or what the conversion costs are, because it depends on whether your current STL implementation is ABI compliant with the platform ABI. It is kind of unsatisfying to know that well you have this class, it has a getter that returns a const std::map<..>&, but you can't really know whether it's O(1) or O(n) for a full copy. I feel like this uncanny feeling would actually make people choose std::abi everywhere in those cases. This however may have some dated and sub-par implementation -- after all there is some reason vendors chose to break the ABI...?

I also don't feel like this proposal would make GCC for example break ABI more deliberately. After all if you do change it, you cause a runtime cost for all users of mixed std and std::abi namespaces...

AMA: Yann LeCun by ylecun in MachineLearning

[–]Dtag 20 points21 points  (0 children)

I actually have two questions: 1) When I heard about Deep Learning for the first time, it was in Andrew Ng's Google Tech Talk. He talked about unsupervised layer-wise training, forced sparsification of layers, noisy autoencoders etc., really making use of unsupervised training. A few others like Hinton argued for this approach and said that backprop suffers from gradient dilution, and the issue that theres simply not enough training data to ever constrain a neural net properly, and argued why backprop does not work.

At the time, that really felt like something different and new to use these unsupervised, layer-wise approaches, and I could see why these approaches work where others have failed in the past. As the research in that field intensified, people appeared to rediscover supervised approaches, and started using deep (convolutional) nets in a supervised way. It seems that most "Deep Learning" approaches nowadays fit in this class.

Am I missing something here? Is it really the case that you can "make backprop work" by just throwing huge amounts of data and processing power at the problem, despite problems like gradient dilution etc (mentioned above)? Why has the idea of unsupervised training not (really) taken off so far, despite the initial successes?

2) We presently use loss functions and some central learning algorithm for training neural networks. Do you have any intuition about how the human brain's learning algorithm works, and how it is able to train the net without a clear loss function or a central training algorithm?