teleren/devto huggingface dataset:
How integers are stored in memory
Tags: computerscience
Published: 2024-01-29 00:38:38

This will be a brief explanation of how integers are stored in memory, but let's get started.

The storage of integers in memory depends on various factors, including the programming language, hardware architecture, and the specific type of integer (e.g, 8-bit, 16-bit, 32-bit, 64-bit).

First, let's understand what's the difference between these types of integers (8-bit, 16-bit, etc...).

This difference refers to the number of **bits** used to represent each integer value.

### Okay, but what is a **bit**?

A **Bit** is the smallest unit of information that can be stored or transmitted in a computer, a **bit** can only take 2 values *0* and *1*.

Now let's think what a *8-bit* integer means.

This type of integer can take values between *0* and *255* because this is only the values that can be represented with 8 bits.

*`00000000`* -> *`11111111`*

One thing to keep in mind is that is about **Unsigned Integers**.

### Okay, again, WTF is this?

**Unsigned Integers** means that all the bits are used to represent values, without reserving one bit to the signal (positive or negative), so **signed integers** are the opposite.

Which values **8-bit signed integer** can take?

Let's think, if we lose one bit to store the value, we lost some numbers.

**8-bit signed integers** can store numbers between *-128* -> *127*.

```rust
// in rust 'u8' type means unsigned integer of 8 bits

let number: u8 = 0; // ok
let number: u8 = 255; // ok
let number: u8 = -1; // not okay
```

I believe that by understanding these concepts, such as signed and unsigned integers and why there are 8-bit, 16-bit... integers, is a good basis for understanding how computers store these values.

Thanks for reading this far and bye! keep studying!
Utilizando EFS para persistência de arquivos do container ECS/Fargate
Tags: community, aws, ecs, efs
Published: 2024-01-29 00:34:06

Caso esteja executando sua aplicação em container docker utilizando o ECS/Fargate e tenha a necessidade de persistir arquivos de um determinado diretório, o EFS pode ser útil.

Dessa forma, pode ter a tranquilidade de caso o container seja destruído, estes arquivos não serão perdidos.

Com esse recurso, é possível também executar vários containers utilizando o mesmo respositório de persistência e compartilhando os mesmos dados.

![](https://cdn-images-1.medium.com/max/2000/1*wz9qOT5BYC80rsfs5RVOWw.jpeg)

---

![Topologia de referência](https://cdn-images-1.medium.com/max/2000/1*xWysdff3lWwvUH_6VuY0HA.jpeg)

### Pré-requisitos

* Acesso ao console AWS e ao serviço ECS

* Cluster ECS/Fargate já configurado

* EFS já criado

### Considerações

* Foi utilizado uma imagem *httpd* do [Docker Hub](https://hub.docker.com/_/httpd)

* Um *bastion host* Linux pode ser útil para administração e deploy no EFS

* O diretório padrão do *httpd* (/usr/local/apache2/htdocs) será consumido no EFS

* Foi feito upload de uma nova *index.html* através do *bastion host* para o diretório raiz do EFS que será montado no *WORKDIR* do container

![](https://cdn-images-1.medium.com/max/2000/1*9ZscXXQe1rA0wMy92BBSxQ.png)

---

### Execução

- Visualização do EFS criado — Lembre-se de permitir NFS no security group:

![](https://cdn-images-1.medium.com/max/3224/1*UM3uN-JfXuMXgOTyaFAWiw.png)

![](https://cdn-images-1.medium.com/max/3298/1*wfOwv_6Dvqu7FvynnY0rcA.png)

- Na *task definition* do ECS, crie uma nova revisão para adicionar as configurações de volume:

![](https://cdn-images-1.medium.com/max/2030/1*HVJrKsH50LnHduoU0t4YrQ.png)

![](https://cdn-images-1.medium.com/max/2000/1*J3h_M3PemBs5qiNBYljrWA.png)

![](https://cdn-images-1.medium.com/max/2030/1*ZHMLN9G_I2vKHc4ASTaPlg.png)

- Ainda na *task definition*, será necessário ajustar *container definitions*:

![](https://cdn-images-1.medium.com/max/3372/1*HFd4Jivd8Y7nle2ig2zLoA.png)

![](https://cdn-images-1.medium.com/max/2406/1*o4hCPc3pZf3H13XEkKPh9A.png)

- Atualize o *service* para utlizar a revisão correspondente aos ajustes realizados:

![](https://cdn-images-1.medium.com/max/2078/1*dQ-gqDBc2__VDThFkI0NDg.png)

- It works!

![](https://cdn-images-1.medium.com/max/2022/1*4-dMaj7CUdx-ETg3RG6NzQ.png)

### Conclusão

Foi utilizado uma função básica de *web server* para demonstrar a funcionalidade do EFS como repositório de persistência. Assim cada container proveniente da *task definition* que foi atualizada pode consumir o repositório, podendo ser parado e iniciado a qualquer momento sem ocasionar perda de dados (no caso do exemplo, a *index.html*).

Happy building!
Babylon.js Browser MMO - DevLog #9 - Managing game screens
Tags: babylonjs, gamedev, indie, mmo
Published: 2024-01-29 00:26:56

Hello,
While my work is progressing in satisfactory degree I'm trying to catch up with recording. So far without luck but at least I'm make recordings in regular manner.

In Today's episode I'm showing new UI (login, registration etc.) and presenting how I managed to switch between screens in elegant way.

If You're interested let's check the video:

{% youtube 3Pa7g8B5rUk %}
What Alternatives to VS Code do you use?
Tags: watercooler, discuss
Published: 2024-01-29 00:18:22

What, if any, alternatives to VS Code do you recommend? I think VS Code is a pretty great editor, but I have some objections to it which have been stacking up for some time now, and I'm looking for something that could potentially replace it.

If you have any suggestions, I'd love to hear them! Here are the things I'm currently prioritizing:

- Fast (read "not an Electron app"), preferably relatively small memory/CPU footprint.
- Not owned by Microsoft
- Excellent out of the box language support for many mainstream languages, *or* a plugin ecosystem which has plugins to that add support for those languages
- Smart refactoring tools (sometimes find and replace isn't good enough)
- A strong plugin ecosystem. I like to make use of advanced debugging tools when they are available. Also, good plugins can go a long way toward quality of life features.

### Alternative's I'm considering
I have tried or looked into a few alternatives, but I'm not sold on any of them yet.
- [Lapce](https://lapce.dev/). Seems solid, but the plugins often seem like they are out of date and there's no way to tell whether they are except by trying them out. Also, even though Rust has good language support, I've found some of the other language support to be lacking.
- [Emacs](https://www.gnu.org/software/emacs/). I've been hearing about Emacs lately, so I'm considering looking into it in more depth, but I haven't yet. I guess have two main concerns with Emacs: 1) I'm not sure how many advanced features it offers because I'm not sure what it's plugin ecosystem is like, and 2) How good is Emacs' Windows support?
- [Zed](https://zed.dev/). I'm really excited about this option as it seems very promising, but I only use Windows and Linux 😥
- [Vim](https://www.vim.org/)/[Neovim](https://neovim.io/). These tools have been around for a long time and are pretty performant according to my understanding, but from my experience, they don't seem to have many features beyond syntax highlighting, and I'd prefer more advanced features.

I'd love to hear any suggestions from the community! Also, if you have any thoughts about the editors I've already tried, I'd love to hear those too!
Prevent Caddy's automatic http-to-https redirect
Tags: caddy
Published: 2024-01-29 00:15:57

---
title: Prevent Caddy's automatic http-to-https redirect
published: true
description: How to access a Caddy site from both http and https while developing locally.
tags: caddy
canonical_url: https://caddyexamples.com/examples/prevent-http-to-https-redirect/
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2024-01-29 00:07 +0000
---

Occasionally while developing a web app locally, you need to build an isolated feature that _requires_ `https` (such as a [service worker](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#setting_up_to_play_with_service_workers)). Using a self-signed certificate locally introduces the annoyance of Chrome returning an error every few hours that says `Your connection is not private`.

It would be nice to only deal with those self-signed `https` warnings when you absolutely needed to use `https`, then access the site warning-free via `http` the rest of the time. However, Caddy automatically adds an `http`-to-`https` redirect for all domain [site addresses](https://caddyserver.com/docs/caddyfile/concepts#addresses).

You can prevent the automatic redirection from `http`-to-`https` by listing both `http` and `https` addresses at the beginning of the [site block](https://caddyserver.com/docs/caddyfile/concepts#blocks):

```py
http://mysite.test, https://mysite.test {
	# bind allows access to containers from host when
	# running Caddy in Docker.
	bind 0.0.0.0

	# Issue a self-signed certificate for development.
	tls internal

	respond "Hello, world! I am being accessed from {scheme}."
}
```

**Do not use this configuration in production.** There are very few responsible reasons to serve an `http` version of your production site. Only use this configuration for development.

## Gotchas

When developing locally, you may need to add the domains to your system's `hosts` file if they aren't already there.
Binance Coin (BNB)
Published: 2024-01-29 00:02:37

¡Hola, compañeros criptoinversores! Me gustaría compartir mi experiencia de hacer dinero en cryptocurrency. Recientemente, he estado utilizando activamente Binance Coin (BNB), y puedo decir que es una excelente opción para los inversores. Una plataforma conveniente y una amplia gama de oportunidades hacen de BNB un activo atractivo. En [más información](https://www.cryptomkt.com/es-cl/comprar-binance) encontré una forma cómoda de comprar BNB y empecé a invertir con éxito. ¡Te recomiendo que estudies esta criptodivisa detenidamente también!
Caption This! 🤔💭
Tags: watercooler
Published: 2024-01-29 00:00:00

Ready to unleash your inner wordsmith? We need your wit to crack the code behind this picture-perfect scene. Caption away!
![People with paper bags on their heads looking at the Grand Canyon](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2bptm4rwvacfmh5idzgj.jpg)

---

Follow the DEVteam for more online camaraderie! {% embed [https://dev.to/devteam](https://dev.to/devteam) %}
last words on Stray Gods
Tags: gamedev, writing
Published: 2024-02-25 21:28:15

---
title: last words on Stray Gods
published: true
date: 2024-01-29 00:00:00 UTC
tags: [ 'gamedev', 'writing' ]
canonical_url: https://onwriting.games/daily/20240129-1038-last-words-on-stray-gods/
---

Ok. I finished Stray Gods.

I liked it, but I think it's because it's the first game that tries to bring Broadway from the manual to video games.

Unfortunately, I have to say that the game works, but not as a great showcase of interactive fiction.

The story is ok, it's not Sandman, but it's captivating.

The main problem is, like in many narrative games, there's no agency, few reasons to replay, etc.

It's almost a linear game, there are few things you can change, and definitely a waste of opportunities to do memorable things.

It saddens me because the game's lore works, the characters are good, the art works and everything.

Unfortunately, it doesn't go beyond.

The game lasts 7 hours, and it's very ambitious. I don't understand why they didn't make it last 2 hours but with 3 very different stories.

Anyway, I enjoyed the first run a lot, but more because I'm a theater kid than anything else: if you like musicals, give it a try, otherwise... next!

I still think that we need more games that think of stories as spaces for exploration, that design using the rhizome as a central element and leave behind the linearity of traditional media.

PS: You may have noticed that I didn't send emails over the weekend. I'm trying this new writing format from Monday to Friday and resting on weekends. We'll see how it goes.
Violinist and automation with Eirik Morland
Published: 2024-02-03 08:04:48

---
title: Violinist and automation with Eirik Morland
published: true
date: 2024-01-29 00:00:00 UTC
tags: 
canonical_url: https://www.oliverdavies.uk/archive/2024/01/29/violinist-and-automation-with-eirik-morland
---

In [today's episode of the Beyond Blocks podcast](https://www.oliverdavies.uk/podcast/8-eirik-morland-violinist), I'm joined by Eirik Morland - the Developer of [Violinist](https://violinist.io).

We discuss why you'd want to use a tool like Violinist to manage your dependency updates, why you'd want to automate repetitive tasks and focus on providing value for clients and customers.

We also discuss running a SaaS business and why Drupal is a good choice for SaaS products - though this could be a full episode on its own.

 P.S. Need help or want another pair of eyes on your code? Book a [1-on-1 consulting call](https://www.oliverdavies.uk/call) or an [online pair programming session](https://www.oliverdavies.uk/pair) with a 100% money-back guarantee.
Early Adopter's guide to Umbraco v14 - Entry points
Tags: umbraco
Published: 2024-01-28 16:18:49

[The Offical umbraco docs](https://docs.umbraco.com/umbraco-backoffice/tutorials/creating-a-custom-dashboard) Show you how you can define all your elements (dashboards, property edirors, sections, etc) in the `umbraco-package.json` file.

For the purpose of our package template we are only using the `umbraco-package.json` file to define an [Entry Point extension](https://docs.umbraco.com/umbraco-backoffice/extending/extension-types/entry-point).

```json
{
    "$schema": "../umbraco-package-schema.json",
    "name": "mypackage",
    "id": "mypackage",
    "version": "0.1.0",
    "allowTelemetry": true,
    "extensions": [
        {
            "name": "mypackage.entrypoint",
            "alias": "mypackage.EntryPoint",
            "type": "entryPoint",
            "js": "/app_plugins/mypackage/assets.js"
        }
    ]
}
```

This file is in the `assets/public` folder so is copied to to the `wwwroot/app_plugins/packagename` folder when the assets are built.

By using an entry point we are defining all our other elements in typescript. This gives us some advantages in the long run, because all our assets will be subject to the typescript compiler so we should catch errors as part of the build.

## Entry point.
In Umbraco an entry point script is ran when the back office is initialized when the onInit method is called.

```ts
export const onInit: UmbEntryPointOnInit = 
    (_host, extensionRegistry) => {    
        // register them here. 
        extensionRegistry.registerMany(manifests);
};
```

In the default example here we register any manifests we might have already defined, and if the base template we have defined a dashboard manifest.

```ts
import { manifests as dashboardManifests } 
    from './dashboards/manifest.ts';

const manifests: Array<ManifestTypes> = [
    ...dashboardManifests
];
```

but you might add others such as sections or trees.

```ts
/ dashboards..
import { manifests as dashboardManifests } from 
    './dashboard/manifest.ts';
import { manifests as sectionManifests } from 
    './section/section.ts';

const manifests: Array<ManifestTypes> = [
    ...dashboardManifests,
    ...sectionManifests
];
```

This makes your entry point file the main point where you add new things to your package. and you don't need to alter the `umbraco-package.json` file again (except maybe for the version info?).

For the purpose of our samples (and how the Umbraco core appear to be doing it) we have manifest.ts files for each of the areas of our package we want to seperate out and they are then loaded into our main entry point - seperating it all out and preventing us from having to manager a single massive `umbraco-package.json` file.
Microservices Architecture for George Mason University’s Course Registration System
Published: 2024-01-28 23:57:49

### Appropriate Architecture Pattern/Style: Microservices

George Mason University's course registration system faces fluctuating traffic throughout the academic year. Adopting a Microservices architecture provides the ability to dynamically scale up services based on demand. For instance, during peak course registration periods, scaling up user management and registration services becomes essential to efficiently handle increased traffic.

The increased modularity inherent in Microservices architecture offers several advantages. It facilitates easier maintenance and debugging while enabling faster rollout of updates. This is achievable as development teams can concurrently work on multiple modules. Additionally, the system gains enhanced fault tolerance due to increased modularity.

### Non-Functional Requirements/Quality Attributes:

1. **Scalability:** The system must horizontally scale to accommodate peak registration periods and a growing user base over time.
2. **Availability:** Given the anticipated surge in traffic during peak registration periods, maintaining high availability and minimizing downtime is crucial for uninterrupted service.
3. **Security:** Robust security measures, including two-factor authentication, must be implemented to safeguard sensitive user data.
4. **Performance:** Rapid course filling necessitates a high-performance system to ensure swift and responsive user interactions.
5. **Reliability:** Each microservice should demonstrate reliability and resilience. Implementing proper error handling, logging, and monitoring is imperative to swiftly identify and address issues.
6. **Interoperability:** Microservices should effectively communicate through well-defined APIs and protocols to ensure seamless integration.
7. **Data Management:** A robust data management strategy is essential, covering aspects such as data consistency, backup procedures, and disaster recovery plans.
8. **Compliance:** Ensuring compliance with relevant data protection regulations and standards, such as GDPR or FERPA, is imperative based on the jurisdiction and nature of the handled data.

In summary, adopting a Microservices architecture not only addresses the dynamic nature of George Mason's course registration system but also aligns with key non-functional requirements, enhancing scalability, availability, security, performance, reliability, interoperability, data management, and compliance.
Make layout with bidirectional text has never been so easy 🙌
Tags: css, layout, webdev, ui
Published: 2024-01-28 23:18:44

## Intro

Sometimes we have to support multi language app. Some of them might have a different direction, form left to right. But how to keep our margins/padding the same? I know there are some tools for that, but actually there is a native solution.

Today we are going to talk about logical css properties:

```css
margin-block-start
margin-block-end
margin-inline-start
margin-inline-end
```

```css
padding-block-start
padding-block-end
padding-inline-start
padding-inline-end
```

```css
inset-block-start
inset-block-end
inset-inline-start
inset-inline-end
```

```css
border-block-start
border-block-end
border-inline-start
border-inline-end
```

These properties are similar to usual properties but with special sense.

## Example 1

Let's say we have a container with `padding: 20px 60px 80px 10px;` (top right bottom left). Then we add `direction: rtl;` to change language direction. We will see that our right padding is 60px but we need 10px as before left padding was.

That's why we need logical properties.

```css
padding-inline: 10px 60px;
padding-block: 20px 80px;
```

If we use logical properties out paddings will be changed with text direction as well. In this case right padding `60px` will become `10px` and vice versa. It works the same for `writing-mode: vertical-rl;`

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

You can play with margins on the codepen at the end of article.

## Example 2

I guess it's clear for margins and paddings. But these properties work for borders as well.

Let's see the difference for left to right direction.

```css
  border-inline-start: 10px solid #FFD54F; // left
  border-inline-end: 10px solid #4DD0E1; // right
```

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

## Example 3

Only one type of property has left. As you might already guess `inset-block`/`inset-inline` allow us to apply logical properties for elements with absolute positioning.

When we have element with `position: absolute;` and use usual properties we won't see any changes. But if we use `inset-block`/`inset-inline` and change text direction we will se how position of element will be changed as well.

Try it yourself 😉

{% codepen https://codepen.io/dhutaryan/pen/jOJYyKE %}

### Bonus

Now, you know how to show element by center using one row of css.

```css
  margin-inline: auto;
```
Normalization Technique
Tags: apacheage, postgressql
Published: 2024-01-28 23:11:37

**Introduction**
Normalization is a crucial data preprocessing technique in the field of data science and machine learning. It involves transforming numerical data into a standard scale, making it easier for algorithms to converge during training and ensuring that no particular feature dominates due to its larger magnitude. Here's an overview of normalization techniques commonly used in data science:

**Min-Max Scaling (Normalization):**

This method scales the data between a specified range, typically 0 and 1.
The formula for Min-Max Scaling is given by:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/blssokfbf002z1xwjts5.png)
**Z-score Normalization (Standardization):**

Z-score normalization transforms the data to have a mean of 0 and a standard deviation of 1.
The formula for Z-score normalization is given by:

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

Robust scaling is similar to Min-Max Scaling but is less sensitive to outliers.
It uses the interquartile range (IQR) to scale the data, making it more robust against extreme values.
**Log Transformation:**

Log transformation is useful for handling data with a wide range of values or data that follows an exponential distribution.
It helps to stabilize variance and make the data more normal.
**Normalization in Neural Networks:**

In the context of neural networks, normalization is often applied to the input data or intermediate layers using techniques like Batch Normalization or Layer Normalization.
Batch Normalization normalizes the activations of a neural network layer by adjusting and scaling the outputs during training.
Sparse Data Normalization:

For sparse data, like text data represented as a bag-of-words, techniques such as Term Frequency-Inverse Document Frequency (TF-IDF) normalization are commonly used.

Choosing the appropriate normalization technique depends on the nature of the data and the requirements of the machine learning algorithm. It's important to experiment with different methods to find the one that works best for your specific use case.