Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Server Side Programming Articles - Page 1579 of 2650
4K+ Views
Executor framework are designed using thread pool concept. Thread pool is the way to reuse the already created thread instead of creating a new thread every time to execute the current task.Executors class provides a factory method to create thread pools. The ThreadPoolExecutor class is the base implementation for the executors that are returned from many of the Executors factory methods.Sr. No.KeyFixed Thread PoolCached Thread Pool1BasicAs per Java Doc −Creates a thread pool that reuses a fixed number of threads operating off a shared unbounded queue. At any point, at most nThreads threads will be active processing tasks. If additional ... Read More
2K+ Views
Executor and ExecutorServices both interfaces are part of the Executor framework. It is released with Java 5. In java, thread creation is very expensive operation so we should reuse the available thread instead of starting a new thread every time and we can achieve the same using Executor framework.Executor framework use the thread pool to execute the task parallel which helps to optimize response time and resource utilization. It provides four types of built in thread pools −Fixed Thread PoolCached Thread PoolScheduled Thread PoolSingle Thread ExecutorSr. No.KeyExecutorExecutorServices1BasicIt is a parent interfaceIt extends Executor Interface2MethodIt has execute() methodIt has submit() method3Return TypeIt ... Read More
7K+ Views
Runnable and Callable both functional interface. Classes which are implementing these interfaces are designed to be executed by another thread.Thread can be started with Ruunable and they are two ways to start a new thread: one is by subclassing Thread class and another is implementing Runnable interface.Thread class does not have constructor for callable so we should use ExecutorService class for executing thread.Sr. No.KeyRunnableCallable1PackageIt belongs to Java.langIt belongs to java.util.concurrent2Thread CreationWe can create thread by passing runnable as a parameter.We can’t create thread by passing callable as parameter 3Return TypeRuunable does not return anythingCallable can return results4.MethodIt has run() methodIt ... Read More
6K+ Views
Java Collections framework is used for storing and manipulating group of data. It is an in-memory data structure and every element in the collection should be computed before it can be added in the collections.Stream API is only used for processing group of data. It does not modify the actual collection, they only provide the result as per the pipelined methods.Sr. No.KeyCollectionsStreams1BasicIt is used for storing and manipulating group of dataStream API is only used for processing group of data2PackageAll the classes and interfaces of this API is in the Java.util packageAll the classes and interfaces of this API is ... Read More
152 Views
When the number of categories is large in numbers for a variable and we want to create a bar plot then the display of the bar plot becomes a little ambiguous because the bars are plotted very close to each other. To make the bars clearly visible, we can reduce the width of the bars and set different colors for them to make them visually attractive.geom_bar(width=0.2,color="red")Consider the below data frame −x
5K+ Views
When we find the summary statistics of a data frame then the output is returned as a table and each of the column records the minimum, first quartile, median, median, third quartile, and maximum with their names. If we want to save this summary as a data frame then it is better to calculate it with apply function and store it as data.frame.ExampleConsider the below data frame − Live Demox1
2K+ Views
In data analysis, often we require to determine the minimum and maximum values because these values help us to understand the limits of a column or variable under consideration. This can be done by using which.max for maximum and which.min for minimum with single square brackets to extract the rows.ExampleConsider the below data frame − Live Demox1
2K+ Views
When we join or combine plots using grid.arrange the scales of the first plot comes in between as X-axis even if the independent variable in both of the plots is same.Therefore, we might want to remove the space between the plots while joining to get only one X-axis. This can be done by using theme function.ExampleConsider the below data frame − Live Demoset.seed(123) x
375 Views
When we create a plot in R and draw gridlines then the gridlines are drawn on the basis of the values provided inside the grid function, therefore, it may or may not match with the Y-axis labels. But it can be done, we just need to set the values inside the grid function to NULL.ExampleConsider the below plot − Live Demox
9K+ Views
Sometimes we need to create extra variable to add more information about the present data because it adds value. This is especially used while we do feature engineering. If we come to know about something that may affect our response then we prefer to use it as a variable in our data, hence we make up that with the data we have. For example, creating another variable applying conditions on other variable such as creating a binary variable for goodness if the frequency matches a certain criterion.ExampleConsider the below data frame − Live Demoset.seed(100) Group