
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 26504 Articles for Server Side Programming

7K+ Views
C# is a powerful object-oriented programming language used for developing a wide range of applications. In this article, we will discuss how to write a C# program to read and write a byte array to a file using the FileStream class. Step 1: Creating a Byte Array The first step in this program is to create a byte array that we want to write to a file. Here is an example − byte[] byteArray = { 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64 }; Step 2: Writing Byte Array to File The next step is ... Read More

2K+ Views
In Swift, you can use higher-order functions to flatten an array of arrays. You can use a combination of joined(), reduce(), and flatMap() functions. Sometimes, you are required to merge multiple arrays into a single array. In Swift, you can easily do that using high-order functions. In this article, we will see some examples of different use cases. Example 1: Using the flatMap() Function To flatten an array of arrays in Swift, you can use the joined() method along with the flatMap() function. Here's an example. import Foundation let arrayOfArrays = [[1, 2], [3, 4], [5, 6, 7]] let flattenedArray ... Read More

230 Views
Error management in Swift is a technique for dealing with mistakes that happen while the code is running. It enables you to create code that smoothly predicts and deals with mistakes rather than crashing during execution. You will see some examples of how to deal with Swift code errors in this post. The try, catch, and throw keywords are just a few of the error-handling tools offered by Swift. Together, these keywords make it possible for programmers to create error-free code. There are Some Points of How Error Handling Works in Swift If a function can throw an error ... Read More

998 Views
In Swift, you can use the data(using:) method to convert a string to data. This method belongs to the string class and is used to retrieve a data value. In this article, you will see some examples of use cases of this approach. Here are the Steps for Converting NSString to NSData in Swift Create an NSString object containing the string you want to convert. Call the data(using:) method on the NSString object, passing the desired encoding as a parameter. Check if the result of the data(using:) method is not nil by using optional binding (if let). Use the ... Read More

3K+ Views
In Swift, you can convert a URL to a String using the absoluteString property of the URL. To convert a string to a URL, you can use the URL(string:) initializer. In this article, you will see many different examples of how to convert an URL to a string and vice versa. Example 1: Converting URLs to Strings and Vice Versa for converting a URL to a string using the absoluteString property and a string to a URL, you can use the URL(string:) initializer. It also mentions that the URL(string:) initializer returns an optional URL value that should be checked for ... Read More

901 Views
To obscure a UITextField password in iOS, you can use the secureTextEntry property. This property allows you to hide the text entered into a text field by showing dots or asterisks instead of actual characters. In most iOS apps, we are required to obscure a UITextField to implement the password feature. This is easy to use the property. The isSecureTextEntry Property isSecureTextEntry is a property of the UITextField class in iOS that determines whether the text entered into the text field should be obscured, such as when entering a password. When isSecureTextEntry is set to true, the text entered into ... Read More

17K+ Views
To make a VStack fill the screen width in SwiftUI, you can use the frame modifier with a maxWidth parameter set to ".infinity". In this article, you will see different examples of VStack with full width. VStack VStack is a layout container in SwiftUI that arranges views vertically in a top-to-bottom fashion. The views are stacked on top of each other, with the first view added to the VStack at the top and subsequent views added below it. In SwiftUI, VStack is part of a family of layout containers that also includes HStack and ZStack. These containers provide a flexible ... Read More

2K+ Views
In Swift, there are two ways to open a link. One approach is to use the UIApplication class to open a link in the Safari browser. Another approach is using the SafariServices framework in iOS. Let's see some examples of how to open a link based on these approaches. Approach 1: Using the UIApplication class Step 1 − Create a URL object for the link that you want to open. You can do this using the URL(string:) initializer. Step 2 − Create an instance of the UIApplication class. This class is responsible for managing the behavior of your app, ... Read More

729 Views
In iOS, the UIStackView itself doesn't have a background color property. However, you can add a subview to the UIStackView and set its background color. In this example, we will add a stack view with some subviews. After that, we will see how to apply the background color to the stack view. UIStackView UIStackView is a container view that arranges its subviews horizontally or vertically. It automatically calculates the size and position of its subviews based on the stack view's axis, distribution, alignment, and spacing properties. You can add subviews to a UIStackView programmatically or in the Interface Builder. UIStackView ... Read More

2K+ Views
To create space at the beginning of a UITextField in Swift, you can set the leftView property of the text field to a UIView with the desired width. By default, UITextField does not provide a margin on the left or right side and this is the most common requirement to have space for a better user interface. In this article, you will see an example of how to add a left margin to the text field. In this example, we first create a view controller and then an email address text field. First, we will see the default text field ... Read More