Skip to content

Instantly share code, notes, and snippets.

@dniHze
dniHze / test.kt
Created Jan 23, 2018
How to pack circles in rectange in Kotlin.
View test.kt
import java.util.*
import kotlin.math.*
data class Point(var x: Double, var y: Double) {
fun vect(p: Point) = Point(p.x - x, p.y - y)
fun norm() = sqrt(x.pow(2) + y.pow(2))
fun dist(p: Point) = vect(p).norm()
fun add(p: Point) = Point(x + p.x, y + p.y)
fun mult(a: Double) = Point(x * a, y * a)
}
@dniHze
dniHze / gist:a64aa5fd1212cc864294
Last active Aug 29, 2015
KPI Live Notificator
View gist:a64aa5fd1212cc864294
import vk_api
import time
from subprocess import call
def main():
# your vk login and password
login, password = 'yourlogin@vk.com', 'password'
# sometext
sometext = "text"
# path to KPI Live logo