- 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
Anvi Jain has Published 629 Articles
Anvi Jain
2K+ Views
To detect current device with iOS/Swift we can use UserInterfaceIdiom. It is an enum in swift, which tells which device is being used.The interface idiom provides multiple values in it’s enum which are.case unspecified @available(iOS 3.2, *) case phone // iPhone and iPod touch style UI @available(iOS 3.2, *) case ... Read More
Anvi Jain
2K+ Views
You can strip last two characters with the help of SUBSTRING() and CHAR_LENGTH() methods. The syntax is as follows −select yourColumnName, SUBSTRING(yourColumnName, 1, CHAR_LENGTH(yourColumnName) - 2) AS anyVariableName from yourTableName;To understand the above syntax, let us create a table −mysql> create table LastTwoCharacters −> ( ... Read More
How to resolve the error that occurs while using a reserved word as a table or column name in MySQL?
Anvi Jain
995 Views
This error occurs when you try to use a reserved word as a table or column name. It can occur due to −Case 1: Whenever you use reserved word as a table name −mysql> create table insert −> ( −> Id int −> );The error is as follows −ERROR 1064 ... Read More
Anvi Jain
634 Views
To add a live camera preview to our default UIView in swift we can either use AVFoundation framework of iOS SDK or native UIImagePickerController(). In this example we’ll be using ImagePicker as our aim is to present camera preview on the UIView and Imagepicker is suitable for that task. AVFoundation ... Read More
Anvi Jain
904 Views
You can use IN statement to delete more than one rows from a table using id in MySQL. The syntax is as follows −delete from yourTableName where yourColumnName in(value1, value2, .....valueN);To understand the above syntax, let us create a table. The following is the query to create a table.mysql> create ... Read More
Anvi Jain
5K+ Views
To select distinct values in two columns, you can use least() and greatest() function from MySQL.Let us create a table with two columns −mysql> create table SelectDistinctTwoColumns −> ( −> StudentId int, −> EmployeeId int −> ); Query OK, 0 rows affected (0.60 sec)Now you can ... Read More
Anvi Jain
1K+ Views
To make an iPhone vibrate using swift we’ll use two different methods. First create a new project and add Four different buttons to the main View controller.Now import the AudioToolbox framework in your view controller class.For the first button add an action and write the following code as shown below:@IBAction ... Read More
Anvi Jain
531 Views
In this article we’ll see how to open a pdf file using swift in iOS. Here we’ll do it with an example of opening pdf in webView in iOS. Let’s create a project and add WKWebView to the storyboard.Connect it’s outlet to the ViewController class.Now we’ll see two different thingsOpening ... Read More
Anvi Jain
17K+ Views
You can query between dates with the help of BETWEEN statement. The syntax is as follows −select *from yourTableName where yourColumnName between ‘yourStartingDate’ and curdate().Use curdate() or now(), both these functions will work. To understand the above syntax, let us create a table −mysql> create table BetweenDateDemo ... Read More
Anvi Jain
649 Views
In MySQL, now() can be used to insert current date/time. The syntax is as follows −insert into yourTableName values(now());To understand the above concept of inserting current date/time in the table, let us first create a table −mysql> create table CurrentDateTimeDemo −> ( −> YourTime ... Read More