teleren/devto huggingface dataset:
ABSOLUTE AND RELATIVE LENGTH UNITS
Tags: webdev, beginners, programming, css
Published: 2022-03-11 19:27:04

Several CSS properties take “Length” values, such as width, padding, font size, margin, etc. The Length values are used to set the size of an element or space an element in a web page. 
The two main types of length units used in CSS are absolute and relative. Understanding how these two units work is important for styling web pages using CSS.

Absolute Length Units
Absolute Length units describe physical units of length. They approximate the actual size of an element on the screen and are not relative to any other element or measurement. Absolute Length Units include centimeters(cm), millimeters(mm),  inches(in),  pixels(px), points(pt) and picas(px). 

The absolute length units are fixed and a length expressed in any of these will appear as exactly that size when displayed. The only value that you will commonly come across is px (pixels). The others are more useful for print.

Absolute Units are not recommended for use on screens because they will look the same whether on desktop, tablet, or mobile, and will not change along with the viewport’s dimensions, making it impossible to build responsive web pages.

Relative Length Units 
Relative length units specify a length relative to another length property which for example could be the size of the viewport or the size of the parent element’s font. Relative length units are useful for making responsive websites. 

They scale relative to a parent or the viewport and allow for websites to adapt style sheets from one environment to another, such as from mobile to desktop.
Some of the most useful relative units for web development are listed in the table below

![relative length units](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qe1cyu3je7cnxvxi8pwz.png)
                                      
em and rem are the two relative lengths you are likely to encounter most frequently when sizing elements.
It is good practice for web developers to set length values using relative length units rather than absolute units. This makes it easier to manipulate the size of elements, easily halving or doubling the size instead of setting explicit values.

Thanks for reading!
Sum an array in python
Tags: python
Published: 2022-03-11 19:21:47

An array may be a collection of things keep in contiguous memory locations. the idea is to store multiple items of constant kind together. This makes it easier to calculate the position of every part by merely adding Associate in Nursing offset to a base worth eg. memory location of the primary element of the array (usually indicated by the name of the array).

For simplicity, we can think of an array as a fleet of stairs where a value is placed on each step (say one of your friends). Here you can identify the location of any of your friends just by knowing the number of steps they are on. The array can be managed in Python by a module called array.They can be useful when we need to manipulate only values of a specific data type. A user can treat lists like tables.

However, the user cannot constrain the type of items stored in a list.

In this Python programming post I will teach you how to obtain the sum of all the elements of an array, as well as obtain the average of it.

Explanation of the algorithm
Once the matrix is defined, all we have to do is use for into go through the arrays or rows that the matrix has (since a matrix is an array of arrays, or list of lists).

In each route of the row, we simply go through each element of it, where we will already have the true value. It is right here when we are increasing the counter of elements and we are adding to the sum.

Finally we obtain the average, which would be to divide the sum of all the elements by the number of them.

Python source code
Now that I have explained how it works, let's look at the code for the exercise:

"" "

https://kodblems.com/posts

"" "

matrix = [

[7.8, 2.5, 10],

[20, 15.2, 12],

[89, 9, 6.77],

]

# All we do is add all the values and divide them by the total elements

# Note: if the matrix is a "square" matrix then you could just use

# len (matrix) * len (matrix [0])

elements = 0

sum = 0

for row in matrix:

for element in row:

sum + = element

elements + = 1

average = sum / elements

print (

f is "The sum is {summation} and the average is {average}, for the matrix that has {elements} elements"

)
We go through the entire matrix in line 15 , then we go through each element of the row in line 16 and this is where we increase the summation and the element count.

Hope it helps.
Create Portfolio in 2 minutes
Tags: nextjs, webdev, javascript
Published: 2022-03-11 19:21:23

Hey guys check out [DevFolio](https://devfolio.kumard3.me) which can create your portfolio with just one username in just a minute . Which you can also customise it . 
![description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wjaho6xo1bj90f5yeudt.gif)
Use notepad++ for java
Tags: notepad, java
Published: 2022-03-11 19:21:08

Java, like many other programming languages, is written in plain text. So if you want to write and compile a Java script on your computer, you can use Notepad, the plain text editor. Java files are compiled when run through the Java runtime environment and therefore in Notepad all you need is to save the file correctly. Once created, it is opened from the command line via Java, and the script compiled.


Instructions
Click "Start", "All Programs", "Accessories", "Notepad".

Enter your Java code in Notepad.

Click "File", "Save As". Click the "Save as type" drop-down and select "All files."

Name your file and type ".java" to give it a java extension. Save this in the Java directory. Running this from the command line will compile the script on the fly.

Notepad ++ is a very versatile editor that can help us to program in multiple programming languages, even with code files or plain text that we want to modify thanks to its powerful regular expression engine. But this will not be the case for this post.

To configure Notepad ++ so that it can work with the Java machine, for this we must have the Oracle JDK distribution installed and configured correctly.

Guidelines
Once we have the editr open we go to the menu bar, and select the Run option

Once the option is open.

In the present case, it will be the compiler and the one that executes the Java program that we have created.

In the options, if we select one that conflicts with any that we already have, the same configurator will sing it to us.

If the error appears that the javac command is not recognized, we must see that in the system variables (path), we have the Java jdk / bin path configured well.

Hope this will help you.
Nodename nor Servname provided,or not known
Tags: node, server
Published: 2022-03-11 19:18:00

That error demonstrates an organisational issue that happened eventually in the form cycle, yet it ought to (apparently here) be irregular and uncommon. If you see it, re-running the form is the most ideal alternative; on the off chance that you experience it more than once, if it's not too much trouble, open a help ticket or connect!


Problem
That blunder isn't coming from the example code, yet a web search on the bit of the mistaken text that you've given and some testing I did recommends that it's a systems administration issue (explicitly probable name goal).

I went through the cloning, building, and execution of that example without blunder. Then, at that point purposely provided terribly

&bull;    installed and tried ssh on my home organization.

&bull;    Set a static IP for my pi.

&bull;
Set up a Powerful DNS administration and introduced the product on my pi. I referred to these guidelines for setting up the static IP, and there are a lot more informative assets out there.

Solution
Likewise, I set up a port forward on my switch for facilitating a site and I had even port forward port 22 to my pi's static IP for ssh, yet I left the field clear where you indicate the application you are playing out the port sending for on the switch. In any case, I added 'ssh' into this field and, Presto! A working ssh association from anyplace to my pi.

I worked out my switch's port sending settings.

(ApplicationTextField)_ssh (outside port)_22 (Inner Port)_22 (Protocol)_Both (To IP Address)_192.168.1.### (Enabled)_checkBox

Port forward

ssh - p 22 myName@hostname

or on the other hand:

ssh - l myName - p 22 hostname
Hope this post helped you!
How to check if a certificate matches a private key in spring boot api
Published: 2022-03-11 19:03:35

I have a spring boot API, the client is passing a certificate in the header. How do I check if that certificate matches a private key on the API side? I am trying to do cert-based authentication. My scenario is as mentioned in [Spring boot x509 testing - pcf](https://stackoverflow.com/questions/53315857/spring-boot-x509-testing-pcf)[](https://stackoverflow.com/questions/53315857/spring-boot-x509-testing-pcf). In Cloud Foundry my client certificate is forwarded to my spring boot API and needs to read out the header and validate the cert against the private key if valid allow access else reject. Any help is appreciated

Thanks
Si eres desarrollador de Javascript debes conocer esta extensión de VS Code
Tags: javascript, programming, productivity, node
Published: 2022-03-11 18:53:01

Me enamoré de esta extensión de vsCode y en este post te mostraré por qué.
La extensión es [Node.js Notebooks (REPL)](https://marketplace.visualstudio.com/items?itemName=donjayamanne.typescript-notebook).

Si quieres:

- Probar la salida de tu código javascript.
- Conocer el tiempo de ejecución de la compilación (ms)
- Previsualizar las librerías
- Ejecutar parte del código
- Ver el rendimiento de tu código

Esta extensión vscode es para ti!.

![Node.js Notebooks (REPL)](https://res.cloudinary.com/practicaldev/image/fetch/s--kNjYfNY1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://raw.githubusercontent.com/DonJayamanne/typescript-notebook/main/images/REPL.gif)
 
![Node.js Notebooks (REPL)](https://res.cloudinary.com/practicaldev/image/fetch/s--77sCZVXU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://raw.githubusercontent.com/DonJayamanne/typescript-notebook/main/images/demo.gif)

Gracias por leer mi artículo, he escrito otros artículos y puedes verlos en la barra de la derecha .
Connecting devices together!
Tags: webdev, computerscience, tutorial, programming
Published: 2022-03-11 18:36:30

## Sock Idea
- [Organization](https://github.com/Sock-Net)

Sock is a idea, not a code. "Sock" allows you to connect to channels and communicate with other instances. Everyone can make his own "Sock" and "Sock Client". Or you can use [Lightweight Sock Server](https://github.com/Sock-Net/sock) to host a Sock.

## Why Websockets?
Simple, websocket is easy to use in browser. This allows you to host a "Sock" server and manage sock to communicate between back-end and front-end easily.

## Why Not?
Not recommended for embedded devices. But still, [Lightweight Sock Server](https://github.com/Sock-Net/sock) only uses 2MB ram.

## Making a Sock Server
To make a sock server, you must have these routes:
- `/channel/:channel` (WebSocket): This route is where we connect our clients.
- `/api/channel/:channel/:id` (HTTP): This route allows us to get a instance from channel
- `/api/channel/:channel` (HTTP): This route allows us to get all instances from channel

And you must write-read a object that has:
- `type` (int): Type for the instance. Every client has their own types.
- `data` (string): This key can hold any data.
- `from` (string): For see who sent the message.

If type is less than zero (0), Message is for pinging server to keep connection alive.

If type is equals to zero (0), Message is for getting current instance id.

Please check [Lightweight Sock Server](https://github.com/Sock-Net/sock) to understand how it works.

## Making a Sock Client
And you can make a sock client that allows anything... For example, you can make a sock client that allows to run a python code in channel and send output to other instances.

We made a client that uses "Sock" to send files and data between instances. Check it [here](https://github.com/Sock-Net/sockc)

Please check [Sockc](https://github.com/Sock-Net/sockc) to understand how it works.

## Finishing
You can star project if you liked it!
Template Driven Approach In Angular Forms
Tags: javascript, beginners, tutorial, vscode
Published: 2022-03-11 17:54:00

## How to start with TDA in Angular??

First Step:Make sure you import FormsModule in your AppModule

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bv4q9w51hb3bho4vm7q2.png)
Day-42 Training At Ryaz:Unit Testing
Tags: webdev, node, github, javascript
Published: 2022-03-11 17:49:06

Date:11/01/2022
Day:Friday

Today, I started at about 10:40 am as I was done till eleven modules and now I was to start with twelfth module i.e unit testing so, I started with it and in the beginning the instructor started with automated testing as we think of it we seem or we think that it is an alternative of manual testing but in language of instructor it was the practice of writing the code to test our code, and then run those test in an automated fashion as our source code would consist of two codes one is application code another would be test code as we can understand with an example that if we have written an function and having different attributes in it and returning some value so, if we manually test it we need some interface or we have to initialise it on browser and
we may have to login in it soothes way we can test it manually so, main use of automated testing is as we test our application again and again the cost of testing keeps on increasing so, this may pinch the programmer so, automation of testing is important so, in automated testing we pass certain return values so, it is tested every time when we make some changes after this instructor started with types of testing i.e unit ,integrational ,functional testing further he started with testing numbers, strings,arrays. soothes way my day ended up and I got to learn many new things.
The Great GatsbyJS Bootcamp
Tags: javascript, react, graphql, gatsby
Published: 2022-03-11 17:34:49

## What is GatsbyJS? 🔒

Gatsby is a framework for creating blazing fast websites and web applications. Powered by React and GraphQL, Gatsby gives you everything you need to build and launch your next project.

## Deployed: 🤯
https://bootcampdynasty.com/

## Version Control + Documentation 🤐
https://github.com/JavascriptDon/The-Gatsby-Bootcamp

## License: 📝
This project is under The BSD Zero Clause License (0BSD). See the [LICENSE](https://bootcampdynasty.com/) for more information.

## Contributions
Contributions are always welcome...

🔹 Fork the repository
🔹 Improve current program by
🔹 improving functionality
🔹 adding a new feature
🔹 bug fixes
🔹 Push your work and Create a Pull Request
My Coding Career Journal
Tags: webdev, programming, career
Published: 2022-03-11 17:32:49

I have completed the first year of my career in an IT company back in Jan 2022. What I learned in that year is, everybody is still learning, and that never ends. There is always something new to learn.

Being a constant listener of [Cal Newport](https://calnewport.com) I was always attracted towards the idea of ["So Go They Can't Ignore You"](https://www.calnewport.com/books/so-good/).

So here's my career goal - I want to gain an advanced level of knowledge in just a single area. As Cal says in the book, "so good they can't ignore you".  
I know it's a long journey and it takes years to gain advanced skills and knowledge in a particular area. It takes deliberate practice and discipline.

I have dabbled with web development during college but never went the distance with it. Also, I very much enjoyed creating websites. But I decided to learn it back from square one. I'm following [The Odin Project](https://theodinproject.com) curriculum as it's very much project-oriented.

Today I have completed the first submission on TOP. A basic HTML website. 
[Repo](https://github.com/iamhrk/odin-recipes) 
[Preview](https://iamhrk.github.io/odin-recipes/)

Also started reading the [Coding Career Handbook](https://learninpublic.org/) 

I will continue to write this journal every day. Even if what I learn is a small thing, I will try to journal that here. 

As Shawn says in his [book](https://learninpublic.org/)- this is a marathon and not a sprint.
From the FAANG to the MAANA
Tags: discuss, thoughts, web2, faang
Published: 2022-03-11 17:29:23

"**FAANG**" is a popular acronym that refers to the _stocks of five prominent American technology companies_: _Meta_ (formerly known as **Facebook**), **Amazon**, **Apple**, **Netflix** and _Alphabet_ (formerly known as **Google**).

The term FANG was coined by _Bob Lang_ (of Explosive Options) with commentator _Jim Cramer_ (host of Mad Money on CNBC), in 2013, who praised these companies for being _“totally dominant in their markets”_.
<small>_Read: [https://www.cnbc.com/id/100436754](https://www.cnbc.com/id/100436754)_</small>
<small>_Lang tells the story: [https://www.youtube.com/watch?v=WMEfOg0mowA](https://www.youtube.com/watch?v=WMEfOg0mowA)_</small>

Originally, the term "FANG" was used, with Apple (the second “A” in the acronym) added in 2017.
___

With **Meta** and **Alphabet** coming along, time for a new acronym...

<center>
##Let's name it MAANA!##
</center>

![From FAANG to MAANA](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i88mhrqgwq7j18ac33bz.png)

**Mana** in its traditional sense means _power_, _authority_, _ownership_, _status_, _influence_... 

> In Melanesian and Polynesian culture, mana is the spiritual life force energy or healing power that permeates the universe. Anyone or anything can have mana. It is a cultivation or possession of energy and power, rather than being a source of power. It is an intentional force.
>
> <small>Source: [https://en.wikipedia.org/wiki/Mana](https://en.wikipedia.org/wiki/Mana)</small>





And **māna** has some obvious _pictorial meaning_ when speaking about _companies that are totally dominant_ in their markets.

> In Māori culture, there are two essential aspects of a person's mana: mana tangata, authority derived from whakapapa (genealogy) and mana huaanga, defined as "**authority derived from having a wealth of resources to gift to others to bind them into reciprocal obligations**".
> 
> <small>Source: [https://en.wikipedia.org/wiki/Mana](https://en.wikipedia.org/wiki/Mana)</small>

___

Some of you may work for one of those companies.

So?
**Do you have _maana_?**


_________________
Let's connect on [Twitter](https://twitter.com/cyrezdev).
<small>_Illustrations by Cyril Rezé_</small>
What is CSS Box Model ? Complete guide on Box model — Margin, Padding, Border & Content
Tags: css, html, webdev, beginners
Published: 2022-03-11 17:28:50

Hello there 👋! hope you are doing great. Today, in this article we’ll discuss about CSS box model. We’ll talk about what it is ? and how we can take advantage of it. So let’s start.

#📌What is CSS Box Model ?

![image](https://miro.medium.com/max/1372/1*Kzm-mZhkQ3P08MBhCVID3g.png)

CSS Box Model is basically a box which wraps around each HTML element. It consists of all the spaces — margins, paddings, border and the actual content itself.

Okay so it is a combination of margin, padding, border and content but what are these ??

→ Margin — This is a space outside the elements.

→ Padding — This is the space inside the element or content.

→ Border — As the name suggests, it is a border after padding not content.

→ Content — And the last, it is the actual content could be any HTML element from text to image to video to everything.

![image](https://miro.medium.com/max/1400/1*TuK7CYAq8Aui3ufdc2UOIQ.png)

It is a very simple concept of CSS but often we forget about this. So this is all about it, but let’s understand this better with 1 example 👇

![image](https://miro.medium.com/max/1400/1*5wZ-MqkzgiFpsiqfKGkmOQ.png)

If you see the above image, If I ask you what is the width of our content. Its 100px right?

And you are right, its width is 100px but is it covering only 100px of the screen, I don’t think so. Let’s do some calculation to check

![image](https://miro.medium.com/max/1400/1*hpwyUyTsLmq8PQtfoiIueg.png)

So you see its actual width is 100px but it is covering 150px.

So you just saw, it doesn’t matter really what’s a content width is, when we want to do some serious design where every px matters. So that’s why CSS Box model visualise us the correct spacings so that we can design website very precisely.

That’s it. This was all about CSS Box Model. I hope you got each and every point and made this concept very clear to you. Still if you have any doubt you can ask me in comments or you can contact me on my [Instagram](https://www.instagram.com/modern_web_channel/).

And if you want to master you web dev skills, you can checkout my [YouTube](https://www.youtube.com/c/modernweb?sub_confirmation=1) channel. I make very helpful coding tutorials. With that all 😎

Thanks for reading. Have a nice day
Get Phone Number Details Using Python
Tags: programming, python, opensource
Published: 2022-03-11 17:27:10

**Get Any Phone Number Details Using `phonenumbers` Python Library**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ylhtxdeksf3diid7gjg0.png)

**1- Import Library : **

```
import phonenumbers 
```

**2- import modules **

```
from phonenumbers import carrier , geocoder , timezone 
```

**3- Prompt User ** 

```
Number = input('Please Enter Your Number With Country Code : ')
```

**4- Parse User Input **

```
Number = phonenumbers.parse(Number)
```

**5- Print Timezone **

```
print(timezone.time_zones_for_number(Number))
```

**6-Print Phone Number Carrier  : **

```
print(carrier.name_for_number(Number,"en"))
```

**6-Print Phone Number Country : **

```
print(geocoder.description_for_number(Number , "en"))
```

**7-Check Phone Number Validity : **

```
print('Valid Mobile Number : ',phonenumbers.is_valid_number(Number))
```