Tutorials
Golang : How to get URL port?
From the previous tutorial on how to break down a URL string, a reader emailed me wanting to….... read more
Golang : How to generate QR codes?
In this short tutorial, we will learn how to generate QR codes with the https://godoc.org/code.google.com/p/rsc/qr package. QR codes….... read more
Golang : Generate QR codes for Google Authenticator App and fix "Cannot interpret QR code" error
This is a supplement tutorial for the previous tutorial on how to generate QR codes with Golang and….... read more
Golang : Convert []byte to image
There are times when you need to convert []byte to image for saving into file purpose. I encountered one of….... read more
Golang : Return multiple values from function
One of the features that I like about Golang is the ability to return multiple values from a function (Python….... read more
Golang : Check if IP address is version 4 or 6
Problem :
Your Golang program needs to determine if a given IP address is version 4 or 6.
Solution….... read more
Golang : Validate hostname
Problem :
You need to validate if a given string is a valid hostname or not. Hostnames such as :
….... read moreGolang : Validate IP address
Problem :
You need to validate if a given IP address string is a valid IP address.
Solution :
Use….... read more
Golang : Split strings into command line arguments
Problem :
You have a string and you want to split the string into command line arguments in Golang.
Solution….... read more
Golang : How to shuffle elements in array or slice?
Problem :
You have an array or slice with elements in natural order and you want to shuffle the elements.
….... read moreGolang : Null and nil value
Programmers coming from different programming languages to Golang might wonder how does one deal with NULL values. I put down….... read more
Golang : Get constant name from value
Problem :
How to find out the constant name associated with a value? For example, if the a constant value….... read more
Golang : Detect variable or constant type
Problem :
You have a variable or constant and you want to know which type the variable belongs to.
Solution….... read more
Golang : Strings comparison
Given that mostly backend services deal with text data. There bound to be times when there is a need to….... read more
Golang : Convert(cast) string to int64
Problem :
You want to convert(cast) a string to big integer value(int64) for display.
Solution :
Use strconv.ParseInt() function to….... read more
Golang : How to check if a string contains another sub-string?
Problem :
How to check if a string contains another sub-string in Golang?
Solution :
Use the strings.Contains()
function.
CodeIgniter : How to check if a session exist in PHP?
Problem :
How to check if a CodeIgniter or PHP session exist or not?
Solution :
From the official PHP….... read more
CodeIgniter : "Fatal error: Cannot use object of type stdClass as array" message
There are times when the error message returned by the interpreter or compiler just don't make sense. Today I encountered….... read more