teleren/devto huggingface dataset:
Decentralized
Identity (DID)
Published: 2020-04-06 08:21:06


did.baidu

[系统架构](https://did.baidu.com/architecture/)

Layer 1：区块链层
分布式存储中保存的是DID文档（DID Document），在文档内最关键的是DID与公钥的对应关系。在区块链上则锚定着这些身份数据的对应关系。
区块链支持Ethereum和Quorum，分布式存储支持IPFS

Layer 2：去中心化二层网络
对上提供了统一的DID解析服务，即DID Resolver

Layer 3：可信交换层
`DID Agent`是用户使用的DID客户端，百度发布了DID小程序，作为DID客户端 uport [daf](https://github.com/uport-project/daf)
`Identity Hub` 是用户安全存储身份数据的组件

[萬字說透去中心化身份系統發展現狀與展望：以 Blockstack 等爲例](https://www.chainnews.com/zh-hant/articles/217043393478.htm)

實現 DID 並不容易，其中會涉及到身份的發現、識別和驗證，相關數據的可信存儲和計算，身份的聲明和憑證等等。

3.5 DID 系統技術棧的挑戰

**DID 在某種程度上與數據共享產生矛盾，有可能會進一步加劇信息孤島，甚至會加大對監管部門的挑戰。** 區塊鏈系統只能在信息輸入後用時間戳保證信息不可篡改，交易不重複，但無法控制信息源頭是否真實，而 DID 目前在法律上不具有效力。一旦監管部門要求對不準確的信息進行修改，但是不可篡改卻難以執行。

可讀性(x)安全性(o)和去中心化(o)

2019 年 5 月 13 日，微軟發佈了其 DID 的實現——ION （Identity Overlay Network）。ION 是一個基於比特幣的雙層網絡，通過 Sidetree 協議訪問比特幣網絡。ION 通過在第二層網絡進行批量合併的方式，將大量 DID 操作合併成一個上鍊操作，並通過將數據存於 IPFS，而通過將數據的哈希存在比特幣網絡上的方式，從而實現 DID 數據的可信存儲。ION 規避了比特幣網絡的性能問題，可以支持每秒數千甚至數萬的數據吞吐量。

隱私問題的解決是 DID 落地的前提
DID 的標識符的難可讀性將阻礙人與人之間進行交流

用戶基數的擴大帶來的一系列問題將會導致 DID 絕大多數可落地的項目只能先開始於 2B 端，比如劍橋區塊鏈等項目，使用門檻增加已經成了必然。


短期內，DID 項目會更多的存在於多方博弈的領域（如供應鏈金融等）以 2B 端的形式落地；中期會隨着效益與公平問題的解決逐步走向 2C 端；長期 DID 在全球將會形成統一的標準，在效益和公平中找到平衡點，實現數據真正地掌握在用戶手中。


DID 本質上是在保證效益的基礎上讓公平程度更加完善，二者之間不斷的博弈與妥協，權衡與取捨。

我們認爲 DID 的發展要隨着法律法規和社會制度的演變而逐步完善。

從短期（未來 5 年內）的角度出發，大多數 DID 項目的發展仍是以 2B 端爲主，爲供應鏈金融等存在多方博弈、運行低效、信息極端不對稱的行業應用領域提供有效的解決方案，以私有鏈或聯盟鏈的形式構建 DID。（提一下各個標準）

從中期（未來 5-10 年）的角度出發，隨着法律基礎設施的不斷完善，DID 出現了符合其自身發展的標準化、法律規範等相關配套設施，來發揮最大作用。DID 將從 2B 端逐步走向 2C 端，隨着智能合約先天缺乏網絡效應的缺憾被逐步彌補，部分 DID 項目開始實現一定的規模效應和網絡效應。

從長期（未來 10 年以後）的角度出發，DID 網絡會逐步出現龍頭，全球將會統一 DID 的標準，DID 在效益和公平中找到了平衡點，監管者以驗證人或存儲機構的方式接入 DID 系統，加強監管的同時保證用戶的隱私，實現數據真正的掌握在用戶手中。


Each of us needs a digital identity we own, one which securely and privately stores all elements of our digital identity.

[擁有自己的數位身分識別](https://www.microsoft.com/zh-tw/security/business/identity/own-your-identity)

[下載技術白皮書](https://go.microsoft.com/fwlink/p/?linkid=2083998)

[Azure 區塊鏈服務文件](https://docs.microsoft.com/zh-tw/azure/blockchain/)

[Azure Blockchain Workbench](https://docs.microsoft.com/zh-tw/azure/blockchain/workbench/)

[快速入門：使用 Azure 入口網站建立 Azure 區塊鏈服務的區塊鏈成員](https://docs.microsoft.com/zh-tw/azure/blockchain/service/create-member)
[快速入門：使用 MetaMask 連線並部署智慧型合約](https://docs.microsoft.com/zh-tw/azure/blockchain/service/connect-metamask)


[部署 Azure Blockchain Workbench](https://docs.microsoft.com/zh-tw/azure/blockchain/workbench/deploy)


## Azure 區塊鏈 

Azure / 區塊鏈 / [下載 PDF](https://docs.microsoft.com/zh-tw/azure/opbuildpdf/blockchain/workbench/TOC.pdf?branch=live)

操作指南
部署 Workbench
管理 Workbench 使用者
版本控制應用程式
使用 Workbench API
針對應用程式進行疑難排解
使用 Workbench 資料
設定 DB 防火牆
取得 DB 詳細資料
在 Excel 中使用資料
在 Power BI 中使用資料
在 SQL ManagementStudio 中使用資料

解決方案範本
Ethereum 權威證明聯盟
Hyperledger Fabric 聯盟 Azure KubernetesService
What is your go to solution/tech/service for sending emails?
Tags: discuss, programming
Published: 2020-04-06 07:50:25

---
title: What is your go to solution/tech/service for sending emails?
published: true
description: 
tags: discuss, programming
---

So, if people haven't [read about it](https://dev.to/barelyhuman/hireme-the-open-source-hiring-platform-92m) (why not?!) , I made a little something. 

And it required email verification and I wanted to have magic link logins which I did implement and I used [SendGrid](https://sendgrid.com/) for it as always.

But have been experiencing delays in email deliveries for the past 30 hours and the magic link login makes no sense when the email is getting delivered 30-40 mins after a person has requested for a login.

Hence, I'd like to know what are other options that are out there and are frequently used by people. 

Any kind of solution is welcome. 

Update: Forgot to mention, It'd be nice if it had a free plan.
Basic Concepts of Javascript
Tags: javascript, webdev, questions
Published: 2020-04-06 07:34:05



This post is based on some basic concepts about JavaScript for Junior Developers and for someone out there looking for an Interview

**1) How to copy or clone an array?**

In the old way, we can copy an array with slice().
const newaaray= oldarray.slice();
after ES6, we can copy array with the spread operator
Const newarray = [...sheeps]

**2) What is the output of +‘16’?**

The result is number 16 of type number because the unary operator tries to convert all strings, boolean and null to number.
+‘-5’ gives -5
+’0xFF’  gives output 255
+‘false’  gives 0
+‘Infinity’ gives Infinity
+’infinity’ gives NaN
+’function’ gives NaN

**3) What does this return?**

!!hello == true
Answer is true

**4) Why can’t we use = to copy an array like (new_variable = existing_array) ?**

Because an array are reference value in javascript. When we write newarray = oldarray, we don’t create new array rather it's reference that point to the same memory location


**5) What is Variable Hoisting in JacaScript?**

Hoisting is a JavaScript mechanism where variables and function declarations are moved to the top of their scope before code execution regardless of whether their scope is global or local

**6) What Closures ?**
Closures is simply the ability of a function at the time of declaration to remember the references of variables and parameters on its current scope, on its parent function scope, on its parent's parent function scope until it reaches the global scope with the help of Scope Chain. Basically it is the Scope created when the function was declared

**7) Value of This in JavaScript?**
The value of , **this** refers to the value of the object that is currently executing or invoking the function.
Arrow Functions doesn't have their own this , in this situation it is refers to its parent 

**8) Arrow Functions**
Arrow functions allow us to write shorter function syntax ,Another significant advantage it offers is the fact that it does not bind its own this. In other words, the context inside arrow functions is lexically or statically defined.

Basic Syntax for arrow function 

hello = () => {
  return "Hello World!";
}

**9) Event Bubbling**
When an event occurs on a DOM element, that event does not entirely occur on that just one element. In the Bubbling Phase, the event bubbles up or it goes to its parent, to its grandparents, to its grandparent's parent until it reaches all the way to the window.


**10) What are Higher Order Functions?**

Higher-Order Function are functions that can return a function or receive argument or arguments which has a value of a function.
function higherOrderFunction(param,callback){
    return callback(param);
}
I have Created Dear Dairy App Using Django
Tags: django, python
Published: 2020-04-06 07:33:19

Hello, Guy's,
I have created DEAR DAIRY APP using Django. It's just a Quote Posting App. I make this is my first app because I am a beginner at Django. I upload it on GITHUB.
Following is my GitHub Link:

https://github.com/shailesh6363/Dairy-App.git

Please update the project if there is missing and let me know.
How to keep events and their listeners organized?
Tags: events, listener, documentation
Published: 2020-04-06 07:27:50

---
title: How to keep events and their listeners organized?
published: true
description: How to document event systems
tags: events, listener, documentation
---

Asking for a friend, obviously...

Say, you a have a well kept legacy codebase with a nice framework in place. It's a rather big piece of monolithic glory. It's maintainable. We're well off.

But the concept of triggers, events and listeners gains traction and now events and listeners are popping up left and right. (When all you have is a hammer...)

Now, nobody is demonizing the concept of events and I... err, my friend has used events and listeners quite successfully. But this feeling of being flooded is setting in. You know, when you are not sure if you have seen that exact event message once or twice before. Are we having multiple messages for the same event in different places? Am I listening to the right event? 

So I was wondering if you guys have a strategy or style of documentation that would help keep things, at least apparently, organized.
A quick one: Multi-Framework Pros and Cons
Tags: microfrontends, multipleframework, vue, frontend
Published: 2020-04-13 12:10:16

---
title: A quick one: Multi-Framework Pros and Cons
published: true
date: 2020-04-06 07:26:48 UTC
tags: micro-frontends,multiple-framework,vue,frontend
canonical_url: https://medium.com/@activenode/a-quick-one-multi-framework-pros-and-cons-ce5ebdbfb306
---

[![](https://cdn-images-1.medium.com/max/2600/1*rjeHd-hcvttOuoWJQNuuqA.png)](https://medium.com/@activenode/a-quick-one-multi-framework-pros-and-cons-ce5ebdbfb306?source=rss-96d012863e35------2)

In my analysis article about #MicroFrontends I talked about the requirements of a Multi-Framework Web Components integration with SSR. You…
 
[Continue reading on Medium »](https://medium.com/@activenode/a-quick-one-multi-framework-pros-and-cons-ce5ebdbfb306?source=rss-96d012863e35------2)
Function Scope Vs Block Scope
Tags: javascript, es6, blockscopping, functionalscoping
Published: 2020-04-06 06:53:40

In JavaScript there’s two kinds of scope: function-scope and block-scope

##Function-scope##
function myFn() {
  var foo = 'peekaboo!';
  console.log(foo); // 'peekaboo!'
}
console.log(foo); // ReferenceError: foo is not defined

Using var, variables are function-scoped because their visibility is limited to the function. When you try to use it outside of the function, you’ll get an error.


##Block-scope##

A block of code is the code between curly braces in JavaScript

if (true) {
  var message= 'peekaboo!';
  let text = 'i see u';
  const string = 'baby blue!';
  console.log(message); // 'peekaboo!';
  console.log(text ); // 'i see u';
  console.log(string ); // 'baby blue!';
}
console.log(message); // 'peekaboo!';
console.log(text ); // ReferenceError: bar is not defined
console.log(string ); // ReferenceError: baz is not defined

Notice the visibility of message isn’t limited by the if-statement block. However, both text and string are limited in visibility to the block of code.

This concept of scope is the most prominent distinction between the old-fashioned var and modern let/const.

We will cover use of let/const/var in next article.
Flask Delicious Tutorial : Building a Library Management System Part 3 - Routes
Tags: showdev, flask, tutorial, python
Published: 2020-04-06 06:53:15

---
title: Flask Delicious Tutorial : Building a Library Management System Part 3 - Routes
published: true
description: Understand how routes work in Flask
tags: showdev, flask, tutorial, python
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/r6dxbtk943x48c84eh87.png
---

Previous: [Part 2: Start With A Loaded Skeleton](https://dev.to/abdurrahmaanj/flask-delicious-tutorial-building-a-library-management-system-part-2-start-with-a-loaded-skeleton-3j96)

I have configured what we need in this repo: [DeliciousFlask-3.1](https://github.com/Abdur-rahmaanJ/DeliciousFlask-3.1). Download it, and run app.py (If you are new to python see Part2).

In this part we explore some concepts related to routes.

If you run the above, app and go to _http://127.0.0.1:5000/_

you should see

```
abcd
```

why? because we said so in app.py:

```python
@app.route('/')
def index():
    return 'abcd'
```

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

Let's try `http://127.0.0.1:5000/test`

we get `test ok`

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

As we configured it:

```python
@app.route('/test')
def route_test():
    return 'test ok'
```

## Adding Parameters

if you do `http://127.0.0.1:5000/greet/bob` you will get:

`hi bob`

whatever you put after greet, it will always return `hi` + what you put

That's because Flask allows you to specify parameters. Here's how you do it:

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

## Operations using parameters

Let's say you want to do:

`/add/2/3` and you want to get `5`

in app.py you will see a function:

```python
@app.route('/add/<a>/<b>')
def add(a, b):
    return '{}'.format(a+b)
```

But, if you run it, you'll get ... 23

That's because a and b are strings

If you want to get 5, you must convert before adding.

```python
@app.route('/real-add/<a>/<b>')
def real_add(a, b):
    return '{}'.format(int(a) + int(b))
```

## Specifying types in parameters

If you want to get a and b as integers directly, you can do so by specifying the type at the begining:

```python
@app.route('/converted-add/<int:a>/<int:b>')
def converted_add(a, b):
    return '{}'.format(a+b) # no need to convert
```

If you try `converted-add/5/abc` you will get errors.

## Why do i get `# AssertionError: View function mapping is overwriting an existing endpoint function: <name here>`?

That's because if you do for example:

```python
@app.route('/')
def index():
    return 'abcd'

@app.route('/test')
def index():
    return 'test ok'
```

The first and second functions have the same name. You must change the second function's name to something else.

## TODO

Add a snippet so that when we do

`/multiply/5/3` we get `15`

Stay tuned for the next part!

_My mail if you don't understand something: arj.python at gmail dot com_

Next: [Part 4 - Focus On Responses](https://dev.to/abdurrahmaanj/flask-delicious-tutorial-building-a-library-management-system-part-4-focus-on-responses-4j18)
Developers should be good at documentation
Tags: documentation, developers, writing, technical
Published: 2020-04-06 06:30:32

---
title: Developers should be good at documentation
published: true
description: Docu... what? Yeah, I said it. If we want to work well as a team, developers need to write clear documentation, because the average code base isn't self-documenting.
tags: documentation, developers, writing, technical
---

Docu... what? Yeah, I said it. If we want to work well as a team, developers need to write clear documentation, because the average code base isn't self-documenting.
A productive web developer needs a buddy in his browser (Chrome Extension)
Tags: webdev, javascript, productivity, beginners
Published: 2020-04-06 06:25:11

---
title: A productive web developer needs a buddy in his browser (Chrome Extension)
published: true
description: Stay productive and have an easy view on all the data available about you when browse a page!
tags: webdev, javascript, productivity, beginners
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/muquagtw345t086g7xye.png
---

We all want to be productive web developers.

As a Fullstack Web Developer I find myself debugging a lot the same things over and over again. This is used for both making logic around the results and especially to understand that everything behaves as expected and that there is nothing unusual on the client's end. Things like:

- Browser details (User Agent, Languages, ..)
- Page details (History, Location, Protocol, Host, Origin,..)
- Supported Features (Geolocation, Canvas, Touch device, ...)
- Screen sizes (Window, Body, Document, Resolution, ...)
- Storage (Cookies, localStorage, sessionStorage, ...)
- Geo IP / Position (Latitude, Longitude, ..)
- CSS supported features (Animations, Transforms, Media queries, ...)

As you can see, the above list is endless, and we don't want to end up opening the DevTools each time, we just want this information available to our needs in a 1-Click distance! For this need, I created a new [Chrome Extension](https://bit.ly/browserbuddy) called [BrowserBuddy](https://www.browserbuddy.me) to easily give you a full visibility on these.

So it's now easy to view the info available and stored about you in the browser!

**Screenshots**

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

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

Clicking any row will also tell you what code can retrieve the value:

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

I hope you find this helpful as I am 😊
If you have any comments or suggestions to add, feel free to comment!


----

If you liked the article, please click the ❤️ below so other people will see it on DEV.to :) ! Feel free to [follow me on Github](https://github.com/otomer)
Download Torrent File with IDM More Than 4 GB Free
Tags: torrent, idm
Published: 2020-04-06 06:24:49

Torrents are an extremely common way for some people to download and get files, including legal jobs and the daily internet user. Torrents aren’t inherently prohibited to take or make, but it’s crucial to think that unless you learn where to expect, it’s far too simple to go affected in malicious or illegal activities.

Before we begin, understand that torrenting is the form of file sharing and is not inherently criminal. Still, most of the material you see on torrent websites is copyrighted material and downloading it is very often not permitted; if you torrent the film, novel or play, you’re breaking the law. What you do is up to you, but remember you’re making it on the personal looking.
https://bloggerali.com/download-torrent-file-with-idm/
How to make a parallax effect with Rellax.JS
Tags: javascript, tutorial, beginners
Published: 2020-04-06 06:59:42

---
title: How to make a parallax effect with Rellax.JS
published: true
date: 2020-04-06 00:00:00 MDT
tags: javascript, tutorial, beginners
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/lgrgs8eygjie7v4syjzh.jpeg
description: Making a parallax with JavaScript or CSS can be difficult, so make it easy with Rellax.js, a super lightweight library (1021b gz) for making parallaxes.
canonical_url: https://developerbacon.ca/articles/how-to-make-a-parallax-effect-with-rellax-js/
---

[Rellax](https://dixonandmoe.com/rellax/) is a lightweight library made exactly for [parallax](https://en.wikipedia.org/wiki/Parallax) effects. This JavaScript library makes it very easy to make a parallax effect so that you don't have to go through the trouble of making it your self.

## Installation

This is by far the most important step. If this is not added then anything will work because it was not installed :)

```bash
npm install rellax
#of
yarn add rellax

```

## Importing

Just like other JavaScript libraries, you will need to import the script into your

```js
import Rellax from "rellax";

```

After you have imported the library you will want to set a variable for it to set the settings later on. The only variable you need to set when making this is the class that Rellax.js will look for to apply the parallax.

```js
var rellax = new Rellax(".rellax");

```

## JavaScript config

To change the settings for Rellax.js you will need to replace the variable definition with the below code. This sets the defaults for every parallax element.

```js
var rellax = new Rellax(".rellax", {
    speed: -2,
    center: false,
    wrapper: null,
    round: true,
    vertical: true,
    horizontal: false
});

```

## Adding the effect

Now let's say that you have an image that you would like to apply the parallax to and the HTML looks something like this:

```html
<img src="cool-parallax-image.jpeg" alt="" />

```

To let Rellax.js know that you want to add the parallax to this element we will add the class from before to this element, like so:

```html
<img src="cool-parallax-image.jpeg" class="rellax" alt="" />

```

## Parallax speed

Just adding the class will set the default parallax speed for the element. If you want to increase or decrease the speed of the parallax then you can add this `data-rellax-speed` attribute to that element as well as the class. The minimum value is -10 and the maximum value is 10.

```html
<img src="cool-parallax-image.jpeg" class="rellax" data-rellax-speed="-7" alt="" />

```

If you would like to learn more about what Rellax.js can do check out there [Github documentation](https://github.com/dixonandmoe/rellax).
The Ultimate Git Tutorial Part 5: Undoing Changes and Reverting Commits
Tags: git, productivity, beginners, github
Published: 2020-04-06 05:37:58

**About Me:** I've been a professional web developer for just over 10 years now. I'm currently the lead web development instructor at [Better Coding Academy](https://codebetter.com.au), and as part of what I do, I post videos on our YouTube channel at [https://www.youtube.com/c/BetterCodingAcademy](https://www.youtube.com/c/BetterCodingAcademy).

_(Subscribe for awesome web development content!)_

I'm releasing a full series covering the use of Git from the very beginning! This series will cover everything from cloning, pulling, branching, merging, and so much more. Here's the fifth video in the series - stay tuned for more to come very soon!

{% youtube g8UgXgqEJXs %}

Happy coding!
The Ultimate Git Tutorial Part 4: Merging and Resolving Conflicts
Tags: git, productivity, beginners, github
Published: 2020-04-06 05:17:34

**About Me:** I've been a professional web developer for just over 10 years now. I'm currently the lead web development instructor at [Better Coding Academy](https://codebetter.com.au), and as part of what I do, I post videos on our YouTube channel at [https://www.youtube.com/c/BetterCodingAcademy](https://www.youtube.com/c/BetterCodingAcademy).

_(Subscribe for awesome web development content!)_

I'm releasing a full series covering the use of Git from the very beginning! This series will cover everything from cloning, pulling, branching, merging, and so much more. Here's the fourth video in the series - stay tuned for more to come very soon!

{% youtube icUggPL4qpY %}

Happy coding!
ASP.NET Basics: Inject Service into Controller
Tags: beginners, webdev, dotnet, csharp
Published: 2020-04-06 14:39:41

---
title: ASP.NET Basics: Inject Service into Controller
published: true
date: 2020-04-06 05:00:00 UTC
tags: beginners, webdev, dotnet, csharp
canonical_url: https://wellsb.com/csharp/aspnet/aspnet-inject-service-into-controller/
---

In this tutorial, you will learn how to use C# dependency injection to inject a service into a controller. This is useful if you need to call an action from within a separate controller.

## Register Service Class

First, register your service class with the `ServiceCollection` interface. Open **Startup.cs** of your project and locate the `ConfigureServices` method. Depending on how your service is configured, you might register it through the HttpClientFactory.

```csharp
services.AddHttpClient<ApiService>(client =>
{
	client.BaseAddress = new Uri(Configuration["ApiBase"]);
})

```

Or you might register as a service with Singleton, Scoped, or Transient lifetime.

```csharp
services.AddTransient<ApiService>();

```

## Inject into Controller

To inject the service into your controller, use the standard C# dependency injection technique.

```csharp
[Route("stripe/[controller]")]
public class CustomerWebhook : ControllerBase
{
	private readonly ApiService _apiService;
	public CustomerWebhook(ApiService apiService)
	{
		_apiService = apiService;
	}
	
	//Add controller actions
}

```

## Invoke Service Method from Controller

Suppose you have a method in your service class that calls an API controller to get a user from the database by the user’s ID.

```csharp
public async Task<User> GetUserByIdAsync(int id)
{
	var response = await _httpClient.GetAsync($"api/users({id})");
	response.EnsureSuccessStatusCode();
	using var responseContent = await response.Content.ReadAsStreamAsync();
	return await JsonSerializer.DeserializeAsync<User>(responseContent);            
}

```

The service class’s `GetUserByIdAsync()` method interacts with the project’s **UsersController**. You might need this user information from within another controller, **AnotherController**. If you have injected **ApiService** as a dependency in **AnotherController** , you can easily use it to interact with **UsersController**.

```csharp
var dbUser = await _apiService.GetUserById(userId);

```

## The Bottom Line

In this tutorial, you learned how to inject a service into a controller. That controller could be an API controller, an MVC controller, or a webhooks receiver. In the next tutorial, we will put this technique into practice as we create a listener controller to respond to webhooks sent by Stripe.

[Source](https://wellsb.com/csharp/aspnet/aspnet-inject-service-into-controller/)