I made an "associative" container adapter that gives list/vector/array/deque a std::map interface (without the iterator/reference guarantees) Then it dawned on me it should probably work on a std::set as well. In which case, there's no reason for std::map to exist. Does anyone have a counterexample off the top of their head?
the problem only occurs because pronunciation vs spelling isn't a very reliable thing, and especially since it changes a lot over time, you can find a lot of samples in the wrong way
because it was the right way fifty or a hundred years ago
Given an object initialized like so:
Base* a = new Derived();
Container<Base> = new C<T>(a);
where
class Base {
...
protected:
~Base();
}
class Derived : public Base {...};
template <typename T>
class Container {
private:
T* object;
public:
Container(T...
Instead I just present valid reasoning as to why the question is silly. Sometimes it works, sometimes I get screwed anyway.
On an English test, there was a question at the end to provide an argumentative text in favour of something I can't remember. Instead of doing that, I provided an argument about why I couldn't decently provide such an argumentation. The teacher was a good one and gave me full score :)
var xorIt = function(input, secret) {
var r = "";
for(var i = 0; i < input.length; ++i) {
r += String.fromCharCode(input.charCodeAt(i) ^ secret.charCodeAt(i));
}
return r;
}
This produces non-printable characters, though. And requires the secret to be at least as long as the input.
Yep, you're encoding the first character with the last byte of the secret. And then decode the last character with the first byte. (modulo the length thing).
Note: Updated and improved the code a lot.
The following code uses a macro to keep the code clean and partial specialization to provide the members. It relies heavily on inheritence, but that makes it very easy to extend it to arbitary dimensions. It's also intended to be as generic as possible,...
I've been thinking about this for a while now how do i convert this function to iterative instead of recursive:
void func(int x){
for(int a = 0; a < x; a++){
func(x - 1)
}
}
note this is not! homework i had a job i...
I've been thinking about this for a while now how do i convert this function to iterative instead of recursive:
void func(int x){
for(int a = 0; a < x; a++){
func(x - 1)
}
}
note this is not! homework i had a job i...