8
votes
Accepted
Stack Interview Code methods made from class Node and Smart Pointers
Overall
Not sure I agree with the use of std::unique_ptr inside of Node. BUT I can't really argue against it. So I am not going ...
6
votes
Stack Interview Code methods made from class Node and Smart Pointers
swap does not swap sizes.
If pop_back throws on empty stack, top shall also throw.
I see no ...
5
votes
Accepted
Python Export Decorator
Personally, I'd prefer to use @export() or @export(globals()), rather than manually perform the ...
4
votes
"Sudo Mode" in VBA to Let UDFs Modify Workbook
I think this is a neat trick which can have some uses so many thanks to @Greg (the OP) for sharing. One use already identified by the OP in another post is the ability to add named ranges from a UDF ...
4
votes
"Sudo Mode" in VBA to Let UDFs Modify Workbook
An alternative
This post is primarily about how one can get around the limitation of formulae being unable to modify areas outside of themselves. Is there a particular reason that this has to be done ...
3
votes
3
votes
Accepted
Frame hack to get variable names as strings
Disclaimer: I am not quite sure this can be considered as a proper review but this is definitly too big for a comment.
Not all variables are in f_locals
Not all ...
2
votes
Python Export Decorator
If there's too much magic, I worry about static linters and new users not understanding the code, so I would want to support proper global variable assignment.
On the other hand, Peilonrayz's answer ...
2
votes
Defining hardware components structure
I'll expand a bit on your design by introducing an adapter.
Implementation
Firstly, you have somewhere an implementation. This could be a library from the internet that you don't want or can't change. ...
1
vote
Accepted
Defining hardware components structure
Namespace vs. struct
It's great that you created a namespace, that already avoids some of the problems global variables have. However, a struct has some advantages, and it's rather trivial to go from ...
1
vote
Accepted
Compute pairwise Pearson's R in parallel with tasks separated by pairs of columns of an array
If you are not going to write anything to X (which it seems you are not doing), and just going to read from it, you should be good to just have all processes access ...
1
vote
C++ Data-Oriented Modules using namespaces and extern
I find your approach of using a namespace instead of a class a good fit for for your purpose.
I recently started to use it as an alternative to the standard singleton pattern.
Regarding the global ...
1
vote
C++ Linked list with smart pointers
In addition to what @MartinYork said, I have a few comments.
std::unique_ptr<typename Node<T>::Node> head;
Why don't you just say:
...
1
vote
Conversion between enum and string in C++ class header
If you have large enumerations, you might find that linear search in an array is inefficient. There's also a real risk of accidentally omitting one or more of the mappings.
I solved this a different ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
namespaces × 28c++ × 10
javascript × 7
python × 4
c++11 × 4
object-oriented × 3
beginner × 2
jquery × 2
node.js × 2
regex × 2
pointers × 2
library × 2
shell × 2
enum × 2
c# × 1
python-3.x × 1
php × 1
c × 1
strings × 1
array × 1
sql × 1
design-patterns × 1
parsing × 1
vba × 1
python-2.x × 1