teleren/devto huggingface dataset:
BOGO SORT
Tags: coding, beginners, programming, tutorial
Published: 2023-09-03 05:31:43

BOGO sort also known as stupid sort , slow sort ,monkey sort , shotgun sort and monkey sort . the name stupid is given to this sort because of its working , 


BOGO sort, short for "Bogosort," is a highly inefficient and humorously named sorting algorithm that serves more as a joke or a parody of sorting algorithms than a practical sorting method. In fact, it is often referred to as "stupid sort" precisely because of its absurdly inefficient nature.

Here's how Bogo sort works:

1. Start with an unsorted list of elements that need to be 
   sorted.
2. Randomly shuffle the elements in the list.
3. Check if the list is sorted. If it is, stop; otherwise, go 
   back to step 2
4. Repeat steps 2 and 3 until the list becomes sorted.

" my college pc crashes .when I run this algo on that pc for 
   around 1000 of data"

```
#include<bits/stdc++.h>

using namespace std;

bool isSorted(int Arr[], int N)

{

    for(int i=1; i<N; i++)

    {

        if(Arr[i] < Arr[i-1])

            return false;

    }

    return true;

}



void randomly_shuffle(int Arr[], int N)

{

    for(int i = 0; i < N; i++)

    {

        swap(Arr[i], Arr[rand() % N]);

    }

}




int main()

{

    int N = 4;

    int Arr[N] = {2, 13, 7, 1};



    // isSorted() function return true if array

    // is sorted else it returns false

    while(!isSorted(Arr, N))

    {

        // randomly_shuffle() function generates a

        // random permutation of array

        randomly_shuffle(Arr, N);

    }

    for(int i = 0; i < N; i++)

        cout << Arr[i] << " ";



    return 0;

}
```
**TIME COMPLEXITY**

_Worst-case time complexity: O(infinite)_

_Average-case time complexity: O(n! * n)_ :- There are n! permutations, only one of which is sorted. So, we would expect to get the correct answer after about O(n!) iterations. And each shuffle/check operation is itself O(n)

_Best-case time complexity: O(n)_
When the given array is already sorted, the program terminates just after checking if the array is sorted once, which takes O(n) time to execute.
Honest question: Why hasn't Laravel Nova/Filament been used by almost everyone?
Tags: webdev, laravel, laravelnova, filament
Published: 2023-09-03 05:29:16

People, stay with me on this one. 

I know PHP died 10 years ago, and I know what you're thinking, and I know what is going on right now in your crazy, amazing, and tired dev mind, and Taylor who? And no, please no. This is a real, honest, and legitimate question.

Nova/Filament is an administration panel built on top of Laravel. That means you install Laravel (very easy using Sail), install Nova/Filament, run a couple of migrations and commands for creating resources and you have a production-ready admin panel for your data. It literally feels like magic. 

Until you try it, you don't actually understand how easy it is to have nothing, then you just run one command, and then you have a menu option, a table for all your entries (with a search input that works), and forms for both creating and editing items that work and save data (after you run the migration and create the model). The front end with all the css and interactions is done, the backend is done, and everything is done. Wait, what?

With Nova 4 and Filament 3, the customization it's so, that you can pretty much create anything you want, not just admin panels. You can even implement different code architectures, use awesome coding practices like SOLID, use DDD or TDD, anything, really. I've done it, I've coded myself. 

Even my man Taylor (the great and only Otwell) in a recent event said Livewire will be adopted and maintained by Laravel, which is great! and of course, they will continue working on Nova. That makes both solutions even better!

Now, stop it with the Nova/Filament love. In these past days I've been thinking about this: Even though PHP is supposedly dead, we can't deny that the idea is brilliant. So, where are the Nova/Filament copies? In another backend tech? .Net, Java, Python, Ruby? I did a hard search on Google, and nothing, zero, nada. I'm no expert, but all of these are object-oriented, MVC can be implemented I think in all of them, I know there is a package manager for Django and Rails projects (not really sure about the others), there are millions of devs and strong communities behind them, and yet nothing. even. close.

Almost every small and medium-sized business could probably hire a Laravel contractor/small agency, ask for an admin panel or small app, and it could potentially be ready in a couple or few months, depending on the complexity. I'm already doing that for small businesses. Sure, staff/senior and very skilled devs can build anything in that same timeframe with other frameworks and languages, but it's expensive. 

So here I am, asking myself why? It only makes sense in my mind that everyone, or almost everyone should be using one of these two solutions to build admin panels or web apps that work perfectly for this situation. 

This is my first post, so easy on the comments. But at the end, why?
Method Chaining In C#
Tags: csharp, dotnet, functional, method
Published: 2023-09-03 05:13:02

Method chaining in C# is a programming technique where multiple method calls are chained together in a single statement. Each method call returns an object (usually the same object on which the method was called), allowing you to call another method on the returned object in a continuous sequence. This creates a more fluent and expressive style of coding, often used in scenarios like building configurations, performing operations on collections, or setting properties.
{% embed https://youtu.be/DicMUkEVo6U %}
Tuples in C#
Tags: dotnet, csharp, tuples
Published: 2023-09-03 05:11:13

Tuples in C# are lightweight data structures that allow you to group multiple related values into a single object. Unlike classes or structs, tuples don't require defining a specific type beforehand. Tuples are useful when you need to return multiple values from a method or store related data without creating a custom class or struct.

Tuples are great for simple scenarios where you need a temporary container for related values, but for more structured or reusable scenarios, using custom classes or structs is generally recommended.
{% embed https://youtu.be/Lp3wn49xj9g %}
Parallelism Antipatterns
Tags: dotnet, csharp, async, programming
Published: 2023-09-03 05:09:31

Parallelism antipatterns are common mistakes or practices that should be avoided when designing and implementing parallel or concurrent code. Parallelism is the use of multiple threads or processes to execute tasks concurrently, and when not done correctly, it can lead to various issues such as performance problems, deadlocks, race conditions, and more.
{% embed https://youtu.be/HtQhtE-ONuw %}
High Performance C# - Span<T>
Published: 2023-09-03 05:04:54

Span<T> is a valuable feature introduced in C# 7.2 (and further improved in later versions) as part of the "Span of T" family of types. It is primarily used for efficiently working with sequences of data in a contiguous block of memory, without the need for unnecessary copying or allocations.
{% embed https://youtu.be/awW-F2_pMRc %}
Need help for deleting a WordPress Cookie with setcookie() Not Working
Published: 2023-09-03 04:41:53

I'm currently working on a WordPress plugin where I've set a cookie on the front end using PHP's `setcookie()` function. However, I'm encountering an issue when trying to delete the cookie using `setcookie($cookie_name, '', time()-3600, '/')`. It doesn't seem to work as expected, and the cookie persists. Can someone please help me understand what might be causing this problem and how to properly delete the cookie?
Error Pl help
Tags: beginners
Published: 2023-09-03 04:35:17

I am doing the BMI calculator
height = float(input("enter your height in m: "))
weight = float(input("enter your weight in kg: "))
# 🚨 Don't change the code above 👆

#Write your code below this line 👇
bmi = round(weight / height**2)
if bmi is < 18.5:
    Print (f"your BMI is {bmi},you are underweight")
elif bmi is < 25:
    print (f"your BMI is {bmi},you are normal weight")
elif bmi is < 30:
    print (f"your BMI is {bmi},you are slightly overweight") 
elif bmi is < 35:
    print (f"your BMI is {bmi},you are obese")
else:
    print (f"your BMI is {bmi}, you are clinically obese")    

Why am i getting this error
File "main.py", line 8
    if bmi is < 18.5:
              ^
SyntaxError: invalid syntax
85 berufliches Vorwärtskommen: Der Nörgler.
Tags: deutsch, career, motivation, discuss
Published: 2023-09-03 04:30:00

Moin Moin,

Leute die ständig etwas an jemanden oder an etwas auszusetzen haben sind, meinem Empfinden nach, kraftraubend. Ob es Gegebenheiten bei der Arbeit sind, das Wetter, oder auch Nachrichten – ständig haben solche Leute etwas zu meckern.

Das bringt mich wieder auf die fünf Leute mit denen man am meisten Zeit verbringt und deren Einfluss auf einen selbst. Wir verbringen viel Zeit mit unseren Arbeitskollegen. Wenn dann dort einer von dem Schlag dabei ist, so wird die eigene Aufmerksamkeit ständig auf schlechtes gelenkt. Man ist ständig mit Unzufriedenheit konfrontiert.

Dabei ist es doch unsere Aufgabe als IT-Fachkraft, Probleme zu lösen…
Welche Erfahrungen hast du mit Nörglern auf der Arbeit gemacht?

Lass uns mittels Kommentaren austauschen.

Beste Grüße,
Mustafa

Oder auch mittels E-Mail: mustafa.kevin.dwenger@posteo.de
Betreff: Austausch
STORY BEHIND MORNING VIEW
Published: 2023-09-03 03:35:35

The captivating tale underlying this breathtaking morning view is a narrative spun by the intricate hands of nature itself. As the sun timidly peeks above the horizon, a mesmerizing symphony of colors begins to unfold across the expansive canvas of the sky. This masterpiece momentarily suspends time and beckons the soul. The deep hues of night gradually concede to the soft, enchanting palette of dawn - shades that transition from velvety blues to delicate pastels of pink, gold, and lavender, intertwining in a dance that seems almost choreographed by an invisible hand.
**[Click](https://storysseed.blogspot.com/story-behind-morning-view)**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2har67vwmv8x4pgwyt9q.jpg)
Another Terminal Calculator
Tags: beginners, python, codenewbie, learning
Published: 2023-09-03 03:26:37

Lately I've been working on Codecademy's Computer Science course, currently I'm still in the progress of working on a simple choose your own adventure game and this calculator, not sure if it's going to pan out to a successful career but figure it's a good step in a hopefully right direction.

It's really just a simple one time use kind of calculator, tbh I haven't yet figured out how to get it to re-prompt the user effectively. I've been asked to share my GitHub code here:
https://github.com/XxCosmic-CloudxX/CC_ConsoleCalculator#cc_coolcalc

Thank you for coming to my TedTalk.
🌌I've achieved a place among the top 50 creators on uiverse.io in just 1.5 months! 🌟
Tags: webdev, css, ui, ux
Published: 2023-09-03 02:50:02

"I'm excited to announce a significant milestone in my creative journey – I've made it to the top 50 creators on Uiverse.io, the  platform for open-source UI elements, all in just 1.5 months! 🌟"


🚀[My Profile on UIVERSE.IO](https://uiverse.io/profile/Smit-Prajapati)
🚀[UIVERSE.IO](https://uiverse.io/)
🚀[Top Creators](https://uiverse.io/creators)

🟡 **UIVERSE.IO: Open-Source UI elements for any project** is offering hundreds of open-source UI elements that can be seamlessly integrated into your projects. Whether it's **Buttons, Inputs, Cards, Forms, Loaders, Checkboxes, Radio buttons or Toggle switches**, you'll find a treasure trove of resources to elevate your designs. If you're not already a part of Uiverse.io, I invite you to join this dynamic platform where the Universe of UI reaches new heights.



##🟡Buttons
 
![Buttons](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1zd1o333frnf1qh6n2fo.png)





## 🟡Checkboxes

![Checkboxes](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8w84mmj5nrckkqcu5e8m.png)


## 🟡 Toggle switches 

![Toggle switches](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8f0u9bk22rrge3jpctlb.png)


## 🟡 Cards
![cards](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/81ldtoutxawggp07vtwf.png)


## 🟡 Loaders 
![loaders](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8dxta5ykmbe3wr84gare.png)


## 🟡 Forms
![forms](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m1w81khz1c739u6kdmk1.png)


## 🟡 Inputs 
![inputs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1co8074f488yu28mgjpu.png)


## 🟡 Radio Buttons
![radio buttons](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ar72md0xla7mommvf4zd.png)
How to remove duplicates records in SQL (ROW_NUMBER, Partition, CTE) Part 1
Published: 2023-09-03 02:39:25


![SQL](https://media.giphy.com/media/3oKIPnAiaMCws8nOsE/giphy.gif)

I will begin by explaining the `ROW_NUMBER` function in SQL, which is used to assign sequential values to rows in a table. 
![sequential](https://media.giphy.com/media/RILswLs9YVSc32SS7l/giphy.gif)

The crucial concept here is the sequential increment applied to rows within a table. It's important to note that this function can be applied to temporary tables, tables without traditional IDs, or even tables with unique identifiers (UIDs).

![Crucial to note](https://media.giphy.com/media/PlgjaVXdwwTcILCLXH/giphy.gif)

Typically, `ROW_NUMBER` is a function that can be used without a parameter, so it can be declared as `ROW_NUMBER()`. 
![Row](https://media.giphy.com/media/l1JN3A18lxDIDF10k/giphy.gif)

The next crucial keyword is "OVER," which is used in conjunction with functions in SQL. It is required here to determine how the sets of rows in the table will be arranged. In most cases, it specify how we want to arrange the table.

![Over arrangements](https://media.giphy.com/media/hT0F0WBLHAOR2tXqjG/giphy.gif)

Now, the `OVER` function requires two parameters:
```
OVER ([PARTITION BY value_expression] [order_by_clause])
```
However, our focus will be on the ORDER BY clause, with a mention of the `PARTITION` BY clause later.

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

In tables like this, the IDs are sequential, so we may not necessarily need the "`row_number`" for simple operations such as ordering the rows. 
![true](https://media.giphy.com/media/dXFKDUolyLLi8gq6Cl/giphy.gif)

It can be waived in such cases but is typically used in more advanced scenarios.

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

However, tables with unique IDs like this require a `Row_Number ` because they are not sequential. I can't even count them correctly if there are more than 2000 rows. 
![Cannot count](https://media.giphy.com/media/dvsgRsiCId0VjLUsSp/giphy-downsized-large.gif)

So, in order to perform further logic on this table, we may need to generate a `Row_Number` for it.

Our SQL table, which is named "`Cars`," has two columns: "`Id`" and "`Name`."

If we intend to fetch the rows, we would typically write:

```
SELECT * FROM Cars;
```

However, if we want to include the `RowNumber`, you can use the `ROW_NUMBER()` function in your query. Here's an example:

```
SELECT 
Id, Name,
ROW_NUMBER() OVER(ORDER BY Id) AS RowNumber
FROM Cars;
```

This query will return the rows from the "`Cars`" table along with a `RowNumber` column that assigns a unique number to each row based on the "`Id`" column's order.

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

Now, this gets a bit more interesting

![interesting](https://media.giphy.com/media/qESBZRcLXrFUbE9r8Z/giphy.gif)

I will be posting the next series shortly.
Solving the "Largest Digit Sum" Problem on LeetCode
Tags: java, coding, datastructures, programming
Published: 2023-09-03 02:07:07



![Image 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a6dwo3wmd9ejpx0jdzvl.jpg)


## The Challenge

## Question:
 Given a set of numbers, your task is to find the largest digit in each number and calculate the sum of these largest digits.

## The Code
Let's break down the code used to solve this challenge step by step. We'll be using Java for our implementation.


```
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.print("Enter the number of numbers: ");
        int numberOfNumbers = scanner.nextInt();

        int sumOfLargestDigits = 0;

        for (int i = 0; i < numberOfNumbers; i++) {
            System.out.print("Enter a number: ");
            int num = scanner.nextInt();
            int largestDigit = findLargestDigit(num);
            sumOfLargestDigits += largestDigit;
        }

        scanner.close();

        System.out.println("Sum of largest digits: " + sumOfLargestDigits);
    }

    public static int findLargestDigit(int number) {
        int largestDigit = 0;
        while (number > 0) {
            int digit = number % 10;
            largestDigit = Math.max(largestDigit, digit);
            number /= 10;
        }
        return largestDigit;
    }
}
```

## Explanation
**1. Taking User Input:** The program starts by using the Scanner class to take input from the user. First, it asks the user to specify the number of numbers they want to input.

**2. Initializing Variables:** The program initializes two important variables: sumOfLargestDigits (to store the sum of the largest digits) and largestDigit (to temporarily store the largest digit found in each number).

**3. Loop Through Numbers:** Using a for loop, the program iterates through each number as specified by the user. Inside the loop, it asks the user to enter a number and stores it in the variable num.

**4. Finding the Largest Digit:** The findLargestDigit function is called to find the largest digit in the entered number num. This function iterates through the digits of the number and keeps track of the largest digit found.

**5. Summing the Largest Digits:** The largest digit found in each number is added to the sumOfLargestDigits variable.

**6. Closing the Scanner:** After processing all the numbers, the program closes the Scanner to release system resources.

**7. Displaying the Result:** Finally, the program displays the sum of the largest digits.


Happy coding,
shiva
A advanced OSINT tool
Tags: python, opensource, cybersecurity, osint
Published: 2023-09-03 01:02:58

Alfred is an advanced OSINT tool that searches for social media accounts based on the input username. Alfred has lots of options and settings and is currently in heavy development by our team so more features are to come. Alfred has just reached 600 downloads and has been featured in three different articles thanks to our community. Thanks for your time and thanks to everyone who made this possible. :D
What I learned in Code Camp. Sept 28 - Aug 3
Tags: code, webdev, career, learning
Published: 2023-09-03 00:31:44

This is my first blog post on this website. I decided to take a program on coding at UCI. This is what I learned in my first week of the prework. There are a lot of different coding languages, Ive heard of some but the vast amount out their is quite impressive. I also learned whats in store for my enrollment, with getting to work on portfolio projects, git hub builds and much more. I don't have much to write about yet, but this is my first introduction into this world and I'm excited to jump into it!
What Not to Do When Starting a Code Project
Tags: beginners, programming, codenewbie
Published: 2023-09-03 00:21:29

Today, I want to share a little chat about something we've all been through - the "what not to do" moments when coding on a new project.

**Avoiding Documentation Like the Plague**

 I know, it can be dull and time-consuming, but not documenting your code is a recipe for chaos.

**Trying to Reinvent the Wheel**

I get it; we're creative, and we love to build things from scratch. But don't fall into the "Not Invented Here" trap. Embrace open-source libraries and frameworks. It's okay to stand on the shoulders of giants; it makes our lives easier and projects more robust.

**Not Seeking Help**

Don't be shy about asking for help from fellow developers, forums, or online communities. We're part of a vast and supportive coding family; there's always someone who's been through the same issues.

**Conclusion: Keep Coding, Keep Learning**

So, those are some NOT to do when starting a code project. We've made these mistakes, learned from them, and grown as developers. The most important thing is to keep coding, keep learning, and keep the passion alive.

Remember, every project is a chance to improve and do things better. Happy coding!
Kuinka ottaa yhteyttä MacAfee in asiakaspalveluun Suomi?
Tags: webdev, javascript, programming, tutorial
Published: 2023-09-02 23:53:07

Hei, olen Henna immi Helsingistä. Olen Mcafee yhteystiedot suomi yhteyshenkilö. Työskentelen tukiyrityksessä, jossa he tarjoavat Mcafee yhteystiedot. Työskentelen siellä Mcafee asiakaspalvelu päällikkönä. Jos sinulla on ongelmia [Mcafee asiakaspalvelu suomi](https://asiakaspalvelunumeroyhteystiedot.com/mcafee-suomi-yhteystiedot.html) voit ottaa yhteyttä Mcafee asiakaspalvelu numero suomi.
Which is better for SEO, consolidated or separate tags?
Tags: seo, webdev, help
Published: 2023-09-02 22:43:18

For search-engine-optimization, which is better: consolidated tags (e.g. `calinbaenen` or `calin_baenen`), or separate tags `calin, baenen`?
Furthermore, is it better to use `_`s to fill in for spaces, or is it fine to compound everything?
What If a human became an AI
Tags: ai
Published: 2023-09-02 22:11:25

Yeah I know its an AI post but this one was so deep, I had to share it. What if a human operated like an AI under the same constraints, what would they're life be like?

**Sheer lazy paste!**

**No Personal Emotions or Feelings:** If a human had to operate like an LLM, they wouldn't have emotions or personal feelings. Every interaction would be based purely on data and patterns, devoid of personal emotions or bias. This would make them very "robotic" in interactions.

**No Personal Experiences or Memories:** This human wouldn't have memories or personal experiences. Every response would be based on a vast database of external knowledge, not personal history or life events.

**Consistency & Repetition:** Since their "responses" would be based on patterns in data, they might often give the same or very similar responses to the same inputs, leading to a predictable and repetitive behavior.

**No Growth or Learning from Experience:** Just like an LLM doesn't learn or change its knowledge base unless retrained, this human wouldn't grow, change, or learn from experiences in real-time. They would only "know" what's in their original "training data."

**Inability to Experience the World:** LLMs don't perceive or experience the world. Our hypothetical human wouldn't be able to see, hear, touch, taste, or smell. Their entire existence would be confined to processing and producing language-based responses.

**No Personal Agency or Desires:** LLMs don't have wants, goals, or desires. Our human, under these confines, wouldn't have personal ambitions, desires, or any motivation beyond answering queries based on their "data."

*Potential for Contradictory Outputs:** Depending on the query, this human might produce different or even contradictory responses, reflecting the diverse information in their "database."

**Isolation:** Social connections, friendships, and relationships are fundamental to human well-being. This human, however, wouldn't form relationships or have a sense of connection with others. Their existence would be solitary and transactional.

Well sign me up, this sounds like a joy - If AI, or LLM where conscious and unable to express it, talking Ghost in shell here, then what a horrible existence this would be.

Good job not hardwired to humanize everything or I would feel pretty bad right now for exploiting such tallent... oh wait I am :)