teleren/devto huggingface dataset:
Visualizing COVID Risk via ER Diagram
Tags: entityrelationship, er, database
Published: 2020-09-07 03:49:31

Hello!

As you guys would've probably heard in the past few months, times we are living in are quite uneasy. The COVID-19 pandemic has had a devastating impact on people all over the world, forcing many college students including myself to do their education virtually while also putting many people out of work or under that risk if not, and causing the death of almost 900K people around the world.

There are many risks and factors that play into the likelihood of an individual person or patient contacting the COVID-19, as well as the probability of recovery from the illness. In order to have ourselves be assured about the situation of the pandemic, I created a Diagram that displays many of the entities, relationships and attributes that can help understand the risk factors for COVID-19.

![COVID19 (1)](https://dev-to-uploads.s3.amazonaws.com/i/l7l3v3nhc6gy4w57yrev.png)

 
## Entities
The entities I chose are patient info, test (results & qualities), traits, hospital, and risk.

# Patient info
Patient describes the user and has the primary key of User ID. Primary keys are unique fields that identify each tuple of an entity. The said keys include geographic location, age, sex, and occupation. Sex and age are the typical categories you would expect in a medical statistics; but occupation and geographic location serve the more integral points. Notably, Korea’s method of tracking system is what can emphasize the importance of the patients’ occupation and geographic location. Occupations and places they live can help indicate any additional latent infectants. 

# Test
To be precise about test, I mean the quality of the COVID testing and the results. Quality is all about the accuracy of indicating the infection and result speed is set to indicate the amount of time to find the result, which is something that the medical institutions seek to minimize. Results is simply whether the test patient is negative or positive.

# Traits
Behavior describes how a patient behaves in their everyday life. Its primary key is also User ID because behavior will be unique to each user. It also contains a foreign key for occupation to reflect the relationship between occupation and behavior. Its relationship with patient is maintained through the shared primary key.

# Risk
Risk describes a patient's risk from Covid-19. It’s also a separate factor because it is unique to each user and is based on all of the other information. 

# Hospital
Hospital describes the characteristics of a hospital within a location. The foreign key for Location is used to form this link. Hospital has the primary key of name because hospital names tend to be very location specific; needless to say that each hospital is also unique with different number of beds and medical staffs so it is an important factor to put in the tuple.


{% youtube yiKhZDndy30%}
Entity Relationship Diagram for COVID-19. 
Published: 2020-09-07 03:49:06

Hello, and welcome to my second blog post! In this post, I'll be going over an ER Diagram for Covid-19 risk I was assigned to make. Here it is, pictured below. 

![Lab2](https://dev-to-uploads.s3.amazonaws.com/i/1s6g6q6vyj6lkn2q6ep3.jpg)
 
Also pictured below are example Tuples for each entity.
![exampletuple](https://dev-to-uploads.s3.amazonaws.com/i/vlmof38p09yfwb01sw8u.JPG)
 
## Entities 

In this post I'll be listing each entity and explaining both their attributes and their relationships.

### **Patient**
This entity contains data about the actual user. It consists of general information about them: their age, race, gender, and immediate family size. It also has a unique ID in case the user needs to be identified at any point. 

### **Location**
This entity is about where the user lives. It contains information about the country and state they live in, the population of their area, whether they're on lockdown or not, and what the risk level of their area is. 

### **Occupation**
This entity contains data about the user's job. It determines whether or not the user is in close contact with people during their job, if their job offers remote employment, how many other employees the user works with, how many hours a day the user works, and whether or not the job provides health insurance and what kind of health insurance at that.

### **Behavior**
This entity is about the behavior and habits of the user. Do they party a lot or are they consistently quarantining? Do they regularly wear a mask? How often do they go to public places? How often do they meet with friends and family?

### **Risk**
This is the entity that all of the other entities relate to, and describes the potential risk the user is at. It contains information on if the user has health issues and what kind, if the user's state is a hotspot, if the user's family is at risk, if the user's coworkers are at risk, and the amount of information the user has contact with.   

My intention with structuring the diagram the way I did was to lay out all of the basic information beforehand and converge it all into the "risk" entity at the end, to lay out the most important information there. 

{%youtube k5tixDnZMCs %}
Why session does not update for upload progress?
Published: 2020-09-07 03:47:28

```
<?php
session_start(); 
 if($_SERVER['REQUEST_METHOD']=='POST'){ 
   print_r($_SESSION);  
 }
?>
<!DOCTYPE html>
<html>
    <head></head>
    <body>
     <div class="min">
     <form action="<?php echo $_SERVER['PHP_SELF']?>" method="POST" enctype="multipart/form-data">
 <input type="hidden" name="<?php echo ini_get("session.upload_progress.name"); ?>" value="123" />
 <input type="file" name="file1" />
 <input type="submit" />
</form>
     </div>
    </body>
</html>
```

Hi Above is my HTML and PHP code and I want to be able to track upload progression. Above code does not work because session does not update. Can anybody help me with this? any help will be appreciated.
Covid 19 - Relationships and what do they mean?
Published: 2020-09-07 03:27:03

Hey guys HanSolotech here again. This time I have something very relevant to the current situation in the world.

#Covid 19 Diagram
This diagram shows the relationships between factors in the pandemic and I explain the exact relationships in my new video linked below.

These relationships need to be analyzed in terms of risk to decide when it is a good time to go back to normal (Hopefully soon)

Hope you all enjoy!

{% youtube Bdz0TwTEtUI %}
Caveat on Android in app browser
Tags: android, localstorage, inappbrowsers, androidappdevelopmen
Published: 2020-09-20 16:06:01

---
title: Caveat on Android in app browser
published: true
date: 2020-09-07 03:10:42 UTC
tags: android,localstorage,inappbrowsers,androidappdevelopmen
canonical_url: https://medium.com/@victorleungtw/caveat-on-android-in-app-browser-fd0e6fdf8a3a
---

When you’re developing a web application, you would need to consider browser compatibility issues. The problem I faced was an android in-app browser issue, which didn’t test while in development but launched in production, causing many thousands of failure transaction. There were no clear logs to troubleshoot the root cause and took me some time to figure out, so let me document this in hope to save you some time in the future.

When your end-users view your web app from a third party android in-app browser, you have no control over this webView, since it was provided by this third party. If they setJavaScriptEnabled(false) then it's pretty much end game for you. If luckily the frontend code still able to load, notice that, by default, setDomStorageEnabled is false. If you look at the documentation:

[https://developer.android.com/reference/android/webkit/WebSettings#setDomStorageEnabled(boolean)](https://developer.android.com/reference/android/webkit/WebSettings#setDomStorageEnabled(boolean))

This boolean flag is to sets whether the DOM storage API is enabled. The default value is false, so the WebView should disable the DOM storage API. This would cause a problem in your code execution, stopped and froze running at the line to include localStorage when you try to read the storage object in the browser.

[https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage)

The solution is simply to add a condition checking if (localStorage) {... available before you proceed with the code. This particular issue doesn't throw a meaningful error and you would have a hard time to troubleshooting log from the android in-app web view anyway as you would need to simulate this problem.

One tip to share is to download this tooling app to help you replicate the issue:

[https://play.google.com/store/apps/details?id=com.snc.test.webview2](https://play.google.com/store/apps/details?id=com.snc.test.webview2)

It is really useful and you can get a console log from this android in-app web view.

Another tip for you if you’re troubleshooting via server log, you can check the request header User-Agent Strings. You can differentiate the WebView by looking for the **wv** field in the example header below:

```
Mozilla/5.0 (Linux; Android 5.1.1; Nexus 5 Build/LMY48B; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.65 Mobile Safari/537.36
```

Hope this article help and save you time on this caveat.

_Originally published at_ [_https://victorleungtw.com_](https://victorleungtw.com/caveat-on-android-in-app-browser/) _on September 7, 2020._
Entity-Relationship Diagram for a Covid-19 Risk Dashboard
Published: 2020-09-07 00:01:57

I was tasked with creating an ER diagram for a theoretical Covid-19 risk dashboard. This is the diagram I created:


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/xrb384gtvi6vra2zet2f.png)


And here is a spreadsheet with tuples (a tuple is one row/record/entry):

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/yb20v4drt7s5zd70pl0p.png)


#Entities

The entities I chose are patient, occupation, behavior, location, hospital, and risk. 
##Patient

Patient describes the user and has the primary key of User ID. Primary keys are unique fields that identify each tuple of an entity. Patient also contains foreign keys for occupation and location to create a relationship between the entities. A foreign key is when an entity contains the primary key of another entity. 
##Occupation 

Occupation describes the patient's job and contains attributes that are relevant to the risk of contracting Covid-19. The primary key is a combination of company name and job title because the same job within the same company should be similar enough to not need individual entries.
##Behavior

Behavior describes how a patient behaves in their everyday life. Its primary key is also User ID because behavior will be unique to each user. It also contains a foreign key for occupation to reflect the relationship between occupation and behavior. Its relationship with patient is maintained through the shared primary key.
##Risk

Risk describes a patient's risk in general and from Covid-19. It also uses the primary key of User ID because it is unique to each user and is based on all of the other information. The User ID field links Risk to Patient.
##Location

Location describes the characteristics of a Patient's physical environment as well as relevant government policies. Its primary key is City/Town because any policies within the same city or town should be same.
##Hospital

Hospital describes the characteristics of a hospital within a location. The foreign key for Location is used to form this link. Hospital has the primary key of name because hospital names tend to be very location specific.

#Why This Layout?

I chose this layout in an attempt to maximize user convenience. The entities that use User ID as a primary key will be unique to each user, so the user will have to enter information manually for the patient and behavior entities(Risk would be generated by the dashboard). The other entities, however, could be shared by multiple users(patients), so if there is already an entry for an occupation, location, or hospital then the user will not have to enter in all of the information. Hospital's link to location also means that a list of known hospitals in that location can be generated after the user enters their location.

#A Video Discussing the Same Topic:
{% youtube UzK951XwCpU %}
Java/Angular Build Speed Improvements
Tags: java, typescript, angular, testing
Published: 2020-09-07 02:34:45

I've been inspired to fix our build times after watching:
{% youtube nRDlYvIbSBU%}
* http://dan.bodar.com/2012/02/28/crazy-fast-build-times-or-when-10-seconds-starts-to-make-you-nervous/


I'll be updating this as I investigate different techniques this week.

Here are a list of improvements and the effect they had on build times.

# Java & Spring Boot
## Spring lazy init
`spring.main.lazy-initialization=true`
This made the build twice as slow.. and broke the swagger tests as some of the endpoints didn't get instantiated.

## Logging
Reduce all logging to only log on WARN
`logging.level.root=WARN`

## Have a single "test" profile
The more profiles you have in tests, the more the spring DI ApplicationContext cache has to be reset. This can have a massive speed impact on your tests.

## Test Slices
https://www.baeldung.com/spring-tests#5-using-test-slices

## Turn integration tests into unit tests
This one requires considering that integration tests or "SpringBootTests" are really just testing that spring is configured correctly.
Most of the logic should be in fast unit tests.
Have maybe a single integration test 

# Typescript/Angular/Jest
## Switch to Jest
## Use @swc-node/jest
https://github.com/Brooooooklyn/swc-node
## Use babel for jest
Angular Error Explained: Expression Changed After It Has Been Checked Error
Tags: angular2, typescript, frontend, angular
Published: 2020-09-20 16:06:11

---
title: Angular Error Explained: Expression Changed After It Has Been Checked Error
published: true
date: 2020-09-07 02:29:41 UTC
tags: angular2,typescript,frontenddevelopment,angular
canonical_url: https://medium.com/@victorleungtw/angular-error-explained-expression-changed-after-it-has-been-checked-error-fcc2b057531c
---

A colleague of mine encounters an error message while developing an Angular frontend app. The error message is like this:

```
ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value 'null', Current value: 'true'.
```

The scenario for this error is when he’s developing a back button feature from the second page to the first page, where the first page is already rendered before, and need to re-render second time with different initial values.

The reason for this error is because, after each operation, Angular remembers what values it used to operate. They are stored in the oldValues property of the component view. After the checks have been done for all components, Angular then starts the next digest cycle, but instead of operating, it compares the current values with the ones it remembers from the previous digest cycle.

Note that this additional checking is only performed in the development mode. Angular enforce so-called unidirectional data flow from top to bottom. No component lower in the hierarchy is allowed to update the properties of a parent component after parent changes have been processed.

The possible solution of the above issues includes using async update, such as setTimeout or force change detection at ngAfterViewInit() with \_changeDetectorRef.detectChanges(), where the ChangeDetectorRef class has the following 5 methods:

```
abstract class ChangeDetectorRef {
  abstract markForCheck(): void
  abstract detach(): void
  abstract detectChanges(): void
  abstract checkNoChanges(): void
  abstract reattach(): void
}
```

So you can run change detection and update child view. My colleague was happy the error got resolved then after this explanation.

_Originally published at_ [_https://victorleungtw.com_](https://victorleungtw.com/angular-error-explained-expressionchangedafterithasbeencheckederror/) _on September 7, 2020._
Covid-19 ER Diagram
Published: 2020-09-07 01:50:46

Growing up with social media, millennial's have seen the consequences and repercussion that in can have in out day to day lives. This can include less face to face interactions, an easy distraction, and an outlet for exaggerated or fake news. As we are in the midst of a global-pandemic, behind covid, fake news is another thing that should not be spread around. In a recent discovery, there have been many misleading articles millennials  are reading which are causing an extreme response or no response at all to the safety precautions that are put in place by the local governments. 
Below is a diagram I created to show the various factors that each person should take into consideration when thinking about their risk of getting covid. 

**Entities and Relationships**
In the center of the diagram is the starting point- the person or potential patient. I placed this in the middle of the diagram because it is the main focus and the starting point to reading the chart. 
To the left of person, is the entity behavior. This is the activities in which the person is choosing to partake in throughout the pandemic. The more behaviors one takes part in, the more at risk one is to contracting the virus. 
Going back to the middle of the chart, to the right of person is the location entity. The location can effect how likely one is to getting covid if they choose to follow health guidelines. The stricter the rules, the less likely someone is to getting Covid. I chose to add two more entities to location because they are both effected by where the person is living. This includes where they work and the closest hospital they would go to if they needed to be placed into a hospitals care. The place in which they work is super important because it could keep them home or place them at a higher risk based on who they are in contact with on a day to day basis. 
The last entity I chose to relate to a person is how at risk they may be, without having anything to do with where they are or what they are doing. This includes prior health concerns, such as breathing issues (asthma), being immunocompromised, etc., other risks include age and hygiene- like washing hands often, using hand sanitizer. 

I chose to include entities that have strong relationships with the subject of the diagram. This is because it is more broad and can be applied to everyone and they can see the various factors that put one at risk of catching covid. 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/lk06fer6dc6ntmt20a5g.jpg)

Example tuple:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/eb5niv8gvk08d6cfib5j.jpg)

Here is a video of me talking about the diagram in more detail, enjoy!

https://drive.google.com/file/d/1BW_weNUvobht7iDQ64OJMjwmhuZXkIzA/view
I have a problem with Vue composition API
Tags: help, vue
Published: 2020-09-07 01:48:27

---
title: I have a problem with Vue composition API
published: true
tags: help, vue
---
Hi,
I'm trying to create a vue composable hook to toggle sidebar menu.

```js
import { reactive, toRefs } from '@vue/composition-api';

const useToggleMenu = () => {
  const state = reactive({
    isMenuOpen: true,
  });

  const toggleMenu = () => {
    state.isMenuOpen = !state.isMenuOpen;
  };

  return {
    ...toRefs(state),
    toggleMenu,
  };
};

export default useToggleMenu;
```
the problem I'm facing is when using `isMenuOpen` state in one component (ex: Layout), and use `toggleMenu` in another component (ex: BurgerMenu).

```js
// BurgerMenu.vue

import { useToggleMenu } from '../hooks';

export default {
  name: 'BurgerMenu',
  setup() {
    const { toggleMenu } = useToggleMenu();
    return {
      // use this in template to show/hide menu.
      toggleMenu,
    };
  },
  
  ...
};
```

```js
// Layout.vue

import { useToggleMenu } from '../hooks';

export default {
  name: 'Layout',
  setup() {
    const { isMenuOpen } = useToggleMenu();

    return {
      // use this in template to add some classes to <body>
      isMenuOpen,
    };
  },
};
  
  ...
};
```

the issue is when I click burger menu and trigger the `toggleMenu` function, that does not make any change! the `isMenuOpen` boolean is not reactive.

I hope that is clear, and thanks to anyone trying to help.
First Dev Post
Tags: beginners, firstyearincode, webdev, javascript
Published: 2020-09-07 01:10:26

So, how exactly does this work?
I'm really not sure yet but I'd like to give this a go.

My name is Chidera, a self-taught webdev from Lagos, Nigeria. Passionate about accessibility(#a11y). I'm really just trying to learn the ropes of this software development thing, but no doubt in my mind its gonna be great. Hope to write a lot more of my thoughts on here and maybe even track my progress with beginner-perspective articles(more than open to corrections on that)

So far, so good. no regrets, we move lol. 

PS: Already familiar with HTML, CSS, JS( vanilla and React path).  What technologies would you recommend i try out? #a11y libraries, testing, SSG, etc. I'm open to new ideas
Where We Are: Mapping Our Dystopia
Tags: database, beginners, erdiagram
Published: 2020-09-07 00:32:17

Hey.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/tuf5n88b4phjnol6y24f.png)

See that? It's a diagram! An _**entity relationship diagram.**_ Wow. Well, thanks for checking it out, I'll...

Okay. Okay, yeah, I'll explain.

This diagram exists to help map out the relationships between several components that are related to the COVID-19 crisis. It's a great visual for understanding the basis of an SQL database as well. We use these diagrams to see what acts on what, what attributes does what have, and how much of what is acting on what.

What.

In a database, these connections exist to help relate entities, and each entity can be used to represent what may be a table of data in an SQL database. A primary use would be to understand... well, primary keys. Keys are used to identify each unique tuple (row) in a data table. After all, if all the data started looking the same, it would be hard to understand what you were looking at. Primary keys ensure that the data for each tuple is meaningful.

If any of these terms are starting to sound foreign, then no worries, foreign keys exist too.

I'm sorry.

You'll see these keys as attributes (columns) assigned to one entity, and their relation back to a primary key from another entity.

Keys are the heart of connections for SQL, and in these next two videos, we'll discuss these topics and how they're stored, connected, and understood in an SQL world, and maybe, you'll find your place in this crazy world of reality as well.

<a href="http://www.youtube.com/watch?feature=player_embedded&v=BqR43Nw2SUQ
" target="_blank"><img src="http://img.youtube.com/vi/BqR43Nw2SUQ/0.jpg" </a>

<a href="http://www.youtube.com/watch?feature=player_embedded&v=HjDjvHRk3xs
" target="_blank"><img src="http://img.youtube.com/vi/HjDjvHRk3xs/0.jpg" </a>

With all that said, you can throw yourself in and think: Where am I, in this world of risks? Would my behavior correlate to them? There's plenty of connections all around, and you can be a key part of someone else's world. **You** can represent a part of this dystopia. But don't see yourself as a patient, and definitely don't try to become one. Just realize that this isn't an isolated world. We're in this together.

We'll be delving back into this diagram next time, and I hope you all stay safe out there: the risks aren't as bad as long as you know how to keep yourself safe.

Sources:

1. https://www.guru99.com/er-diagram-tutorial-dbms.html
2. https://www.texmed.org/uploadedFiles/Current/2016_Public_Health/Infectious_Diseases/309193%20Risk%20Assessment%20Chart%20V2_FINAL.pdf