Nitya Raut

Nitya Raut

158 Articles Published

Articles by Nitya Raut

Page 3 of 16

C++ Program to Implement Jarvis March to Find the Convex Hull

Nitya Raut
Nitya Raut
Updated on 29-Apr-2025 1K+ Views

A convex hull is the smallest convex polygon with maximum area and minimum perimeter that encloses all the given points in a 2D plane. In this article, we will learn how to write C++ program to implement Jarvis March Algorithm to find a convex hull. The objective of this problem is to take a set of x and y coordinates of a 2d plane as input, and display coordinate point from the set which are part of convex hull. // Input Set of points: {0, 0}, {1, 1}, {2, 2}, {2, 0}, {1, 2}, {0, 2} // Output ...

Read More

How to dynamically remove items from ListView on a click?

Nitya Raut
Nitya Raut
Updated on 18-Nov-2024 2K+ Views

This example demonstrate about How to dynamically remove items from ListView on a click Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main.xml.   In the above code, we have taken listview. Step 3 − Add the following code to src/MainActivity.java package com.example.myapplication; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.TextView; public class MainActivity extends Activity {  TextView textView;  ArrayAdapter adapter = null;  String[] ...

Read More

What is Hamming Distance?

Nitya Raut
Nitya Raut
Updated on 01-Nov-2023 79K+ Views

Hamming DistanceHamming distance is a metric for comparing two binary data strings. While comparing two binary strings of equal length, Hamming distance is the number of bit positions in which the two bits are different.The Hamming distance between two strings, a and b is denoted as d(a, b).It is used for error detection or error correction when data is transmitted over computer networks. It is also using in coding theory for comparing equal length data words.Calculation of Hamming DistanceIn order to calculate the Hamming distance between two strings, and , we perform their XOR operation, (a⊕ b), and then count ...

Read More

How to draw a hollow circle in SVG?

Nitya Raut
Nitya Raut
Updated on 16-Dec-2021 3K+ Views

To draw a hollow circle in SVG, use the element. For that, use fill=”none” and draw the outline.SVG stands for Scalable Vector Graphics and is a language for describing 2D-graphics and graphical applications in XML and the XML is then rendered by an SVG viewer. Most of the web browsers can display SVG just like they can display PNG, GIF, and JPG.ExampleYou can try to run the following code to learn how to draw a hollow circle in SVG           HTML5 SVG Hollow Circle                                   Output

Read More

How to use size() in android ConcurrentLinkedDeque?

Nitya Raut
Nitya Raut
Updated on 01-Jul-2020 186 Views

Before getting into the example, we should know what ConcurrentLinkedDeque is, it is unbounded deque based on linked nodes. Multiple threads can access deque elements with safety.This example demonstrates about How to use size() in android ConcurrentLinkedDequeStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     In the above code, we have taken a text view to show ConcurrentLinkedDeque elements.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Build; import android.os.Bundle; ...

Read More

Top-level script environment in Python (__main__)

Nitya Raut
Nitya Raut
Updated on 27-Jun-2020 735 Views

A module object is characterized by various attributes. Attribute names are prefixed and post-fixed by double underscore __. The most important attribute of module is __name__. When Python is running as a top level executable code, i.e. when read from standard input, a script, or from an interactive prompt the __name__ attribute is set to '__main__'.>>> __name__ '__main__'From within a script also, we find a value of __name__ attribute is set to '__main__'. Execute the following script.'module docstring' print ('name of module:', __name__)Outputname of module: __main__However, for an imported module this attribute is set to name of the Python script. ...

Read More

How to determine device type (iPhone, iPod Touch) with Swift?

Nitya Raut
Nitya Raut
Updated on 27-Jun-2020 908 Views

When working on iOS applications, we sometimes need to know the device on which application is installed, and provide custom features depending on the device in use. For example, we want to provide some features on iPhone X but not on iPhone 7. In this article we’ll learn how to find the iOS device being used, using an iOS Application.Let’s go through some terms that will be required for achieving the desired results, utsname − this is a structure located in Darwin module of iOSuname − uname is a function that takes utsname as an input and returns Int32 as ...

Read More

How to determine the current iPhone model information?

Nitya Raut
Nitya Raut
Updated on 27-Jun-2020 601 Views

iOS Provides a UIDevice class which has all the information about your iPhone that does not violate any privacy laws Apple has.Using the UIDevice we can access information like −UIDevice.current.localizedModel − this returns the localized version of modelUIDevice.current.model − this returns model of current device, e.g. @"iPhone", @"iPod touch"UIDevice.current.name − this returns the current name of the device in use, e.g. "My iPhone"UIDevice.current.systemName − this returns the system name e.g. @"iOS"UIDevice.current.systemVersion − this returns the system version e.g. @"4.0"UIDevice.current.batteryLevel − this returns the battery level, if it is between 0 to 1, it will return the value otherwise if the ...

Read More

How to launch any arbitrary iPhone application from within another app?

Nitya Raut
Nitya Raut
Updated on 27-Jun-2020 1K+ Views

iOS Allows us to open some applications with some links or other ways from our app, like dialing a number when clicked on it, or writing a mail with some static body or writing a SMS. But this is limited to some applications, not every app can be opened from within an application.Specifically it is limited to apps that have a registered URL Scheme. For example if you want to open a SMS from your app, it is possible using the registered URL Scheme.Some of the applications that can be opened with URL schemes and how to open them are ...

Read More

Corona vs. Phonegap vs. Titanium

Nitya Raut
Nitya Raut
Updated on 27-Jun-2020 272 Views

In this article we’ll learn about Corona, PhoneGap and Titanium, though all these technologies are different, the common thing between these is that they all are cross platform. i.e they can be used to write program once and then run that on multiple platforms like iPhones and android devices.Corona − Corona is a free and open source SDK (Software development kit), developed by corona Labs roughly 10 years ago in 2009. Corona is mainly for developing 2D mobile applications for most of the platforms including iOS, Android, Desktop/ Windows Applications. Corona is based on top of C++ and openGL to ...

Read More
Showing 21–30 of 158 articles
« Prev 1 2 3 4 5 16 Next »
Advertisements