Can you define `Comonads` based on `Monads`?

Yes, in fact any functor gives rise to a unique comonad in this way, unless f==0. Let F be an endofunctor on Hask. Let W(a) = ∀r.F(a->r)->r W(f) = F(f∗)∗ where g∗(h) = h∘g The puzzle becomes geometric/combinatoric in nature once you realize the following isomorphism: Theorem 1. Suppose neither of the types (∀r.r->F(r)) (∀r.F(r)->r) … Read more

CSS – add transform to element without removing the existing one [duplicate]

Update 2022 At the end of last year the W3C published the working draft for “CSS Transforms Module Level 2”. This spec adds new transform functions and properties for three-dimensional transforms, and convenience functions for simple transforms. It adds “Individual Transforms”: translate scale rotate As the browser-support is over 85% it should be usable, if … Read more

CSS Transform scale, don’t scale child element

Unfortunately this is not possible. You roughly have two other options though: Scale all the other elements, excluding the one you don’t want to scale (but this won’t scale the container). Scale the container and re-scale the element you don’t want to scale (but this will probably make it look blurry). Examples: // Example 1. … Read more

How to apply transform to an STL map in C++

You are missing the const in the first type of the pair. [](std::pair<const std::string, std::string>& p) { However this is not your problem: You cannot use a map as the OutputIterator, as they do not support assignment. You can, however mutate the second argument using std::for_each. Good old map_to_foobar: std::for_each(data.begin(), data.end(), [](std::pair<const std::string, std::string>& p) … Read more

CSS tranform:translateY from JavaScript

You can pass any transform property as a string. HOW? It can be done like this; div.style.transform = “translate(x,y)” I find out that if I write div.style.transform = “translate(someValue)” It only affects x axes. “translate-y(someValue)” or “translate-x(someValue)” did not work out. Or you can use rotate property; div.style.transform = “rotate(50px)”. Try it! https://jsfiddle.net/araknafobia/4wtxu0dr/1/

Fastest available algorithm for distance transform

This paper reviews the known exact distance transform algorithms: “2D Euclidean distance transform algorithms: A comparative survey” https://rfabbri.github.io/stuff/fabbri-EDT-survey-ACMCSurvFeb2008.pdf The fastest exact distance transform is from Meijster: “A General Algorithm for Computing Distance Transforms in Linear Time.” http://fab.cba.mit.edu/classes/S62.12/docs/Meijster_distance.pdf The design of the algorithm is particularly well suited for parallel calculation. This is implemented in my open … Read more