Exercise: Fibonacci closure package main import “fmt” var prev, curr int // fibonacci is a function that returns // a function that returns an int. func fibonacci() func() int { inc := 1 return func() int { prev = curr curr = inc inc = prev+curr return prev } } func main() { f :=… Continue reading Go Exercises: Fibonacci
Category: Issues and resolutions
Go exercises: Maps
Exercise: Maps package main import ( “golang.org/x/tour/wc” “strings” ) func WordCount(s string) map[string]int { stringAr := strings.Fields(s) result := make(map[string]int) for i:=range stringAr { v :=result[stringAr[i]] result[stringAr[i]] = v+1 } return result } func main() { wc.Test(WordCount) }
Go exercises: Slices
GoLang tutorial has a task – Create slices for picture package main import ( “golang.org/x/tour/pic” ) func Pic(dx, dy int) [][]uint8 { result := make([][]uint8,dy) for i:=range result { innerS := make([]uint8, dx) for j := range innerS { switch { case i*j % 15 == 0: innerS[j] = 240 case i/j % 3 ==… Continue reading Go exercises: Slices
Developing bots for Facebook Messenger Platform with Glasfish server
There is so much informational noise about new Facebook feature – Messenger Platform, that I could not resist to try it out for our project “Is it kosher?“.
Google Vision Image recognition for Android
Recently Google announced new API for image recognition. It is one the most exiting solutions from Google and prices are quite affordable. So, I decided to switch from CamFind API to Google’s, because the last one is much more efficient and faster. Camfind worked quite well, but it took time for upload of image and… Continue reading Google Vision Image recognition for Android