teleren/devto huggingface dataset:
Delegates and Interfaces
Tags: programming
Published: 2021-10-13 10:17:28

Delegates and interfaces have a lot in common. In fact, any problem that can be solved by a delegate can be solved by an interface. This made me think, why should I use delegates when I have interfaces? Let’s explore this question together!

Before we dive in, if you are not familiar with delegates, I suggest you first read my post on Action and Func, which introduces delegates. If you are already familiar, then continue below. I will briefly introduce interfaces, but not extensively, as it’s not the purpose of this article.

Requirements:
We have a customer data dump, with hundreds of properties, firstName, lastName, favourite jedi, house they fight for in game of thrones etc. etc. We must design and implement a flexible architecture so we can filter any of these customers using one or many of these properties.

Interfaces
An interface represents a contract. The contract demands a set of public methods to be implemented by the class. Let’s think of a concrete example. Looking around at some of the electronics around me, I have a laptop, a lamp, a television and an air humidifier. They all provide very distinct purposes, but they all share a common IPluggable interface. The power outlet demands something to be shaped like a plug, it doesn’t care what its powering, as long as the item conforms to the contract; the IPluggable interface.
Visit StackOverflow without leaving the terminal with Python
Tags: python, tutorial, productivity, showdev
Published: 2021-10-13 10:07:55

Stuck on a coding problem? Wish to visit StackOverflow without leaving the terminal? With `howdoi`, you can do it!
### Introduction to howdoi

Howdoi is an open source command line tool that gives answers to your questions right on the command line. Howdoi can be used by anyone and everyone who finds themselves Googling for answers to their basic programming questions.

You wonder:
```python
howdoi print hello in python
```
Howdoi output:

```python
print(“hello”)
```
### Installation
```python
pip install howdoi
```
Suppose you want to know how to format a date in bash. Why open your browser and read through blogs (risking major distraction) when you can simply stay in the console and ask howdoi:

```
$ howdoi format date bash
> DATE=`date +%Y-%m-%d`
```
howdoi will answer all sorts of queries:

```
$ howdoi print stack trace python
> import traceback
>
> try:
>     1/0
> except:
>     print '>>> traceback <<<'
>     traceback.print_exc()
>     print '>>> end of traceback <<<'
> traceback.print_exc()

$ howdoi convert mp4 to animated gif
> video=/path/to/video.avi
> outdir=/path/to/output.gif
> mplayer "$video" \
>         -ao null \
>         -ss "00:01:00" \  # starting point
>         -endpos 10 \ # duration in second
>         -vo gif89a:fps=13:output=$outdir \
>         -vf scale=240:180

$ howdoi create tar archive
> tar -cf backup.tar --exclude "www/subf3" www
```
You can also search other [StackExchange properties](https://stackexchange.com/sites#traffic) for answers:
```
HOWDOI_URL=cooking.stackexchange.com howdoi make pesto
```
or as an alias:

```
alias hcook='function hcook(){ HOWDOI_URL=cooking.stackexchange.com howdoi $* ; }; hcook'
hcook make pesto
```
 
I advise you to visit this link:  [howdoi](https://github.com/gleitz/howdoi)

There is also an  Visual Studio Code Extension, Head over to the [MarketPlace](https://marketplace.visualstudio.com/items?itemName=howdoi-org.howdoi) to install the extension.

Thank you all.
Azure Devops - Secure Reset of Terraform State
Tags: azure, devops, terraform
Published: 2021-10-13 10:00:08

If you're using Terraform for Azure Infrastructure provisioning, you're likely using the [Azure Storage Backend type](https://www.terraform.io/docs/language/settings/backends/azurerm.html) for your state file.

When running a plan and apply, Terraform acquires a lock on the the state file to control concurrency (i.e. so that multiple deployments don't interfere with each other), and sometimes if a pipeline terminates abruptly you're left with a lock on the state file. 

Next time you run the pipeline, you'll get something like

```
Error locking state: Error acquiring the state lock: 
state blob is already locked
```

We've network restricted our storage accounts and are using a VM Scale Set associated with a subnet for our Azure Devops build pools. The subnet is allow listed on the storage account network restrictions, and the containers holding the state file are also  RBAC restricted to the SPN associated with the Devops Service Connection. This means, [only our Devops pipelines can interact with our Terraform state](https://samcogan.com/store-terraform-state-securely-in-azure/) and therefore we need an azure pipeline to perform the unlock for us - so that we can authenticate and  execute under the correct security context. 

This is pretty simple, the only requirement here is to break the lease on the state file blob, which can be achieved with an  AzureCLI task. By using this task type, authentication is performed via the specified Service Connection, which performs token management and allows access to the [RBAC restricted container](https://docs.microsoft.com/en-us/azure/storage/blobs/assign-azure-role-data-access?tabs=azure-cli). 

```yaml
parameters:
- name : TerraformStateFile
  displayName: Terraform State File (e.g. whatever.statefile.tfstate)
  type: string

- name: ServiceConnectionName
  default: YourServiceConnectionDefault
  displayName: The name of the service connection that gives access to the storage account for the state file
  type: string

- name: StorageAccountName
  default: YourStorageDefault
  displayName: The name of the storage account that holds the Terraform state files
  type: string

trigger: none

steps:
  - task: AzureCLI@2
    displayName: "Break lease on terraform state"
    name: BreakLease
    inputs:
      azureSubscription: ${{ parameters.ServiceConnectionName }}
      scriptType: "pscore"
      scriptLocation: "inlineScript"
      inlineScript: "az storage blob lease break --container-name 'terraform' --blob-name '${{ parameters.TerraformStateFile }}' --account-name '${{ parameters.StorageAccountName }}'"
```

NB: The container name is hardcoded to `'terraform'` in this example, you could parameterise or set to whatever default works for you

Now, any team members can run the pipeline to reset state, without requiring any direct access to the storage account.
Asp.net core Routing app.UseRouting() ve app.UseEndPoints() Giriş.
Tags: dotnet, csharp
Published: 2021-10-13 09:58:21

Bir model-view-controller projesi oluşturalım.

Ve Startup.cs içerisindeki Configure metodumuz aşağıdaki gibidir : 
```
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }
            app.UseHttpsRedirection();
            app.UseStaticFiles();

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Home}/{action=Index}/{id?}");
            });
        }
```

Routing kısmında bizi ilgilendiren iki middleware var burada.

a.) app.UseRouting

b.) app.UseEndpoints

Şimdi bu middleware kısaca anlatacağım.

1.) app.UseRouting(); middleware'i :

UseRouting uygulamadaki tanımlanmış route'lara bakıp, gelen isteğin url'sini, uygulamada tanımlanmış route ile ilişkilendirir.

2.) app.UseEndpoints(...) middleware'i :

app.UseRouting'in eşleştirdiği route'u çalıştırır.


Bazı notlar :

x.) UseStaticFiles  middleware'i UseRouting middleware'inden önce gelmelidir.
y.) Authentication ve Authorization middleware'leri,  UseRouting ve UseEndpoints middleware arasında tanımlanmalıdır.

https://stackoverflow.com/a/61413251/17052458

Bir dahaki yazımda görüşmek dileğiyle.

En iyi dileklerim ile.

Mustafa Samed Yeyin.
How to Hire FinTech Developers in 2021
Tags: fintech
Published: 2021-11-25 12:18:55

---
title: How to Hire FinTech Developers in 2021
published: true
date: 2021-10-13 09:53:45 UTC
tags: FinTech
canonical_url: https://www.botreetechnologies.com/blog/how-to-hire-fintech-developers/
---

In 2020, the global FinTech adoption rate rose to 64%. While online payments and digital wallets were the biggest contributors to the growth, the rise of cryptocurrency and stock trading among the youth also became a driving factor for FinTech’s success.

As financial firms, enterprises, and startups realize the importance of digital finance, more and more FinTech app development companies are entering the industry. The development of contactless payment solutions, digital banking, blockchain networks, and more are now a priority for such companies.

There is now a high demand for [FinTech app developers](https://www.botreetechnologies.com/fintech-app-development) who can build a fascinating and advanced digital FinTech platform. FinTech offers lower cost, greater convenience, and a faster rate of transactions than offline methods. That is why enterprises look for FinTech software developers who can build solutions to reap the economic and competitive benefits.......

The post [How to Hire FinTech Developers in 2021](https://www.botreetechnologies.com/blog/how-to-hire-fintech-developers/) appeared first on [BoTree Technologies](https://www.botreetechnologies.com/blog).
Creating a cool profile card
Tags: beginners, webdev, html, css
Published: 2021-10-13 09:52:57

Hello guys,
today i will be showing how I created this cool profile card, let's get started..

![profile_card](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/md87pijbeiddnrdwfczn.png)

##Create a workspace
```git
   cd /Desktop
   mkdir profile_card
   cd profile_card
   touch index.html
   touch style.css
```
**cd /Desktop**: is use to change directory to the desktop 🖥️

**mkdir profile_card**: this command is use to create a folder called _ptofile_card_.

**cd profile_card**: the command is use to navigate inside the profile_card folder.

**touch index.html**: create a index.html file inside the profile_card folder.

**touch style.css**: create a style.css file inside the profile_card folder.

##create profile card
```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA- 
         Compatible" 
          content=" IE=edge">
         <meta name="viewport" 
         content="width=device- 
         width, initial-scale=1.0">
    
    <title>Profile page</title>

    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="profile-block">
    
    	<div class="cover-img">
    		<img src="c.png" alt="cover-photo">
    	</div>
    	
        <div class="profile-image-box">
            <img src="a.jpg" alt="profile picture">
        </div>
        <span>Ayebidun Ezekiel</span>
        <p>Full_stack Developer</p>

        <div class="more">
            <button type="button" >Portfolio</button>
        </div>
    </div>
</body>
</html>
```

##styling our profile card
```css
*{
    width: 100%;
    margin: 0;
    padding: 0;
}


.profile-block{
    top: 20%;
    left: 15%;
    width: 250px;
    position: absolute;
    border-radius: 5px;
    box-shadow: 0px 0px 4px 0px #5c75b1;
}

.cover-img{
	width: 100%;
	height: 150px;
}

.cover-img img{
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center;
	background-repeat:no-repeat;
	border-top-right-radius: 5px;
	border-top-left-radius: 5px;
}

.profile-image-box {
    top: 80px;
    left: 65px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    position: absolute;
    border: solid 7px #4d6cb2;
    box-shadow: 0px 0px 4px 0px #5c75b1;
}


.profile-image-box img{
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.profile-block span{
    font-size: 25px;
    font-weight: bold;
    margin-top: 50px;
    position: absolute;
    text-align: center;
    font-family: 'franklin gothic medium', 'arial narrow', arial, sans-serif;
}

.profile-block p{
	margin-top: 80px;
    text-align: center;
    font-weight: lighter;
}

.more{
    text-align: center;
}

.more button{
    width: 150px;
    height: 30px;
    border: none;
    margin-top: 40px;
    color: #ffffff;
    font-weight: bold;
    margin-bottom: 50px;
    background-color: #5c75b7;
}%
```
Về chúng tôi
Published: 2021-10-13 09:41:53

Nông Sản sạch store là cửa hàng cung cấp nông sản sạch, an toàn, 100% tự nhiên. Với mong muốn thực phẩm an toàn sẽ tới tay mọi gia đình Việt Nam. Các sản phẩm tiêu biểu của chúng tôi gồm: Các loại trà, ngũ cốc dinh dưỡng, hạt dinh dưỡng, trái cây sấy,….
Website: <a href=" https://nongsansachstore.com/"> https://nongsansachstore.com/</a>
Asp.net core Routing Giriş.
Tags: dotnet, csharp
Published: 2021-10-13 09:33:26

## Route nedir ?

Türkçe karşılığı rota demektir.

## Asp.net core routing nedir ?

Örneğin hepmizi web sitelerini ziyaret ediyoruz. Sitelerde gezinirken dikkat ediyoruz ki "url"ler değişmeye başlıyor : 

www.example.com
www.example.com/Home
www.example.com/Blog

gibi siteler üzerinde geziniyoruz tabi burada rota'ya veya routing'e /Home ve /Blog gibi değişkenlerdir diyebiliriz.

Asp.net core da ise bu rota'lara göre farklı sayfalar kullanıcıya geri gönderebiliyoruz. Farklı bir rota için farklı kod çalıştırırken başka bir rota için farklı bir kod çalıştırabiliyoruz.

## İnceleyeceğimiz routing çeşitleri :

1.) Conventional Routing

2.) Attribute Routing 

Bu konuları bu yazı serisinde ele alacağım.

Bir dahaki yazımda görüşmek dileğiyle.

En iyi dileklerim ile.

Mustafa Samed Yeyin.
Ciel and A-B Problem
Tags: math, implementation, easy, java
Published: 2021-10-13 09:19:51

> 
In Ciel's restaurant, a waiter is training. Since the waiter isn't good at arithmetic, sometimes he gives guests wrong change. Ciel gives him a simple problem. What is A-B (A minus B) ?<br>
Surprisingly, his answer is wrong. To be more precise, his answer has exactly one wrong digit. Can you imagine this? Can you make the same mistake in this problem?

**Input**<br>
An input contains 2 integers A and B.<br>
**Output**<br>
Print a wrong answer of A-B. Your answer must be a positive integer containing the same number of digits as the correct answer, and exactly one digit must differ from the correct answer. Leading zeros are not allowed. If there are multiple answers satisfying the above conditions, anyone will do.<br>

**Sample input:**
```
5858 1234
```
**Sample output**
```
4625
```

**Output details:**

*The correct answer of 5858-1234 is 4624. So, for instance, 2624, 4324, 4623, 4604 and 4629 will be accepted, but 0624, 624, 5858, 4624 and 04624 will be rejected.*

Solution:-
```
import java.util.*;

class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
	Scanner sc= new Scanner(System.in);
	int n= sc.nextInt();
	int m = sc.nextInt();
	int res = 0;
	if(n>m) {
		res= n-m;
	}else if(m>n) {
		res=m-n;
	}else {
		res=0;
	}
	int rem = res%10;
	
	
		if(rem<9) {
			System.out.println(res+1);
		}
		else if(rem == 9) {
			System.out.print(res-1);
		}
	
	
	sc.close();
	}
}
```
Hacktoberfest: Collabora Online
Tags: hacktoberfest, cool, css, javascript
Published: 2021-10-13 09:06:04

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yknqmiaukwxibx7ce8br.png)
Do you need help with git? Or perhaps some other questions that are blocking you from your contributions in this #hacktoberfest ? Come and ask them yourself every Thursday at ~ 09:20 UTC / 11:20 CEST right before our regular weekly meeting : ) https://collaboraonline.github.io/post/communicate/
Things to Consider When Building Web Components
Published: 2021-10-10 19:26:48

In this post, I will discuss some basic considerations to take into account when building web components. Some examples may include accessibility, security, flexibility, and stylistic aspects.

#Details
For this project we are creating learning cards (shown in image below). The cards are composed of several elements which can be separated into the following components:
- The Icon
- The Banner
- The Slotted HTML (bottom half of card)

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

Breaking the components down a little bit more will allow us to continue to reuse/repurpose the components in future projects.
The icon component is an SVG icon that includes the circle surrounding the symbol. The banner component consists of a header and subheader as well as contains the icon SVG. And finally, the entire card can be considered to have a top and bottom half with the top half including the icon/banner portion and the bottom half being open to include text or whatever information is desired to be put there.

#Expected Obstacles/Past Experience
I have helped create a button component for a previous project, but I believe that this project will be slightly more challenging. I don't have much personal experience with web components and this has much more content to work with than a button does. I believe stylistically making sure that the header and text fits the learning card in the way that we want it to might be the most difficult.

While we are sure to face some difficulties, I believe that we have also gained valuable knowledge from creating the button which we will carry into this project.
A "Brave" way to brows blocked content from terminal
Tags: tor, terminal, brave, content
Published: 2021-10-13 09:03:27

## tl;dr
- <small>Add the brave executable to environment variables</small>
- <small>From the terminal type:  `brave --tor <URL>`</small>


Apart from Google Chrome, [Brave](https://brave.com/) has been one of my go-to browser, specially for its "New Private Window with Tor" feature. Basically it acts as a VPN for browsing ISP/country blocked contents. 

I never liked installing any chrome extension or use any free VPN solution (let alone buying it) to brows any blocked content. In stead, I used to fire up the Brave browser and open a tor tab to load the desired URL. But it was still too much work to load a simple URL, well at least for a software professional.

> Along came the idea to do it from terminal. 

After some research I found out that Brave has a CLI option to open any URL with "New Private Window with Tor". I only have to use the following command -

`path-to-brave-executable --tor <URL>`

For my convenience, I added the brave executable to my environment variables. Now I can type `brave --tor https://medium.com/` in my terminal and voilà.
100 algos in 100 days (Day 28)
Published: 2021-10-13 08:48:27

###Question
###Parenthesis Matching

e.g. given the string:
"Sometimes (when I nest them (my parentheticals) too much (like this (and this))) they get confusing."

given an index of an opening bracket:
e.g. 10

Find the closing bracket.

I quite the method I used to solve this. I started visualizing a very simple example.
(...) - Just the last one
()() - Find first closing
(()) - If there is another opening bracket, ignore the first closing bracket.

This was similar to TDD but just doing it in with examples and coming to a potential algorithm quite quickly.
The Lead Game
Tags: codecity, java, easy, math
Published: 2021-10-13 08:47:50

To View Problem Statement [Click here](https://www.codechef.com/problems/TLG)
Consider the following score sheet for a game with 5 rounds:

**Input**

The first line of the input will contain a single integer N (N ≤ 10000) indicating the number of rounds in the game. Lines 2,3,...,N+1 describe the scores of the two players in the N rounds. Line i+1 contains two integer Si and Ti, the scores of the Player 1 and 2 respectively, in round i. You may assume that 1 ≤ Si ≤ 1000 and 1 ≤ Ti ≤ 1000.

**Output**

Your output must consist of a single line containing two integers W and L, where W is 1 or 2 and indicates the winner and L is the maximum lead attained by the winner.

**Example**

**Input:**
```
5
140 82
89 134
90 110
112 106
88 90

```
**Output:**
```
1 58

```
**Solution**
To run the code [Click Here](https://gouravmk.hashnode.dev/the-lead-game)
```
import java.util.*;
import java.lang.*;
import java.io.*;


public class Main {
		public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
	int n= sc.nextInt();
	int sum=0;
	int sum1=0;
	int arr_win[]= new int[n];
	int arr_diff[]=new int[n];
	for(int i= 0 ; i <n;i++) {
		int  p1 = sc.nextInt();
		int p2= sc.nextInt();
		sum += p1;
		sum1 += p2;
		if(sum>sum1) {
		arr_diff[i]= sum-sum1;
		arr_win[i]= 1;
		}
		else if(sum1>sum) {
			arr_diff[i]= sum1-sum;
			arr_win[i]= 2;
		}
		
		}	
	
int p =0;
	int max=arr_diff[0];
    for(int i = 1 ;i < n; i++) {

    if( arr_diff[i]> max) {
        max= arr_diff[i];
        p=i;

    }
    }
    System.out.println(arr_win[p]+" "+max);

	
	sc.close();
	}
}
```
Learn With me:Apple's Swift
Hello World

Tags: programming, swift, ios, tutorial
Published: 2021-10-13 08:14:55

Hi guys, I'm Ansh and today in this tutorial we are going to learn Swift which is a powerful and initutive programming language by Apple.It's used to create apps for iOS,MacOS,watchOS and so on.Swift's code is concise yet easy to understand and write.
So tighten your seat belts and get ready to take-off .

𝗛𝗲𝗹𝗹𝗼 𝗪𝗼𝗿𝗹𝗱
So keeping the tradition in mind we are going to start with our Hello World in Swift and here it's
```swift
// Swift "Hello, World!" Program

print("Hello, World!") 
```
and this will result into 
```
Hello,World!
```
The code above displays the text Hello, World! on your screen.

Congratulations! You just wrote your first program in Swift.

In next part we'll learn about variables, constants, and literals in Swift.