teleren/devto huggingface dataset:
Neural Network Basics: Building a Neural Network
Tags: machinelearning, learninpublic
Published: 2020-03-16 12:33:54

In the [previous post](https://dev.to/_akshaym/neural-network-basics-the-perceptron-3c4), we discussed the structural building block of a neural network, also called the perceptron. In this post, we will learn how these perceptrons connect together to form a layer of a neural network and how these layers connect to form what is called a deep neural network.

## Multi-Output Perceptron

Let us recall the structure of a perceptron, that we discussed in the last post.

![Perceptron](https://dev-to-uploads.s3.amazonaws.com/i/dcvyxtds6zv4tfrwsij0.png)


Now, let us consider that we have 2 perceptrons, instead of 1, each connected to all the inputs. This can be visually represented as the image below.

![Multi Output Perceptron](https://dev-to-uploads.s3.amazonaws.com/i/68eh10p86clwmm2zm16v.png)

This is called a multi-output perceptron.

- This allows us to create as many outputs as we want, by stacking together multiple perceptrons.
- For the sake of simplicity, the bias term has been omitted here.
- Each perceptron is connected to all the inputs from the previous layer. This is known as a **dense layer**.

## Single Layer Neural Network

Let's add more perceptrons to create a single layer neural network.

![Single Layer Neural Network](https://dev-to-uploads.s3.amazonaws.com/i/jln1fzscqji3dbix5ttf.png)

Here, we can see 3 types of layers:

- The first layer contains the inputs to the network and is called Input Layer
- The last layer provides the final output of the network and is called the Output Layer
- The layers between the input and output layer are called the Hidden Layers. **The number of hidden layers represent the depth of the network**.

As the number of connections increase, so do the number of weights. For example, there are two sets of weights, w<sub>1,1</sub><sup>(1)</sup> connecting x<sub>1</sub> to z<sub>1</sub> & w<sub>1,1</sub><sup>(2)</sup> connecting z<sub>1</sub> to y<sup>^</sup><sub>1</sub>. The equations for the perceptrons in the hidden and output layer can be represented as:

![Layer Equations](https://dev-to-uploads.s3.amazonaws.com/i/z7216i0cfkilzukxs3es.png)

To make these easier to manage, and also to speed up computation, the inputs, weights, and outputs are usually stored in the form of vectors. This also allows us to take advantage of multi-core CPUs to speed up training by better parallelizing computations.

To vectorize the equation, we can represent input, output, and weights as vectors and simply replace the summation of products with a matrix dot product:

![Vectorized Equations](https://dev-to-uploads.s3.amazonaws.com/i/g2pz56uak33hw5n2j9dz.png)

## Conclusion

In this post, we learned how a neural network is constructed by connected individual perceptrons. In the next part, we will see how the network computes the output and eventually gets better and more accurate.

I would love to hear your views and feedback in the comments. Feel free to hit me up on [Twitter](https://twitter.com/_akshaym).
The perils of configuration security
Published: 2020-03-16 12:21:08

A [MyDevSecOps live session](https://www.mydevsecops.io/post/the-perils-of-configuration-security) from Feb 26, 2020 by [Gareth Rushgrove](https://twitter.com/garethr)

With the growth of cloud and API-driven infrastructure, came infrastructure as code. This movement shifted the management of configuration from a mainly hidden part of IT, to a larger and more explicit part of software development. If you’re not writing YAML files you’re probably writing tools to write YAML files.

But an incorrectly configured application can have an outsized impact on the common security challenges of confidentiality, integrity and availability.


In this discussion we’ll look at:

- Examples of real-world hacks related to configuration issues

- The problems found in projects like Kubernetes that have a large configuration surface area

- What it looks like to apply application security approaches to infrastructure as code

- Demos of tools that are emerging to help test configuration

This session should be of interest to developers and operators struggling with the explosion of configuration as well as security analysts interested in the higher level emerging problem of configuration security.

{% youtube LKZlFOVqfY4 %}
How to cleanup "C Drive" on windows and speed up your PC
Published: 2020-03-16 12:18:01

As we all know that the “C” drive is very important for most people, or almost all windows because it is the place where their operating system is installed, and all the crucial system files are kept. Inevitably, this is also the drive that gets filled up most easily due to endless Windows updates, downloaded files that you forget about, and the fact that by default everything saves to the “C” drive and that is why it is filled up very quickly and sometimes it also reached to its end without any reason.

Here I’ll show you how to clean up your drive, recover some space, and subsequently get it running nicely and quickly again.

1.  By Using "%temp% command" 

Open Run Prompt > Type %temp% > Click Ok > Select All > Shift+Del



2. By Using "temp" Command

Open Run > Type "temp" > Click OK > Select All > Shift+Del



3. By using "Recent" Command

Open Run Prompt > Type "Recent" > Click Ok > Select All > Shift+Del

 For More Read this article: https://www.myinquisitor.in/clean-c-drive-on-windows-and-speed-up-your-pc/
Select programs on Coursera going at $3.14 with Pi Day Event
Tags: datascience, machinelearning, computerscience, tutorial
Published: 2020-03-16 12:06:54

Hello everyone, just wanted to give you all a quick heads up! Select specialization and certificate programs on coursera are going at $3.14 at the moment for the first 30 days. 

This unique event ends on 30th of March 2020. If you are looking for a program to which this offer applies, consider learning more over here:

https://onlinecoursesgalore.com/coursera-pi-day-promo/

Let me know if yo have any questions.

Cheers
Website with Notion
Tags: career
Published: 2020-03-16 11:57:08

A personal website is an opportunity to share your thoughts with the world. It is your piece of the internet where others can learn a bit more about you. I consider myself an accomplished engineer with an eye for design. Still, I struggled for years to be comfortable with my website appearance. Last week one thought came to mind — Is it that important?.


### Are the looks of a personal website that important for an engineer?

In my case, I believe the content is more significant than aesthetics. [Notion](http://notion.so/) has the basic building blocks so I can focus on the content without bothering about look 'n' feel.

Notion comes with some **cons**:
- I can't optimise SEO;
- The pages location is tied to the path Notion generates;
- It's not simple to get insights on user behaviour and behaviour;
- The line-height could be more spacious.


### Are the cons a show stopper?

**No.** I was never the type of person to own a personal blog, not having a suitable site has been my excuse for the past years. Let's see where not having to worry about the looks takes me. Writing more is the minimum value proposition of this change.

### What is Notion?

They describe it better than I do.

> The all-in-one workspace for your notes, tasks, wikis, and databases.

But don't be fooled. This simple mantra doesn't come close to explain the awesome things you can do with the building blocks the fantastic team behind notion brings to you.

Checkout the result of a my website with [Notion](https://www.notion.so/fampinheiro/Hey-5c96b52345db451d83c84ace047769d3).
Provide simple value for components in Angular
Tags: provide, inject, angular
Published: 2020-03-16 09:54:13

---
title: Provide simple value for components in Angular
published: true
description: Provide simple value for components in Angular
tags: provide, inject, angular
---

Sometimes you need to inject a simple value into multiple components

[![Edit provide-use-value](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/goofy-http-tu7nl?fontsize=14&hidenavigation=1&module=%2Fsrc%2Fapp%2Fapp.module.ts&theme=dark)

To inject a simple value you have to pass an object to the providers array of your `NgModule` decorator.

```ts
@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule],
  providers: [
    {
      provide: "language",
      useValue: "en"
    }
  ],
  bootstrap: [AppComponent]
})
```

And in your components import `Inject` decorator:
`@Inject()` is a decorator relevant for DI and helps you manually inject a value into your components.


```ts
import { Component, Inject } from "@angular/core";

....
export class AppComponent {
  constructor(@Inject("language") private language) {
    console.log(this.language);
  }
}

```


You can also use `@Inject()` decorator to provide services from your module.

Ex:
```ts
import { Component, Inject } from "@angular/core";
import { AppService } from "./app.service";

@Component({
  selector: "app-root",
  templateUrl: "./app.component.html",
  styleUrls: ["./app.component.css"]
})
export class AppComponent {
  constructor(
    @Inject("language") private language,
    @Inject(AppService) private appSer,
    private appSer2: AppService
  ) {
    console.log(this.language, this.appSer, this.appSer2);
  }
}
```
Using: 
```ts
...
    @Inject(AppService) private appSer,
    private appSer2: AppService
...
```
Above code illustrates 2 ways of injecting a service into your component.

Hope you find it useful and see you on the next post!
Stay safe!
Shell command options you didn't know you needed (or possibly even existed) #4
Tags: bash, linux, shell, unix
Published: 2020-03-16 11:39:14

OK - this is the first one that surprised me in this series - #1 and #2 were things I kind of knew *had* to exist, it was just a matter of finding them, but this one was more "Oh. Oh that's neat." Also, obvious in hindsight :D

We're talking about `grep -Z`.

Following on from #3, in fact - the `-Z` option spits out filenames from `grep` terminated by `NUL`. Same reasoning as `find -print0`, but allows you to do things like this:

`grep -l -r -Z "error" . | xargs -0 cp -t failurelogs/`

And yes, `cp -t` does exactly what you expect :D {% link https://dev.to/fleetfootmike/shell-command-options-you-didn-t-know-you-needed-1-ei0 %}
CryptoZombieをやる2
Tags: solidity, cryptozombies, ethereum
Published: 2020-03-16 11:33:24

---
title: CryptoZombieをやる2
published: true
tags: Solidity, CryptoZombies, Ethereum
---

![CryptoZombies](https://dev-to-uploads.s3.amazonaws.com/i/zhrfr556o585his1j862.png)


[shinjuku-mokumoku](https://shinjuku-moku.connpass.com/event/167655/)会においてSryptoZombiesの続きを進めました。

https://cryptozombies.io/

SolidityのLesson4からLesson5までの内容になっています。

Lesson3までは前の記事を見てください。

{% link https://dev.to/yutagoto/cryptozombie-2jal %}

## Lesson4

バトルシステムを作っていく章です。

### Payable

Etherを受け取ることができる特別なタイプの関数です。

```sol
  function buySomething() external payable {
    // Check to make sure 0.001 ether was sent to the function call:
    // 関数呼び出しで0.001 etherが送金されたか確認する
    require(msg.value == 0.001 ether);
    // 関数を実行する
    transferThing(msg.sender);
  }
```

このような感じに関数を定義します。

### withdraw

送ったはいいものの、送られた側は引き出さないと使えないのでちゃんと引き出します。

```sol
contract GetPaid is Ownable {
  function withdraw() external onlyOwner {
    owner.transfer(this.balance);
  }
}
```

transfer関数でownerのアドレスに送金することができます。this.balanceはコントラクトに溜まっている残高の総量を返します。
例えば100人のユーザがownerのコントラクトに1 etherずつ送金していたとすると、上記関数をownerが実行したら100 etherがownerのアドレスに入ることになります。。

### 乱数

`keccak256` でランダムなハッシュ値が生成されます。それを uint に変換することでランダムな整数になります。
たとえば、1-100のランダムな値の生成は以下のようにします。

```sol
uint randNonce = 0;
uint random = uint(keccak256(now, msg.sender, randNonce)) % 100;
randNonce++;
uint random2 = uint(keccak256(now, msg.sender, randNonce)) % 100;
```

nowというタイムスタンプとmsg.sender、randNonceで生成されるので、randomとrandom2は異なる値になる可能性が高いです。(100で割ったあまりなので奇跡的にかぶることはあるが、そう発生しないので無視できる)


#### 脆弱性

ただこの方法での乱数生成には脆弱性があります。解決にはチュートリアルの域を超えているので https://ethereum.stackexchange.com/questions/191/how-can-i-securely-generate-a-random-number-in-my-smart-contract のディスカッションを見てみましょう。

自分のノードに向けてトランザクションを発行し、自分の都合の良い結果になるまで繰り返し行うことができる脆弱性があります。
都合のいい結果がでるまでやり直せられるので、例えばコイントスのコントラクトがあると、常に当たるまで計算をやり直せられて100％儲けられますね。

解決策のひとつにイーサリアムのブロックチェーン外部から乱数関数にアクセスするために oracle を使うアイディアがあります。oracleについてはあとのレッスンでやるみたいです。


## Lesson5

ゾンビトレードしたいので、Tokenとか規格とかを独自に作っていきます。

### トークン

イーサリアム上のトークン は、基本的にいくつかの共通ルールに従ったスマート・コントラクトになっています。
ERC20はトークンの送金、残高照会、アドレス毎の残高記録など、トークンを発行するのに必要な機能について定められています。ERC20で作成されたトークン同士は互換性があるので連携しやすくなっています。ERC721は同じトークンでも、それぞれがユニークであると仮定され異なる特徴を持たせることができます。ERC721であれば、同じトークン（ゾンビ）でもレベルが異なれば別物として扱うことができます。

### 多重継承

継承は一つじゃなくてもOK！カンマ区切りで複数個継承することができます

```sol
contract SatoshiNakamoto is NickSzabo, HalFinney {
  // ...
}
```

### ERC721の実装

独自の規格はそれようのコントラクトを用意して、関数をオーバライドしていって作っていきます。

### オーバーフロー、アンダーフロー対策

uint8の整数型だと最大が255になります。ここで1が加わるとオーバーフローを起こして0になってしまいます。。

OpenZeppelinのSafeMathというライブラリを使うと防ぐためのメソッドを用意することができます。

```sol
using SafeMath for uint256;

uint256 a = 5;
uint256 b = a.add(3); // 5 + 3 = 8
uint256 c = a.mul(2); // 5 * 2 = 10
```

SafeMathの詳しい中身は https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/SafeMath.sol にあります。
How is Covid-19 impacting the UK job market?
Tags: career
Published: 2020-03-16 11:29:24

Should you still be looking?
<p>
It's come as yet another blow to the high street and airlines are struggling, but there are some postives: 

1) Many companies are now interviewing remotely to minimize risk, which is making the overall hiring process faster, more convenient and cheaper for candiates.

2) Companies which have always been hesitant about remote working are now realising that flexibility doesn't come at the expense of productivity, something which increases access to opportunity to a great number of people and increase diversity

3) Infrastructure will also improve for people who already work remotely as it becomes "the new normal"

4) There's a reduction in meetings for the sake of meetings or "face time" - boosting productivity 

5) As with any time of change, there will be less competition for the top jobs as many people hold off on making any moves
<p>
So overall, still a good time to look depending on industry.
<p>
<p>
<p>
<p>
<p>
<p>
If you'd like to have a chat about any of my latest roles below, get in touch

👉 ashleigh@bsqit.com
👉 0117 927 0195


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/jhg3l9up6ofj9dvrdclh.png)
Intro a passportjs con node y mongoDB
Tags: node, webdev, howto, mongodb
Published: 2020-03-16 11:25:28

#Seguro, flexible y modular

Passportjs nos ayuda a autentificar a nuestros usuarios, clientes o visitantes, de una forma sencilla, ágil y robusta.
Passportjs está diseñada para trabajar con base en express.

Para comenzar y suponiendo que nuestro proyecto está preconfigurado vamos a instalarlo.

**Vamos a necesitar:**
```
//=================================
// * passport
// * passport local
// * passport local moongose
// * express-session
//=================================
```
1. passport
*es la librería principal.
2. passport local
*es la más simple, solamente para declarar usuario y password.
3. passport local moongose
*es el driver para nuestra base de datos en mongoDB.
4.express-session
*nos ayudará a configurar las sesiones una vez logueado el usuario.


Comenzamos instalando lo necesario
```node
npm install passport passport-local passport-local-mongoose express-session --save
```

Una vez instalados los paquetes necesarios vamos a crear nuestro modelo de usuario.

user.js
```javascript
const        mongoose   =   require('mongoose'),
passportLocalMongoose   =   require('passport-local-mongoose');

const UserSchema = new mongoose.Schema({
    username: String,
    password: String
});
// añadimos todas las características de passport a nuestro schema
UserSchema.plugin(passportLocalMongoose);
module.exports = mongoose.model('User', UserSchema);
```
Ahora vamos a nuestro archivo principal js, en mi caso app.js y configuramos passport para funcionar con express y mongodb.

app.js
```javascript
//declaramos nuestra variables 
const   passport        = require('passport'),
        LocalStrategy   = require('passport-local');
//importamos nuestro modelo Usuario
        User        = require('./models/users'),

//configuramos passport
app.use(require('express-session')({
   secret: 'Una frase secreta para encriptar',
   resave: false,
   saveUninitialized: false
}));
app.use(passport.initialize());
app.use(passport.session());
passport.use(new LocalStrategy(User.authenticate()));
passport.serializeUser(User.serializeUser());
passport.deserializeUser(User.deserializeUser());
app.use(function(req, res, next){
    res.locals.currentUser = req.user;
    next();
}); //le pasamos a nuestro express el usuario de manera global
```
Ya tenemos nuestro servidor a punto para usar passportjs.

###Vamos a ello.
app.js
```javascript

app.post('/login', passport.authenticate('local', 
            {
               successRedirect: '/bienvenido',
               failureRedirect: '/login',
               failureFlash: 'Usuario o contraseña incorrecto'
            }), (request, response){}
        );
app.get('/loggout', (req, res) =>{
    req.logOut();
    res.redirect('/index');
});
```

Con la función incorporada ***authenticate()*** de passportjs, obtendremos el resultado de si el usuario está identificado o no.

Todo esto sucede gracias a passportjs y sus métodos de fácil uso.

Aquí os dejo el link a mi código un poco más complejo pero donde utilizo casi toda la funcionalidad de passportjs [codigo](https://github.com/3rChuss/YelpCamp)
Starting remote work journey - Day 0
Tags: remote, corona, watercooler
Published: 2020-03-16 11:20:13

---
title: Starting remote work journey - Day 0
published: true
description: Thanks to corona we are all moving now to remote first policies and therefore I want to write down my thoughts and experiences
tags: remote, corona, watercooler
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/cuf97jx7k7ug488ck4k3.jpg
series: working from home
---

Everything has to happen quickly. Over the last 4 days, in Berlin the news started with my employer telling people to work from home if possible. There is already a great [blogpost](https://jobs.zalando.com/en/tech/blog/how-to-work-remotely-at-zalando/?gh_src=gk03hq) about how we should work remotely. 

On Friday, 13th 😱, I suspected that such immediate action from Zalando and early news of some German federal states closing schools. My gut told me, I should go out and plan for my 2 kids ( 5 and 2). They will be at home for 5 weeks soon.

Interestingly, I decided to go to a big mall and at 9 am it was quiet empty, shelves full 😃. To be fully transparent, I also bought twice as much as I need, due to people buying like crazy and me not finding most stuff for more than a week. Yes, at one point as a father you start acting similar.

Over the weekend, more breaking news came in. Clubs, Bars are closing, any gathering of people >50 is prohibited and <50 you need to keep a list. Borders are closing.

These last 4 days were like being part of a Hollywood Movie, like "World War Z" were people are going crazy and you are trying to be calm yet it is not possible.

At the same time, I had to fix a broken door in our bed room in order to be able to close it, so I can work without being distracted by kids 😃 Luckily, when we moved to a new flat in 2018 I planned a small "home office" area which is now in our bed room and the past work area is another play are for our kids.

Here we are now, planning with my wife for at least next 5 weeks. We also sit down on Sunday and established a plan how we can both still be able to work and take care of our kids. To summarize it:

> It will be a huge challenge to work remotely (2 jobs) and take care of small kids.

Thankfully, everything is setup, our Daily Standups are happening via Hangout.

One of the first things I did was to update our Spotify Account to a Family Membership as we will need multiple accounts streaming in parallel 😃

So far it feels totally surreal and I'm still trying to calm down and understand what is happening around me.

Take care everyone!
Are 3rd Party CSS Frameworks Dead?
Tags: css
Published: 2020-01-28 17:08:05

It's 2021, 10 years after the release of [Bootstrap](https://en.wikipedia.org/wiki/Bootstrap_(front-end_framework)) and [other CSS Frameworks](https://en.wikipedia.org/wiki/CSS_framework). 

Are CSS Frameworks dead? My opinion is: "no, but they are less important than before". Why? Consider the HTML5 Grid and SCSS; which together, give us complete height, width, column and row control, as well as specificity.

CSS itself is a poor example of a [DSL](https://en.wikipedia.org/wiki/Domain-specific_language) that implements pseudo inheritance using Cascades. It's hard because finding out about browser internals is not something we can read up on.  Therefore, CSS is pretty much a "Learn by your failures" thing.  Many of us have had those CSS moments where anything we try doesn't work.

>The simpler parts of CSS, such as background, color, margin, padding, height and width or font size, font family, font weight, box shadows and borders give us good control over the page.  These rules are simple to use.

>Pseudo elements such as hover, after, before are also easy to understand. 

>This means we have all fine adjustment tools we need, and are easy to understand.

The birth of entire industries that made layout easier was a direct result of the hard parts of CSS.  Those hard parts are history, when we use SCSS, the HTML Grid, and @media print (for print layout). 

JWP2020
Loneliness in tech
Tags: discuss, watercooler, productivity, remote
Published: 2020-03-16 11:05:51

I'll preface this with a quick bit about me: I've been a remote worker for just over 5 years now, typically I'll try to go to the office once a week. This is certainly something I have had to deal with.

With recent world events looking to increase the number of people working from home, particularly with the added difficulty of lockdowns reducing opportunities for social interaction, this is a topic worth discussing.

I'll list a couple of things I've done over the years to help with loneliness, but I'm really interested in hearing what tips and advice the community has to offer.

#### Join online communities

I mean actively; not passively lurking. Be it Twitter, Reddit, dev.to, Slack, Discord, or anywhere. Start the conversation or join in. You're here, reading this! Drop something in the comments.


#### Get some fresh air

I appreciate the irony in this. Usually my advice would be to seek out places you could work outside of a home office occasionally, e.g. co-working space or coffee shop; however, this becomes *much* more difficult where everything but essential travel is restricted. 

Even if you have a garden space, no matter how small, it can help to get out and take in that fresh air. Even if it is just an open window.


#### Favour video rather than audio only

Seems like a no-brainer but for the longest time meetings and informal chats were always audio only for me.

---

What advice do you have for dealing with loneliness? What experiences have you had?

---

I'm more than happy to have a natter on Twitter with anyone, about anything [@thatonejakeb](https://twitter.com/thatonejakeb).
IGT LPG Gas Regulator Products
Tags: igt, regulator, gas
Published: 2020-03-16 10:36:31

Find here  IGT LPG Regulator, Liquefied Petroleum Gas Regulators companies,  Manufactures, suppliers & exporters in India. Get touch items & location of businesses producing and supplying LPG Regulators, Liquefied Petroleum Gas Regulators over India.