teleren/devto huggingface dataset:
What is Amazon Lex?
Tags: nlp, aws, datascience, cloud
Published: 2022-08-14 13:17:00

It is always beneficial to keep learning new things, and that is why, we are learning Natural Language Processing 😜. And like every other field of Machine Learning, NLP has different paradigms to work on. Here, we are working on Chatbots or *conversational interfaces*. Yes, and for that, we are using Amazon Lex. 

Amazon Lex is an excellent Amazon technology that allows developers to design high-quality conversational interfaces that can be smoothly integrated into either a new or existing application. Your clients would easily connect with your applications utilising voice or text instructions, for example, Chatbot for talking with your customers in a simple way, with the Amazon Lex.

Amazon Lex uses the same deep learning integration as Amazon Alexa for the chatbot, including automated speech recognition and natural language understanding. Before delving more into what the Amazon Lex is, I'd want to define a ChatBot application. A ChatBot application is a software that mimics human dialogue.

Why use Amazon Lex instead of a self-taught natural language algorithm?
- They are straightforward to include into new or current applications.
- Because it is a pay-as-you-go business, the cost to effort ratio is extremely affordable.
- They smoothly comprehend both text and voice.
- They are simple to deploy and use in your apps.
- They are very scalable.
- It is simple to interface with other services on the AWS platform.

It is worth noting that all network interactions with Amazon Lex use only HTTPS to ensure safe communication, which means your discussions are encrypted by Amazon Lex. I noted before that the Amazon Lex is reasonably priced, but let's look at the pricing model of the Amazon Lex below:
- Each voice request costs $0.004, therefore if your ChatBot handles 5000 voice requests per month, you could expect to spend 5000 * 0.004 = $20 per month.
- Each text request costs $0.00075, therefore if your chatbot handles 5000 text queries per month, you could expect to spend 5000 * 0.00075 = $3.75 per month.

Your monthly charge and cost with Amazon Lex are calculated depending on the total number of queries processed by your application on a monthly basis. There is also a free Amazon Lex option that allows you to process 10,000 messages and 5,000 voice requests per month for the first year, allowing you to test its functionality inside your application.
Ethereum's Four Stages of Development
Tags: blockchain, ethereum, bitcoin, webdev
Published: 2022-08-14 12:48:34

**Ethereum**!

What is an Ethereum?

Many of you know, that Ethereum is the native blockchain of ETH cryptocurrency.

Yup.

Not only this, it has a lot of other features. Once go through my previous article about Ethereum to learn more about it.

Well,

So, what are the four stages of Ethereum's development?

As might few of you know, Ethereum's development was planned over four distinct stages, with major changes occurring at each stage. A stage may include a sub-release, known as hard fork, that changes functionality in a way that is not backward compatible.

The four main development stages are codenamed _Frontier, Homestead, Metropolis, and Serenity_. The intermediate hard forks that have occurred (or are planned) to date are codenamed _Ice Age, DAO, Tangerine, Whistle, Spurious, Dragon, Byzantium, and Constantinople_. Let's see below all of these development stages and the intermediate hard forks with the block numbers.

**Frontier (Block #0)**

Frontier is the initial stage of Ethereum, lasting from July 30, 2015, to March 2016,

**Ice Age (Block #200000)**

It is a hard fork to introduce an exponential difficulty increase, to motivate a transaction to PoS when ready.

**Homestead (Block #1150000)**

Homestead is the second stage of Ethereum, launched in March 2016.

**DAO (Block #1192000)**

DAO is a hard fork that reimbursed victims of the hacked DAO contract and caused Ethereum and Ethereum Classic to split into two competing systems.

**Tangerine Whistle (Block #2463000)**

It is a hard fork to change the gas calculation for certain I/O-heavy operations and to clear the accumulated state from a denial-of-service(DoS) attack that exploited the low gas cost of those operations.

**Spurious Dragon (Block #2675000)**

Spurious Dragon is a hard fork to address more DoS attack vectors and another state clearing. Also, a replay attack protection mechanism.

**Metropolis Byzantium (Block #4370000)**

Metropolis is the third stage of Ethereum, launched in October 2017. Byzantium is the first two hard forks planned for Metropolis.

After Byzantium, there is one more hard fork planned for Metropolis: Constantinople. Metropolis will be followed by the final stage of Ethereum's development, codenamed Serenity.

This is a small overview of Ethereum's development stages.

I hope you found it informative.

Thanks for reading :)
Ether Wallet Smart Contract
Tags: web3, blockchain, beginners, solidity
Published: 2022-08-14 12:46:52

## Ether Wallet

Ethereum wallets are applications that let you interact with your Ethereum account. Think of it like an internet banking app – without the bank. Your wallet lets you read your balance, send transactions and connect to applications.

---

The owner's address is listed first in the contract.

```solidity
address payable public owner;
```

The address has the designation `payable` so that ether can be sent to it.

The owner variable in the constructor is set to `msg.sender`, or the deployer of the contract, upon initialization.

```solidity
constructor() {
    owner = payable(msg.sender);
}
```

We now have two unique functions called "receive" and "fallback" that allow the contract to accept plain ether with or without a calldata. For more information on these functions, [read on](https://dev.to/envoy_/day-25-fallback-and-receive-functions-4am0).

```solidity
receive() external payable {}
fallback() external payable {}
```

Following this, we require a function to withdraw our ether to the address of the owner; the `withdraw` function aids us in doing this. It has a `require` statement that makes that the owner, whom we initialised in the constructor, is the one calling the method. We transfer ether from the smart contract to the `msg.sender` if that criterion is satisfied.

```solidity
function withdraw(uint _amount) external {
    require(msg.sender == owner, "caller is not owner");
    payable(msg.sender).transfer(_amount);
}
```

Finally, we create a new function named `getBalance`, which is a view function, meaning that anyone can call it to retrieve the smart contract's balance without affecting the blockchain's current state.

```solidity
function getBalance() external view returns (uint) {
    return address(this).balance;
}
```

For Entire Code - 

{% embed https://github.com/Envoy-VC/Smart-Contracts noreadme %}

---
How to schedule and run cron jobs in Rust using apalis
Tags: rust, tokio
Published: 2022-08-14 12:13:00

For this tutorial, we're going to use [apalis](https://crates.io/crates/apalis) to run cron jobs in an async context. We will also look at how to decorate our jobs with [tower](https://docs.rs/tower) middleware allowing us to unlock features like retries, prometheus, sentry etc

To begin, we will want to:

Setup a new project

```
cargo new my-cron-scheduler
cd my-cron-scheduler
```

Add to Cargo.toml

```
[dependencies]
apalis = { version = "0.3", features = ["cron"] }
serde = { version = "1.0", features = ["derive"] }
tower = 0.4
```

In this tutorial we will create a daily reminder example.

```rust
use apalis::prelude::*;
use serde::{Serialize,Deserialize};

#[derive(Serialize, Deserialize, Default, Debug, Clone)]
struct Reminder;

// Define an apalis job
impl Job for Reminder {
    const NAME: &'static str = "reminder::DailyReminder";
}
// Define a handler
async fn send_reminder(job: Reminder, ctx: JobContext) {
    // Do reminder stuff
}
```

Lets define our entry point

```rust
use apalis::cron::{CronWorker, Schedule};
#[tokio::main]
async fn main() {
    // any valid cron string that points to the future should work
    let schedule = Schedule::from_str("@daily").unwrap();

    let worker = CronWorker::new(schedule, job_fn(send_reminder));

    Monitor::new()
        .register(worker)
        .run()
        .await
        .unwrap();
}
```
This works perfectly but we can add some more functionality eg retries and extensions to a job context. 

To use these features by `apalis`, you need to include the `retry` and `extension` features.

```rust
use apalis::layers::{Extension, DefaultRetryPolicy, RetryLayer};

#[derive(Clone)]
struct FakeService;

let service = ServiceBuilder::new()
    // Will retry 25 times
    .layer(RetryLayer::new(DefaultRetryPolicy))
    .layer(Extension(FakeService))
    .service(job_fn(send_reminder));

let worker = CronWorker::new(schedule, service);

Monitor::new()
    .register(worker)
    .run()
    .await
    .unwrap();

```

Now we can access our `FakeService` in our handler

```rust
// Define a handler
async fn send_reminder(job: Reminder, ctx: JobContext) {
    let fake_service = ctx.data_opt::<FakeService>();
    // fake_service.fetch_from_db()
}
```

You can repeat the process for different cron jobs.
```rust
Monitor::new()
    .register(daily_worker)
    .register(weekly_worker)
    .run()
    .await
    .unwrap();
```

Further reading: 
[Background job processing with rust using apalis, actix and redis](https://mureithi.me/blog/background-job-processing-with-rust-actix-redis)
[Apalis on Github](https://github.com/geofmureithi/apalis)
GIT IS NOT GITHUB
Tags: git, opensource
Published: 2022-08-14 12:00:11

Wassup guys!

Most people tend to use the words **GIT** and **GITHUB** interchangeably and get them confused which is quite wrong

**GIT** is a VERSION CONTROL software, i.e. It tracks changes to a set of files over time

**GITHUB **is an online code repository hosting service

You can essentially think of GitHub as

- The repository that Git makes that tracks the changes in files every time

- The online interface that hosts this changes online for people to see, Pull down and contribute to.

While the underlying Software used in GitHub repository providing service is Git

GitHub is the most popular open source repository hosting platform as it is entirely free, transparent and easy to use.

_**Simple Illustration**_

Just like

- MacOS runs Apple Devices

- WindowsOS runs Microsoft Devices

- GIT runs GITHUB repository service

**Note**: **GIT** is not an Operating System ( Lol ), Hope you got the point.

**Ciao!**
Simple Ecommerce Web App using Reactjs
Tags: react, javascript, fakestoreapi, ecommerce
Published: 2022-08-14 11:57:49


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

**Demo** : [https://ecommerce-web-app-reactjs.vercel.app/](https://ecommerce-web-app-reactjs.vercel.app/)
**Source**: [https://github.com/erajamanickam/ecommerce-web-app-reactjs](https://github.com/erajamanickam/ecommerce-web-app-reactjs)

Simple Ecommerce Web App using reactjs with fakestoreapi

**[Fake Store API](https://fakestoreapi.com/)**
FakeStoreApi is a free online REST API that you can use whenever you need Pseudo-real data for your e-commerce or shopping website without running any server-side code. It's awesome for teaching purposes, sample codes, tests, etc.

`https://fakestoreapi.com/products`and in your product page you request a single product by Id `https://fakestoreapi.com/products/1`

- Product Category
- Product lists
- Product Details

[Github](https://github.com/erajamanickam)
[Linkedin](https://linkedin.com/in/rajamanickamweb)
[Portfolio](https://erajamanickam.github.io/)
Pycraft v0.9.6-1 is now live!
Tags: programming, python, opensource, gamedev
Published: 2022-08-14 11:46:52

Pycraft v0.9.6-1 is now live on GitHub, we have been making lots of general improvements to Pycraft, but now focus will shift to work on the settings menu! You can find all the changes and new update here: https://github.com/PycraftDeveloper/Pycraft/tree/Pycraft-v0.9.6-1

## Full change-log:
* PEP8: We have tweaked more function, procedure, class and variable names to bring them in line with the PEP8 standard, this is in line with a current project to introduce the PEP8 standards in Pycraft.
* Feature: We have deprecated numerous variables and keys in save data that were no longer needed.
* Feature: We have added "Registry.py" to Pycraft that takes charge of initialising a lot of the key variables used throughout Pycraft, shortening the "main.py" module considerably.
* Feature: We have tweaked and improved file loading in Pycraft so that if your saved data has readable keys, we can recover those without resetting everything in the save.
* Feature: We have tweaked the sequence of GUIs that appear on start-up to make them make more sense, putting the start-up animation before the theme selector menu.
* Feature: We have added the theme selection menu and start-up animation into the core 2D display functionality module with means that we can more easily tweak them later on if we need to.
* Feature: We have improved in-game events, especially focused on movement to make them shorter and more user friendly.
* Feature: We have altered the jump animation for Pycraft to make it more realistic. We have also re-added the ability to hold the space bar to continuously jump.
* Feature: We have made several improvements to the joystick control in game, fixing bugs and allowing for better menu navigation and mouse control. We have also made freeing the mouse from Pycraft easier.
* Feature: We have con
Pycraft v0.9.6-0 is now live!
Tags: programming, python, opensource, gamedev
Published: 2022-08-14 11:41:00

Pycraft v0.9.6-0 is now out on GitHub, it features many bug fixes and a new way to create Perlin noise and changes to how resources are checked, you can find the latest developer preview here: 
https://github.com/PycraftDeveloper/Pycraft/tree/Pycraft-v0.9.6-0

## Full change-log:
* Feature: There have been some major changes and improvements to how Pycraft checks to make sure all the resources it needs are present and in the correct location, the process is now faster and it’s easier to add more files later on and has been improved to include all the required files in Pycraft (some were not checked before).
* Feature & Performance: The 'noise' module for generating Perlin noise in Pycraft has now been removed, opting for a solution that is faster, more efficient and also supported on newer hardware and more operating systems.
* Bug-Fix: Numerous improvements and other small bug-fixes that were quickly patched in Pycraft v0.9.5 have been properly patched now.
* Feature: Some of the folders used by Pycraft have been renamed to make them more user friendly.
* Feature: Some of the core variables for Pycraft have been renamed to bring them in-line with the PEP8 specification, this is a small part of the gradual transition to supporting most of the PEP8 standards in Pycraft.
What text editor should I use? ⌨️
Tags: programming, discuss, productivity
Published: 2022-08-14 11:33:00

> A man is as good as his tools

— Emmert Wolf

So I am gonna help you choose which text editor to use because there are so many companies selling shovels in the developer gold rush!

First, let’s see what are the choices:
In the stack overflow developer survey, those were the results ![stack overflow developer survey](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vmkrrniek5bjvttui7t4.jpeg)

So this leads us to the first question:
## **Should I use an IDE or regular text editor?**
it depends first if you were developing something like Java and you know that you’re coding in Java only it’s better to use an IDE to get access to some special developer and debugging tools that may be hard to find in a regular text editor like visuals studio code, but on the other hand, when using multiple languages using multiple IDEs will take you between a million and a quadrillion times slower. Also using an IDE can be pricey for example JetBrains if you want to use some of their IDEs you have to pay around $69 a month!! 
So now after clarifying the situation let's look at the best text editors.
### Visual Studio Code
Visual Studio Code is a free and open-source text editor. It’s built over chromium(so be rest assured that it's a memory hog) I use it and I like it because of its massive extension store and its minimal design. It’s so powerful!
### Notepad++
This editor feels like you are programming in Microsoft word but not in a bad way it’s like it’s simple there’s not that much usability for it but it’s good for a quick edit.
### Sublime Text
This is also one of my main editors are use it rarely if I want to do some quick edits or something it’s decent and it’s also good for beginners because it doesn’t have the tooling and stuff it’s just simple.
### Vim
Unlike the other three above it, I can’t say I have tried vim. I use it as a vs code extension and I like that it boosts my productivity other than that can't say anything.

So here we conclude our small little tour in the text editor world hope you liked it.
And write down in the comments what are you using!!
JavaScript addEventListener() Silly Mistake To Avoid
Tags: javascript, webdev, beginners, tutorial
Published: 2022-08-14 11:09:00

Hi there,
Using addEventListener() for handling the event is a better way. You can define the function separately, which you want to execute upon the event that occurred on your desired element.

Now you have the freedom to use that function for other elements of events, ensuring the reusability. However, some beginners tend to make a **mistake** by invoking it directly and passing it to addEventListener(). Here is an example explaining different ways and scenarios.

```javascript
const btn = document.querySelector(".btn")

//This way, if these statements are required only for this 
//Particular element event
btn.addEventListener("click", () => {
  console.log("I'm clicked")
})

//Reusable function
const reusable = () => {
  console.log("I'm reusable function for events")
} 

//Here comes the mistake, You called it directly
btn.addEventListener("click", reusable())
//"I'm reusable function for events."
//Function executed without an event occurring
//Nothing will happen on click event

//Multiple Ways to fix it

//Don't call it directly
btn.addEventListener("click", reusable)

//Returning it inside another function
btn.addEventListener("click", ()=>reusable())

//Using bind function
btn.addEventListener("click", reusable.bind(null))
```

Thanks for reading.
CSS POSITIONING BRIEFLY EXPLAINED
Published: 2022-08-14 10:52:00


Css positioning illustrates where an element is positioned in an HTML document, otherwise expressed as CSS position property which defines the top, right, bottom, left and Z-index attributes to determine where an element will be positioned finally in a document.

**_There are five types of Css position properties:_**

## **Static**
This is the default position property that comes with any given element in a document , Any given element in a specified document without a given position is said to have a default position property of static
.sub { Position: static; }

## **Relative**
 This positioning property works exactly like static but can relatively position itself by changing the Top, Bottom, Left, and Right, it makes the object move relative to its normal position if it was statically positioned

Relative positioning follows the normal document follow but can be offset using the four properties above

.sub { Position: relative; Top: 20px; Left: 50px; }

Relative positioning can also be used as a container for Absolute positioned elements.




## **Absolute**
 This positioning property completely removes itself from the document flow when used by an object or element in a document.

If an element has the Absolute positioning property, it would act like every other elements in the document does not exist

The element would render itself in the document as a static element with no parent but can be corrected by giving it the properties of Top, Right, Bottom, and Left ,For the document to be aligned with its parents in the document, the parent element has to be positioned with either of the properties Fixed, Sticky or Relative for the element to be absolutely positioned to it ( Relative is more preferred by designers.)

.main { Position: Relative; }

.sub{ Position: Absolute; Top: 0px; Left: 50px; }

_**Note**_:

- Absolute positioned usually have their Width set by default to Auto instead of its full width like a Div.

- If none of the element in the document has the Properties of either Relative, Fixed or Sticky, It looks for elements that has the Transform, Filter or Perspective properties to use as a parent container


## **Fixed**
 This positioning property is always fixed based on the entire HTML document and has nothing to do with the parents element, the element stays in the same place even when scrolling through the entire document

.sub{ Position: Fixed; Top: 0px; Left: 0px; }

## **Sticky** 
This positioning property combines the property of relative and fixed positioning into one, The values of Top, Right, Bottom and Left get active when scrolled

By Default it is Relative but when the document is scrolled, the element with the Sticky property becomes Fixed.

.sub{ Position: Sticky; Top: 0px; Left: 0px; }

**Conclusion**
This position properties has values that have so many possibilities when used in designing web pages, This properties might be quite confusing to use with some levels of difficulties to it but also lots of potential

Thanks for Reading!
How to send multiple requests parallelly in fetch hook - Nuxt
Tags: javascript, vue, nuxt, beginners
Published: 2022-08-14 10:50:00

Let's declare a method to fetch data from multiple endpoint.
```js
methods:{
// rest of your methods 
async fetchData(){
     let [res1, res2, res3] = await Promise.all(
         this.$axios.$get('api/endpoint/1'),
         this.$axios.$get('api/endpoint/2'),
         this.$axios.$get('api/endpoint/3'),
         )
     // check your response and whatever you want with those response
     console.log(res1)
     console.log(res2)
     console.log(res3)
}
```
Then you can call this method in fetch hook - 
```js
async fetch(){
      await this.fetchData()
}
```
Thank you

😎 Read more - 
* https://dev.to/siumhossain/how-to-implement-an-infinite-scroll-with-vue-and-nuxt-4d6k
* https://dev.to/siumhossain/generating-sitemap-xml-for-static-and-dynamic-from-multiple-api-endpoint-in-nuxt-js-2cij
* https://dev.to/siumhossain/vue-nuxt-remove-html-tags-from-rendered-text-for-seo-5e47
* https://dev.to/siumhossain/set-up-deploy-nuxtjs-web-application-on-ubuntu-2204-lts-2gm0
* https://dev.to/siumhossain/shortnote-redirect-and-catch-errors-in-fetch-hook-nuxt-ssr-33k2
* https://dev.to/siumhossain/how-to-detect-scroll-up-and-scroll-down-in-nuxtvue-4a3m
* https://dev.to/siumhossain/error-system-limit-for-number-of-file-watchers-reached-in-nuxt-5g2d