teleren/devto huggingface dataset:
Tic Tac Toe Terminal Game
Tags: python, terminal, beginners, learning
Published: 2024-04-11 20:25:11

_This is a Python Terminal Game that was part of a Portfolio Project for the Computer Science Codecademy course._

The source code can be found on Github using the following link:  `https://github.com/IoanPapuc/tic_tac_toe_terminal_game-.git`



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

## Description and Functionalities

The presented program, written in Python, generates a terminal version of the **Tic Tac Toe** game, also known as **Xs and Os**, which can be played by two users. 

The players are asked successively to input the location, consisting of row and column, where they want their specific character to be inserted. Every time a user enters a new symbol, the grid is updated and displayed into the terminal.

Errors generated by the introduction of non-valid inputs are identified and treated accordingly: the user is asked to re-enter a row and a column if the entered values are integers different from 1, 2 or 3 or if the respective location has been previously filled. The same thing happens if non-integer data types are entered instead of a row or column. The only exception to the last rule is made for the character 'Q' which can be entered by any player to quit the current game.

The game ends when a player first satisfies one of the three winning conditions, when a draw is reached or when one of the player uses the 'Q' option.

Users have the possibility to play multiple games in a row without running the source code from the file each time, due to a menu-managed game framework that has been set. The menu provides two options: 'S' to start a game and 'E' to exit the program.


## Short Overview of the functions 

- <u>new_board()</u> - creates a new empty grid

- <u>print_board()</u> - displays the grid in a suitable manner

- <u>insert_symbol(board, symbol)</u> - asks the users to input the row and column of their own character and updates the grid accordingly before printing it; also checks and ensures the accuracy in data entry 

- <u>full_row(board, symbol)</u>, <u>full_column(board, symbol)</u>, <u>full_diag(board, symbol)</u> - return 'True' if a sequence of three identical symbols are placed in a row, column or diagonal

- <u>winning_verification(board, symbol)</u> - returns 'True' if one of the three winning criteria from above is satisfied

- <u>play_game()</u> - the main function in the program; includes all of the previously mentioned function and establishes the conditions for stopping the game

- <u>game_menu()</u> - very simple menu-driven interface created to make multi-game sessions easier to play
 

Obviously, this is just a basic version of the classic Tic Tac Toe game. It can be improved and completed in countless ways such that, with enough imagination, can lead to a sufficiently complex and challenging game.
My First Youtube live stream
Published: 2024-04-11 20:16:21

---
title: My First Youtube live stream
published: true
description: A description of my first youtube live stream. I am blind, so I hope all the visuals turned out OK. Would love feedback.
tags: 
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2024-04-11 20:06 +0000
---
I am a blind web developer, and I made my first youtube livestream today. i converted a webhook using clerk authentication from a next.js webhook to an express route for use in an express api server. I recorded my screen reader as well so you would be able to hear how I code. I hope the visuals turned out OK i.e. you can actually see my screen, I'm not very familiar with how obs works, I just added the sources. Are there any virtual react/programming meetups out there, I live in a small town so there isn't much here. Link to the video below:
https://www.youtube.com/watch?v=ZRTmhZY6SK4&t=42s
Tutorial Básico de Go
Tags: go, braziliandevs, beginners
Published: 2024-04-11 20:07:38

## Introdução

Go, também conhecida como Golang, é uma linguagem de programação de código aberto desenvolvida pelo Google em 2007. Ela foi projetada para ser eficiente, concisa e fácil de usar. Neste tutorial, vamos cobrir os conceitos básicos da linguagem Go, incluindo variáveis, estruturas de controle, funções e pacotes.

## Instalação

Antes de começar a escrever código em Go, você precisa instalar o compilador e configurar o ambiente de desenvolvimento. Você pode baixar e instalar o Go em golang.org.

## Hello, World!

Vamos começar com o tradicional "Hello, World!" em Go:

```go

package main

import "fmt"

func main() {
    fmt.Println("Hello, World!")
}
```

Para executar esse programa, salve-o em um arquivo com extensão .go (por exemplo, hello.go) e use o comando go run seguido do nome do arquivo:

```bash
go run hello.go
```
Isso imprimirá "Hello, World!" no console.
Variáveis

Em Go, você declara variáveis usando a palavra-chave var, seguida pelo nome da variável e seu tipo:

```go


package main

import "fmt"

func main() {
    var nome string = "Gopher"
    idade := 10 // Inferência de tipo
    fmt.Println("Olá,", nome)
    fmt.Println("Idade:", idade)
}
```

## Estruturas de Controle

Go possui estruturas de controle familiares, como if, for e switch:

```go
package main

import "fmt"

func main() {
    // if
    x := 10
    if x > 5 {
        fmt.Println("x é maior que 5")
    } else {
        fmt.Println("x é menor ou igual a 5")
    }

    // for
    for i := 0; i < 5; i++ {
        fmt.Println(i)
    }

    // switch
    dia := "segunda"
    switch dia {
    case "segunda":
        fmt.Println("Dia útil")
    case "sábado", "domingo":
        fmt.Println("Fim de semana")
    default:
        fmt.Println("Outro dia")
    }
}
```

## Funções

Você pode definir funções em Go usando a palavra-chave func:


```go
package main

import "fmt"

func soma(a, b int) int {
    return a + b
}

func main() {
    resultado := soma(3, 4)
    fmt.Println("3 + 4 =", resultado)
}
```

## Pacotes

Go organiza código em pacotes. Você pode importar pacotes usando a declaração import:

```go
package main

import (
    "fmt"
    "math/rand"
)

func main() {
    fmt.Println("Número aleatório:", rand.Intn(100))
}
```

Este é apenas um tutorial básico para começar com a linguagem de programação Go. Há muito mais para aprender, incluindo tipos de dados avançados, ponteiros, interfaces e concorrência. Recomendo explorar a documentação oficial em golang.org
Setup and Use Pyenv in Python Applications
Tags: python, tutorial, development, programming
Published: 2024-04-11 20:04:14

Pyenv is a popular option in Python applications. Pyenv allows you to manage different versions of Python in your application and also on your system.

Pyenv does not officially support Windows but you can use WSL (Windows Subsystem for Linux).

> For more information visit: [pyenv repository](https://github.com/pyenv/pyenv)

### Installation:
You can install using Homebrew or make a manual installation:

- **Using Homebrew**:
    ```bash     
    brew install pyenv
    ```

- **Manual Installation**:
    - Download pyenv:    
    ```bash
    curl https://pyenv.run | bash    
    ```

    - Let's edit your bash profile:    
    ```bash
    nano .bashrc
    ```

    - Add these lines in the end of the document:    
    ```bash
    export PYENV_ROOT="$HOME/.pyenv"
    export PATH="$PYENV_ROOT/bin:$PATH"
    eval "$(pyenv init --path)"
    ```

### Creating a Virtual Environment:
```bash
pyenv virtualenv <python_version> <env_name>
```

### Activating the Virtual Environment:
```bash
pyenv activate <env_name>
```

### Deactivating the Virtual Environment:
```bash
pyenv deactivate
```

### Managing Python Versions:

Pyenv allows you to manage python versions, here is a simple tutorial that you can use in your application or in your input system:

    
- List available versions: 
```bash
pyenv install -list
```

- Install a version:
```bash
pyenv install <version>
```

- Defining a version: 
```bash
pyenv global <version> # set a global version
pyenv local <version> # set a local version
```
Setup and use Virtualenv in Python Applications
Tags: python, tutorial, development, programming
Published: 2024-04-11 20:02:01

virtualenv is a simple to use tool to create isolated Python environments.

For more information visit: [virtualenv documentation](https://virtualenv.pypa.io/).

### Installation:
```bash
pip install virtualenv
```

### Creating a Virtual Environment:
```bash
virtualenv <env_name>
```

### Activating the Virtual Environment:
- On Unix-like systems (Unix, Linux, or MacOS):
```bash
source <env_name>/bin/activate
```

- On Windows:
```bash
<env_name>\Scripts\activate
```

### Deactivating the Virtual Environment:
```bash
deactivate
```
JavaScript Challenge: What would be your solution to this challenge? 🥷🏻🧩
Tags: javascript, beginners, challenge, discuss
Published: 2024-04-11 19:56:50

Hey folks. how are you today?!

Today I saw a cool and interesting JavaScript challenge and thought I'd bring it to our community too!

Soo...


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

___

## The Challenge 🕵️‍♂️

The expected result for the challenge will be something like below:

### 🎯 Expected Output:
```javascript
{
  CJS: "This is the original Node.js module system, used since its first versions."
}
```

And also the base code is to start solving the challenge as below:


### 🎯 Base Code:
```javascript
function getCorrectDescription(patternName) { 
	let patterns = { 
		ESM: "This is a more modern modularization pattern, officially introduced in newer versions of Node.js.", 
		CJS: "This is the original Node.js module system, used since its first versions.", 
		AMD: "AAMD is a modularization standard associated with JavaScript development for the browser.",
	};

	return ?;
 }
```
___

A little cool, right?!

When I saw this challenge I thought it was really cool and I needed to take some time to apply it and finish it.

And you, what would be your proposed solution?! Leave it in the comments, let's share and see different ways of solving

See you 😄😁
Setup and use Python Venv in Python Applications
Tags: python, tutorial, development, programming
Published: 2024-04-11 19:55:02

Python Venv is a built-in tool to create and manage lightweight virtual environments. 

> For more information visit: [venv tutorial](https://docs.python.org/3/tutorial/venv.html).

### Installation:
Already installed on MacOS and Windows platforms, but needs to be installed on some Linux distros, here is an installation guide for different package managers:

```bash
sudo apt install python3-env # using apt
sudo dnf install python3-env # using dnf
sudo pacman -S python3-env # using pacman
```

### Creating a Virtual Environment:
```bash
python -m venv <env_name> # Unix-like systems
python -m venv <env_name> # windows
```

### Activating the Virtual Environment:

- On Unix-like systems (Unix, Linux, or MacOS):
```bash
source <env_name>/bin/activate
```

- On Windows:
```bash
<env_name>\Scripts\activate
```

### Deactivating the Virtual Environment:
```bash
deactivate
```
How to open a Camera on an HTML Site?
Published: 2024-04-11 19:36:14

To open a camera on an HTML site, you usually use the getUserMedia() API offered by HTML5. This API provides access to the cameras and microphones on the user's device. Here is a simple example:

`<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Kamera Açma</title>
</head>
<body>
    <h1>Kamera Açma</h1>
    <video id="videoElement" autoplay></video>

    <script>
        // Kameraya erişimi kontrol et
        navigator.mediaDevices.getUserMedia({ video: true })
            .then(function (stream) {
                var video = document.getElementById('videoElement');
                // Video elementine akışı atayın
                video.srcObject = stream;
            })
            .catch(function (err) {
                console.log("Kamera erişim hatası: " + err);
            });
    </script>
</body>
</html>
`

This code creates a video element to display images from the camera into a video tag and provides access to the camera with getUserMedia(). When the user visits this page, the browser will ask for permission to access the camera, and if the user gives permission, the camera image will be transferred to the video element.
To create a new Node.js project and work with dependencies, you'll need to follow these steps
Tags: typescript, ai, javascript, programming
Published: 2024-04-11 19:19:03


**Initialize a new Node.js project**: This will create a `package.json` file in your project directory.
```bash
mkdir my-node-project
cd my-node-project
npm init -y
```

**Install dependencies**: Use `npm` to install any libraries you need. For example, if you need Express.js, you would run:
```bash
npm install express
```

**Create your main file**: Typically, this is `index.js` or `app.js`. Here's a simple Express server
```javascript
const express = require('express');
const app = express();

app.get('/', (req, res) => {
  res.send('Hello World!');
});

const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
  console.log(`Server running on port ${PORT}`);
});
```
**Run your application**: You can start your Node.js application with the following command:
```bash
node index.js
```

Remember to replace `express` with any other dependencies you might need for your project. Also, you can add scripts to your `package.json` to streamline the start-up process, like so:
```json
"scripts": {
  "start": "node index.js"
}
```

Now, you can start your server with `npm start`. This is a basic setup, and your actual implementation might vary based on the project requirements.
What do you do if your superiors doubt your ability to handle challenging projects in Cloud Computing?
Published: 2024-04-11 19:13:59

**Acknowledge the Concerns:**

- Begin by acknowledging the concerns expressed by your superiors. 🤔
- Show understanding of their perspective and the importance of ensuring project success. 📉

**Highlight Relevant Experience:**

- Detail your experience and past successes in Cloud Computing projects. 💼
- Mention specific projects you’ve worked on, highlighting your contributions and achievements. 🏆
- Emphasize any relevant certifications or training you have undergone to strengthen your expertise. 🎓

**Demonstrate Understanding:**

- Explain your understanding of the challenges involved in Cloud Computing projects. 💡
- Discuss your familiarity with the latest technologies, best practices, and industry trends. 🌐
- Provide examples of how you have successfully navigated similar challenges in the past. 🔄

**Propose a Plan:**

- Offer a comprehensive plan outlining how you intend to approach the challenging project. 📝
- Break down the project into manageable tasks and milestones, demonstrating your strategic thinking and problem-solving skills. 🎯
- Highlight any innovative ideas or strategies you plan to implement to ensure project success. 💡

**Request Support and Resources:**

- Express willingness to collaborate with colleagues and seek support from experts if needed. 🤝
- Request any additional resources or training that could enhance your ability to excel in the project. 📚
- Show readiness to learn and adapt to new technologies or methodologies as required. 🔄

**Communicate Confidence and Enthusiasm:**

- Convey confidence in your abilities to overcome challenges and deliver results. 💪
- Express enthusiasm for the opportunity to take on a challenging project and contribute to the success of the team and the organization. 🚀
- Reiterate your commitment to meeting or exceeding expectations. 
✅

**Seek Feedback and Reassurance:**

- Invite feedback from your superiors on your proposed plan and approach. 🗣️
- Address any remaining concerns they may have and provide reassurance that you are capable of delivering results. 🤝
- Remain open to constructive criticism and demonstrate a willingness to refine your approach based on feedback. 🔄

**Follow Through and Deliver:**

- Once the project is underway, consistently communicate progress updates to your superiors. 📊
- Proactively address any issues or challenges that arise, demonstrating your ability to adapt and problem-solve effectively. 🛠️
- Deliver high-quality results within the agreed-upon timeframe, showcasing your competence and reliability. 🏅

For a one-on-one discussion using this URL: https://topmate.io/debashis_sikdar/423205

To follow Linkedin Page: https://www.linkedin.com/in/debashis-s/

#programming #coding #softwaredevelopment #webdevelopment #javascript #python #opensource #devops #cloudcomputing
#cplusplus #java #frontend #backend #webdev #techcommunity
Learn Primitives Types in TypeScript
Tags: javascript, beginners, learning, codenewbie
Published: 2024-04-11 19:03:27

# Learn Primitives Types in TypeScript


### Hello there 👋! I am Birusha Ndegeya.

Learning TypeScript is crucial to understanding programming languages. TypeScript, being a superset of JavaScript, can be easily learned if you're familiar with JavaScript fundamentals. You can even choose TypeScript as your first programming language.

In this tutorial, we'll cover the basics of TypeScript, starting with data types. For those new to programming, knowing how to print something on a computer using TypeScript is essential. Let's start with a basic command:

```ts

console.log("Hello World"); // Output: Hello World

```

## Let's dive deeper into understanding TypeScript primitive types.

To create a variable, we use the keywords **let** or **const**.

```ts
let name: string = "Jill";
const ID: number = 1;
```

To display these variables, we use the function:

```ts

console.log(name); // Output: Jill
console.log(ID); // Output: 1

```

We use **const** for values that never change, and by convention, we write them in uppercase. **let** is used when the value can change.

### Now, let's explore the basic data types widely used in TypeScript:

- **string** : Represents a chain of characters enclosed in double or single quotes.

```ts

let firstName: string = "Jimmy";
let lastName: string = 'Elijah';
// We can print them to the screen:
console.log(firstName); // Output: Jimmy
console.log(lastName); // Output: Elijah

// Checking the type:
console.log(typeof firstName); // Output: string
console.log(typeof lastName); // Output: string

```

- **boolean** : Represents true or false values.

```ts

const isMale: boolean = true;
const isFemale: boolean = false;

// Printing them to the screen:
console.log(isMale); // Output: true
console.log(isFemale); // Output: false

// Checking the type:
console.log(typeof isMale); // Output: boolean
console.log(typeof isFemale); // Output: boolean

```

- **number** Represents any numeric value, including whole numbers or decimal numbers.

```ts

let age: number = 30;
const GPA: number = 3.1;

// Printing them to the screen:
console.log(age); // Output: 30
console.log(GPA); // Output: 3.1

// Checking the type:
console.log(typeof age); // Output: number
console.log(typeof GPA); // Output: number

```

### Additionally, a variable can hold multiple types:

```ts

let ID: number | string;
// Assigning it a number value:
ID = 1;
console.log(ID); // Output: 1
// Checking the type:
console.log(typeof ID); // Output: number

// Assigning it a string value:
ID = '01';
console.log(ID); // Output: 01

// Checking the type:
console.log(typeof ID); // Output: string

```

Now, if you need a starter code, you can visit my [GitHub profile]("https://github.com/BirushaNdegeya/learn-primitives-typescript"). 

Thanks for keeping up with the reading. 

**Happy coding!** 🚀🚀🚚🚚🚚
fit_transform()
Published: 2024-04-11 18:48:25

`fit_transform` yöntemi, özellikle makine öğrenimi ve veri analizi alanlarında sıkça kullanılan bir yöntemdir. Genellikle veri ön işleme aşamasında kullanılır ve aşağıdaki işlevleri yerine getirir:

1. **Uygun parametreleri öğrenme (`fit`):** Bu adımda, veriye uygun normalleştirme, ölçekleme veya diğer dönüşümler için gerekli parametreler (örneğin, ortalama ve standart sapma gibi) öğrenilir. Bu, veriye uygulanacak dönüşümü tanımlayan parametrelerin belirlenmesini sağlar.

2. **Veriyi dönüştürme (`transform`):** Bu adımda, öğrenilen parametreler kullanılarak veri dönüştürülür. Bu dönüşüm, verinin ölçeklendirilmesi, normalleştirilmesi veya diğer işlemlerle değiştirilmesini içerebilir.

Birçok durumda, bu iki adım bir arada kullanılır ve `fit_transform` yöntemi bu işlevleri birleştirir. Özellikle, eğitim veri setindeki istatistiklerin hesaplanması ve aynı dönüşümlerin test veya doğrulama veri setlerine de uygulanması gerektiğinde, `fit_transform` yöntemi kullanışlıdır.

Özetle, `fit_transform` yöntemi, veriye uygun parametreleri öğrenir ve bu parametreleri kullanarak veriyi dönüştürür. Bu, veri ön işleme sürecinde veriye uygun dönüşümleri uygulamak için sıkça kullanılan bir yöntemdir.
Janitor AI: Unlock the Secrets of Your AI Chat Partner
Published: 2024-04-11 18:46:25

Consider Janitor AI as a fantastic playground where you may communicate with a wide variety of characters, from smart sages to adorable cartoon heroes. It's similar to having pen pals with unique backstories and secrets from many realms. To know More: https://digicrusader.com/janitor-ai-chat/
MinMaxScaler()
Published: 2024-04-11 18:41:00

`MinMaxScaler`, veri normalizasyonu yapmak için kullanılan bir dönüştürücüdür. Normalizasyon, veri setindeki değerleri belirli bir aralığa veya ölçeğe dönüştürme işlemidir. `MinMaxScaler`, veri setindeki değerleri belirli bir aralığa sıkıştırmak için kullanılır, genellikle 0 ile 1 arasında bir aralıkta olacak şekilde ölçeklendirme yapar.

Özellikle, Min-Max normalizasyonu için kullanılan formül şu şekildedir:


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



`MinMaxScaler` kullanılarak bu normalizasyon işlemi yapılır ve veri setindeki her bir özellik (sütun) için ayrı ayrı uygulanır. Bu işlem, özellikler arasındaki farklı ölçeklerin neden olduğu problemleri gidermek için sıklıkla kullanılır. Özellikle, makine öğrenimi algoritmalarıyla çalışırken, özellikler arasındaki farklı ölçekler, modelin yanlış eğitilmesine veya düşük performansına neden olabilir. Bu nedenle, veri setindeki özellikleri aynı ölçeğe getirmek önemlidir.

Özetle, `MinMaxScaler`, veri setindeki değerleri belirli bir aralığa sıkıştırarak veriyi normalize etmek için kullanılır. Bu, özellikler arasındaki ölçek farklılıklarını ortadan kaldırarak model performansını artırabilir.