teleren/devto huggingface dataset:
Software Testing Course
Tags: programming, testing
Published: 2022-05-07 05:12:30

Pentagon space is a training establishment in Bangalore. We provide best Software Testing Course and automation course and we train our understudies with different perspectives with 620 Hours of concentrated training, Career Talks by industry experts,5 Realtime projects, convenient group timings, special bootcamp, periodic false and assessments, Get prepared by guaranteed trainers, Guaranteed 100+ drive opportunities, Interview explicit prepping sessions, World class infrastructure, One to one mentoring meeting. 
[https://pentagonspace.in/softwate-testing](https://pentagonspace.in/softwate-testing)
Logical-Comparison-Operators in Javascript
Tags: javascript, beginners, codenewbie, tutorial
Published: 2022-05-07 04:50:52

Let's see the operators in Javascript. 

```
var a = 10
var b = 5
```
Here if we can use the Arithmetic Operators. What does Arithmetic Operator do? Arithmetic operators combine with numbers to form an expression that returns a single number.

```
console.log(a + b);
console.log(a - b);
console.log(a / b);
console.log(a * b);
```
Here each of the `console.log` will give the respective answers - 15, 5, 2, 50.

Similar to the Arithmetic operators we have the modulus. Modulus returns the remainder between two numbers. 

```
console.log (a%b)
```
There are also comparison operators. There are problems in which we need to make decisions in coding. All decisions really comes down to making a comparison. Two values comparing to each other to ultimately determine a true or false result. Comparison operators combine with strings, booleans and numbers to form an expression that evaluates to true or false.

> Beginners often gets confused when asked the difference between `==` and `===`
Here `==` compares equality. 
For example `console.log(b == c);` where `b ="50"` and `c =50`. Here both the values are 50 while one is a string data type and other is a number. Here in this example `b==c` is true while `b===c` is false. That is because `===`Compares equality and type (strict equality).

Other comparison operators are -

1.  Greater than or less than
2. Greater than or equal to and less than or equal to

```
var a = 100;
var b = 10;
var c = "10";
var expression1 = (b == c);
var expression2 = (a > b);
```
3. && - When we do `console.log(expression1 && expression2);`, evaluates to true if expression1 AND expression2 are both true, otherwise false
4. || -  Similarly if we use || operator, evaluates to true if expression1 OR expression2 is true, otherwise false
Underlying Principles of Blockchain
Tags: blockchain, crypto, ethereum, web3
Published: 2022-05-07 02:26:37

> With blockchain, we can imagine a world in which contracts are embedded in digital code and stored in transparent, shared databases, where they are protected from deletion, tampering, and revision. In this world every agreement, every process, every task, and every payment would have a digital record and signature that could be identified, validated, stored, and shared.

Intermediaries like lawyers, brokers, and bankers might no longer be necessary. Individuals, organizations, machines, and algorithms would freely transact and interact with one another with little friction. This is the immense potential of blockchain.

Here are five basic principles underlying the technology:

1- Distributed database. Each party on a blockchain has access to the entire database and its complete history. No single party controls the data or the information. Every party can verify the records of its transaction partners directly, without an intermediary.

2- Peer-to-peer transmission. Communication occurs directly between peers instead of through a central node. Each node stores and forwards information to all other nodes.

3- Transparency with pseudonymity. Every transaction and its associated value are visible to anyone with access to the system. Each node, or user, on a blockchain has a unique 30-plus-character alphanumeric address that identifies it. Users can choose to remain anonymous or provide proof of their identity to others. Transactions occur between blockchain addresses.

4- Irreversibility of records. Once a transaction is entered in the database and the accounts are updated, the records cannot be altered, because they’re linked to every transaction record that came before them (hence the term “chain”). Various computational algorithms and approaches are deployed to ensure that the recording on the database is permanent, chronologically ordered, and available to all others on the network.

5- Computational logic. The digital nature of the ledger means that blockchain transactions can be tied to computational logic and in essence programmed. So users can set up algorithms and rules that automatically trigger transactions between nodes.

In summary, the underlying principles of blockchain technology make it a powerful and disruptive technology that has the potential to transform many industries.

---

_Follow me on Twitter for the upcoming updates [@dominguezdaniel](https://twitter.com/dominguezdaniel)_

---
Where to start with regular expressions?
Tags: regex, discuss
Published: 2022-05-07 02:11:24

Recently I was asked where a novice would start learning how to read and write regular expressions. Below are two sites that I think would be useful.

# Reading regular expressions
I think [RegExr](https://regexr.com/) is a good site for explaining regular expressions.

![RegExr](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w2k9iemrgnz2na36u4fr.gif)

# Writing regular expressions
Learning to write regular expressions is quite hard. [RegexOne](https://regexone.com/) provides a very good beginners tutorial to help people learn how to write regular expressions.

![RegexOne](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c9xb9b5rf64ovysnmzcy.gif)

What resources have helped you to learn how to read/write regular expressions?
Must Read blogs
Tags: react, javascript, webdev, node
Published: 2022-05-07 02:09:08

Just a bunch of really great blog collection
I am trying to make a blog for collection of blog or docs which i would recommend to read 

1) https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects

2) https://react-typescript-cheatsheet.netlify.app/docs/advanced/patterns_by_version/
How I regained access to my GitHub after deleting 2-FA
Tags: github
Published: 2022-05-07 01:57:27

Hello Everyone,

Yesterday I faced my worst nightmares when I was locked out from my GitHub Account 😱,

What really happened is every time I try to access GitHub, it asks me to check my mobile to approve sign in, but it does not, I have to go into the Auth App and enter the OTP, I was irritated by this issue, so I deleted GitHub account from Auth App trying to resolve the issue, maybe it was not configured properly... and Boom !!, I'm looked out 😢, 

I have no alternative method to access my GitHub account, it was my only authentication method enabled (Stupid I know !!), even my recovery codes did not work for some reason, and to make things worst, I could not restore my Auth App backup due to an error in the backup (Yes, a series of unfortunate events🤦🏻‍♂️)

So after going through every possible article on the internet, no solution, so I contacted GitHub support very knowingly they wont restore my access.

I was still able to push and pull commits, but I could not login to my account,

luckily, I had GitHub Desktop version installed on one of my computers and my account is still logged in, and in desperate moment, I tried to open my repositories from there....aaaaand it worked😍🥳🎉, apparently I don't need to authenticate my access if I tried to open my Repositories from the desktop version.

from there I re-enabled every possible access method (lesson learned 😂)

I wanted to share my experience hopefully it would help someone noob like me to gain access back.
Qual usar? Cocoa Touch Class ou Swift File?
Tags: ios, swift, mobile, tutorial
Published: 2022-05-07 01:47:46


 Quantas vezes você estava acompanhando um tutorial, e na hora de criar um novo arquivo no projeto, você se deparou com o Dev fazendo a seguinte escolha:

> _"Agora vamos criar um Cocoa Touch Class..."_


E você ficava com aquela pulga atrás da orelha, por que não criar um Swift File? por que a escolha do Cocoa Touch Class? 

Se quando criado um Cocoa Touch Class, é possível notar que a extensão é a mesma de um Swift File, ".swift" 🤔

Hoje vamos acabar com todas essas duvidas.

Pra entendermos o que é **Cocoa Touch Class**, é interessante compreender o contexto da sua criação.

Basicamente, o Cocoa Touch é a estrutura para desenvolvimento de aplicativos iOS para iPhone, iPad, AppleWatch e AppleTv, que contempla os frameworks **Foundation** e **UIKit**.

> O termo “Cocoa” tem sido usado para se referir genericamente a qualquer classe ou objeto que é baseado no tempo de execução Objective-C e herda da classe raiz, NSObject.

---

## <br>Então, em que o Cocoa Touch Class nos ajuda?<br>
Quando estamos criando um novo arquivo **Cocoa Touch Class**, podemos perceber que o Xcode nos exibe uma tela que não é exibida quando criamos um **Swift File**:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dq0zpctcdbxgpaqfx4nx.png)
Temos um ComboBox onde nos possibilita indicar qual vai ser a subclass do nosso novo arquivo, ou seja, de qual super classe nosso arquivo vai herdar. (No exemplo acima escolhemos "UITableViewController" )
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/81pwwwo7v5bgogp6vh8d.png)
Com isso, temos como resultado um novo arquivo ja preenchido com algumas funções herdadas da super classe que selecionamos anteriormente, facilitando a implementação :)

O Xcode nos traz métodos necessários para implementar um arquivo herdando de "UITableViewController", como mostrado na imagem.
<br>
**Qual a diferença de fato, entre os dois arquivos?**

Um arquivo Cocoa Touch Class ja vem "pronto", ou melhor, pre-preenchido de acordo com a subclasse que indicamos que queremos herdar. 

Quando criamos um arquivo Swift, o mesmo não vem "pronto" ou já pre-preenchido, é criado apenas um arquivo ".swift" em branco.



---


Header Image: Photo by <a href="https://unsplash.com/@kylejglenn?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Kyle Glenn</a> on <a href="https://unsplash.com/s/photos/choices?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
Svelte components have file location meta data
Tags: javascript, svelte, todayilearned
Published: 2022-05-07 01:29:55

Svelte nodes have a `__svelte_meta` object in development mode that contains the file location of the component that rendered that node. 

```json
{
	"loc": {
		"file": "src/routes/index.svelte",
		"line": 18,
		"column": 4,
		"char": 358
	}
}
```

You an try it out on [StackBlitz](https://node.new/sveltekit). Inspect an element using the Chrome Dev Tools and use the console:

```js
$0.__svelte_meta
```

<img width="1095" alt="Screenshot 2022-05-07 at 9 25 47 AM" src="https://user-images.githubusercontent.com/4616064/167232485-a712022b-b799-441a-a052-70f2a5ff9633.png">


(`$0` [references the last selected DOM element](https://developer.chrome.com/docs/devtools/console/utilities/#recent-many). It is part of the DevTool's Console API)

Learn more about `__svelte_meta`:

- https://github.com/sveltejs/svelte/pull/1501
- https://github.com/sveltejs/svelte/issues/1499

**Today I Learned**
I share what I learn on [Today I Learned](https://petermekhaeil.com/today-i-learned/).
Javascript Animation 13
Tags: javascript, webdev, css
Published: 2022-05-07 01:27:59

Whatever you do on Javascript, you have to understand the roots and focus on the basic knowledge.
# 1. 3D cube Animation  
{% codepen https://codepen.io/php-hacker/pen/zYEWOXG %}
# 2. Pendulum animation  
{% codepen https://codepen.io/php-hacker/pen/dyVmbPP %}
# 3. Tree
{% codepen https://codepen.io/php-hacker/pen/YzraKzy %}
# 4. Diffusion animation     
{% codepen https://codepen.io/php-hacker/pen/JjrpggQ %}
# 5. Circular grid layered loop   
{% codepen https://codepen.io/php-hacker/pen/bGoLXXR %}
Javascript Animation 12
Tags: javascript, webdev, css
Published: 2022-05-07 01:24:43

Whatever you do on Javascript, you have to understand the roots and focus on the basic knowledge.
# 1. Stunning font fade in and fade out animation  
{% codepen https://codepen.io/php-hacker/pen/KKXogYy %}
# 2. Multi-point conic  
{% codepen https://codepen.io/php-hacker/pen/YzraGMz %}
# 3. Text with animated background
{% codepen https://codepen.io/php-hacker/pen/wvrmzOg %}
# 4. Canvas animation     
{% codepen https://codepen.io/php-hacker/pen/rNGdMPr %}
# 5. Bézier curve   
{% codepen https://codepen.io/php-hacker/pen/wvrmzNg %}
Day 28: Endless work
Tags: productivity
Published: 2022-05-07 01:23:27

Hi!
It's now 03:15 and it's Friday. usually on Fridays I sleep early because there no match to do and I have free time in the weekends but this one was different, I was still working on my personal portfolio project and I made a huge progress where I created a project management board on Trello with cards and some I managed to finish them I had a great coding session with on of my teammates and I don't feel that tired either
Tomorrow ( technically today) I plan to finish the paper at least the complex parts and I have to spare time for the project too because it have to be done as soon as possible I also plan to write an article about `setting up testing environment with Jest and React testing Library`
We will see how it will come along
We are 2 days away from the first milestone by the way!
signing off...
Javascript Animation 11
Tags: javascript, webdev, css
Published: 2022-05-07 01:21:30

Whatever you do on Javascript, you have to understand the roots and focus on the basic knowledge.
# 1. Interactive swipe  
{% codepen https://codepen.io/php-hacker/pen/LYzdRKK %}
# 2. Gravity ball  
{% codepen https://codepen.io/php-hacker/pen/WNZzGqE %}
# 3. Clues to the problem
{% codepen https://codepen.io/php-hacker/pen/mdBxrZV %}
# 4. Calculator     
{% codepen https://codepen.io/php-hacker/pen/mdBxrYV %}
# 5. Pingpong   
{% codepen https://codepen.io/php-hacker/pen/eYGMdoj %}
Javascript Animation 10
Tags: javascript, webdev, css
Published: 2022-05-07 01:17:55

Whatever you do on Javascript, you have to understand the roots and focus on the basic knowledge.
# 1. Hitchhiker's Guide To The Galaxy  
{% codepen https://codepen.io/php-hacker/pen/LYzdbKb %}
# 2. Flame effect  
{% codepen https://codepen.io/php-hacker/pen/qBPoqza %}
# 3. Dynamic UI with AngularJS
{% codepen https://codepen.io/php-hacker/pen/wvrmoae %}
# 4. Ripple animation    
{% codepen https://codepen.io/php-hacker/pen/GRMxNRq %}
# 5. Particle heart shape   
{% codepen https://codepen.io/php-hacker/pen/yLzKVBj %}
Cleo -- A Simple Game Made in 1 Week
Tags: showdev, javascript, gamedev
Published: 2022-05-07 01:01:48

Hey everyone,

A short while ago I created a game called Cleo. I really enjoyed making it, and I created it with the p5.js library in Javascript. 

If you didn't know, p5.js is a Javascript library that makes it a bit easier for drawing graphics to the canvas. Besides this, I pretty much had to program my own player controller, player physics (like collisions), scenes, and more! 

I created all the art, music, and code for the project (although I did use some code as a base for project, e.g., for the cool glow effect.)

**The goal is to get through all 25 buildings to the end and not get lost behind the camera.**

You can play the game here: https://cleo.stcollier.repl.co/
If you would like to see the source code, here's the link: https://replit.com/@STCollier/Cleo-GAME?v=1#main

I hope you enjoy the game!
validation password and confirm password with Yup
Tags: formvalidation, javascript, react, webdev
Published: 2022-05-07 00:51:39

Yup is javascript schema builder for validation like string, number, password, etc.

use yup for validation password and confirm password very easy with yup schema like below

```
import * as Yup from "yup";

const validation = Yup.object().shape({
    email: Yup.string().required().email(),
    name: Yup.string().required(),
    phone: Yup.string().required(),
    password: Yup.string().required(),
    confirm_password: Yup.string().label('confirm password').required().oneOf([Yup.ref('password'), null], 'Passwords must match'),
  })

```

we can use `oneOf([Yup.ref('password'), null], 'Passwords must match')`
Tip: Edit Files on a Server Using Your Local Vim Config
Tags: vim, aws, linux, tutorial
Published: 2022-05-07 00:19:37

Recently I found out that you can edit files that are hosted on a server with vim using the scp protocol, and keep your local `.vimrc` / `init.nvim` config!

On this tutorial I'll be editing files that are hosted on an EC2 instance, to do this you'll need:

* A `.per` or `.cer` file for authorization
* The ip address that you'd normally use to connect to your server through ssh

And that's it! Let's first setup the permissions.

1. On your terminal, run `vim ~/.ssh/config` to either create or modify an existing config file
2. Copy and paste the following, replacing it with your own server values
 ```
 Host your-ec2-instance-name
 Hostname 2.89.32.932
 User ubuntu
 IdentityFile /Users/myname/path/to/your-ec2-instance-name.cer
 PasswordAuthentication no
 ```
<ol start="3">
  <li>Run <code>vim scp://your-ec2-instance-name/home/ubuntu/my-file.txt</code></li>
</ol>

And that's it! You might be prompted with a message to authorize the host in which case you'll need to type _yes_.

![editing a file on a server through scp](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xf80q0n309obfnv8ggvw.png)
How I scanned dev.to APIs for vulnerabilities
Tags: security, api, testing, node
Published: 2022-05-07 00:16:03

I recently saw the dev.to updated to their REST APIs. 
https://developers.forem.com/api

I became curious, and I wanted to scan the Dev.to REST API for vulnerabilities. I used this free and web-based API security tool for this job.
https://apisec-inc.github.io/pentest/

Here are the scan results

![Scan result](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mhi2fw7actyx20k39p4r.png)

Surprisingly it reported 8 issues. Here is the list:

![Vulnerability report](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xbxuwznr4yyyqoghvovg.png)

I analyzed the dev.to web UI to find out what was happening. I quickly figured out all the open endpoints were also open on the web UI and were left public by design so the unauthenticated users can view the dev.to articles, videos, and their associated tags, categories, and author's public images. All other functionality like content engagement like likes, comments, follow, create articles, etc., requires the user to be authenticated.

The free web tool did a decent job of identifying unauthenticated endpoints. Of course, there was no way the tool could have guessed the business reasoning behind leaving those endpoints public. 

Here is the free tool URL: https://apisec-inc.github.io/pentest/
Using Serializers in Rails
Published: 2022-05-06 23:42:08

Serializers can be used to customize JSON data for a single model.  However, they can also be used to handle associations between multiple models.  The **has_many** and **belongs_to** Active Record macros can assist.

To use a serializer with a one-to-many association, add the belongs_to macro to the corresponding serializer.  Example: there are three models, episode--< appearances >--guests.  When the JSON data for appearances is returned, I want to include the data for episode and guest.  Since the relationships have been established in the model, I can include the same **has_one :episode** and **has_one :guest** relationship in the corresponding serializer.  Therefore, when the JSON data for appearance is returned, it will include the data for episode and guest.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yi0v243bx14powrgyeqi.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cr1bgopcjc5vw2t7qpot.png)
  
The same can be used with many-to-many associations.  Example: I want the JSON data to include guests along with data for episodes.  Including the **has_many :guests** relationship in the corresponding episode serializer will return JSON data with the episode, and guests.

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

What helped me understand these concepts the most was seeing them in action.  Practice coding different serializers to see the JSON data that is returned.
Scheme: eqv? vs equal?
Tags: umkc, cs441
Published: 2022-05-06 23:36:21

*Photo by [Piret Ilver](https://unsplash.com/photos/98MbUldcDJY?utm_source=unsplash&utm_medium=referral&utm_content=creditShareLink) on Unsplash*

---

You can read a few lengthy explanations [on Stack Overflow](https://stackoverflow.com/questions/16299246/what-is-the-difference-between-eq-eqv-equal-and-in-scheme), but in a nutshell:

- `equal?` returns true if its arguments have the same structure. This is comparable to `==` in most languages.
- `eqv?` is a pointer comparison. It looks at memory addresses.
  - The exception is numbers. 
  - Unlike `eq?`, it will compare numeric data instead of addresses.
  - However, it won't convert between `int` and `float` data.

## Further Reading

- [Stack Overflow question](https://stackoverflow.com/questions/16299246/what-is-the-difference-between-eq-eqv-equal-and-in-scheme)
- [Washington University page](https://courses.cs.washington.edu/courses/cse341/03wi/scheme/basics.html)
MyFunction
Published: 2022-05-06 23:13:18

<script type="text/javascript">
<!--
function myFunc()
{
   var a = 100;

   alert("Value of variable a is : " + a );
 
}
//-->
</script>
</head>
<body>
<p>Click the following to see the result:</p>
<form>
<input type="button" value="Click Me" onclick="myFunc();" />
</form> `
Generating realistic landscape images with Nvidia Canvas showcase app
Tags: ai, nvidia
Published: 2022-05-06 23:09:42

Nvidia Canvas is a showcase application that allows you to generate realistic landscape images with AI. Using options like grass, hill, ocean you can tell the AI to generate given feature on selected spot of the image. Lets take a look.

You can [download Nvidia Canvas](https://www.nvidia.com/pl-pl/studio/canvas/) for free but to use it you **need a PC with Nvidia RTX GPU**.

The UI is quite simple although unique to this application:

![Nvidia Canvas UI](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lrt76qefwukefup3lnak.jpg)

You start from selecting an image from the right column. You can add your own as well. You should use landscape images, on others you will get weird abstract results. I used Windows XP wallpaper.

When you select an image you likely won’t see it on the preview. The app has two panels — drawing box on the left and preview box on the right. Using materials from the right column you draw where given landscape feature should be on the image and the AI will try to draw it there.

To have a base start you should try drawing where original landscape features are on the base image — so I’ve market the area where the Windows XP wallpaper had grass and where it had sky. This generated something similar to the original image. Next I started experimenting with adding water, ocean, hills and so on. Note that you need somewhat realistic angles and size of features like hills or mountains for the AI to generate something that looks like them and not weird artifacts.

![Sea and mountains added](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o6ci8m6dbteyj7ogpjjr.jpg)

**More examples on:**

> **https://rk.edu.pl/en/generating-realistic-landscape-images-with-nvidia-canvas-showcase-app/**