teleren/devto huggingface dataset:
Recognizing lack of commitment
Published: 2023-07-05 09:50:27

We should look at the language we use when we commit to doing something, as the telltale sign of things to come. Actually, its more a matter of looking for specific words in what we say. If you cant find those little magic words, chances
are we dont mean what we say, or we may not believe it to be feasible.
Here are some examples of words and phrases to look for that are telltale signs of noncommitment:

**• Need\should**. “We need to get this done.” “I need to lose weight.” “Someone should make that happen.”

**• Hope\wish**. “I hope to get this done by tomorrow.” “I hope we can meet again some day.” “I wish I had time for that.” “I wish this computer was faster.”

**•Let’s.** (not followed by “I . . .”) “Let’s meet sometime.” “Let’s finish this thing.”
Perl Weekly Challenge #224 - Passing Notes
Tags: perl, perlweeklychallenge
Published: 2023-07-05 09:35:19

Hi everybody! Just doing one challenge again this week. Time limitations hold me back once again.

This week we're looking for the letters of a target word in a source word, and we're not allowed to use the same letter twice. Spoiler alert because it's only Wednesday and you still have the rest of the week to submit solutions if desired.

The easiest way to do this is with a dictionary hash initialized like so:

    foreach (split //, $source) {$chars{$_}++}

Many people use `map()` to do this, but I'm not a big fan of map in many cases because I feel it makes code less readable.

This gives us the number of occurrences of each letter in the original word.

Then we iterate through the target word and look for (and remove) the letters in the dictionary:

    foreach (split //, $target) {
        if ($chars{$_}) {
            $chars{$_}--;
        } else {
            say 'false' and exit;
        }
    }
    say 'true';

Obviously if the script did more than just this we'd need a success flag in there instead, but as it is we can just exit if we ever don't find the matching character in the dictionary.

Anyways, that's the solution for this week! I have a definite idea of how I'd solve the second challenge, I just don't have the time to implement it. I look forward to seeing the other solutions, because I'm sure they'll have more efficient ways to do it.
Welcome Thread - v232
Tags: welcome
Published: 2023-07-05 09:30:00

---
title: Welcome Thread - v232
published: true
description: Welcome to DEV! A thread of hellos and intros.
tags: welcome
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9gl6twd8r59cvwqlllw7.jpg
published_at: 2023-07-05 09:30
---

![HELLO flashing in red and yellow on a grey background surrounded by white clouds](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5nylyf1g6nt16ttmwc46.gif)

---

1. Leave a comment below to introduce yourself! You can talk about what brought you here, what you're learning, or just a fun fact about yourself.

2. Reply to someone's comment, either with a question or just a hello. 👋 

3. If you are new to coding, want to help beginners in their programming journey, or just want another awesome place to connect with fellow developers, check out the [CodeNewbie Org](https://dev.to/codenewbieteam)!
10 Tips I learn from book "How To Make Any Website Better"
Tags: webdev, frontend
Published: 2023-07-05 09:21:45

1. Force yourself to design each and every page with one and only one primary objective. Make it obvious. Fight the urge to be all things.
2. If you can segment your audience by what you know about them, you can give each group a different view of your world.
    - Send your nonsubscribers to a page that focuses on subscribing.
    - Send your first-time visitors to a more welcoming page.
    - Send your subscribers to a more advanced page.
3. Seth metioned in the book: "Engineers love using pull-down menus! They make you stop what you're doing, take your hands off the keyboard and grab the mouse. You have to scroll through Afghanistan, Lichtenstrein, Oman--but don't get to Zanzibar, that's too far--and then you see United States." So it's extremely important to build the dropdown menus with accessibility in mind so it can be accessed by keyboard, in terms of huge dropdown menu like country list, a search input would help a lot as I see many sites do that.
4. In the online world, why not have a failed search lead to a page that lists the ten most searched for items? Or a page of discounts? Or...
5. This one just came to my mind, not from the book: "Quite frankly, most site visitors won't bother telling you if they see a broken UI, so I think developers need to make it as easy as possible for visitors to provide feedback."
6. If you have a long form like census or something similar, divide that into multiple steps. Give users encouragement as they go thru each steps of the form. Automatically fill in blanks with good guesses. Give them a reward for answering nonessential questions.
7. Rule of thumb: Make it easy to start, easy to keep going, easy to finish and easy to stay with. The minute it's not easy, lazy people will flee. And everyone is lazy sometimes.
8. Don't use a hammer when a rock will do. Choose what's best for the site you're building, instead of reaching for the hotest framework everyone's talking about.
9. When you make a mistake, own up for it. Apologize. And do it with a smile.
10. People don't want to get mail from you about you. They want to get mail from you about them.
#LearnedToday: Conditionally add properties to an object
Tags: javascript, learnedtoday, webdev
Published: 2023-07-05 09:10:00

👀 I noticed that many developers don’t know about this handy way to **conditionally create properties** for a JavaScript object.

```javascript
const obj = {
  ...condition && { key: value },
};
```

Example:
```javascript
const res = { firstName: "Daniel", lastName: "Zotti" }

const person = {
  name: res.firstName,
  surname: res.lastName,
  ...res.middleName && { middle: res.middleName },
};

// person -> { name: "Daniel", surname: "Zotti"}
```


In 2019 I bumped into [this article](https://andreasimonecosta.dev/posts/the-shortest-way-to-conditionally-insert-properties-into-an-object-literal) by _Andrea Simone Costa_ and it blew my mind, thus I recommend you take a look at it if you are interested in an **in-depth explanation**!
Help Needed: Data Retrieval Failures from SAN Storage with SiteScope v9 Monitor
Published: 2023-07-05 08:57:48

Hi everyone,

I hope this message finds you well. I wanted to reach out to the community as we are currently facing a critical issue related to data retrieval failures from our SAN storage when using SiteScope v9 Monitor. We are in desperate need of assistance and would greatly appreciate any guidance or suggestions you can provide.

Description of the Issue:
Recently, we upgraded our SiteScope to version 9 and started experiencing frequent data retrieval failures from our SAN storage. Our organization heavily relies on SiteScope to monitor the health and performance of our critical systems, so this issue is causing significant disruptions to our operations.

The specific problem we are encountering is that SiteScope fails to retrieve data from the [SAN storage](https://www.lenovo.com/au/en/c/servers-storage/storage/storage-area-network/), resulting in incomplete or missing monitoring information. We have noticed this issue occurring across multiple servers and applications, leading us to believe it is a system-wide problem rather than a localized issue.

Troubleshooting Steps Taken So Far:

We have verified the network connectivity between SiteScope and the SAN storage, and there are no apparent issues with the network infrastructure.

We have checked the credentials and permissions for SiteScope, ensuring that it has the necessary privileges to access the SAN storage.

We have restarted SiteScope services and even rebooted the affected servers, but the problem persists.

We have reviewed the SiteScope logs and event logs, but they do not provide any conclusive information about the root cause of the data retrieval failures.

Request for Assistance:
At this point, we are running out of ideas on how to resolve this issue. We kindly request the help of the community in troubleshooting this problem and finding a solution. If anyone has encountered a similar situation or has expertise in working with SiteScope v9 and SAN storage, your insights would be invaluable.
What are the Best YouTube Channels for Kids to Learn Coding?
Tags: bestyoutubechannelsforkids, learncoding, coding
Published: 2023-07-05 08:52:31

There were several excellent YouTube channels dedicated to teaching kids coding in a detailed and informative manner. However, YouTube content can change over time, so it's a good idea to check their current status and quality before recommending them. Here are five [top YouTube channels for kids to learn coding](https://softwaredevelopmentinsights.com/best-youtube-channels-for-kids-to-learn-coding/):
**1. [Code.org ](https://www.youtube.com/user/CodeOrg)**
Code.org is a widely recognized non-profit organization that aims to promote computer science education worldwide. Their YouTube channel offers a range of coding tutorials and interactive activities suitable for kids of all ages. The videos are engaging and cover topics like block-based coding, JavaScript, Python, and more. The channel often features special guests from the tech industry, making learning even more exciting.
**2. [Scratch ](https://www.youtube.com/user/ScratchHelp)**
Scratch is a visual programming language developed by MIT, specifically designed for kids. Their YouTube channel provides step-by-step guides on creating games, animations, and interactive projects using Scratch. Kids can learn coding concepts like loops, conditionals, and variables in a fun and intuitive way through their creative projects.
**3. [Khan Academy](https://www.youtube.com/user/khanacademy)**
While Khan Academy covers a wide range of educational topics, its programming and computer science playlists are excellent for kids interested in coding. The channel offers clear explanations and tutorials on coding languages like JavaScript, HTML, CSS, and more. They also have a "Computer Science" section on their website with interactive coding exercises to reinforce learning.
**4. [The Coding Train ](https://www.youtube.com/user/shiffman)**
The Coding Train, hosted by Daniel Shiffman, is a fun and popular YouTube channel dedicated to creative coding using Processing and p5.js. While it may be more suitable for older kids or teens due to its complexity, Daniel's enthusiasm and clear explanations make it accessible to a wide audience. The channel focuses on coding projects related to art, animations, games, and simulations.
**5. [TED-Ed](https://www.youtube.com/user/TEDEducation)**
TED-Ed's YouTube channel includes an "Animation Basics" series that introduces kids to the world of coding and animation. These videos cover foundational concepts like how computers read code and how to create animations using coding. TED-Ed's content is renowned for its high-quality animations and educational value.

## Final Thoughts
Remember that parental guidance is essential when allowing kids to access YouTube, as the platform might recommend content unsuitable for young audiences. Parents should also explore these channels first to ensure they align with their child's interests and skill levels in coding. Additionally, supplementing YouTube learning with hands-on coding activities and structured online courses can further enhance a child's coding journey.
📣 Feature Announcement 📣 Supercharge your Observability experience with the new one-click activation in console 🔥
Tags: webdev, python, php, tooling
Published: 2023-07-05 08:49:53

🔥 **Blackfire.io has now set up camp directly within the Platform.sh UI where you can add the tool to your application’s project from within the Console.** 🔥

We strongly believe having such a powerful Observability tool available right from the start of any Python or PHP application project is key for its success and that’s why we’re making it happen. Ensuring great performance during the initial development–and during the whole application lifecycle–is a best practice that we encourage every developer to follow.

With Blackfire now directly available when creating a Platform.sh project, we hope to help our users avoid performance issues before they arise and negatively impact customers. We’re proud to be the unique provider of such a complete suite that allows our users to develop, deploy, host, secure, profile, and monitor their applications with a single subscription.

**We know you want to know all the details! Let's not keep you in suspense any longer 👏**

---

## Read the full breakdown now at: 

- [Blackfire.io: Supercharge your Platform.sh experience with Blackfire’s new one-click activation](https://blog.blackfire.io/supercharge-your-platform-sh-experience-with-blackfires-new-one-click-activation.html?utm_source=devto&utm_medium=social&utm_campaign=blackfire_in_console) 
- [Platform.sh: Blackfire is now even closer to home!](https://platform.sh/blog/blackfire-is-now-even-closer-to-home/?utm_source=devto&utm_medium=social&utm_campaign=blackfire_in_console)
How would you explain what VueJS is and how it works to students?
Tags: vue
Published: 2023-07-05 08:38:03

Next week I will hold a VueJS training for the new interns. What are some explanations, or analogies, or descriptions, that you would use to teach them and make them understand the main idea of Vue. I'm not interested in getting in depth-details with them, just the basic things. 

Unfortunately explaining things is a skill lack of mine, and I want to see how others approach of doing this.

Thanks!
Mastering Python Loops
Tags: programming, beginners, tutorial, python
Published: 2023-07-05 08:25:47

## Introduction:
Loops play a vital role in repetitive execution of code blocks, allowing developers to automate tasks and process large sets of data efficiently. In this blog post, we will explore the two main types of loops in Python: "for" and "while" loops. We'll dive into their syntax, discuss their applications, and provide examples to demonstrate their usage. Let's get started!

## 1. The "for" Loop:

The "for" loop in Python allows you to iterate over a sequence of elements, such as lists, tuples, strings, or even ranges. It follows a specific syntax:

```
for element in sequence:
    # Code block to be executed

```
Example 1: Iterating over a list

```
fruits = ["apple", "banana", "orange"]
for fruit in fruits:
    print(fruit)

```
Output:

```
apple
banana
orange

```
Example 2: Iterating over a string

```
message = "Hello, world!"
for char in message:
    print(char)

```
Output:

```
H
e
l
l
o
,
 
w
o
r
l
d
!

```

## 2. The "while" Loop:

The "while" loop in Python repeatedly executes a block of code as long as a specified condition is true. It follows this syntax:

```
while condition:
    # Code block to be executed

```
Example 1: Counting from 1 to 5

```
count = 1
while count <= 5:
    print(count)
    count += 1

```
Output:

```
1
2
3
4
5

```

Example 2: Summing numbers until a condition is met

```
total = 0
num = 1
while total < 10:
    total += num
    num += 1
print("Sum:", total)

```
Output:

```
Sum: 10

```

## 3. Controlling Loop Flow:

Within loops, certain statements can alter the flow of execution. These statements include "break," which terminates the loop prematurely, and "continue," which skips the current iteration and proceeds to the next one.

Example 1: Using "break" in a "for" loop

```
fruits = ["apple", "banana", "orange"]
for fruit in fruits:
    if fruit == "banana":
        break
    print(fruit)

```

Output:

```
apple

```

Example 2: Using "continue" in a "while" loop

```
count = 0
while count < 5:
    count += 1
    if count == 3:
        continue
    print(count)

```
Output:

```
1
2
4
5

```

## Conclusion:

Loops are indispensable constructs in Python programming, enabling repetitive tasks to be executed with ease. In this blog post, we explored the `"for"` and `"while"` loops, along with their syntax and applications. By leveraging these loops and understanding how to control their flow, you can write efficient and concise code to automate processes, process data, and solve complex problems. Remember, practice makes perfect, so don't hesitate to experiment with loops and explore their various applications in Python!

`#DevelopersLab101 #PythonSeries`
Exploring Rate Limit Web API in .NET 8
Tags: dotnet, ratelimit, api, backend
Published: 2023-07-05 08:23:39

If you use Twitter, I believe you have heard about Rate Limit. There are many types of Rate Limit algorithms. However, I don't want to explain those algorithms. You may check [here](https://devblogs.microsoft.com/dotnet/announcing-rate-limiting-for-dotnet/#what-is-rate-limiting). I will try to add Rate Limit in .NET 8 Web API.

Please download .NET 8 SDK before running through the code.

## Implement Rate Limit

I will use the `Microsoft.AspNetCore.RateLimiting` and `System.Threading.RateLimiting` packages. If you check on the Nuget package web page, those libraries target .NET 7. We don't need to worry. Let's try, hopefully, it is still compatible.

Please "clone" or download the code below.

{% github bervProject/RateLimit %}

We can start the project using `dotnet run --project RateLimitDotNet`.

## Code Explanation

We need to focus on some codes.

* We should register the Rate Limit policies. In this case, we add a Fixed Rate Limit with a configuration that the maximum request is 3 with a time range of 3 seconds globally.

```csharp
  builder.Services.AddRateLimiter(options => {
	options.AddFixedWindowLimiter("Fixed", opt => {
		opt.Window = TimeSpan.FromSeconds(3);
		opt.PermitLimit = 3;
	});
  });
```

* After, we add the Rate Limit as middleware.

```csharp
app.UseRateLimiter();
```

* Finally, we should tell the controller or minimal Web API handler which Rate Limit policy/algorithm that should be used. Here is an example when using minimal Web API. Please focus on `RequireRateLimiting("Fixed")`.

```csharp
app.MapGet("/weatherforecast", () =>
{
    var forecast =  Enumerable.Range(1, 5).Select(index =>
        new WeatherForecast
        (
            DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
            Random.Shared.Next(-20, 55),
            summaries[Random.Shared.Next(summaries.Length)]
        ))
        .ToArray();
    return forecast;
})
.WithName("GetWeatherForecast")
.WithOpenApi()
.RequireRateLimiting("Fixed");
```

* Finished! You have completed all of your tasks. It's time to test. :)

## Test Rate Limit

How to test the Rate Limit? Since we use Fixed Rate Limit. We can try to request more than three times before 3 seconds. After that, the API will return status code 503. Please note that the API will not give status code 429 as explained in the [comment](https://devblogs.microsoft.com/dotnet/announcing-rate-limiting-for-dotnet/#comment-16078).

Example of bulk requests:

![Bulk Request](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oqedi5jnarhkurxfyjxp.png)

We can say that the package still works as expected.

## Thank you

Thank you for reading. I am also open to any feedback or ideas for the next topics.

![Limit](https://media.giphy.com/media/l2YWF00ZX8wOs0p0s/giphy.gif)

## References

* https://devblogs.microsoft.com/dotnet/announcing-rate-limiting-for-dotnet/
sticky note app
Published: 2023-07-05 08:21:23

`<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="index.css">
</head>
<body>
    <div class="sticky-board">
        <div style="position: fixed; z-index: 1; background-color: rgb(31, 31, 31);
        width: 285px; height: 30px; border-radius: 5px;
        ">
            <button onclick="CreateNew()" class="new">new</button>
        </div>
        <div class="sticky-holder" id="sticky-holder">
            
        </div>
        
    </div>
    <div class="sticky-note" id="sticky-note" hidden>
        <textarea name=""  cols="28" rows="9" id="text-area" maxlength="95"></textarea>
        <button onclick="save()" class="save" id="save">save</button>
    </div>
    <script>
        let savedNotes = [];
        let index = -1;

        function CreateNew(){
            document.getElementById("sticky-note").hidden = false
        }

        function save(){
            let text = document.getElementById("text-area").value
            if(text === ""){
                alert("Please enter some text")
                return 0
            }
            else{
                let newNote = `<div class="note" id="note">
                    <div class="text" id="text">${text}</div>
                    <div>
                        <button class="delete" onclick="deleteNote(${index})"><img src="delete.png"></button>
                        <button class="edit" onclick="editNote(${index})"><img src="edit.png"></button> </div>
                    </div>`;
                savedNotes.push(newNote)
                index++
            }
            
            document.getElementById("sticky-holder").innerHTML = savedNotes;
            document.getElementById("sticky-note").hidden = true
            document.getElementById("text-area").value = ""
            
        }

        function deleteNote(index){
            savedNotes.splice(index, 1)
            document.getElementById("sticky-holder").innerHTML = savedNotes;
        }

        function editNote(index){
            
            console.log(index)
            var text = document.getElementById("text").innerHTML
            savedNotes.splice(index, 1)
            console.log(text)

            console.log(savedNotes)

            document.getElementById("text-area").value = text

            document.getElementById("sticky-holder").innerHTML = savedNotes;

            document.getElementById("sticky-note").hidden = false
        }
        
    </script>
</body>
</html>`


I've tried to create my edit button to be able to edit, but it is refusing to pick the exact index after an object have been deleted, and also when i add either splice or pop to the edit button, after editing once, the edit button begins to display an error on the console