2016 Update

This commit is contained in:
Tina Müller 2016-12-05 22:15:40 +01:00
parent 948b86eafa
commit dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions

View file

@ -0,0 +1,33 @@
package main
import (
"math"
"os"
"strconv"
"text/template"
)
func sqr(x string) string {
f, err := strconv.ParseFloat(x, 64)
if err != nil {
return "NA"
}
return strconv.FormatFloat(f*f, 'f', -1, 64)
}
func sqrt(x string) string {
f, err := strconv.ParseFloat(x, 64)
if err != nil {
return "NA"
}
return strconv.FormatFloat(math.Sqrt(f), 'f', -1, 64)
}
func main() {
f := template.FuncMap{"sqr": sqr, "sqrt": sqrt}
t := template.Must(template.New("").Funcs(f).Parse(`. = {{.}}
square: {{sqr .}}
square root: {{sqrt .}}
`))
t.Execute(os.Stdout, "3")
}

View file

@ -0,0 +1,2 @@
65..67 | ForEach-Object {$_ * 2} # Multiply the numbers by 2
65..67 | ForEach-Object {[char]$_ } # ASCII values of the numbers

View file

@ -0,0 +1 @@
65..67 | Where-Object {$_ % 2}

View file

@ -0,0 +1 @@
65..70 | Format-Wide {$_} -Column 3 -Force