This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.io.FileType | |
def path = "" | |
def uuid = "" | |
properties([[$class: "ParametersDefinitionProperty", | |
parameterDefinitions: [ | |
[$class: "StringParameterDefinition", | |
description : "Exercise UUID", | |
name : "UUID"]]]]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func GetANumber() int { | |
rand.Seed(time.Now().UnixNano()) // different seed every time | |
return rand.Intn(100) // generate a random number | |
} | |
func BenchmarkGetANumber(b *testing.B) { | |
for i := 0; i < b.N; i++ { | |
GetANumber() | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gosoup | |
func mySecretLittleFunction() {} | |
func UseMeImExported() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uzilan Oct 2nd at 11:21 PM | |
Hamming 2.3.0 allows both strands to be empty, but if only the left or the right strands are empty then an exception should be thrown with different error messages for each case. This means one should check for many different situation. And this is only the third exercise. Isn’t it a bit of an overkill? | |
12 replies | |
uzilan 1 month ago | |
https://raw.githubusercontent.com/exercism/problem-specifications/master/exercises/hamming/canonical-data.json | |
uzilan 1 month ago | |
Specifically, for Kotlin, that means you can’t use the idiomatic require because the condition (not empty) is only required if only one strand is empty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface TrollNumber { | |
val value: Int | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package zer.ubba.bel; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.regex.Pattern; | |
import static java.lang.ClassLoader.getSystemResource; | |
import static java.util.Arrays.stream; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package zer.ubba.bel | |
import java.io.File | |
import java.lang.ClassLoader.getSystemResource | |
import java.util.Locale | |
private val boringWords = ("the,and,of,to,that,for,in,i,his,a,with,it,be,is,not,they,thou") | |
.split(",") | |
fun readTheBible(): Map<String, Int> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package zer.ubba.bel | |
import scala.io.Source.fromResource | |
class ScalaBible { | |
private val boringWords = ("the,and,of,to,that,for,in,i,his,a,with,it,be,is,not,they,thou") | |
.split(",") | |
def readTheBible(): Map[String, Int] = { | |
val source = fromResource("bible.txt") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package zer.ubba.bel | |
class GroovyBible { | |
private final def boringWords = "the,and,of,to,that,for,in,i,his,a,with,it,be,is,not,they,thou" | |
.split(","); | |
def readTheBible() { | |
def resource = ClassLoader.getSystemResource("bible.txt") | |
return resource |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns zer.ubba.bel.clojure_bible | |
(:require [clojure.java.io :as io]) | |
(:require [clojure.string :as str]) | |
(:gen-class)) | |
(def data-file (io/resource "bible.txt")) | |
(def boringWords | |
(str/split "the,and,of,to,that,for,in,i,his,a,with,it,be,is,not,they,thou" #",")) |
OlderNewer