Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles on Trending Technologies
Technical articles with clear explanations and examples
Golang program to convert a linked list into an array and vice-versa
In the Go programming language, a linkedlist is a data structure made up of a series of nodes, each of which has a value and a reference (pointer) to the node after it. Since items can be added to or removed from a list without rearranging the entire data set, linked lists offer a dynamic and adaptable approach to store data. Using structs and pointers, linked lists can be implemented in Go whereas array is a fixed-size group of identical elements that may be accessed by their respective indexes, which are integers with a zero-based basis. An array's size is ...
Read MoreGolang program to make a file read-only
We can use chmod function and syscall package in Golang to make a file read-only file. To convert a file into read-only files, the chmod function set the file’s right to 044. The os.Chmod function is then used to modify the file's mode. In syscall package of Golang we are going to use os.stat function to obtain information about the file. Method 1: Using chmod function This program employs the Chmod function to modify a file's permissions using the os package. Syntax os.Chmod In Go, this function belongs to the os package. The main goal of this function is ...
Read MoreGolang program to write into a file
In go programming language we can use os.create and ioutil.WriteFile to write into a file. In Go, the OS can be used to represent a file. os package file type that offers ways to open, read from, write to, and manipulate files. Method 1: Using os.Create function We make use of the os.Create in this program to start a new file or, if one already exists, to open it. The file is deferred while a string is written using the WriteString function. Close makes ensuring that when the application ends, the file is correctly closed. Syntax Os.Create In ...
Read MoreGolang program to create a temporary file
In Go programming language we can use ioutil.TempFile function to create a temporary file. To create a new temporary file in the default temporary directory, this program uses the ioutil. TempFile function. The directory in which the file should be created is the first argument to TempFile, and the pattern to use for the file name is the second argument. The pattern in this instance is "temp-*.txt, " leading to a file name like "temp-123456789.txt". Syntax Ioutil.TempFile In Go programming language, this function is a part of ioutil package and is used to create a temporary file. A ...
Read MoreGolang program to create a new file
Golang has two internal function – os.create and ioutil.WriteFile to create a new file. The "file" is a disk-based file that a Go program may read from or write to. In Go, the OS can be used to represent a file. os package file type that offers ways to open, read from, write to, and manipulate files. Method 1: Using os.Create Command In this method, the os.Create function uses the specified name to create a new file or truncate an existing one. When the function has completed running, the file is closed using the defer command. Syntax Os.Create ...
Read MoreGolang program to convert file to byte array
In Go programming language we can use byte function and ioutil.ReadFile function to convert a file into byte array. The os package file type that offers ways to open, read from, write to, and manipulate files whereas array is a fixed-size group of identical elements that may be accessed by their respective indexes, which are integers with a zero-based basis. An array's size is predetermined at the moment of declaration and cannot be altered later on. When storing a set of data with a known number of elements, arrays in Go are handy, but they have some drawbacks, such as ...
Read MoreGolang program to add elements to a linkedlist
In Golang, we can use node struct and linkedlist struct to add elements to a linkedlist. A linkedlist is a data structure made up of a series of nodes, each of which includes an element and a reference to the node after it in the sequence. It is a linear data structure with pointers connecting the items, and from the first node (head) to the last node, each node can be visited (tail). As opposed to arrays, which require all elements to be shifted, linked lists just require altering the pointers of the adjacent nodes, making them helpful in situations ...
Read MoreSecurity Factors In IoT Devices
The interconnection of physical devices, vehicles, and other things which relate to electronics, software, sensors, and connections that allows these objects to collect and share data is referred to as the Internet of Things (IoT). The Internet of Things (IoT) has altered our way of life and work. Ever since IoT came into our lives, we have had great experiences and easy lives. Hence its security is a factor that cannot be ignored. Major IoT Devices in Use Smart thermostats, security cameras, and home assistants are examples of IoT gadgets that have become standard in our homes and workplaces. As ...
Read MoreInternet of Robotic Things (IoRT)
One of the interesting topics everyone wants to know about is robots! Do you love to search about robots and how they work? How could robots work as humans? What is the difference between IoRT and IoT? How are they interrelated? Yes! Many questions running through your mind, right? You got to get answers to all of them and explore this interesting topic! First, let us start by defining what IoRT is. What is Internet of Robotic Things (IoRT)? The Internet of Robotic Things (IoRT) is the integration of internet connectivity and sensors into robots and other devices, allowing them ...
Read MoreWhy do IoT Deployments Fail Most of The Time?
The IoT gives organizations a potential chance to assemble information from a wide assortment of resources and afterwards communicate it, using the Web, to cloud-based or other IT frameworks. Organizations can then utilize this information to decrease the resources' free time, smooth out their business processes, offer new administrations that increment their incomes, and in any case, change their organizations. In any case, despite the commitment to the IoT and the outcome of numerous IoT projects, there has likewise been an enormous number of disappointments. These disappointments have driven many associations to ask themselves what they misunderstood with their IoT ...
Read More