sudo apt-get install zsh
Follow the instructions: https://ohmyz.sh/
| public class InstanceAroundResource implements AutoCloseable{ | |
| //(1)We will delegeta cleaning to Cleaner from Java 9 | |
| private static final Cleaner cleaner=Cleaner.create(); | |
| //(2)This is definition of internal state, static -> so it has no ref to external instance | |
| //private - to better hide information | |
| private static class EncapsulatedResource implements Runnable{ | |
| (...) | |
| } |
sudo apt-get install zsh
Follow the instructions: https://ohmyz.sh/
| # Remove all running docker container | |
| docker rm -f $(docker ps -a -q) | |
| # Create the cluster | |
| docker run -d -e "CASSANDRA_TOKEN=1" --name cassandra-1 spotify/cassandra:cluster | |
| docker run -d -e "CASSANDRA_TOKEN=10" -e "CASSANDRA_SEEDS=$(docker inspect --format='{{ .NetworkSettings.IPAddress}}' cassandra-1)" --name cassandra-2 spotify/cassandra:cluster | |
| docker run -d -e "CASSANDRA_TOKEN=100" -e "CASSANDRA_SEEDS=$(docker inspect --format='{{ .NetworkSettings.IPAddress}}' cassandra-1)" --name cassandra-3 spotify/cassandra:cluster | |
| docker run -d -e "CASSANDRA_TOKEN=1000" -e "CASSANDRA_SEEDS=$(docker inspect --format='{{ .NetworkSettings.IPAddress}}' cassandra-1)" --name cassandra-4 spotify/cassandra:cluster | |
| docker run -d -e "CASSANDRA_TOKEN=10000" -e "CASSANDRA_SEEDS=$(docker inspect --format='{{ .NetworkSettings.IPAddress}}' cassandra-1)" --name cassandra-5 spotify/cassandra:cluster |
| package scalaInAction.chapter8ScalableExtensibleComponents | |
| import org.scalatest.{FlatSpec, Matchers} | |
| class FoodReadyToBeEaten | |
| sealed trait Pizza | |
| object Pizza { | |
| sealed trait EmptyPizza extends Pizza | |
| sealed trait Cheese extends Pizza |
| package scalaInAction.chapter8ScalableExtensibleComponents | |
| import org.scalatest.{FlatSpec, Matchers} | |
| trait HasAtLeastOneElement[F[_]] { | |
| def any[A](xs: F[A]): Boolean | |
| } | |
| /** | |
| * Higher-kinded types are types that know how to create a new type from the type argument. That's why |
| package scalaInAction.chapter8ScalableExtensibleComponents | |
| import org.scalatest.{FlatSpec, Matchers} | |
| /** | |
| * Declare the .NET keyword as a singleton. | |
| */ | |
| object using { | |
| /** | |
| * Type alias. |
| package scalaInAction.chapter8ScalableExtensibleComponents | |
| import org.scalatest.{FlatSpec, Matchers} | |
| class Food | |
| class Grass extends Food | |
| abstract class Animal { | |
| type SuitableFood <: Food // Upper bound (<:) |
Here is the looks and feel of your terminal once the tutorial has been applied on your system:
Using Homebrew:
| package ch.heigvd.infogr.maths.collision; | |
| import ch.heigvd.infogr.maths.Vector3; | |
| import ch.heigvd.infogr.maths.collision.algorithms.AaBbBoxedCollisionAlgorithm; | |
| import ch.heigvd.infogr.maths.collision.algorithms.ICollisionAlgorithm; | |
| import ch.heigvd.infogr.maths.collision.representation.IBoxedCollidable; | |
| import ch.heigvd.infogr.maths.collision.representation.ICollidable; | |
| import com.jogamp.opengl.GL2; | |
| import javafx.util.Pair; |