teleren/devto huggingface dataset:
WSGI als Python runtime - Django in Produktion Teil 5
Published: 2024-05-26 20:33:06

## Vorwort
Nun, da wir auf unserem Produktionsserver alles auf unsere django - Webapp vorbereitet haben, ist als nächstes Gunicorn dran. Gunicorn wird unsere app - so wie `python manage.py runserver` in der Entwicklung, in Produktion zum laufen bringen.

## Installation in requirements.txt
Jetzt sollte unsere requirements - Datei zumindestens folgendes enthalten:

```
# django
django==5.0.4

# postgresql database adapter
psycopg2==2.9.9
psycopg2-binary==2.9.9

# webserver in production
gunicorn==21.2.0
```

in Entwicklung und Produktion mit `pip install -r requirements.txt` installieren

## Erster Start
Jetzt kannst du den WSGI server das erste mal starten, am besten bei dir Lokal in der Entwicklungsumgebung.

```
cd meine_repository/meine_app
gunicorn meine_app.wsgi

# so sollte dein Output ausschauen:
[2024-05-26 22:25:05 +0200] [71525] [INFO] Starting gunicorn 21.2.0
[2024-05-26 22:25:05 +0200] [71525] [INFO] Listening at: http://127.0.0.1:8000 (71525)
[2024-05-26 22:25:05 +0200] [71525] [INFO] Using worker: sync
[2024-05-26 22:25:05 +0200] [71526] [INFO] Booting worker with pid: 71526
--- Using development Settings ---
```

Nun sollte deine app in der Produktionsversion lokal bei dir laufen. Gehe einfach auf http://127.0.0.1:8000 und du kannst sie dir anschauen.

Das kannst du nun so auch auf deinem Server ausführen, aber du wirst deine App wahrscheinlich nicht unter deiner Domain / ip erreichen können. Um das zu können musst du mit nginx deinen Webserver als Reverse-Proxy weiterleiten. Damit geht's beim nächsten mal weiter.
[Hier kannst du mehr über nginx als Reverse Proxy herausfinden.](https://docs.gunicorn.org/en/latest/deploy.html)

PS: Viel Spaß beim Coden,
Dein Ruben

[Mein Blog](rubenvoss.de)
My first DEV community post
Tags: webdev, discuss, beginners
Published: 2024-05-26 19:59:54

**Hello Dev Community👋**

My name is Mihailo, and I'm from Serbia 🇷🇸. I'm currently a student of information technologies at the Higher Education Technical School of Professional Studies in Novi Sad, and I'm in my final year of studies. As I prepare to finish university, I'm focusing on honing my skills to become a full-stack web developer, with the hope of landing my first IT job next year. This summer, I'm hoping to build up my GitHub with as many projects as possible and create a strong portfolio.

I would greatly appreciate any support and guidance from this community to help me improve as a developer. If you have any suggestions, tips for landing my first job, or just want to connect, please feel free to leave a comment or reach out to me through my socials☺️
Free headless CMS for devs
Tags: webdev, programming, tutorial, startup
Published: 2024-05-26 19:53:18

When I was building [Sveltepack - The ultimate SvelteKit boilerplate](https://sveltepack.com) I had trouble finding a no-bloat, free, and simple tool to make blogs. 

I tried every single headless CMS that I could find but they were all overkill for me. I just needed something small to make blogs.

So I went to Twitter and asked if anyone had the same issues. Turns out they did so I launched [tinycms](https://usetinycms.com)! Tinycms gives you a free online WYSIWYG editor to make blogs, you can then copy the JSON, add it to your database, and serve the data to your web app for free!

I have built components in my web app for each component type on tinycms, this lets me easily loop through the data and render each part of the blog dynamically! In the end I get consistent and clean blogs for my site.

Would love to see what you guys think!
HOW TO CREATE AZURE VIRTUAL MACHINE USING WINDOWS 11
Published: 2024-05-26 15:49:25

Step 1: Logging into Azure Portal
Open your web browser and navigate to https://portal.azure.com.
Sign in using your Azure account credentials.
Step 2: Navigating to Virtual Machines
After logging in, you’ll land on the Azure dashboard. In the left-hand menu, click on “Virtual machines”
This will take you to the Virtual machines section, where you can manage your VMs.
Step 3: Creating a New Virtual Machine
Click the “+ Add” button to start creating a new virtual machine.
The process begins with configuring the basics of your VM:
Subscription: Choose the appropriate subscription.
Resource Group: Create a new or select an existing resource group.
Virtual machine name: Give your VM a unique name.
Region: Choose the data center region closest to you.
Availability options: Select the availability preferences.
Image: Choose the operating system as window 11
add administration account password, click on monitoring and (disable) then tag with the VM name
step 4: click on review and create for virtual machine to be deployed and wait for it to be completed. Also click on recourse group to extend the idle time out on the IP address and save, connect download RDP and save into your local repository and lunch your virtual machine



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xypsh6ikrebtlgc78nza.png)
HTML semantics
Published: 2024-05-26 19:42:26


Semantic HTML are tags that define the content they contain.

Semantic HTML is widely used in HTML 5, which is the latest version of HTML.

It requires organizing and arranging HTML tags in a well detailed manner using detailed elements.

Such elements tags are: Header, nav, section, article, aside, figure, figcaption, main, time, address and footer.

HTML semantics can be beneficial in the following ways: 
1 Code structuring 
2 SEO 
3 Accessibility 
4 Readable and reusable code.

HTML tags:
Header: used to define the header of a context, can be used in any part of the document apart from the footer.

Nav: used to define navigation for links to different pages or any part of the document, the ul and li were formerly used before the nav were introduced 

Figure: used to contain an image, it houses the section of an image and the images caption.

Figcaption: this is the caption for the image in the figure tag.

NB: it is safe to note that most of the HTML semantics tags do not alter the style of the document or give it a specific style, rather it helps in organizing and ordering the code in a readable manner.
Pure HTML with CDN json schema form element has typo
Tags: javascript, jsonschema, uischema, lit
Published: 2024-05-26 19:28:57

what a great project that uses lit

https://github.com/json-schema-form-element/jsfe?tab=readme-ov-file

Everything was working great with https://github.com/json-schema-form-element/examples/blob/main/src/pages/pure-html.html


but when I tried to use the ui-schema it failed until I changed

ui-schema to uiSchema


not working:

```
<json-schema-form
	// .....
	ui-schema='{
		"bar": {
			"ui:widget": "switch"
		}
	}'
></json-schema-form>
```


working:

```
<json-schema-form
	// .....
	uiSchema='{
		"bar": {
			"ui:widget": "switch"
		}
	}'
></json-schema-form>
```
Fin Alchemist MVP with AWS Amplify Gen 2
Tags: devchallenge, awschallenge, amplify, fullstack
Published: 2024-05-26 19:22:29

*This is a submission for the [The AWS Amplify Fullstack TypeScript Challenge ](https://dev.to/challenges/awschallenge)*

## What I Built
I built a simple MVP app. Virtually, It can build a stock portfolio. These stocks are from NASDAQ exchange.

I quite enjoyed using AWS Amplify Gen 2, the only thing I do not like  about it is the `UI-React` library. There is no Modal Component, so I had to implement that on my own :-) Still I had fun... You should try too.

## Screen Shots

![Login Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v0po17x2b4yvjgmxlm79.png)

![Home Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g6r5z2c0uspmd43gr51x.png)

![Stocks Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b41qia8k11dzeqsc3dmc.png)

> **Note: ** Sorry, I am not a UI/UX developer, therefore please mind my design :-)

## Demo and Code

Fin Alchemist's code can be found [here](https://github.com/gokhantamkoc/fin-alchemist-demo-app).
The demo can be accessed from [here](https://main.d2wknzviowb134.amplifyapp.com).

## Integrations

I used the below integrations for `Fin Alchemist`:
- For Authentication, The MVP depends on Cognito.
- For Data, The MVP depends on DynamoDB.
- For Servless Functions, The MVP is integrated with AWS Lambda
- For File Storage: The MVP depends on AWS S3.

**Connected Components and/or Feature Full**

The MVP uses `Authenticator` connected component for Sign in/up actions.

## Team Members

- [Gökhan Tamkoç](https://github.com/gokhantamkoc)

> **Note:** You can connect with me on [Linkedin](https://www.linkedin.com/in/gokhantamkoc/) as well.
C# 13.0 da nima yanglik ?
Tags: csharp, dotnet, microsoft, news
Published: 2024-05-26 19:08:00

**Ushbu maqolada nimalarni o'rganamiz ? **
1. **C#** 13.0 haqida
2. 1👆
3. Params to'plamlar
4. Indexga yashirin kirish

C# 13.0 - Bu C# ning 13.0 chi versioni degani. O'zimizni tilda avlodi. Va har yili yangilanib boradi. Bazida esa 2 3 yilda bir yangilanadi...
Xullas boshladik!

`C# 13.0` o'z ichiga quyidagi narsalarni oladi. 
- Siz ushbu functionni `.NET sdk 9.0` da ishlata olasiz xolos.
- **Visual studio 2022** yoki **VsCode** orqali ishlatishingiz mumkin.

C# 13.0 Faqatgina SDK 9.0 da ishlaydi. Undan pastiga emas ❌

Xohlasangiz `.NET SDK 9.0` ni o'rnating ([ushbu havola orqali](https://dotnet.microsoft.com/en-us/download/dotnet/9.0))

`Params` modifikator massiv turlari bilan cheklanmaydi. Endi siz  `System.Span<T> , System.ReadOnlySpan<T>` va `System.Collections.Generic.IEnumerable<T>` ni params har qanday to'plam turidan foydalana olasiz. Add orqali esa `System.Collections.Generic.IEnumerable<T>` , `System.Collections.Generic.IReadOnlyCollection<T>` , `System.Collections.Generic.IReadOnlyList<T>` , `System.Collections.Generic.ICollection<T>` interfeyslari bor , va `System.Collections.Generic.IList<T>` dan ham foydalanish mumkin.


Indexga yashirin murojaat qilish. 

Endilikda `^` orqali objectni ishga tushirish ham mumkin(ruxsat beriladi). Ya'ni nima demoqchiman. Ming marta eshitgandan bir marta korgan yaxshi deganlaridek. Quyidagi code orqali siz massivni ishga tushirishingiz mumkin. 

```
var sanash = new TimerRemaining()
{
    buffer =
    {
        [^1] = 0,
        [^2] = 1,
        [^3] = 2,
        [^4] = 3,
        [^5] = 4,
        [^6] = 5,
        [^7] = 6,
        [^8] = 7,
        [^9] = 8,
        [^10] = 9
    }
};
```
ana ko'rdilarmi. 

> Hozir bu code 0 dan 9 gacha hisoblovchi massivni yaratadi. C# 9.0 `^` belgi orqali massivni ishga tushirishga ruxsat bermasdi. `C# 13.0` da esa o'zingzi ko'rib turibsiz.
_Hozircha men ham tushunganlarim shu. Lekin hali bundanda qiziqarli maqolalar hali oldinda..._
Amplify-Gallery
Tags: devchallenge, awschallenge, amplify, fullstack
Published: 2024-05-26 18:44:19

*This is a submission for the [The AWS Amplify Fullstack TypeScript Challenge ](https://dev.to/challenges/awschallenge)*

##Introduction
Amplify-gallery is an online photo-sharing app that leverages AWS Amplify's data,storage & authentication .
User can upload photos after authentication & share them to other users.


## Demo and Code
Here you can find the github repo for the reference:
I have used AWS Amplify vite starter template for bootstrapping the app.
[Code](https://github.com/Kaku-g/amplify-vite-react-template)

[Live Website](https://main.d269wuph7uc92m.amplifyapp.com/)


## Integrations

I have used AWS Amplify's authentication, data & storage for building tis gallery. Additionally I have used MUI as frotendnlibrary and toastify for providing notifications.

**Connected Components and/or Feature Full**


##Screenshots

Photo-Gallery
![Image-Gallery](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l3fgysnq0lwqec7r79wm.png)

Authentication Page
![Login Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xmlzfgxe4mhjski9fdo0.png)

##Future Updates
 Amplify's Lamda functions to make it an intelligent photo sharing app that utilizes cloud space. It will automatically compress the less accessed photos & will timely keep track of the compressed & uncompressed files.
Rodosbet Giriş
Tags: rodosbet
Published: 2024-05-26 18:20:46

**Rodosbet**

RodosBet, 2021 yılında kurulan ve kısa sürede online bahis ve casino sektöründe kendine sağlam bir yer edinen bir platformdur. PAGCOR lisansına sahip olan RodosBet, kullanıcılarına güvenilir ve kaliteli bir oyun deneyimi sunmayı hedefler. BETCONSTRUCT altyapısını kullanan site, hem spor bahisleri hem de casino oyunlarında geniş bir yelpaze sunar.

**RodosBet**'in sunduğu spor bahisleri seçenekleri oldukça çeşitlidir. Futbol, basketbol, tenis gibi popüler spor dallarının yanı sıra, e-spor ve daha az bilinen spor dallarında da bahis yapma imkanı sağlar. Bu sayede, farklı ilgi alanlarına sahip kullanıcılar, kendilerine uygun bahis seçeneklerini kolayca bulabilirler. Spor bahislerinin yanı sıra, canlı bahis imkanı da sunan RodosBet, maçları anlık olarak takip ederek bahis yapma olanağı sağlar.

Casino oyunları konusunda da oldukça iddialı olan RodosBet, kullanıcılarına çeşitli oyun sağlayıcılarından oluşan geniş bir oyun yelpazesi sunar. Evolution, Pragmatic Play Live, NetEnt gibi dünya çapında tanınan sağlayıcılarla çalışan RodosBet, yüksek kaliteli ve eğlenceli casino oyunlarına ev sahipliği yapar. Slot oyunları, masa oyunları, canlı casino ve daha birçok seçenek ile kullanıcılarına keyifli bir oyun deneyimi sunar.

Finansal işlemler konusunda da kullanıcı dostu bir yaklaşım sergileyen RodosBet, çeşitli yatırım ve çekim yöntemleri sunar. Kripto Fulgurpay, JestPays Havale, Payfix, MiniPay Papara, Anında Papara, Anında Parazula, MiniHavale Kredi Kartı, HemenÖde Mefete, Anında Kredi Kartı, Aninda QR, Hizlıca Papara, Tosla, Paycell ve Peppara gibi birçok ödeme yöntemi sayesinde kullanıcılar, kendilerine en uygun ve güvenli yöntemi seçebilirler. Bu çeşitlilik, kullanıcıların finansal işlemlerini hızlı ve sorunsuz bir şekilde gerçekleştirmelerini sağlar.

_RodosBet_, kullanıcı deneyimini en üst düzeye çıkarmak için çeşitli sosyal medya platformlarında da aktif olarak yer alır. Telegram kanalı, Twitter ve YouTube gibi platformlar üzerinden kullanıcılarına en güncel bilgileri ve promosyonları sunar. Bu sayede, kullanıcılar her zaman en yeni bilgilere ve fırsatlara erişebilirler. Ayrıca, RodosBet'in mobil uygulaması sayesinde kullanıcılar, her yerden ve her zaman siteye erişim sağlayabilirler. Mobil uygulama, kullanıcıların hareket halindeyken bile bahis yapmalarına ve casino oyunlarına katılmalarına olanak tanır.

Sonuç olarak, [RodosBet](https://rodosbet-giris.blogspot.com/), geniş oyun seçenekleri, çeşitli ödeme yöntemleri ve kullanıcı dostu hizmet anlayışı ile online bahis ve casino sektöründe öne çıkan bir platformdur. Kullanıcılarına güvenilir ve eğlenceli bir oyun deneyimi sunmayı amaçlayan RodosBet, sürekli olarak kendini geliştirerek kullanıcı memnuniyetini en üst düzeyde tutmayı hedefler.
AWS Amplify Fullstack TypeScript Challenge Submission
Tags: devchallenge, awschallenge, amplify, fullstack
Published: 2024-05-26 17:54:45

*This is a submission for the [The AWS Amplify Fullstack TypeScript Challenge ](https://dev.to/challenges/aws)*

## What I Built
My app is a demo of a fictional company called ChargeNG. They provide monitoring of the British electricity grid to consumers so that they can check supply and demand, both currently and historically, to make decisions on when and where to charge their EV.

## Demo
[ChargeNG Demo](https://main.d28gbqvmg1hblh.amplifyapp.com/)
(You'll need to register with an email address in order to access the app content. Don't worry, I'll remove all user accounts regularly!)

![Town View page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p6wa208zkqazvtf3re1w.png)

![Street View page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hrkmvzjttk1ls6n88jgx.png)

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

## Journey
I use Amplify Gen 1 in my day job, so having a good reason to try out Gen 2 was too good an opportunity to pass on!

I already use an AWS tech stack in my day job, so I already knew that I wanted to incorporate Cognito, AppSync, DynamoDB and S3. The Gen 2 Amplify documentation was really clear and, much like with the Gen 1 documentation, I got up and running with Gen 2 quickly. Of course there are some gotchas that need to be addressed by AWS:

- If we're going to be allowed to define our Cognito service in code, then Cognito needs to support updating the user pool from code. I ran into build errors that required me to delete the app and start over.
- It would be awesome if Amplify Data could support single-table design in . Our production data model would require at least half a dozen tables with the current Gen 2 implementation, which would create a big headache for integration and maintenance.
- The **list()** method really shouldn't default to a DynamoDB scan for obvious reasons. Our production data contains DynamoDB items partitioned by area (i.e. "MeasurementByArea#< Area ID >"), so I'd like to be able to supply the partition key (and optionally the sort key) when I call the **list()** method, switching it to query mode.

The app itself uses [Tanstack Query](https://tanstack.com/query/latest) to manage client-side data, with the Amplify Data operations contained in a utilities file ("utils/crud.js"). The charting feature is implemented using [Recharts](https://recharts.org/en-US/).

Overall, it's great that I can now do in code what used to be a PITA to do in configuration and direct in the generated service. The next step for me is to start making a lot of noise in AWS' direction to get the above issues resolved, so I can make plans to use Amplify Gen 2 in our product web application.

**Connected Components and/or Feature Full**

The UI is built with Next.js 14, the Amplify UI library and uses the Authenticator connected component to implement the UI for user management.

The project uses the following Amplify categories:

- Auth
- Data
- Storage
Lost money trading crypto, get it recovered !
Published: 2024-05-26 17:24:14

I became a victim of a bitcoin scam and lost a significant amount of money. This incident happened a month ago. The way I handled the situation and recovered my money was to reach out to the right recovery support, via an email on; Hackrecovery AT Yandex DOT ru, I was in a complete despair. I started to feel a little better about myself as soon as I wrote them a letter. The good thing here is that I didn’t have to worry about anything during the process; all I had to do was wait for them to finish and return all my lost money to my wallet. I really commend the whole process.
Create a circle in html css
Tags: circle, shape, html, css
Published: 2024-05-26 17:17:35

<h2>How to create a circle in html/css</h2>
<h3>First step: create the square</h3>
<p>To create a square in html/css, you can create/write a div element, and add a background and a size to this:</p>

{% codepen https://codepen.io/TidyCoder/pen/LYoRvjz %}

<h3>Two step: use the border-radius css property to add rounded corners to this</h3>
<p>Set the border-radius property to 50% for all corner, Because 50% is the half of 59px in this code.</p>
{% codepen https://codepen.io/TidyCoder/pen/pomEBWv %}
552. Student Attendance Record II
Tags: php, leetcode, algorithms, programming
Published: 2024-05-26 16:57:35

552\. Student Attendance Record II

Hard

An attendance record for a student can be represented as a string where each character signifies whether the student was absent, late, or present on that day. The record only contains the following three characters:

- `'A'`: Absent.
- `'L'`: Late.
- `'P'`: Present.

Any student is eligible for an attendance award if they meet **both** of the following criteria:

- The student was absent (`'A'`) for **strictly** fewer than 2 days **total**.
- The student was **never** late (`'L'`) for 3 or more **consecutive** days.

Given an integer `n`, return _the **number** of possible attendance records of length `n` that make a student eligible for an attendance award. The answer may be very large, so return it **modulo** <code>10<sup>9</sup> + 7</code>._

**Example 1:**

- **Input:** n = 2
- **Output:** 8
- **Explanation:** There are 8 records with length 2 that are eligible for an award:

  "PP", "AP", "PA", "LP", "PL", "AL", "LA", "LL"

  Only "AA" is not eligible because there are 2 absences (there need to be fewer than 2).

**Example 2:**

- **Input:** n = 1
- **Output:** 3 

**Example 3:**

- **Input:** n = 10101
- **Output:** 183236316 

**Constraints:**

- <code>1 <= n <= 10<sup>9</sup></code>

**Solution:**

```
class Solution {

    /**
     * @param Integer $n
     * @return Integer
     */
    function checkRecord($n) {
        $kMod = 1000000007;
        $dp = array(array(0, 0, 0), array(0, 0, 0));
        $dp[0][0] = 1;

        while ($n-- > 0) {
            $prev = array_map(function($A) {
                return array_values($A);
            }, $dp);
            
            $dp[0][0] = ($prev[0][0] + $prev[0][1] + $prev[0][2]) % $kMod;
            
            $dp[0][1] = $prev[0][0];
            
            $dp[0][2] = $prev[0][1];
            
            $dp[1][0] = ($prev[0][0] + $prev[0][1] + $prev[0][2] + $prev[1][0] + $prev[1][1] + $prev[1][2]) % $kMod;
            
            $dp[1][1] = $prev[1][0];
            
            $dp[1][2] = $prev[1][1];
        }

        return (int)(($dp[0][0] + $dp[0][1] + $dp[0][2] + $dp[1][0] + $dp[1][1] + $dp[1][2]) % $kMod);

    }
}
```


**Contact Links**

- **[LinkedIn](https://www.linkedin.com/in/arifulhaque/)**
- **[GitHub](https://github.com/mah-shamim)**
Learning Python
Tags: python, machinelearning, webdev, beginners
Published: 2024-05-26 16:57:22

Hi guys, this is my second personal blog about learning Python. I am happy to say I am already in an advanced topic. Python is easier than I thought. If you are scared of programming you should definitely start with Python.

So far, Harvard CS50 has been the most important resource followed by the University of Helsinki(MOOC.fi). I would highly recommend these resources.

In addition to Python, I have gained some knowledge in SQL and Robotics. I was able to build almost all the bigger level projects and was able to solve some leetcode problems.

It was very fun to learn and be productive.
Unveiling JavaScript: The Quirks and Charms of the World's Most Popular Language
Tags: javascript, react, programming, beginners
Published: 2024-05-26 16:26:21


![javascript](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/04bcd1gw3lmgv2lhkx5f.jpeg)
Love it or hate it, you can't ignore it. Here are some fascinating quirks and unique features of JavaScript that every developer should know about:

➡ JavaScript was created in just 10 days by Brendan Eich in 1995. This rushed development has left us with some interesting quirks.

➡ JavaScript automatically converts values between types, which can lead to unexpected results:
 - [] + [] results in an empty string ("").
 - [] + {} yields [object Object].
 - Swapping the order ({} + []) gives 0.
 - {} + {} results in NaN.

➡ Did you know that JavaScript's `Array.prototype.sort` sorts elements as strings by default? To sort numbers correctly, you need to provide a compare function:
 [1, 100000, 21, 30, 4].sort((a, b) => a - b); // Correctly sorts numbers

➡ Two ways to represent 'no value':
 - undefined: A variable has been declared but not assigned a value.
 - null: An assignment value representing an intentional absence of any object value.


➡ Before ES6, JavaScript lacked a native module system, leading to the creation of CommonJS, AMD, and UMD. Now, we have ES Modules, but older projects still use the old systems, adding complexity.

➡ The JavaScript world is constantly evolving with new frameworks and libraries. This rapid evolution can feel like a never-ending chase for the latest and greatest tools.

Despite its quirks, JavaScript remains a versatile and essential language for web development. Embrace its uniqueness and leverage its widespread use to build amazing projects