How to create a custom navigation drawer in Android?

George John
Updated on 30-Jul-2019 22:30:26

5K+ Views

This example demonstrate about How to resize Image in Android App.Step 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.         Step 3 − Add the following code to res/layout/nav_header_main.xml.             Step 4 − Add the following code to res/layout/app_bar_main.xml.                     Step 5 − Add the following code to res/layout/content_main.xml. Step 6 − Add the ... Read More

How to Read data from BLOB and CLOB type columns from a table using JDBC?

Anvi Jain
Updated on 30-Jul-2019 22:30:26

6K+ Views

Clob datatypeCLOB stands for Character Large Object. in general, an SQL Clob is a built-in datatype which is used to store large amount of textual data. Using this datatype, you can store data up to 2, 147, 483, 647 characters. MYSQL database provides support Clob datatype TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT.The java.sql.Clob interface of the JDBC API represents the CLOB datatype. Since the Clob object in JDBC is implemented using an SQL locator, it holds a logical pointer to the SQL CLOB (not the data).Reading Data from a column of datatype ClobYou can read CLOB value (character stream data) from a ... Read More

HTML DOM PageTransition Event

AmitDiwan
Updated on 30-Jul-2019 22:30:26

186 Views

The DOM PageTransitionEvent is an event which occurs when a user navigates between the webpages.Property of PageTransitionEvent objectPropertyExplanationpersistedIt returns true or false value depending upon whether the webpage was cached or not.Types of events belong to PageTransitionEvent objectEventsExplanationpageHideIt happens when the user navigates away from a webpage.pageShowIt happens when the user navigates to a webpage.ExampleLet us see an example of PageTransitionEvent object − Live Demo    body{       text-align:center;       color:#fff;       background: #ff7f5094;       height:100%;    }    .btn{       background:#0197F6;       border:none;     ... Read More

HTML DOM Input URL Object

AmitDiwan
Updated on 30-Jul-2019 22:30:26

230 Views

The HTML DOM Input URL Object represents an input HTML element with type url.SyntaxFollowing is the syntax −Creating an with type url.var urlObject = document.createElement(“input”); urlObject.type = “url”;AttributesHere, “urlObject” can have the following attributes −AttributesDescriptionautocompleteIt provides suggestions based on previously typed text, if set to ‘ON’autofocusIf set to true the url field is focused upon initial page load.defaultValueIt sets/returns the default value of an url fielddisabledIt defines if an url field is disabled/enabledformIt returns a reference of enclosing form that contains the url fieldmaxLengthIt returns/sets the value of maxLength attribute of an url fieldnameIt defines the value of name ... Read More

Difference between char s[] and char *s in C

Samual Sam
Updated on 30-Jul-2019 22:30:26

2K+ Views

We have seen sometimes the strings are made using char s[], or sometimes char *s. So here we will see is there any difference or they are same?There are some differences. The s[] is an array, but *s is a pointer. For an example, if two declarations are like char s[20], and char *s respectively, then by using sizeof() we will get 20, and 4. The first one will be 20 as it is showing that there are 20 bytes of data. But second one is showing only 4 as this is the size of one pointer variable. For the ... Read More

Create a stored Procedures using MySQL Workbench?

Nishtha Thakur
Updated on 30-Jul-2019 22:30:26

3K+ Views

Let us first create a Stored Procedure. Following is the query to create a stored procedure using MySQL Workbench.use business; DELIMITER // DROP PROCEDURE IF EXISTS SP_GETMESSAGE; CREATE PROCEDURE SP_GETMESSAGE() BEGIN DECLARE MESSAGE VARCHAR(100); SET MESSAGE="HELLO"; SELECT CONCAT(MESSAGE, ' ', 'MYSQL!!!!'); END // DELIMITER ;Here is the screenshot of stored procedure in MySQL workbench −You need to execute the above stored procedure with the help of below symbol shown in the screenshot −Now you can call the stored procedure with the help of CALL command.call SP_GETMESSAGE();The screenshot is as follows −Now again you can execute the above statement with the ... Read More

How to limit text length of EditText in Android?

Ankith Reddy
Updated on 30-Jul-2019 22:30:26

5K+ Views

This example demonstrate about How to limit text length of EditText in Android.Step 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.     Step 3 − Add the following code to src/MainActivity.javapackage app.tutorialspoint.com.sample ; import android.support.v7.app.AppCompatActivity ; import android.os.Bundle ; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate (Bundle savedInstanceState) {       super .onCreate(savedInstanceState) ;       setContentView(R.layout. activity_main ) ;    } }Step 4 − Add ... Read More

How to add an extra field in a sub document in MongoDB?

Smita Kapse
Updated on 30-Jul-2019 22:30:26

587 Views

You can use update(). Let us first create a collection with documents −> db.addExtraFieldDemo.insertOne(    {       "_id": 1,       "UserName": "Larry" ,       "UserOtherDetails":[          {             "UserCountryName": "US",             "UserAge":23          },          {             "UserCountryName": "UK",             "UserAge":24          }       ]    } ); { "acknowledged" : true, "insertedId" : 1 }Following is the query to ... Read More

How to write data into BLOB and CLOB type columns in a table using JDBC?

Smita Kapse
Updated on 30-Jul-2019 22:30:26

3K+ Views

CLOB stands for Character Large Object. in general, an SQL Clob is a built-in datatype which is used to store large amount of textual data. Using this datatype, you can store data up to 2, 147, 483, 647 characters. MYSQL database provides support Clob datatype TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT.The java.sql.Clob interface of the JDBC API represents the CLOB datatype. Since the Clob object in JDBC is implemented using an SQL locator, it holds a logical pointer to the SQL CLOB (not the data).Inserting Data into a column of Clob typeYou can insert a CLOB type value using the setCharacterStream() or, ... Read More

C Program for cube sum of first n natural numbers?

Arnab Chakraborty
Updated on 30-Jul-2019 22:30:26

2K+ Views

In this problem we will see how we can get the sum of cubes of first n natural numbers. Here we are using one for loop, that runs from 1 to n. In each step we are calculating cube of the term and then add it to the sum. This program takes O(n) time to complete. But if we want to solve this in O(1) or constant time, we can use this series formula −AlgorithmcubeNNatural(n)begin    sum := 0    for i in range 1 to n, do       sum := sum + i^3    done    return ... Read More

Advertisements