Set maximum value for char.static int maxCHARS = 256;Now display the duplicate characters in the string.String s = "Welcometomywebsite!"; int []cal = new int[maxCHARS]; calculate(s, cal); for (int i = 0; i < maxCHARS; i++) if(cal[i] > 1) { Console.WriteLine("Character "+(char)i); Console.WriteLine("Occurrence = " + cal[i] + " times"); }Above, we have calculated the frequency of characters. The same is shown below in the complete example −Exampleusing System; class Demo { static int maxCHARS = 256; static void calculate(String s, int[] cal) { for (int i = 0; i < ... Read More
>Create View View_name as Select Col1,Col2 From Table_name;In the above SQL statement, you are creating a view that contains Col1 and Col2 from the table.Table Name − Emp_InfoExampleIdEmplNameEmpluserEmplpasswordJoining_Date1Employee 1Emp1Emp1Pwd9/11/20162 Employee 2Emp2 Emp2Pwd 16/08/20153Employee 3Emp3Emp3Pwd15/09/20164Employee 4Emp4 Emp4Pwd 3/07/20145Employee 5Emp5Emp5Pwd10/09/20126Employee 6Emp6 Emp6Pwd 1/10/2013 To create a view, which contains only 3 columns you have to write->Create View View_EmpInfo As Select Id, EmplName,Joining_Date From Emp_Info;This view can be used by users to get Id, EmplName, and Joining_date.
Following benefits can be achieved using database views −To provide security −Using a view, you can select specific columns and assign access to the users. Users can only see the columns for which permissions are set on the view and not the underlying tables with full data.To hide Complexity −Consider a scenario where you need to join multiple tables using complex joins or calculations. All the coding can be put in database view and access can be provided.
When a user logins to the HANA system, the following steps are performed −Step 1 The system authenticates the user using the configured mechanism.Example − When User name/password authentication is being enforced, the provided user name and password are verified.Step 2The system verifies that the user's account is within its validity period.In the system view USERS, the columns VALID_FROM and VALID_UNTIL must contain effective values for the user in question.However, this is an optional parameter that a user administrator can set during user provisioning.Step 3The next step is system verifies that the user's account is active.This can be performed by checking ... Read More
You can use parameter detailed_error_on_connect: Indicates the detail level of error information returned when a logon attempt fails.Parameter detailed_error_on_connectDefault Value falseAdditional Information When you set this parameter to false, only the information authentication failed is returned.When this parameter is set to true, the specific reason for failed logon is returned −Invalid user or passwordUser is lockedConnect try is outside validity periodUser is deactivated
We can write multiple-line statements because MySQL determines the end of a statement by looking for the termination semicolon, not by looking for the end of the input line.Examplemysql> Select * -> from -> stock_item; +------------+-------+----------+ | item_name | Value | Quantity | +------------+-------+----------+ | Calculator | 15 | 89 | | Notebooks | 63 | 40 | | Pencil | 15 | 40 | | Pens | 65 | 32 | | Shirts | 13 ... Read More
For creating a table with such kinds of names we must have to use quote character. The quotes can be single or double depends upon ANSI_QUOTES SQL mode. If this mode is disabled then the identifier quote character is the backtick (“`”). Consider the following example in which we created a table named ‘select’ −mysql> Create table `a^b`(`a^b` int); Query OK, 0 rows affected (0.19 sec) mysql> Create table "a^g"("a^g" int); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"a^g" ("a^g" ... Read More
Queue represents a first-in, first out collection of object. It is used when you need a first-in, first-out access to items. When you add an item to the list, it is called enqueue, and when you remove an item, it is called deque.Let us see an example of the Queue class.To add elements, use Enqueue −Queue q = new Queue(); q.Enqueue('X'); q.Enqueue('Y'); q.Enqueue('Z');To delete elements, use Dequeue −// remove elements while (q.Count > 0) Console.WriteLine(q.Dequeue());Let us see an example to add elements in a queue.Example Live Demousing System; using System.Collections; namespace Demo { class Program { ... Read More
We can use MySQL EXIST operator to test for the existence of a record in the subquery. In other words, we can say that EXIST operator checks if a subquery returns any rows. The syntax of using EXIST operator with MySQL subquery is as follows −SyntaxWHERE EXISTS (Subquery)The above EXIST (subquery) expression returns TRUE if the subquery returns at least one row, otherwise it returns false.ExampleTo make it understand we are using the data from the following tables −mysql> Select * from Customers; +-------------+----------+ | Customer_Id | Name | +-------------+----------+ | 1 | ... Read More
To make jQuery animations smoother use the easing library. Use the animation speed properly to form it a perfect animation for the web page. Do not speed up animation and you should know where to stop it while using animate().For an example, set a button, that fades out on click and displays a textarea:Add answerThe following is the textarea that generates showing smoother animation using animation() and fadeout(): You can try to run the following code to make jQuery animation smoother:Example Live Demo $(document).ready(function(){ $('body').on('click', '#answer', function() ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP