Case Statement in Oracle PL/SQL

Write a SQL block that will categorize Employee Salaries. If the Salary is higher than average, it will show ‘Above Average’ to the output. If the Salary is lower than the average it will show ‘Below average’ to the output. Use HR.Employees Table. Also, utilize CASE statement.

SELECT employee_id,
       CASE 
           WHEN salary > (SELECT AVG(salary) FROM hr.employees) 
                THEN 'Above Average'
           WHEN salary < (SELECT AVG(salary) FROM hr.employees) 
                THEN 'Below Average'
           ELSE 'Average'
       END AS salary_comparison
FROM hr.employees
order by salary_comparison;

-- Ref: with a bit of information from the Internet

Variable Declaration Conventions in Oracle PL/SQL

Ref: https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.1/2-naming-conventions/naming-conventions/

3D Scatter Plot in Python

Visualizing 3-D numeric data with Scatter Plots

length, breadth and depth

Ref: https://towardsdatascience.com/the-art-of-effective-visualization-of-multi-dimensional-data-6c7202990c57

import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib as mpl
import numpy as np
import seaborn as sns
%matplotlib inline

fig = plt.figure(figsize=(8, 6))
ax = fig.add_subplot(111, projection=’3d’)

xs = wines[‘residual sugar’]
ys = wines[‘fixed acidity’]
zs = wines[‘alcohol’]
ax.scatter(xs, ys, zs, s=50, alpha=0.6, edgecolors=’w’)

ax.set_xlabel(‘Residual Sugar’)
ax.set_ylabel(‘Fixed Acidity’)
ax.set_zlabel(‘Alcohol’)

Other Visualizations of Wine Data

Univariate Analysis

tight_layout, 15 bins

Correlation Maps: Multivariate Analysis

Seaborn – Heatmaps

plot parallel coordinates

BOX Plot

Violin plot: sns.violinplot(x=”quality”, y=”sulphates”, data=wines, ax=ax) : Seaborn

3d Pairwise Scatter Plot

Images are taken from my own executions.

How to Disable SELinux

Ref: https://www.ibm.com/docs/en/tnpm/1.4.5?topic=tasks-disable-selinux-linux-only

Sample File:

selinux: getsebool -a sample output

getsebool -a | head


abrt_anon_write –> off
abrt_handle_event –> off
abrt_upload_watch_anon_write –> on
antivirus_can_scan_system –> off
antivirus_use_jit –> off
auditadm_exec_content –> on
authlogin_nsswitch_use_ldap –> off
authlogin_radius –> off
authlogin_yubikey –> off
awstats_purge_apache_log_files –> off

VPN (Business VPN) to connect to Corporate Network

Options:

Cisco Any Connect

Cisco Mobility Connect

You will be able to download from:

https://software.cisco.com/download/home

Versions available for Windows, Mac, and Linux.

Other Options:

OpenConnect

Global Protect

NordLayer


Using Anyconnect VPN on Linux:

https://www.cisco.com/c/en/us/support/docs/smb/routers/cisco-rv-series-small-business-routers/kmgmt-2597-Installing-AnyConnect-Linux-Ubuntu-desktop-User-Interface.html


Open Connect:

https://www.infradead.org/openconnect/download.html

NordLayer Business VPN:

https://nordlayer.com/business-vpn

“A VPN is a security solution that provides a tunnel between your organization’s resources and the employees accessing them. In essence, only employees connected to the VPN servers can access company resources on the network. Since this tunnel is encrypted end-to-end, businesses need not worry about unwanted access or visibility into their network — ensuring complete protection and anonymity of all traffic.” Ref: NordLayer Website

Fix the WordPress Issue: Could not reach wordpress.org Curl Error 7

It may solve provided Selinux is denying the access
setsebool -P httpd_can_network_connect on

How to fix mail command does not work?

yum install mailx

or

apt get install mailx

MVC in Java

•To get some details on MVC pattern, you may want to check:

https://www.javatpoint.com/mvc-architecture-in-java 

https://www.geeksforgeeks.org/mvc-design-pattern/ 

•An MVC Web Application (approach, minimum what we want)

https://www.baeldung.com/mvc-servlet-jsp

Java Spring MVC:

Learn to do it Step by Step in Eclipse

https://www.digitalocean.com/community/tutorials/spring-mvc-example

Ref: the link above

IntelliJ: Spring MVC

https://medium.com/panchalprogrammingacademy/create-a-spring-mvc-project-with-maven-and-intellij-idea-community-edition-1d31b3efe078

Java Spring MVC in Eclipse

https://www.digitalocean.com/community/tutorials/spring-mvc-example

Adapter Pattern

Ref: Google Images

If you have Access to Linkedin Courses: You can read from: It explains the diagram below i.e. how the adapter pattern works:

Explained the Diagram : https://www.linkedin.com/learning/programming-foundations-design-patterns-2/the-adapter-pattern-defined?autoSkip=true&resume=false&u=2199673

Check the code from here:

https://www.tutorialspoint.com/design_pattern/adapter_pattern.htm

A video example: The above will be easy to understand

https://www.linkedin.com/learning/programming-foundations-design-patterns-2/using-the-adapter-pattern?autoSkip=true&resume=false&u=2199673

Using MediaAdapter, AudioPlayer is accessing the methods of AdvancedMediaPlayer

Ref: https://www.tutorialspoint.com/design_pattern/adapter_pattern.htm

Proxy Design Pattern

Ref: Google

Proxy Pattern from Wikipedia

Class Diagram from Wikipedia

If you have access to Linkedin Courses, then the following Videos will be useful

https://www.linkedin.com/learning/c-sharp-design-patterns-part-3-2017/proxy-pattern-explained?u=2199673

https://www.linkedin.com/learning/c-sharp-design-patterns-part-3-2017/walk-through-proxy-pattern?autoSkip=true&resume=false&u=2199673