Golang function to fill a specific default value into an Array
Simple code to achieve that
func filldefault(YourArray []int ) {
for i := range YourArray { YourArray[i] = -1 }
}
Golang function of max and min
Simple code to achieve that
func max(x, y int) {
if x > y {
return x
} else {
return y
}
}
func min(x, y int) {
if x > y {
return y
} else {
return x
}
}
Golang function of contain or find an element in an array
Simple code to achieve that
func contain(t []int, x int) bool {
for _, n := range t {
if n == x {
return true
}
}
return false
}
Monday, April 01, 2019
Dockerfile for Httpd on Oracle Linux 7
Please check details on Github OracleLinux Httpd Dockerfile Repo
Dockerfile for Postgresql9.5 on Oracle Linux 7
Please check details on Github OracleLinux Postgresql 9.5 Dockerfile
Docker: Failed to get D-Bus connection: Operation not permitted
Symptom:
When we build Postgresql 9.5 docker image on Oracle Linux 7-slim ( FROM oraclelinux:7-slim)it error out
Docker: Failed to get D-Bus connection: Operation not permitted
Solution:
It is due to Oracle Linux 7-slim is very slim. It takes systemd function out of the image. D-bus need systemd to function. In order to fix it ,we need to use a bit heavy linux image which includes systemd. To use Oracle Linux 7 would fix it (FROM oraclelinux:7)The full Dockerfile details of Postgresql 9.5 is on github link
Thursday, March 28, 2019
Go Implementation For meta-strings
This note is to add Go implementation of below problem
https://practice.geeksforgeeks.org/problems/meta-strings/0
Golang playground url : https://play.golang.org/p/jacrGzz8JjJ
Github code url
https://practice.geeksforgeeks.org/problems/meta-strings/0
Golang playground url : https://play.golang.org/p/jacrGzz8JjJ
Github code url
Subscribe to:
Comments (Atom)