teleren/devto huggingface dataset:
$IOTX one off the kind
Published: 2021-10-16 05:58:20



**Introduction to $IOTX**
The IoTeX Network is fueled by the native IOTX token. In addition to representing fractional ownership of the IoTeX Network, IOTX has multiple uses (or “utility”) to enable trusted and transparent interactions between various stakeholders, including users, Delegates, developers, and service providers. The IOTX token is the lifeblood of the IoTeX protocol and instills economic and reputational incentives to ensure the IoTeX Network is governed/maintained in a decentralized fashion.
IoTeX stakeholders can spend, stake, and/or burn IOTX in order to access network resources. As the utility of IOTX grows, the demand and value of IOTX will also grow, providing continued incentives for network participants to maintain and grow the network. As such, IOTX tokenomics are designed to balance incentives across multiple types of stakeholders:
Users pay for DApps/services and stake/vote for Delegates with IOTXDevelopers power their devices/DApps and incentives via IOTXDelegates stake IOTX in order to be eligible to produce blocksService Providers offer services to devices/DApps, paid in IOTX
Push Docker image to Azure Container Registry
Tags: azure, docker, node, vue
Published: 2021-10-16 07:36:02

If you are already familiar with Docker and Docker Hub then in this post I’d like to introduce the Azure Container Registry which is an alternative to the well-known Docker Hub.

**Things required before starting:**

1. Docker Desktop
2. Azure CLI
3. Azure Account

In order to start with Azure Container Registry, you need an Azure account which you can create easily with FREE Credits and also ACR is a very cheap service. Once you logged into Azure, Navigate to Azure Container Registry by clicking on **New --> Search --> type Azure Container Registry**. After that create a new ACR by filling in all details you want to add but make sure you enable admin access. After Two or three minutes your ACR will be created.

Once you created a resource navigate Access Keys to get the Login server, Username, and password which is required for the command line push your local Docker image to ACR.

![Fig 1:Docker Login](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nxafy6jh8v4aj2u0dszg.png)

Type Above fig command and replace [login-server] with your ACR resource EG: **firstapp.azureacr.io** [username] with firstapp and [password] with the hash password. Once completed, you should see Login succeeded! Message. After this you need to build your docker image with this command

```
docker build –f ./Dockerfile . –t node_vue_app
```

![Fig 2: Docker Tag to ACR resource](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m6cfdcsht3hvx18jc8rs.png)

Final step is to push your local Docker image to ACR. Follow below image command to push. Keep in mind though that these repositories are private by default, which means that you have to perform authentication first.

![Fig 3: Docker Push to ACR resource](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1oayrbphsb03cmjw8t72.png)

And that’s it. You can make use of this container registry just like you used. In Part 2 we will see how we can deploy same thing using CI/CD with GitHub Workflow
Stage 4: Optional chaining
Tags: javascript, webdev, programming
Published: 2021-10-17 14:58:19

**Motivation**
When looking for a property value that's deep in a tree-like structure, one often has to check whether intermediate nodes exist or not like below 

    const street = user.address && user.address.street;
   
Also, many API return either an object or null/undefined, and one may want to extract a property from the result only when it is not null

    const fooInput = myForm.querySelector('input[name=foo]')
	const fooValue = fooInput ? fooInput.value : undefined


The Optional Chaining Operator allows a developer to handle many of those cases without repeating themselves and/or assigning intermediate results in temporary variables:

    var street = user.address?.street
	var fooValue = myForm.querySelector('input[name=foo]')?.value

The call variant of Optional Chaining is useful for dealing with interfaces that have optional methods 

    iterator.return?.() // manually close an iterator
or with methods not universally implemented

    if (myForm.checkValidity?.() === false) { // skip the test in older web browsers
	    // form validation fails
	    return;
	}

**Syntax**
The Optional Chaining operator is spelled ?.. It may appear in three positions:

    obj?.prop       // optional static property access
	obj?.[expr]     // optional dynamic property access
	func?.(...args) // optional function or method call

**Semantics**
If the operand at the left-hand side of the `?.` operator evaluates to undefined or null, the expression evaluates to undefined. Otherwise the targeted property access, method or function call is triggered normally.

    a?.b                          // undefined if `a` is null/undefined, `a.b` otherwise.
	a == null ? undefined : a.b

	a?.[x]                        // undefined if `a` is null/undefined, `a[x]` otherwise.
	a == null ? undefined : a[x]

	a?.b()                        // undefined if `a` is null/undefined
	a == null ? undefined : a.b() // throws a TypeError if `a.b` is not a function
	                              // otherwise, evaluates to `a.b()`

	a?.()                        // undefined if `a` is null/undefined
	a == null ? undefined : a()  // throws a TypeError if `a` is neither null/undefined, nor a function
	                             // invokes the function `a` otherwise

**Short-circuiting**

    a?.[++x]         // `x` is incremented if and only if `a` is not null/undefined
	a == null ? undefined : a[++x]

**Stacking**

	a?.b[3].c?.(x).d
	a == null ? undefined : a.b[3].c == null ? undefined : a.b[3].c(x).d
	// (as always, except that `a` and `a.b[3].c` are evaluated only once)

 **Optional deletion**
 
    delete a?.b
	a == null ? true : delete a.b
Rails templates with docker
Tags: docker, rails
Published: 2021-10-16 17:58:28

Starting new rails apps has never been easier for me. Here's why and how.

## Before docker

You know when you want to start a new app, but you end up losing too much time setting it up, and solving issues with the dependencies on your machine? And after a while, you want to start another new project, only to find yourself going through the same steps and pains, to a point where you almost lose interest?

I've always wanted to find a way to start a new project on my machine, seamlessly. No hassle, just plug and play. But I never found a solution for that until I started using docker. Being able to start a rails project in under 5 minutes has given me back the joy of working on side projects and exploring new things. 

## After docker

So, recently I've decided to put together simple docker based templates with the tools I generally work with on a rails project:

- [rails with postgres] (https://github.com/anansilva/docker-rails-postgres-template)
- [rails api with postgres] (https://github.com/anansilva/docker-rails-api-postgres-template)
- [rails api with mysql] (https://github.com/anansilva/docker-rails-api-mysql-template)
- [rails api with postgres and rspec] (https://github.com/anansilva/docker-rails-api-postgres-rspec-tempate)

Using [github templates](https://docs.github.com/pt/repositories/creating-and-managing-repositories/creating-a-template-repository) I can easily create new repositories based on a chosen template, clone it to my machine, run some `docker-compose` commands documented in the project's README, and voilà!  

These templates are mostly based on the official docker [quickstart tutorial for rails](https://docs.docker.com/samples/rails/). They are currently set for ruby 3 and rails 6 but the beauty of docker is that you can go ahead and easily change them to whatever version you like, without the need to have anything installed on your computer. The same goes for postgres, mysql or whatever other tools you might add to these templates. 

I'll be adding more as I start new rails apps with different toolsets that might be helpful in the future. For instance, I've currently started a new rails app with sidekiq and since I use sidekiq often, I know it's a good candidate for a template. I'll not create templates for all possible combinations of tools but mostly for those that involve adding containers, networking, or installing other dependencies. The idea is to save time with cumbersome configurations. 

I'm happy to get feedback on these, feel free to use them, adapt them to your needs or just take some ideas to start your own. If you're fairly new to docker like me, I recommend you build your own from scratch. You'll learn a lot about docker and docker tools. 

![We're saved](https://media.giphy.com/media/3o6Mb4ESRjnBhOivT2/giphy.gif)
Machine  Learning in Artificial Intelligence 💯
Tags: machinelearning, webdev, showdev, webpack
Published: 2021-10-16 18:26:59


#Introduction
####Hello everyone! 
In this article, we look into about machine learning in Artificial intelligence
We are using Artificial intelligence in our daily life I will tell you that Machine learning how it work and how many types we are see all the step in this article  it's help you to grow and build your knowledge.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h4h5tlna4lrg47v595ry.jpeg)
Machine learning is a subset of AI,and it's provide the static ( Statistics )Method and there algorithm and enable to machine and computers learning ,the program to change in any case Machine Learning is utilized in various applications, ranging from automating.

##What is Machine learning ?
Machine Learning provides many different techniques and algorithms to make the computer learn Machine learning uses a massive amount of structured and semi-structured data so that a machine learning model can generate accurate result or give predictions based on that data. Also it's called (ML)Machine learning enables a computer system to make predictions or take some decisions using historical data without being explicitly programmed.

##Types Of Machine Learning
There are Three types of Machine learning
1.Supervised Learning
2.Unsupervised Learning
3.Reinforcement Learning

###Supervised Learning
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g1wl5s72jtytbv11fh17.png)
Supervised learning is typically done in the context of classification, when we want to map input to output labels, or regression.
Supervised learning (SL) is the machine learning task of learning a function that maps an input to an output based on example input-output pairs. 

###Unsupervised Learning
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bgztqf42maobyautb43w.jpeg)
Unsupervised learning is a type of machine learning in which the algorithm is not provided with any pre-assigned labels or scores for the training data.
Advantages of unsupervised learning include a minimal workload to prepare and audit the training set, in contrast to supervised learning techniques where a considerable amount. 

###Reinforcement Learning
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gpkt6guutb09h03w7f9q.jpeg)
Reinforcement learning is a machine learning training method based.It enables an agent to learn through the consequences of actions in a specific environment.
example, types of reinforcement might include praise, getting out of unwanted work, token rewards ,etc.

#####It's the some of the basis points of the machine learning I will also provide  the machine learning and there platform is also giving in my last article. You can check there and learn about the machine learning.
.
.
.
###Conclusion
####I hope you found this article useful, if you need any help please let me know in the comment section.💯
Release0.2 week two
Published: 2021-10-16 20:04:18

I have had experience about how to search Hacktoberfest issue, so I found the appropriate issue very soon. The Second Hacktoberest issue is about "String Metadata Extraction", and it is more difficult than the first one. The project named [Nirjas] (https://github.com/fossology/Nirjas). This project focus on  extracting the comments and source code out of your file(s). The extracted comments can be processed in various ways to detect licenses, generate documentation, process info, etc.

### The issue
The [issue](https://github.com/fossology/Nirjas/issues/36) named "String Metadata Extraction". The problem is that in code files there are variables which are assigned with the strings. Extraction of it can be simply done using the same process of regex.  
foo = "This is a string". 
Nirjas is currently extracting several type of metadata including the SLOC, Comments. This can be a separate output metadata with only assigned string extractions.

### How to do 
**First**, I studied the code structure and understood the functions meaning. Then I authored a new function according to a similar function in this project. 
**Second**, the point of the new function is about the regular expression. I had some regular expression experience in recent weeks. However, it is too complicated, so I need a tool to test it. I found an extension named "Regex Previewer", and it help me to find a right regular expression.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wtm3f9x41bgyluuuswbx.png)
**Third**, Interact with the project owner and revise the code repeatedly according to their opinions.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8vcgiuor4suwgd1u6lub.png)
 
### Reflection
1. Regular expression is very useful, but it is also complicated. We will continue to learn it in the coming weeks.
2. Be patient！ This project have sever owners and they have different style. They will put forward different requirements to improve a function, and sometimes their opinions are not clear. I need to keep good communication to clarify what needs to be modified. I have learned a lot in this process.
3. I want to introduce my method which search the project. I used the advanced search, and choose "With this many forks <50 "in Repositories options part. It is very helpful for me to search for issues at my level.
Learn Simple HTML5(First Article), Beginner level 
Tags: html, beginners, programming
Published: 2021-10-17 04:59:40

## What is an HTML?

- HTML (Hyper Text MarkUp language), which we use to define the basic structure of the web pages. Like The contents where we have some paragraphs, bullets points, data table forms, images,videos and map etc.

- The HTML Tags Contains machine-readable information about the metadata of the Document, like title, script, style, etc.

### what is MetaData?

- The simplest Definition is that the data describes the data is called metadata.Like the tag of <html> </html> element also contain metadata in its  head tag which also describes the data like style title, the script is metadata of HTML

### what head tag holds between the opening and Closing Tag?

- I will also cover, about opening and closing tags below in the document.The Head tag holds the Information about the  machine-understandable data, not for human-readable,but for humans html provides use some tags which we use in browser tab and provide some extra information about the website as well.  

### What is an Element?

- I will to explain about the element through an example?
```
<p>This is a content </p>
This is an complete Example of an Element
```

- There are some pre-defined key words in HTML such as ```p```which tells us about the Paragraph ,same like `h1` which represents heading.There are many other pre-defined key words as well. I will provide the link to learn more about the element and tags name at the end of this article.

- We have Two opening angle brackets `<p>`
- In between of tags we have the content .```This is an Enclosed text content <p> This is an content</p>``` 
   we can write whatever we want in between of opening & close brackets.
- The two closing angle Brackets  and slash  ```</p>```.

### Attribute
-The element can contain an attribute where we store extra information about the element which does not appear on the web page, we use attributes for different reasons just like, the class for styling, id attribute, `<p class="para">moiz </p>`, this is an attribute.

### Nested Elements
-In HTML we have nested elements as well, we can make the elements and we can make another elements inside  of it, `<p>Moiz JS<strong>Dev</strong> <p>`
 
###### Important Note:
-we need to remember that, when we make the nested element and after the opening tag then we must make the closing tag before the parent Closing tag.

###Empty Elements
- Empty Elements are those elements are those elements which are not contain any content `<img/>`  , but this tag accepts and we also called the self-closing tag `<img src="Path of Image" alt="Meaning full Message"/>` 

The Link of Elements:`https://developer.mozilla.org/en-US/docs/Web/HTML/Element`

Message:
If Someone see some wrong thing which should be correct then feel free to contact me on LinkedIn or twitter
LinkedIn:  `https://www.linkedin.com/in/abdul-moiz-8b84361b2/`
 Twitter: `https://twitter.com/Abdulmoiz8994`
How do you become a writer? 7 steps.
Tags: beginners, career, motivation, writing
Published: 2021-10-17 07:16:56

What do you have to do to become a writer? The short answer: writing. The long answer: reading, being insecure, sitting still (ergo: working), being rejected, looking critically at your own work and submitting it to a publisher.

1. Read and Learn

The best writers are readers. They learn when they read (for pleasure) and are genuinely interested in stories. Here are five books by writers about writing that you can start with, but also read what you feel like yourself.

2. Be insecure

Hey? Shouldn't you be very firm as a writer? New. In general, it is a good sign if you are insecure about your own work: you realize that you do not know everything and that there is still a lot to learn. Knowing more?

3. Sit still (and work)

As a writer you have to have guts. My solution to sitting still is to start moving when I'm not writing or pausing .

4. You must exhibit 'writer behavior'

You are a writer when you write and eventually finish a book, for example. To write you need three things:

Motivation
Trigger
Power (such as a computer and time)

Are you missing an element? Then you get stuck. For example, when you lack motivation and you have new ideas every time, but do not bring anything to realization. Learn more about this behavioral model and how to make sure you become a writer with these elements .

5. You must be rejected

Rejection is part of writing. You learn from it. There is no writer whose work is all good and 100% accepted. Especially if you're just starting to write. That doesn't make getting rejected any easier. I found a way to collect rejection, learn from it, and grow into a debut writer.

6. Be critical of your work

Really good writing is a result of rewriting. That's where the story gets taut and where everything comes together. A few tips to look at your writing with a fresh, critical eye . And know: deleting hurts, and for this reason.

7. Send your manuscript to a publisher

If you want to become a published writer, at some point you have to send your book to a publishing house . It is important that your manuscript looks good and that you may have a good writer's resume.

For more info: https://www.outreachway.com/
React Developer Roadmap
Tags: react, javascript, webdev, reactnative
Published: 2021-10-17 11:21:57

[React Developer Roadmap](https://codingtute.com/react-developer-roadmap) will help you to start your react learning path in an organized way.
You can find more useful developer content at [codingtute](https://codingtute.com) and follow [facebook](https://www.facebook.com/codingtute) page for latest updates
![React Developer Roadmap](https://codingtute.com/wp-content/uploads/2021/10/React-Developer-Roadmap-1.png)
Using replace() and replaceAll() in JavaScript
Tags: javascript, string, beginners, webdev
Published: 2021-10-17 15:49:11

In this tutorial, we're going to see how to use the methods replace() and replaceAll() in javascript.

Both methods are part of the String object. that means you can invoke them on strings. Let's start with replace().

The replace() method can be used to search from a string, a specific character or a substring that matches a pattern that you provide in order to replace it by another character or a new substring. The method takes 2 arguments, the first one will be the pattern and the second one will be the newsubstring.

```javascript
replace('pattern','newsubstring');
```
The pattern can be a string or a regular expression.

let's put an example:

```javascript
let str = 'cars are fast';
let newstr = str.replace('cars', 'planes');
console.log(newstr);
//the output will be:planes are fast

```
There are 2 important points to mention: 
First, the method return a new string, it doesn't modify the original one.
```javascript
let str = 'cars are fast';
let newstr = str.replace('cars', 'planes');
console.log(newstr);
//the output will be:planes are fast
console.log(str); // str is still: cars are fast
```

 Second, when the pattern is a string it will return the first occurence it finds.

```javascript
let str = 'cars are fast but, some cars are really fast';
let newstr = str.replace('cars', 'planes');
console.log(newstr);
/**
 * The output will be: 
 * planes are fast but, some cars are really fast
 */

```
Now, let's see with a regular expression
```javascript
let str = 'cars are fast but, some cars are really fast';
let newstr = str.replace(/cars/g, 'planes');
console.log(newstr);
/**
 * The output will be: 
 * planes are fast but, some planes are really fast
 */
```
The letter g in the regular expression is for global, it makes the function searches for all the occurence.

For more details about how to use regular expression visit [this guide](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions).

For the replaceAll(), as the name suggest it will look for all the occurence that match the pattern to replace them by the newsubstring. And as the replace(), it will return a new string with the changes.
```javascript
let str = 'cars are fast but, some cars are really fast';
let newstr = str.replaceAll('cars', 'planes');
console.log(newstr);
/**
 * The output will be: 
 * planes are fast but, some planes are really fast
 */
```

I hope this will help you have a quick understanding of how to use replace() and replaceAll() in JavaScript.