In Python, there are 3 ways to check what version of the Interpreter is interpreting my script.
Using sys.version String
A string containing the version number of the Python interpreter plus additional information on the build number and compiler us...
In Golang, there are 2 ways to set timeout for http.Get requests
Using http.Client.Timeout Field
Timeout specifies a time limit for requests made by this Client. The timeout includes connection time, any redirects, and reading the response body.
S...
In Golang, there are 3 ways to read a whole file into a string variable.
Using ioutil.ReadFile Function
ReadFile reads the file named by filename and returns the contents. A successful call returns err == nil, not err == EOF. Because ReadFile reads...
In Golang, there are 3 ways to remove packages installed with go get.
Using go mod tidy
go mod tidy ensures that the go.mod file matches the source code in the module. It adds any missing module requirements necessary to build the current module’s p...
In Golang, there are 2 ways to install Go in Linux.Download Packages
Download packages for Windows 64-bit, macOS, Linux, and more.
Go install
Linux
Remove any previous Go installation by deleting the /usr/local/go folder (if it exists), then extr...
In Rust, there are 3 ways to convert string to json.
Using Serde JSON
Serde is a framework for serializing and deserializing Rust data structures efficiently and generically.
Adding dependencies
In Cargo.toml file we’ll add this information.
[de...
In Rust, "Hello World!" is the first basic program.
Build and Run
In our main.rs, add the following code:
// main.rs
fn main() {
println!("Hello,世界,こんにちは,안녕하세요")
}
Hello,世界,こんにちは,안녕하세요
we can run our application by typing:
B...
In Rust, there are two ways to install rust in Linux.Running the following in your terminal
If you’re running macOS, Linux, or another Unix-like OS. To download Rustup and install Rust, run the following in your terminal, then follow the on-screen i...
Python Examples of zlib.crc32Cyclic redundancy check
A cyclic redundancy check (CRC) is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to digital data.
Using zlib.crc32 Function
Computes a C...
Fetch Internet Resources Using The urllib Package.Fetching URLs
The simplest way to use urllib.request is as follows:
#!/usr/bin/env python3
# Import datetime module
import urllib.request
with urllib.request.urlopen('https://google.com') as respon...
Reading from a url resource in Go.Fetching a URL
Go provides a collection of packages, grouped under net, that make it easy to send and receive information through the Internet. Package http provides HTTP client and server implementations.
packag...
Hello, World! is the first basic program in any programming language.source code
package main
import "fmt"
func main() {
fmt.Println("Hello,世界,こんにちは,안녕하세요")
}
To run the program
Go is a compiled language. The Go toolchain converts a source pro...
user interface to the TELNET protocol.
Telnet is an application protocol used on the Internet or local area network to provide a bidirectional interactive text-oriented communication facility using a virtual terminal connection. User data is interspe...
command line tool and library for transferring data with URLs.
cURL (pronounced 'curl') is a computer software project providing a library (libcurl) and command-line tool (curl) for transferring data using various network protocols. The name ...
Go mod provides access to operations on modules.
Initialize new module in current directory. If you plan to publish your module for others to use, the module path must be a location from which Go tools can download your module.
go mod init ...