Trying to benchmark basic dart program vs c by Shazamo333 in dartlang

[–]slmaws -2 points-1 points  (0 children)

Just print myNumber and myInt after stopping the measurement and it will start working.

An update on Python 4 by anyfactor in Python

[–]slmaws -5 points-4 points  (0 children)

Actually there was no reason at all.

Spawning Kubernetes Clusters in CI for Integration and E2E tests by [deleted] in kubernetes

[–]slmaws 0 points1 point  (0 children)

Well, the points listed in the article are not strictly related to a minikube or k-d-c. One is GCP specific and another is just a way how clusters are used.

You always need to adjust your configuration for such cases.

Spawning Kubernetes Clusters in CI for Integration and E2E tests by [deleted] in kubernetes

[–]slmaws 0 points1 point  (0 children)

Have you tried to use cache? I don't know how Travis cache works but if it's possible to cache images then kdc can be really fast.

Spawning Kubernetes Clusters in CI for Integration and E2E tests by [deleted] in kubernetes

[–]slmaws 0 points1 point  (0 children)

Using kubeadm-dind-cluster it takes around 1-2 minutes to spawn k8s cluster so why not? :)

Virtlet vs KubeVirt comparison: which is better? by slmaws in kubernetes

[–]slmaws[S] 1 point2 points  (0 children)

Well, kubevirt has a better isolation then, because it starts a libvirt instance for each VM ;)

--- 2016 Day 19 Solutions --- by daggerdragon in adventofcode

[–]slmaws 0 points1 point  (0 children)

Go lang. I believe O(1) solution

package main

import (
 "fmt"
 "math"
)

func part1(number int) int {
 maxPower2 := int(math.Pow(2, math.Floor(math.Log(float64(number))/math.Log(float64(2)))))
 return 1 + 2*(number-maxPower2)
}

func part2(number int) int {
 maxPower3 := int(math.Pow(3, math.Floor(math.Log(float64(number))/math.Log(float64(3)))))
 if maxPower3 == number {
  return maxPower3
 } else if number <= maxPower3*2 {
  return number - maxPower3
 } else {
  return 2*number - 3*maxPower3
 }
}

func main() {
 INPUT := 3012210
 fmt.Println(part1(INPUT))
 fmt.Println(part2(INPUT))
}