teleren/devto huggingface dataset:
Blog Post 13 Understanding Strings, Arrays, and Hash in Ruby
Published: 2022-03-02 18:47:21


![Confused man](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ljpanjzlzlc9jep2wej8.jpeg)As I continued to take a step back to understand Ruby more I came across Strings, Arrays, and Hash. Sometimes I feel I have to simplify the terminology for me to understand and grasp the programming language better. 

To me the term String refers to basic piece of data.  It may contain letters, numbers, or even symbols.  An example of this can be, "I love Ruby" or 'I love Ruby'.  Strings can be done by using single or double quotes as mentioned earlier.

What is an Array? It is like a container or even structure that can store multiple values.  What does that even mean? Here is an example that I used using my family members.  

family = Array["Esme", "Aria", "Crystal"] 

The container/structure in that code above is family and the names of my family members are the array elements.  

Lastly a Hash is like a collection of unique things to a specific value.  What does that even mean right? It almost acts like an array where we store pieces of information but with a Hash you can store something called key value pair.  We can store a value and give it a key which is kind of like giving it a name. For instance, using a dictionary we have a word and then the definition.  So the word is the "key" and the "value" would be the definition.  

At first I did not understand it so I had to read and watch videos to dumb it down for me.  Here is an example that helped me understand it.

states = {
       "Illinois" => "IL",
       "Puerto Rico" => "SJ"
}

Here we have the states in "key" form and the value would be the abbreviated states in two letters.  The => symbols serve as a "map" to link the "key"/state in to the "value"/letters on the right.  Seeing this multiple times has helped me understand how it works. Now applying it in a real job setting....only time will tell.
Cost Optimization Design Principles and Definition - AWS Well-Architected Framework Study Guide
Published: 2022-03-02 18:45:22

[Return to Well-Architected Framework Guide](https://dev.to/aidutcher/aws-well-architected-framework-study-guide-introduction-fjg)

[**Cost Optimization**](https://docs.aws.amazon.com/wellarchitected/latest/framework/cost-optimization.html)
- Run systems to deliver business value at the lowest price point

[**Design Principles**](https://docs.aws.amazon.com/wellarchitected/latest/framework/cost-dp.html)
- Implement Cloud Financial Management
- Adopt a consumption model
- Measure overall efficiency
- Stop spending money on undifferentiated heavy lifting
- Analyze and attribute expenditure

[**Definition**](https://docs.aws.amazon.com/wellarchitected/latest/framework/cost-def.html)
- Five best practice areas:
     - Practice Cloud Financial Management
     - Expenditure and usage awareness
     - Cost-effective resources
     - Manage demand and supply resources
     - Optimize over time

[Return to Well-Architected Framework Guide](https://dev.to/aidutcher/aws-well-architected-framework-study-guide-introduction-fjg)
RFM Analysis in Python | Simplified.
Tags: python, rfmanalysis, customersegmentation
Published: 2022-03-02 18:44:27

**An automated way to perform RFM analysis.**

In this tutorial, we will perform RFM analysis using a python library called "rfm".

- - - - - - - - - - -
We will be using [Kaggle E-commerce](https://www.kaggle.com/carrie1/ecommerce-data) dataset.

1 . Install Package using:
```
$ pip install rfm
```

2 . Read the transaction dataset:
```
>>> import pandas as pd
>>> df = pd.read_csv('~./data.csv')
# create new column for transaction amount for each record
>>> df['Amount'] = df['Quantity'] * df['UnitPrice']
```

3 . Start RFM Analysis using:
```
>>> from rfm import RFM
# this will take some time depending upon size of the dataset. 
# enter the required columns names: customerid, transaction date and amount
>>> r = RFM(df, customer_id='CustomerID', transaction_date='InvoiceDate', amount='Amount')
```

4 . See the results using:
```
>>> r.rfm_table
```

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

**Ta-Da !!! It is that simple.**

This way it automatically calculates recency, frequency, monetary values as well as rfm scores and along with their segments for you. You can save above results in memory by using pd.to_csv method.
The rfm package offers further functionalities and analytical graphs for your analysis reports for those who want it all.

**Additional Extra Features:**

1 . See the number of customers per segment or segment distribution table using:
```
>>> r.segment_table
```

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

```
>>> r.plot_segment_distribution()
```

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

Find out more:
[Medium Blog link](https://medium.com/@suresh-sonwane/rfm-analysis-in-python-simplified-f41f7cb3f344)
[GitHub](https://github.com/sonwanesuresh95/rfm)
[PyPi](https://pypi.org/project/rfm)
Day-35 Training at Ryaz : Asynchronous js
Tags: javascript, webdev, beginners, node
Published: 2022-03-02 18:33:12

- Date:2/03/2022
- Day:Wednesday

Today I started at about 10:50 am as I was done with till fifth module and was to start with sixth module so, I started with sixth module in which instructor have main agenda of Asynchronous js. Firstly he explained the difference between Synchronous and Asynchronous java script. As the name suggests synchronous means to be in a sequence, i.e. every statement of the code gets executed one by one and on other hand Asynchronous code allows the program to be executed immediately where the synchronous code will block further execution of the remaining code until it finishes the current one.and after this he explained with callbacks in node js as he explained that callbacks are function called at the completion of a given task or assigned task.and after this he explained about promises in node js i.e promises are action which will either be completed or rejected.so, today I was able to cover this much I am left with Async and await part and exercise of sixth module. so, this way today I was able to learn many new things.
The Angular Mini-Book 2.0 is now available!
Tags: angular, typescript, springboot, minibook
Published: 2022-03-02 18:28:21

---
title: The Angular Mini-Book 2.0 is now available!
published: true
description: The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it.
tags: angular, typescript, springboot, minibook
canonical_url: https://raibledesigns.com/rd/entry/the_angular_mini_book_2
cover_image: https://pbs.twimg.com/profile_banners/1457165600690745344/1637522193/1500x500
---

<p>I'm pumped to announce that the Angular Mini-Book 2.0 has been released! You can <a href="https://www.infoq.com/minibooks/angular-mini-book-v2/">download it in PDF and EPUB formats from InfoQ</a>.
<p>
<a href="https://www.infoq.com/minibooks/angular-mini-book-v2/" data-href="https://www.flickr.com/photos/mraible/51687063929/" title="Angular Mini-Book Cover"><img srcset="https://live.staticflickr.com/65535/51687063929_f89f0e0f71_n.jpg 480w, https://live.staticflickr.com/65535/51687063929_f89f0e0f71_n.jpg 800w" sizes="(max-width: 600px) 480px, 800px" src="https://live.staticflickr.com/65535/51687063929_f89f0e0f71_n.jpg" class="picture" alt="Angular Mini-Book Cover"></a>
</a>
<h3>About this book</h3>
<p>The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication. </p>
<p>
Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy. What about deploying your Angular app to the cloud? Yep, it covers that too!
</p>
<h3>What's new?</h3>
<p>This new edition (2.0) uses Angular 13 and Spring Boot 2.6. Some other fun facts:<p>
<ul>
<li>First commit on 2.0 version: Nov 19, 2021 { <em>Thanks to <a href="https://jamesward.com/">James Ward</a> for his help upgrading to Knative 1.0!</em> }</li>
<li>Upgraded the book's project to use Gradle 7: Dec 2, 2021 { <em>I appreciate you <a href="https://twitter.com/Mogztter">Guillaume Grossetie</a>!</em> }</a>
<li>Upgraded to Angular 13 and Spring Boot 2.6.1: Jan 7, 2022</li>
<li>Detailed QA of all the code: Jan 27 - <a href="https://twitter.com/mraible/status/1491856038085251082">Feb 10, 2022</a></li>
<li>Files changed since 1.0: 244</li>
<li>Build date: Feb 17, 2022</li>
</ul>

<p>For more information about this book, please read <a href="https://raibledesigns.com/rd/entry/the_angular_mini_book_1">my post about its 1.0 release</a>.</p>
<p>
<p>To send us feedback or issues, e-mail InfoQ at feedback@infoq.com, email me at matt@raibledesigns.com, or hit me up on Twitter <a href="https://twitter.com/mraible">@mraible</a>.</p>
Golang: go get package from your private repo in Gitlab
Tags: go
Published: 2022-03-02 18:26:02

We can use `go get` to install a module from our private repo.

Say we have a private repo `gomath` that is hosted in gitlab under url: https://gitlab.com/yourname/gomath:

File `math.go`:

```go
package gomath

func Double(a int) int {
    return a * 2
}
```

Now in your other Go module you want to install this package, you need to do 2 things:

1. Set the `GOPRIVATE` env variable
2. Set `git config` to let git know your personal access token in gitlab. You can get the token from gitlab > preferences > Access Tokens. Make sure your token has the "read_repository" scope.

File `config.sh`:

```bash
#!/usr/bin/env bash

go env -w GOPRIVATE=https://gitlab.com/yourname/gomath

git config \
  --global \
  url."https://<yourname>:<personal access token from gitlab>@gitlab.com".insteadOf \
  "https://gitlab.com"
```

Run this script: 
```bash
$ bash config.sh
```

Now under your Go module, you can just use `go get` like normal:

```bash
$ go get https://gitlab.com/yourname/gomath
```

Then use it in `main.go`:

```go
package main

import (
    "fmt"

    "gitlab.com/yourname/gomath"
)

func main() {
    num := 2
    result := gomath.Double(num)
    fmt.Println("result:", result)
}
```
How to make a sleep function in JavaScript with async await

Tags: javascript, tutorial
Published: 2022-03-02 18:19:02

In this video I’m going to show you how you can add a sleep function in JavaScript. Languages like .net, python and java have a method called sleep. This allows a method to pause and wait for a certain amount of time and then continue execution of its code. JavaScript does provide a setTimeout method where you can pass a function to execute after a certain amount of time. However with the addition of async and await in javascript we can write this solution in a more elegant way.

This is the solution used in the video:

`async function sleep(seconds) {
  return new Promise((resolve) =>setTimeout(resolve, seconds * 1000));
}`

{%embed https://youtu.be/N8ONAZSsx80 %}
Javascript DOM manipulation cheatsheet
Tags: javascript, beginners, tutorial, programming
Published: 2022-03-02 17:56:57



The Document Object Model (referred as the DOM) is the means that allowed developers to add interactivity to their websites, DOM is an essential part to learn to be a good javascript developers so today i'll give a cheatsheet to master the manipulation of the DOM

## Prerequisite
This post is intended to be a refresh so i expect you to know the basics  of javascript as well as basic knowledge of what the DOM is all about.

## Creating elements

```javascript
const element = document.createElement('element')
parentElement.appendChild(element)

const div = document.createElement('div')
body.appendChild(div)

const ul = document.createElement('ul')
const li = document.createElement('li')
ul.appendChild(li)

```

## removing elements
- you can remove an element either by using `removeChild` or with `remove` methods
```javascript
// with removeChild method
parent.removeChild(child)
// with remove method
child.remove()

ul.removeChild(li)
// or
li.remove()

```

## Querying elements

- query an element that has an id
```javascript
const element = document.getElementById('elementId')

const container = document.getElementById('container')
```

- query **all** elements by tag name (there is no similar method to find only one element by tag name)

```javascript
const groupOfElements = document.getElementsByTagName('tag')

const inputs = document.getElementsByTagName('input')
```

- All in one
```javascript
// query by id
const element = document.querySelector('#elementId')

// query group of elements by id (which ignores the purpose of having a special id)
const elements.querySelectorAll('#elementId')

// query element by class name
const element = document.querySelector('.className')

// query group of elements by class name
const elements = document.querySelectorAll('.className')


```

## Modify elements

- modifying element's attributes

modifying the style object
```javascript
element.style.fontSize = "18px"
element.style.backgroundColor = "#ffffff"
```

 modifying the id:
 ```javascript
element.id = "myId"
```

modifying the class
```javascript
element.classList.add('myClass')

element.classList.remove('myClass')
```

- modifying the text
```javascript
const element.innerText = "Hello World"
```
There is also `textContent` property for this job, However you would rather use `innerText`instead.

- modifying the attribute in general
```javascript
element.setAttribute(attribute, value)

input.setAttribute(name, "myInput")

element.removeAttribute(attribute)

input.removeAttribute('name')
```

## Event Listeners
Here is a list of the popular events you'll likely to use: `change`, `click`, `submit`, `keydown`... and [more](https://www.javatpoint.com/javascript-events)

```javascript
element.addEventListener('event', () => {
// Do something...
}

button.addEventListener('click', () => {
alert('Hello There!')
}
```

## Conclusion

If this post was helpful for you i would appreciate it if you leave a 💓
WordPress Bible Membership - Learn, Build And Sell Websites
Tags: wordpress, productivity, website, programming
Published: 2022-03-02 17:56:48

Hi 

Very few things have disrupted the digital marketing scene as greatly as WordPress has in the last decade.

Thanks to the platform’s free and simple content management system made it possible for anyone, regardless of levels of technical knowledge, to create impressive websites.

This possibility is boosted further by the seemingly endless library of themes and plugins.

Thus, makes it possible even for small businesses to compete with large, global companies that enjoy massive marketing budgets.

Therefore to help you get started, we had put together all the resources and created a ground-breaking “WordPress Bible” HD Video Training Course that will provide you the all the essential tips about how to use WordPress to increase your site profits.

Take a Look at what you are going to get inside…

Module #1 – Learning WordPress Basics

Module #2 – Mastering WordPress

Module #3 – Building Landing Pages With Elementor

Module #4 – Building Ecommerce Sites

Module #5 – Building Membership Sites

Module #6 – Building LMS Sites

Module #7 – Make Money With WordPress

And so much more… (133 Video Tutorials In TOTAL)

==>It’s One of a Kind Training Course, Check it out Yourself…(Insert Your Affiliate URL)

Here are just a few reasons why WordPress Bible Premium Membership is intrinsic for any business’ growth and success:

[+] WordPress has a 60.8% market share in the CMS market
[+] WordPress powers 14.7% of the world’s top websites
[+] 500+ sites are built each day using WordPress while only 60-80 per day are built on platforms like Shopify and Squarespace
[+] The WordPress Plugin Directory features 55,000+ plugins
[+] WooCommerce powers 22% of the top 1 million ecommerce sites in the world

And these facts understate the blooming popularity of WordPress.

Surely, by now you are jumping on your seats to get your hands on this Exclusive “WordPress Bible Premium Membership” HD Video Training course…..

So without much ado, let us present A Key to your Success.

==>Book your copy of this Training.. click here 
https://tinyurl.com/mr2kx3cd

Sincerely,

Sudhanshu Kumar



-
25 Algorithms that all developers should know
Tags: javascript, career, beginners, programming
Published: 2022-03-02 17:44:46

**Searching Algorithms**
1. Linear search
2. Binary search
3. Depth first search 
4. Breath first search

**Sorting**
1. Insertion sort
2. heap sort
3.Counting sort
4. merge sort
5. selection sort
6. Quick sort

**Graphs**
1. Kruskal's Algorithm
2. Les Algorithm
3. Dijkstra's Algorithm
4. Bellman Ford Algorithm
5. Floyd Warshall Algorithm
6. Topological sort Algorithm
7. Flood Fill Algorithm

**Arrays**
1. kadane's Algorithm
2. Floyd's Cycle detection Algorithm
3. KMP Algorithm
4. Quick select Algorithm
5. Boyer - more majority vote Algorithm

**Basics**
1. Huffman Coding Compression Algorithm
2. Euclid's Algorithm
3. Union Find Algorithm
What is your best FREE resource to learn ReactJS?
Tags: javascript, webdev, discuss, react
Published: 2022-03-02 17:41:34

I'm currently learning ReactJS but I'm hopping from a resource to another. First, I started by reading through React's step-by-step series on its website, but as I reached lesson #5 things started to confuse me a lot, and since the lessons don't have more than 1 example per concept, I was getting lost easily.

I then found a 2-hour React course on Youtube, I started watching it, but as I reached minute 53 I got lost again. 

The issue I think with me that I'm used to think about every element as object, so that when I encounter JSX syntax I get lost because I don't know how this actually works as normal JS objects.

I went through the transpiled JSX code btw, and I found it interesting, and **I was able to write React code without JSX at all**. But still the issue... How to learn React? What's your best resource to do so?
VSCode on Android (you don't need to install anything)
Tags: tutorials, webdev, vscode, android
Published: 2022-03-02 17:32:32

---
title: VSCode on Android (you don't need to install anything)
description: Since my baby girl was born I don't have the time to use my computer because I'm taking care of her and I only have a short period of free time during the day. So I needed to use my Android smartphone to create and update [my blog](https://renanfranca.github.io?utm_source=dev.to&utm_medium=social&utm_campaign=promote-blog).
published: true
tags: #tutorials #webdev #vscode #android
canonical_url: https://renanfranca.github.io/2022/03/02/vscode-on-android.html
series: My ❤️ VsCode Experience
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h7474rzxb7d9zgwb47sk.jpeg
---

Since my baby girl was born I don't have the time to use my computer because I'm taking care of her and I only have a short period of free time during the day. So I needed to use my Android smartphone to create and update [my blog](https://renanfranca.github.io?utm_source=dev.to&utm_medium=social&utm_campaign=promote-blog).

When you click on the JHipster link at my blog home page, It will open the JHipster site onto a new tab:
{% embed https://youtu.be/w44NP26Fhhc %}

If you have a repository at github, you can access the [VSCode web](https://github.dev) version by replacing the **.com** with **.dev**. 

After that, your github repository will be opened at a functional VSCode web version and each commit automatically push the change to de repository.

As an example of the use VSCode on Android I will remove the target _blank from the JHipster link at home:
{% embed https://youtu.be/bKEt4L-1pw4 %}

Once the repository was changed, [the github action](https://dev.to/entando/get-started-with-github-actions-1gde) (by @@avdev4j ) will update my blog and the JHipster link will open at the same tab:
{% embed https://youtu.be/SJh-J0EgXFg %}

I used VSCode to easily navigate through my repository files, I used the search/replace, change files folder and rename. It helped me a lot!

In my opinion, VSCode for Android isn't a smooth experience and it's hard to hit the spot you want to change at code.

If you have any questions or just want to say something, please, use the comment section 😊
Simplified Next.js, The modern React.js Framework #1
Tags: react, nextjs, webdev, beginners
Published: 2022-03-02 17:24:40

# Getting started

In this series of posts, I will be teaching you. How to easily start learning Next.js. By simplifying the learning process, being super practical and avoiding over-technical terms.

I hope you, like it. And give it a try, maybe you will discover something awesome and fall in love with this modern React.js Framework .🐱‍👤💕

To begin with, execute the following command on your terminal:

`npx create-next-app@latest`

Or:

`yarn create next-app`

After the installation finish, go to the folder you created and open it on your favorite IDE. Then execute the following command, to start the development server.


`npm run dev`

And voilà, you just begin using Next.js 🎉🎉✨

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

If you want to begin personalizing your views.

## Go to Pages/index.js
There you will see your home page component with some Next.js extra info.

By the way, by putting 👉👉.js👈👈, files into Pages/, folder. You automatically are using built-in Next.js routing, so YOU DON´T REQUIRE REACT-ROUTER-DOM INSTALLATION AND CONFIGURATION.

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

Here you have it. 🙇‍♂️👇

1. Create about.js into Pages/ and write some test data, like Hello World! From About File.
2. Then go to your browser and type, in your URL bar, localhost:3000/about.
3. Then you will be able to see automatically your about.js info displayed in your browser.

Well, this is the end of the first part 😭😫, If you would like to support my content go to: [BuyMeACoffee](buymeacoffee.com/MarioLemusDev), and buy me a coffee! 😁😁👌🙌
Difference between Web 2.0 and Web 3.0
Published: 2022-03-02 17:07:23

Web 2.0 pertains to websites that emphasize user-generated content, usability, and interoperability for end users all over the world. 
The participative social web is another name for Web 2.0. It does not refer to a change in a technical definition, but rather to a change in the way Web pages are built and used. The transition is advantageous, although it does not appear to be the case when the changes occur. 
Web 2.0 allows users to interact and collaborate with one another in a social media dialogue as creators of user-generated content in a virtual community.
AJAX and JavaScript frameworks are among the web browser technologies that are employed in Web 2.0 development.

Where as, Web 3.0 is a catch-all term that encompasses a variety of web usage and interaction evolutions. Data isn't owned in this case; instead, it's shared, with multiple views for the same web / data being displayed by different services.
It involves the embedding intelligence throughout the web and deploying robots to make decisions on the user's behalf. It is concerned with the establishing a uniform standard for websites to express content so that any computer program can comprehend the semantic meaning given by the web page.

Ref: [Blockgames](www.blockgames.gg), [ZuriTeam](www.zuri.team), [Nestcoin](www.nestcoin.com)