teleren/devto huggingface dataset:
Create project using Spring Boot 3
Published: 2024-01-08 02:13:15

To start the series of posts about **How to build REST API with Spring Boot 3**, we need to create the initial project files and some configurations.
This series will explore the steps to implement the entity, service, and control layers about RESP API.

If you don't kwon what is REST API, I recommend you read this [post](https://aws.amazon.com/pt/what-is/restful-api/) from Amazon.

## Create a project
To make our lives easier, I will use [https://start.spring.io](https://start.spring.io).
Choose project by maven with the language JAVA 21, the version of spring boot can be 3.2.1.
On the right of the screen, add this dependencies:
- Spring Web
- Spring Data JPA 
- Spring Boot DevTools

In Project Metadata you can put the name of your project like this:
Group: com.spring
Artifact: SprignRest
Name: SprignRest
Description: Api Rest with Spring Boot
Package name: com.spring

Look to the picture to see the final configuration
![start.spring.io](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fhpc83e2xnj457r6t038.png)
After click em **GENERATE**, it'll download the project, unzip the file to the folder that you want.
Open this file in your favorite IDE, I will use IntelliJ, and go to the file pom.xml.
Add another dependency h2database inside **dependencies tags** and reload the project to import the new dependency.
```
<dependency>
	<groupId>com.h2database</groupId>
	<artifactId>h2</artifactId>
	<scope>runtime</scope>
</dependency>
```
![pom.xml](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dxf0t6ye0dkd5itn6n99.png)
## Firts configuration
In the application.properties we need to configure the H2 database

```
spring.jpa.hibernate.ddl-auto=update

spring.datasource.url=jdbc:h2:mem:restdb
spring.datasource.username=sa
spring.datasource.password=

spring.h2.console.enabled=true
spring.h2.console.path=/h2-console
```
How our database will be in memory, we need that the spring boot be responsible for create the tables, columns...
The first line do it.

The second block is to configure access settings for our database
And the final is to enable the console of H2 database.

## Run the project
Go to the SprignRestApplication class and click to start the application.
See the logs to guarantee that application is working in port default 8080 and H2 database too.

![logs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/70m0v1cv5800vqvme1tz.png)

Open http://localhost:8080/h2-console in your browser.
This is the endpoint about your database application, put the url,username and password equals to in application.properties to be able to see informations.
In this point the database will be null, but in the next post we'll configure the tables and records.

![h2login](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/brzkiatmuhljsgxok8gy.png)

## Conclusion
In this first post, we configure the initial dependencies and our database so that our project is ready to receive implementations of a REST API.

## Next Step
In the next step we will create an Entity class and some records for our application.
Step-by-step Guide to Installing Terraform on Windows
Published: 2024-01-08 01:44:13

Installing a new software package on your PC can sometimes feel daunting. Trust me, I did feel this way when I was trying to install Terraform on my Windows PC. So, if you are new to Terraform and want it installed on your Windows PC, this guide will walk you through the process.

> You can also check out my previous article on [a brief introduction to Terraform](https://dev.to/annysah/a-brief-introduction-to-terraform-fhm)


## Step 1: Download Terraform 

- Navigate to the [Terraform homepage]
(https://www.terraform.io/) and click on **"Download Terraform"**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6msk419y0wluw9bbty81.PNG)

- Select Windows under the **"Operating Systems"** section.

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

- Click on **"AMD64"** to download Terraform binary for a 64-bit operating system (OS) or **"386"** for a 32-bit OS.

- Navigate to your PC's Windows directory and create a new folder named **`terraform`**.

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

- In your Downloads, right-click on the downloaded Terraform binary file and select **"Extract All..."** The window below will pop up.

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

- Click on **"Browse..."** and navigate to the `terraform` folder created earlier. This is where you will extract the file. Once you are in the 'terraform' folder, click on **"Extract."**

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

## Step 2: Set Terraform Path to System Environment Variables
- In your Windows start menu, type environment and click **"Edit system environment variables."**

- Click on **"Environment Variables"** in the System Properties window.

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

- Under **"System variables,"** select the **"Path"**, then click **"Edit."**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/616li8bbp6qeufet6ahq.PNG)

- Click **"New"** and enter the path of the Terraform folder, which is `C:\terraform`. Click **"OK"** to close each window.

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

## Step 3: Verify Terraform Installation and Configuration

- Navigate to the folder path `C:\terraform` in a new command prompt window and type the `terraform -version` to verify the installed version.

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

To see more Terraform commands, you can simply type `terraform` in the terminal.

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

Now, you have successfully installed and configured Terraform on your Windows PC. Cheers to more learning!
Full stack developer
Tags: programming, android, frontend, mobile
Published: 2024-01-08 01:26:15

Hi! I'm a Full Stack Developer with a passion for crafting seamless digital experiences.

What I Bring:
- A knack for problem-solving and optimizing code
- Seamless collaboration with cross-functional teams
- Proficiency in Agile methodologies and project management tools

Why Choose Me:
- Continuous learner, staying current with industry trends
- Diverse portfolio showcasing impactful projects
- Passionate about coding and turning ideas into reality

Let's Connect:
Open to exciting opportunities and collaborations. Check out my work on samifalouti.wordpress.com. Feel free to reach out at samifalouti02@gmail.com.

Feel free to customize the details and adjust any parts to fit your style and specific information.
Nudges - A Gentle Push Towards Better Choices
Published: 2024-01-08 01:00:00

In the world of behavioral economics, the term "nudge" has become a powerful concept in influencing the decision-making processes of individuals. Coined by Richard Thaler and Cass Sunstein in their influential book "Nudge: Improving Decisions About Health, Wealth, and Happiness," a nudge is defined as any aspect of the choice architecture that alters people’s behavior in a predictable way without forbidding any options or significantly changing their economic incentives.

![](https://victorleungtw.com/static/6d659b539c5a10dda4817a89a5329c6e/f058b/2024-01-08.png)

### Types of Nudges

1. **Default Nudges**: These are based on setting a default choice which is more likely to be chosen because of inertia. For example, automatically enrolling employees in a retirement savings plan but giving them the option to opt out.

2. **Social Norm Nudges**: These nudges use the power of social influence. By showing that a particular behavior is the norm, individuals are more likely to conform. An instance of this is hotels indicating that most guests reuse their towels, encouraging others to do the same.

3. **Simplification Nudges**: These are based on the principle that if a choice is easier to understand, it's more likely to be chosen. For instance, simplifying the paperwork for financial aid can increase college enrollment.

4. **Salience Nudges**: These nudges make certain options more prominent or visible. An example is placing healthier foods at eye level in a cafeteria to promote better eating habits.

5. **Feedback Nudges**: Providing feedback about behavior can influence future decisions. For example, a monthly report on electricity usage compared to neighbors nudges people to reduce their consumption.

### Examples of Nudges in Action

1. **Organ Donation**: In countries where organ donation is an 'opt-out' system (default nudge), there's a higher rate of organ donors compared to countries where you have to 'opt-in'.

2. **Healthy Eating**: In school cafeterias, placing fruits and vegetables at the beginning of the serving line (salience nudge) has been shown to increase their consumption among students.

3. **Financial Decisions**: Apps that round up purchases to the nearest dollar and save the difference (simplification nudge) make it easier for people to save money without feeling a significant impact on their finances.

4. **Environmental Conservation**: Showing a building’s energy consumption in real-time compared to other similar buildings (feedback nudge) can motivate reductions in energy use.

5. **Public Health**: During the COVID-19 pandemic, social norm nudges were used by displaying signs about mask-wearing being a common practice, thereby encouraging more people to wear masks.

### Conclusion

Nudges represent a subtle yet powerful way to influence human behavior positively. By understanding how different types of nudges work, policymakers, businesses, and even individuals can create an environment where making the best choice becomes the easiest option. It's a testament to the power of gentle persuasion over forceful compulsion.
How To Recover Crypto Currency From Fraudulent Investment Platforms
Published: 2024-01-08 00:50:25

The world of cryptocurrency is a thrilling roller coaster soaring highs of potential, heart-stopping dips of volatility, and the ever-present hum of uncertainty. While the rewards can be immense, the risks are equally daunting, none more so than the chilling prospect of losing your hard-earned digital assets. This is where Digital web Recovery steps in, not just as a technical savior, but as a beacon of hope in the digital abyss. My story is unfortunately familiar. A seemingly innocuous phishing attack, a moment of carelessness, and my digital wallet, once brimming with promise, lay empty. The pit of despair was bottomless; the fear of financial ruin was paralyzing. Desperation led me down a rabbit hole of online forums and recovery "experts," each promising a solution, each leaving me with a deeper sense of helplessness. Then, I stumbled upon Digital Web Recovery. Their services, unlike the others, exuded a quiet confidence, and a sense of professionalism that resonated with my desperation. The testimonials, heartfelt and genuine, offered a glimmer of hope, a fragile spark in the darkness. I reached out to Digital Web recovery with a hesitant plea for help, and was met not with skepticism, but with genuine empathy and a meticulous understanding of my predicament. The recovery process itself was transparent. Every step was explained in clear, concise terms, and my questions were answered with patience and understanding. The Digital Web Recovery team never sugarcoated the challenges, but they never wavered in their determination to find a solution. Days turned into weeks, each update a nail-biting cliffhanger, until finally, the news arrived,my cryptocurrency, every precious Satoshi, had been recovered. The relief was overwhelming, a tidal wave of gratitude washing away the months of anxiety. But beyond the sheer joy of regaining my assets, it was the human touch that truly resonated. Digital Web Recovery wasn't just a recovery service; they were my digital lifeline, Contact them via; digitalwebrecovery(@)mail-me.com Telegram User; @digitalwebrecovery my unwavering support system in a time of crisis. My experience demonstrates Digital Web Recovery unwavering devotion to their clients as well as their technical expertise. They are aware of the psychological effects of losing cryptocurrencies, including the terror and despair that can overcome even the most experienced investor. They tackle every case with kindness and commitment, viewing each missing currency as a personal issue that must be solved.
Questi squisiti abiti da sposa sono progettati per assicurarti
Published: 2024-01-08 00:38:54


Preparati a gridare il tuo amore a gran voce con stile con l'ultima collezione di abiti da sposa Martina Liana! Questi squisiti abiti da sposa sono progettati per assicurarti che tu stia cercando niente di meno che eccezionale per il tuo giorno speciale, con tutti i nuovi abiti decadenti e sognanti come la tua storia d'amore. Questa collezione si ispira a tutte le principali tendenze dell'alta moda e agli stili da sposa senza tempo abito lungo da sera, dai dettagli scintillanti al minimalismo moderno ai fiori romantici. Continua a leggere per scoprire la lussuosa bellezza di Martina Liana.

[​http://www.gillne.it](​http://www.gillne.it)
Per i veri romantici con uno spirito gentile, lo stile 1358 porta il fascino glamour. Questo vestito presenta fiori 3D fluttuanti abito da sposa economico, accenti di perline scintillanti e un fiocco delicato, con una gonna ispirata alla ballerina che aggiunge un'eleganza senza sforzo.

Lo stile 1373 è la tua fantasia floreale definitiva portata in vita. Questo abito da sposa porta la drammaticità, con tessuto floreale tagliato al laser dalla testa ai piedi, tulle e dettagli in paillettes, che conferiscono a questo abito uno splendido splendore.

Per un look morbido e romantico nel giorno del matrimonio, lo stile 1374 presenta disegni floreali decorati e strati di tulle schiumoso, con stelle filanti opzionali che scorrono sulle spalle aggiungendo un tocco etereo.
JavaScript Arrow Functions and Their Uses
Tags: javascript, beginners, webdev, discuss
Published: 2024-01-08 00:32:00

## Introduction

JavaScript Arrow Functions, also known as fat arrows, are a new feature of the language which are used for writing concise and short functions. These functions are extremely useful for writing simplified and more concise code.

## Advantages

The main advantages of Arrow Functions are their ability to reduce the amount of code needed to write a program, saving developers time and energy. Arrow Functions also allow code to be more readable, concise, and organized.

## Features

Arrow Functions do not require the use of the `function` keyword, use shorter syntax, can be written in a single line, and also do not need parentheses when passing one argument. Arrow Functions can also be used with the spread operator, allowing developers to quickly expand an array or object into multiple variables.

### Example 1: Single Argument

Here is how you can define a function that squares its input, using an arrow function:

```javascript
const square = x => x * x;
console.log(square(5)); // Outputs: 25
```

This example demonstrates the concise syntax of arrow functions when a single argument is passed.
### Example 2: Using the Spread Operator

Arrow Functions work well with the spread operator for functions expecting multiple arguments:

```javascript
const sum = (...args) => args.reduce((acc, current) => acc + current, 0);
console.log(sum(1, 2, 3, 4)); // Outputs: 10
```

This code snippet showcases an arrow function utilizing the spread operator to sum an arbitrary number of arguments.

## Disadvantages

The main disadvantage of Arrow Functions is that they are not backwards compatible and may lead to problems when running older code. Additionally, Arrow Functions have their own scope which is not shared with the rest of the code, can make understanding code more difficult, and may cause unexpected behaviour.

## Conclusion

In conclusion, JavaScript Arrow Functions are a useful tool for developers looking to write shorter and more concise code. Although there are some drawbacks, careful consideration should be made before using Arrow Functions, as they may lead to unexpected behaviours.
Workplace Authenticity: Balancing with Professionalism?
Published: 2024-01-08 00:00:00

---
published_at : 2024-01-08 00:00 +0000
---
Reflect on the call for authenticity in the workplace. How can individuals balance authenticity with professionalism, and what benefits does it bring to corporate culture?
<br>
Follow the [CodeNewbie Org](https://dev.to/codenewbieteam) and [#codenewbie](https://dev.to/t/codenewbie) for more discussions and online camaraderie!

*{% embed* https://dev.to/codenewbieteam *%}*
2024 Health Routines for Well-being?
Published: 2024-01-08 00:00:00

---
published_at : 2024-01-08 00:00 +0000
---
What practices or routines are you adopting to ensure a healthy and balanced lifestyle in the realm of physical and mental health in the coming year?
<br>
Follow the DEVteam for more discussions and online camaraderie!
{% embed https://dev.to/devteam %}
Add Azure Developer CLI deployment ID and UTC timestamp to Bicep files
Tags: cloudnative, deployment, azuredevelopercli, bicep
Published: 2024-01-09 03:30:12

---
title: Add Azure Developer CLI deployment ID and UTC timestamp to Bicep files
published: true
date: 2024-01-08 00:00:00 UTC
tags: Cloudnative,Deployment,AzureDeveloperCLI,Bicep
canonical_url: http://dfberry.github.io/2024-01-08-bicep-timestamp.md
---

If you frequently deploy to Azure with Azure Developer CLI, either through your local computer or through an automated pipeline, you need a quick and obvious way to track back from the Azure resource to the pipeline or deployment.

In order to mark the deployment resource itself, use the Azure Developer CLI's `deployment().name` and the Bicep `utcNow()` function to mark your deployments. The `deployment().name` is the name of your environment and a timestamp (expressed as a unix timestamp).

To use these in your bicep file, a sample snippet of code is provided:

```
param deploymentDateTimeUtc string = utcNow()
param deploymentName string = deployment().name
```

<button type="button" aria-label="Copy code to clipboard" title="Copy"><span aria-hidden="true"><svg viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button>

You can use these variables in your Bicep to add as tags to your resources.

```
var tags = {
  'azd-env-name': environmentName
  'azd-deployment-id': deploymentName
  'azd-deployment-utc': deploymentDateTimeUtc
}
```

<button type="button" aria-label="Copy code to clipboard" title="Copy"><span aria-hidden="true"><svg viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button>

You can also export the variables as an environment variable to use in post-processing activities.

```
output DEPLOYMENT_NAME string = deploymentName
output DEPLOYMENT_DATETIME_UTC string = deploymentDateTimeUtc
```

<button type="button" aria-label="Copy code to clipboard" title="Copy"><span aria-hidden="true"><svg viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button>

If you are using Terraform instead of Bicep, with Azure Developer CLI, you still have access to the deployment name but the `utcNow()` is not available.
The LightBox Nerd Snipe
Published: 2024-01-29 04:44:56

---
title: The LightBox Nerd Snipe
published: true
date: 2024-01-07 22:32:34 UTC
tags: 
canonical_url: https://alex.party/posts/2024-01-07-the-lightbox-nerd-snipe/
---

I’ve been [nerd sniped](https://xkcd.com/356/).

A few weeks ago, Raymond Camden posted about [An Image Dialog Web Component](https://www.raymondcamden.com/2023/12/13/an-image-dialog-web-component) and I read that article, added some discussion about how you’d style it, then promptly stopped thinking about it… _ **consciously** _. I think it’s been floating around in the back of my brain because another colleague recently asked what [lightbox](https://lokeshdhakar.com/projects/lightbox2/) scripts people were using with astro and other SSGs. My immediate thought was “Well, that should be a web component…” completely forgetting that Raymond made a post about it nearly a month prior.

Anyway, I made my own version.

See the Pen <a href="https://codepen.io/fimion/pen/GReZMMx">

light-box by Alex Riviere ([@fimion](https://codepen.io/fimion))

on [CodePen](https://codepen.io).

This version is a bit more forgiving than Raymond’s. It looks for any link with an image inside of it. Which makes it easier to use it with a list, or whatever nested structure you want. It also allows for multiple images and then will give you previous and next buttons based on what is there, but will limit itself to the contents of the current light-box.

Anyway, You’re welcome. Go use this for good.

Or chaos.

Have fun.