teleren/devto huggingface dataset:
scope variable
Published: 2023-02-09 10:23:02

```rb
module M 
    class C
        class D
            module N
                X = 1
            end
        end
    end
end

puts M::C::D::N::X
```
```rb
module M 
    class C
        X = 222
        class D
            module N
                X = 1
            end
        end
    end
end

puts M::C::D::N::X
puts M::C::X
```

it works correct
```rb 
module M 
    class C
        class D
            module N
                X = 1
            end
        end
        puts D::N::X
    end
end
```
this is wrong and doesn't work! 
```rb
module M 
    class C
        class D
            module N
                X = 1
            end
        end
    end
end

puts D::N::X # it is wrong 
```
Understanding React - A Beginner's Guide
Published: 2023-02-09 10:15:56

Outline:
1. Introduction
2. Understanding React Components
3. Managing State with React
4. Reusable Components
5. Conclusion

**Introduction:**
Building user interfaces can be a challenging task, especially when you have to keep track of changes to the data and manage the overall appearance of your application. That's where React comes in - it's a JavaScript library that makes it easier to build user interfaces. With React, you can create reusable components and manage the state of your application efficiently.


**Understanding React Components:**
Think of React components like building blocks. When you build with blocks, you start with a few simple blocks and combine them to create something more complex. That's exactly how React components work. You create simple components and then combine them to build a complete user interface. For example, let's say you want to create a button component. The code for a basic button component in React might look like this:

```
import React from 'react'; 

function Button(props) { 
 return <button>{props.text}</button>; 
} 

export default Button; 
```

**Managing State with React:**
State is like the "brain" of your React component - it keeps track of the data and decides how the component should behave. Managing state can be tricky, but React makes it easier by allowing you to manage the state of your application in a centralized and organized way. For example, let's say you have a component that displays a list of items. The state of this component might look like this:


```
const [items, setItems] = useState([
  { id: 1, text: 'item 1' },
  { id: 2, text: 'item 2' },
  { id: 3, text: 'item 3' },
]); 
```

**Reusable Components:**
Reusable components are components that you can use multiple times throughout your application. This makes it easier to keep your code organized and maintain consistency in the design of your application. For example, let's say you want to create a card component that you can reuse throughout your application. The code for a reusable card component might look like this:

```
import React from 'react'; 

function Card(props) { 
 return ( 
  <div> 
   <h2>{props.title}</h2> 
   <p>{props.text}</p> 
  </div> 
 ); 
} 

export default Card;

```



**Conclusion:**
In conclusion, React is a powerful JavaScript library that makes it easier to build user interfaces. With React, you can create reusable components, manage the state of your application efficiently, and build user interfaces that are both functional and visually appealing. Whether you're just starting out or you're an experienced developer, React is a great tool to have in your toolbox. So go ahead, dive deeper into React, and see what amazing things you can build!
ZonedDateTime and toLocalDate / toLocalTime
Tags: java, time
Published: 2023-02-09 10:14:47

I need to deal with New York, London and Tokyo time zone in the same application. Some time it is quite difficult to manage.

This is how I convert `ZonedDateTime` to `LocalDate`. In `functionOne`, you can't guarantee the timezone of parameter `dateTime` is the one you expect. Before you convert to `LocalDate`, you always need to change the timezone first.

```java
void functionOne(ZonedDateTime dateTime) {
    var date = dateTime.withZoneSameInstance(londonZoneId).toLocalDate();
    // use the date
}
```

If they provide a function `ZonedDateTime.toLocalDate(ZoneId zoneId)`, it would be less error prone I think. It can force people to provide a `ZoneId` when they get the `LocalDate`.

This is another solution I can think of. We create a date time type for each timezone.

```java
class LondonDateTime {
  private final ZonedDateTime dateTime;

  public LondonDateTime(ZonedDateTime dateTime) {
    this.dateTime = dateTime.withZoneSameInstance(londonZoneId);
  }

  public ZonedDateTime getDateTime() { return dateTime; }

  public LocalDate getLocalDate() { return dateTime.getLocalDate(); }
}

void functionTwo(LondonDateTime dateTime) {
  var date1 = dateTime.getDateTime().toLocalDate();
  // or 
  var date2 = dateTime.toLocalDate();
}
```
Boost User Satisfaction with a Dynamic Progress Bar for Your JavaScript Fetch Calls
Tags: webdev, javascript, fetch, ux
Published: 2023-02-09 10:14:25

Creating a dynamic progress bar for your JavaScript fetch calls can greatly improve the user experience and boost satisfaction. Here are a few steps to get you started:

1. Create an HTML structure: First, create an HTML structure for your progress bar. You can use a `div` element with a width of 0% and a background color. This `div` will represent the progress bar.

2. Use JavaScript fetch method: Next, use the JavaScript `fetch` method to make the network request. The fetch method returns a `Promise` that resolves to the Response object representing the response to your request.

3. Track the progress of the fetch call: You can use the `Response.body` property to access a `ReadableStream object`, which represents the body of the response. You can then use the `ReadableStream.getReader()` method to get a reader and track the progress of the fetch call by reading chunks of data.

4. Update the progress bar: As you receive chunks of data, you can use JavaScript to update the width of the progress bar. For example, you can divide the total number of bytes received by the total number of bytes to be received, and multiply the result by 100 to get the percentage. You can then use this percentage to update the width of the progress bar.

5. Show the completion of the fetch call: Finally, you can use JavaScript to show the completion of the fetch call. For example, you can change the background color of the progress bar to green when the fetch call is complete, or display a message to indicate that the data has been loaded.

By following these steps, you can create a dynamic progress bar for your JavaScript fetch calls that provides a better user experience and improves satisfaction.


{% codepen https://codepen.io/dhruvangg/pen/NWBVQLM %}
How to use MFA with AWS CLI using Yubikey
Tags: aws, security, iam, yubikey
Published: 2023-02-09 10:06:27

How to use MFA with AWS CLI using Yubikey

While resetting my IAM keys, I realized I had all those powerful keys lying in plaintext in the credentials file.

Even though it requires access to my laptop, I wanted to have some extra security. As a big fan of MFA, I decided to enforce MFA with Yubikey while using CLI.

Here's the full article and step-by-step guide:

https://cloudinternals.net/aws/how-to-use-mfa-with-aws-cli-using-yubikey/

You will need to have a Yubikey to be able to follow the article, though. 

I hope it helps others as well.
How to rotate AWS Access Keys with PowerShell
Tags: aws, powershell, iam, security
Published: 2023-02-09 10:05:22

I'm still recovering from the LastPass breach. Because my IAM keys were in LP, I had to go through all of them and replace them. 

As I had multiple keys to be replaced, I created a Powershell script to replace all the keys in my AWS credentials file.

The article explaining the script is here:

https://cloudinternals.net/aws/how-to-rotate-aws-access-keys-with-powershell/

I hope it comes in handy to other people too.
ChatGPT cheat sheet
Tags: chatgpt, openai, cheatsheet, tips
Published: 2023-02-09 10:03:08

Here is a list of how to use ChatGPT to help Coding:


- Use ChatGPT to explain why a line of code isn't working
- Use ChatGPT to explain what a piece of code means
- Use ChatGPT to change the CSS of a line of code
- Use ChatGPT to change the HTML of a line of code
- Use ChatGPT to code an entire software program
- Use ChatGPT to generate regular expressions (regex)
- Use ChatGPT to add comments to your codebase


[See more prompts](https://quickref.me/chatgpt)

![ChatGPT cheat sheet](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/919ddwsxr08kh0p2g81p.png)
SO - TP 1
Tags: ubuntu, virtualbox, server, devops
Published: 2023-02-09 10:01:29

##  For task purposes in Operating System Subject


1. Download and install [VirtualBox](https://www.virtualbox.org/)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7sis8ejr10pv0uapzo4p.png)
&nbsp;

2. Download and install  [Ubuntu Server](https://ubuntu.com/download/server)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2gxzh10sks3sr9tnno5b.png)
&nbsp;


3. Create new machine in VirtualBox
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rffod2bc074uw7he9656.png)
&nbsp;

4. Isi nama dan lokasi iso Ubuntu server dan check skip unattended installation
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5uua33q0mhcfr7zkre3l.png)
&nbsp;

5. Sesuai besaran memory dan processor yang dibutuhkan
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ojs2pv7iqi5q3r7wsbwj.png)
&nbsp;

6. Sesuaikan besaran virtual hard disk
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vxjyget028c6suisw1v6.png)
&nbsp;

7. Summary instalasi dan finish
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9y92cf20o14ux1rrmm7n.png)
&nbsp;

8. Tampilan setelah finish
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uik9bzf81fktq9iihtpf.png)
&nbsp;
Mastering the Language of Machines: An Introduction to Natural Language Processing
Tags: machinelearning, computerscience
Published: 2023-02-09 10:00:00

Natural Language Processing (NLP) is the branch of Artificial Intelligence and Machine Learning that deals with the interaction between computers and human languages. It involves the use of techniques and algorithms to understand, interpret and generate human language. In this article, we'll explore the basics of NLP, how it works, and its potential applications in the future.

---

## **What is Natural Language Processing?**

Natural Language Processing (NLP) is the ability of a computer program to understand, interpret, and generate human language. It involves the use of techniques and algorithms to analyze and understand text, speech, and other forms of human language. NLP can be used for a variety of tasks, such as sentiment analysis, language translation, text summarization, and more.

## **How does NLP work?**

NLP is composed of several sub-tasks, such as tokenization, part-of-speech tagging, named entity recognition, and more. These sub-tasks are performed using various techniques and algorithms, such as rule-based methods, statistical methods, and machine learning.

## **Applications of NLP**

NLP has a wide range of applications in various industries, including:

- **Chatbots and virtual assistants**: NLP is used to understand and respond to user's queries in a natural way.
- **Language translation**: NLP is used to translate text from one language to another with high accuracy.
- **Sentiment analysis**: NLP is used to determine the emotional tone of text, such as whether it is positive, negative, or neutral.
- **Text summarization**: NLP is used to summarize long pieces of text into shorter, more concise versions.
- **Voice recognition**: NLP is used to transcribe speech into text and understand the meaning of spoken words.

## **Conclusion**

Natural Language Processing (NLP) is an exciting and rapidly evolving field that has the potential to revolutionize the way we interact with computers. From chatbots and virtual assistants to language translation and text summarization, NLP has a wide range of applications that can improve our lives in many ways. As technology continues to evolve, we can expect to see even more impressive applications of NLP in the future. It's an exciting time to be a part of the world of AI and ML, and we can't wait to see what the future holds for NLP.
苹果企业签名、ios企业签名、安卓报毒处理、买卖企业证书、添加QQ：1553207692 、飞机@ios616
Tags: linodehackathon
Published: 2023-02-09 09:42:09


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ii3u49sqcy4kzzqbozax.JPG)
## What I built


### Category Submission:


### App Link


### Screenshots


### Description
 

### Link to Source Code


### Permissive License


## Background
(What made you decide to build this particular app? What inspired you?)


### How I built it
(How did you utilize Linode? Did you learn something new along the way? Pick up a new skill?)


### Additional Resources/Info
Ürün Tanıtım Filmi Çekimi Nasıl Yapılır?
Tags: tantm, videosu, filmi
Published: 2023-02-09 09:39:21


![Tanıtım Videosu](https://www.yavuzdoganalp.com/wp-content/uploads/2023/02/hd-tanitim-filmi.png)
**[Tanıtım videosu](https://www.hdtanitimfilmi.com/)**, ürününüzü tanıtmanın etkili ve güçlü bir yoludur. Ürününüzü potansiyel müşterilere etkili bir şekilde pazarlamak için kullanılabilecek, genellikle iki dakikadan uzun olmayan kısa bir videodur. Potansiyel müşteriler üzerinde büyük bir etki yaratabileceği ve ürününüzün faydalarını anlamalarına yardımcı olabileceği için her ölçekteki işletme için paha biçilmez bir araçtır. 

**Fragman, Bir Ürünü Tanıtan ve Reklamını Yapan Kısa Bir Filmdir**

Fragmanlar, bir ürünü veya hizmeti geniş bir kitleye tanıtmanın ve tanıtmanın etkili bir yoludur. Yeni bir ürünü tanıtmaktan, bir hizmeti veya teklifi sergilemeye veya bir ürünün faydalarını göstermeye kadar her şey için kullanılabilirler. Fabrika tanıtım filmi, geleneksel pazarlama yöntemlerinden daha geniş bir kitleye ulaşabildikleri için sosyal medya pazarlama kampanyalarıyla birlikte kullanıldıklarında özellikle etkilidir.

**Tanıtım Videoları Sosyal Medya Aracılığıyla Geniş Bir Kitleye Ulaşmanın Etkili Bir Yoludur**

Ürün tanıtım filmi ayrıca bir ürünü tanıtmanın ekonomik bir yoludur. Profesyonel olarak üretilen bir fragman, reklam panoları veya basılı reklamlar gibi geleneksel pazarlama yöntemlerinden daha pahalıya mal olabilir, ancak daha fazla kişiye ulaşma ve ürüne daha fazla ilgi uyandırma potansiyeline sahiptir. Üretim ve dağıtım maliyeti, yapmayı seçtiğiniz filmin türüne ve dağıtmak için kullandığınız satış noktalarına bağlı olacaktır.
Starchart: Designing And Theming
Tags: opensource
Published: 2023-02-04 04:17:03

### Overview
This week I put my main effort in terms working on StartChart in two things: 
- UI Design (and collaborating on design with Mario)
- Initialising Theme for the Chakra UI

I also did some code review, but they were side quests. 

### Designing 
This week I kept working on UI design with Mario. We presented our design concept of Domain management screens and had very productive conversation with out team members. They provided us many clarifications on how system is gonna work and we adjusted the design accordingly. For now design of domains management screens look very decent. 


### Chakra UI init
The one [PR](https://github.com/Seneca-CDOT/starchart/pull/100) I created this week was initialisation of Chakra UI theme. For now it only includes shades of our "brand" color, which is well-known Seneca's red color. This color is now applied as a default one for all UI components such as Button, Checkbox etc. After several iterations of code reviews and updates from my side the PR was merged. 

### Some thoughts 
Hope the next week I will flex with some actual view elements be merged :) Have great weekends everyone
How to test the existence of a file in Javascript
Tags: javascript, beginners, node, tutorial
Published: 2023-02-09 09:16:01

# How to test the existence of a file in Javascript

## Table of contents

1. Create a file
2. The file testing function
3. Execute code
4. Tips

-------------------

## 1 - Create a file

First, we need to create another file that contains our test function.
You can create this file using the IDE of your choice or by typing the following command in the terminal :

```js
touch testFile.js
```

-------------------

## 2 - The file testing function

In the previous file, add this function that takes an array as an argument. For each file name in the array, we will test its existence.

```js
function isNotFile(args) {
    for (let i = 0; i < args.length; i++) {
        if (fs.existsSync(args[i]) == true) {
            console.log(args[i] + "this file exist")
        } else {
            console.log(args[i] + "this file doesn't exist")
        }
    }
    return true
}
```

Now, we need to call the function with the correct parameter (**don't forget the array**):

```js
isNotFile(['test.txt'])
```

-------------------

## 3 - Execute code

Now, all you need to do is create the 'test.txt' file. To do this, run the following command in the terminal:

```js
touch test.js
```

And now, simply execute our function in the terminal:

```js
node testFile.js
```

If you have successfully created the 'test.txt' file, you should receive a message indicating that the file exists in the terminal.

-------------------

## 4 - Tips

The best way to utilize this code is to check out my topic, ["Javascript in the Terminal"](https://dev.to/semihgkl/javascript-in-the-terminal-514k). There, you will learn and see how to retrieve the arguments passed in the terminal command, such as:

```js
node testFile.js test.js test2.js
```

Practice makes progress ! :muscle:
  
[~SemihGKl](https://dev.to/semihgkl)
BACKEND TECHNOLOGIES IN THE INDUSTRY
Tags: backend, webdev, javascript, programming
Published: 2023-02-09 09:14:20


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gz66qis88ng04fksuloq.jpg)
Backend Technologies😛Yuk belajar bareng serta diskusi dikolom komentar, serta di save biar ga lupa💬😝

🌱Follow : @appardana
💭Stay Young, Be Innovative and Keep Learning

#Java #PHP #Javascript #Phyton #Web #Skills #IT #Backend #Developer #Roadmap #SelfImprovement #Growth #Aditria #Pardana #AditriaPardana #appardana #iAppTech ⚛️💻


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b6mku6kw0pmwlpofa44j.jpg)
Web Vulnerabilities: OTP or Reset Link :
Tags: otp, auth
Published: 2023-02-09 09:00:46

One of the principal actions over the internet is authentication. Authentication, not to be mistaken for authorization, is the process an application goes through to confirm that a supposed user is actually who they claim they are.

Basic authentication (pun?) involves the user providing a combination of username and password. Sometimes email address is used in place of username. These username/email and password combination are provided during signup.


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

If a user ever forgot their username or password, a way to get them back into their account is to confirm if the user have access to the associated email address.

To do this some platforms send a reset link to the email, expecting the user to click and thereby get confirmed to be the legitimate account owner and thereby allowed to reset the password.

Another way is that OTP is sent to the email address and the user is expected to enter it correctly into a form on the platform.

I have built solutions that employ both methods and from my experience with web security and vulnerabilities I will say OTP is the better option. Why?

With reset links some email clients will not make it clickable by default, leaving your users stranded but for a few that understand that they can copy it.


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

Unless there's a kind of that has to be performed on the page the link directs to, then we cannot be so sure of who clicked, and why it was clicked - it might be a wrong email and the receiver mistakenly pressed the link from mailbox.

Receivers of link are susceptible to being phished, and some conscious users would be reluctant to click.

OTPs are discrete, they cannot be broken like links, and the platform can be so sure that the verification was accurate to the tune of 98%>

Which one do you prefer?
Greyscale image with filter in CSS3
Tags: webdev, css, tutorial, productivity
Published: 2023-02-09 08:32:20

What is a greyscale image with filter in css3? How do you make a greyscale image with filter in css3?

**Greyscale image with filter in CSS3 -  HTML Code:**
```html
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Greyscale image with filter in CSS3</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="image"> <img src="http://dummyimage.com/600x400/F00000/ffffff.png" alt="" title="" />
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
</body>
</html>
```

---

**Greyscale image with filter in CSS3 - CSS Code:**
```css
img { -webkit-filter: grayscale(0%); -moz-filter: grayscale(0%); -ms-filter: grayscale(0%); -o-filter: grayscale(0%); filter: grayscale(0%); filter: gray; /* IE 6-9 */ -webkit-transition: all .6s ease;
}
img:hover { -webkit-filter: grayscale(100%); -moz-filter: grayscale(100%); -ms-filter: grayscale(100%); -o-filter: grayscale(100%); filter: grayscale(100%); filter: gray; /* IE 6-9 */
}
```

---

👉 Source & Preview: [https://scriptcodes.co/greyscale-image-with-filter-in-css3-acbqc](https://scriptcodes.co/greyscale-image-with-filter-in-css3-acbqc)
What are dynamic NFTs ?
Tags: nft, blockchain, ethereum, webdev
Published: 2023-02-09 08:24:25

You must have heard the term NFT, its Non-Fungible token, whats the difference between fungible and non fungible ?

**Fungibility :**
Fungibility is the ability of a good or asset to be interchanged with other individual goods or assets of the same type. Fungible assets simplify the exchange and trade processes, as fungibility implies equal value between the assets.

Now to simply explain it we can interchange the fungible tokens with each other and their value will remain the same. It’s like interchanging 1$ for 1$. Both have the same value in the market.

How come bitcoin is fungible if its price is changing?

cause, here you are comparing two fungible tokens of different types with each other, the dollar and bitcoin. This change in value totally depends upon supply and demand. If demand for bitcoin is less and supply is more, its value will decrease and its value increases if demand is more and supply is less.

**Non-Fungible**
Non-fungible tokens will always have their own value and can not be interchanged with other non-fungible tokens. The tokens will hold completely different purposes and have unique characteristics.

Examples of non-fungible assets can be paintings, antique pieces, land properties, etc. You don't interchange one painting with another or one land property with another. You buy these types of assets with money, a fungible token.

The current NFTs are static NFTs, let's say you own one NFT of a bored ape collection. Its just a static image that sits like that for years. But what if I say it grows older as time passes or changes its outfits according to the weather conditions?
Interesting right?
That's called as dynamic NFT.
To know more about how the Dynamic NFTs work and how to mint one you can take this course on DAppWorld -

https://dapp-world.com/course/introduction-to-dynamic-nfts-IsYJ