### Detect Outlier using Boxplot in Java

`import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;`
```public boolean isOutlier(String itemId, String value) {

if (monitoringItem.getProperties().getBoxPlotSize() > 0) {
BoxPlot boxPlot = Statics.boxPlotRepository.findByItemId(itemId);

DescriptiveStatistics descriptiveStatistics = new DescriptiveStatistics();
double dValue = Double.parseDouble(value);

for (ItemBoxPlot bItem : boxPlot.getBoxPlotList()) {
double d = Double.parseDouble(bItem.getValue());

}

double Q1 = descriptiveStatistics.getPercentile(25);
double Q3 = descriptiveStatistics.getPercentile(75);
double IQR = Q3 - Q1;

double highRange = Q3 + 3 * IQR;
double lowRange = Q1 - 3 * IQR;

if (dValue > highRange || dValue < lowRange) {
return true;
}
}

return false;
}```

### Detect Outlier using Boxplot

Order the data from least to greatest then calculate these values:

• Q1 – quartile 1, the median of the lower half of the data set
• Q2 – quartile 2, the median of the entire data set
• Q3 – quartile 3, the median of the upper half of the data set
• IQR – interquartile range, the difference from Q3 to Q1
• Extreme Values – the smallest and largest values in a data set

Outliers

In order to be an outlier, the data value must be:

• larger than Q3 by at least 1.5 (some times 3) times the interquartile range (IQR), or
• smaller than Q1 by at least 1.5 (some times 3) times the IQR.

### Nesting in Bootstrap Grid System

To nest your content with the default grid, add a new `.row` and set of `.col-sm-*` columns within an existing `.col-sm-*` column. Nested rows should include a set of columns that add up to 12 or fewer (it is not required that you use all 12 available columns).

```<div class="container">
<div class="row">
<div class="col-sm-9">
Level 1: .col-sm-9
<div class="row">
<div class="col-8 col-sm-6">
Level 2: .col-8 .col-sm-6
</div>
<div class="col-4 col-sm-6">
Level 2: .col-4 .col-sm-6
</div>
</div>
</div>
</div>
</div>```

### Offsetting columns using Margin utilities in Bootstrap

```<div class="container">
<div class="row">
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4 ml-auto">.col-md-4 .ml-auto</div>
</div>
<div class="row">
<div class="col-md-3 ml-md-auto">.col-md-3 .ml-md-auto</div>
<div class="col-md-3 ml-md-auto">.col-md-3 .ml-md-auto</div>
</div>
<div class="row">
<div class="col-auto mr-auto">.col-auto .mr-auto</div>
<div class="col-auto">.col-auto</div>
</div>
</div>```

### Offsetting columns using Offset classes in Bootstrap

```<div class="container">
<div class="row">
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4 offset-md-4">.col-md-4 .offset-md-4</div>
</div>
<div class="row">
<div class="col-md-3 offset-md-3">.col-md-3 .offset-md-3</div>
<div class="col-md-3 offset-md-3">.col-md-3 .offset-md-3</div>
</div>
<div class="row">
<div class="col-md-6 offset-md-3">.col-md-6 .offset-md-3</div>
</div>
</div>```

### See detailed information about a given PID on Linux

`ps -Flww -p THE_PID`

### How can a Java program get its own pid

`long pid = ProcessHandle.current().pid();`

### Install new Fonts on Ubuntu Server

`apt install fontconfig`
`cp -R ~/arial /usr/share/fonts/truetype/`
`sudo fc-cache -f -v`

### Update Angular

```npm uninstall -g angular-cli
npm cache verify
npm install -g @angular/cli@latest
```

on Linux :

`sudo npm install -g @angular/cli@latest --unsafe-perm=true --allow-root`
`ng update @angular/cli @angular/core`

### obtaining pid of a python script inside the script itself

```import os

print "This process has the PID", os.getpid()```