Working with Constants and iota in Go.
The Constant Generator iota
Here’s an example from the time package, which defines named constants of type Weekday for the days of the week, starting with zero for Sunday. Types of this kind are often called en...
In Rust, there are 2 ways to raise a number to a power.
Using pow Method
The pow() function raises a value to the power of exp, using exponentiation by squaring. Note that 0⁰ (pow(0, 0)) returns 1. Mathematically this is undefined.
See the followi...
In Rust, there are 2 ways to convert Vec to a string.
Using collect Function
The collect() function transforms an iterator into a collection. collect() can take anything iterable, and turn it into a relevant collection. This is one of the more powe...
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...
3 ways to convert int64 to string in Golang.Using strconv.Itoa Function
The code snippet below shows how to convert an int to a string using the Itoa function.
package main
import (
"fmt"
"strconv"
)
func main() {
s := strconv.Itoa(100)
f...
Python’s Core Data Types.Core Data Types
The principal built-in types are numerics, sequences, mappings, classes, instances and exceptions.
Built-in objects preview:
Object type:
Numbersint, float, complex.Strings'spam', "Bob's", b'a\x01c', u'sp\xc4m...
Convert File Size to a human friendly format.Get file size in human-readable units like kilobytes (KB), Megabytes (MB) or GigaBytes (GB)
SI (Decimal 1 k = 1,000)
A metric prefix is a unit prefix that precedes a basic unit of measure to indicate a mul...
Format a string without printing in Go.Basics
Package fmt implements formatted I/O with functions analogous to C's printf and scanf. The format 'verbs' are derived from C's but are simpler.
fmt.Sprintf
Sprintf formats according to a format specif...
Display amount of free and used memory in the system.
free displays the total amount of free and used physical and swap memory in the system, as well as the buffers and caches used by the kernel. The information is gathered by parsing /proc/meminfo....
Show information about the file system on which each FILE resides, or all file systems by default.
df (abbreviation for disk free) is a standard Unix command used to display the amount of available disk space for file systems on which the invoking us...
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 ...
List Files and Directories.The ls command lists files and directories within the file system, and shows detailed information about them. It is a part of the GNU core utilities package which is installed on all Linux distributions.
List all files, in...
Babylon.js is a real time 3D engine using a JavaScript library for displaying 3D graphics in a web browser via HTML5. The source code is available on GitHub and distributed under the Apache License 2.0.--pname-- is a powerful, beautiful, simple, and ...
lit-html is a simple, modern, safe, small and fast HTML templating library for JavaScript.--pname-- lets you write HTML templates in JavaScript, then efficiently render and re-render those templates together with data to create and update DOM.
--pna...
Powerful rich text editor framework with a modular architecture, modern integrations and features like collaborative editing.--pname-- is a WYSIWYG rich text editor which enables writing content directly inside of web pages or online applications. It...