trackler 2.0.6.14 → 2.0.6.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/tracks/ceylon/.travis.yml +1 -0
  4. data/tracks/ceylon/bin/compile-all-stubs +16 -0
  5. data/tracks/ceylon/config.json +11 -0
  6. data/tracks/ceylon/exercises/react/example/Reactor.ceylon +96 -0
  7. data/tracks/ceylon/exercises/react/example/module.ceylon +4 -0
  8. data/tracks/ceylon/exercises/react/source/react/Reactor.ceylon +29 -0
  9. data/tracks/ceylon/exercises/react/source/react/ReactorTest.ceylon +195 -0
  10. data/tracks/ceylon/exercises/react/source/react/module.ceylon +3 -0
  11. data/tracks/csharp/config.json +9 -0
  12. data/tracks/csharp/exercises/pov/Example.cs +17 -17
  13. data/tracks/csharp/exercises/zipper/Example.cs +137 -0
  14. data/tracks/csharp/exercises/zipper/ZipperTest.cs +83 -0
  15. data/tracks/go/config.json +9 -0
  16. data/tracks/go/exercises/transpose/cases_test.go +247 -0
  17. data/tracks/go/exercises/transpose/example.go +25 -0
  18. data/tracks/go/exercises/transpose/example_gen.go +54 -0
  19. data/tracks/go/exercises/transpose/transpose_test.go +39 -0
  20. data/tracks/go/exercises/triangle/triangle.go +1 -1
  21. data/tracks/haskell/.travis.yml +2 -2
  22. data/tracks/haskell/common/stack.yaml +1 -1
  23. data/tracks/haskell/exercises/accumulate/stack.yaml +1 -1
  24. data/tracks/haskell/exercises/all-your-base/stack.yaml +1 -1
  25. data/tracks/haskell/exercises/allergies/stack.yaml +1 -1
  26. data/tracks/haskell/exercises/alphametics/stack.yaml +1 -1
  27. data/tracks/haskell/exercises/anagram/stack.yaml +1 -1
  28. data/tracks/haskell/exercises/atbash-cipher/stack.yaml +1 -1
  29. data/tracks/haskell/exercises/bank-account/stack.yaml +1 -1
  30. data/tracks/haskell/exercises/beer-song/stack.yaml +1 -1
  31. data/tracks/haskell/exercises/binary-search-tree/stack.yaml +1 -1
  32. data/tracks/haskell/exercises/binary/stack.yaml +1 -1
  33. data/tracks/haskell/exercises/bob/stack.yaml +1 -1
  34. data/tracks/haskell/exercises/bowling/stack.yaml +1 -1
  35. data/tracks/haskell/exercises/change/stack.yaml +1 -1
  36. data/tracks/haskell/exercises/clock/stack.yaml +1 -1
  37. data/tracks/haskell/exercises/connect/stack.yaml +1 -1
  38. data/tracks/haskell/exercises/crypto-square/stack.yaml +1 -1
  39. data/tracks/haskell/exercises/custom-set/stack.yaml +1 -1
  40. data/tracks/haskell/exercises/difference-of-squares/stack.yaml +1 -1
  41. data/tracks/haskell/exercises/dominoes/stack.yaml +1 -1
  42. data/tracks/haskell/exercises/etl/stack.yaml +1 -1
  43. data/tracks/haskell/exercises/food-chain/stack.yaml +1 -1
  44. data/tracks/haskell/exercises/forth/stack.yaml +1 -1
  45. data/tracks/haskell/exercises/gigasecond/stack.yaml +1 -1
  46. data/tracks/haskell/exercises/go-counting/stack.yaml +1 -1
  47. data/tracks/haskell/exercises/grade-school/stack.yaml +1 -1
  48. data/tracks/haskell/exercises/grains/stack.yaml +1 -1
  49. data/tracks/haskell/exercises/hamming/stack.yaml +1 -1
  50. data/tracks/haskell/exercises/hexadecimal/stack.yaml +1 -1
  51. data/tracks/haskell/exercises/house/stack.yaml +1 -1
  52. data/tracks/haskell/exercises/kindergarten-garden/stack.yaml +1 -1
  53. data/tracks/haskell/exercises/largest-series-product/stack.yaml +1 -1
  54. data/tracks/haskell/exercises/leap/stack.yaml +1 -1
  55. data/tracks/haskell/exercises/lens-person/stack.yaml +1 -1
  56. data/tracks/haskell/exercises/linked-list/stack.yaml +1 -1
  57. data/tracks/haskell/exercises/list-ops/stack.yaml +1 -1
  58. data/tracks/haskell/exercises/luhn/stack.yaml +1 -1
  59. data/tracks/haskell/exercises/matrix/stack.yaml +1 -1
  60. data/tracks/haskell/exercises/meetup/stack.yaml +1 -1
  61. data/tracks/haskell/exercises/minesweeper/stack.yaml +1 -1
  62. data/tracks/haskell/exercises/nth-prime/stack.yaml +1 -1
  63. data/tracks/haskell/exercises/nucleotide-count/stack.yaml +1 -1
  64. data/tracks/haskell/exercises/ocr-numbers/stack.yaml +1 -1
  65. data/tracks/haskell/exercises/octal/stack.yaml +1 -1
  66. data/tracks/haskell/exercises/palindrome-products/stack.yaml +1 -1
  67. data/tracks/haskell/exercises/parallel-letter-frequency/stack.yaml +1 -1
  68. data/tracks/haskell/exercises/pascals-triangle/stack.yaml +1 -1
  69. data/tracks/haskell/exercises/phone-number/stack.yaml +1 -1
  70. data/tracks/haskell/exercises/pig-latin/stack.yaml +1 -1
  71. data/tracks/haskell/exercises/pov/stack.yaml +1 -1
  72. data/tracks/haskell/exercises/prime-factors/stack.yaml +1 -1
  73. data/tracks/haskell/exercises/pythagorean-triplet/stack.yaml +1 -1
  74. data/tracks/haskell/exercises/queen-attack/stack.yaml +1 -1
  75. data/tracks/haskell/exercises/raindrops/stack.yaml +1 -1
  76. data/tracks/haskell/exercises/rna-transcription/stack.yaml +1 -1
  77. data/tracks/haskell/exercises/robot-name/stack.yaml +1 -1
  78. data/tracks/haskell/exercises/robot-simulator/stack.yaml +1 -1
  79. data/tracks/haskell/exercises/roman-numerals/stack.yaml +1 -1
  80. data/tracks/haskell/exercises/run-length-encoding/stack.yaml +1 -1
  81. data/tracks/haskell/exercises/saddle-points/stack.yaml +1 -1
  82. data/tracks/haskell/exercises/say/stack.yaml +1 -1
  83. data/tracks/haskell/exercises/scrabble-score/stack.yaml +1 -1
  84. data/tracks/haskell/exercises/secret-handshake/stack.yaml +1 -1
  85. data/tracks/haskell/exercises/series/stack.yaml +1 -1
  86. data/tracks/haskell/exercises/sgf-parsing/stack.yaml +1 -1
  87. data/tracks/haskell/exercises/sieve/stack.yaml +1 -1
  88. data/tracks/haskell/exercises/simple-cipher/stack.yaml +1 -1
  89. data/tracks/haskell/exercises/simple-linked-list/stack.yaml +1 -1
  90. data/tracks/haskell/exercises/space-age/stack.yaml +1 -1
  91. data/tracks/haskell/exercises/strain/stack.yaml +1 -1
  92. data/tracks/haskell/exercises/sublist/stack.yaml +1 -1
  93. data/tracks/haskell/exercises/sum-of-multiples/stack.yaml +1 -1
  94. data/tracks/haskell/exercises/triangle/stack.yaml +1 -1
  95. data/tracks/haskell/exercises/trinary/stack.yaml +1 -1
  96. data/tracks/haskell/exercises/word-count/stack.yaml +1 -1
  97. data/tracks/haskell/exercises/wordy/stack.yaml +1 -1
  98. data/tracks/haskell/exercises/zebra-puzzle/stack.yaml +1 -1
  99. data/tracks/haskell/exercises/zipper/stack.yaml +1 -1
  100. data/tracks/lua/exercises/list-ops/list-ops_spec.lua +1 -1
  101. data/tracks/objective-c/config.json +9 -0
  102. data/tracks/objective-c/exercises/beer-song/BeerSongExample.h +7 -0
  103. data/tracks/objective-c/exercises/beer-song/BeerSongExample.m +56 -0
  104. data/tracks/objective-c/exercises/beer-song/BeerSongTest.m +51 -0
  105. data/tracks/objective-c/xcodeProject/ObjectiveC.xcodeproj/project.pbxproj +23 -1
  106. data/tracks/objective-c/xcodeProject/ObjectiveC.xcodeproj/xcshareddata/xcschemes/OCLint.xcscheme +1 -1
  107. data/tracks/objective-c/xcodeProject/ObjectiveC.xcodeproj/xcshareddata/xcschemes/xobjectivecTest.xcscheme +1 -1
  108. data/tracks/perl6/config.json +5 -0
  109. data/tracks/perl6/exercises/grade-school/Example.pm +17 -0
  110. data/tracks/perl6/exercises/grade-school/grade-school.t +32 -0
  111. data/tracks/scala/config.json +6 -0
  112. data/tracks/scala/exercises/rna-transcription/build.sbt +2 -2
  113. data/tracks/scala/exercises/sublist/build.sbt +2 -2
  114. data/tracks/scala/exercises/sublist/src/test/scala/SublistTest.scala +1 -1
  115. metadata +19 -2
@@ -0,0 +1,25 @@
1
+ package transpose
2
+
3
+ func Transpose(m []string) []string {
4
+ max := maxLen(m)
5
+ t := make([]string, max)
6
+ for i, row := range m {
7
+ for j, c := range row {
8
+ t[j] += string(c)
9
+ }
10
+ remMax := maxLen(m[i:])
11
+ for j := len(row); j < remMax; j++ {
12
+ t[j] += " "
13
+ }
14
+ }
15
+ return t
16
+ }
17
+
18
+ func maxLen(m []string) (length int) {
19
+ for _, l := range m {
20
+ if len(l) > length {
21
+ length = len(l)
22
+ }
23
+ }
24
+ return
25
+ }
@@ -0,0 +1,54 @@
1
+ // +build ignore
2
+
3
+ package main
4
+
5
+ import (
6
+ "log"
7
+ "text/template"
8
+
9
+ "../../gen"
10
+ )
11
+
12
+ func main() {
13
+ t, err := template.New("").Parse(tmpl)
14
+ if err != nil {
15
+ log.Fatal(err)
16
+ }
17
+ var j js
18
+ if err := gen.Gen("transpose", &j, t); err != nil {
19
+ log.Fatal(err)
20
+ }
21
+ }
22
+
23
+ // The JSON structure we expect to be able to unmarshal into
24
+ type js struct {
25
+ Cases []struct {
26
+ Description string
27
+ Input []string
28
+ Expected []string
29
+ }
30
+ }
31
+
32
+ // template applied to above data structure generates the Go test cases
33
+ var tmpl = `package transpose
34
+
35
+ // Source: {{.Ori}}
36
+ {{if .Commit}}// Commit: {{.Commit}}
37
+ {{end}}
38
+
39
+ var testCases = []struct {
40
+ description string
41
+ input []string
42
+ expected []string
43
+ }{
44
+ {{range .J.Cases}}{
45
+ {{printf "%q" .Description}},
46
+ []string{
47
+ {{range .Input}} {{printf "%q" .}},
48
+ {{end}}},
49
+ []string{
50
+ {{range .Expected}} {{printf "%q" .}},
51
+ {{end}}},
52
+ },
53
+ {{end}}}
54
+ `
@@ -0,0 +1,39 @@
1
+ package transpose
2
+
3
+ import (
4
+ "reflect"
5
+ "testing"
6
+ )
7
+
8
+ func TestTranspose(t *testing.T) {
9
+ for _, test := range testCases {
10
+ actual := Transpose(test.input)
11
+ if !reflect.DeepEqual(actual, test.expected) {
12
+ // let's make the error more specific and find the row it's on
13
+ min := min(len(test.expected), len(actual))
14
+ for i := 0; i < min; i++ {
15
+ if test.expected[i] != actual[i] {
16
+ t.Fatalf("\n\tTranspose(%q): %s\n\n\tExpected: %q\n\tGot: %q\n\n\tRow %d Expected: %q Got: %q",
17
+ test.input, test.description, test.expected, actual, i, test.expected[i], actual[i])
18
+ }
19
+ }
20
+ }
21
+ }
22
+ }
23
+
24
+ // helper function
25
+ // https://stackoverflow.com/questions/27516387/what-is-the-correct-way-to-find-the-min-between-two-integers-in-go
26
+ func min(a, b int) int {
27
+ if a < b {
28
+ return a
29
+ }
30
+ return b
31
+ }
32
+
33
+ func BenchmarkTranspose(b *testing.B) {
34
+ for _, test := range testCases {
35
+ for i := 0; i < b.N; i++ {
36
+ Transpose(test.input)
37
+ }
38
+ }
39
+ }
@@ -1,6 +1,6 @@
1
1
  package triangle
2
2
 
3
- const testVersion = 2
3
+ const testVersion = 3
4
4
 
5
5
  // Code this function.
6
6
  func KindFromSides(a, b, c float64) Kind
@@ -11,8 +11,8 @@ cache:
11
11
  - $HOME/.foldercache # Per exercise `.stack-work` cache.
12
12
 
13
13
  env:
14
- - RESOLVER="lts-7.9" CURRENT="YES" # Equal to each stack.yaml.
15
- - RESOLVER="nightly" # Latest nightly snapshot.
14
+ - RESOLVER="lts-7.16" CURRENT="YES" # Equal to each stack.yaml.
15
+ - RESOLVER="nightly" # Latest nightly snapshot.
16
16
 
17
17
  matrix:
18
18
  allow_failures: # The snapshot `nightly` is just an alias to
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16
@@ -1 +1 @@
1
- resolver: lts-7.9
1
+ resolver: lts-7.16