teleren/devto huggingface dataset:
Create a Load Balanced WordPress Website
Tags: tutorial, aws, beginners, serverless
Published: 2022-08-16 11:44:00

**| Amazon Lightsail**

Lightsail is an easy-to-use virtual private server that offers everything which is needed to build a cost-effective website with a monthly plan. This approach is suitable for prototyping and test environments as well for blogs, custom sites, and e-commerce applications. In this blog, you can explore everything about Amazon Lightsail including a business scenario to spin up a WordPress site quickly with a customized look and feel, least configuration efforts, and minimal costs.

**| Lightsail instance**
Lightsail instance is a virtual private server (VPS) that lives in the AWS Cloud. Use your Lightsail instances to store your data, run 

your code, and build web-based applications or websites. Your instances can connect to other AWS resources through both public (Internet) and private (VPC) networking. You can create, manage, and connect easily to instances right from the Lightsail console.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g00pvije09mpkk7aqdf5.png)
 


**Prerequisites**
You need to have an AWS account and some basic knowledge of working with AWS services. Following AWS services will be utilized throughout this guide.

Amazon Lightsail
Wordpress
Amazon S3
Elastic Load Balancer



**| Wordpress Website in Lightsail
**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s41biy4ygdsk6q1d5nk9.png)
 
                  Figure 1: Wordpress instance

In the Above Figure, two Wordpress instances are there with the configuration like 512MB,1vCPU etc. Also created two Static IP 
and attached with each instance.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gi7kqsvuln287g8lkvsv.png)
 
                    Figure 2 : Load Balancer

The load balancer is configured in the same region in which two Wordpress instances are launched. After that, both instances are attached to the load balancer under Target Instance. The load balancer will give one DNS name by which you can access the website and response will come from any of the Wordpress instances.

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

This is the Homepage of the website where the default hello world page is already given. All the recent posts will be shown on the menu and by clicking it you can open that particular blog.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h5f9ht7s0iv7x5hhr3vp.png)
 
              Figure 4: Wordpress's Admin Dashboard

This is the Admin dashboard of Wordpress. From here you can configure many things like Add new pages, Menus, Add necessary plugins, change the theme of the website.

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

Here's the blog of the Flutter Ebook app which is runnig on the Wordpress instance.
Textract using AWS
Tags: aws, serverless, tutorial, beginners
Published: 2022-08-16 11:27:00

AWS Textract is a document text extraction service.

“Amazon Textract is based on the same proven, highly scalable, deep-learning technology that was developed by Amazon’s computer vision scientists to analyze billions of images and videos daily. You don’t need any machine learning expertise to use it” — AWS Docs

This post will provide a walkthrough of several use cases of AWS Textract service using AWS Lambda with Python implementations. Mainly,

Extracting Text from an S3 Bucket Image.
 
 
Prerequisites
You need to have an AWS account and some basic knowledge of working with AWS services. Following AWS services will be utilized throughout this guide.

Lamda Service
Textract Service
Simple Storage Service
Identity Access Management Service


| Extracting Text from an S3 Bucket Image
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r4cxo535qk7lidbqzt3l.png)

                   Figure 1: Flow Diagram
When the user uploads the image to the S3 bucket and uploaded it successfully then the Lambda trigger will be activated and the Lambda function will call the Amazon Textract Service which will extract the text from 1mage. Textract will pass the extracted text to the Lamda. Now Lambda function will generate one text file of the same name as the Image name and write the extracted text into text document. This text file will be stored in the S3 bucket. 

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

                   Figure 2: Lambda Function

 In the above Figure, one Lambda function is created named getTextFromS3Image.With the Lambda function, the S3 bucket trigger is attached. It will activate on all objects create events with the suffix .png. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1w3hsl4rki4td3ed033k.png)

                 Figure 3:Uploading Image to S3

From the S3 bucket by clicking add files you can attach the png file and then upload it. On the completion of uploading the status will be changed to succeeded.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/22z70zwm8re159v7ssna.png)

                     Figure 4: S3 Bucket

This is the image of the S3 bucket in which I have uploaded 2 png photos for testing the Text extraction.Within 4-5 Seconds the Text file of both the png image is generated and saved as the same name of image with .txt format.
 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zd1k9ayxzqyjls8x374z.png)

                   Figure 5: Extracted Text

Here's the final output on the left side one png file is there and on the right side is the extracted text file of the image. As you can see Amazon Textract has correctly identified all the words of the image. Now you can use this text anywhere as per your need.
HRMP Channels
Tags: substrate, xcm, hrmp, parachain
Published: 2022-08-16 11:25:00

In order there are some articles about opening HRMP channels:
 
 
https://wiki.acala.network/build/development-guide/composable-chains/open-hrmp-channel
https://docs.manta.network/docs/guides/XcmOnboarding#get-the-relay-encoded-call-data-to-open-hrmp-channel
https://docs.substrate.io/tutorials/connect-other-chains/rococo-slot/
 

Also make sure that Sovereign account on relay chain has balance to run transaction: 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hz95m72ak620y3d0bn9v.png)


Note: 

To acquire ROC, join the Rococo faucet matrix channel and use the !drip <accountID> command in the faucet channel to get 100 ROC in your wallet.

Tip:

 

To Get Sovereign account - use this:
https://github.com/Manta-Network/dev-tools/blob/main/caclulate-sovereign-account/calculateSovereignAddress.ts
 

 


Here is parachain sovereign account 2000 (the AcountId32):

0x70617261 + d0070000 + 000000000000000000000000000000000000000000000000

0x70617261 = b"para" (up/down) or 0x7369626c = b"sibl" (side-to-side)

d0070000 = scale encoded number 2000

You can see the scale encoding of a u32 by typing the number into collatorSelection/setDesiredCandidates and looking at the encoded call details on the bottom right by max that is the encoded version of 2000.
enter image description here

To copy and paste:

1000: 0x70617261e8030000000000000000000000000000000000000000000000000000

2000: 0x70617261d0070000000000000000000000000000000000000000000000000000

2001: 0x70617261d1070000000000000000000000000000000000000000000000000000

2002: 0x70617261d2070000000000000000000000000000000000000000000000000000

(That's also enough examples that you could guess the rest. I do think that we need an easy way to get these from polkadot-js maybe from the parachain screen? - PRs welcome!)

If you want a normal polkadot/kusama address then you can use the "AccountId to Hex" at 
  - paste in the above on the right hand side as the hex and you will get the address calculated. For example, for 1000 parachain id it returns 5Ec4AhPZk8STuex8Wsi9TwDtJQxKqzPJRCH7348Xtcs9vZLJ
Callbacks in JavaScript
Tags: javascript, webdev, programming, namastejavascript
Published: 2022-08-16 11:10:00

Hi All,

I started with season2 of Namaste Javascript Series.
Hope, most of us are already aware of this free series on youtube by @akshaysaini. 

Today, I have completed first chapter of season2, and here are my learnings for the same.

What are callbacks.
What are the problems with callbacks.

Callbacks are the functions in JavaScript, which are heavily used to perform async operations. It can be passed as an argument to other function. Since, JavaScript is a synchronous single threaded language. To perform async operations, callbacks play a vital role.

Callbacks are powerful way to achieve async behavior, but there are some limitations with it.

0. Callback Hell
1. Inversion of control

**0. Callback Hell :** In case of callbacks, if there are multiple callbacks hierarchy i.e. nested callbacks. which leads to callback hell. And, sometime, it becomes difficult to manage, read such codes.

**1. Inversion of control :** When we pass our function to other function, we lose the control of our function. We don't know, how other function is going to use our function.

Hope this article makes sense to all the JavaScript developers. 
Please provide your inputs in comments.
Two Types of SmartContracts
Tags: blockchain, web3, eth, smartcontract
Published: 2022-08-16 11:09:03

---
title: Two Types of SmartContracts
published: true
description: general knowledge about blockchain
tags: 
  - blockchain
  - web3
  - ETH
  - smartcontract
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fgluze7u4vfqcn8jpnp7.jpeg
# Use a ratio of 100:42 for best results.
---

For blockchain technologie and web3 it is today needed to use smartcontracts. today I want to discuss two greatly differences between smartcontracts.
 1. single process contract
 2. business rule contract

##  single pricess contracts:
On public blockchains such as eth one deployed smartcontract is meaned to represent one business process. they can be used to lock in some money(eth or a currency on that blockchain) and releqse it after some condition is met.

Single process contracts can also be used to reflect ownership of some property. To do so they store a reference to the propery(art, house, car, certificate...) and a reference to the owner. depending on the usecase, the ownership can be transfered or not or only under defined conditions. 

## business rule contracts
In private or consortium blockchains business rule contracts are used. Often these blockchain systems make a distinction of two data systems. First the blockchain itself, that is holding transactions in sequential order, that order can not be changed. And second a state database.

In hyperledger fabric, the state db is defined as a key value store, and in most cases implemented using couchdb. In sawtooth the data store is a custom merkle tree that is also used like a key value store.

The smartcontract in a business rule blockchain define the rules how a business is run. technically defining methods that will update the state database and apply rules for authentication and other validations.

## implications
When learning about etherium smartcontracts, I often asked: how do I store all my data. and the answer is: you don't. One smartcontract only reflects one business process and hopefully that process is finite(has an end, even if it is far in the future).  You might give the eth contract and its methods a meaningful name, but the true meaning comes from the application that is interacting witg that contract. 

Business rule contracts can represent business processes and rules much better and more clear. however instead of defining the rules for once incident of a process, they describe the rules for the long run. This is making it much more important to reach consensus of the business rules/smartcontract. This is making it particular hard to stablish this kind of contract, not technically but organisatorial.
JavaScript Sorting Multidimensional Array
Tags: javascript, programming, webdev, productivity
Published: 2022-08-16 11:03:00

---
canonical_url: https://www.fast2learning.com/how/javascript-multidimensional-array-sorting
---
Sorting is a technique to arrange item to Increasing or Decreasing order

Sorting of item done by comparison of another item or element

## Sort Single Dimensional Array 

Single Dimensional Array have sorted by javascript sort method


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/offfigwjeeqazui2nrp7.png)
Single dimension array sorting output

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

 

## Sorting  Multidimension Array

Multidimensional array sorted using  array sort() method

Multidimensional array sorted on the basis of column index number

In below image we sort array on the basis of third column  or element ( 2 index ) of inner array   

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/78lbyjhrlf2h0zkdfbvy.png)
Output of multidimension array sorting

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tb6ki6p3se9uiyoa3p8y.png)
Learn more artical related to Web Dev also visit [fast2learning.com](https://halflearning.com)
What has really changed the way we do QA? (not what you think!)
Tags: devops, testing, qa, beginners
Published: 2022-08-16 10:29:37

What was the most important change in the way we do QA?


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

Traditionally, quality assurance would rely on thorough testing. By performing experiments with the product we would learn about product defects, which would then be prioritized and fixed. Thus, the probability that the user will experience an error will be decreased.

It does make perfect sense in an environment where the cost of failure is intolerable and recovery is not easy.

In contrast, many modern products rely on how easy and cheap it is to recover when users experience a defect. With current DevOps practices and telecommunication technologies, it is often a better choice.

Finally, both approaches are not excluding each other and can be used together.

Want to learn more about DevOps or Testing? Drop a comment with a topic you'd like to read about.
Array Methods in JS - reverse()
Tags: javascript, tutorial, beginners, webdev
Published: 2022-08-16 10:16:00

Hello Guys today i will discuss reverse() array method in javascript
reverse() method is used to reverse array elements

Example -
[1,2,3,4,5]
After reversing
[5,4,3,2,1]

Let's get started...

## Code Example 1 -
```js
const numberArray = [1,2,3,4,5];
const stringArray = ['A','B','C','D','E'];
const booleanArray = [true,true,false,true,false];
const objectArray = [
  {
  name:"Shubham",
  age:21
  },
  {
  name:"Shivam",
  age:25
  },
  {
  name:"Bharat",
  age:22
  },
]
const mixedArray = [1,2,3,"A","B","C",true,false,
{
   name:"Shivam",
  age:25
}
]



console.log(numberArray.reverse())
console.log(stringArray.reverse())
console.log(booleanArray.reverse())
console.log(objectArray.reverse())
console.log(mixedArray.reverse())
```

## Output - 
```
[ 5, 4, 3, 2, 1 ]
[ 'E', 'D', 'C', 'B', 'A' ]
[ false, true, false, true, true ]
[
  { name: 'Bharat', age: 22 },
  { name: 'Shivam', age: 25 },
  { name: 'Shubham', age: 21 }
]
[ { name: 'Shivam', age: 25 }, false, true, 'C', 'B', 'A', 3, 2, 1 ]

```

* As you can see we have reverses the arrays containing number, strings, booleans, objects and mixed.


## Code Example 2 - How to reverse a string
```js
const string = "hello"
const stringArray2 = []
for (let i of string){
  stringArray2.push(i)
}
stringArray2.reverse()
let reversedStr = stringArray2.join("").toString()
console.log(newStr)
```

## Output - 
```
olleh
```

* As you can see first we have converted the string into array with each character as an element of array then we applied the reverse() method on this array.
* After that we have used the join("").toString() to again convert the array into string again.

THANK YOU FOR CHECKING THIS POST
^^You can help me by some donation at the link below Thank you👇👇 ^^
☕ --> https://www.buymeacoffee.com/waaduheck <--

Also check these posts as well
https://dev.to/shubhamtiwari909/javascript-map-with-filter-2jgo

https://dev.to/shubhamtiwari909/e-quotes-3bng

https://dev.to/shubhamtiwari909/deploy-react-app-on-netlify-kl
Typescript Series - Readonly Utility Type
Tags: javascript, webdev, tutorial, typescript
Published: 2022-08-16 09:39:31

I'd like to start by saying that I am doing this series to learn and understand better Typescript, so feel free to correct me or contact me.

## What is the Readonly Utility Type?

`Readonly<Type>` Constructs a type with all properties of Type set to readonly, meaning the properties of the constructed type cannot be reassigned. [Docs](https://www.typescriptlang.org/docs/handbook/utility-types.html#readonlytype). 

Let's see an example of it:

```
interface Person {
  name: string;
}
 
const person: Readonly<Person> = {
  name: "Joe",
  schedule: {
    starts: "08:00",
    ends: "16:00"
  }
};
 
person.name = "Tom"; 
// Cannot assign to 'title' because it is a read-only property.
```

As you can see, the name property can't be reassigned. 

The utility type is basically doing the following:

```
interface Person {
  readonly name: string;
  readonly schedule: ...
}
```

One thing to keep in mind is that it doesn't add the readonly for nested properties. For example, it won't add the readonly to the starts type too. Additional readonly modifiers need to be added to all the nested properties.


```
person.schedule.starts = "12:00"; // This is ok 
```

But how does the Readonly Utility works under the hood ?

```
type MyReadonly<Type> = {
  readonly [Key in keyof Type] : Type[Key]
}
```

Okay, that is not too bad, let's break it down.

First we add the `readonly` keyword to every property type.

Then [`Key in keyof Type]` the keyword in means that Key has to be one of the keys extracted Type("name" | "schedule").

`Type[Key]` Finally, here we are simply accessing the type of a property. Same as how we access values in an object, let's look at the following example.


**Little side note**: 
Remember that care needs to be taken when using the Readonly utility type. It is perfect for shallow object immutability but doesn't make an array or nested object properties immutable.



Thank you!

you can find me here [My Twitter] (https://twitter.com/sarmunbustillo?t=pztqXmT7DH2pa9lDLjfrdQ&s=09)
TIL: Template Strings used with a function
Tags: javascript, webdev, programming, todayilearned
Published: 2022-08-16 09:18:00

ES6 introduced the handy Template literals that you probably use day-to-day to avoid string concatenation. 

But what you may not know is that you can parse these template literals with a function.

This feature is called [Tagged templates](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates).

The concept is simple. You can pass an interpolated template literal into a function call.
- The resulting function's first parameter is an array of the strings in the interpolated string.
- The subsequent parameters are the interpolated values.

Example.

```
const exampleFunction = (testStringsArray, interpolated1, interpolated2) => console.log(interpolated2, interpolated1, testStringsArray[0])

const value1 = "B"
const value2 = "C"

exampleFunction`A ${value1} ${value2}`

// Result is "C B A"

```

This might not be something we use day-to-day but it may be quite handy for package builders and possibly creating dynamic CSS values.

The one place that I have seen it used this in is [styled components](https://styled-components.com/), although this is in hindsight - I didn't realise I was using this feature until I recently learned about what tagged templates were!
Cost to Develop Flower Delivery App from Scratch
Tags: flowerdeliveryapp, uberforflowerdelivery, flowerdeliveryappdevelopment, ondemandapp
Published: 2022-08-16 09:08:11

Flowers have the reputation of being the best mediums for expressing different emotions of love, joy, happiness, or sorrow. They are also the perfect gifts for different occasions. It however becomes a hurdle to locate the right flower for the right occasion. It even becomes a sad affair if you find the shop closed. This is where having a flower delivery app comes in handy.

With it, customers can locate a florist nearby and get the flexibility to purchase flowers of their choice by selecting a payment mode they want. When they perform this action, they get the desired convenience to track its status and be informed when the final delivery takes place.

> The easy operations of the app have been responsible for its popularity growing manifold. Hence, the revenues are expected to become $17.02 billion by 2027.

Hence if you are operating in the florist sector and have yet not digitized it, it is crucial you do it now. Doing so will empower you with the following advantages.

## Advantages of the Flower Delivery App

1. Quick flower delivery services
2. Automate management of florist shop
3. Boost visibility for your florist shop among end customers

Hence, if you plan to digitize your florist shop with the solution, do this immediately. However, follow these steps.

## Steps to Follow When You Develop Flower Delivery App

• Conduct research well on competitor and customer requirements
• Have an idea of app operations
• Get a grasp over features that allows the app to easily perform flower delivery services
• Check the tech stack that allows robust app operations
• Connect with a flower delivery app development company offshore to get a custom Uber for flower delivery app to attain scalability and growth.

Alongside these steps, you also should have a formative knowledge of the cost to develop the flower delivery app from scratch.

If you want to know in detail about flower delivery app development steps then peep into this post: [Digitize Your Florist Business with the Flower Delivery App](https://www.peppyocean.com/blog/digitize-your-florist-business-with-the-flower-delivery-app/?utm_source=Web&utm_medium=DEV&utm_campaign=MB&utm_id=Blog)

## Cost to Develop Flower Delivery App from Scratch

Two places are recommended particularly for the task- USA and India. Hence, if you get this task done from the former, the finances will be $40 to $140 on an hourly basis. For the latter on the other hand, you would get charged $20 to $30 per hour.

However, it is important to note that the cost may vary based on the complexity of your app design, the features, and the third-party integrations you add.

Keep these points handy and be aware of these factors before you go ahead to get the app for your florist business. You can also get a grasp on this area better by reading this comprehensive guide so you can save on your finances immensely when you develop the app from scratch.

Happy Reading!!
Learn from the best Career Acceleration Programming and Latest Technologies Courses in Tamil
Tags: webdev, programming, react, javascript
Published: 2022-08-16 08:52:11

Learn from the best Career Acceleration Programming and Latest Technologies Courses in Tamil
------------------------
Learning Highlights ::-
- Language - Tamil
- Learn on your Mobile or Laptop anytime, anywhere
Click and Learn : https://maanavanlearncode.com/courses/

Contact Us:
MaanavaN Learn Code
www.maanavanlearncode.com
-- 1. Mobile : +91 80730 44127
-- Chat on WhatsApp : +91 80730 44127 / https://wa.me/918073044127
-- Email : info@maanavan.com