teleren/devto huggingface dataset:
Understanding binary numbers and how to convert decimal numbers to binary
Tags: binary
Published: 2022-09-15 22:20:32

We all know 10 based numbering system which has numbers from 0-9
And when we think of numbers we think about decimal numbers but have you asked yourself how a computer “thinks” about numbers?
So essentially computer consists of many small “processors” which can only process one thing whether there is a signal or there is not, and in order to communicate with the computer we created a binary numbering system that consists of two numbers:1(on) and 0(off) 
The computer can do complex tasks by doing a lot of easy ones for example if we need to add two decimal numbers computer will convert each number to a binary number add them and then convert it back to a decimal number to give us an answer 
**Understanding how to convert a decimal number to a binary number.**
We need to divide the given number repeatedly by 2  writing down every remainder until we get 0. Then, we write the remainders in reverse order to get the binary number.
Binary numbers
Tags: beginners
Published: 2022-09-15 22:12:38

## Introduction
A binary number is a number expressed in the base-2 numeral system by using only two symbols: 0 and 1. It is just like counting in decimal except we reach 10 much sooner. We start with 0 then 1 and after which we start with 0 again but already with 1 on the left side (10). This is the language which is used to speak with all computer-based devices. Besides the binary there are also 8-based 16 based representations. This is also the base of Boolean algebra: 0 is False, 1 is True.

## How to convert decimal to binary
Let's consider a decimal number 46 and try to convert it to binary.
46/2 will be 23 and 0 reminder
23/2=11, 1 reminder
11/2=5, 1 reminder
5/2=2, 1 reminder
2/2=1, 0 reminder
2/2= 1
So the representation of 46 in binary will be 101110 from below to above.
##How to convert Binary to decimal
Now let's try to convert 11011001 binary number into decimal.


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

Order start from right to left and we start count from 0.
11011001
_76543210_

Then we are summing up all numbers multiplied by the 2 power of their order number.

##Memory
Each 1 or 0 in binary number is one bit, so 11011001 is 8 bits which is equal to 1 byte. Bit is the smallest measure. Let's consider English Alphabet (there are 26 letters) we can represent it with 5 digits because 4 will be not enough.
00001
00010
…
01111
11111
With 5 digits we can represent 2^5=32 letters or something.

## Addition
Binary addition works like a decimal addition, but the number can have only zeros and ones as digits, so if the sum exceeds 1, you have to carry 1 to the next bit.


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



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


When we add 1 to 1 we will get 10 so we will have 0 and 1 carry. Moreover,  we can check that by converting these numbers and our answer into decimal.
10001 = 17
11101 = 29
17 + 29 = 46 
101110 = 46 

## Multiplication
Binary multiplication is similar to the multiplication of decimal numbers.

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


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

Here we can also check the results by converting binary numbers into decimal.
React Airbnb Clone Page
Published: 2022-09-15 22:06:50

I recently completed an Airbnb clone page using HTML/CSS, JavaScript, and React.  Things that I learned on this project was the ability to scale every text using rem instead of pixels, and to also create individual components so they may be reused.  Specifically a card component, that did not have any of the data hard coded in, but rather was able to fetch the data from a separate file that I had saved locally, to represent fetching real data from an API database.  That information then was populated into my card component using the map function.

I like how this info is clean and clear, and able to present my desired results, all while using React.  Now onto my next project!


![Airbnb clone static page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/95tvkzy96vm4j2z7k1gq.png)

https://react-jackson-airbnb.netlify.app
Binary numbers
Published: 2022-09-15 21:59:15

**What are binary numbers, and why do we need them?**

Binary numbers are a counting system that consists of 2 numbers (0s and 1s). Binary numbers are mainly used in computing and electronic devices. Computers cannot understand languages and numbers as humans do; they work with electrical signals, either on or off. 1 shows that signal is on, and 0 shows that signal is off.  

**How to convert decimal to binary and vice versa?**

To convert decimal into binary, divide the decimal number by 2 until we get 0 as the quotient. After every division in the reminder, there will be either 0 or 1. If we write reminders of all divisions from the last to the first, we will get a binary representation of the current number.

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

To convert binary into decimal, we need to list all powers of 2 for all digits, starting from 2^0 for the rightmost digit. As we move on, the numbers will become 2^1, 2^2, 2^3 ... then we multiply each digit starting from the right one and add them. The sum will be the decimal representation of the binary number.

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

**How to add binary numbers?**

Adding binary numbers is similar to decimal numbers. We have to go from right to left. 1+0 and 0+1 will result in 1, and 0+0 will result in 0, but if we have 1+1, it is impossible to write 2, so we will have to write 0 and have 1 carry for the next column. After adding numbers in the second column, we also add the carry and continue this until the end.


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

**How to multiply binary numbers?**

Multiplication is done by multiplying every digit of one number to another x number, resulting in either 0s or x. After multiplying each digit, we shift the beginning of the new number to the left by one column. The sum of all those numbers is the result of multiplication.


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


References
https://www.cuemath.com/numbers/binary-to-decimal/
https://www.wikihow.com/Add-Binary-Numbers
Set docker build args from .env file (NextJS)
Tags: docker, devops
Published: 2022-09-15 21:36:48

I recently came across the issue that I had to build a Docker container with a NextJS app inside that was relying on a environment variable to set the domain for [Plausible.io](https://plausible.io/).
The tricky thing was that I was building the container once and deploying it to multiple pods with different environment configs.

Technically docker can respect a `.env` file when it is run with the option `--env-file` like so:
```sh
docker run --rm --env-file .env -p 3000:3000 -d YOUR_CONTAINER_TAG:prod
```

### So here comes the issue...
But since the environment was set during build time inside the container and NextJS has automatic site optimiziation and builds pre-rendered pages for server-side render during build, the environment variables from the Docker build run were baked into the image and it did not care about the `.env` file for server logic.

### A small bash script to the rescue
I am using Envault to manage environment configs and since the image is being build with a Jenkins pipeline, the pipeline pulls the correct `.env` file from Envault each time.
Inside the `Dockerfile`, change the vars to be this:
```sh
ARG DB_USER
ARG DD_SVC_NAME
ENV DB_USER=$DB_USER
ENV DD_SVC_NAME=$ARG DD_SVC_NAME
```
This means the build command needs to contain `--build-arg` paramters for each variable.
To read those from the `.env` file via bash, we can use this:
```sh
$(for i in `cat .env`; do out+="--build-arg $i " ; done; echo $out;out="")
```
The docker command looks like this:
```sh
docker build -f Dockerfile -t MYTAG:prod $(for i in `cat .env`; do out+="--build-arg $i " ; done; echo $out;out="") .
```

### Bonus round: makefile
Since I love Makefiles, there is a small pitfall how to include the bash loop into the command, so here is my Makefile for reference:
```sh
SHELL := /bin/bash
...
# this line will set the build args from env file
DECONARGS = $(shell echo "$$(for i in `cat .env`; do out+="--build-arg $$i " ; done; echo $$out;out="")")
GEN_ARGS = $(eval BARGS=$(DECONARGS))

.PHONY: dist-prod
dist-prod:
	@echo "Running docker build for PROD ..."
        $(GEN_ARGS)
	docker build -f Dockerfile -t $(TAG_SHA) $(BARGS) .
...
```
Angular v.14 + ESBUILD = -25/40% build time
Tags: angular, esbuild, build
Published: 2022-09-15 20:48:18

Angular v.14 now supports [esbuild](https://esbuild.github.io/), a "new" super fast JavaScript Bundler, also used by [ViteJS](https://vitejs.dev/).

I have tried it right now in a small Angular project (about 10 modules) and it almost halved the build time (-44%).

If you want to try it (but it's still experimental!) you can simply add the suffix '-esbuild' in your angular.json file as shown in the attached image.


```json
...

"architect": {
 "build": {
  "builder": "@angular-devkit/build-angular:browser-esbuild",
     "options": {
     
...
```


![angular.json screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t4xfxhlfpxjzi5xf3haa.png)


---

More info and tutorials about Angular, React, RxJS and JS on my [YouTube Channel](https://www.youtube.com/c/FabioBiondi)
how to fix raise ImproperlyConfigured("settings.DATABASES is improperly configured. "
Tags: django, railway, drf, postgres
Published: 2022-09-15 20:24:20

hallo guys, 
so i'm having issue deploying my django on railway but once the deployment is complete the app crash with this err

```

raise ImproperlyConfigured("settings.DATABASES is improperly configured. "
django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.

```

and below is my django settings and railway setting 

```
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'HOST': os.environ.get('PGHOST'),
        'NAME': os.environ.get('PGDATABASE'),  
        'USERNAME': os.environ.get('PGUSER'),
        'PASSWORD': os.environ.get('PGPASSWORD'),
        'PORT':os.environ.get('PGPORT')
    }
}

```

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


can anyone help out pls
GUI? tô fora, pego meu CLI e vou embora ⌨️
Tags: braziliandevs, news, newsletter, writing
Published: 2022-09-15 20:21:27

Fala dev!

Estamos portando a **EZ._pills_ 💊** para cá (apenas uma preview), uma newsletter em cápsulas de conteúdos para devs!

E você? Prefere CLI ou GUI no seu dia a dia? 👀

---

### Se o Cibercrime fosse um país, seria a terceira maior economia do mundo
Segundo a _Statista_, o custo anual dos crimes cibernéticos vão crescer 40% e atingir US$ 11,5 tri em 2023. Um comparativo entre os prejuízos causados por esses ataques neste ano e em 2019 indica um aumento de 630% na receita total, o que pode ser justificado pela intensa digitalização forçada pela Covid-19. A notícia pode ser lida no [Convergência Digital🔗](https://www.convergenciadigital.com.br/Seguranca/Cibercrime-atinge-receita-de-R%24-43-trilhoes-e-se-torna-a-terceira-economia-do-mundo-61403.html).

### Ataques de phishing com keylogger em JavaScript
Uma campanha de phishing com foco na Grécia criou sites de phishing que imitam o site oficial de uma plataforma governamental com um código malicioso em JavaScript que captura todos os caracteres digitados e os envia ao servidor do criminoso, mesmo sem que os usuários enviem o formulário. A notícia pode ser lida no [Bleeping Computer🔗](https://www.bleepingcomputer.com/news/security/phishing-page-embeds-keylogger-to-steal-passwords-as-you-type/).

### Domínios sem pontos existem e são as menores URLs
O engenheiro James Williams chamou a atenção do público ao encontrar domínios que são menores que os mais conhecidos g.co ou m.me. É possível que entidades regulatórias da internet habilitem simples palavras como endereços DNS válidos, e em um teste do site, puderam acessar o endereço sem pontos https://ai/. A notícia pode ser lida no [Bleeping Computer🔗](https://www.bleepingcomputer.com/news/technology/dotless-domains-home-to-the-internet-s-shortest-urls/).

---

## 📚 Dicas de Conteúdo
### Oportunidades em TI: o que você precisa saber antes de aceitá-las
Entenda o que você deve analisar antes de aceitar novas oportunidades em TI e como fazer isso através das entrevistas com recrutadores. Acesse o artigo no [blog da Kodus](https://kodus.io/oportunidades-em-ti-o-que-voce-precisa-saber-antes-de-aceita-las/)🔗.

### Como setar seu mindset para desafios tech
Quem nunca sentiu a espinha gelar na hora que se deparou com um desafio tech? Além de estar preparado tecnicamente, você também deve estar com o mindset preparado para os desafios tech que você vai encontrar durante sua jornada como desenvolvedor. Confira [nosso vídeo🔗](https://www.youtube.com/watch?v=jGUdVyQv0CU) que pode te ajudar com isso!

---

E assim nós finalizamos essa edição da sua dose semanal de pílulas de conteúdo! 💙
Day 1 of 100
Tags: react, 100daysofcode, webdev, beginners
Published: 2022-09-15 20:00:30

It's kinda weird to start the 100 days while I'm already busy with a project, but here we are. I am creating my own website using ReactJS and a whole host of other practices. You can find the code @ https://github.com/LitMgwebi/My_WebSite
Quem sou eu na fila do pão?
Tags: begin, career, devjournal, braziliandevs
Published: 2022-09-15 19:49:28

Meu nome é Oswaldo, tenho mais de 30 anos, sou natural de Teresina, Piauí(pare de xenofobia o Piauí existe sim! rs), minhas origens(pais) são do Ceará e eu atualmente(2022) moro em Campina Grande, Paraíba. 

Aqui é nordeste! ☀️🌵

A minha origem é humilde, nenhum dos meus pais conseguiu completar o segundo grau, meu pai foi taxista praticamente a vida toda, mas sempre teve uma veia empreendedora e junto com minha mãe construiu negócios que me deram muitas oportunidades.

Meu pai sempre teve uma grande preocupação com estudo, ele me ensinou a ler com 6 anos e meu irmão já sabia ler com 4. Não é saber reconhecer caracteres é ler mesmo, ser capaz de receber um gibi e ler toda história. Sou muito grato não só por esse cuidado, mas por muitos outros ao longo da vida. Me deu um computador numa época que isso era proibitivo para muita gente, financiou a minha faculdade, tudo sempre com muito suor e esforço.

Eu me formei em 2009 em sistemas de informação mas até 2020 eu nunca tinha trabalhado com tecnologia, existem alguns motivos para isso. Eu criei esse blog para partilhar a minha experiência, meus aprendizados e minha trajetória que até então tem sido muito feliz.

Até Breve 👋
My Engagement to The #100Days of Code Challenge.
Tags: beginners, productivity, webdev, 100daysofcode
Published: 2022-09-15 19:41:38

I'm publicly committing to the 100DaysOfCode Challenge starting today! Learn More and Join me! hey @ka11away https://100DaysOfCode.com #100DaysOfCode  I know it's gonna be a challenging journey, but i'm ready.🙃
Binary Numbers
Tags: beginners, programming, binary
Published: 2022-09-15 19:40:51


_By Levon Yedigaryan_

## What are binary numbers?

These are numbers which as every other number are used to represent an amount. These numbers are used in computers due to the peculiarities of the comupter's organisation.

## How do Binary numbers work?

in everyday life people often use decimal system of representation of numbers because it is the method people got used to from the early life. Decimal system is a system where the basis is the number 10, which means that in decimal numbers every digit shows the amount of certain powers of 10 according to their position. If we look at a digit in a number, it shows the maximum amount of 10s in the power of n in the number where n is the position of the digit if we start counting from left to right starting with 0.
To better understand this here is an example with the number 35468991.

![structure of a decimal number](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kijp4rid3sz260i0o76k.jpg)

The same principle is true with binary numbers. Here every digit shows the amount of 2s in the power of n in the number. In binary systems the only digits are 1s and 0s. For illustration here is an example of number 10110011 in binary system which is then represented in decimal system.


![structure of a binary number](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5jliwbi4x739k6tg0vzn.jpg)

So the transmission from binary to decimals is clear. No lets talk about transmission from decimals to binary. To convert decimal numbers into binary we have to divide the number by 2 and write down the remainders until the quotient becomes 0 and then we have to rewrite the remainders in the reverse order. here is an example with the convertion of number 54 in decimals.


![convertion of decimal numbers into binary](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rnwc6wda5uoirok0oh46.jpg)

## How to add binary numbers?

The principle of addition of binary numbers is exactly the same as the for the decimals. We start from the digit at the very right and then go to the left. In case when we get 1+1 in binary it is 10 but as be can not write 10 as one gidit we write only 0 and then carry 1 part to the left. For a better visualization here is an example of an addition of 2 binary numbers.


![addition of binary numbers](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t41sv9eiilqyv8c9qbeo.jpg)

## How to multiply binary numbers?

The principle of multiplication is completely the same as with decimal numbers. We multiply one by one the digits from the lower factor each time writing the product one digit to the left and then summing all the product together. here is an example.


![multiplication of binary numbers](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5tgxr3oqw7943k7t297z.jpg)

These were the sum and the multiplication of binary numbers. With this information one can easily do subtraction and division as the principles are exactly the same as for decimal numbers.

Wish you luck with your further studies of binary numbers)
I hope this information was useful.
Should Agile Manifesto be revised?
Tags: agile, programming, discuss, management
Published: 2022-09-15 19:37:56

Is there premise in the manifesto you would disagree with?

The biggest problem with it that I see is this one: "Working software over comprehensive documentation". It sounds good, it is also a very convenient premise to believe in - many developers hate writing documentation. But I it think misses an important part of the problem - software is only part the product. Arguably, it is not the most important part of the product as well. If we can solve a problem without writing any software, for example by updating the documentation - everyone would win.

If a user cannot use the software or software does not solve user problem - it doesn't matter if it is working or not.

As an extreme and somewhat sobering example, lets consider Boing Max disaster.

Boing Max had the capabilities to overrun faulty autopilot commands, but because it was never properly communicated in the manuals pilots could not use the functionality. Mostlikely they even didn't understand its significance. The decision to compromise on a documentation part resulted in 3 planes crashing, killing hundreds of people.

It seems that Manifest was designed for a particular point of time and a particular environment and wasn't supposed (or ready) to be universally adopted.


What do you think?
What are binary number? Why we need them? How to convert Binary to decimal? How to add and multiple binary number?
Tags: binary, adding, multiplying, converting
Published: 2022-09-15 19:21:04

What are binary numbers?

Binary numbers are numbers which are expressed in base-2 numerical system or binary numerical system. It’s a method of mathematical expression which uses only two symbols: 0 and 1. So to represent numbers starting from zero in base-2 numerical system we just start from 0(0 in base-10), 1(1 in base-10), 10(2in base-10), 11(3 in base-10), 100(4in base-10) and so on. Every digit in our base-2 numbers is referred to as a bit or a binary digit.

So why do we need this base-2 numerical system?

The main reason the binary number system is used in computing and it is simpler for computers to understand the language or numbers in the same way that we do. All that computers really have available to work with are switches and electrical signals, which are either on or off. So, to say it much simpler if we have 1 it means there is an electricity if we have 0 it means that there is no electricity. 

How to convert binary to decimal?

If you are given a binary number and you need to understand which decimal number that could be you jut need to do the following to get decimal value of that number.                                    Since binary numbers are type of positional number system. That means Weight of the positions from right to left are as 2^0, 2^1, 2^2,2^3 … and so on. So, starting from the right side you just multiple your binary digit into 2^(digit’s position) and add all numbers that you got from multiplying.
		For example: 1101 = 1*2^3 + 1*2^2 + 0*2^1 + 1*2^0 = 8+4+0+1 = 13

How to add and multiply binary numbers?

                            Adding
The binary addition operation works similarly to the base 10 decimal system, except that it is base 2 system and it consist of only two digits. In binary addition we again start from the right. Binary addition is much easier than the decimal addition if you remember just this four rules of binary addition: 
•	0 + 0 = 0
•	0 + 1 = 1
•	1 + 0 = 1
•	1 + 1 = 10
Now, look at the example of binary addition: 101 + 101
Step 1: First consider 1’s column from the right, and add the digits of that column (1+1) and it gives the result 10
Step 2: Now, leave the 0 in the one’s column and carry the value 1 to the 10’ column
Step 3: Now add 10’s place, 1+(0+0) = 1. So, nothing carries to the 100’s place and leave the value 1 in the 10’s place
Step 4: Now add the 100’s place (1+1)=10. Leave the value 0 in the 100’s place and carries 1 to the 1000’s place
		Result: So in the end by adding 101 to 101 we get 1010.     

                          Multiplying 
Binary multiplication is similar to the multiplication of decimal numbers. We have a multiplier and a multiplicand. The result of multiplication result in a product. Since only binary digits are involved in binary multiplication, we get to multiply only 0s and 1s. The rules for binary multiplication are as follows.
•	0 * 0 = 0
•	0 * 1 = 0
•	1 * 0 = 0
•	1 * 1 = 1
 And you just multiply binary numbers as you multiply decimals by using this rules.
called a softwait
Tags: notmuchofasoftwar
Published: 2022-09-15 19:20:26

```md
silent weapons of the softwar(e) handing 
in the quiet destructiveness 
of a novel disgust of disgust
```

![spec and brick](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xao3i99pqepd2pyysywn.png)