I hereby claim:
- I am uberto on github.
- I am ramtop (https://keybase.io/ramtop) on keybase.
- I have a public key ASCJlFfUeGLy4B_A_nG22PQVS_HGmwdlFftKuJCycbZAmgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import java.lang.Math.round as jround | |
import kotlin.math.round | |
fun main() { | |
val r = round(4.5) + round(9.5) | |
println("kotlin round 4.5+9.5 $r") | |
val r2 = round(5.5) + round(9.5) |
import java.lang.Math.round as jround | |
import kotlin.math.round | |
fun main() { | |
val r = round(4.5) + round(9.5) | |
println("kotlin round 4.5+9.5 $r") | |
val r2 = round(5.5) + round(9.5) |
package com.gamasoft.delegation | |
import assertk.assert | |
import assertk.assertions.isEqualTo | |
import org.junit.Test | |
//https://kotlinlang.org/docs/reference/delegation.html | |
interface Printer { | |
fun print(msg: String) |
package com.gamasoft.memoryReferences; | |
import java.util.Observable; | |
public class Factory { | |
public Runnable createRunnable() { | |
return new Runnable() { | |
@Override |
def place_stone(self, player, point): | |
assert self.is_on_grid(point) | |
assert self._grid.get(point) is None | |
adjacent_same_color = [] | |
adjacent_opposite_color = [] | |
liberties = [] | |
# First, we examine direct neighbors of this point. | |
for neighbor in point.neighbors(): | |
if not self.is_on_grid(neighbor): |
fun placeStone(player: Player, point: Point) { | |
assert(isOnTheGrid(point)) | |
assert(isFree(point)) | |
//0. Examine the adjacent points. | |
val adjacentSameColor = mutableSetOf<GoString>() | |
val adjacentOppositeColor = mutableSetOf<GoString>() | |
val liberties = mutableSetOf<Point>() | |
for (neighbor in point.neighbors()) { |
Python | |
def remove_string(self, string): | |
for point in string.stones: | |
# Removing a string can create liberties for other strings. | |
for neighbor in self.neighbor_table[point]: | |
neighbor_string = self._grid.get(neighbor) | |
if neighbor_string is None: | |
continue | |
if neighbor_string is not string: |
public static void main(String[] args){ | |
ServerConfig config = ConfigFactory.create(ServerConfig.class); | |
List<Calculation> routes = Calculations.getAllCalculations(config.users()); | |
WebServer.start(config.port(), routes); | |
} |
import org.aeonbits.owner.Config; | |
import org.aeonbits.owner.Config.Sources; | |
import java.util.List; | |
/** | |
* Keeps the configuration values for the server | |
*/ | |
@Sources({ "file:config.properties" }) | |
public interface ServerConfig extends Config { |