Articles on Trending Technologies

Technical articles with clear explanations and examples

Design patterns for data mining/machine learning projects

Mouri Roy
Mouri Roy
Updated on 09-May-2023 349 Views

As the demand for machine learning is increasing in various fields like corporate offices, hospitals, server-side services, traffic, manufacturing, and many more fields, it is important to deliver the best solutions for any problem related to machine learning. This will alternatively increase the efficiency of machine learning models. The design patterns are a way in which the various stages and steps to train machine learning models are recorded so that it can be used to solve a problem with much efficiency and less error. In this article, we will see the various machine learning design patterns. But before that let ...

Read More

How to send images via MMS in Android?

Vaibhav Ahire
Vaibhav Ahire
Updated on 09-May-2023 2K+ Views

Introduction The multimedia messaging service is a great way to send images and other media files along with text to different contacts over the phone. If you are looking to send images to your contacts then MMS is a great way to send this to your friends and family. In this article we will take a look at How to send images via MMs in ANdroid. Implementation We will be creating a simple application in which we will be creating a text view for displaying the heading of our application. After that we will be creating an image view in ...

Read More

How to save files on external storage in Android?

Vaibhav Ahire
Vaibhav Ahire
Updated on 09-May-2023 4K+ Views

Introduction In android devices the most useful feature is to store and read the files within the device storage or an external storage. This allows users to expand their device storage capacity so that they can store and retrieve files according to their convenience and can use them accordingly. In this article we will take a look at How to save files on external storage in Android. Implementation We will be creating a simple application in which we will be creating a text view for displaying the heading of our application.After that we will be creating an edit text field ...

Read More

How to Read/Write String from a File in Android?

Vaibhav Ahire
Vaibhav Ahire
Updated on 09-May-2023 4K+ Views

Introduction Many times while building an android application we have to store data in the form of files within our android application. We will read and write string data inside our file. In this article we will take a look on How to Read/Write string from a file in Android Implementation We will be creating a simple application in which we will be firstly writing the data in that file which the user can enter through edit text. After that we will be reading the data stored in that file by clicking a button and displaying that within our text ...

Read More

Swift Program to Search an Element in a Dictionary

Ankita Saini
Ankita Saini
Updated on 09-May-2023 3K+ Views

In a Swift dictionary, we can search for an element that is either a key or value with the help of contains() function. The contains() function will return a boolean value which represents whether the specified element(key or value) is found or not. Syntax dict.contains{$0.key == “KeyName”} Here, dict is the dictionary. The contains() function returns a boolean value which represents the result. Here we pass a closure in the function which will check if the current key is equal to the specified key or not and then return the result accordingly. Algorithm Step 1 − Create a ...

Read More

Swift Program to Replace Elements in a Dictionary

Ankita Saini
Ankita Saini
Updated on 09-May-2023 432 Views

In Swift, a dictionary is an unordered collection of key-value pairs. So, to replace the value of a key Swift provides bracket notation or subscript notations. Using this notation we can also add new key-value pair in the dictionary if the specified pair does not exist. Syntax dict[keyName] = “Value” Here, dict is the dictionary. The keyName represents the key whose value you want to replace, and the Value represent the new value. Algorithm Step 1 − Create a dictionary with key-value pairs. Step 2 − Display the original dictionary. Step 3 − Now replace the value of ...

Read More

How to programmatically set style attributes in a view on Android?

Vaibhav Ahire
Vaibhav Ahire
Updated on 09-May-2023 7K+ Views

Introduction Many times we have seen a case while developing an android application that we have set the same style for multiple views across our application. We have seen writing the code to set the style multiple times. To reduce the code duplication and optimization of our code we can create the style for a specific view in our styles.xml file and set that style to our view programmatically. In this article we will take a look on How to programmatically set the style attribute in a view on Android. Implementation We will be creating a simple application in which ...

Read More

Swift Program to Remove Null from a Dictionary

Ankita Saini
Ankita Saini
Updated on 09-May-2023 944 Views

Sometimes a dictionary contains null values so to remove those null values Swift provides an in-built function named the filter() method. In the filter() method, we pass a closure which returns a boolean value indicating whether the key-value pair should be included in the resultant dictionary or not. Or we can say that if the second element(value) of a key-value pair is not nil, then it will be included in the resultant dictionary. Otherwise not. Syntax dict.filter{$0.1 != nil} Here, dict is the dictionary. The filter() function return key-value pairs which satisfy the given closure. The closure returns true ...

Read More

Swift Program to Remove duplicate elements from Dictionary

Ankita Saini
Ankita Saini
Updated on 09-May-2023 966 Views

In Swift dictionary, we cannot have duplicate keys but can have duplicate values hence in this article we will remove duplicate values from the dictionary. So for that, we use contains() function. This function checks if the dictionary contains duplicate values or not. If the dictionary contains duplicate values, then it will remove them from the resultant dictionary. Syntax dict.values.contains(val) Here, dict is the resultant dictionary in which we will store unique key-value pairs and the contains() function compares two values with each other. Algorithm Step 1 − Create a dictionary named as myCityRank with key-value pairs. Step ...

Read More

Swift Program to Remove all the elements from Dictionary

Ankita Saini
Ankita Saini
Updated on 09-May-2023 502 Views

In a dictionary, to remove all the elements from the dictionary Swift provides an inbuilt function named as removeAll() function. It will remove all the key-value pairs from the specified dictionary. Syntax dict.removeAll() Here, dict is the dictionary. The removeAll() function does not take any parameter and removes all the key-value pairs present in the specified dictionary. Algorithm Step 1 − Create a dictionary with key-value pairs. Step 2 − Print the original dictionary. Step 3 − Now remove all the key-value pairs from the dictionary using removeAll() function. Step 4 − Print the output. Example In ...

Read More
Showing 37071–37080 of 61,297 articles
Advertisements