Skip to content

Instantly share code, notes, and snippets.

View oktalz's full-sized avatar

Zlatko Bratkovic oktalz

  • HAProxy Technologies
  • Zagreb, Croatia
View GitHub Profile
@oktalz
oktalz / go-draft-ok.md
Last active October 23, 2018 20:51
Comment for new go error handling feature

Comment on Go2ErrorHandlingFeedback

I like draft design

handle err {
    return fmt.Errorf("copy %s %s: %v", src, dst, err)
}

r := check some_func()
@oktalz
oktalz / GAMain.java
Last active October 23, 2018 21:22
My graduate college shutdown method when Genetic algorithm program for finding student schedules was shutting down
...
public static class RunWhenShuttingDown extends Thread {
public void run() {
if (perfect.test()) {
co.println("Shutting down...\n\n\n");
co.println("solution is here,\n");
co.println("The end is near,");
co.println("there is no fear,");
try {
@oktalz
oktalz / main.go
Created December 3, 2018 11:38
Go example, go version 1.11, what happens with GC if we have a goroutine that is intensive
package main
import (
"log"
"runtime"
"time"
)
func example1() {
//this example locks all threads