teleren/devto huggingface dataset:
[Book Review]Learning SQL(3rd ed.) by Alan Beaulieu
Tags: webdev, database, mysql, beginners
Published: 2023-04-15 03:21:50

# TL; DR
- This is a nice book, especially either if you're a total beginner or someone who's been using SQL queries in ad-hoc manners
- Focus on the concept part; some parts are too specific for a certain SQL server(MySQL, Oracle, etc.) and may be outdated as of now

## Why I read this book
As a person who's been using SQL sporadically and in ad-hoc manners, I always have thought my lack of full understanding about how SQL queries and those DB services work. I wanted to go through really basic and core concepts of SQL queries and databases.

This book, [*Learning SQL* by Alan Beaulieu(3rd ed., O'Reilly Media](https://www.amazon.com/Learning-SQL-Generate-Manipulate-Retrieve/dp/1492057614), was one of books that satisfied my needs. This book starts from very beginning and covers some core concepts that are essential in real production environments. Hence I chose this book and now I am a bit more confident about writing SQL queries in my workplace.

## Good Parts
I like this book since it starts from defining the concepts like "database", "table", "relational DB", and so on. Those who are enforced to do some query jobs would probably have very vague understanding about what those jargons mean. Moreover, it introduces many real-life essential concepts and techniques such as

- basic, intermediate queries including joining, grouping, set operations or subqueries
- some intermediate or advanced concepts such as transactions, indexes, views, metadata, or database sharding

Rather than reading a small piece of code from a stackoverflow page or a medium article, reading through this book will definitely solidify your knowledge about those concepts.

## Soso Parts
Even if this book covers lots of SQL-related subjects, sometimes it dives too deep. For example, if you're going to use built-in functions, it's better to use official docs or ChatGPT to look up what you need. Also, some examples seem to be made to explain just a particular concept(like cross join that is hardly used in a real production environment).

I recommend skipping those parts that you feel too detailed or consuming too much time explaining example query results. Maybe you could revisit them for reference later.

## Conclusion
I was satisfied with this book in general. But some parts are rather too detailed. And yet, this book is a great introduction to those database novices who have had not much chance to take any database courses in university.
O que é S3 na AWS e como esse serviço pode beneficiar seu projeto?
Published: 2023-04-15 03:08:18

O Amazon Simple Storage Service (S3) é um serviço de armazenamento em nuvem oferecido pela Amazon Web Services (AWS). Ele permite que as empresas armazenem, acessem e gerenciem grandes quantidades de dados de maneira fácil, rápida e segura. O S3 é um dos serviços mais populares da AWS, sendo amplamente utilizado por empresas de todos os tamanhos e setores para armazenar dados, arquivos e objetos.

O S3 é projetado para oferecer alta disponibilidade, durabilidade e escalabilidade, permitindo que os usuários armazenem e recuperem dados de maneira eficiente e confiável. Ele pode ser usado para armazenar qualquer tipo de dado, incluindo arquivos de mídia, backups de banco de dados, arquivos de log, imagens e documentos. Além disso, o S3 oferece recursos avançados, como a criptografia de dados em repouso e em trânsito, controle de acesso granular, versionamento de objeto e replicação de dados em várias zonas de disponibilidade.

Uma das principais vantagens do S3 é sua escalabilidade. Os usuários podem criar e excluir objetos de armazenamento sob demanda, sem a necessidade de provisionar antecipadamente a capacidade de armazenamento. Isso significa que o S3 consegue lidar com grandes quantidades de dados, sem a necessidade de gerenciar a infraestrutura subjacente.

Além disso, o S3 é fácil de usar e oferece uma ampla variedade de opções de gerenciamento de dados. Os usuários podem usar a API do S3 para interagir com seus objetos de armazenamento, bem como utilizar interfaces de usuário web para gerenciar seus dados.

O S3 também é altamente seguro, com recursos avançados de segurança projetados para proteger os dados dos usuários. Ele oferece criptografia de dados em repouso e em trânsito, controle de acesso granular, autenticação de usuários e integração com outros serviços da AWS.

Resumindo, o Amazon S3 é um serviço de armazenamento em nuvem altamente escalável, seguro e confiável, que oferece uma ampla variedade de recursos avançados de gerenciamento de dados. É uma escolha popular para empresas que precisam armazenar e gerenciar grandes quantidades de dados, arquivos e objetos de maneira eficiente e confiável.
O que é EC2 na AWS e como esse serviço pode beneficiar seu projeto?
Published: 2023-04-15 03:08:16

O Amazon Elastic Compute Cloud (EC2) é um dos serviços mais populares da Amazon Web Services (AWS), que fornece capacidade de computação escalável na nuvem. Ele permite que as empresas provisionem rapidamente recursos de computação virtual, incluindo CPUs, memória, armazenamento e outros recursos de infraestrutura.

O EC2 é projetado para ser altamente flexível e escalável, permitindo que as empresas dimensionem a capacidade de computação para atender às necessidades de seus aplicativos e serviços em tempo real. Com o EC2, os usuários podem escolher entre uma ampla variedade de opções de instância, que incluem diferentes tipos de CPU, memória e armazenamento, bem como opções de rede e de segurança.

O serviço é baseado em instâncias, que são máquinas virtuais (VMs) que fornecem recursos de computação para executar aplicativos e serviços. As instâncias EC2 são fornecidas em diferentes tamanhos, com diferentes combinações de CPU, memória e armazenamento. Os usuários podem escolher o tipo de instância que melhor atende às necessidades de seu aplicativo ou serviço, com base em requisitos de desempenho, carga de trabalho, orçamento e outros fatores.

Além disso, o EC2 oferece várias opções de armazenamento, incluindo Amazon Elastic Block Store (EBS) e Amazon Elastic File System (EFS). O Amazon EBS fornece armazenamento de bloco persistente para instâncias EC2, enquanto o Amazon EFS é um sistema de arquivos totalmente gerenciado que pode ser acessado por várias instâncias EC2.

O EC2 também fornece uma ampla gama de opções de rede e segurança, incluindo a capacidade de criar e gerenciar grupos de segurança, para controlar o acesso às instâncias, e a capacidade de criar e gerenciar redes virtuais privadas (VPNs), para conectar as instâncias com outras redes e serviços.

Um dos benefícios mais importantes do EC2 é sua capacidade de escalar rapidamente a capacidade de computação, à medida que as necessidades dos aplicativos e serviços mudam. Isso pode ajudar as empresas a atender a demandas imprevistas e picos de tráfego, sem a necessidade de provisionar e gerenciar recursos de computação locais.

O EC2 é amplamente utilizado por empresas de todos os tamanhos e setores, desde pequenas startups até grandes corporações. É um dos serviços mais populares da AWS, e a plataforma continua a evoluir e se expandir para atender às necessidades em constante mudança dos clientes.

Resumindo, o Amazon Elastic Compute Cloud (EC2) é um serviço de computação em nuvem altamente flexível e escalável, que permite que as empresas provisionem rapidamente recursos de computação virtual. Com o EC2, os usuários podem escolher entre uma ampla variedade de opções de instância, armazenamento, rede e segurança, e podem escalar rapidamente a capacidade de computação para atender às necessidades dos aplicativos e serviços em tempo real. É uma solução eficiente e escalável para empresas que buscam capacidade de computação na nuvem.
How to make a Travel Roulette App named "Where"?
Tags: nextjs, openai, programming, webdev
Published: 2023-04-15 02:43:49

# What is “Where?”

Where? is a travel roulette app that randomly selects a destination for the user. The app will suggests a few activities to do in that location. Once the origin airport is provided, flight information will be provided.

# What are the ingredients?

- NextJs | Typescript - React Framework
- Framer Motion - Animation
- Jotai - Global state management
- OpenAi - Activities suggestion

# The making of “Where?”

You can watch part of the making of this app. 
{% embed https://youtube.com/video/FKNLx4id2qs %}

{% embed https://youtube.com/video/jOQJMm7ryn0 %}

# What else can we add to this app?

To further improve the app, several features could be added.
Below are some example:
- Add `try` and `catch` when fetching from OpenAI. If there are any errors, display it to the user. For instance, if your api token expired or OpenAI didn’t send back the data in the right format, it should ask the user to try again.
- Add automatic retry. If the internet connection goes down in between requests. The app will retry the requests.
- Provide interfaces for the user to select their own travel dates and actually pay for the flight with the duffel api.

Source code: https://github.com/Mingeee/travel-roulette
Getting Started with Selenium (Python)
Tags: beginners
Published: 2023-04-15 01:36:27

## Introduction
Selenium is a powerful tool for automating web browsers, and it can be especially useful for web developers looking to test their applications or automate repetitive tasks. Here are some useful commands for working with Selenium in Python.

## Installing Selenium

Before we can use Selenium, we need to install it. We can install Selenium using pip, the Python package manager. Simply open a terminal or command prompt and type:

`pip install selenium`

## Starting a Browser Session

To begin working with Selenium, we need to start a browser session. We can do this with the webdriver module. Here's an example of starting a session with Chrome:

```py
from selenium import webdriver

driver = webdriver.Chrome()
```
This will start a new Chrome window, and the driver object will be our interface for interacting with the browser.

## Navigating to a URL

Once we have a browser session, we can navigate to a URL using the get method. Here's an example: 

```py 
driver.get("https://www.example.com")
```
This will load the specified URL in the browser window.

## Finding Elements

One of the most powerful features of Selenium is its ability to find elements on a web page. We can do this using the find_element method. Here are a few examples:
```py
# Find an element by ID
find_element(By.ID, "id")

# Find an element by name attribute
find_element(By.NAME, "name")

# Find an element by xpath
find_element(By.XPATH, "xpath")

# Find a hyperlink
find_element(By.LINK_TEXT, "link text")
find_element(By.PARTIAL_LINK_TEXT, "partial link text")

# Find an element by its tag name
find_element(By.TAG_NAME, "tag name")

# Find an element through its class name
find_element(By.CLASS_NAME, "class name")

# Find an element with its CSS selector
find_element(By.CSS_SELECTOR, "css selector")
```

Once we have a reference to an element, we can interact with it in various ways. For example, we can get its text content with the text attribute:

```py
# get the text content of an element
text = element.text
```

## Additional Information

Since this is just a basic introduction, a lot of aspects of Selenium have been left out. For the full documentation, head to their official doc site.
What is Database Normalization?
Published: 2023-04-21 20:23:05

---
title: What is Database Normalization?
published: true
date: 2023-04-14 18:33:38 UTC
tags: 
canonical_url: https://harshmange.hashnode.dev/what-is-database-normalization
---

Database normalization is a process of organizing the data in a relational database in a structured and efficient way, by minimizing data redundancy and dependency. It involves breaking up large tables into smaller, more manageable tables, and establishing relationships between them.

Normalization is achieved by following a set of rules, called Normal Forms (NF), which are designed to ensure that each table has a well-defined purpose, and that data is stored in a logical and consistent way.

There are several normal forms, including first normal form (1NF), second normal form (2NF), and third normal form (3NF). Let's take a look at each of these normal forms, along with an example:

1. [First Normal Form (1NF)](https://harshmange.hashnode.dev/normalization-of-tables-from-1nf-to-2nf): A table is in 1NF if it contains only atomic values (values that cannot be further decomposed). For example, a customer table that stores a customer's address as a single field, like "123 Main St, Anytown, USA," violates 1NF because the address can be broken down into separate fields (street address, city, state, and zip code).

2. [Second Normal Form (2NF)](https://harshmange.hashnode.dev/normalization-of-tables-from-2nf-to-3nf): A table is in 2NF if it is in 1NF and all non-key attributes are dependent on the primary key. For example, consider a table that stores orders and order items. The order table has a composite primary key consisting of order ID and customer ID, while the order items table has a composite primary key consisting of order ID and product ID. To achieve 2NF, we could split the order items table into two tables: one that stores order details (order ID, customer ID, date, etc.), and one that stores order item details (order ID, product ID, quantity, price, etc.).

3. [Third Normal Form (3NF)](https://harshmange.hashnode.dev/normalization-of-tables-from-3nf-to-bcnf): A table is in 3NF if it is in 2NF and all non-key attributes are independent of each other. For example, consider a table that stores employee data, including employee ID, name, department, and department manager. The department manager is not directly dependent on the employee ID, but rather on the department ID. To achieve 3NF, we could split the employee table into two tables: one that stores employee details (employee ID, name, department ID, etc.), and one that stores department details (department ID, department name, department manager, etc.).

By following the rules of normalization, we can create a well-organized and efficient database structure that is easy to manage and maintain.
Update on Contractr: Progress on User Authentication, User Profiles, and Chat Feature
Tags: webdev, javascript, programming, react
Published: 2023-04-15 00:39:01

Hello everyone,

Day 74 of #100DaysOfCode

I am excited to provide an update on the progress I've been making on the Contractr project. Building a web application that connects freelancers with potential clients has been an exciting and challenging experience, but I am enjoying every bit of it.

Today, I've been working on implementing cookies to allow for successful user sign up and login functionality. It was not an easy task, but I am happy to report that I've made significant progress on this front. Users can now sign up and log in to their accounts with ease, and I am delighted to see how this feature has come together.

One of the most significant challenges I encountered was figuring out how to handle user authentication securely. However, through extensive research and testing, I was able to implement a robust encryption system that ensures user data is kept secure. I take great pride in this achievement, knowing that users can trust the application to keep their information safe.

Currently, I'm working on saving user profile information to the database and retrieving it as part of the cards to swipe on. While there have been some challenges in working with the database, I am confident that I'll be able to address them and get this feature up and running soon. This is a critical component of the Contractr app as it allows clients to easily find freelancers that meet their needs.

In addition to making progress on saving user profile information, I also worked on the chat feature, but it will be my main focus in the upcoming days. This feature will enable freelancers and clients to communicate with ease, which will improve the overall user experience. Although I haven't made significant progress on this front yet, I am excited to start working on it in the upcoming days.

Overall, I am pleased with the progress I've made so far on the Contractr project. While it has been challenging at times, it has been an enjoyable experience building this application. I am excited to continue building out this app and making it the best it can be, and I look forward to sharing more updates with you all soon.

Thank you for your interest in the Contractr project, and stay tuned for more updates.
Git Actions
Tags: git, opensource
Published: 2023-04-15 00:30:33

## This week in Star Chart

We are nearing the 1.0 release of star chart and a lot of the big ticket items are done, the site really seems as though it is coming together and we even deployed it to production.

Initially we intended to deploy to production every time we pushed a v Tag for a new version of star chart and have an action run that would automate the release and change log for that new version tag. We tried testing this and found that we had some problems with permissions which will be a common theme this week although for a different reason later and we decided instead to create a release branch. The releases will be done by merging the appropriate version of main into the release branch and that will trigger the release to prod. What I did is I got an action working that will automate a changelog, creating a release tag with the release and taking all of the new commits from this release tag to the previous one and documenting them in a change log for the new release.

This was achieved using the following action: [Action!](https://github.com/marvinpinto/action-automatic-releases). Initially this was what I intended to use to automate releases on pushing version tags but it also worked for this. The problem I ran into was the following: 
```
 Generating release tag
  Attempting to create or update release tag "release"
  Could not create new tag "refs/tags/release" (Resource not accessible by integration) therefore updating existing tag "tags/release"
```

I realized that it was a permissions problem but could not figure out at a glance what permission I was missing and this wasn't really documented in the action docs so I eventually found my way to [Github Docs](https://docs.github.com/en/rest/overview/permissions-required-for-github-apps?apiVersion=2022-11-28). I made an educated guess as to which of these subheadings we would need by matching what I saw in the error to a similar looking git api. After adding permissions to the yml file to write content the next release worked and generated a change log:

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

PRs: [#563](https://github.com/DevelopingSpace/starchart/pull/563), [#590](https://github.com/DevelopingSpace/starchart/pull/590), [#609](https://github.com/DevelopingSpace/starchart/pull/609)
I do badly at tests
Tags: beginners, architecture, programming
Published: 2023-04-15 00:13:53

I am an Information Technology major, a sophomore. I'm writing my second semester exams now, and today I wrote an exam on computer architecture.

Now, while studying the material for the course, reading stuff online about concepts like pipelining and parallel processing, I enjoyed every bit of that.

Understanding the concepts were intuitive, I understood them on an empirical level. Some conventions in a C plus plus course I take and concepts became clearer as well.

Problem is, I wasn't able to put in writing what these concepts mean in computer science jargon. I got into this mental block. And there was no way I could use "explain-like-i'm-five" grammar in this exam. The lecturer implied, during lectures, that jargon was to be used to answer exam questions to get full marks.

What caused my mental block? I was a nervous wreck overthinking how to present my thoughts in nerdy jargon.

I'm used to writing and speaking "explain-like-i'm-five" grammar from my experience in content writing and ghost writing.

Maybe it's because I'm going to be graded, I felt trapped in my head. I reenacted many Prison Break episodes in my head, I won an Noble prize for Science in another universe in my head. All while exams were ongoing.

On the other hand, swapping definitions of concepts and practical scenarios where they were implemented with my roommate in pidgin English was more interesting and refreshing. 

**I don't do well on tests** might not be a suitable title for this post, but I wanted to use a Suits reference.
Building Web Applications with Rocket for Rust
Tags: rust
Published: 2023-04-15 14:01:11

---
title: Building Web Applications with Rocket for Rust
published: true
date: 2023-04-15 00:06:46 UTC
tags: rust
canonical_url: https://dlcoder.medium.com/building-web-applications-with-rocket-for-rust-ea153a5b7c58
---

[![](https://cdn-images-1.medium.com/max/600/0*stfHWrp0RE3AXGyP.png)](https://dlcoder.medium.com/building-web-applications-with-rocket-for-rust-ea153a5b7c58?source=rss-93bca1b4c1e9------2)

[Continue reading on Medium »](https://dlcoder.medium.com/building-web-applications-with-rocket-for-rust-ea153a5b7c58?source=rss-93bca1b4c1e9------2)
Android vs Desktop App Kotlin Compilation Process
Tags: android, kotlin, beginners
Published: 2023-04-15 00:00:00

**Android and Desktop app Kotlin compilation process comparisons - Java Virtual machine(JVM), Dalvik Virtual Machine(DVM) and Android Runtime(ART)**

Have you ever wondered what happens when you compile your Kotlin source code?

The **Kotlin Compiler** doesn't convert your code to machine code directly, but it **converts your code to bytecode** instead.

Then, the **Kotlin Interpreter/Virtual Machine converts the bytecode to machine code** during run-time/installation time.

## Java Virtual Machine (JVM)

In the desktop app, the Kotlin interpreter is called Java Virtual machine (JVM).

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676715279563/2b117e7b-d67d-4d1d-933c-c9e234b203ac.png)

The **JVM compiles the Java bytecode(\*.class) to machine code** when the app is launched. This is called the Just-in-time (JIT) compilation.

## Dalvik Virtual Machine (DVM)

In the Android app, the **Kotlin Interpreter is called Dalvik Virtual Machine (DVM)**. It is similar to JVM except it doesn't read in Java Bytecode but Dalvik bytecode.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676715214920/23522058-ef22-48d4-9ac3-7e942e31c99f.png)

So there is one additional layer where the **DEX Compiler (DX) compiles the Java bytecode into Dalvik bytecode(\*.dex)**.

Then, **Dalvik Virtual Machine (DVM) compiles the Dalvik bytecode into machine code** when the app is launched. So the DVM is also a Just-in-time compilation.

## Android Runtime (ART)

After Android KitKat / Version 4.4 / API Level 19 was introduced in 2013, the **Dalvik Virtual Machine (DVM) is replaced by Android Runtime(ART)**.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676715133275/6f361b6a-65db-4971-9c3e-ba05aa72280f.png)

**ART** is similar to DVM except it **compiles the Dalvik bytecode to machine code during app installation.**

This is called the **Ahead-of-time compilation**. The benefit is it runs faster during app launching at the expense of executable file size.

## Conclusion

Well, this is just a high-level diagram to show the Android app compilation process. I was not completely aware of this compilation process before, which I believe is a super important concept for all Android app developers to understand.

For more details about ART (which you don't need to know), you can refer to the official documentation [here](https://source.android.com/docs/core/runtime).

------

*Originally published at [https://vtsen.hashnode.dev](https://vtsen.hashnode.dev/android-vs-desktop-app-kotlin-compilation-process)*.