Thursday, June 2, 2022

Electron How to clear Cookies

session.defaultSession.clearStorageData([], (data) => {})

Note that the session has to be the one attached the browserwindow. So normally this data will be accessible only on the point where it is attached to the browser window. 

references:

https://stackoverflow.com/questions/37520322/electronjs-how-to-clear-all-cookies-from-a-session

HIPAA security officer requirements

 All Covered Entities and Business Associates are required by 45 CFR 164.308 – the Administrative Safeguards of the HIPAA Security Rule – to identify a HIPAA Security Officer who is responsible for the development and implementation of policies and procedures to ensure the integrity of electronic Protected Health Information (ePHI). The role of HIPAA Security Officer is often designated to an IT Manager due to the perception that the integrity of ePHI is an IT issue. However, this is not necessarily the case 
Although the Technical Safeguards of the HIPAA Security Rule relate to restricting access to systems on which ePHI is maintained and transmission security, only about 30% of a HIPAA Security Offer´s responsibilities are IT-related. The remainder of his or her responsibilities relate to training, auditing, incident management and overseeing Business Associate compliance. A HIPAA Security Officer is also responsible for facility security and the preparation of a Disaster Recovery Plan.
The Responsibilities of a HIPAA Security Office
The HIPAA Security Rule stipulates the person designated the role of HIPAA Security Officer must implement policies and procedures to prevent, detect, contain, and correct breaches of ePHI. Before developing the policies and procedures, the HIPAA Security Officer has to conduct and chronicle risk assessments to cover every element of the Security Rule´s Technical, Physical and Administrative Safeguards 

Once the risks to the integrity of ePHI have been identified, a HIPAA Security Officer must implement measures “to reduce risks and vulnerabilities to a reasonable and appropriate level to comply with 45 CFR 164.306(a)”. Employees have to be trained on any new work practices that are introduced and be informed of the sanctions for failing to comply with the new policies and procedures. In order to enforce the sanctions policy, a system of reviewing information system activity also has to be implemented

HIPAA Security Officer Job Description
A HIPAA Security Officer job description needs to outline the Officer´s responsibilities with regard to establishing and maintaining HIPAA-compliant mechanisms for ensuring the confidentiality, integrity and accessibility of healthcare information systems. These responsibilities will vary according to the nature and size of the organization, but should include:

Responsibilities for establishing, managing and enforcing the Security Rule safeguards and any subsequent rules issued by OCR.
Responsibilities for integrating IT security and HIPAA compliance with the organization´s business strategies and requirements.
Responsibilities for addressing issues related to access controls, business continuity, disaster recovery, and incident response.
Responsibilities for organizational security awareness, including staff training in collaboration with the HIPAA Privacy Officer.
Responsibilities for conducting risk assessments and audits – especially with regard to Business Associates and other third parties.
Responsibilities for investigating data breaches and implementing measures for their future prevention and/or containment.
in larger organizations, the HIPAA Compliance Team. There are many areas of the Security and Privacy Rules that overlap, and resources can be pooled to conduct risk assessments, manage employee training, and accelerate HIPAA compliance. A partnership between Security and Privacy Officers can also better oversee Business Associate compliance.

The HIPAA Privacy Officer Requirement
HIPAA Privacy Officers have been mentioned periodically throughout this article as it is required that, in addition to a HIPAA Security Officer, Covered Entities appoint a HIPAA Privacy Officer. The HIPAA Privacy Officer requirement is mandated by HIPAA and, depending on the nature and size of the organization, it is possible for the two roles to be combined into one.

The role of a HIPAA Privacy Officer is similar in some respects of that to a Security Officer as it involves conducting risk assessments, staff training, and managing Business Associate Agreements. However, a Privacy Officer will also be responsible for establishing, managing, and enforcing HIPAA-compliant policies and procedures to protect PHI in whatever format it is maintained.

references:
https://www.hipaajournal.com/hipaa-security-officer/

Angular how to pass in multiple arguments in emit()

 It allows only single parameter. We can pass an Object which contains multiple keys and values to avoid this issue. 

for e..g 

this.onSelection.emit({'key1' : 'value1', 'key2' : 'value2'})


Wednesday, June 1, 2022

What is difference between Object.Freeze and Object.seal



Both freeze and seal are used to create non extensible objects in JavaScript, but there are plenty of differences between them. Object.seal() allows changes to the existing properties of an object whereas Object.freeze() does not allow so. Object.freeze() makes an object immune to everything even little changes cannot be made. Object.seal() prevents from deletion of existing properties but cannot prevent them from external changes.


  // creates an object

    var obj = {

        // assigns 10 to value

        value: 10

    };

    // creates a non-extensible object

    Object.freeze(obj);

    // updates the value

    obj.value = 20;

    // but cannot change the existing value

    console.log(obj.value);




 // creates an object

    var obj = {

        // assigns 10 to value

        value: 10

    };

    // creates a non-extensible object

    Object.seal(obj);

    // the value gets updated to 20

    obj.value = 20;

    console.log(obj.value);




references:

https://www.geeksforgeeks.org/what-is-the-difference-between-freeze-and-seal-in-javascript/

Linear and Non Linear equations

Linear means something related to a line. All the linear equations are used to construct a line. A non-linear equation is such which does not form a straight line. It looks like a curve in a graph and has a variable slope value.

The major difference between linear and nonlinear equations is given here for the students to understand it in a more natural way. The differences are provided in a tabular form with examples.



Linear Equations

It forms a straight line or represents the equation for the straight line

It has only one degree. Or we can also define it as an equation having the maximum degree 1.

All these equations form a straight line in XY plane. These lines can be extended to any direction but in a straight form.

The general representation of linear equation is y = mx +c 


Non-Linear Equations

It does not form a straight line but forms a curve.

A nonlinear equation has the degree as 2 or more than 2, but not less than 2.

It forms a curve and if we increase the value of the degree, the curvature of the graph increases.

The general representation of nonlinear equations is ax2 + by2 = c


Tuesday, April 19, 2022

Dataframe tips

 You can get the type of the entries of your column with map:

df['ABC'].map(type)

So to filter on all values, which are not stored as str, you can use:

df['ABC'].map(type) != str


If however you just want to check if some of the rows contain a string, that has a special format (like a date), you can check this with a regex like:

df['ABC'].str.match('[0-9]{4}-[0-9]{2}-[0-9]{2}')


But of course, that is no exact date check. E.g. it would also return True for values like 0000-13-91, but this was only meant to give you an idea anyways.



Monday, April 11, 2022

Linear regression how to use scipy linear regress

Regression is when we want to examine relationship between variables

Linear regression uses the least square method.

The concept is to draw a line through all the plotted data points. The line is positioned in a way that it minimizes the distance to all of the data points.

The distance is called "residuals" or "errors".

Below are the main steps involved 

Import the modules you need: Pandas, matplotlib and Scipy

Isolate Average_Pulse as x. Isolate Calorie_burnage as y

Get important key values with: slope, intercept, r, p, std_err = stats.linregress(x, y)

Create a function that uses the slope and intercept values to return a new value. This new value represents where on the y-axis the corresponding x value will be placed

Run each value of the x array through the function. This will result in a new array with new values for the y-axis: mymodel = list(map(myfunc, x))

Draw the original scatter plot: plt.scatter(x, y)

Draw the line of linear regression: plt.plot(x, mymodel)

Define maximum and minimum values of the axis

Label the axis: "Average_Pulse" and "Calorie_Burnage"

import pandas as pd

import matplotlib.pyplot as plt

from scipy import stats

full_health_data = pd.read_csv("data.csv", header=0, sep=",")

x = full_health_data["Average_Pulse"]

y = full_health_data ["Calorie_Burnage"]

slope, intercept, r, p, std_err = stats.linregress(x, y)


def myfunc(x):

 return slope * x + intercept


mymodel = list(map(myfunc, x))


plt.scatter(x, y)

plt.plot(x, slope * x + intercept)

plt.ylim(ymin=0, ymax=2000)

plt.xlim(xmin=0, xmax=200)

plt.xlabel("Average_Pulse")

plt.ylabel ("Calorie_Burnage")

plt.show()




References:

https://www.w3schools.com/datascience/ds_linear_regression.asp