teleren/devto huggingface dataset:
Why Spring Matters for Java Developers
Tags: java, spring, springboot, programming
Published: 2024-06-01 00:15:02

## Writing Java Applications in the Past

When writing Java applications in the past, writing all the functionalities from scratch was common. It was time-consuming, requiring significant effort to create various factories, infrastructure code, setup code, etc.

## Growth of the Java Ecosystem and the Problem with Large Libraries

As the years passed, the Java ecosystem grew, and many libraries were created and shared to solve developers' common development problems. While these libraries were useful, they started to come with a cost.

These libraries grew too large, and using a simple functionality from a library required loading the entire package. Imagine importing a library with a thousand classes just to use a single one. Packaging your application would include all those classes even if you only needed one.

## The Solution: Small, Specific Libraries and Spring

This became a problem. A better idea was to have small libraries specific to certain problems, decoupled by topic. Instead of having large jars that did everything, we started to use small jars to solve specific problems.

For example, Jackson is a library specialized in serializing and deserializing JSON objects.

Now, Spring is a collection of these useful jars that can help you create your applications. It allows you to create a combination of dependencies (libraries) that suit your needs.

## Benefits of Spring

Spring helps by using the convention over configuration pattern. It creates a series of infrastructure beans based on the dependencies you add to your project, making things easier by providing a default configuration and allowing you to configure only what matters to you.

For example, are you using Kafka? Use the Spring Kafka dependency, customize your Kafka broker URL and some other configurations, and you're ready to go. Spring will provide a bean to send or consume messages from Kafka.

## Simplifying Development Decisions

It reduces the decisions developers need to make about handling connections, whether to use a singleton, where to put topic configurations, etc. It's already done; just customize it, and you're ready to go.

Spring uses these abstractions to make you more productive so you can focus on what matters most!

Do you use Spring in your projects? Many developers started working with Spring without knowing the Java past and how Spring makes our lives easier.

If you like Spring make sure to follow me and stay tuned to learn more! Don't miss out!

[Willian Moya (@WillianFMoya) / X (twitter.com)](https://twitter.com/WillianFMoya)

[Willian Ferreira Moya | LinkedIn](https://www.linkedin.com/in/willianmoya/)

Follow me here on dev.to!
Profile Card Using HTML CSS & GSAP
Tags: html, javascript, webdev, beginners
Published: 2024-05-31 23:57:02

Hello Guys,

 Created an Animated profile card using HTML CSS & GSAP Animation. I use the simple card and use GSAP timeline() to animate the card using gsap.from() you can animate a card. I hope you like this also comments about your thoughts. 

{% codepen https://codepen.io/mhmpmurm-the-looper/pen/QWRpdEd %}
Kong Gateway - Validando configurações específicas para exposição de serviços
Tags: kong, deck, gateway
Published: 2024-05-31 23:37:59

Olá, Mentes Tech!

Essa semana testei o deck files lint que é uma feature do deck, que usa o projeto [vacuum](https://github.com/daveshanley/vacuum) para esta implementação.


> [Caso Uso] Existe a necessidade de identificar o proprietário de cada rota em nosso ecossistema. 
Como solução, foi requisitado que todas as rotas contenham a propriedade tags preenchida com nome da squad e que a versão do Kong seja mantida em 3.1.

Referência: [Ruleset](https://quobix.com/vacuum/rulesets/understanding/)
Repositório: [kong-bussiness-rules-lint](https://github.com/devxbr/kong-bussiness-rules-lint)

Criei duas regras, uma para validar se a propriedade tag existe e possui valor, e a segunda regra é se a propriedade _format_version é 3.1.


![ruleset.yml](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r8mlk1xldzs9c1cgntkr.png)


Criei duas configurações de rotas


![config.yml](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rzhqx858khtmbpc8wz60.png)



![corrupted.yml](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mm1lbb1vca2c35wwg961.png)


Então criei uma imagem com deck na versão latest


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

No Dockerfile tem comandos para validar o arquivo de configuração contra um ruleset.

`RUN deck file validate corrupted.yml`
`RUN deck file lint -s corrupted.yml ruleset.yml`

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

Chegamos ao fim...

como você configura seu Gateway Kong?
Weekly Updates - May 31, 2024
Tags: couchbase, ai, community, nationalclouddatabaseday
Published: 2024-05-31 23:28:30

Hello Readers! 
I hope all of you had a really good week! 
Here are our updates for this week:

- 🎉 **We're Celebrating: National Cloud Database Day!** - Every year on June 1, we want to celebrate this special day. You can read more [about National Cloud Database Day here >>.](https://www.couchbase.com/clouddbday/) As part of our celebration, we have published a blog post talking about how Cloud Databases are in their AI Era. [*You can read the blog here >>*](https://www.couchbase.com/blog/national-cloud-database-day-2024/)
<br>

- 📺 **Brand New Video: Cloud to Edge Gen AI & Vector Search with Couchbase** - Join Mark Gamble and Shivay Lamba for a special event where they'll explore Couchbase's cloud-to-edge vector search capabilities, including a showcase on how Couchbase can be used for building applications with unified cloud-to-edge search & offline-first capabilities  [*You can watch the video here>>*](https://www.youtube.com/watch?v=BYgIne9Zi8Q)
<br>

- 🤝 **Do you enjoy technical talks and meetups?** We have Couchbase specific User Groups! We would love to meet you in person! [*You can see a list of the groups and their events here >>*](https://www.meetup.com/pro/couchbase)
<br>

- 👋 **Summit Season is still ongoing!** - Are you traveling to any of the AWS or Google Summits or other Tech Expos? Come say Hi and meet the team! [*You can see the Summit's we will be attending here >>*](https://www.couchbase.com/resources/webcasts-and-events/?cb_searchable_posts_asc%5BrefinementList%5D%5Btaxonomies.events_category%5D%5B0%5D=Tradeshow)
<br>

Have a great weekend everyone!
How to generate random number in PHP
Tags: php, programming, webdev, backenddevelopment
Published: 2024-05-31 23:15:35

Ever wondered how to generate random numbers in PHP using a simple function while excluding some numbers you don't want, just like a friend of mine that requested for this code?

Here's how to do it:

```php
<?php
function generateRandomNumber($min, $max, $excludedNumbersArr) {
    do {
        $number = rand($min, $max);
    } while (in_array($number, $excludedNumbersArr));

    return $number;
}

// Use it this way
echo generateRandomNumber(50,250,[123,145]); //This PHP function generates a number between 50 and 250, excluding 123 and 145.
?>
```

### Explanation:
1. **Set the Range**: The function defines the minimum (`$min`) and maximum (`$max`) values for the random number.
2. **Excluded Numbers**: An array `$excludedNumbersArr` contains the numbers you want to exclude.
3. **Generate Random Number**: A `do-while` loop generates a random number using `rand($min, $max)`. It continues to generate a new number until the number is not in the `$excludedNumbersArr` array.
4. **in_array()**: This is a PHP function that checks if a value exists in an array. It takes two parameters:
> **Value**: The value you want to search for.
> **Array**: The array in which you want to search for the value.

5. **Return the Number**: Once a valid number is generated, it is returned.

This function ensures that the generated number is within the specified range and does not include the excluded values.

Thanks for reading this article.

I write codes on demand. Let me know the code you need, and I will help you write them in your programming language.


**PS:**
I love coffee, and writing these articles takes a lot of it! If you enjoy my content and would like to support my work, you can buy me a cup of coffee. Your support helps me to keep writing great content and stay energized. Thank you for your kindness!
[Buy Me A Coffee](https://buymeacoffee.com/yafskkw).
How I got $2500 from a single software license
Tags: startup, sales, webdev, programming
Published: 2024-05-31 23:03:14

🥳 Landed a BIG client! Here's how I got $2500 from a single software license.

They already had a lower-tier, Company license. They purchased it during last year's Black Friday sale for around $190.

After using the product internally for the last 6 months, they realized that their clients could also get value out of using it.

When they emailed me asking about the migration process from Company to Agency, it was close to midnight. But I knew that the sooner I responded, the higher the chances that they would buy. I quickly replied, asking for their license key, for verification purposes (I did this mostly to gain time). Then, I got an idea. I had to show that the migration process will be easy and smooth.

I started coding. And coded I did... I coded from midnight until 6AM in the morning. After improving the migration system (and also enabling a feature to easily switch from a single to a multi-database setup, which they were interested in), I sent them a discount coupon for the amount they have already paid ($180). I made sure to mention the work I did to ease their migration process. 

After a few hours, I got another email. This time, it was from Paddle: they purchased. The final price, including the discount, was $2310. I think they would have purchased at full price too, but I believe it's only fair to just pay for the difference.

$2310 is a considerable amount for an indie-hacker like me, as it covers rent and expenses for a month. This is not the whole story, though. I learned something more. Last month, I increased the prices to better match the value of the product. I was afraid that the new, higher prices, will scare away potential customers. It turns out, it didn't.

My takeaways from this story:

 - Responding quickly to sales and support inquiries makes a BIG difference.
 - Always provide proof to the customer that they will be well taken care of. With your actions, not with words.
 - The pricing doesn't matter as much as you would think if your product is good and does bring value to customers. Offer higher quality and price higher instead of joining the race to the bottom.
experience in phase 4
Published: 2024-05-31 15:46:56

SO phase 4 has kinda been more than a little rough, lots of personal stuff going on in my life and I've been very distracted not to mention the literal tornadoes and loss of power for like a week, but I do actually like the material we're going over in phase 4, I used a little bit of it in phase 3 on accident when I was making my final project, I didnt have a very good understanding of it then, but I think I learned a lot more about it now and am much more comfortable with it.

all that being said I have been stuck on this final project for a while now, I've been working non stop on it but I have this terrible habit of overcomplicating my code and doing things that aren't required, in this case its kinda gone too far I kept looking for complicated fixes to problems that I cause by using complicated code and it just became too much of a web, I've completely restarted it a few hours ago trying to start from the beginning and keep it simple, but I cant get the frontend requests to work, like my login feature is just supposed to make a post request to /login on the backend but /login on the backend just doesnt work and I dont know how to fix it I have tried so many different things now, but I just cant get it, I probably messed up something small and accidentally covered it up or just never noticed it.

I'm hoping its something simple atleast then when I talk to you I can quickly finish up everything after you help, but if not I'm making sure all of my other assignments are completed and ready to go

I kinda wanna restart again and just do everything as basic as possible and what I know but I think I'm a little too short on time for that, I wasted so many hours stuck on something and was just way too stubborn to move on without fixing it, actually now that im thinking about it I need to quickly get rid of the token based authorization I got set up, I really cant explain it well at all, I just followed a guide online, only used it because I thought maybe it was my password hash that was causing an issue and wanted to try an alternative

thats everything though I just wanted a short break from coding to ramble a bit, I really like the content in phase 4 though
On VSCode, how to open the selected folder from Explorer view into the current open terminal (without opening a new one)?
Tags: vscode, howto, terminal
Published: 2024-05-31 22:49:51


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

## 1. Install the [multi-command](https://marketplace.visualstudio.com/items?itemName=ryuta46.multi-command) extension  
This allows us to create a sequence of commands that can be used by a keybinding.

## 2. Add this snippet to your `settings.json`
```json
"multiCommand.commands": {
  "multiCommand.openFolderInTerminal": {
    "interval": 10,
    "label": "Open Explorer view folder in active terminal",
    "sequence": [
      "copyFilePath",
      "terminal.focus",
      {
        "command": "workbench.action.terminal.sendSequence",
        "args": { "text": "cd \"" }
      },
      "workbench.action.terminal.paste",
      {
        "command": "workbench.action.terminal.sendSequence",
        "args": { "text": "\"" }
      },
      {
        "command": "workbench.action.terminal.sendSequence",
        "args": {
          "text": "\u000D"
        }
      }
    ]
  }
}
```
What this effectively does is to copy the path of the selected folder and send sequences of text to the terminal, as stated [here](https://code.visualstudio.com/docs/terminal/advanced#_custom-sequence-keybindings). The quotes are escaped by `\` and `Enter` is sent by the newline unicode character `\u000D`.

## 3. Add a keybinding to your `keybindings.json`
```json
{
  "command": "multiCommand.openFolderInTerminal",
  "key": "ctrl+enter",
  "when": "filesExplorerFocus && !inputFocus"
}
```
The value of the `"command"` key has the same text as the one defined on the `"multiCommand.commands"` object.
Cloud Resume Challenge - Chunk 3
Tags: webdev, devops, aws, career
Published: 2024-05-31 22:36:33

Here is the previous [post](https://dev.to/brianhaas/cloud-resume-challenge-chunk-2-1p78) in this series.

## What's needed for the CRC Chunk 3

Not much really. Just a few lines of javascript on the static website to call the API, get the hit count and present it on the page. 

This required me to revisit my [Hugo](https://gohugo.io/) website. I opened up the developer tools in Edge to figure out which section was which to decide where I wanted to place my hit counter. 

I learned about layouts and partials in hugo in order to customize the Hugo template I was using to put my javascript code and hit counter section where I wanted. 

Here is the [finished HTML section](https://github.com/chronosAZ/CRC-Frontend/blob/main/web/index.html#L96)

And here is what the counter looks like on my page:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yovyh85wsbwzaq9wqf6l.png)


### What's next and final thoughts on the CRC

There is quite a bit I can do to improve and refine the work I've done here. Namely, writing tests. I know, I know, I should've followed the test-driven development principle, but I didn't since it was a fairly simple application. 

I can also do some of the security mods and beef up the API function, so it counts unique visitors rather than just page hits.

I'm also considering doing the challenge in Google Cloud and Azure to get more familiar with them. 

All in all, I think the CRC is good because it gives you a set of requirements, but it doesn't tell you how to do them, instead it leads you to resources to figure them out on your own. 

A lot of training these days is tutorial based, where they just walk you through the concepts and then give you all the code and answers, rather than have you try to work something out on your own. Figuring out how to solve a problem is what DevOps personnel do. 

Tools come and go. Figuring out how to onboard a new tool or new service and fit it into the existing tech stack, is way more important than just copying down someone else's answers. 

The CRC was a great refresher for me to get back in the workflow of a DevOps engineer.
Node.js is not single-threaded
Tags: node, javascript, backend, programming
Published: 2024-05-31 22:32:49

Node.js itself is not single-threaded.

Node.js developers often confuse the main single-threaded event loop with Node.js entirely.

When a Node.js app is running, it automatically creates 4 threads under the worker pool for blocking tasks.

So at any given time, there are at least five threads.

This worker pool is managed by Libuv.

The blocking tasks are mainly I/O-bound and CPU-intensive.

1. I/O bound
a. DNS: dns.lookup(), dns.lookupService()
b. File system except fs.FSWatcher()

2. CPU-intensive tasks
a. Some crypto methods such as crypto.pbkdf2(), crypto.scrypt(), crypto.randomBytes(), crypto.randomFill(), crypto.generateKeyPair()

b. All zlib APIs other than those using libuv thread pool synchronously.

The main thread/event loop works for JavaScript execution as usual, but the worker pool takes care of blocking tasks for the main loop.

So, Node.js shouldn't be confused.

Thanks for reading.

I do a deep dive into foundational concepts & how things work under the hood. You can consider connecting with or following me, Ali Raza, here and on [LinkedIn](https://www.linkedin.com/in/thealiraza/) to get along with the journey.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6q1hgko27x88u7jiaxsb.gif)
Why Are You Here?
Tags: career, learning, discuss
Published: 2024-05-31 22:25:03

I should preface this by saying that I don't mean to be elitist or keep any sort of gate. I am just wondering what you may think.

I started studying for my computer science bachelor's degree in 2020. Computing at the time was a lot different from computing now. Back then, cloud computing was all the rage given the pandemic that made cloud computing a real useful tool. It took its time as the main trend in computing up until web 3 was being discussed as a technology that is "just around the corner." We never quite got there and the focus shifted towards generative AI.

This field changes significantly faster than most other fields that people may choose to study with passion. It's hyper-sonic compared to a field like law or medicine. It occurs to me that the field I started studying in 2020, despite being fundamentally the same, is a lot different nowadays than it was when I started. I asked myself, "Why did I choose computer science?"

I won't bore you with my on soul-searching, but long story short, I was always the computer guy around my social circle and I guess I felt most excited about and most ready for this field. When observing my peers, I found that they questioned their existence in my college program whenever a new trend came out or an impressive innovation was announced. Some of my peers would lose their motivation and self-esteem, while others would work extra hard to try and keep up, and both reactions resulted in some sort of hate or resentment towards the field.

Now, I may have stuck long enough to answer the title question and realize I like what I'm doing, but I don't guarantee that for everyone else. Whether you're studying for a degree or you're self-learning purely to not miss out on the trends, I believe it is important you ask yourself why you think you're here.

I'm not an expert on psychology to explain how having a purpose helps you, but just knowing why you're here makes a world of difference. You'll have your own goals and specialization interests. Suddenly, computer science won't look like a spaghetti of paths that you can take. You'll have a path that's enticing for you to walk.

I hope I was able to express what I thought well, and I hope these fleeting thoughts helped. :)
একজন মা তার ছেলেকে জন্ম দেন নাড়ী থেকে
Published: 2024-05-31 22:05:20

একজন মা তার ছেলেকে জন্ম দেন নাড়ী থেকে,
একজন স্ত্রী সেই ছেলেকেই স্বামী হিসেবে জন্ম দেন হৃদয় থেকে।

একজন মা তার অদেখা ছেলেকে অনুভব করেন পেটে হাত রেখে দশ মাস,
একজন স্ত্রী সেই অচেনা ছেলেকেই অনুভব করেন বুকে হাত রেখে সারাটাজীবন।

একজন মা জন্ম দেন একজন শিশু পুত্রকে,
একজন স্ত্রী জন্ম দেন একজন পরিণত পুরুষকে।

একজন মা তার সন্তানকে হাত ধরে হাঁটতে শেখান,
একজন স্ত্রী সেই সন্তানের হাত ধরেই জীবনের সমস্ত পথটা হাটেন।

একজন মা তার সন্তানকে কথা বলতে শেখান,
একজন স্ত্রী প্রিয় বন্ধু হয়ে সারাজীবন তার কথা বলার সঙ্গী হয়ে ওঠেন।

সন্তানের দায়িত্ব কাঁধে আসতেই মা তার সমস্ত পৃথিবী ভুলে যান,
আবার স্ত্রী সেই সন্তানের দায়িত্ব নেবেন বলেই তার সমস্ত পৃথিবীটা ছেড়ে একদিন চলে আসেন।

সন্তান না খেতে পারলে পাতের সেই উচ্ছিষ্ট খাবার মা এবং স্ত্রী উভয়েই খান, আবার সন্তান এবং স্বামীর মঙ্গল কামনায় উপবাস মা এবং স্ত্রী দুজনেই করে থাকেন।

সন্তানকে বড় করেও সন্তানের থেকে প্রতিটা মাকেই আঘাত পেতে হয়।
আবার স্বামীকে বিয়ে করেও প্রত্যেকটি স্ত্রীকে এক না একদিন নির্যাতিত হতেই হয়।

মায়ের কাছে সন্তানের জীবনে দায়িত্ব নেওয়ার শুরু প্রায় কুড়ি বছর।
স্ত্রীর কাছে স্বামীর জীবনের দায়িত্ব নেভানোর শেষ বাকি ষাটটি বছর(কখনো কখনো সেটি আশি বছরেও যেতে পারে যদি আয়ু একশো বছর হয়)।

সন্তানের শৈশবে তার মল মুত্র মা-ই পরিস্কার করেন।
সন্তান যখন বৃদ্ধ হন তখন তার এই একই দায়িত্ব স্ত্রীর কাঁধেই বর্তায়।

মায়ের কোল হল সেই কোল যেখানে সন্তানের জন্ম হয় অর্থাৎ প্রথম বিছানা।
স্ত্রীর কোল হল সেই কোল যেখানে আমাদের মৃত্যু হয় অর্থাৎ শেষ বিছানা।

কিন্তু সমাজ এবং পরিস্থিতি আজ এমনই যে ছেলেটির বিয়ের পর মায়ের সাথে স্ত্রীর তুলনা করে প্রতিটা মুহূর্তে মাকেই শীর্ষস্থানে রাখেন, যেখানে দুজনের ভূমিকাই সমান সেখানে সামাজিক নজরে কেন মা আর স্ত্রীর মাঝে তুলনামূলক দ্বন্দ্বে বারবার পাঁচিল উঠবে বলতে পারেন।
গর্ভ থেকে জন্ম নেওয়াটাই মা ও স্ত্রীর মধ্যে যদি সবচেয়ে বড় পার্থক্য হয়ে থাকে তাহলে শেষ কথা একটাই বলব-
"একজন আপনাকে গর্ভে ধারণ করেছেন,
অন্যজন আপনার জন্য গর্ভধারণ করবেন।"
"একজন আপনাকে জন্ম দিয়ে মা হয়েছেন,
অন্যজন আপনার জন্য আরেক জনকে জন্ম দিয়ে মা হবেন।"
WS+27(838-80-8170)Valid issue of Goethe A1-A2-B1-B2-C1-C2 without TEST
Published: 2024-05-31 22:01:21

At our association we can help you obtain the original certificate of all this test without taking the exam. 
whatsap:[+27-83-880-8170)We are a group of Teachers and Examiners Working in various centers like British council, IDP centers, Ets, Gmat Etc… and we have teamed up to form a wide organization with the sole interest of providing reliable services for all our customers In Documentation and Travel consultancy. Our Group of Staff will be devoted in their mission and treat each case as very important. Contact us if interested: 
(testduolingo6@gmail.com)