Author Archives: admin

go: printing struct & array

Printing struct https://play.golang.org/p/BvMIqF3Pmc9 package main import “fmt” type point struct { x, y int } func main() { p := point{1, 2} fmt.Println(“Printing struct point:”) fmt.Printf(” type %%T: %T\n”, p) fmt.Printf(” just values %%v: %v\n”, p) fmt.Printf(” +field names %%+v: … Continue reading

Posted in golang, workday | Leave a comment

go: add elements to array

Here is one way, how to add elements to array in go language, see https://play.golang.org/p/nCLX23ymRUM package main import ( “fmt” ) type MyRecord struct { Name string Phone string } var recA = MyRecord{Name: “Anna”, Phone: “123”} var recB = … Continue reading

Posted in golang, workday | Leave a comment

GIMP: first script-fu

GIMP is great tool for images manipulation. Even better is to automate as much as possible through scripts. Lets say we would create file named my-first.scm and this file will be placed into sub-directory scripts. Location would depend on the … Continue reading

Posted in workday | Leave a comment

base64

Base64 encoding is widely used and there are nice online tools, for example https://www.base64decode.org/. On command line could be convenient choice to use openssl with argument base64 to encode or two arguments base64 -d to decode. Tool reads from stdin, … Continue reading

Posted in workday | Leave a comment

go: interface example

Go is fresh fast relatively new language. One of the key to utilize it’s power are interfaces. Here is example of the geometry interfaces. See https://play.golang.org/p/nQ_ylb2jXKS package main import ( “fmt” “math” ) //https://www.mathsisfun.com/area.html type geometry interface { area() float64 … Continue reading

Posted in golang, workday | Leave a comment

HTTPS Tomcat

Here are some notes from install and run HTTPS Tomcat on digitalocean inpired by Mavi’s blog. on digitalocean: Ubuntu 18.04 x64 Memory:1GB, vCPU:1, SSD_Disk:25GB, Transfer:1TB, price:$5/mo Hostname:ubuntu18 IP:1.2.3.4 on my DNS provider web: Edit DNS A records for example.com and … Continue reading

Posted in workday | Leave a comment

CSV: How to sort by several columns in Java8

CSV_SortByThreeColumns.java package example.stream; import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; import java.util.Comparator; import java.util.stream.Stream; /** * Let’s say there is a comma delimited file with the first line describing column names: * Name, State, Years of experience * Here is how … Continue reading

Posted in Java8, workday | Leave a comment

CSV: How to skip the first line in Java8

CSV_SkipFirstLine.java package example.stream; import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; import java.util.stream.Stream; /** * Let’s say there is a comma delimited file with the first line describing column names. * In this example a person name and state. * Here is … Continue reading

Posted in Java8, workday | Leave a comment

Handy notepad in Chrome tab or window

There is nice option to create editable tab on window in Chrome browser with URL like this: data:text/html, <html contenteditable> It is possible to save it into the file after pressing CTRL+<S>

Posted in workday | Leave a comment

Sky above from freezing cold nights

Nights are long in the Winter, with many clear nights, but with very cold temperatures as well. It looks like Kakslauttanen Arctic Resort in Finland built good solution how to observe beauty of the sky in Winter.

Posted in family | Leave a comment