teleren/devto huggingface dataset:
Ruby Variable
Tags: webdev, ruby, programming, tutorial
Published: 2023-03-06 17:57:02

## Definition:

- A name on the left side of the assignment operator = is assigned to the object on the right side.
- A variable itself is not a “thing”. It’s just a name for a thing (an object).
- You can pick whatever variable names you want, they’re just names, like post-it notes stuck onto actual objects.

```
number = 1
puts number

a = 1
puts a

large_number = 1
puts large_number

apples = 1
puts apples
```

## Reusing variable names:

- Variable names can be re-used, and re-assigned.
- Using variable names can be useful to break up long lines and make code more expressive and readable.
- There are spaces around the assignment operator `=` as well as the arithmetical operators `+` and `*`.

```
number = 4 #On the first line Ruby creates the number (object) 4.
number = (number * 3) #on the second line, Ruby first looks at the stuff on the right side, and evaluates the expression number * 3. Doing so it will create the number (object) 3 and multiply it with the object that currently has the name number, which is 4. This operation results in a new number (object) 12
puts number + 2 #On the third line Ruby will, again, first look at the expression number + 2 on the right. It creates the object 2 and adds it to the object that currently has the name number. This results in a new number (object) 14.
#Finally Ruby passes this object 14 to puts, which outputs it to the screen.

```

##  Things on the right go first:
 Ruby evaluates the expression on the right first.

```
number = 2 + 3 * 4
puts number

number = 3 * 6  + 2
puts number
```
Unhandled Rejection (FirebaseError): No document to update
Published: 2023-03-06 17:50:25

When i creating my twitter clone with nextjs i got this error and it takes my 10 hours ,but luckily i got solution in my mind 
my code was 


```
const imageRef = ref(storage, `posts/${docRef.id}/image`);
 //setselctedfile is an error
 if(selectedFile){
  await uploadString(imageRef, selectedFile ,"data_url").then(async()=>{
    const downloadURL = await getDownloadURL(imageRef);
  await updateDoc(doc(db, "posts", docRef.id),{
    image:downloadURL
  }
  
  );
  });
 }
```

then i change updateDoc to onSnapshot 

```
const imageRef = ref(storage, `posts/${docRef.id}/image`);
 //setselctedfile is an error
 if(selectedFile){
  await uploadString(imageRef, selectedFile ,"data_url").then(async()=>{
    const downloadURL = await getDownloadURL(imageRef);
  await onSnapshot(doc(db, "posts", docRef.id),{
    image:downloadURL
  }
  
  );
  });
 }
```

that's work for me .
Ruby Introduction
Tags: webdev, ruby, oop, programming
Published: 2023-03-06 17:43:45

## Defination:

Ruby is a high-level interpreted programming language that has been developed with an emphasis on simplicity and readability. It was created in the mid-1990s by Yukihiro “Matz” Matsumoto in Japan.

Ruby is commonly used for web development, data analysis, and script. It is also a popular language for the development of desktop apps and system utilities.

## Key features of Ruby:

**Object-oriented programming:** Ruby is a fully object-oriented language, which means that everything within Ruby is an object, including variables, classes, and functions.

**Dynamic Typing:** Ruby supports dynamic typing, which means that the type of a variable can change dynamically during execution.

**Blocks and Procs:** Ruby has powerful block and proc (procedure) support, allowing for flexible, reusable code that can be passed around as objects.

**Syntax:** Ruby’s syntax is recognized for its simplicity and legibility. It is often said to resemble “executable pseudocode.”

**Gems:** Ruby has a large and dynamic community, and one of her strengths is the vast collection of libraries and tools available via the RubyGems package manager.

**Interoperability:** Ruby can be easily integrated into other programming languages, like C, Java, and Python, making it a great choice for use in a variety of software projects.

**Metaprogramming:** Ruby has powerful metaprogramming abilities, allowing developers to write code that writes code.

## Some of the Popular Companies that used Ruby on Rails:

**Shopify:** Shopify is a Canadian-owned conglomerate and e-commerce organization.

**GitHub:** GitHub offers access control and a variety of collaborative features including feature requests, project management, project wikis, and bug tracking. The company uses Git for ease of versioning and development.

**Netflix:** Netflix is a subscription-based streaming service that allows our members to watch TV shows and movies on an internet-connected device.

**Hulu:** This is a video streaming platform currently available just in the United States. It isn’t as big as HBO GO or Netflix, but it is growing quickly and releasing great new shows every month.

**Airbnb:** Airbnb, as in “Air Bed and Breakfast,” is a service that lets property owners rent out their spaces to travelers looking for a place to stay.
Creating a phone book in Angular js when submit button is clicked previous data must displayed on the form table
Tags: angular, form
Published: 2023-03-06 17:36:57

Hi Team

How can write  a form table when the instructions are as follows;

>  "Once the submit button is pressed, the information should be displayed in a list below (automatically sorted by last name) along with all the previous information that was entered. This way the application can function as a simple phone book. When your application loads, the input fields (not the phone book list) should be prepopulated with the following values already:
> First name = Coder
> Last name = Byte
> Phone = 8885559999"

// code in Angular
`// @ts-ignore
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-area',
  template: `
    <div class="form-wrapper">
      <form>
        <div>
          <label for="firstName">First name</label>
          <input type="text" name="firstName" id="firstName" class="userFirstname">
        </div>
        <div>
          <label for="lastName">Last name</label>
          <input type="text" name="lastName" id="lastName" class="userLastname">
        </div>
        <div>
          <label for="phoneNumber">Phone number</label>
          <input type="tel" name="phoneNumber" id="phoneNumber" class="userPhone">
        </div>
        <div>
          <input type="submit" value="submit" class="submitButton">
        </div>
      </form>
    <div>
    <div class="informationTable">
      Table of contacts should go here...
    </div>`,
  styles: []
})

export class MainAppComponent implements OnInit {
  // code goes here
  ngOnInit() { 
    
  }
}`
Learning C# and .NET
Tags: csharp, beginners, programming, codenewbie
Published: 2023-03-06 17:32:28

Welcome!👋🏽 I'm currently learning C# and .NET. I would like to share with you things I've completed for day 1 of my new learning experience! You can find the resources that I used at the end of this post.⬇️

**What is C#?**
_C# is a programming language that can be used to make mobile apps, augmented reality, virtual reality, desktop apps, backend services, and video games._ 

**What is .NET?**  
_.NET is an open source development platform    (collection of languages and libraries) that can all work together to build all kinds of apps such as, web, mobile, desktop, games, IoT, and more. You can also build websites with ASP.NET._



**Day 1 C# - Objectives**

- Learn the command to print text to the console and print your first line of code. 
- Learn the command that captures user input in the console and capture user input.
- Learn how to make comments within your program and make your first comment.


**Day 1 .NET - Objectives**

- Complete .NET tutorial
- Create first web app using .NET
- Complete ASP.NET tutorial 
- Create a web UI with ASP.NET Core




**Learning Resources**

**Learn C#** 
https://www.codecademy.com/learn/learn-c-sharp

**Introduction to .NET**
https://dotnet.microsoft.com/en-us/learn/dotnet/what-is-dotnet

Tutorial to .NET
https://dotnet.microsoft.com/en-us/learn/dotnet/hello-world-tutorial/intro?&WT.mc_id=Educationaldotnet-c9-scottha

**Introduction to ASP.NET**
https://dotnet.microsoft.com/en-us/learn/dotnet/hello-world-tutorial/intro?&WT.mc_id=Educationaldotnet-c9-scottha

Tutorial to ASP.NET 
https://dotnet.microsoft.com/en-us/learn/aspnet/hello-world-tutorial/next

**Create your first web UI with ASP.NET Core** https://learn.microsoft.com/en-us/training/modules/create-razor-pages-aspnet-core/?WT.mc_id=dotnet-35129-website

**.NET for Beginners**
https://youtube.com/playlist?list=PLdo4fOcmZ0oWoazjhXQzBKMrFuArxpW80

Here is a in-browser tutorial of .NET
https://dotnet.microsoft.com/en-us/learn/dotnet/in-browser-tutorial/1
#Rust 🦀 – Using #OpenAI ChatGPT APIs from Rust. Demo Chat console App
Tags: englishpost, chatgpt, openai
Published: 2023-03-07 15:17:05

---
title: #Rust 🦀 – Using #OpenAI ChatGPT APIs from Rust. Demo Chat console App
published: true
date: 2023-03-06 17:26:14 UTC
tags: EnglishPost,ChatGPT,EnglishPost,OpenAI
canonical_url: 
---

![](https://brunocapuano.files.wordpress.com/2023/02/a669d364-8028-4471-a1d4-f1d7b43e182c.png?w=1024)

Hi!

Let’s look at my [**sample repository on how to use OpenAI APIs in Rust**](https://github.com/elbruno/RustOpenAIAPIs). I added a new scenario: a sample console chat app that uses the new ChatGPT APIs model.

The process is remarkably similar to the text completion scenario, including a major change in the model used. Instead of davinci-003, we use the new gpt-3.5-turbo model.

This is a sample response this model in a sample chat app Sample:

![](https://brunocapuano.files.wordpress.com/2023/03/chatgpt-rustchat.gif?w=676)

This sample does not implement a multi-turn conversations model. Right now, the sample is a single-turn Q&A without any conversations. I’ll implement a multi-turn conversations model in the future.

Happy coding!

Greetings

El Bruno

More posts in my blog [ElBruno.com](https://www.elbruno.com).

More info in [https://beacons.ai/elbruno](https://beacons.ai/elbruno)

* * *
Getting started experience with thirdweb framework
Published: 2023-03-06 17:10:00

Hello Guys,I hope your learnings are going well. I am Manichand 3rd year btech student at KL University. I am going say about my getting started experience with thirdweb framework. 

**Learnings from Errors**:
I have been learning web3 by doing  projects using thirdweb framework. 
I am sharing my experiences from some of my mistakes and errors that i got. 

**Error**: 
We you try to call solidity contract from your frontend react project you get an error in browser console saying that 
1) sometype of contract address metadata is not is resolved.
2) contract cannot call due to null values caught. 
If you came across similar senario Or getting similar error that means that you either didn't specified network that you are using in index. js file. The network is default set to etherium. In my case i am using Goerli Or didn’t connected to metamask. 
**Suggestion**:
Don't use thirdweb framework template for creating reactjs as frontend. Because there is some problem with using materialUI, bootstrap etc with thirdweb react template. 
I am not saying there is a bug in it but I faced alot of problem while using it.

**Pros of using thirdweb**:

1) easy to deploy our contracts.

2) easy to develop web3 apps using our deployed contracts. 

3) Documentation was super cool and rapidly getting updated. 

- I want to know anything I am wrong about or any thing should be added. 

**Note** : 
Its just my personal experience and personal view not recommanded. 

Connect with me :
twitter:
https://twitter.com/Manichand01
linkedin:
https://www.linkedin.com/in/kondapaka-manichand-14b825154
github:
https://github.com/mani-chand
(SHOWCASE) Amazon Clone in SvelteKit, Svelte, TailwindCSS.
Tags: svelte, tailwindcss, javascript, webdev
Published: 2023-03-06 17:05:57

{% youtube NHDOjV2HD_Y %}

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



LIVE DEMO URL CLICK HERE

##URL for the build: https://amazon-svelte.vercel.app/
##Source Code:  https://rebrand.ly/amazon_svelte


#Requirements 

Node 16 or above Features 

1. The Project uses SvelteKit, Svelte, TailwindCSS, ShopAPI, etc to fetch the data 

2. Highly Editable without changing the code

 

Just open the file src/assets/details.js 

Edit it according to your needs like the API URL, images URL, logo of the site, etc


##Product Insiders

 1. The Project displays the products.

 2. The product can be added to the cart.

 3. Can't See cart without signing in.

 4. Displays Total Price.

##Directory Structures


├── jsconfig.json
├── package.json
├── package-lock.json
├── postcss.config.cjs
├── README.md
├── sda.js
├── src
│   ├── app.css
│   ├── app.html
│   ├── assets
│   │   ├── cartHelper.js
│   │   ├── details.js
│   │   ├── firebaseImport.js
│   │   ├── req.js
│   │   └── router.js
│   ├── firebase
│   │   ├── auth.js
│   │   └── config.js
│   ├── global.d.ts
│   ├── hooks.js
│   ├── lib
│   │   ├── Body
│   │   │   ├── CarousalItem.svelte
│   │   │   ├── CheckoutProduct.svelte
│   │   │   ├── Currency.svelte
│   │   │   ├── ProductFeed.svelte
│   │   │   ├── Product.svelte
│   │   │   └── Stars.svelte
│   │   └── Header
│   │       ├── bottomnav.svelte
│   │       ├── index.svelte
│   │       └── login.svelte
│   ├── routes
│   │   ├── checkout.svelte
│   │   ├── index.svelte
│   │   └── __layout.svelte
│   └── store
│       ├── basket.store.js
│       └── user.store.js
├── static
│   ├── favicon.svg
│   └── robots.txt
├── svelte.config.js
└── tailwind.config.cjs



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3swptayd5yk03egcdait.jpg)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8uvv3kq8l2q7byb7uiyy.jpg)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ky09gaye8iftgnoea9r6.jpg)
CodePen Designs - 43 : Lottie Animations in React
Tags: css, codepen, webdev, design
Published: 2023-03-06 17:05:03

### We are excited to introduce our new series that will explore the best design ideas from the Codepen community. 

We will be publishing these each day and hope you find them insightful and inspiring as we showcase some of the most talented designers in this space.

---

---

## Video Tutorial

Don't miss the amazing video we've embedded in this post! Click the play button to be inspired

{% youtube  PnqDy99p3EA %}

---
### Codepen Design - 43
---

{% codepen https://codepen.io/dilums/pen/XWdqvGd %}


---
## For more information

1. Check my GitHub profile
[https://github.com/amitSharma7741](https://github.com/amitSharma7741)

2. Check out my Fiver profile if you need any freelancing work
[https://www.fiverr.com/amit_sharma77](https://www.fiverr.com/amit_sharma77)

3. Check out my Instagram
[https://www.instagram.com/fromgoodthings/](https://www.instagram.com/fromgoodthings/)

4. Linktree
[https://linktr.ee/jonSnow77](https://linktr.ee/jonSnow77)

5. Check my project

- EVSTART: Electric Vehicle is the Future
[https://evstart.netlify.app/](https://evstart.netlify.app/)
-  News Website in react
 [https://newsmon.netlify.app/](https://newsmon.netlify.app/)
-  Hindi jokes API
 [https://hindi-jokes-api.onrender.com/](https://hindi-jokes-api.onrender.com/)
- Sudoku Game And API
[https://sudoku-game-and-api.netlify.app/](https://sudoku-game-and-api.netlify.app/)

---
---

---

## Video Tutorial

Don't miss the amazing video we've embedded in this post! Click the play button to be inspired

{% youtube  PnqDy99p3EA %}

---
A importância do Analista de Qualidade (QA) no time ágil
Tags: qa, qualityassurance, agile, testing
Published: 2023-03-06 16:32:03

Quando o modelo cascata de desenvolvimento de software ainda era o mais utilizado nas empresas, hoje o papel que conhecemos de analista de qualidade geralmente era de uma pessoa responsável por realizar os testes manuais da aplicação, muitas vezes o próprio desenvolvedor ou analista de suporte que executava os testes ao final da etapa de codificação, após os requisitos do cliente serem desenvolvidos.

Hoje no time ágil as entregas do produto são feitas de maneira constante e incremental onde as etapas são independentes e o software está em contanto evolução, e isso acarretou na necessidade de um foco ainda maior na qualidade do software, o que nos trouxe a figura do analista de qualidade que desempenha um papel de grande importância no time. Mais do que testes manuais, a qualidade é algo que deve estar presente muito antes da codificação, desde a análise dos requisitos do cliente até a integração e entrega contínua do software.

Com isso, o QA participa de todo o ciclo de desenvolvimento desde o início do processo e precisa estar próximo do time atuando de maneira colaborativa com o PO, Scrum Master e os desenvolvedores, disseminando as boas práticas de qualidade para agregarmos valor na entrega ao cliente. 

Mais do que testes, esse profissional pode e deve auxiliar em etapas como a revisão e análise dos requisitos do projeto e o refinamento das demandas, utilizando seu conhecimento e olhar crítico para garantir que as informações estejam claras, objetivas e que as expectativas do cliente estejam sendo atendidas. Nessa etapa ele também já consegue ter as informações necessárias para iniciar o planejamento dos testes que serão executados, quais os recursos serão necessários e quais testes deverão ser automatizados, eliminando as repetições manuais de processos críticos e garantindo uma maior cobertura dos testes. Também é possível que o QA apoie no mapeamento dos processos do sistema, na análise de defeitos e identificação de causas raiz. 

São muitas as possibilidades e há vários outros pontos em que o QA pode auxiliar o time, tendo sendo como premissa ser um guardião e evangelizador de práticas de qualidade de forma que as entregas possam contribuir positivamente para os nossos clientes. Dessa forma conseguimos agregar ainda mais valor, otimizando o tempo, reduzindo os custos e aumentando a eficiência dos nossos processos.
Fatal error: require(): Failed opening required 'public_html/PHPMailer/vendor.autoload.php'
Tags: php, phpmail, email, programming
Published: 2023-03-06 16:32:01

Hi Team

I need some help, i am receiving email but my main object is to get an attachment when a user apply for a loan as pdf. Currently i am unable to achieve this it has been close to a week now with no luck at all including wide research.

// logic
`use PHPMailer\PHPMailer;

require 'public_html/PHPMailer/vendor.autoload.php'; // complaining here about this path(it is like this on the path server though

$msg = '';
if (array_key_exists('bankstatement', $_FILES)) {
    //Create a message
    $mail = new PHPMailer();
    $mail->setFrom('info@acifinance', 'ACI Finance');
    $mail->addAddress('gcobani.mkontwana@agilelimitless.org.za', 'ACI Finance');
    $mail->Subject = 'ACI Finance Application Loan';
    $mail->Body = 'My message body';
    //Attach multiple files one by one
    for ($ct = 0, $ctMax = count($_FILES['bankstatement']['tmp_name']); $ct < $ctMax; $ct++) {
        //Extract an extension from the provided filename
        $ext = PHPMailer::mb_pathinfo($_FILES['bankstatement']['name'][$ct], PATHINFO_EXTENSION);
        //Define a safe location to move the uploaded file to, preserving the extension
        $uploadfile = tempnam(sys_get_temp_dir(), hash('sha256', $_FILES['bankstatement']['name'][$ct])) . '.' . $ext;
        $filename = $_FILES['bankstatement']['name'][$ct];
        if (move_uploaded_file($_FILES['bankstatement']['tmp_name'][$ct], $uploadfile)) {
            if (!$mail->addAttachment($uploadfile, $filename)) {
                $msg .= 'Failed to attach file ' . $filename;
            }
        } else {
            $msg .= 'Failed to move file to ' . $uploadfile;
        }
    }
    if (!$mail->send()) {
        $msg .= 'Mailer Error: ' . $mail->ErrorInfo;
    } else {
        $msg .= 'Message sent!';
    }
}
?>`
What’s New in .NET 8 Preview 1
Published: 2023-03-06 16:15:45

**'dotnet publish' and 'dotnet pack'**

Now produce _release_ assets by default

The following output shows the different behavior between dotnet build and dotnet publish, and how you can revert to publishing Debug assets by setting the PublishRelease property to false.
`
/app# dotnet new console
/app# dotnet build
  app -> /app/bin/Debug/net8.0/app.dll
/app# dotnet publish
  app -> /app/bin/Release/net8.0/app.dll
  app -> /app/bin/Release/net8.0/publish/
/app# dotnet publish -p:PublishRelease=false
  app -> /app/bin/Debug/net8.0/app.dll
  app -> /app/bin/Debug/net8.0/publish/`


For more information, see '[dotnet pack](https://learn.microsoft.com/en-gb/dotnet/core/compatibility/sdk/8.0/dotnet-pack-config)' uses Release config and '[dotnet publish](https://learn.microsoft.com/en-gb/dotnet/core/compatibility/sdk/8.0/dotnet-publish-config)' uses Release config.
Understanding Amazon Web Services
Tags: aws, books, cloud
Published: 2023-03-06 16:14:48

{% youtube b-wsOF8gGik %}
"[Amazon Web Services for Dummies](https://rebrand.ly/devshelf-003)" by Bernard Golden is an excellent resource for those looking to get started with the Amazon Web Services (AWS) platform. The book breaks down complex concepts and makes them accessible to readers of all levels. The book is well-organized, easy to follow, and provides a comprehensive overview of the AWS platform and its various services.

**What Does This Book Cover?**

This book covers a wide range of topics, including cloud computing, infrastructure as a service (IaaS), platform as a service (PaaS), and software as a service (SaaS). He also provides a thorough explanation of the different AWS services, such as EC2, S3, and RDS, and how they can be used to build scalable, secure, and reliable applications.

> Chapter 1: Amazon Web Services Philosophy and Design.
> Chapter 2: Introducing the AWS API.
> Chapter 3: Introducing the AWS Management Console.
> Chapter 4: Setting Up AWS Storage.
> Chapter 5: Stretching Out with Elastic Compute Cloud.
> Chapter 6: AWS Networking.
> Chapter 7: AWS Security.
> Chapter 8: Additional Core AWS Services.
> Chapter 9: AWS Platform Services.
> Chapter 10: AWS Management Services.
> Chapter 11: Managing AWS Costs.
> Chapter 12: Bringing It All Together: An AWS Application.
> Chapter 13: Ten Reasons to Use Amazon Web Services.
> Chapter 14: Ten Design Principles for Cloud Applications.

The book also provides a wealth of information on how to use AWS in a cost-effective manner, including tips on how to reduce costs and optimize performance. Additionally, it includes a variety of real-world examples that illustrate the concepts discussed in the book.

Overall, "[Amazon Web Services for Dummies](https://rebrand.ly/devshelf-003)" is an excellent resource for anyone looking to get started with AWS. Whether you are a beginner or have some experience with the platform, this book will provide you with the knowledge and skills you need to become proficient in using AWS. I highly recommend this book to anyone interested in cloud computing or AWS.

📚[Get the Book in Amazon](https://rebrand.ly/devshelf-003)

---

[![DevShelf](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v04cas2nc9gcvaznw3va.jpg)](https://devshelf.co/)