teleren/devto huggingface dataset:
Resolving Attribute Error in WebDriver Implementation using Python
Tags: python, beginners, php, programming
Published: 2024-01-10 20:52:27

If you're facing an AttributeError while implementing WebDriver in Python, the issue might arise when attempting to use **find_element_by_name** directly on the **webdriver.Chrome()** object. This method is not available on the **webdriver.Chrome()** object itself but should be applied to the WebDriver instance returned when opening a webpage.

To address this, consider the following corrected Python code:

```
import random
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys

# Initialize the WebDriver instance using Chrome
driver = webdriver.Chrome()
driver.get("https://www.facebook.com")

# Generate random credentials
username = str(random.randint(0, 999999999)).zfill(5)
password = username[:-2]

# Locate the email input field and input username
email_field = driver.find_element_by_name("email")
email_field.send_keys(username)

# Locate the password input field and input password
password_field = driver.find_element_by_name("pass")
password_field.send_keys(password)

# Locate the login button and click it
login_button = driver.find_element_by_name("login")
login_button.click()

# Adding a delay to ensure elements are loaded (consider using WebDriverWait for a more robust solution)
time.sleep(5)



```

Now, the **find_element_by_name** method is appropriately applied to the driver instance rather than the **webdriver.Chrome()** object, resolving the AttributeError. Feel free to customize the code further based on your specific requirements.


**[Solving Selenium AttributeError: A Comprehensive Guide for WebDriver Implementation in Python](https://dgihost.com/index.php/2024/01/10/webdriver-implementation-in-python/)**

Thanks for reading,
**DGI Host.com**
I was once lured into a crypto currency investment platform
Published: 2024-01-10 20:29:28

I was once lured into a crypto currency investment platform that I came across on Instagram. I lost about $508,000 to this evil scheme after I invested and accumulated profits, I was denied withdrawals on the specified date. I wrote to the customer support but I was given no feedback, I knew I had been scammed and I started to search for a way to recover my crypto.. I considered myself fortunate that I stumbled upon a post on the internet web about a Recovery Expert Jeanson James Ancheta wizard. I would highly recommend Jeanson James Ancheta wizard agent to anyone who wants to recover their lost funds from any scam. He is the best in the business and will do anything possible to help you get your money back. I never thought it would be possible to get back crypto once it is sent but I'm super happy and grateful for the services of Jeanson James Ancheta wizard. Kindly reach out to him if you need any help.(jeansonjamesanchetawizard62@gmail.com) or  WhatsApp number: +44 (7951) 389762 or +44 (7506) 216101.
Analyzing .next/trace
Published: 2024-01-10 20:21:51

If you want to analyze why your Next.js build is slow, using `.next/trace` is what you need. But it's not documented.

To analyze in your CLI:

Make sure to have pnpm installed.

```bash
git clone https://github.com/vercel/next.js.git && cd next.js
pnpm i
node scripts/trace-to-tree.mjs /your/app/.next/trace
```

To analyze with Jaeger:

First make sure to have Docker and Cargo/Rust installed.

```bash
docker run --rm --name jaeger \
  -e COLLECTOR_ZIPKIN_HOST_PORT=:9411 \
  -p 6831:6831/udp \
  -p 6832:6832/udp \
  -p 5778:5778 \
  -p 16686:16686 \
  -p 4317:4317 \
  -p 4318:4318 \
  -p 14250:14250 \
  -p 14268:14268 \
  -p 14269:14269 \
  -p 9411:9411 \
  jaegertracing/all-in-one:1.52
```

```bash
git clone https://github.com/vercel/next.js.git && cd next.js
pnpm i
cd scripts/send-to-jaeger
cargo run /your/app/.next/trace
```

At the top of the output, the trace URL will be logged:

```bash
Jaeger trace will be available on http://127.0.0.1:16686/trace/ae9e5ca034dca21e
```

Sources:
Tim's comments at https://github.com/vercel/next.js/issues/45529
We don't make optimal choices, We Satisfied. - KAWWARD
Tags: ux
Published: 2024-01-10 20:07:52

When we design web pages, we often assume users will carefully scan through all the available options and meticulously choose the best one. However, the reality is quite different. More often than not, we tend to opt for the first satisfactory option we come across, a phenomenon referred to as satisficing. This behavior has been something I observed for years, but its true significance became vividly clear to me after delving into Gary Klein's book, "Sources of Power: How People Make Decisions."

Klein's extensive research into naturalistic decision-making, where he studied professionals like firefighters, pilots, chessmasters, and nuclear power plant operators, shed light on how high-stakes decisions are made in real settings. These scenarios often involve time pressure, vague goals, limited information, and changing conditions.

In a particular study focusing on field commanders at fire scenes, Klein's team initially approached the research with the widely accepted model of rational decision-making. This model suggests that when faced with a problem, individuals gather information, identify possible solutions, and then choose the best one. However, their assumption, given the high stakes and time pressure, was that fire captains would likely only be able to compare two options, which they thought was a conservative estimate.

Surprisingly, the findings revealed that the fire commanders didn't engage in a comprehensive comparison of options. Instead, they swiftly embraced the first reasonable plan that came to mind and performed a quick mental check for potential issues. If no problems were identified, they proceeded with that plan of action. This approach emphasized the practical tendency to satisfice rather than exhaustively analyze options, particularly in situations demanding rapid decision-making.
OmniPod 5 G6 Intro Kit Buy Online at $749 - CGM Monitors
Tags: webdev, javascript, tutorial, python
Published: 2024-01-10 20:01:47

[Omnipod 5 G6 intro kit](https://cgmmonitors.com/product/omnipod-5-g6-intro-kit/) is an advanced insulin pump to automatically delivers insulin to your body A personalized insulin delivery with Dexcom G6 integration
Rust Programming Quick Start Guide
Published: 2024-01-10 19:36:03

**1. Installing Rust:**
   - Visit [official Rust website](https://www.rust-lang.org/) for installation instructions.
   - Open a terminal and run the installer.

**2. Setting Up Your First Project:**
   - Create a new project: `cargo new my_first_rust_project`.
   - Navigate into the project: `cd my_first_rust_project`.

**3. Cargo Build System:**
   - Use `cargo build` to compile your project.
   - Run your project: `cargo run`.
   - Manage dependencies in `Cargo.toml`.

**4. Writing Your First Program:**
   - Open `src/main.rs` and replace with:

```rust
fn main() {
    println!("Hello, Rust!");
}
```

**5. Variables and Data Types:**
   - Declare variables with explicit types.

```rust
fn main() {
    let my_integer: i32 = 42;
    let my_float: f64 = 3.14;
    let is_true: bool = true;
    let my_char: char = 'A';
    let my_string: &str = "Hello, Rust!";
}
```

**6. Functions:**
   - Define functions using `fn`.
   - Example:

```rust
fn add_numbers(a: i32, b: i32) -> i32 {
    a + b
}

fn main() {
    let result = add_numbers(5, 7);
    println!("The sum is: {}", result);
}
```

**7. Ownership and Borrowing:**
   - Rust's ownership system ensures memory safety.
   - Use borrowing for references without sacrificing performance.

**Conclusion:**
   - Rust offers a modern, safe, and performant programming experience.
   - Explore advanced features and community resources to deepen your Rust expertise. Happy coding!
Freestyle Libre 3 Reader Buy Online | CGM Monitors
Tags: reader, javascript, programming, tutorial
Published: 2024-01-10 19:59:02

Buy [Freestyle Libre 3 Reader](https://cgmmonitors.com/product/freestyle-libre-3-reader/) online on sale at the CGM Monitors website We offer the Libre 3 reader at 110 with free shipping all over the USA Order now!
My cybersecurity journey.
Published: 2024-01-10 19:58:28

I didn’t discover my passion for cybersecurity until I was midway into my academic career. I remember feeling so lost about what aligns with my interests and what truly piques my inherent curiosity. All that I knew was that I love learning, being challenged, researching, and am a geek (haha) through and through.

I chose to pursue a career in tech and researched the kinds of roles that could interest me but I didn’t feel like anything related to IT and software development were a fit for me. Then, I discovered the WiCys (Women in Cybersecurity) organization on my campus. Led by curiosity, I joined and participated in workshops, webinars, CTFs, and it ignited my passion and inquisitiveness to grow the more I learned. 

I then took the initiative to keep up with my learning by using TryHackMe, HackTheBox, YouTube, and currently I’m in the process of doing security related projects using Python as well as learning to use tools like WireShark, nmap, etc. Fun fact: I got accepted to be on the Editorial Board for The Colloquium for Information Systems Security Education™! 

Although I’m passionate about this field, I face imposter syndrome and learning curve challenges; the material does not come easy for me but this does not deter me from working hard to pursue a career in the field as I believe good things take time and discipline in working towards reaching milestones. It’s been a real challenge for me because I’m not technically apt or at the technical skill level I want/need to be, but my goals are to accomplish a solid understanding of the fundamentals, pass my COMPTIA Security+ certification exam, and gain new technical skills. 

What I love about cybersecurity is it rewards my curiosity, there’s always something new/old to learn, and most importantly the infosec community that has been rooting and helping me on this journey and especially making me feel like I belong. 

My dream is to work in the gaming industry in a cybersecurity role, contribute to open source projects, create my own tool, learn how to automate things, and become someone who can help others and contribute to research. I’m passionate about cybersecurity and am on a mission to help and protect others from malicious threat actors. 




#security #cybersecurity #infosec #discuss #aboutme #newbie #learning #womenintech
Smart India Hackathon 2023 Experience
Tags: smartindiahackathon, sih2023, hackathon
Published: 2024-01-10 19:53:44

## Journey to the nodal center

![our train](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dnb4e4tkb4hp1i9gpklk.jpg)

So our nodal center was CV Raman Global University, Bhubaneshwar in Odisha. The train journey almost took 37 hours as train was delayed by 4 hours to cover a whopping distance of 1932 kms.
Tools for creating 3D assets for games
Published: 2024-01-10 19:30:19

Tools used for creating 3D assets for games:

- Blender
- Maya
- MagicaVoxel
- Tinkercad
- Sculptris
- 3ds Max
- ZBrush
- VoxEdit
- Substance Painter

Did I miss any out? Let us know in the comments! Also which of these have you used? I have used MagicaVoxel, VoxEdit, Tinkercad and Blender.
Random class
Published: 2024-01-10 19:25:33



## C# da tasodifiy butun sonni qanday yaratish mumkin ?<br>

> C# tilidagi **Random** classi tasodifiy butun sonlarni yaratadigan aniqlangan usullarni taqdim etadi.
**Random** klassidan tasodifiy butun sonlarni hosil qilishning eng keng tarqalgan usuli bu **Next()**.

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

## Random sinfiga mansub Next() usulining turli xil ko'rinishlari<br><br>
### 1. Next()
> _2,147,483,648_ _<=_ _qiymat_ _<=_ _2,147,483,647_ ushbu orliqdagi 
> istalgan butun sonni qaytaradi.

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

### 2. Next(int max)
> `max` dan kichik istalgan butun sonni qaytaradi.

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

### 3. Next(int min, int max)
> _min_ _<=_ _qiymat_ _<_ _max_ ushbu oraliqdagi tasodifiy butun soni qaytaradi

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

### 4. NextDouble()
> 0,0 dan katta yoki teng va 1,0 dan kichik bo'lgan tasodifiy _floating-point_ nuqtali sonni yaratadi.

<br>
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x6323bnbxnzdbtig3otm.jpg)<br>
### 5. NextByte()
> Belgilangan massivni tasodifiy baytlar bilan to'ldiradi.

<br>
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c6k6ijc6sg3zahtr6iku.jpg)<br>
Demystifying Python Loops: A Beginner's Guide to Crafting a Multiplication Table
Published: 2024-01-10 19:25:03

Today, we're going to explore a simple yet fundamental concept in coding – loops. Loops are incredibly powerful tools that allow us to perform repetitive tasks efficiently. To illustrate this, we'll dive into a practical example: creating a multiplication table for the number 2. This might sound complex at first, but I assure you, by the end of this post, you'll find it as easy as pie!

## Understanding the Basics: What is a Loop?

Imagine you have to perform a task repeatedly, like saying "Hello" ten times. Instead of writing out "Hello" ten times, you can tell Python, "Hey, print 'Hello' ten times," and it will do just that. That’s the magic of loops!
In Python, one of the simplest forms of a loop is the for loop. It repeats a block of code a specified number of times.

## Our Task: The Multiplication Table

We're going to use a for loop to print out the multiplication table of 2. The code looks like this:

```
for i in range(1, 11):
    print("2 x " + str(i) + " = " + str(2*i))
```

## Breaking It Down: Step by Step

### The Loop Starts: for i in range(1,11):

- This tells Python to start a loop, and in each iteration, assign i a value starting from 1 and going up to 10.

### The Action Inside the Loop:

- print("2 x " + str(i) + " = " + str(2*i))
- This line is the heart of our loop. Each time the loop runs, it executes this line.
- It prints out a string that shows the current step in the multiplication table of 2.

### What's Happening Behind the Scenes?

- **First Iteration:** i is 1. The code prints 2 x 1 = 2.
- **Second Iteration:** i becomes 2. Now it prints 2 x 2 = 4.

This continues, increasing i by 1 each time, until i reaches 10.

## Why Use str(i) and str(2*i)?

Python likes to keep text and numbers separate. By using str(), we convert the numbers into text, so Python can smoothly combine them with other pieces of text to create a full sentence.

## The Outcome:

You'll see the multiplication table for 2, neatly printed out:

```
2 x 1 = 2
2 x 2 = 4
2 x 3 = 6
2 x 4 = 8
2 x 5 = 10
2 x 6 = 12
2 x 7 = 14
2 x 8 = 16
2 x 9 = 18
2 x 10 = 20

```

## Conclusion: Embracing the Power of Loops

Loops are an essential part of programming, allowing us to automate and simplify tasks that are repetitive or involve patterns. By mastering loops, you’ve taken a significant step forward in your Python programming journey. The multiplication table is just the start – imagine what else you could automate or calculate with this new tool in your toolkit!

Happy coding, and remember, practice makes perfect!
Kubernetes: criando seu primeiro Pod
Tags: kubernetes, docker, devops
Published: 2024-01-10 19:21:21

---
title: Kubernetes: criando seu primeiro Pod
published: true
description: 
tags: kubernetes, docker, devops
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-12-04 20:42 +0000
---

Segundo a documentação do Kubernetes um Pod é a menor unidade computacional que você pode criar e gerenciar no Kubernetes. É um encapsulamento de um ou mais containers que utilizam recursos de hardware e rede compartilhados entre si, como se essas aplicações estivessem rodando em uma mesma máquina em servidores VPS por exemplo.

Vamos subir um Pod simples com o nginx primeiramente:

```YAML
apiVersion: v1
kind: Pod
metadata:
  name: nginx
  labels:
    app: nginx
spec:
  containers:
  - name: nginx
    image: nginx
    ports:
    - containerPort: 80
```

Para aplicar as alterações vamos salvar esse código em um arquivo pod.yaml e rodar o comando do kubeclt: `kubectl apply -f pod.yaml`

Para verificar se terminou certinho podemos rodar `kubectl get pods` e o resultado deve ser algo parecido com:

```SHELL
NAME    READY   STATUS    RESTARTS   AGE
nginx   1/1     Running   0          20s
```

Agora temos um Pod rodando um container que utiliza a imagem do nginx, ou seja, se entrar dentro dele e fizermos uma requisição pro localhost deve retornar a página default do nginx. Para facilitar a visualização vamos permitir o acesso do pod externamente pela porta 8080 com o comando `kubectl port-forward pod/nginx 8080:80`. Se você estiver utilizando o minikube irá precisar rodar o comando `minikube tunnel`. Com isso podemos ver a página default do nginx acessando localhost:8080
Automate those pesky copyright dates in your csproj files.
Published: 2024-01-10 19:06:05

Just add this bit of xml to somewhere near the top of the csproj file.

```xml
<PropertyGroup>
    <!-- dynamic -->
    <Year>$([System.DateTime]::Now.Year.ToString())</Year>
</PropertyGroup>
```

In the section where the Copyright tag is change that to

```xml
<PropertyGroup>
    <Copyright>Company Name (c) $(Year) All Rights Reserved</Copyright>
```

There you go - no more annoying check ins to update the copyright date, ever.

Easy Peasy

I am not a lawyer. I do not play a lawyer on the Internet or anywhere for that matter. This notice may not be the exact notice you need to be legally covered.
Top 10 VEGAS Pro AI Plugins to Enhance Your Workflow
Tags: vegaspro, ai, plugins, software
Published: 2024-01-10 19:01:01



![Top AI-powered VEGAS Pro plugins](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7jc6w9w7zz8dauvqdmvd.jpg)
You may have something in your mind about editing in the age of AI? so that's why we’ve compiled a list of the first top ten AI VEGAS Pro plugins. Along with the new features in VEGAS Pro 21, AI add-ons add extra functionality providing a more efficient and faster workflow.
Here are the [top ten AI plugins for VEGAS Pro](https://www.shinesfox.com/2024/01/best-ai-plugins-for-vegas-pro.html) that you need to have in your toolkit.

1. SilhouetteFX
2. AI-Enhanced Z-Depth
3. Boris FX Mocha Pro
4. AI Style Transfer
5. Colorization AI Effect
6. Neat Video
7. AI-Driven Upscale
8. Smart Mask
9. Text-to-Speech
10. Speech-to-Text

## Conclusion
Artificial intelligence has become a major part of the rapidly changing AI tool market as these AI-powered tools can transform the video editing process to new heights. In this read, we’ve reviewed the ten best plugins for VEGAS Pro and tried to know how these intelligent tools can revolutionize the workflow experience.

## What is the new AI in VEGAS Pro?
MAGIX introduces new AI-powered tools with advanced machine-learning techniques and algorithms in VEGAS Pro 21. The best AI VEGAS Pro plugins include AI-Enhanced Z-Depth, AI Style Transfer, SilhouetteFX, Colorization AI Effect, AI-Driven Upscale, Smart Mask, Text-to-Speech, and Speech-to-Text.
Implementing CORS with go-chi
Published: 2024-01-10 18:59:39

All web browsers implement a security model known as the Same-Origin Policy (SOP). It restricts domains from accessing and retrieving data from other domains’ resources; this helps protect users from malicious scripts that could access their sensitive data or perform unauthorized actions on their behalf. This led to creation of Cross-Origin Resource Sharing (CORS) is an HTTP-header based mechanism that allows a server to indicate any origins (domain, scheme, or port) other than its own from which a browser should permit loading resources.

```
corsHandler := cors.Handler(cors.Options{
		AllowedOrigins:   []string{"https://site1.com"},
		AllowedMethods:   []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
		AllowedHeaders:   []string{"Accept", "Authorization", "Content-Type", "X-CSRF-Token", "Access-Control-Allow-Origin"},
		ExposedHeaders:   []string{"Link"},
		AllowCredentials: false,
		MaxAge:           300, // Maximum value not ignored by any of the major browsers
	})
```
The AllowedOrigins field in the corsHandler configuration in main.go specifies which origins are allowed to access the server's resources. In this case, only requests from https://site1.com are allowed.

This is a security measure known as Cross-Origin Resource Sharing (CORS). It prevents web pages from making requests to a different domain than the one the web page came from, unless the server specifies that it allows such requests.

If a request comes from an origin not listed in AllowedOrigins, the server will respond with a CORS error and the browser will block the request. This helps protect your server from potentially malicious requests from unknown origins.
Excited to Launch: danieljsaldana.dev Portfolio! 🎉
Tags: webdev, javascript, programming, astro
Published: 2024-01-10 18:58:12

Proudly presenting version 1.0.3 of my web portfolio, a project that's a true labor of love and dedication. Inspired by the latest web development trends and technologies, I've crafted a site that showcases not just my skills but my passion for innovation and interactive design.

**Key Features of My Portfolio:**

- Built with Astro, leveraging cutting-edge JavaScript tools.🌌
- Interactive interface featuring gamification elements. 🎮
- Seamless integration with platforms like GitHub, Twitter, and YouTube using custom scripts. 💻
- Responsive and user-friendly design, perfect for various devices. 📱
- Powered by a robust Next.js backend, ensuring efficient server-side data handling and logic. 🔧

I'm committed to continually enhancing and updating my site, adding new features and refining the user experience. I invite you to visit [danieljsaldana.dev](https://danieljsaldana.dev) and would love to hear any feedback or suggestions you might have.

Hope you enjoy exploring my portfolio as much as I enjoyed creating it! 🌟
Automate the authors of a Nuget package during the build process.
Published: 2024-01-10 18:56:56

It's very simple.

create a get_authors.sh (Mine is in the root but could also be a folder for build scripts. That's probably where I will put it when I create an example to go with this post.

One line of code in get_authors.sh script file - I tried to put the code in the csproj but because of the percent symbol it was easier to put it in a script.

```bash
git log --format='%ae' | grep -v noreply | grep -v outlift | sort -u | tr '\n' ', '
```

then add this fragment to your csproj file somewhere near the top

```xml
    <Target Name="SetAuthors" BeforeTargets="InitializeSourceControlInformation">
        <Exec Command="bash ../get_authors.sh" ConsoleToMSBuild="True" IgnoreExitCode="False">
            <Output PropertyName="Authors" TaskParameter="ConsoleOutput" />
        </Exec>
    </Target>
```

In the section where the Authors tag is change that to

```xml
	<PropertyGroup>
		<Authors>$(Authors)</Authors>
```

Now the Nuget package Authors value is always up to date.

Easy peasy.