Anyone know a good recipe for fake blood?

I presume that there will be soon a 'How To' page on this on Mahalo, but in the meantime, wikihow has a good recipe using 1 part water and 3 parts corn syrup, and some thickener. I won't copy it here, but you can find it at this location: wikihow.com/Make-Fake-Blood Metacafe also has a very nice video on this, which I link here too, plus a youtube video. This should give you more than enough material to work with.

Good luck at scaring people!

How much you put in) it depends on how much blood you want! I know another way to make fake blood! Get some writing icing.

Put it on your hand.

You might overload the operator on a custom container, to provide a syntactically/semantically clearer way of accessing elements For example my_container3 = 9 is somewhat clearer than my_container. Set(3, 9) Of course, you could overload the to do essentially anything, but you probably shouldn't. You could, for example, cause my_object3 to increment my_object by 3, but semantically the operator conveys lookup-by-index, and it's always better to have your interfaces conform to expectations You could use assert for quick-and-dirty bounds checking; it will cause your program to die messily, which is always preferable to introducing subtle memory corruption.

The benefit is that assert is a macro which can be compiled out of production code, meaning you may pay the overhead of bounds-checking your container in development and not in production with no modification to your code.

You might overload the operator on a custom container, to provide a syntactically/semantically clearer way of accessing elements. For example my_container3 = 9; is somewhat clearer than my_container. Set(3, 9); Of course, you could overload the to do essentially anything, but you probably shouldn't.

You could, for example, cause my_object3 to increment my_object by 3, but semantically the operator conveys lookup-by-index, and it's always better to have your interfaces conform to expectations. You could use assert for quick-and-dirty bounds checking; it will cause your program to die messily, which is always preferable to introducing subtle memory corruption. The benefit is that assert is a macro which can be compiled out of production code, meaning you may pay the overhead of bounds-checking your container in development and not in production with no modification to your code.

You would consider overloading operator for classes where the operation (index( by a single field makes sense, as it is the case of vectors (index by position) set or maps (index by key). Note that if there is more than one dimension by which to index, it might make sense to use a different operator (operator()), as operator takes a single argument. You should probably read the C++FAQ lite entry on Operator Overloading.In general assert is unrelated to operator (or any other operator).

Assert is a way of determining at runtime that some preconditions to the operation are met, and should be used to fail fast and fail hard when you detect that some of your invariants are broken.

1 Just a note, but if there is more than one dimension, the classical solution is to return a proxy, which also overloads . One can argue about the two approachs, but the proxy solution does provide the same syntax as C style arrays of arrays, i.e. Cij.

– James Kanze Mar 30 at 16:13 @James Kanze: That is, in most cases not the best idea. Read 13.10 and the following points from the linked C++FAQ. – David Rodríguez - dribeas Mar 31 at 10:16 @David Rodriguez The FAQ expresses the opinion of one author.

Opinions on this question differ. (Several of the statements in the FAQ, particularly those concerning performance, are simply false. One solution maps easily to the other, so performance is never a reason to prefer one over the other.) I rather prefer the use of () myself---I've been influenced by Barton and Nackman---but both options are valid, and deserve to be mentionned, and judging from the places I've worked, the option seems to be the more popular, and to be considered the more "classical" solution.

– James Kanze Mar 31 at 10:56 @James Kanze: No, not really. It is trivial to provide the operator() on top of the operator composition, but not in the reverse direction (*). Also that FAQ is not the work of an author but rather the result of pulling frequently asked questions from comp.lang.

C++. (*) Ok, trivially it is, if you provide a function with N arguments, and operator return proxies that only contain a pointer to the object + the argument to the operator, the last level of such proxying calling the original function. – David Rodríguez - dribeas Mar 31 at 14:30 ... but that shows that you have solved the issue by providing a multiple argument function (why not just call it operator()?

) and added a bunch of boiler plate code just to make it look like operator. – David Rodríguez - dribeas Mar 31 at 14:34.

Well with my limited knowledge on this, I can say, in situations when the classes hold a sequence of elements. Vector/String for example. For assert you may want to check out this site.

--LINK.

Assert has absolutely nothing to do with the indexing operator operator per se. Assert is used to check preconditions/invariants in debug builds, so violations of these are trapped before going into production. Indexing operators are prone to index out of range type of situation, which might explain why you seem to be noticing them there more often than elsewhere.

I use assert basically at least once in every parameterized function, and several times per class (checking invariants). HTH.

You might overload operator if you are implementing a class that is a collection or a wrapper for a collection. For me, I would only overload operator if the operation could be executed in constant or near-constant time, since that is how array indexing performs. It may make sense to use it to look up values in a hash table, but not to index into a linked list.

If you are finding asserts used in implementations of operator, it is likely to enforce that the index argument is within the range of the collections. This, IMO, is an incorrect use of assert, since assert should be used to catch internal programming errors, rather than you program being called the wrong way. An end user or client application should never see an assertion error.

The other possibility is that this class is only used internally, in which case an assertion error would reveal an internal programming error, not a wrong argument passed in by a client.

Good mention of time constraint; that is what prevents the operator from occurring on many STL containers. Though they allow log time in the case of map. – edA-qa mort-ora-y Mar 30 at 16:42.

A classification of some common programming languages is made by whether their operators are overloadable by the programmer and whether the operators are limited to a predefined set. The ALGOL 68 specification allowed operator overloading. Note that no special declaration is required to overload an operator, and the programmer is free to create new operators.

Ada supports overloading of operators from its inception, with the publication of the Ada 83 language standard. However, the designers of the language choose not to permit the definition of new operators: only the existing operators in the language may be overloaded (by defining new functions with identifiers such as "+", "*", "and" etc.). Subsequent revisions of the language (in 1995 and 2005) maintain the restriction to overloading of existing operators.

C++'s operator overloading is further refined from that of ALGOL 68's. Sun chooses not to include operator overloading in the Java language. Ruby allows operator overloading as syntactic sugar for simple method calls.

Lua allows operator overloading as syntactic sugar for method calls with the added feature that if the first operand doesn't define that operator, the method for the second operator will be used. Microsoft includes operator overloading for C# in 2001. Scala treats all operators as methods and thus allows operator overloading by proxy.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions