Tutorials
Swift : Convert (cast) String to Integer
Problem :
How to convert (cast) String to Integer value in Swift programming language ?
Solution :
Just cast the….... read more
Golang : How to verify uploaded file is image or allowed file types
Problem :
How do I verify if an uploaded file to my server is ... let say I only allow….... read more
Golang : Crop image
This is a continuation from the previous tutorial on how to resize image in Golang. For this tutorial,….... read more
Golang : Resize Image
Somehow...just feel like writing a tutorial on how to resize image with Golang today while writing out references for Golang's….... read more
Golang : Get number of CPU cores
Problem :
You want to find the maximum number of CPU cores to maximize performance.
Solution :
Use the .... read more
Golang : Save image to PNG, JPEG or GIF format.
This tutorial will demonstrate how to save images into files. We will learn how to generate some random images and….... read more
Golang : How to read JPG(JPEG), GIF and PNG files ?
Was having a hard time trying to figure out why all my attempts to open and read JPG or JPEG….... read more
Golang : Fix cannot download, $GOPATH not set error
For anyone exploring Golang and trying to get new packages from ... let say Github. One of the most common….... read more
Linux : sudo yum updates not working
Try to do a sudo yum updates
command this morning on one of my DigitalOcean droplets today and encounter weird….... read more
Golang : convert(cast) bytes to string
Encounter a problem when helping out a co-worker today to read in data generated by another program. To make it….... read more
Golang : automatically figure out array length(size) with three dots
In Go, you can specify a length(size) of an array either explicitly or implicitly(i.e let the compiler figure out) with….... read more
Unix/Linux/MacOSx : How to remove an environment variable ?
Somehow I screwed up my GOPATH and GOROOT environment variables today and removing (sudo yum remove ) Go did not….... read more
Golang : How to get struct field and value by name
In Go, there are times when we need to find out the value of a field in a given structure….... read more
Golang : Convert CSV data to JSON format and save to file
Need to load a CSV data file and save it to JSON encoded file or stream it out ... like….... read more
Convert JSON to CSV in Golang
Need to load a data file with JSON encoded data and save it to CSV file ? This tutorial will….... read more
Golang : Setting variable value with ldflags
This short tutorial will demonstrate how to initialize a variable value during runtime at the stage of compilation/linking. Go linker….... read more
Golang : convert(cast) string to integer value
To convert or cast a string to integer value, just use the strconv.Atoi()
function. Below is the code example to….... read more
Golang : Check to see if *File is a file or directory
Sometimes, we need to write codes that is robust and flexible enough to handle different situation. For example, if a….... read more