teleren/devto huggingface dataset:
RASA - Rasa X
Tags: rasa, chatbot, nlp, ai
Published: 2021-04-15 07:17:33

> Rasa X is a tool for Conversation-Driven Development (CDD), the process of listening to your users and using those insights to improve your AI assistant.

## Installation
Make sure you have your python virtual environment activated (`source venv/bin/activate`).
To install Rasa X locally, run the following in your project root:
```bash
pip install rasa-x --extra-index-url https://pypi.rasa.com/simple
```

Update the `requirements.txt` after the installation.
```bash
pip freeze > requirements.txt
```

You can learn more about installing Rasa X in the [documentation](https://rasa.com/docs/rasa-x/installation-and-setup/installation-guide).

## Starting the server
Start the server by running `rasa x`.
This will open a browser tab on http://localhost:5002 with Rasa X GUI.

![Rasa X](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fwdf8chfu1zrdo8cyg2q.png)

## Capabilities of Rasa X
* You can talk to your chatbot. While you are talking, a story and test story is being generated for you. You can also observe what intents have been recognized, with what accuracy, what is the current active_loop, which slot is being filled in etc. You can save the generated story. This is much more convenient than writing the story yourself.
* You can see and review past conversations.
* You can tag and filter past conversations.
* You can correct chatbot's decisions.
* You can edit all the files we have been working with so far.
* There's so much more Rasa X is capable of! I encourage you to launch the server and start discovering by yourself.

You can learn more about Rasa X in the [documentation](https://rasa.com/docs/rasa-x/).

You can read more about Conversation-Driven Development on [Rasa blog](https://blog.rasa.com/conversation-driven-development-a-better-approach-to-building-ai-assistants/) or in [The CDD Playbook](https://info.rasa.com/cdd-playbook)

In the next chapter, we will look at categorical slots.

Repository for this tutorial:
{% github petr7555/rasa-dev-tutorial no-readme %}

You can checkout the state of the repository at the end of this tutorial by running:
```bash
git clone --branch 08-rasa-x git@github.com:petr7555/rasa-dev-tutorial.git
```
Increase Productivity with custom google chrome search engines
Tags: chrome, productivity
Published: 2021-04-15 07:17:23

As a programmer, I spend a lot of my time searching through web-based software such as JIRA, Bitbucket, and Github. 

On a day-to-day basis, I'll be looking up tickets by their reference numbers. Why? Why can't I just get these tickets off of the current sprint board? 
Well, I don't know about you, but I'll be in the middle of a ticket, and a tester, business analyst, or product owner will drop me a message asking about XYZ-999. 

What on earth was XYZ-999? I've managed to save a large amount of time by introducing custom search engines into google for simple tasks as quickly searching for a ticket reference. 

Or even just looking up active pull requests or trying to find some documentation on confluence.

In this short article, I'll share how I go about doing this so that you can save yourself some time, sure it's 20-30 seconds here or there, but that adds up over a year. 

## Adding a custom search engine to Chrome
Open Chrome and right-click the address bar, and click `Manage search engines...`

Click the add button. Under the section `other search engines`, a small popup will show with 3 form fields to fill in.

```
Search Engine:
Keyword:
URL with %s in place of query
```

Fill this in with the info about your search engine. For example, confluence my be something like:

```
Search Engine: Wiki
Keyword: wiki
URL: https://<company>.atlassian.net/wiki/search?text=%s
```

## How to use a custom search engine
Once you've added a custom search engine, you can use it by clicking on the address bar and using the keyword, followed by a space, then the text you want to search for, then press enter.

`wiki which badger danced the best duck?<enter>`

## Examples from my uses
```
Search Engine: Jira
Keyword: jira
URL: https://<company>.atlassian.net/browse/ref-%s
```

```
Search Engine: BBPRs
Keyword: bbpr
URL: https://bitbucket.org/<company>/<repo>/pullrequests/%s
```

```
Search Engine: Gihub_ProjectPRs
Keyword: ghppr
https://github.com/<company>/<project>/pulls
```


```
Search Engine: Gihub_AllPRs
Keyword: ghapr
https://github.com/pulls
```
## Wrap Up

This has been a very short post, but it is what it says on the tin, a very simple post showing you an easy tip to make searching GitHub, Jira, etc., much easier.
Cheat sheets. Use them.
Tags: cheatsheets, css, javascript, html
Published: 2021-04-15 07:06:57

The most productive thing I did today was to start implementing cheat sheets. I knew about these sheets but for whatever reasons I hadn't been using them while I was working on projects. Today I made a bookmark folder named CheatSheets and started throwing some of my favorites in there. 

<h2>Here are a couple:</h2>
https://www.thinkful.com/blog/web-developer-cheat-sheet/
This is Thinkfuls Ultimate Cheat Sheets for Web Developers. Tons of helpful cheat sheets.

https://htmlcheatsheet.com/

Let me know down in the comments any of your favorite cheat sheets.
Front-End MicroService Architecture
Tags: microservices, vue, nuxt, javascript
Published: 2021-04-15 06:51:51

Whenever I read about MicroService Architecture, it was for the back-end but today I will explain how to implement this architecture in the front end.

###What should be considered as Service?

The first principle about microservice architecture indicates that each service should be independent of others so the first step is to separate independent parts of our front-end. One of the good approaches that we can separate our independent parts is considering layouts.

For example, consider a simple shopping website. Most authentication layouts including login, register, forget the password, etc differ from the home page so authentication pages could be considered as one of our services. 

We will create a new Nuxt project which has the below pages:
(all are under /auth scope)
- /login
- /register
- /forget-password
- /confirm-email

We will create another Nuxt project that has other pages of our shopping such as home page, basket, product, categories, etc.

Up to here, we were able to decomposite our front-end into two services still we can move one more step forward and consider all pages under profile scope to be another service so we will create a new Nuxt project including the below pages:
- /orders
- /orders/view/:id
- /addresses
- /addresses/:id
- /info
- /info/update

###How to run 3 projects?

At this point, we have 3 Nuxt projects that could be developed by different people and we need a parent router to keep these projects under one HTTP server and allocate requests to the project based on defined routes.

For example, when the browser hits

``` http://127.0.0.1:3000/auth/login ```

the router will assign this request to the first Nuxt project and when the URL is

``` http://127.0.0.1:3000/profile/orders ```

the outer will give this request to the last Nuxt project to handle it.

*I'm developing this router and after publishing at npm I'll write a new post to explain how to use it*

###Advantages
- you won't face the memory leak of watching a large number of files in development.
- services could be in development or production mode independently 
- each service has its own assets
- better teamwork experience
- work one service A while others are in production mode and running.

###Disadvantages
- If you don't have a different layout it is useless
- Based on the UI, maybe you have repeated components in different services
- Maybe you have repeated peace of codes or functions (i.e function to generate random int between 2 number)

###Final Notes
Implementing microservice architecture is recommended IF your project is on a large scale.

Thanks for your reading, It's just architecture and how to implement it.

here is the [part II](https://dev.to/ifarhad/implement-nuxt-vue-micro-service-1oo1) (implementing in nuxt project)
Any comments or criticisms are welcome
Day 32 of 100Days OF SwiftUI
Tags: swift
Published: 2021-04-15 05:57:55

I just completed day 32 of 100 days of SwiftUI. Today, I learnt about animations in SwiftUI.

Since SwiftUI is a state-driven UI framework, SwiftUI animates the changes between the state of views.
There are two categories of animations in SwiftUi: Implicit and explicit animations. 

Implicit animations are done using the animations modifier. They are used to animate views based on changes in state property.

```swift
struct ContentView: View {

     @State private var animationAmount: CGFloat = 1

        var body: some View {
            Button("Tap Me") {
                self.animationAmount += 1
            }
            .scaleEffect(animationAmount)
            .animation(.default)
       }
    }
}
```
The code above makes a button bigger whenever a user taps. It also animates the transition with the animation modifier. As you can see we don't explicitly say when to start or stop the animation. Everything is handled by SwiftUI.

Explicit animations give you more control over what changes you want to animate. You can do this using `withAnimation` closure. 

```swift
struct ContentView: View {
    @State private var opacity = 1.0

    var body: some View {
        Button("Press here") {
            withAnimation {
                opacity -= 0.2
            }
        }
        .padding()
        .opacity(opacity)
    }
}
```
LeetCode 1396. Design Underground System
(javascript solution)
Tags: algorithms, javascript
Published: 2021-04-15 05:46:58

###Description:
An underground railway system is keeping track of customer travel times between different stations. They are using this data to calculate the average time it takes to travel from one station to another.

Implement the UndergroundSystem class:

void checkIn(int id, string stationName, int t)
A customer with a card ID equal to id, checks in at the station stationName at time t.
A customer can only be checked into one place at a time.
void checkOut(int id, string stationName, int t)
A customer with a card ID equal to id, checks out from the station stationName at time t.
double getAverageTime(string startStation, string endStation)
Returns the average time it takes to travel from startStation to endStation.
The average time is computed from all the previous traveling times from startStation to endStation that happened directly, meaning a check in at startStation followed by a check out from endStation.
The time it takes to travel from startStation to endStation may be different from the time it takes to travel from endStation to startStation.
There will be at least one customer that has traveled from startStation to endStation before getAverageTime is called.
You may assume all calls to the checkIn and checkOut methods are consistent. If a customer checks in at time t1 then checks out at time t2, then t1 < t2. All events happen in chronological order.



```javascript
class UndergroundSystem {
    // class constructor
    constructor() {
        // check ins are of type {id : {checkIn time, station name}}
        this.checkIns = {};
        // trips are of type {route : [full elapsed times]}
        this.trips = {};
    }
	
    checkIn(id, stationName, t) {
        // log check in
        this.checkIns[id] = {
            t: t,
            stationName: stationName,
        };
    }
	
    checkOut(id, stationName, t) {
        // create route string
        const route = this.checkIns[id].stationName +
            '=>' +
            stationName;
        // check if this route is not in trips obj yet
        if (!(route in this.trips))
            this.trips[route] = [];
        // push elapsed time to route: trips
        this.trips[route].push(t - this.checkIns[id].t);
    }
	
    getAverageTime(startStation, endStation) {
        // create route string
        const route = startStation + '=>' + endStation;
        // running sum
        let sum = 0;
        // iterate thru all elapsed trip times for this route
        for (let i = 0; i < this.trips[route].length; i++) {
            // add to running sum
            sum += this.trips[route][i];
        }
        // return avg
        return sum / this.trips[route].length;
    }
}
```
LeetCode 1200. Minimum Absolute Difference
(javascript solution)
Tags: algorithms, javascript
Published: 2021-04-15 05:34:46

###Description:
Given an array of distinct integers arr, find all pairs of elements with the minimum absolute difference of any two elements. 

Return a list of pairs in ascending order(with respect to pairs), each pair [a, b] follows

a, b are from arr
a < b
b - a equals to the minimum absolute difference of any two elements in arr

###Solution:
Time Complexity : O(n)
Space Complexity: O(n)

```javascript
var minimumAbsDifference = function(arr) {
    const ans = [];
    // Put smallest numbers first
    arr.sort((a, b) => a - b);
    // minDiff should be changed on the first iteration
    let minDiff = Infinity;
    for (let i = 1; i < arr.length; i++) {
        // The new minDiff changes if the current diff is smaller
        minDiff = Math.min(minDiff, arr[i] - arr[i - 1]);
    }
    for (let i = 1; i < arr.length; i++) {
        // Push all pairs that equal the minDiff into ans
        if (arr[i] - arr[i - 1] === minDiff) ans.push([arr[i - 1], arr[i]]);
    }
    return ans;
};
```
Create the first phpunit test
Published: 2021-04-15 05:27:46

>Note: phpunit9 doesn't support php8^, it compatible with php7.4

* clone the repo: https://github.com/pcreem/psr-4Autoload
* install phpunit 
`$composer require --dev phpunit/phpunit ^9`
 
```
$./vendor/bin/phpunit --version
PHPUnit 9.0.0 by Sebastian Bergmann and contributors. 
```
* `$code composer.json`
```
{
    "autoload": {
        "psr-4": {
            "App\\":"App/"
        }
    },
    "require-dev": {
        "phpunit/phpunit": "^9"
    }
}
```
* `$code App/Data/Database.php`
```
<?php
namespace App\Data;

class Database {
    public function sayHi()
    {
        return 'create database\n';
    }
} 
```

* `$code tests/DatabaseTest.php`
```
<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;
use App\Data\Database;

final class DatabaseTest extends TestCase
{
    public function testCanCreateDatabase(): void
    {
        $database = new Database();
        $this->assertSame('create database\n', $database->sayHi());
    }
} 
```

* `$./vendor/bin/phpunit --testdox tests`

>output
```
PHPUnit 9.5.4 by Sebastian Bergmann and contributors.

Database
 ✔ Can create database
the init

Time: 00:00.006, Memory: 4.00 MB

OK (1 test, 1 assertion)
```

repo: https://github.com/pcreem/theFirstPhpUnitTest
How did you improve your communication skills?
Tags: career, discuss
Published: 2021-04-15 05:26:14

Hi there, its Bruno.

We all know how important it is to be able to communicate clearly and directly. This in fact goes to any field, not only software development.

I have seen several times now the situation where the well respected/higher in the ladder was the person who was clearly a good communication, as opposed to the one who had a very good technical knowledge and even worked more hours.

I would like to hear from you what are the steps you have taken to improve on it? Books? courses? training?

am I the only one who thinks *half* of the arguments are won by the person who speaks with the most confidence?
jenkins docker nginx proxy run
Tags: jenkins
Published: 2021-04-15 05:20:08

## 1 前提
linux环境
* docker运行环境
* nginx运行环境
* 准备maven安装目录放到/opt/jenkins_docker/maven3
* 新建宿主机映射目录 /opt/jenkins_docker
* 准备nodejs安装目录放到  /opt/jenkins_docker/node-v14.16.1
## 2 docker运行
 docker方式运行命令如下：
```
docker run -d -p 28080:8080 --restart=always \
-p 10241:50000 \
-v /opt/jenkins_docker:/var/jenkins_home \
-v /etc/localtime:/etc/localtime:ro \
-v /opt/jenkins_docker/maven3:/usr/local/maven3  \
-e TZ=Asia/Shanghai \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(which docker):/usr/bin/docker \
-v /opt/jenkins_docker/node-v14.16.1:/usr/local/nodejs \
--name myjenkins jenkins/jenkins
```
各个参数的含义：

* -d 后台运行
* -p 28080:8080 对外暴露28080端口，防止端口冲突
* --restart=always 在容器停止运行的时候，重启容器。用于开机自启和容器意外关闭时的自启动
* -v /opt/jenkins_docker:/var/jenkins_home 将宿主机的 /home/jenkins-data 目录挂载到 /opt/jenkins_docker
* -v /etc/localtime:/etc/localtime:ro 保证docker中的时区和宿主机一致
* -e TZ=Asia/Shanghai  保证docker中的时区和宿主机一致
* -v /opt/jenkins_docker/maven3:/usr/local/maven3  maven
* -v /var/run/docker.sock:/var/run/docker.sock  容器与Docker守护进程通信
* -v $(which docker):/usr/bin/docker  容器与Docker守护进程通信
* -v /opt/jenkins_docker/node-v14.16.1:/usr/local/nodejs nodejs运行目录映射

## 3 nginx代理
```
  location / { 
    # 反向代理到 gitlab 内置的 nginx 
    proxy_pass http://10.19.42.165:28080; 
    proxy_set_header Host $Host:8080; 
    proxy_set_header X-Real-IP $remote_addr; 
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
  }
```
## 4 配置全局环境
 jenkins 镜像中已经包含了jdk和git，在配置jenkins全局环境需要把路径找出来，配置下路径即可

先进入 jenkins 的容器中
```
docker exec -it jenkins容器id /bin/bash
```
jdk

echo $JAVA_HOME
路径在/usr/local中，然后配置进 jenkins 的 JAVA_HOME 中即可

git
```
which git
```
文件路径为/usr/bin/git，把这个复制到 jenkins 路径中

mvn 在运行时已经指定
```
/usr/local/maven3
```
dokcer 在运行时已经指定
```
/usr/bin/docker
```
nodejs 在运行时已经指定
```
/usr/local/nodejs
```
To activate facebook account, users can dial the FB helpline number
Published: 2021-04-15 04:52:38

Users of FB account sometimes face issues on how to activate facebook account. Whenever you’re facing this kind of glitch, you can rely on our FB technical support team. With us, it becomes easy to rectify the technical troubles with ease. So, ask your problems with our techies for quick solutions. https://www.contactmail-support.com/blog/how-to-process-activate-facebook-account/
Did you send the wrong payment? Get cash app refund
Published: 2021-04-15 04:50:31

No matter whether your cash app account showing money the pending or you are unable to use your cash app or if you send or transfer the money to the incorrect person then any time users can get the cash app refund. If you are facing any type of issue with your cash app account and instant want to get the solution then you can contact our customer support executive. https://www.primotechy.com/blog/how-to-place-cash-app-refund-request/
Strategic Digital Marketing Training
Tags: digitalmarketingtraining, internetmarketingtraining, digitalmarketingcourse, digitalmarketinginstitute
Published: 2021-04-15 04:33:33

Indian Digital Academy (IDA) is the best institute for Digital Marketing Training in Hyderabad KPHB, Kukatpally. Are you looking for Strategic Digital Marketing Course in Hyderabad? we are here to provide the course. IDA is the best institute which offers Strategic Digital Marketing Training in Hyderabad. We offer 10 Modules ( 1. Digital Marketing overview, 2. Website Planning & Creation, 3. Content Marketing, 4. Search Engine Optimization, 5. Google Analytics, 6. Search Engine Marketing, 7. Social Media Marketing, 8. YouTube Marketing, 9. E-Mail Marketing, 10. Lead Generation for Business). This Strategic Digital Marketing Course Duration is 45 Days, Everyday 1.5 hours of training. This institute is located in KPHB colony, Kukatpally.
How I Choose CMS or SSG For A Website
Tags: cms, ssg
Published: 2021-04-15 04:26:56

---
title: How I Choose CMS or SSG For A Website
published: true
description: thinking about best choices of creating a website
tags: CMS, SSG
//cover_image: https://direct_url_to_image.jpg
---
CMS and SSG are great. But when to choose which?

First of all, **CMS** stands for Content Management System such as WordPress and Joomla. **SSG** stands for Static Site Generator.

CMS has more functionality than SSG. So use SSG to build information website like [**UPVC**EG](https://upvceg.com/en/index.html). But if you want to have dynamic functionalities like comments and search use CMS like WordPress like [value in brief](https://www.valueinbrief.com/) website.

The main feature of CMS is being dynamic and editable by the users. And The main feature of SSG is being static and just show information without interaction or being editable at all.

But there is workarounds for searching SSG websites, for example [tailwindcss](https://tailwindcss.com/docs) website using _algolia_ search.

If a company reached out to me to create a website, I put all the features they want. If the website is achievable using SSG, I'll do it. If not, I'll just use a CMS.

## Why I prefer SSG over CMS ?

Static Site Generators (SSG) such as HUGO have too many merits to count. Here are some.
1. speed and efficient.
2. use less CPU and time.
3. super lightweight.
4. highly secure, because you can not edit it on the fly.
5. highly reliable, and can not be DoS-ed easily.
6. Cost effective; need a low end hosting provider.
7. Get the job done. It satisfies the business needs.

That's how I choose a system to build a website at hand. Almost every time I choose SSG, likely [Hugo](https://gohugo.io/).
List of Visual Tools to help with Data Structures and Algorithms
Tags: programming, webdev, beginners, computerscience
Published: 2021-04-15 03:50:06

As a self-taught dev, it is a little intimidating and overwhelming to learn Data Structures and Algorithms (DSA) with no prior computer science experience. However, after going through [this](https://www.udemy.com/course/data-structures-algorithms-javascript/) course, I realized that DSA basics are not that difficult to understand if explained visually.

I went down the internet rabbit hole and found a few completely free DSA resources that try and explain these concepts visually.

#### 1. [DSA roadmap](https://coggle.it/diagram/W5E5tqYlrXvFJPsq/t/master-the-interview-click-here-for-course-link/c25f98c73a03f5b1107cd0e2f4bce29c9d78e31655e55cb0b785d56f0036c9d1)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0k7g5u6analbc5lvbsvw.png)

This is a great roadmap that displays important data structures and algorithms. Each data structure/algorithm node gives you a good path of what to study next. 

#### 2. [Algorithms Visualizations](https://www.cs.usfca.edu/~galles/visualization/Algorithms.html)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/26l3hzqjo007l5roax53.gif)

The wonderful folks at the University of San Francisco have developed these interactive animations for a variety of data structures and algorithms. This visualization tool is written in javascript using the HTML5 canvas element and runs in just about any modern browser.

#### 3. [Sorting Algorithms](https://www.toptal.com/developers/sorting-algorithms)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jt4fk5oyl2qmyt2ctt1q.gif)

One of my favorite sorting algorithms visualizations, these animations illustrate how effectively data sets from different starting points can be sorted using different algorithms. These animations show 8 different sorting algorithms on 4 different initial conditions. 

#### 4. [VISUALGO](https://visualgo.net/en)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fa6ug8lrxumgr3s291ho.gif)

Developed at NUS, VisuAlgo contains animations of 23 algorithms—from basic ones like sorting, to rarer ones like graph traversal. There's also a section for quizzes to test yourself!

DSA interview prep can be daunting but hopefully, these amazing tools can help you with understanding the basics. 

Hope this was helpful. Here's another interview prep-related [article](https://dev.to/prnvbirajdar/5-javasript-github-repositories-for-interview-prep-306h) for all you JS developers. Happy coding! 👩‍💻🚀👨‍💻
ExUnit test_helper.exs usage
Tags: elixir, exunit
Published: 2021-04-15 03:32:58

Hi

To load additional modules into the mix test, add the path of the modules in the mix.exs. In the below example I am adding "test/helpers" path to the elixirc_paths 

```
def project do
  [
    ...
    elixirc_paths: elixirc_paths(Mix.env())
  ]
end

defp elixirc_paths(:test), do: ["lib", "test/support", "test/helpers"]
defp elixirc_paths(_), do: ["lib"]

```

Then all the modules defined in "test/helpers" will be available to tests.