teleren/devto huggingface dataset:
Sustainability Best Practices - AWS Well-Architected Framework Study Guide
Published: 2022-03-03 15:15:21

[Return to Well-Architected Framework Guide](https://dev.to/aidutcher/aws-well-architected-framework-study-guide-introduction-fjg)

[**Region Selection**](https://docs.aws.amazon.com/wellarchitected/latest/framework/sus-region-selection.html)
- Choose Regions based on both business requirements and sustainability goals
- Ask:
     - How do you select Regions to support your sustainability goals?

[**User behavior patterns**](https://docs.aws.amazon.com/wellarchitected/latest/framework/sus-user-behavior-patterns.html)
- Scale infrastructure with user load
- Eliminate creation and maintenance of unused assets
- Optimize geographic placement of workloads for user locations
- Optimize team member resources for activities performed
- Ask:
     - How do you take advantage of user behavior patterns to support your sustainability goals?

[**Software and architecture patterns**](https://docs.aws.amazon.com/wellarchitected/latest/framework/sus-software-architecture-patterns.html)
- Optimize software and architecture for asynchronous and scheduled jobs
- Remove or refactor workload components with low or no use
- Optimize areas of code that consume the most time or resources
- Optimize impact on customer devices and equipment
- Use software patterns and architectures that best support data access and storage patterns
- Ask:
     - How do you take advantage of software and architecture patterns to support your sustainability goals?

[**Data patterns**](https://docs.aws.amazon.com/wellarchitected/latest/framework/sus-data-patterns.html)
- Implement a data classification policy
- Use technologies that support data access and storage patterns
- Use lifecycle policies to delete unnecessary data
- Minimize over-provisioning in block storage
- Remove unneeded or redundant data
- Use shared file systems or object storage to access common data
- Back up data only when difficult to recreate
- Ask:
     - How do you take advantage of data access and usage patterns to support your sustainability goals?

[**Hardware patterns**](https://docs.aws.amazon.com/wellarchitected/latest/framework/sus-hardware-patterns.html)
- Use the minimum amount of hardware to meet your needs
- Use instance types with the least impact
- Use managed services
- Optimize your use of GPUs
- Ask:
     - How do your hardware management and usage practices support your sustainability goals?

[**Development and deployment**](https://docs.aws.amazon.com/wellarchitected/latest/framework/sus-development-deployment-patterns.html)
- Adopt methods that can rapidly introduce sustainability improvements
- Keep your workload up to date
- Increase utilization of build environments
- Use managed device farms for testing
- Ask:
     - How do your development and deployment processes support your sustainability goals?

[Return to Well-Architected Framework Guide](https://dev.to/aidutcher/aws-well-architected-framework-study-guide-introduction-fjg)
The Code Blue App
Tags: healthcare, apps, congressionalappchalleng, javascript
Published: 2022-03-03 15:10:26


# [TheCodeBlueApp](https://thecodeblueapp.com)
### A Code Blue, When Every Second Counts
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nz3iz4x4092u853ychzn.png)
----
[thecodeblueapp.com](https://thecodeblueapp.com)
### What is The Code Blue App?
The Code Blue App is a tool made for hospital staff to use during a code blue. This app helps them time the actions in a code blue to the American Heart Association's ® recommendations. It is simple to use and records the data needed for hospital records.
### What is a Code Blue?
When a person experiences respiratory or cardiac failure, it is typically called a code blue. During a code blue a combination of physical, electrical, and chemical interventions are used to resuscitate the patient.
### Who Created The Code Blue App?
This app was developed by Jace Billingsley for the Congressional App Challenge 2021. His father is a respiratory therapist, and he participates in resuscitation efforts very frequently. Many times, the documentation efforts in a code blue are not as detailed and accurate as is needed. This app can assist any healthcare provider to deliver better lifesaving efforts during a code blue.

----

# Specifications

### Frontend + Backend
The Code Blue App's frontend is created in javascript. This runs the timers on the page, manages the data of the page, and more. 
The Code Blue App's backend is an [expressjs](https://expressjs.com) webserver running on [Node.js](https://nodejs.org). These return the correct pages when accessing a webpage on [thecodeblueapp.com](https://thecodeblueapp.com)

### Features
- The Code Blue App offers timers for medication and pulse checks. The default medications listed are: Epinepherine, Amiodarone, Atropine, Adenosine, and Lidocaine. Additionally, there is an "Other Med" button for medications not listed.
- After a code a preview of the codes logs is shown on all devices, and a file is downloaded on computers containing the time the code started, time of events, details of events, etc.
- The Code Blue App has a Start Code button, an End Code Button, and a ROSC Obtained button. Both the End Code and Rosc Obtained buttons will end the code blue, however in the log file they will show different outcomes. ROSC Obtained means "Return of Spontaneous Circulation," meaning the patient has been resuscitated successully. The End Code button will show in the file the code has ended, but the patient has not been resuscitated.
- [app.thecodeblueapp.com/autostart](https://app.thecodeblueapp.com/autostart) will automatically start the code whenever the webpage is openend.

### Features to Come
- Medication Count.
- Active Code Log below pulse check section.
- Better UI and mobile design.
- More helpful features for use in a code blue.


# Contact
### Website
You can view my website at [jacebapps.com](https://jacebapps.com)

### Email
You can email me at [jacebapps@outlook.com](mailto:jacebapps@outlook.com)
Arrays in JS
Tags: computerscience, interview, programming, beginners
Published: 2022-03-03 15:09:13

# Array

An array organizes items sequentially, one after another in memory.

## Syntax

```
const array_name = [item1, item2, ...];   
```

Each position in the array has an index, starting at 0.

## **Strengths:**

Fast lookups. 
Retrieving the element at a given index takes O(1)O(1) time, regardless of the length of the array.

Fast appends. 
Adding a new element at the end of the array takes O(1)O(1) time, if the array has space.

## **Weaknesses:**

Fixed size. 
You need to specify how many elements you're going to store in your array ahead of time. (Unless you're using a fancy dynamic array.)

Costly inserts and deletes. 
You have to "scoot over" the other elements to fill in or close gaps, which takes worst-case O(n)O(n) time.

Some languages (including Javascript) don't have these bare-bones arrays.

```
const cars = ["Saab", "Volvo", "BMW"];

//or

const cars = [];
cars[0]= "Saab";
cars[1]= "Volvo";
cars[2]= "BMW";

//or

const cars = new Array("Saab", "Volvo", "BMW");

```



STAY TUNED FOR NEXT BLOG, HOPEFULLY IT WILL LONGER THAN THIS xD 

Thanks for reading <3
Sustainability Design Principles and Definition - AWS Well-Architected Framework Study Guide
Published: 2022-03-03 15:03:46

[Return to Well-Architected Framework Guide](https://dev.to/aidutcher/aws-well-architected-framework-study-guide-introduction-fjg)

[**Sustainability**](https://docs.aws.amazon.com/wellarchitected/latest/framework/sustainability.html)
- Focuses on environmental impacts, especially energy consumption and efficiency
- These are important levers for architects to inform direct action to reduce resource usage

[**Design Principles**](https://docs.aws.amazon.com/wellarchitected/latest/framework/sus-design-principles.html)
- Understand your impact
- Establish sustainability goals
- Maximize utilization
- Anticipate and adopt new, more efficient hardware and software offerings
- Use managed services
- Reduce the downstream impact of your cloud workloads

[**Definition**](https://docs.aws.amazon.com/wellarchitected/latest/framework/sus-def.html)
- Six best practice areas 
     - Region selection
     - User behavior patterns
     - Software and architecture patterns
     - Data patterns
     - Hardware patterns
     - Development and deployment process

[Return to Well-Architected Framework Guide](https://dev.to/aidutcher/aws-well-architected-framework-study-guide-introduction-fjg)
What are Jupyter Notebooks?
Published: 2022-03-03 14:57:39

Welcome to this section using [Jupyter](http://jupyter.org/) notebooks. The notebook is a web application that allows you to combine explanatory text, math equations, code, and visualizations all in one easily sharable document. You can view a few more tutorial notebooks at [Gravitational Wave Open Science Center homepage](https://www.gw-openscience.org/tutorials/).
Notebooks have quickly become an essential tool when working with data. 

You'll find them being used for [data cleaning and exploration](http://nbviewer.jupyter.org/github/jmsteinw/Notebooks/blob/master/IndeedJobs.ipynb), visualization, [machine learning](http://nbviewer.jupyter.org/github/masinoa/machine_learning/blob/master/04_Neural_Networks.ipynb), and [big data analysis](http://nbviewer.jupyter.org/github/tdhopper/rta-pyspark-presentation/blob/master/slides.ipynb).

Typically you'd be doing this work in a terminal, either the normal Python shell or with IPython. Your visualizations would be in separate windows, any documentation would be in separate documents, along with various scripts for functions and classes. However, with notebooks, all of these are in one place and easily read together.

Notebooks are also rendered automatically on GitHub. It’s a great feature that lets you easily share your work. There is also http://nbviewer.jupyter.org/ that renders the notebooks from your GitHub repo or from notebooks stored elsewhere.

## Literate Programming

Notebooks are a form of [literate programming](http://www.literateprogramming.com/) proposed by Donald Knuth in 1984. With literate programming, the documentation is written as a narrative alongside the code instead of sitting off by its own. In Donald Knuth's words,

> Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do.

After all, code is written for humans, not for computers. Notebooks provide exactly this capability. You are able to write documentation as narrative text, along with code. This is not only useful for the people reading your notebooks, but for your future self coming back to the analysis.

Just a small aside: recently, this idea of literate programming has been extended to a whole programming language, [Eve](http://www.witheve.com/).
Paracetamol.js💊| #69: Explica este código JavaScript
Tags: javascript, spanish, beginners, webdev
Published: 2022-03-03 14:33:03

## **Explica este código JavaScript**

```js
const banda = {
  id:1,
  nombre: "Radiohead",
  "tipo de musica": "Rock",
  albunes: ["Pablo Honey", "Ok Computer", "In Rainbows"]
};

console.log(banda["nom"+"bre"])
```

A. `Radiohead`
B. `undefined`
C. `nombre`
D. `SyntaxError`

Respuesta en el primer comentario.

---
First Class Functions
Published: 2022-03-03 14:44:54

> A programming language is said to have First-class functions when functions in that language are treated like any other variable.

Functions are also called first-class objects, this means that functions should have all the properties which object haves.

**The properties a first-class function have are:**


1. 
A function can be assigned to a variable. Following is the code explaining that.

```
#Defining a function square
def square(num):
    return num*num
#assinging function to a variable
x=square #now x is same as square and we can treat x as a function
print (square)
print(x)
#both print statements will have same results
#calling the functions
print(square(2)) # output-4
print(f(2))#output-4


``` 



2. 
A function can be passed as an argument to other functions.

```
#defining a function
def multiple_of_two(num):
    return 2*num


#defining another function
def my_func(func, a_list_of_integers):

    result=[ ] #creating an empty list which will be used later in function
    for i in a_list_of_integers:

        result.append(func(i))
    return result # each element of list is passed as an argument to "func" function
#and the output of that function is then added to "result"


multiplication = my_func(multiple_of_two, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])

print(multiplication) #output-[2, 4, 6, 8, 10, 12, 14, 16, 18, 20]

``` 

3. A function can be returned from other functions.


```
def greetings(name):
    def greet():
        print("Hi "+msg)
        return
    return greet #returning greet function from greetings function


my_func = greetings("xyz")
my_func() #calling the function


```
security tip for your website
Tags: vps, cybersecurity, devops, devjournal
Published: 2022-03-03 14:37:40

Attackers can easily exploit your web app if they know the version of the server you are running and most web servers like nginx transmit this data by default😳. Let's try the following line of code in any terminal to get your domain's server info.
 ```
curl --head yourdomain.com
```
My result looks like so..
```
HTTP/1.1 301 Moved Permanently
Server: nginx/<SERVER_VERSION>(<OPERATING_SYSTEM>)
Date: Thu, 03 Mar 2022 13:46:14 GMT
Content-Type: text/html
Content-Length: 162
Connection: keep-alive
Location: https://jast-tech.com/
```
you might be using apache, no worries i gat you😌

Our simple task now is to hide the `<SERVER_VERSION>`

1. FOR NGINX
edit the nginx configuration file
```
nano /etc/nginx/nginx.conf
```
Under the #HTTP Options line and before the ## line, add the following
```
server_tokens off;
```
save changes with `ctrl` + `x` and we are done😜
restart your server with `sudo systemctl restart nginx` and you can try `curl --head yourdomain.com` to get your server version.

2.FOR APACHE
edit the apache configuration file
```
nano /etc/httpd/httpd.conf
```
change `ServerTokens Prod` and `ServerSignature Off`
now one more step, look for
```
<Location "/server-status">
    SetHandler server-status
</Location>
```
and change it to
```
<Location "/server-status">
    SetHandler server-status
    Order deny,allow
    Deny from all
</Location>
```
😛We are done, just restart your server with `sudo service apache2 restart`
Enjoy. 👋🏿
Web3; Better Than Web2?
Tags: web3, blockchain, web2
Published: 2022-03-03 14:24:38

**Web 3.0** has been a major buzzword for sometime now, as a programmer or someone in tech, especially blockchain, you must have come across it a whole lot of times, and if you're like me, you must have wondered what exactly it is about and probably done some research, chances are that it's that research that brings you to this article.
So, to best understand web3, I think it's very important to have a
basic knowledge of the evolution of the web, the functionalities, 
differences and similarities of its various versions.

**Web 1.0** is the first iteration and a read only version of the web, this means users had a very limited input on it. it's not interactive, not responsive, users can only take, not give. No feedback, comments, tagging, etc.

Whereas in **Web 2.0**, users can interact and have a public opinion on the information they've received, they can even give out their own information. Web2 is more of a social version of the web, it's very interactive and community focused.

Now that brings us to **Web 3.0**, which is, or will be a decentralized version of the web. Decentralization of the web allow users to have more control over the data and information they give out, unlike in web2 where the big corporations like google, facebook, twitter, etc. controls and gate-keeps these data in their own private servers.

Asides decentralization, there are other few known differences between web 2.0 and 3.0. personally I regard web3 as a more secured and user focused version of web2.

Some of the other known differences are:
**Technology;** Web3 leverage on artificial intelligence and machine learning to offer smarter applications than those available in web2. Also, it enables users to capitalize on the vast potential of 3D visuals and graphics.
Another very important feature of the web3 technology is the semantic web functionality, which implies that the web can understand words just like humans does and this will lead to easier discovery, analysis and sharing of information on the web.

Please note that there are so many characteristics embedded in the 
decentralized feature of web3 that makes it standout from web2. 
Some of these characteristics are;
- Security
- Privacy
- Verifiability
- Self-governing
- Permission-less
- Distribution and robustness
- Native built-in payments, etc.



**Web 3.0** is the future of the internet but it is not without its own downsides and challenges. I'd discuss some of these challenges in my next article, do follow and watch out for it.

If you'd like to learn how to solve problems using blockchain technology, which is an integral part of web3, please checkout [Blockgames](https://blockgames.gg/), an 8-week intensive program, training developers to shape the future of web3.
**Blockgames** is powered by [Nestcoin](https://nestcoin.com/) in partnership with the amazing team at [Zuri](https://zuri.team/).
Why wording is critical on your to-do list 
Tags: productivity, beginners, codenewbie, startup
Published: 2022-03-03 14:07:43

Your brain really likes to think as little as possible. Thinking might be it's job, but the brain also is a bit lazy or busy sometimes. 

Clear wording on your to-do list reduces the thinking-work your brain needs perform before taking care of your tasks. 

So if you provide clear wording, you (and your brain) will be more willing to work on your to-dos - because they are less work to think of.

If your to-do is looks like that: 

> Call doctor

you and your brain will need to think a lot about it before finally doing it. What doctor do I need to call? And why? Is there anything wrong with me?

A better way of writing that to-do would be: 

> Call Doctor Smith and schedule a control appointment for March

You could just call the doctor whenever you read the to-do. No need of thinking about it again.

For all of my to-dos, I try to explain them as clear as possible. No matter if I write tasks for my personal to-do list or for my projects at work, if the tasks are explained and worded well, it is much easier to work on them for me. 

At the beginning, it was hard for me to have clear, explaining wording on my to-dos. It seemed a bit strange to explain what to do next to myself. I mean, I already know that? 

What helps me here is to imagine that I write the to-do for someone else. 

In Austria and Germany, we have the tale of “Heinzelmännchen” (hine-cell-man-ken for my english-speaking friends). 

You can imagine them as santa’s elves for personal use. They will come at night and do all of the work you couldn’t finish throughout the day. 

In the classic tale, those little friends helped a shoemaker. They visited his shop and found a lot of unfinished shoes and boots on the floor. So they decided to help the shoemaker out and finished all of the shoes and boots for him.

Imagine, those little elves would come to your desk to help you out. There are no unfinished tasks lying around on the floor. You are working on your computer all day. So they start your computer, hack the password and open your to-do-list-app. 

What a pity! They have no idea what to work on. They are wondering: 

> "What does all of that mean?"  

Nothing is explained or clear, everything is confusing. Sorrowful, they leave your desk again without helping you. They are sad. You are sad. No happy end. If you only had well-explained and clear to-dos on your list!

Even if this might be a bit childish, I try to keep that in mind. If the “Heinzelmännchen” ever visit my office, they will find a clear-worded, well-explained to-do list to work on. No chance I will miss the opportunity of free workforce. 

And if they won't come around, I still have a to-do list my brain likes to work on. Because the to-dos are so clear, even elves would understand.
Why you should favour named functions in place of anonymous functions at callback
Tags: node, javascript
Published: 2022-03-03 14:05:22

Hello there! It's your cap again!

Recently, when I learn more about functions in JavScript, I found something who get my attention. In this blog [post](https://dmitripavlutin.com/6-ways-to-declare-javascript-functions/) from Dmitri Pavlutin, he explain why favour name function expressions in place of anonyumous functions at callbacks.

At first, it's a simple thing I said. But, I make a small experiment to test this behavior.

I created two functions, with same behavior: make a division by an undefined variable.

Let's check the first scenario, using anonymous function:
![Anonymous function declaration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d8e774cn5cgyniv86tzz.png)

Here, I create an arrow function on map callback. When the function test has been executed, we can see an error stack with various <anonymous>:
![Anonymous function error stack](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3vwzjt12ff2o2bputk4j.png)

It's a little bit hard to understand what happen.

So let's check the second scenario. We can watch the map callback function is named function expression declared as `divide`.

![Named expression function](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ryxc48xtospwzr1xkn77.png)
 
When the function has been executed, we can see after reference error the name of function has triggered the error:

![Named expression function error](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2hpghx4w84pkrrgi6dhw.png)

So, which scenario is easier to debug?

Imagine you have have this function called inside one, two, three levels of functions. Which one it's easier now?

My point here, after all of it: use wisely the named expression functions. It's a debug time saver and maintain your code cleaner.
Python Functions ....
Tags: python
Published: 2022-03-03 14:03:45

Function 1:

**len()** -> This function is used to find the length of string.

string_name = ("Hello")
print(len(string_name))

Output : 5

This function will not execute int or float values.

**Round** -> As the name suggest it round the floating point values.

          If value>0.5 = 1
          else value < 0.5 = 0 
Example:
1.6 is return as 2
1.1 is return as 1.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/50y3apqksc4ab0adk7xn.png)
 
**Lower()** -> "Dev".lower()then it return "dev"
**Count** -> "Dev".count("e") then it count and return 1.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/osfuse4wx7chiu7kogxr.png)
objectrender issue in log4j 2.17
Published: 2022-03-03 13:54:10

we are using log4j for logging the message in our application and we are upgarading from log4j 1.x to log4j 2.17.2 using bridge option.
we are using appenders (rollingfileappender, consoleappender, fileappender) and layouts (xmllayout, patternlayout) and able to get most of the messages as expected but unable to use Obectrender as we have used in log4j 1.x to log message according to user specified criteria, below is the foramt we used to configure in log4j 1.x configuration file
<renderer renderedClass="com.util.logging.EpnyMessage" renderingClass="com.util.logging.EpnyMessageRenderer"/>

could you please suggest me how to use objectrender in log4j2.17.2.