teleren/devto huggingface dataset:
Angular NgIf directive implementation
Tags: angular, webdev, javascript, typescript
Published: 2020-07-20 14:45:49

In this article, we will learn how to implememt `NgIF` structural directive using angular 9.

#NgIf directive overview

>NgIf — change the DOM layout by adding and removing DOM elements based on a conditional statement. Placing the ngIf directive on a component, or element, will in fact hide or show that element based on the truthy or falsy of the condition you pass it.

#NgIf usage example

Using `NgIf` directive is very simple, all you need to do is add it to any html element that you want to show/hide.

```html
<div *ngIf="isLoading">
  Loading...
</div>
```
The `div` above will be added to the DOM only if `isLoading` is true.

#Implementation

Now that we understand `NgIf` and how to use it, lets start with our own implementation. We'll call it `MyNgIf`.

###Create project using angular CLI

Open terminal and run `ng new ngif-directive`, this creates new angular project called `ngif-directive`.

###Directive using angular CLI
cd into the project and run `ng g d myNgIf` to generate directive template file. Open `my-ng-if.directive.ts` and paste the following code:

```javascript
import {
Directive, 
Input, 
TemplateRef, 
ViewContainerRef
} from '@angular/core';

@Directive({
  selector: '[appMyNgIf]'
})
export class MyNgIfDirective {

  @Input() set appMyNgIf(condition: boolean) {
    if (condition) {
      this.viewContainer.createEmbeddedView(this.templateRef);
    } else {
      this.viewContainer.clear();
    }
  }

  constructor(private templateRef: TemplateRef<any>,
              private viewContainer: ViewContainerRef) { }

}
```
The `@Directive` decorator is used to configure this class as an directive. The brackets ([]) on `selector: '[appMyNgIf]' ` make this directive an attribute selector. Angular will locates each element in the template that has an attribute 'appMyNgIf' and applies the logic of this directive.

The `@Input` decorator is used to pass data to the directive from the element our directive is attached to.

`TemplateRef` represent the element our directive is attached.

`ViewContainerRef` is a container where one or more template can be attached by calling `createEmbeddedView` method. To remove attached template(s) we call `clear` method.

###Use `appMyNgIf` directive

Paste the following code into `app.component.ts`

```javascript
import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  template: `
    <div *appMyNgIf=condition>
      Loading...
    </div>
    <button (click)="condition = !condition">Show/Hide</button>
  `,
})
export class AppComponent {
  condition = true;
}
```
If you run the app (`npm start`) and go to `http://localhost:4200`, the div with `loading...` should be rendered.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/j62gkbzigyd31zfjwjdr.png)

If you click `Show/Hide` button, the div should be hidden.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/qse7s8nb752wme0zce84.png)

Code available on [github](https://github.com/Dimakzela/angulr-ngif-implementation)
Laravel Vs CodeIgniter: Which One To Choose?
Tags: laravel, codeigniter, php
Published: 2020-07-20 14:31:08

Php is a leading web development technology used by many software companies over the years. And it has become essential to use a PHP MVC framework for developing custom solutions with PHP programming language. There are multiple type of PHP MVC frameworks available and among those, Laravel and CodeIgniter are the most popular. Here we will compare Laravel vs CodeIgniter, to choose the best one. Let us see one by one in detail.

#What Is Laravel?
It is an open-sourced widely used PHP framework and dedicated to the web apps development by using MVC architectural patterns. This framework reuses the existing functionality of the core framework along with its own features. As laravel is released under MIT license, its source code is hosted on GitHub. Developers consider it as a reliable framework due to its accurate and expressive language rule. Know Laravel Packages To Improve Productivity at- Top 11 Laravel Packages To Improve Productivity.

**Features Of Laravel-**
* Easy integration with third-party libraries 
* Provides better IO capabilities
* Easy to use blade templating engine
* Inbuilt authentication mechanism
* Built-in caching mechanism
* Modular Packaging
* Unmatched quality session control
* Dependency manager fully composer based
* Query builder acts as potential ORM alternative

**Why Use Laravel?**
*Has a great documentation feature
*Laravel framework has a auto-loading feature which loads itself and hence there is no need for human intervention.
*It offers the version control system that helps with the simplified management of migrations.
*Supports DBMS platforms like SQL Server, Postgre SQL and My SQL.
*This framework can generate a lot of new tools by the help of a LOC container.
*Framework allows you to enforce the constraints between various DBM objects in an advanced query builder mechanism
*It also supports Artisan command with the sample codes line interface.
*It has modular packaging with composer-based dependency manager
Laravel supports Eloquent ORM to work on DB.

#What Is CodeIgniter?
Know more at- [https://solaceinfotech.com/blog/laravel-vs-codeigniter-which-one-to-choose/]
Building a Code Editor for the Web - Redefining the Console
Tags: webdev, html, css, javascript
Published: 2020-07-20 14:29:54

In order to output to our custom console, we'll need some way to store the logs that usually get logged in the dev tools that are also formatted as we want so that we can display them all at once later on 

Find the code for this video in this branch: 
https://github.com/luvuong-le/code-editor-tutorial/tree/redefine-console

Check out the previous part to this video [here!](https://dev.to/coderarchive/building-a-code-editor-for-the-web-configuring-ace-editor-507h)

Stay tuned for the final video 😁 

Follow and connect with me on:
----------------------------------
📹 Youtube: https://www.youtube.com/channel/UCWaB4SBBUCvhYb91fz5Vidg
🐦 Twitter: https://twitter.com/coderarchive
📚 Github: https://github.com/luvuong-le
💼 LinkedIn: https://www.linkedin.com/in/lu-vuongle/
📷 Instagram: https://www.instagram.com/coderarchive/
📝 Dev.to: https://dev.to/coderarchive
Adding Vim to Xubuntu 20.04
Tags: vim, xubuntu, linux
Published: 2020-07-14 17:14:43

I recently installed Xubuntu, version 20.04 on old laptop. And I needed an editor, so I tried to run Vim from terminal. But it was not found!

There were some 3rd party repos that had the compiled binaries for the Vim, but as you can guess, they are not updated recently. So I thought to try to compile Vim from source.

Here are the steps that I was required to get the Vim working on my Xubuntu 20.04.

## Getting source

Head to Vim's [GitHub page](https://github.com/vim/vim) where the source files and instructions for compiling are located.
Run following in the terminal to get the source code to your own computer:

```
git clone https://github.com/vim/vim.git
```

## Compiling

When you have cloned succesfully the source files, go to your `vim/src` directory.

```
cd vim/src
```

Then run the following to compile the Vim

```
make
```

### Problems when compiling

If you have the same problem that I had, that after some time an error occured that said something about that:

> No Terminal Library Found

So I looked up from the internetz and found this [solution](https://askubuntu.com/questions/158344/no-terminal-library-found-when-compiling-vim).

```
sudo apt-get install libncurses5-dev libncursesw5-dev
```

After installing the missing packages, I tried to run `make` again and now it was successful.

## Installing

As instructions says, you should install your Vim also to use it. So run the following command will do the trick:

```
make install
```

## Done

Now you should have the latest (at the time of pulling the source, compiling, installing) available version of the Vim. You can now update your Vim by doing the instructions again, but instead of cloning you should get the latest sources with:

```
git pull
```

Happy editing with the Vim can start on your fresh Xubuntu!
Ways to declare unsigned columns in the Laravel migrations
Tags: php, laravel, migration, relationships
Published: 2020-07-20 14:18:54

Laravel developers love the way it handles relationships between tables by just associating models with each other.

The column which defines the relationship between tables must be of `unsigned` type.

In this tutorial, we'll see how we can declare columns as unsigned in different ways in Laravel.

<!-- Tested with Laravel versions **5.8**, **6** and **7**. -->

You need to import `Illuminate\Database\Schema` namespace with `use` keyword.

### Using `unsignedInteger` column types

```php
  $table->unsignedInteger('user_id');
```

### Using only `integer` column type

```php
  $table->integer('user_id', false, true);
```

### Using `integer` column type with `unsigned` column modifier

```php
  $table->integer('user_id')->unsigned();
```

Read the complete post on our site [MeshWorld](https://meshworld.in) - [Ways to declare unsigned columns in the Laravel migrations](https://meshworld.in/ways-to-declare-unsigned-columns-in-the-laravel-migrations/)

For more, you can check the official documentation for migrations [creating-columns](https://laravel.com/docs/master/migrations#creating-columns) page.

Read others post on our site [MeshWorld](https://meshworld.in)

Happy coding

With ❤️ from 🇮🇳
Managing QA in Production
Tags: testing, qa, workflow
Published: 2020-07-20 14:01:24

One can judge the maturity of the product by how stabile its production system is. But bugs happen, and having an efficient issue tracking and resolution flow is critical.

As a product manager, I see the need to be able to work with the QA closely and efficiently. This collaboration might be in part definitive of the the whole team's dynamic (I want to write more on this sometime).

###Here's in short how we have it organized:

**Logs** - real-time monitoring tools may show that there is an issue. I like the level of usability on [Rollbar](https://rollbar.com/) or [Kibana](https://www.elastic.co/guide/en/kibana/current/introduction.html). Especially if their notifications integrate into Slack.


**Customer Success** - requests come from customers directly to the success team. They try to reproduce it, collect as many details as possible before informing the QA or handing it over to the engineering. 


**Daily Testing** - QA team monitors automated daily tests that run in [Selenium](https://www.selenium.dev/) or does spot-check user tests and discovery.


**Customer Surveys**- alert about unknown problems, mostly with the user experience.



###So once the issue is reported, the QA needs to follow **these steps**:

###1. Verify:

 - reproduce the issue to make sure it was really an **issue**


###2. Categorize:

- Is it a newly **'Discovered'** issue? 
- Is it an old one that's **'Happened'** again? 
- Is it something that was **'Designed'** this way, but turned out to be a clunky experience?


###3. Prioritize:

 - after step 1 and 2, get together with the product manager and/or engineer to discuss the severity and the need to **escalate**.


**IF** the issue is **escalated** then it's assigned to the engineer who is most familiar with this particular logic in the form of a ticket (we use Jira). 
The hotfix is pushed as soon as possible to PROD and the users who experienced the issue are informed about the resolution.

**IF** the issue is **NOT escalated** then the additional data goes into the QA tracking board where it lives until it's escalated or prioritized later in the development cycles.


----------

In the early days of a young product, the role of the QA is often overlooked. Everyone does testing and debugging. Which is ok to a certain point. 

As the product scales and the team grows, however, what I found to be the most important part of the process, is having the dedicated QA person. The person who has this strong sense of ownership and is passionate about the system doing its best to support the customers through their journey. Without that passion, things become much more complicated and even dangerous.
How to set up your own VPN Client in 15 mins 💻
Tags: azure, linux, opensource
Published: 2020-07-20 14:00:40

I recently set up a VPN client for personal use by using a VM and OpenVPN.

## What you'll need:
- A Linux VM in the Cloud ☁
- OpenVPN Client

For this article, I will be using a VM in Azure.

## Getting your Linux VM ready!

- Launch a VM Ubuntu 18.04 in Azure.

- Make sure you have open the following ports for inbound connection. During the creation process, we can only unlock the following ports: Port 80 (HTTP), 443 (HTTPS), 3389(RDP) and 22 (SSH). In addition to the already unlocked ports, we need to unlock the following ports: TCP on port 943 and UDP on port 1194. We can do this in the network settings of our VM.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/d0oqur9ppk818i6frlwa.png)

- Similarly, open the UDP port 1194.

- Now SSH into your VM and let's get started with the install.

- Run the following commands:
```bash
sudo apt update
sudo apt upgrade
```
- Get the public IP address if not sure!
```bash
dig +short myip.opendns.com @resolver1.opendns.com
```
- Download and run the [opnevpn.sh](http://opnevpn.sh) script
```bash
wget https://git.io/vpn -O openvpn-install.sh
```
- Add the execution bit
```bash
chmod +x openvpn-install.sh
```
- Run the script
```bash
sudo ./openvpn-install.sh
```

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/wugmlckln176qt7ofns6.png)

After the install is complete, you should see a Finished message if it was successful.

## Creating profiles:
Now you can run the script again to create different profiles.

There was one created during the install and it should be located in the home directory of your VM.

You can use WinSCP to copy the file to the local machine.

## Installing the client on the local machine:
- Now you need the OpenVPN client on your local machine and import settings from the .ovpn file that was copied in the previous step.

- After installing the client, you should be able to import the .ovpn file into the OpenVPN client

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ugodhipo8t40a1sv4z3d.png)

- After the profile is imported, you should be able to connect to your personal VPN server.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/gwwgxyq69z09j3rv85uk.png)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/eljwm5ajgehqsqtrt38y.png)

Please feel free to reach out if there are any hiccups setting this up.
Also, you can follow me on [Twitter!](https://twitter.com/rishabk7)
How to gain 1000+ stars on an open-source project quickly?
Tags: showdev, github
Published: 2020-07-20 13:55:58

My open-source project **Github profile README generator** reached 1000+ ⭐️ in less than 45 days 🥳.

It was trending on Github under javascript category🚀
![github-profile-readme-generator](https://dev-to-uploads.s3.amazonaws.com/i/f6wxs4wo9fxb4bctrf0o.png)

I was scrolling the twitter feed and listening to **Blinding Lights** when I got the idea of this tool. Never thought that so many developers will find it useful.

The open-source community is amazing. The project on GitHub received two pull requests without even opening an issue.

- [Nat Friedman](https://twitter.com/natfriedman?lang=en) **CEO of GitHub** followed me on twitter.
- [Thorsten Lünborg](https://twitter.com/linus_borg?lang=en), a member of the Vuejs core team even starred the repository🙇.

![github-profile-readme-generator](https://dev-to-uploads.s3.amazonaws.com/i/659mdvod4dq11bjmckt3.png)

## How I achieved it?
Now the question is How I did it. The strategy I followed is a mix of a few steps which are as follows

#### 1. Cool project README
Project README on Github puts the first impression of the project. To win the battle i.e to gain attention I designed a visually interesting README using **gifs**, **badges**, and **emojis**. It looks like this
![github-profile-readme-generator README](https://dev-to-uploads.s3.amazonaws.com/i/3eelbp0qua074rnu2det.png)

#### 2. Post about project on Dev.to using #showdev
I am quite active on dev.to and understands the power of it. So I wrote this article for the same
{% link https://dev.to/rahuldkjain/github-profile-readme-generator-with-addons-like-visitors-count-github-stats-etc-44bg %}
Guess what, it got 1400+ views. Organic reach is pretty amazing on dev.to.
You blog post must display the capabilities and uniqueness about the project.


#### 3. Promote the project on other platforms(LinkedIn/Reddit/Discord/Twitter)
I am quite active on LinkedIn too. So I took advantage of this and wrote a post regarding the tool. Organic reach of LinkedIn is amazing too and the post was reaching 1000+ people per hour for the first 12 hours. The post became a hit and reached 24000+ people on LinkedIn.

That's it! Dev.to and LinkedIn proved out to be a super awesome platform to reach the targetted audience organically.

PS: If you haven't checked out the tool yet, go check it out
:rocket: Try the tool - [live demo](https://rahuldkjain.github.io/gh-profile-readme-generator/)
{% github https://github.com/rahuldkjain/github-profile-readme-generator %}
Hi Guys.👋 
Published: 2020-07-20 13:42:07

You are a Phone call away from your next Fundraise.
Are you looking for an Investor?🔎 To get your business funded? Well look no further.
Fundmystartups saves you hundreds of hours by aggregating data on 11,000+ Angels and Venture Capitalists in one place, complete with their investment interests and contact info such as emails and direct phone numbers.
Lets help you find an investor in seconds!🚀
https://fundmystartups.com
What were your knowledge gaps when you started your career?
Tags: discuss, beginners, career, codenewbie
Published: 2020-07-20 13:40:17

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

_When developers sweep mistakes under the rug and cover up gaps in understanding with jargon and obfuscation, we reinforce the wall of imposter syndrome. Let's be inclusive and share what this journey is really like, warts and all._

---

**Stuff I think is reasonable to not understand:**
:pushpin: higher-order functions, threads, closure, execution context, recursion, OOP vs Functional programming, a million acronyms everyone seemed to be throwing around



**Stuff I probably should have known:**
:pushpin: Using an IDE, the difference between front-end and back-end, Node debugging and Chrome dev tools basics, using `debugger` instead of `console.log`, what is pure JS syntax and what is framework,



**Stuff I'm not sure is "beginner" or not:**
:pushpin: `this` and `prototype`, merge conflict resolution, [reading [documentation]], the call stack, web API

---

I'm really curious what your thoughts are on this, and what your own lists will look like! 

`MTFBY`
Git and  GitHub Complete Guide
Tags: git, github, vscode, tutorial
Published: 2020-07-20 13:25:37

Git is essential for anyone in tech whether you are using Android, Web Dev, or ML, etc.
It is required for everyone and GitHub is considered as the next resume in tech.
I have teaching GIT and GitHub completely from scratch to advanced that might help people to understand it better.

Do subscribe and keep following for more quality content.  

https://www.youtube.com/playlist?list=PLgQxDWfScmGE14fHsRRe2QVuTkFqwu3B8
11 Best Use Cases to Automate using RPA in 2020
Tags: automation, roboticautomation, rpausecases
Published: 2020-07-21 11:34:51

---
title: 11 Best Use Cases to Automate using RPA in 2020
published: true
date: 2020-07-20 13:24:23 UTC
tags: Automation,RoboticAutomation,RPAusecases
canonical_url: https://www.botreetechnologies.com/blog/rpa-use-cases-for-different-industries
---

![Best Use Cases of RPA](https://www.botreetechnologies.com/blog/wp-content/uploads/2020/07/rpa-use-cases-for-different-industries.jpg)

We have already talked a lot about Robotic Process Automation. If you find yourself asking, “[What is Robotic Process Automation (RPA) in simple words?](https://www.botreetechnologies.com/blog/rpa-technology-101-what-is-it-and-how-it-works)”, this blog has all the answers.

If you already know the basics of Robotic Process Automation but want to see [how you can determine which processes to automate](https://www.codementor.io/@samwatt/how-to-determine-which-process-to-automate-in-your-organization-16uj3cl7pr), then this article is for you.

###What is the use of Robotic Process Automation (RPA)?

In this article, we will talk about some RPA use cases in the real business world. This includes:-

1. RPA use cases in Telecom	
2. RPA for IT Processes
3. RPA use cases in Finance	
4. RPA use cases for Customer Service
5. RPA use case in Administration Processes	
6. RPA use cases in Human Resources
7. RPA use cases in Insurance Industries	
8. RPA use cases for Retail
9. RPA use cases in Healthcare Application	
10. RPA use case in Logistics
11. RPA case studies in Manufacturing	

Robotic Process Automation is a versatile technology that has multiple uses in every industry it serves. It is preferred because of the plethora of challenges it solves like:-

- Human errors due to exhaustion:- **RPA works 24×7**
- Slow completion of tasks:- **RPA increases efficiency by 50%**
- Mundane activities eating employee time:- **RPA takes up routine tasks**
- No time for innovation:- **RPA makes businesses more productive**
- Rigid processes & execution:- **RPA provides flexibility in execution**

Something as simple as automating daily login to your system can improve your productivity twofold.

RPA is best for automating complex processes, but you can also automate any single process that has the opportunity to increase efficiency and reduce the operational cost.

Now let’s look at the [RPA use cases that process automation provides to different industries](https://www.botreetechnologies.com/robotic-process-automation). We will cover 11 different industries and if you think your industry is in it, [GIVE US A CALL](https://www.botreetechnologies.com/contact) to discuss your requirements.

**If you want to know the [benefits of RPA in the top 7 service industries](https://www.botreetechnologies.com/blog/the-benefits-of-robotic-process-automation-in-the-service-industry), read this blog.**

The post [11 RPA use cases in Different Industries you ought to know](https://www.botreetechnologies.com/blog/rpa-use-cases-for-different-industries) appeared first on [BoTree Technologies](https://www.botreetechnologies.com/blog).
PCA in Finance
Tags: machinelearning
Published: 2020-07-20 13:24:15

![pca in finance](http://perfectial.com/wp-content/uploads/2020/07/PCA-06-scaled.jpg)

Exploring one of the many applications of PCA in finance – stock price prediction.

In a recent post, we covered one of the most widely used data clustering algorithms K-means.

Here, we’ll shed some light on a bedrock technique for dimensionality reduction (applied extensively in probability and statistics) – principal component analysis (PCA).

What’s curious about PCA is that it’s not a dimensionality reduction method per se, despite mostly being advertised as such. Actually, it transforms data in a certain way to make it amenable to reduction later.

The algorithm finds new views (axes) for datasets in which it’s easy to separate out data instances and consequently cluster them.

By default, it creates as many axes as there are dimensions to a given dataset but it ranks these directions, called principal components (PCs), in the order of importance: the first PC always captures the most amount of data variance possible, the second one shows the second-largest amount of variance, and so forth.

After the data has been projected into this new subspace, we might drop out some of the axes and thus reduce dimensionality without losing much important information.

Let’s dig a bit deeper into this.

The post [PCA in Finance] (https://perfectial.com/blog/pca-in-finance/) appeared first on [Bespoke Software Development Company Perfectial](https://perfectial.com/).