teleren/devto huggingface dataset:
How to set up a Python WebSocket Server with Godot 4's WebSocketPeer Client. [Tutorial]
Published: 2024-06-04 09:38:59

 Since Godot 4 WebSocketServer and WebSocketClient have been disappeared from the API.
I tried to explain it to myself how Godot 4's new API works since the docs have not been updated using the downloadable example project you can find here: https://godotengine.org/asset-library/asset/2800
However, it seems that only one WebSocketPeer can connect to each other, consequentially, when the server connected to one peers, its over, other peers dont get the chance to connect, too!
Now, I found a pretty solution using python's websockets module.
1) Set up a client with Godot 4's WebSocketPeer

Use the example project (link mentioned above) to set up the client; or use this script on Node:

```
extends Node

# The URL we will connect to.
var websocket_url = "ws://localhost:12345" # Replace with actual server address and port
var socket := WebSocketPeer.new()

func _ready():
    if socket.connect_to_url(websocket_url) != OK:
        print("Could not connect.")
        set_process(false)

func _process(_delta):
    socket.poll()
    
    if socket.get_ready_state() == WebSocketPeer.STATE_OPEN:
        while socket.get_available_packet_count():
            print("Recv. >",socket.get_packet().get_string_from_ascii(),"<")


func _exit_tree():
    socket.close()
    
func _input(event):
    # Send "Ping!" to the server when Enter is pressed.
    if event is InputEventKey and event.pressed and event.keycode == KEY_ENTER:
        if socket.get_ready_state() != WebSocketPeer.STATE_OPEN:
            print("You are currently not connected to the server.")
        else:
            socket.send_text("Ping!")
```

2) Set up a python server using websockets module

Follow the short tutorial on https://pythonexamples.org/python-websockets-example/ how to set up a websocket server. I have not done anything else but copy-pasting the example code and it worked. Use this for example:

```
import asyncio
import websockets

# Define a callback function to handle incoming WebSocket messages
async def handle_websocket(websocket, path):
    try:
        while True:
            message = await websocket.recv()
            print(f"Received message: >{message}<")

            # XXX: Do some stuff here with the message.

            response = "Pong!"
            await websocket.send(response)
    except websockets.ConnectionClosed:
        pass

if __name__ == "__main__":
    # Start the WebSocket server
    start_server = websockets.serve(handle_websocket, "localhost", 12345)

    asyncio.get_event_loop().run_until_complete(start_server)
    asyncio.get_event_loop().run_forever()
```
Checked & Unchecked statements in C# reference
Tags: dotnet, csharp, development, microsoft
Published: 2024-06-04 09:29:38

Bugun sizlar bilan, Quyidagi savollar bilan bog'liq miflarni sindiramiz 🛠️

- Overflow checking Context ?
- Default overflowni tekshirish Contexti ?
- C# tili spefikatsiyasidan bir shingil ?
- Vahokazo ?

Checked va Unchecked iboralari arifmetik va Convertationlar uchun Overflow bo'lishni tekshirish contextini belgilaydi. Butun son arifmetik tomondan to'lib ketganda Overflow checkings bizga nima sodir bo'lganligini ko'rsatadi. Masalan: E'tibor berganmisiz, Int tipiga Int.MaxValue dan ko'p miqdorda qiymat berilganda System.OverFlowException compilator tomonidan sizga tashlanadi. Agar doimiy ifodada Overflow sodir bo'lsa, compilation vaqtida xatolik yuz beradi. Aytgancha bu turdagi Exceptionlar System kutubxonasiga tegishli,
Xullas quyidagi bir shingil codeda qisqa va lo'nda qilib ko'rishimiz mumkin. 

```
uint a = uint.MaxValue;

unchecked
{
    Console.WriteLine(a + 3);  // output: 2
}

try
{
    checked
    {
        Console.WriteLine(a + 3);
    }
}
catch (OverflowException e)
{
    Console.WriteLine(e.Message);  // output: Arifmetik operatsiya to'lib ketishga olib keldi 
}
```


Double tipida ham shunday qilib ko'rsa bo'ladi .
```
double a = double.MaxValue;

int b = unchecked((int)a);
Console.WriteLine(b);  // output: -2147483648

try
{
    b = checked((int)a);
}
catch (OverflowException e)
{
    Console.WriteLine(e.Message);  // output: Arithmetic operation resulted in an overflow.
}
```

Checked va Unchacked haqida yana bir kattaroq misol. Bu misolni review qilishingizni maslahat beraman. 

```
int Multiply(int a, int b) => a * b;

int factor = 2;

try
{
    checked
    {
        Console.WriteLine(Multiply(factor, int.MaxValue));  // output: -2
    }
}
catch (OverflowException e)
{
    Console.WriteLine(e.Message);
}

try
{
    checked
    {
        Console.WriteLine(Multiply(factor, factor * int.MaxValue));
    }
}
catch (OverflowException e)
{
    Console.WriteLine(e.Message);  // output: Arithmetic operation resulted in an overflow.
}
```
HELLO WORLD!
Tags: beginners, cloud, cloudcomputing, azure
Published: 2024-06-04 09:23:10

Hey there!

I finally made the decision to venture into Cloud Computing—finally? Yes, finally. I have been contemplating the idea of doing this for a painfully long while and I am glad I eventually did. 
I believe I was put off by the idea of starting as a total noob in a new field. Apparently, along the line of growing up, the allure of learning where I know nothing had been lost on me. Thus, I kept pushing the time to take the plunge further and further, until I got a recent epiphany that reoriented me.
That said, as with anything worth doing, I figured it was worth doing well and in this case, that translates to knowing the basics of what Cloud Computing entails before delving into any complex aspects of this lovely field.
I will be making posts of what new things I learn on this journey.

Walk with me, frens! Let’s have fun along the way!!
Generative AI Meets Industrial Simulations Rapid Innovation Frontier
Published: 2024-06-04 09:17:10

# Generative AI, a subset of artificial intelligence, focuses on creating new content such as text, images, and music by leveraging machine learning models trained on large datasets. This technology is revolutionizing various industries, including healthcare and automotive, by enhancing creativity, streamlining operations, and enabling personalized experiences. Traditional industrial simulations, which use software to replicate real-world processes, are being significantly enhanced by generative AI, leading to more accurate and efficient simulations. However, integrating these advanced technologies poses challenges related to system compatibility, scalability, and ethical considerations, which require strategic planning and collaboration to overcome. 
 
#rapidinnovation#GenerativeAI #IndustrialSimulations #AIinHealthcare #AIinAutomotive #FutureOfAI 

 link: http://www.rapidinnovation.io/post/generative-ai-meets-industrial-simulations-rapid-innovation-frontier-
Alpine JS Delete Confirmation Modal
Tags: alpinejs, alpine, armanrahman, javascript
Published: 2024-06-04 09:10:01

Want to make like this? 

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

Step 1: At first connect AlpineJs in your project 

```
<head>
    <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
</head>
```

Step 2: Then add this CSS

```
<style>
            .modal {
                position: fixed;
                left: 50%;
                top: 50%;
                transform: translate(-50%, -50%);
                background-color: #ffffff;
                z-index: 99999;
                transition: 0.4s ease;
                width: 500px;
                border-radius: 10px;
                box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
            }

            .overlay {
                /* background-color: blue; */
                position: fixed;
                inset: 0;
                z-index: 99998;
                backdrop-filter: blur(5px);
                background-color: rgb(0, 0, 0, 0.1);
                transition: 0.4s ease;

            }

            .modal .modal-head {
                display: flex;
                align-items: center;
                justify-content: space-between;
                padding: 18px;
            }

            .modal .modal-head h4 {
                margin: 0;
                padding: 0;
                font-size: 18px;
            }

            .modal .modal-body {
                padding: 65px 0;
            }

            .modal .modal-body .large-icon {
                font-size: 60px;
                margin-bottom: 25px;
            }

[x-cloak] {
  display: none !important;
}

        </style>
```

Step 3: Add This On your HTML File

```
<div x-data="{deleteModal:false}">
<div x-cloak x-show="deleteModal">
            <div x-on:click="deleteModal=false" class="overlay"></div>
            <div class="modal">
                <div class="modal-body">
                    <div class="flex justify-center items-center flex-col">
                        <i class="large-icon fa-regular fa-trash-can"></i>
                        <h5>Are You Sure?</h5>
                        <p>Are you sure to delete this?</p>
                        <div class="flex g-10 justify-center">
                            <a class="btn-theme2" x-on:click="deleteModal=false" href="javascript:void(0)"><i
                                    class="fa-solid fa-xmark"></i>Cancel</a>
                            <a class="btn-theme" href="#"><i class="fa-solid fa-check"></i> Confirm
                                Delete</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
</div>
</div>
```
Step 4: Add this button to Open this modal

```
<button x-on:click="deleteModal = true" href="javascript:voide(0)" class="btn btn-primary"><i class="fa-regular fa-trash-can"></i></button>
```
Shree Vardhman Ambrosia Sector 70 Gurgaon | Shree Vardhman Ambrosia Gurgaon
Tags: realestate, realestateagent, realestateinvestment, shreevardhmanambrosia
Published: 2024-06-04 09:08:43

[Shree Vardhman Ambrosia 4 BHK apartments present](https://shreevardhmanambrosia.tech) a premier residential community that redefines modern living. This exceptional 3 BHK apartment development seamlessly blends comfort, style, and convenience, offering residents a truly remarkable living experience.


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

Unparalleled Amenities for Elevated Lifestyles Shree Vardhman Ambrosia boasts a comprehensive suite of top-tier amenities that cater to every aspect of your well-being. Indulge in a state-of-the-art gym, where you can maintain your fitness regime, or take a refreshing dip in the pristine swimming pool. Immerse yourself in the serene beauty of the meticulously landscaped gardens, providing a tranquil oasis within the bustling city.

Convenient Connectivity, Elevated Experiences Strategically located, Shree Vardhman Ambrosia offers residents easy access to major highways, shopping centers, and business hubs, ensuring that every aspect of your daily life is seamlessly integrated. Experience the perfect balance of urban convenience and the serenity of peaceful living, where every detail has been thoughtfully designed to elevate your lifestyle.
Crafted for Sophisticated Living

Welcome to your new home at Shree Vardhman Ambrosia, where sophistication and comfort converge. This exceptional development has been meticulously crafted to provide you with the best in modern living, catering to your every need and desire. Discover the epitome of luxurious living, where every moment is an experience to cherish.
Contact Us: 8595808895
McDonald's Menu
Tags: webdev, javascript, programming, beginners
Published: 2024-06-04 09:06:18

MCD Menu is a culinary symphony, offering a tantalizing array of options to suit every palate and craving. From the iconic Big Mac, with its juicy patties layered between sesame seed buns, to the classic and comforting Chicken McNuggets, each item is crafted to perfection. The menu boasts a fusion of flavors from around the world, from the spicy kick of the McSpicy Paneer Burger to the savory delight of the McChicken Wrap.
https://mcdmenu.org/
Tired of repeatedly searching the installation command so i made a CLI for it.
Tags: cli, webdev, javascript, programming
Published: 2024-06-04 09:04:10


  
## AllKit 
WebDev Framework Selection CLI</h4>


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


## Motivation

Basically the story is I hated searching through different documentation just to find that installation command for different frameworks I want to use so I made a CLI for it. I'm here to share it to you guys.

It currently supports
- Vite
- Next.js
- Svelte
- Vue
- [<u>**You are welcome to open a PR to add some.**</u>](https://github.com/mmvergara/allkit)

## Installation

```bash
npm install -g allkit
# or use any package manager you like

npx allkit
```
its like less than 1kb or something

## [Github Repository](https://github.com/mmvergara/allkit)
Script to get the emails of your dev.to followers
Tags: go, emails, automation
Published: 2024-06-04 08:56:32

---
title: Script to get the emails of your dev.to followers
published: true
description: Script to get the emails of your dev.to followers
tags: Go, Emails, Automation
---
## Why

You may want to reach your followers directly. In my case I needed this script to share our new project [packagemain.tech](https://packagemain.tech) with the audience.

## How does it work

1. A lot of users on dev.to are using Github to sign up, so their username matches their Github username
2. Some people have their email address public on Github

## Input parameters

1. dev.to cookie session. You can find it Dev Tools by inspecting any XHR request and looking for `_Devto_Forem_Session`
2. Github personal access token. You can [create one here](https://github.com/settings/tokens)

## Go script

https://gist.github.com/plutov/8db528b6470ce7c9b2d0e19670f79698

## Usage

```
go run dev_to_emails.go --devtocookie={DEV_TO_COOKIE}--ghtoken={GH_TOKEN}
```

## Output

- users.json - list of dev.to followers
- emails.txt - list of found emails

In my case I was able to find 900+ unique emails from my followers.

Hope this was helpful and please use it with good intentions only.
SQLtest.online: a great platform to test and improve your SQL skills
Published: 2024-06-04 08:56:04


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

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

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

Hi all! I am interested in sql and studied a lot of materials on this topic on the Internet, but I lacked confidence in my qualifications. Wanting more practice, I turned to Google for problems and came across a resource called [sqltest.online](https://sqltest.online/en/). This site is great for those who want to test and improve their sql skills. No matter your experience level, you'll find a wide range of challenges here, from simple to complex.

I especially liked the variety of problems of varying difficulty, allowing you to test knowledge at different levels. You can choose a language (Russian or English) and start solving problems without preliminary database settings.

The site presents more than 200 problems in 17 categories of various databases. New tasks are constantly being added, making learning even more fun for everyone.

No registration is required, just go to the site and start solving problems. The site also has an active community in the Telegram channel, where you can discuss interesting points, share experiences and get help.

One of the advantages of [sqltest.online](https://sqltest.online/en/) is its accessibility. You can use the platform at any convenient time, which is especially valuable. This allows you to develop skills in using SQL in your free time or between tasks.

In addition to self-help tasks, the site also offers educational materials for a deeper understanding of sql. This helps not only to test your knowledge, but also to deepen your study, broaden your horizons and improve your skills.

I recommend anyone who wants to improve their sql skills to join this project. I myself solved about 30 problems and was satisfied with my choice. I felt that my professional skills began to develop. So, if you are interested in this, I recommend paying attention to this platform!
Search Engine Optimization
Tags: webdev, seo
Published: 2024-06-04 08:48:30

Our SEO services can spell magic on your business and increase the visibility rate of your business to the highest level. If your business is smaller, it can become large and if your business is already larger then it will become the largest. All that possible with our smart SEO solutions.

We are a full-service Digital Marketing Agency. We see ourselves as the digital innovators & technical solutions providers for small and micro businesses. We believe every small business has potential to flourish if they are led strategically.  Customer satisfaction through a value-driven approach with accountability is at the core of Plandigi because your business success matters a lot for us. When you get an inch closer to achievements, we also get to ours.

Our digital marketing services are just awesome! Whether you need to boost sales, web traffic, brand awareness, downloads or enhance your digital presence, engagement rates, email opening rates - we can make it possible for your business. Guaranteed.

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

We provide Digital Marketing Services, Search Engine Optimization, Social Media Marketing, Social Media Optimization, PPC Campaign Management Services, Website Designing & Development Services, YouTube Video Marketing Services and other digital marketing services.

For more information visit our website : https://www.plandigi.com/
Airport transfer service
Tags: transfer, airporttransfer, flughafentransfer
Published: 2024-06-04 08:42:03

Professional drivers, well-versed in the quickest and safest routes, ensure timely arrivals and departures, while our competitive pricing offers exceptional value without compromising on quality. Available 24/7, our **[airport transfer service](https://taxiwiesbaden24.com/)** guarantees punctuality, comfort, and a personalized experience tailored to your schedule.

Book your airport transfer in Wiesbaden today and start your journey with ease and peace of mind.
Is it Normal ?
Published: 2024-06-04 08:38:26

I used to look at 100K followers' accounts as rock stars. It seemed unachievable. So I stopped caring about numbers I can't control. Instead, I built startups for 900 days. This happened: 0 → 1K in 8 months 1K → 10K in 6 months 10K → 100K in 16 months Thank you discipline
8
MoonDAO: To the Moon!
Tags: dao, cryptocurrency
Published: 2024-06-04 07:22:35

MoonDAO is one of over a hundred DAOs that recently chose to [domicile in the Marshall Islands](https://www.midao.org/find-an-advisor) to help them achieve their goals. Here’s an overview of what MoonDAO is and why they chose the Marshall Islands. This is part 3 of a series telling our customer’s stories.


MoonDAO: The Internet’s Space Program
MoonDAO began with a simple goal: to send someone to space through the crowd-sourced power of the internet, using ETH, the Ethereum Network’s native currency. In a one-month campaign in January 2022, MoonDAO raised 2,612 ETH from over 2,000 contributors, amounting to $8.3 million at the time. Shortly after, they purchased two seats on a Blue Origin rocket. By August 2022, just eight months after its inception, MoonDAO sent its first astronaut to space through a democratic vote by its members.

Read more about [MoonDAO](https://www.midao.org/blog-posts/midao-customer-spotlight-moondao).
Automating Trade Compliance with iCustoms IDC
Tags: automation, ai, productivity, software
Published: 2024-06-04 08:25:42

Global trade can be a complex beast, riddled with mountains of paperwork and tedious data entry. Bills of lading, invoices, and customs declarations all contribute to this time-consuming process. But fear not, developers!  iCustoms' Intelligent Data Capture (IDC)  leverages AI to automate this drudgery, streamlining trade compliance workflows.

## The Manual Entry Woes

Traditional trade compliance workflows often rely on manual data entry, a process prone to errors and delays. This can lead to frustrated customers, hefty fines for non-compliance, and wasted developer resources on data correction tasks.

## iCustoms IDC: Your AI-powered Solution

iCustoms IDC tackles these challenges head-on with the power of AI. Here's the magic behind it:

Automated Data Capture: IDC extracts data from various trade documents automatically, eliminating the need for manual entry.
AI-powered Validation: The captured data is validated using AI algorithms, ensuring accuracy and reducing human error.
Seamless Integration: IDC integrates seamlessly with existing workflows and systems, minimizing disruption for developers.
## Benefits for Developers

Increased Efficiency: Say goodbye to manual data entry and hello to streamlined workflows. Free up valuable developer time for more strategic tasks.
Enhanced Data Quality: Accurate data capture and validation minimizes errors, leading to smoother trade compliance processes.
Reduced Development Time: Eliminate the need to build custom data capture solutions and leverage the pre-built functionality of IDC.
Improved Developer Experience: Streamlined data handling translates to a more efficient and enjoyable development experience.
## Exploring the Core (Optional)

If you're curious about the technical details of iCustoms IDC, consider [exploring API documentation or developer resources](https://www.icustoms.ai/blogs/benefits-of-intelligent-data-capture-for-global-trade/).

Tired of battling manual data entry in your trade compliance workflows?  Visit [iCustoms](https://www.icustoms.ai/) today to explore how their IDC solution can empower your development team and optimize global trade processes!
CYTA Tech: Award Winning Digital Marketing Agency
Tags: softwaredevelopment, cytatech, digitalmarketingagency
Published: 2024-06-04 08:14:48

At [CYTA Technologies](https://www.cytatech.com.au/), we are driven by a shared vision of harnessing the power of technology to transform businesses and empower their growth. With a deep understanding of industry trends and emerging technologies, we stay at the forefront of digital innovation, enabling us to deliver forward-thinking solutions that give our clients a competitive edge. We pride ourselves on our ability to adapt to the evolving needs of our clients, providing them with scalable and future-proof solutions that support their long-term growth strategies. Our team is comprised of passionate individuals who thrive on the challenges of the digital realm and are constantly seeking innovative solutions to drive measurable impact.
Excel Perform COUNT on Each Category and Concatenate Results into a String
Tags: beginners, tutorial, programming, productivity
Published: 2024-06-04 07:55:09

**Problem description & analysis**:

In the following Excel table, there are duplicate values in column A:
```
    A
1	Fruit
2	Apple
3	Banana
4	Banana
5	Strawberry
```
Computing task: perform COUNT on each category and concatenate result groups into a string with "+"; if the count is greater than 1, write "x count" after each category. The final result will be like this:

Apple+Bananax2+Strawberry

As shown in the picture below:

![Table with code entered](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/goimm8ahycuu2tocz80n.png)

**Solution**:

Use SPL XLL to enter the following formula:

```
=spl("=?.conj().groups(~;count(1)).(#1 / if(#2>1,$[x] / #2)).concat($[+])",A2:A5)
```
**Explanation**:

The conj()function concatenates subsets; the groups() function performs grouping & aggregation; with $[], we do not need to escape a string with double quotation marks, and #1 represents the 1st field of the table.