- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 34472 Articles for Programming
620 Views
Docopt module in Python is used to create command-line interfaces. Similar to other command line arguments and options docopt allows us to define command line arguments and options and also generate help messages and usage strings for the Program. In this article, we will understand how the Docopt module is defined and how it is used to create a command line interface. Installation You can install the Docopt module before using it with the help of the pip command in Python. To install the Docopt module type the following command on your terminal or command prompt. pip install docopt ... Read More
67 Views
The dllist is a class of the llist module in Python that is used to implement a doubly linked list that has the functionality for insertion, deletion, and traversal of elements. The dllist class provides methods for adding, removing, and iterating over the list in both directions. In this article, we will understand the dllist class in detail and its methods. Creating dllist object To create a dllist object, we need to first import the llist module from the pyllist package. We can then use the dllist class constructor to create a new instance of a doubly-linked list. The ... Read More
904 Views
Adam optimizer in Tensorflow is an algorithm used in deep learning models. Optimization algorithms are used in deep learning models to minimize the loss function and improve performance. Adam stands for Adaptive Moment Estimation, which is a stochastic gradient descent algorithm. It combines the advantages of both RMSprop and AdaGrad algorithms to achieve a better optimization result. In this article, we will understand the Adam Optimizer in Tensorflow and how it works. Working principle of Adam Optimizer Adam optimizer is an iterative optimization algorithm. It uses first and second-order moments of the gradient to adaptively adjust the learning rate ... Read More
103 Views
The Factory Method Design Pattern of Python is a creational pattern that provides an interface for creating objects in a superclass but allows subclasses to alter the type of objects that will be created. It is used to define a generic interface for creating objects while allowing subclasses to decide which class to instantiate. In this article, we will explore how to use the Factory Method Design Pattern to access web resources in Python. Accessing Web Resources Python provides several libraries for accessing web resources such as HTTP requests, urllib, and Requests. These libraries allow us to send HTTP requests ... Read More
896 Views
Struct types are used to construct custom data structures consist of fields. These fields reflect the structure's characteristics or attributes. The ability to add tags to fields, such as "JSON" tags, which offer additional metadata about the field when serializing or deserializing the struct to/from JSON format, is a valuable feature of struct types. In this article, we will write Go language programs to represent structs with one JSON tag in each field. type StructName struct { Field1 DataType1 `Tag1:"Value1" Tag2:"Value2"` Field2 DataType2 `Tag3:"Value3" Tag4:"Value4"` // ... ... Read More
696 Views
In golang, Pointers are the variables which store the address of other variables. A struct is a counterpart to class in object-oriented programming where different fields can be placed in the struct, where these fields can be implemented later on and they have a type like int, float, string etc. In this article, we will write a Go language program to compare two struct instances that have pointers as fields. Mathematical representation for assigning the address of variable “b” to variable “a” − a = &b & denotes the address of operator, and receives the memory address of ... Read More
164 Views
A struct is a counterpart to class in object-oriented programming where different fields can be placed in the struct, where these fields can be implemented later on and they have a type like int, float, string etc.In this article, we will write a Go language program to compare the equality of two structs. Syntax func len(v Type) int The len() method returns the length of any parameter. It accepts one input, the data type variable whose length we want to know. func range(variable) The range function iterates through any data type. To utilize this, we must first put ... Read More
68 Views
A pointer is a variable which holds the address of another variable and can be used to point to the content of another variable. A pointer does not have its capacity just like slices, it can be used to point to the map whose length of elements can be calculated.In this article, we will write a Go language program to find the capacity of a pointer pointing to a map. Syntax func make ([] type, size, capacity) The make function in go language is used to create an array/map it accepts the type of variable to be created, its ... Read More
334 Views
In this article, we will write a Go language program to find the longest path in a weighted directed acyclic graph using Bellman-ford-algorithm. Bellman-Ford-Algorithm is a popular algorithm used to find the longest path from source vertex to other vertices in a weighted directed graph. Syntax func range(variable) Any data type may be iterated over using the range function. This may be used by first writing the range keyword, then the data type to which we wish to iterate. func make ([] type, size, capacity) When creating an array or map in the Go programming language, the ... Read More
103 Views
In this article, we will write Go language programs to find the minimum no. of edges in a weighted directed graph that connects all nodes. We will use Prim’s algorithm to perform this operation. It is a greedy algorithm which is used to find the minimum spanning tree for a graph. Syntax func range(variable) Any data type may be iterated over using the range function. This may be used by first writing the range keyword, then the data type to which we wish to iterate func make ([] type, size, capacity) The go language's make function is used ... Read More