How to flatMap cats Applicatives

I’ve started learning functional programming with Cats and I stuck with flatMapping (merging) applicatives F[List]. What is very simple in pure Scala is flatmapping list of lists like that: val animals = List(“Dog”, “Cat”, “Bird”) def getBreads(animal: String): List[String] = … val allAnimalsBreads = animals.flatMap(animal => getBread(animal)) // this will be just List[String] How can…

Details

What is the right way to update “front” vector with custom “world up” vector?

I am trying to implement “planet” world. So in any point on it’s surface with my old camera class I got result like this : Camera class update code is: void cCamera::ProcessMouseMovement(GLdouble dt, glm::vec2 curOffset) { curOffset.x *= static_cast<GLfloat>(dt * m_MouseSensitivity); curOffset.y *= static_cast<GLfloat>(dt * m_MouseSensitivity); m_fPitch += curOffset.x; m_fYaw += curOffset.y; if (m_fYaw >…

Details

Development environment with multiple interconnected computers

I have multiple (about 10) raspberry pi’s which execute some c++ code, they are connected via can/ethernet and should cooperate with each other. They are also physically inside of one “demonstrator”. The development should happen on some single user computer. I’m looking for some centralized way of developing software for all this pi computers. Of…

Details

Enable IPV6FORWARDING on KVM host on CentOS 7

I have here a KVM host on which is running CentOS 7. If my /etc/sysconfig/network looks like HOSTNAME=myname NETWORKING_IPV6=yes NETWORKING=yes IPv6 was enabled and I get a global IPv6 address: # ifconfig br0-enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 … inet6 2a02:aaa:bbbb:cccc:82ee:73ff:fe9d:5909 prefixlen 64 scopeid 0x0<global> inet6 fe80::82ee:73ff:fe9d:5909 prefixlen 64 scopeid 0x20<link> … But if I enable IPV6FORWARDING…

Details