Articles on Trending Technologies

Technical articles with clear explanations and examples

How to sort volley elements in android?

Ankith Reddy
Ankith Reddy
Updated on 29-Jun-2020 201 Views

This example demonstrate about How to sort volley elements 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.     In the above code, we have taken text view to show sorted volley elements.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.widget.TextView; import android.widget.Toast; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.StringRequest; import com.android.volley.toolbox.Volley; import org.json.JSONArray; import org.json.JSONException; ...

Read More

How to sort volley json array based on id in android?

Ankith Reddy
Ankith Reddy
Updated on 29-Jun-2020 571 Views

This example demonstrates How to sort volley JSON array based on id 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.     In the above code, we have taken text view to show sorted custom object.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.widget.TextView; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.StringRequest; import com.android.volley.toolbox.Volley; import org.json.JSONArray; import ...

Read More

How to remove non-alphanumeric characters in PHP stirng?

Alok Prasad
Alok Prasad
Updated on 29-Jun-2020 3K+ Views

We can remove non-alphanumeric characters from the string with preg_replace() function in PHP. The preg_replace() function is an inbuilt function in PHP which is used to perform a regular expression for search and replace the content.syntaxpreg_replace(pattern, replacement, subject, limit, count )Let's discuss the parameters of the function underneath.patternThis parameter contains the pattern to search for.replacementIt is a mandatory parameter. This parameter may contain a string or an array with strings to replace.subjectThe string or an array with strings to search and replace.limitThe maximum possible replacements for each pattern in each subject stringcountThis is an optional parameter, if specified then this ...

Read More

How to convert an array to SimpleXML in PHP?

Alok Prasad
Alok Prasad
Updated on 29-Jun-2020 4K+ Views

We can solved the above problem using array_walk_recursive() function.array_walk_recursive()   is an inbuilt PHP function. This function converts array to XML document where keys of the array are converted into values and values of the array are converted into the element of XML.Let' demonstrate with a simple example.ExampleOutput alex account michigan NoteIf errors message display like PHP Fatal error: Uncaught Error: Class 'SimpleXMLElement' not found in then simply install php-xml, php-simplexml packages.

Read More

Can we use LIKE and OR together in MySql?

Vrundesha Joshi
Vrundesha Joshi
Updated on 29-Jun-2020 18K+ Views

You can use LIKE with OR operator which works same as IN operator.Let us see the syntax for both the cases −Case 1 − Using Like with OR operator.select *from yourTableName where yourColumnName Like ‘Value1’ or yourColumnName Like ‘Value2’ or yourColumnName Like ‘Value3’ . . . NCase 2 − Using IN operator.select *from yourTableName where IN(value1, value2, value3, .....N);To understand both the syntaxes, let us create a table. The query to create a table is as follows −mysql> create table LikeDemo −> ( −> Id varchar(20) −> ); Query OK, 0 rows affected (0.58 sec)Now you can insert records in ...

Read More

UPDATE column to append data into it in MySQL?

Arjun Thakur
Arjun Thakur
Updated on 29-Jun-2020 2K+ Views

To achieve this, the following is the syntax.UPDATE yourTableName set yourColumnName=concat(ifnull(yourColumnName, ””), ’anyValue1, anyValue2, anyValue);To understand the above syntax, let us first create a table. The query to create a table is as follows -mysql> create table AppendDataDemo -> ( -> StudentId int, -> StudentName varchar(100), -> StudentAge int -> ); Query OK, 0 rows affected (1.54 sec)Insert some records in the table using insert command. The query is as follows.mysql> insert into AppendDataDemo values(101, 'John', 23); Query OK, 1 row affected (0.24 sec) mysql> insert into AppendDataDemo values(102, null, 24); Query OK, 1 row affected (0.74 sec) ...

Read More

MySQL Sum Query with IF Condition using Stored Procedure

Rishi Rathor
Rishi Rathor
Updated on 29-Jun-2020 862 Views

The Sum() is an aggregate function in MySQL. You can use sum query with if condition. To understand the sum query with if condition, let us create a table.The query to create a table −mysql> create table SumWithIfCondition    −> (    −> ModeOfPayment varchar(100)    −> ,    −> Amount int    −> ); Query OK, 0 rows affected (1.60 sec)Insert some records in the table using insert command. The query is as follows −mysql> insert into SumWithIfCondition values('Offline', 10); Query OK, 1 row affected (0.21 sec) mysql> insert into SumWithIfCondition values('Online', 100); Query OK, 1 row affected ...

Read More

CSS3 Multi-Column rule-width Property

Priya Pallavi
Priya Pallavi
Updated on 29-Jun-2020 165 Views

The multi-column rule-width property is used to specify the column width. You can try to run the following code to implement rule-width property using CSS: Example                     .multi {             /* Column count property */             -webkit-column-count: 4;             -moz-column-count: 4;             column-count: 4;                          /* Column gap property */             -webkit-column-gap: 40px;             -moz-column-gap: 40px;             column-gap: 40px;                          /* Column style property */             column-rule-style: solid;             column-rule-color: #ff00ff;                          /* Colum width property */             -webkit-column-rule-width: 5px;             -moz-column-rule-width: 5px;             column-rule-width: 5px;          }                                Tutorials Point originated from the idea that there exists a class of readers who respond          better to online content and prefer to learn new skills at their own pace from the comforts          of their drawing rooms. The journey commenced with a single tutorial on HTML in 2006 and          elated by the response it generated,  we worked our way to adding fresh tutorials to our          repository which now proudly flaunts a wealth of tutorials and allied articles on topics          ranging from programming languages to web designing to academics and much more.           

Read More

Rotate div with skew x-axis using CSS

Priya Pallavi
Priya Pallavi
Updated on 29-Jun-2020 195 Views

You can try to run the following code to rotate div with skew x-axis using CSS − Example                     div {             width: 300px;             height: 100px;             background-color: pink;             border: 1px solid black;          }          div#skewDiv {             /* IE 9 */             -ms-transform: skewX(20deg);             /* Safari */             -webkit-transform: skewX(20deg);             /* Standard syntax */             transform: skewX(20deg);          }                                Qries.com                        Qries.com           

Read More

How to Check if PHP session has already started?

Alok Prasad
Alok Prasad
Updated on 29-Jun-2020 4K+ Views

In PHP, we utilize session_start() an inbuilt function to start the session .But the problem we face in a PHP script is if we execute it more than once it throws an error. So here we will learn how to check the session started or not without calling session_start() function twice.There are two ways to follow to resolve this problem.For below PHP 5.4.0 version.ExampleExplanationIf the session not started this code above will always start the session in the PHP script.In the second method, we can utilize the function session_status(), which returns the status of the present session. This function can ...

Read More
Showing 47881–47890 of 61,248 articles
Advertisements