Samual Sam has Published 2492 Articles

Defining Clean Up Actions in Python

Samual Sam

Samual Sam

Updated on 30-Jun-2020 09:14:31

799 Views

There are numerous situation occurs when we want our program to do this specific task, irrespective of whether it runs perfectly or thrown some error. Mostly to catch at any errors or exceptions, we use to try and except block.The “try” statement provides very useful optional clause which is meant ... Read More

Python object serialization

Samual Sam

Samual Sam

Updated on 30-Jun-2020 09:11:53

588 Views

Serialization is a process in which an object is transformed into a format that can be stored/save (in a file or memory buffer), so we are able to deserialize it later and recover the original content/object from the serialized format. We are going to use a python pickle module to ... Read More

Iterate through elements of Java LinkedHashSet

Samual Sam

Samual Sam

Updated on 30-Jun-2020 06:11:07

254 Views

First, create a LinkedHashSet and add elements to it −LinkedHashSet set = new LinkedHashSet(); set.add(10); set.add(20); set.add(30); set.add(40); set.add(50); set.add(60);Now, use the Iterator to iterate through the elements −Iterator i = set.iterator();    while (i.hasNext()) {    System.out.println(i.next()); }The following is an example to iterate through elements of LinkedHashSet −Example Live ... Read More

Create a Stack and Queue using ArrayDeque in Java

Samual Sam

Samual Sam

Updated on 30-Jun-2020 06:08:43

434 Views

Create a stack using ArrayDeque.Deque s = new ArrayDeque(); // stack s.push("Bat"); s.push("Mat"); s.push("Cat"); s.push("Rat"); s.push("Hat"); s.push("Fat");Create a queue using ArrayDeque −Deque q = new ArrayDeque(); // queue q.add("Bat"); q.add("Mat"); q.add("Cat"); q.add("Rat"); q.add("Hat"); q.add("Fat");The following is an example.Example Live Demoimport java.util.ArrayDeque; import java.util.Deque; public class Demo {    public static void ... Read More

How to display an image with rounded corners on iOS App using Swift?

Samual Sam

Samual Sam

Updated on 30-Jun-2020 05:55:51

3K+ Views

To make an image with round corners or to make any view or button or any UI element with round corners in swift, we need to access the corner radius property of its layer. Every UI element in iOS is based on a layer.First of all, let’s add an UIImageView ... Read More

Push segue from UITableViewCell to ViewController in Swift

Samual Sam

Samual Sam

Updated on 30-Jun-2020 05:50:40

597 Views

To create a segue from a UITableViewCell to another View controller, we’ll do it like any other ViewController to ViewController segue. We’ll do this with help of an example here.First Create a project, delete the View Controller from storyboard and add One Table View Controller and one View Controller in ... Read More

How to send an attachment in email using Swift?

Samual Sam

Samual Sam

Updated on 30-Jun-2020 05:44:32

433 Views

To send an email from our iPhone device using our application we need to import the MessageUI framework of iOS SDK. After importing the framework in your application, drag and drop a button on the view controller. Add empty action for that button.Now add the following code in your view ... Read More

Capture picture from iOS camera using Swift

Samual Sam

Samual Sam

Updated on 30-Jun-2020 05:35:25

3K+ Views

To capture pictures from a camera in swift we can use AVFoundation which is a framework in iOS SDK, but we should try to avoid using it until we need a lot of custom features in our camera application. In this example, we’ll only capture a picture from the camera ... Read More

How to remove duplications from arraylist using linked hashset for listview in Android?

Samual Sam

Samual Sam

Updated on 29-Jun-2020 15:55:58

94 Views

This example demonstrate about How to remove duplications from arraylist using linked hashset for listview in AndroidStep 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.   ... Read More

How to insert element to linked list for listview in Android?

Samual Sam

Samual Sam

Updated on 29-Jun-2020 15:54:26

278 Views

This example demonstrate about How to insert element to linked list for listview in AndroidStep 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.       ... Read More

Advertisements