Convert Decimal to Hexadecimal in Golang

Akhil Sharma
Updated on 14-Nov-2022 11:46:41

3K+ Views

In this article you will learn the go language code to convert decimal number to Hexadecimal. Decimal Number Vs Hexadecimal Numbers Decimal numbers are the numbers which have base 10, which means each digit of a number can have an integer value ranging from 0 to 9 (10 possibilities) depending on its position. For example, 23 is a decimal number. Any number contains 16 digits in it, it is based on base 16, which means hexadecimal numbers contains decimal number from 0 to 9 and extra 6 Alphabets. A−F. In go language all the hexadecimal numbers start with 0x or ... Read More

Convert Boolean to String in Go

Akhil Sharma
Updated on 14-Nov-2022 11:36:09

4K+ Views

In this tutorial, we will learn how to convert Boolean to a string in Go programming language. Boolean Vs String Boolean is a data type having 1 byte size. It can store any one of the three values mainly True, False or none. It act like a flag to show whether a condition is correct or not. String data type is used to store a sequence of characters. it can be in the form of literals or alphabets. The size of string variable is 1 byte or 8 bits. Example 1: Convert Boolean type to String USING strconv.FormatBool() Method Syntax ... Read More

Check If a Number is Odd Using Library Function in Go

Akhil Sharma
Updated on 14-Nov-2022 11:26:11

624 Views

In this article we will discuss about how to check if a given number is odd using library function Go language. ODD NUMBERS − In mathematics any number is called odd if it gives “1” as remainder when divided by “2”. For example 1, 3, 5, 7 …. Even Numbers − unlike odd numbers even numbers get completely divided by “2” and do not produce any remainder. For example − 2, 4, 6, 8 … Syntax func Mod(number1, number2 float64) float64 The mod() function is defined in the math package. This function returns the remainder by dividing the two numbers ... Read More

Check If an Array Contains a Given Value in Golang

Akhil Sharma
Updated on 14-Nov-2022 11:11:10

28K+ Views

In this tutorial we will learn how to check if a given value is present in a Go−lang array or not. We will use 2 methods for this. Method 1: Using a for loop directly in the main function We will use a for loop to iterate over the elements of an array in Golang and check for the equality of values using the equality operator. If the values match then we can stop the iteration and say that the given value is present in the array. Method 2: Using the function Golang does not have any pre-defined library function ... Read More

What is a File Descriptor in Python

Sarika Singh
Updated on 14-Nov-2022 08:29:25

7K+ Views

File descriptors in Python are identifiers that represents the open files in the os kernel and are kept in a table of files. Typically, they have non-negative values. Negative results denote an error or a "no value" condition. They support a variety of file-related operations. In general, descriptors are a special approach Python uses to maintain attributes. The main things they assist with are accessing files and other input/output devices like network sockets or pipes. These operations take place on I/O streams identified by following file descriptors − close( fd ) File descriptor closure. This function must be used with ... Read More

Disable Logging from Imported Modules in Python

Sarika Singh
Updated on 14-Nov-2022 08:02:06

24K+ Views

Applications can use the logging module to configure various log handlers and to route log messages to these handlers. This enables a very flexible design that can handle a wide range of use cases. A caller must first request a named logger in order to produce a log message. The program can set up various rules for various loggers using the name. The program can then utilise this logger to produce plain-text messages at various log levels (DEBUG, INFO, ERROR, etc.), allowing it to handle messages with a higher priority differently from those with a lower priority.Following is an example ... Read More

Most Useful Python Modules from the Standard Library

Sarika Singh
Updated on 14-Nov-2022 07:30:09

7K+ Views

The Python Standard Library is a collection of script modules that may be used by a Python program, making it unnecessary to rewrite frequently used commands and streamlining the development process. By "calling/importing" them at the start of a script, they can be used. A module is a file that contains Python code; an ‘coding.py’ file would be a module with the name ‘coding’.We utilise modules to divide complicated programmes into smaller, more manageable pieces. Modules also allow for the reuse of code. In the following example, a module called ‘coding’ contains a function called add() that we developed. The ... Read More

Play QuickTime MOV Files Using Video.js Player

Prince Yadav
Updated on 14-Nov-2022 06:58:56

4K+ Views

Video.js is an open-source, HTML5 web video player. It supports a variety of HTML5 media source extensions along with modern video playback technologies like YouTube, HLS Stream, etc. through plugins. Video.js supports video playback on a range of display sizes with a plethora of devices like desktops and mobile devices. In this tutorial, we're going to learn how to play the QuickTime MOV files using in our web browser using video.js. MOV is a very common video container used in Apple's QuickTime player for storing movies and video files. These containers use a compression algorithm designed by Apple Computer and ... Read More

Set Image as Border with JavaScript

Shubham Vora
Updated on 11-Nov-2022 13:25:15

1K+ Views

In this tutorial, we will learn how to set the image to be used as a border with JavaScript. The outline of an HTML element is called the border. The ‘border-image’ CSS property is used to set an image as the border around an element. It is a shorthand property for: border-image-source, border-image-slice, border-image-width, border-image-outset, border-image-repeat. To set the image to be used as a border with JavaScript we have different ways − Using the style.borderImage Property Using the style.setProperty Method Using the style.borderImage Property An element's style.borderImage property specifies an image that will be used for the ... Read More

Set Text Override for Multiple Languages in JavaScript

Shubham Vora
Updated on 11-Nov-2022 13:17:02

312 Views

In this tutorial, we will learn how to set whether the text should be overridden to support multiple languages in the same document with JavaScript. Use the unicodeBidi property in JavaScript to set whether the text should be overridden to support multiple languages in the same document. Set it to normal, embed, or bidi-override. The bidi-override allows you to add the direction, i.e., rtl to ltr. Using the unicodeBidi Property In JavaScript, the unicodeBidi property is used along with the direction property to set whether the text should be overridden to support multiple languages in the same document. This property ... Read More

Advertisements