As an epileptic I doubt that this kind of device "can help them (the epileptics) adjust their medications." My neurologist adjust my medications every 6 months after studying my blood analyses, standard EEG and sleep EEG.
How did he make it work? I didn't think this would be possible.
Yes, extremely impressed with the tool.
EDIT: Looked at the code. He takes screenshot of the active tab when extension is clicked. And then parses the PNG in measureDistances function when mouse moves.
For a mouse at position X, Y, it tries to find the farthest Top, Bottom, Right, Left points with same color/threshold. This is why it is able to see through 'transparent' Google logo.
"For use on a simple webpage that is not considered a web application. A web application is a website that has customer specific data or charges for its use. This requires a Developer license."
According to the documentation you can declare an operator composed by an arbitrary list of this characters "/ = - + * % < > ! & | ^ . ~". You can recreate C++ stream operators (<<, >>), Ruby combined comparison (<=>), and so on.
I think the danger of abuse is stronger when you overload existing operators than when you make up new ones. The latter can't fool you on its semantic and behavior.
I bet we will see some interesting examples of fooling in obfuscated Swift contests.
For example one can define operators called <>, =<, =>, and !=
You can do interesting stuff with pre- and suffix operators, too. For example, the XML comments <!-- and --> could be a prefix- and suffix operator pair.
Also, you could define operators that look conspicuously like comments, at least to some of your readers.
[disclaimer: I don't have access to the code; I just read the documentation. That documentation seems to imply that // starts a comment _and_ can be used to implement a custom operator. Even if that isn't possible (fairly likely, I would say, you can still try using --- or /// as your operator]
Ok, let me replace my “can’t” with “is a lot less likely to”.
I checked: neither // nor /// can be used as operators (syntax error: they both just start a comment). All your other examples work, but I would say those mean the author is intentionally trying to trick me. Or he’s writing a clever DSL, but that line is very fine and treacherous.
I don't know whether this is reassuring or worrying, but Haskell has long (always?) pursued this strategy of allowing even more flexible operator names. From http://www.haskell.org/onlinereport/lexemes.html:
> Operator symbols are formed from one or more symbol characters, as defined above …
I'm quite fond of being able to define new operators. Particularly in functional languages, it allows you to effectively extend the language. For example, F#'s designers didn't include the usual monad operators. It's easy enough to define your own >>=, though, so life is still good. Similarly, ML developers can create their own forward application ( |> ) operator to also get good access to a useful feature that isn't included by default.
In languages that don't allow you to overload operators at all, the alternative is to use explicit function syntax. That can sometimes be a short path unreadable to code that's littered with pyramids of doom.
In languages that only allow you to overload existing operators, you end up with monstrosities like C++'s << and >> operators, which overload the bit-shift operators with new and completely unrelated semantics. It's that kind of shenanigans that give operator overloading such a bad name.
> Operator overloading can potentially be abused because in Swift you are not limited to standard operators like in C++.
It is both a blessing and a curse, as far as potential for abuse is concerned.
You pointed out the downside of arbitrary operator names. The downside of operator overloading on fixed operator names is that you are limited in your choice of operators, so instead of choosing a more distinct operator, you sometimes have to go with things that are kind-of-the-same, or maybe not close at all. And instead you also have the problem of misleading people, for example by using the +-operator for set union, while the reader thinks you are adding together numbers.
If you write ([[]] == false) you compare values of this object. Internally a [[]].toString() is called which gives an empty string (cause the first element is also an empty array) which in turn is considered false in javascript.
Otherwise [[],[]] is true cause cause [[],[]].toString() gives you this string: ",".
As an epileptic I doubt that this kind of device "can help them (the epileptics) adjust their medications." My neurologist adjust my medications every 6 months after studying my blood analyses, standard EEG and sleep EEG.