How the Tech Industry Manipulates Its Customers

Anuradha Nanda
Updated on 30-Jul-2019 22:30:25

108 Views

Did you know all the articles you read about the reviews of a particular product: about its pros, cons, and ratings from some popular, so-called "authentic and genuine" tech blogs are actually,  just paid ones?In fact, because of these people, the articles with the original product review are pushed to the very end of the priority line by the big tech companies, that can’t seem to get enough affirmation to their success. In some cases, there is no place left for constructive criticism. As you know, criticism also plays an important part in the improvement of technology and its impact on the consumer. ... Read More

ShortBuffer toString Method in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25

160 Views

A string that provides the buffer state in a summary can be obtained using the method toString() in the class java.nio.ShortBuffer. This method requires no parameters and it returns the buffer state in a summary using a string.A program that demonstrates this is given as follows −Example Live Demoimport java.nio.*; import java.util.*; public class Demo {    public static void main(String[] args) {       int n = 5;       try {          ShortBuffer buffer = ShortBuffer.allocate(n);          buffer.put((short)12);          buffer.put((short)91);          buffer.put((short)25);       ... Read More

Programs Using Interface Modules

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

552 Views

We use a logic controller and it is used in industry for the process of control done by the software. Multiple inputs are typically accepted which performs a total complete sequence of operations carried out both arithmetic and logically. The outputs generated are used for the maintenance of the process within the specified desired limits. Visual display is provided by the state of process at any instant of time. The logic controller which interfaces and thus provides a buffered output of 12 lines and which is fed to the buffer inputs of 12 lines only specified for the user. The ... Read More

Get Longest VARCHAR Length in MySQL

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

4K+ Views

To get the longest varchar length, you need to use CHAR_LENGTH().The syntax is as followsSELECT Max(CHAR_LENGTH(yourColumnName)) AS anyAliasName FROM yourTableName;To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table CharLengthDemo    - > (    - > Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    - > Sentence varchar(255)    - > ); Query OK, 0 rows affected (0.60 sec)Insert some records in the table using insert command.The query is as followsmysql> insert into CharLengthDemo(Sentence) values('Java is an object oriented programming language' - > ); Query OK, 1 row ... Read More

LocalDateTime plusMinutes Method in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25

154 Views

An immutable copy of a LocalDateTime object where some minutes are added to it can be obtained using the plusMinutes() method in the LocalDateTime class in Java. This method requires a single parameter i.e. the number of minutes to be added and it returns the LocalDateTime object with the added minutes.A program that demonstrates this is given as follows −Example Live Demoimport java.time.*; public class Demo {    public static void main(String[] args) {       LocalDateTime ldt = LocalDateTime.now();       System.out.println("The current LocalDateTime is: " + ldt);       System.out.println("The LocalDateTime with 15 minutes added is: ... Read More

Convert IntStream to String in Java

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

497 Views

If you have IntStream with ASCII values, then easily convert it to string using the below given example.For IntStream class, import the following packageimport java.util.stream.IntStream;Let’s say the following is our IntStreamIntStream stream = "Example".chars();Now, convert the IntStream to stringString str = stream.collect(StringBuilder::new,    StringBuilder::appendCodePoint,    StringBuilder::append).toString();The following is an example to convert IntStream to String in JavaExampleimport java.util.stream.IntStream; class Demo {    public static void main(String[] args) {       IntStream stream = "Example".chars();       System.out.println("The ASCII values...");       String str = stream.collect(StringBuilder::new,       StringBuilder::appendCodePoint,       StringBuilder::append).toString();       System.out.println("The ... Read More

IntStream mapToLong Method in Java

Daniol Thomas
Updated on 30-Jul-2019 22:30:25

725 Views

The mapToLong() function in IntStream class returns a LongStream consisting of the results of applying the given function to the elements of this stream.The syntax is as follows.LongStream mapToLong(IntToLongFunction mapper)Here, the parameter mapper is a stateless function to apply to each element.Create an IntStream with some elements in the Stream.IntStream intStream = IntStream.of(50, 100, 150, 200);Now create a LongStream and use the mapToLong() with a condition.LongStream longStream = intStream.mapToLong(num → (long)num);The following is an example to implement IntStream mapToLong() method in Java.Exampleimport java.util.*; import java.util.stream.IntStream; import java.util.stream.LongStream; public class Demo {    public static void main(String[] args) {     ... Read More

Make Full Screen Custom Dialog in Android

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

3K+ Views

This example demonstrate about How to make full screen custom dialog.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 button. When user click on button, it will show custom dialog.Step 3 − Add the following code to src/MainActivity.javapackage com.example.andy.myapplication; import android.app.Activity; import android.graphics.Rect; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.view.WindowManager; import android.widget.Button; ... Read More

Add 10 Minutes to MySQL Datetime Format

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

392 Views

Use DATE_ADD() to add 10 minutes to datetime format. Following is the syntax −select date_add(yourColumnName ,interval 10 minute) from yourTableName;Let us first create a table −mysql> create table add10MinuteDemo    -> (    -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> DelayDatetime datetime    -> ); Query OK, 0 rows affected (0.83 sec)Following is the query to insert records in the table using insert command −mysql> insert into add10MinuteDemo(DelayDatetime) values('2019-01-23 12:45:56'); Query OK, 1 row affected (0.16 sec) mysql> insert into add10MinuteDemo(DelayDatetime) values('2019-03-25 10:30:23'); Query OK, 1 row affected (0.19 sec) mysql> insert into add10MinuteDemo(DelayDatetime) values('2019-04-21 04:04:30'); Query ... Read More

Get MySQL DISTINCT to Work Correctly with Whitespace

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

187 Views

To get distinct including whitespace, you can use below syntax −SELECT DISTINCT replace(yourColumnName, ' ', '') FROM yourTableName;Let us first create a table:mysql>create table DemoTable (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    Name varchar(20) ); Query OK, 0 rows affected (0.63 sec)Insert some records in the table using insert command −mysql>insert into DemoTable(Name) values('John '); Query OK, 1 row affected (0.14 sec) mysql>insert into DemoTable(Name) values(' John '); Query OK, 1 row affected (0.14 sec) mysql>insert into DemoTable(Name) values('John'); Query OK, 1 row affected (0.09 sec) mysql>insert into DemoTable(Name) values('Sam'); Query OK, 1 row affected (0.15 sec) ... Read More

Advertisements