teleren/devto huggingface dataset:
Azure DevOps YAML pipeline : Template = task group
Tags: azuredevops, pipeline, yaml
Published: 2020-07-13 14:21:14

When I author build/release pipelines, I often used **task group** so that I can reuse the set of tasks in multiple pipelines.

Since last year, I switched to use YAML pipeline instead of GUI, and all of sudden, I need to say good-bye to task group, and say hello to [**Template**](https://docs.microsoft.com/en-us/azure/devops/pipelines/process/templates)

In this article, I create a repository which contains a set of shared .yml files for reuse.

# Setup Azure DevOps

I have two repositories:

- myapp: Store my application. I just put a text file for now.
- taskgroup: Store shared yml.

# Create shared yml file

I usually create pipeline yml by using pipeline editor as it has IntelliSense support.

1\. Go to Pipelines and click **New pipeline**.

2\. Select "Azure Repos Git".

3\. Select "taskgroup" repository.

4\. Select "Starter pipeline".

5\. Change the file name to hello-user.yml and replace the code. This could be the simplest yml with a parameter. See [Parameters](https://docs.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops#parameters) for more detail.

```yaml
parameters:
  - name: yourName
    type: string
    default: 'world'

steps:
  - script: echo Hello ${{ parameters.yourName}}
    displayName: 'Hello user'
```
6\. Save the change to commit the file. 

# Create consumer pipeline

Next, I author a pipeline in myapp repository and use **hellp-user.yml**.

1\. Go to Pipelines and click **New pipeline**.

2\. Select "Azure Repos Git".

3\. Select "myapp" repository.

4\. Select "Starter pipeline".

5\. Update the code. I keep the file name for now.

- Use resources to reference **taskgroup** repository
- The type is **git** which means **AzureDevOps repository** in this case
- Use <yml filename>@<repository resouce name> to reference the yml
- Use parameters to set parameter values.

```yaml
trigger:
- master

resources:
  repositories:
    - repository: taskgroup
      type: git
      name: taskgroup

pool:
  vmImage: 'ubuntu-latest'

steps:
- script: echo Hello, world!
  displayName: 'Run a one-line script'

- template: hello-user.yml@taskgroup
  parameters:
    yourName: 'ken'
```

6\. Save and run the pipeline.

# Result

When I run the pipeline, I can see that the pipeline references both **myapp** and **taskgroup** repositories.

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

I also confirmed that the shared yml ran as expected with correct parameter value.

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

# Summary

I can use template as if it's task group. The biggest difference for me is that I can move the shared tasks easier as it's all stored as source code.
Componente Input de Busca
Published: 2020-07-13 14:18:35

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/3n20z46tcveg1h4edgq3.gif)
Estudos de implementação de um simples input de busca na forma de um componente VueJs.
Link do repositorio [https://github.com/williamdepaula/componentes-vue](https://github.com/williamdepaula/componentes-vue)
Nepodařilo se zaplatit Netflix
Published: 2020-07-13 13:52:50

Občas se to stane i těm lepším z nás - zapomenete nastavit limit, odmrazit kartu nebo si převést peníze (podle toho, jak moc paranoidní na internetu jste) a životně důležité předplatné není zaplaceno.

Dnes nám píše Netflix:

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

Na první pohled nudný phishing, který má jednu zajímavou charakteristiku - způsob úniku před spam filtry pomocí vkládání náhodných, ale skoro neviditelných, znaků.

Tentokrát nemáme žádné přílohy, ale pojďme si projít obsah e-mailu:

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

1. Netflix píše ze zajímavé domény.
2. Na první pohled se něco pokazilo při přeposílání, že? Chyba lávky - když si text přiblížíme, zjistíme, že to nejsou podtržítka, ale miniaturní shluky písmen. Ve skutečnosti jsou to HTML značky `<span>` ostylované jako text velikosti `1pt`. V původním e-mailu nebyly vůbec vidět - forward je trochu zvětšil.
   ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/nahqiuicgy255dpa5f2s.jpg)
3. Hlavní odkaz vede na podezřelou adresu.
4. Všechno ostatní odkazy v tomto e-mailu vedou na tu stejnou adresu.
5. I tento...
6. Kdyby se text dal rozumně přečíst (což v originále šlo), našli bychom i gramatické chyby (velké "P" po čárce se nepíše ani v angličtině).
7. Také bychom se dočetli, že jakési finanční instituce odmítly měsíční platby...

Co se stane, když klikneme na odkaz? Pokud to uděláme z Outlooku, tak nás upozorní Office 365:

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

A následně i Firefox (v němž jsem zkoušel pokračovat). Tato stránka je totiž evidována jako podvodná, takže moderní prohlížeče by měly zobrazit varování. A přejít přes celočervenou obrazovku, která říká "pozor, nebezpečí!" už chce nemalé odhodlání na straně uživatele.
Logistic Regression for Machine Learning Problem
Tags: machinelearning, python, datascience
Published: 2020-07-13 13:33:59

### Introduction

> **Logistic Regression** is a kind of **parametric classification model.**  It's a binary classification machine learning algorithm. It can only be used to distinguish between 2 different categories like —

- Like if an E-mail is spam(1) or not(0).
- Whether the tumour is malignant (1) or not (0)

<img class="img-fluid" src="https://cdn.pixabay.com/photo/2017/05/31/23/44/email-marketing-2362038_960_720.png" alt="Email is spam or not">

The theory behind Logistic Regression is very similar to the one from Linear Regression, so if you don’t know what Linear Regression is, take 5 minutes to read this Introduction.
 
- <a href="https://codeperfectplus.herokuapp.com/what-is-simple-linear-regression" target="_blank">What is Simple Linear Regression</a>

### Types of Logistic Regression

1. _Binary Logistic Regression_
2. _Multinomial Logistic Regression_
3. _Ordinal Logistic Regression_

### Assumptions for Logistic Regression

1. For Logistic regression, there should be minimal or no multicollinearity among the independent variables.
2.  The Logistic regression assumes that the independent variables are linearly related to the log of odds.
3. The Logistic regression usually requires a large sample size to predict properly.
4. In Logistic regression dependent, the variable should be binary.
5. The Logistic regression assumes the observations to be independent of each other. 

### Iris Flower Classification

```python
# Impoer Library for classification
import numpy as np
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.linear_model import Logi
from sklearn.metrics import accuracy_score
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
import joblib
```
```python
np.random.seed(10)
# split data for training and testing purpose
iris = load_iris()
X = iris.data
y = iris.target
train_X, test_X, train_y, test_y = train_test_split(X, y, train_size=0.8)
```
```python
# Create pipeline
pipe = Pipeline([
    ('scaler', StandardScaler()),
    ('logistic',LogisticRegression(),)
])

# fit and predict
clf = pipe.fit(train_X, train_y)
pred_y = clf.predict(test_X)
score = accuracy_score(test_y, pred_y)
print(score)
```
10 Secret Shopify Apps To Boost Your Sales
Tags: shopify, ecommerce
Published: 2020-07-13 13:31:03

We all are aware of the fact that how badly we all are addicted to shopping. But when it comes to online shopping then the entire case turns out to be more enjoyable and full of comfort zone. E-commerce is a wide platform that is growing at an unprecedented rate all over the world. 

Shopify makes it easy to sell products online. There are hundreds of Shopify applications available to help you grow your business. But selecting the best one to increase your sales is a complicated task.  Here we came with a list of top 10 Shopify apps to boost your sales.

#Top 10 Shopify apps to increase sales-
**1. Growave-**
It is a marketing platform that helps Shopify brands to easily reach targeted audiences, engage users and boosts conversions. It also eases the process of branding by encouraging users to share your brand on social media and email. You can increase the conversion rates using photo reviews, user generated content, Instagram feeds and social proof. Collecting more reviews on autopilot, drive more shoppers to your website through search and social, building trust with visual product reviews, Q&A is all possible with the amazing features of Growave.

Free Trial: 30 Days free Trial

Price: Growth starts at $119/month

Best Used For: Building strong customer relationships

**2. Checkout Boost-**
There is a huge chance of leaking money when you drive to an online store. That money can come from visitors who you were unable to convert, potential deals that you couldn’t upsell or abandoned carts that impacted through your site and never returned.

Checkout Boost application is the main solution you’ll have to fix all issues within a short timeframe.

Run exit-intent offers to get clients who’re about to abandon their cart
Motivate customers to spend more to receive special offers with Sales Gamification method
Upsell more relevant items after checkout to promote repeat purchase 
Request the customers to share their cart to Facebook/Twitter to get special offers
**3. Omnisend-**
Powerful omnichannel suite allows you to create complex automated marketing workflows by integrating channels like, Facebook messenger, Whatsapp, Facebook and Google retargeting ads, SMS and so on. Email campaign creation is a snap with this suite which offers a simple drag-and-drop email builder that allows you to customize campaigns without HTML knowledge. Omnisend is a great option for the sales-focused marketers needs better than simplified newsletters.

Free Trial: Yes, 15 days (plus a free basic plan)

Price: Variable, depending on subscriber list; Standard plan starts at $10/month with 1000 subscribers

Best Used For: Omnichannel marketing automation, multichannel automated workflow

**4. Custom options-**
Most of you are worried about the restricted amount of 3 customizations on each product page, then this app is just for you. It helps you to add unlimited customizations to any product and hence can create unlimited product options for the customers.

**5. Recapture.io-**
Know more at- [https://solaceinfotech.com/blog/10-secret-shopify-apps-to-boost-your-sales/]
Projects To Complete When Learning Web Development
Published: 2020-08-10 08:40:47

---
title: Projects To Complete When Learning Web Development
published: true
date: 2020-07-13 13:11:03 UTC
tags: 
canonical_url: 
---

If you’re intermediate beginner web developer, you have probably run into the wall. The basic tutorials are too easy now. But it’s hard to figure out what to code.

You are probably looking for project ideas with quality design. Fortunately, there is [devchallenges.io](https://devchallenges.io), completly **free** website where each challenge is different and will test you different aspects of coding. It includes small user stories and beautiful designs.

When you complete a challenge, you submit your solution, which can be shared with others. Solutions page is a good place for people to learn from each other. It is for you to share your thought and help others.

# Here are some sample projects

You should visit [devchallenges.io](https://devchallenges.io) for more ideas.

## [Job Board App](https://devchallenges.io/challenges/TtUjDt19eIHxNQ4n5jps)

![githubjobs](https://naveenjujaray.js.org/assets/images/projectchallenges/2.jpg)

## [Quizz App](https://devchallenges.io/challenges/Bu3G2irnaXmfwQ8sZkw8)

![quizapp](https://naveenjujaray.js.org/assets/images/projectchallenges/3.jpg)

## [Unsplash clone](https://devchallenges.io/challenges/rYyhwJAxMfES5jNQ9YsP)

![unsplashclone](https://naveenjujaray.js.org/assets/images/projectchallenges/4.jpg)

## [Checkout page](https://devchallenges.io/challenges/0J1NxxGhOUYVqihwegfO)

![checkoutpage](https://naveenjujaray.js.org/assets/images/projectchallenges/5.jpg)
How do you create entities?
Tags: discuss, php, webdev, bestpractice
Published: 2020-07-13 13:09:35

---
title: How do you create entities?
published: true
description: Let's discuss best practices in code.
tags: #discussion, #php, #webdev, #bestpractice
//cover_image: https://direct_url_to_image.jpg
---

I recently discovered a code like this:

```php
function createLead(
    $salutation,
    $firstName,
    $lastName,
    $email
) {
    $lead = new Lead();
    $lead->setSalutation($salutation);
    $lead->setFirstName($firstName);
    $lead->setLastName($lastName);
    $lead->setEmail($email);
}
```

It is painful for me to work with code like this, because adding a new field to an entity will require not only changes in entity, but everywhere where creation is triggered, and the worst part is that it's super easy to misplace the argument and have unexpected results.

Do you see any pattern/anti-pattern in this code? Would you consider that to be a good or bad practice? Would you refactor it?
How many mistakes can you spot in this exercise?
Tags: inclusion, womenintec
Published: 2020-07-13 12:56:16

**Content warning:** This post contains sexist material that might make your brain melt.

**Update (June 2020):** Course provider has promised to change the wording of their exercises! That is great!

---

I could not believe my eyes when I saw this programming exercise on a C++ course that is widely offered in Finnish Universities. 

**How many mistakes can you spot here?**
> “Write a program that asks the users gender and age. Finally the program prints a sentence based on the following rule:
* Male 0-55 years: “You are a man in his prime!”
* Male 56-100 years: “You are a wise man!”
* Female 0-55 years: “You are like a blooming flower!”
* Female 56-100 years: “You look young for your age!”
* Else “Error encountered!”
Age is handled as an integer variable and gender as string variable (m/f). Letter case is ignored.”
 
And if someone does believe this is true, here's a screencap of it:

![Screencap from exercise. Text is posted below.](https://dev-to-uploads.s3.amazonaws.com/i/okb28ibqouqnehx5f1cn.png)

This might be some wicked way of pointing out sexism in IT industry. In my opinion, simply, not cool!
WebdriverIO - Upload File Example
Tags: testing, javascript, tutorial, beginners
Published: 2020-07-13 12:52:59

During browser automation, you might run into a scenario where you need to upload a test file, this is really easy to do with WebdriverIO. Let's take a look at an example below.

I'm using this [test url](https://the-internet.herokuapp.com/upload) for this example which is stored in the `wdio.conf.js` file.

```javascript
const path = require('path');

describe('Upload File', () => {
  it('should be able to upload a file', () => {
    // find selectors
    const input = $('#file-upload');
    const submitBtn = $('#file-submit');

    // store test file path
    const filePath = path.join(__dirname, '../data/chrome.png');

    // use browser.uploadFile to upload the test file
    const remoteFilePath = browser.uploadFile(filePath);

    // access the test page
    browser.url('/upload');

    // set file path value in the input field
    input.setValue(remoteFilePath);
    submitBtn.click(); // click the submit button

    // Add your assertion here
  });
});

```
💎 This code is also available on [GitHub](https://github.com/automationbro/webdriverio-quick) for you to access and play around with. 

***

#### You can also checkout the video below that will show you the detailed explanation of the code above. 

{% youtube UC8fkpnO2cg %}

***

#### To learn more about WebdriverIO, you can check out my free tutorial series here - 
https://www.youtube.com/watch?v=e8goAKb6CC0&list=PL6AdzyjjD5HBbt9amjf3wIVMaobb28ZYN.
My Cry for Help
Tags: beginners, javascript, 100daysofcode, codenewbie
Published: 2020-07-13 12:38:01

Hey guys, so I'm on Hackerrank and I decided to take on their 30 days of code challenge and lo and behold, I get stuck on day 1, so so frustrating. I decided to leave it for a while and came back to it after a few weeks but still with no positive results, so this is my cry for help for anyone willing to assist me in passing through day 1. Thank you in anticipation
What are the questions to be asked in a Linear Regression problem?
Tags: machinelearning, datascience, learning
Published: 2020-07-13 12:37:57

Hello All!

Linear Regression is the key to understanding regression in machine learning. It is the algorithm where everything is born, and everything ends. It may not be as powerful as the Boosting algorithms are, but regression is the way forward since it has great interpretability.

While performing regression, two important metrics have to be noted and kept handy, for understanding the importance of variables, and how they affect the target:

1. How important is the predictor, for predicting the Target?
(R-squared will denote this)

2. Was this predictor's importance by chance?
(P-value obtained on running the algorithm, will denote this)

Thanks for reading! Let's discuss it!
Add Contentful Your Gatsby Website
Tags: contentful, gatsby, graphql
Published: 2020-07-13 12:06:47

The source code for this tutorial can be found here: [https://github.com/turq84/contentful_gatsby](https://github.com/turq84/contentful_gatsby)

## What is Contentful?

Contentful is a content management tool. Contentful describes itself as a platform where you can update the content of your website, a mobile app, or any other platform that displays content. They save you the time and hassle to create your own backend to manage the content and provide many tools that make it easier to actually generate a website or app.

Still want to learn more about Contentful? Check out their [website](https://www.contentful.com/faq/about-contentful/).

## Assumptions

This guide assumes that you already have an existing Contentful account. If you don’t, please get one and then continue with this guide.

## Packages Needed

You'll need the Contentful plugin from Gatsby:

`gatsby-source-contentful`

## New Gatsby Project

Okay, let’s get started with a new Gatsby project. In your new project folder, open your terminal and enter this:

`gatsby new gatsby-starter-blog https://github.com/gatsbyjs/gatsby-starter-blog`

`cd gatsby-starter-blog`

`npm install`

`npm install --save gatsby-source-contentful`

## How to Use

To use the plugin, you’ll need your Contentful API keys. Here is how you get them.

1. Log into your Contentful account and click Settings.
2. From there, choose API Keys.
3. Select the project you want the API keys for.

You’ll be on the page containing your Access tokens. On this page, you will find the necessary API keys.

In your `gatsby-config.js` file, we need to set up the `gatsby-source-contentful` plugin. So add this code to your file.

```javascript
// gatsby-config.js
plugins: [
	{
		resolve: `gatsby-source-contentful`,
		options: {
			spaceId: `your_space_id`,
			accessToken: `your_content_delivery_api_key`,
		},
	},
];
```

Now you are all set up. Let’s run the development server to see if everything still runs.

`gatsby develop`

**It works!** 🎉

To see your Contentful content, go to `http://localhost:8000/__graphql` in your browser. Your Contentful data should be there.

Now you are all set up to play with your Contentful queries!

For more information about the gatsby-source-contentful plugin, please look [here](https://www.gatsbyjs.org/packages/gatsby-source-contentful/).

## Creating Pages that Use the Contentful Data

If you want to create pages that involve your Contentful data, make sure to add any GraphQL queries to your `gatsby-node.js` file. From there you can use the query data in your `createPage` function.

## Summary

In this tutorial, you learned about the Contentful and what it is. You also learned about the Gatsby plugin for Contentful, how to access your Contentful API data, configure the Gatsby plugin, and see your Contentful data amongst the list of GraphQL queries.

Contentful is a powerful tool. Now you can use it in Gatsby!

The source code for this tutorial can be found here: [https://github.com/turq84/contentful_gatsby](https://github.com/turq84/contentful_gatsby)
How to create an awesome GitHub profile README
Tags: github, opensource
Published: 2020-07-13 12:05:42

Recently GitHub released a new feature that allows users to create a README file and use it as a profile description in the user homepage.

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

They choose to use a Readme file because it supports markdown and this type of file is the default content file type on the platform.
In addition, markdown it's very simple to use and it's very easy to create visual content with less effort. 

## First steps to create your own profile README

To create a profile README it's very easy.

- Create a new repository with the following link [https://github.com/new](github.com/new) or from GitHub homepage, click on "New Repository" in the top right corner menu.
- The repository name must be exactly the same as your username (including casing)
- Remember to check the "Initialize this repository with a README" at the bottom of the form

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

ProTip: if you see the green box below your repository name, you are doing right.

## Next steps
Now the only limit is your imagination.
You can add in your profile README everything: banner image, text, links.

ProTip: use Canva.com to create a banner in 2 minutes and 10 clicks

## Conclusion
Try to find some inspiration from other profile README on GitHub and create your special one.
Check out my profile README: [https://github.com/kasuken](github.com/kasuken)
Daily Developer Jokes - Monday, Jul 13, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-07-13 12:00:07

---
title: "Daily Developer Jokes - Monday, Jul 13, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Monday%2C%20Jul%2013%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1259b9b89f4.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ What do you call optimistic front-end developers?

___A:___ Stack half-full developers.
 -->
GetAdvice is looking for frontend devs
Tags: contributorswanted, javascript, css
Published: 2020-07-13 11:46:31

Hello, I'm the guy behind https://getadvice.github.io/ a site to connect people willing to freely advise others struggling with tech or product issues.

I'm looking for volunteers that would like to join in and help others in their free time (30 mins once a month it's fine if you don't have much free time).

# How does it work?
Volunteers have a profile with some information about them like skills, LinkedIn, Blog, Twitter, etc. 

A user looking for help can browse for a volunteer and schedule a one-to-one call with them by using the public calendar published by the volunteer with his availability (using calendly or similar).

IMPORTANT: This is not a commercial project.

You can read more about at:

https://getadvice.github.io/about.html

Or schedule a call with me for more info https://getadvice.github.io/adriano.galello.html