teleren/devto huggingface dataset:
Pushing Left, Like a Boss — Part 5.12 — Authentication (AuthN), Identity and Access Control
Tags: programming, tutorial, beginners, security
Published: 2019-09-12 17:46:39

---
title: Pushing Left, Like a Boss — Part 5.12 — Authentication (AuthN), Identity and Access Control
published: true
description: The 5th section of this series details various examples of secure coding.
series: Pushing Left Like a Boss
tags: programming, tutorial, beginners, security
---
###This series, and my blog, have moved! [Check it out](https://wehackpurple.com/g8tg)!
---
Note: much of this comes from the [OWASP Cheat Sheet on Access Control](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Access_Control_Cheat_Sheet.md), by Shruti Kulkarni, Adinath Raveendra Raj, Mennouchi Islam Azeddine and Jim Manico. And if not, it may come from one of the other offerings from the amazing [OWASP Cheat Sheets Project](https://github.com/OWASP/CheatSheetSeries/blob/master/Index.md). For more information on almost any AppSec topic, check out the project, it’s definitely worth your time!

![B-Sides Vancouver, 2019](https://thepracticaldev.s3.amazonaws.com/i/1jppmvd8wtnowpt01t1a.jpeg)
#####[B-Sides Vancouver, 2019](https://www.bsidesvancouver.com/)

###Let’s start with some definitions.

**Authentication** is ensuring that the user who is using the application is the actual person they purport to be. For instance, when I log into my webmail, it verifies that I am the one-and-only Tanya Janca that owns this account. Not a different person who is also named [“Tanya Janca”](https://twitter.com/shehackspurple), and not someone pretending to be me. The real, authentic, me; the person who owns the account.

**Identity** (digitally speaking) is a hardware or software-based solution for proof of identity of citizens, users or organizations. For example; in order to access benefits or services provided by government authorities, banks or other companies in person, you must verify your identity, usually with a driver’s license, passport of another physical document. However, if you are verifying your identity digitally (electronically), you must use a software or hardware based solution to prove your identity.

###[Read the rest on my NEW blog!](https://wehackpurple.com/29ak)!
How do you start your css file?
Tags: discuss, css
Published: 2019-09-12 17:17:12

---
title: How do you start your css file?
published: true
description: 
tags: discuss, css
---

I usually start like this:

```css
*:not(ul):not(ol) {
  margin: 0;
  padding: 0;
}
```
It reverts most of the browser specific styles that I care of in the beginning preserving lists markers.
What’s the Difference Between Data Science and Data Analytics?
Tags: career
Published: 2019-09-12 17:02:46

As businesses collect more and more data, the roles of data scientists and data analysts have grown exponentially.

But what exactly do they each do?

To get a better idea of which path is right for you, you must first decide whether you’re more interested in working with numbers and business intelligence tools or with programming and machine learning.

You must also determine where you see yourself sitting in your future office environment. If you see yourself collaborating with business managers, stakeholders and CEOs, the path of a data analyst will challenge you daily to contribute to business growth. If you find yourself more comfortable with engineering teams, you may be best suited to the field of data science.

Just thoughts I should share some notes from a webinar I participated in.

Cheers!
Import dependencies with Svelte and Rollup?
Tags: help, svelte, rollup, javascript
Published: 2019-09-12 16:56:27

---
title: Import dependencies with Svelte and Rollup?
published: true
description: Have to use relative path to /node_modules
tags: help, svelte, rollup, javascript
---

I'm trying out Svelte. I've followed the instructions on [getting a starter project going](https://svelte.dev/blog/the-easiest-way-to-get-started#2_Use_degit). I've made some minor customizations, and added one library to help with making fetch requests ([build-url](https://www.npmjs.com/package/build-url)).

Everything works great! I'm able to import build-url using this syntax in my `Home.svelte` file:

```javascript
import buildUrl from '../node_modules/build-url';
```

However, I'm coming from Angular; I'm very, very used to omitting the path the `node_modules` from my code entirely; Angular just finds what it needs. My ideal end state would be the following:

```javascript
import buildUrl from 'build-url';
```

Is there a Rollup configuration I can use to mimic this behavior? I'm not against using a path to the `node_modules` folder, but I can't help but feel like I'm doing it wrong. If I can't do it with Rollup, is it possible with another bundler like webpack or Parcel?
Should I share my current salary with recruiters?
Tags: anonymous, career, discuss
Published: 2019-09-12 16:50:37

---
title: Should I share my current salary with recruiters?
published: true
tags: anonymous, career, discuss
---

_This is an anonymous post sent in by a member who does not want their name disclosed. Please be thoughtful with your responses, as these are usually tough posts to write. Email sloan@dev.to if you'd like to leave an anonymous comment._
How to easily parse deep json in Swift
Tags: json, swift, ios
Published: 2019-09-12 13:36:05

---
title: How to easily parse deep json in Swift
published: true
description: 
tags: json,swift,ios,
---

JSONCodable is awesome, but sometimes we just need to quickly get value in a deepy nested JSON. In the same way I did for Dart [How to resolve deep json object in Dart](https://github.com/onmyway133/blog/issues/198), let's make that in Swift.

See https://github.com/onmyway133/Omnia/blob/master/Sources/Shared/JSON.swift

```swift
public func resolve<T>(_ jsonDictionary: [String: Any], keyPath: String) -> T? {
    var current: Any? = jsonDictionary

    keyPath.split(separator: ".").forEach { component in
        if let maybeInt = Int(component), let array = current as? Array<Any> {
            current = array[maybeInt]
        } else if let dictionary = current as? JSONDictionary {
            current = dictionary[String(component)]
        }
    }

    return current as? T
}
```

So we can just resolve via key path

```swift
class JSONTests: XCTestCase {
    func test() {
        let json: [String: Any] = [
            "outside": [
                "object": [
                    "number": 1,
                    "text": "hello"
                ],
                "arrayOfObjects": [
                    [
                        "number": 2,
                        "text": "two"
                    ],
                    [
                        "number": 3,
                        "text": "three"
                    ]
                ],
                "arrayOfArrays": [
                    [
                        "one", "two", "three", "four"
                    ],
                    [
                        "five", "six", "seven"
                    ]
                ]
            ]
        ]

        XCTAssertEqual(resolve(json, keyPath: "outside.object.number"), 1)
        XCTAssertEqual(resolve(json, keyPath: "outside.object.text"), "hello")
        XCTAssertEqual(resolve(json, keyPath: "outside.arrayOfObjects.1.number"), 3)
        XCTAssertEqual(resolve(json, keyPath: "outside.arrayOfArrays.1.1"), "six")
    }
}

```


Original post https://onmyway133.github.io/blog/How-to-easily-parse-deep-json-in-Swift/
Why does this work in javascript?
Tags: javascript, node, discuss
Published: 2019-09-12 16:32:49

---
title: Why does this work in javascript?
published: true
description: Accessing object property using array
tags: #javascript, #node, #discuss
---

I just bumped into this. Anyone have insight as to why this works?

```js
const a = {b: 2}; 

console.log( a[['b']] );

// Result: 2
```
Decentraland SDK Tutorial room 4
Tags: gamedev, tutorial, typescript, dapps
Published: 2019-09-12 16:04:16

Some have compared Decentraland to an Inception-like dream world. Ridiculous! That said, your next Video Tutorial in Room 4 is how to spin an object. Erm, don’t forget your totem.
{% youtube Z5NHJmiA0zs %}
What software/services cause you the most agony?
Tags: discuss
Published: 2019-09-12 15:55:54

---
title: What software/services cause you the most agony?
published: true
description: This is a light hearted discussion about software people have to use on a daily basis but they really don't like it
tags: discussion
---

I'd like to take this opportunity to start a support group for users of traumatizing software.

I'll start.
  
Hello, I'm Ahmed, and I have to use Skype For Business and Webex on a daily basis. Every-time I try to connect to my calls, I have to say a little prayer, cross my fingers, roll a 100-sided die, and just HOPE that it works out! 🤣

Do you use software like that on a daily basis? What's the most frustrating software you work or have worked with in the past?

> *This is really meant to be lighthearted discussion and let software frustrations out through comedy 😊*
10 Quick WordPress Security Tips
Tags: wordpress, security, cybersecurity, webdev
Published: 2019-09-12 15:43:58

---
title: 10 Quick WordPress Security Tips
published: true
description: WordPress is very popular for websites, and so it's very often attacked. Protect yourself with these 10 quick tips you can put into use in 10 minutes.
tags: wordpress, security, cybersecurity, webdev
canonical_url: https://www.linkedin.com/pulse/10-quick-wordpress-security-tips-garrett-mickley/
cover_image: https://media.licdn.com/dms/image/C5612AQEFxK1H5opUjA/article-cover_image-shrink_720_1280/0?e=1573689600&v=beta&t=tLgo7PtDXEaEUaaW9Noe6cJY-t3nZhK2b-zX3CSzeKg
---

1. Use 2 Factor Authentication
2. Try to use your Admin account as little as possible
3. Don’t name your Admin account “Admin”
4. Keep your plugins up to date
5. Don’t install more plugins than you need
6. Don’t keep plugins you’re not using, even if they’re inactive
7. Repeat steps 4 through 6 for Themes, too.
8. Keep your WordPress itself up to date
9. Get a plugin that changes your login page from `/wp-login.php` to something random like `/djeu`
10. Get WordFence and if you can afford it, the Premium version.

## Here is an addendum to point 10:

I first recommend getting the highest tier of JetPack, which has all sorts of features _including_ security.

If you’re unwilling to pay for the highest tier of Jetpack, get the Premium version of WordFence.

If you’re looking for free solutions: get both the free tier of JetPack and the free tier of WordFence.

## Some Useful Links:

+ [How to set up WP 2FA](https://en.support.wordpress.com/security/two-step-authentication/)
+ [WPS Hide Login](https://wordpress.org/plugins/wps-hide-login/)
+ [Jetpack free](https://wordpress.org/plugins/jetpack/)
+ [WordFence free](https://wordpress.org/plugins/wordfence/)
+ [Jetpack pricing](https://jetpack.com/pricing/)
+ [WordFence pricing](https://www.wordfence.com/wordfence-signup/?promo_id=top-link-pricing&promo_name=get-pricing&promo_creative=wht-txt&promo_position=sw-top#pricing)
[Pro-Tip] Angular Input syntax
Tags: angular, webdev, javascript
Published: 2019-09-12 15:41:45

---
title: [Pro-Tip] Angular Input syntax
published: true
description: 
tags: angular, webdev, javascript
---

It's time for another **Angular Knowledge Pill**! 💊 It takes just 10 seconds to learn something new 🔥 Like taking your morning vitamins 😃

When you use `[input]="value"` then Angular interprets the value as an expression. So you can place there a variable reference from the component or even mathematic formula. When you use `input="value"` then the value is interpreted as a string! Take a look at the example:

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/sh0mr3u8sfmb69y21i2v.png)

If you would like to receive this kind of knowledge pills directly into your mailbox, subscribe at https://angular-academy.com/blog/. I will be sending them regularly! Remember, it just takes 10 seconds to learn something new!
Byte Sized Episode 4: Edsger Dijkstra and His Famous Algorithm
Tags: computerscience, algorithms, bytesized, history
Published: 2019-09-12 15:28:50

---
title: Byte Sized Episode 4: Edsger Dijkstra and His Famous Algorithm
published: true
description: How one afternoon in a coffee shop changed computer science.
tags: computerscience, algorithms, bytesized, history
cover_image: https://thepracticaldev.s3.amazonaws.com/i/45tqj7fjxmdphgclbvet.png
series: Byte Sized Season 1
---

Today's episode of Byte Sized is about [Edsger Dijkstra](https://en.wikipedia.org/wiki/Edsger_W._Dijkstra), and his algorithmic work

For a more in-depth look at Dijkstra's algorithm, check out this post:

{% link https://dev.to/vaidehijoshi/finding-the-shortest-path-with-a-little-help-from-dijkstra-cmi %}

Follow **Byte Sized** for an adventure through computer history, a few minutes at a time. More great episodes to come.

{% organization bytesized %}

<center>
# **Today's Sponsor**
</center>

{% organization heroku %}

{% link https://dev.to/devteam/why-dev-hosts-on-heroku-and-how-we-configure-our-service-1caj %}
Avoiding manual copy of infromation with vim
Tags: vim, neovim
Published: 2019-09-12 13:35:11

---
title: Avoiding manual copy of infromation with vim
published: true
description: Gathering scattered information from a file to the clipboard using Vim
tags: vim, neovim
---

# Introduction
For many times we need copy information from and to the system clipboard. For those situations, we can use a simple grep plus (pbcopy | xclip), but if you are with the file already open, or if you are in a system wich does not have GNU utils you can do the task simply using vim

## The problem
Let's say you have to copy all lines of code with a specific pattern from all your opened files on vim:

    vim * text.txt

With the **:args** command we can see the list of all opened files we have. 

    :args

## The solution

We are gonna start cleaning the targed register, a kind of many vim "clipboards" that accept appending with a special thecnique. 

    :let @a=""

With the above command we are making sure the register `a` is empty

    :argdo g/pattern/yank A

The `argdo` command performs a task over all opened files we have, and the magic happens with the global command. OBS: the use of `A` allows us to append every line of all files containing the **pattern** to the register `a`. 

Now let's finish:

    :let @+=@a

OBS: If you simply try to use `:argdo g/pattern/yank +` will not work because the system clipboard does not allow "appending" any content to it. 

## How would it be like using `grep`?

    grep 'pattern' *.txt | xclip -selection clipboard

## Creating aliases in order to make it easier 

In my case I use zsh and on my aliases file I have

    (( $+commands[xclip] )) && {
        alias pbpaste='xclip -i -selection clipboard -o'
        alias pbcopy='xclip -selection clipboard'
    }
Delphi Security Components SecureBridge Got a Huge Update
Tags: delphi, security, signalr, tcp
Published: 2019-09-12 15:17:26

---
title: Delphi Security Components SecureBridge Got a Huge Update
published: true
description: Devart has recently introduced a long-awaited update of SecureBridge, its robust security solution. The new features are aimed to strengthen the protection of TCP traffic.
tags: Delphi, security, SignalR, TCP
---

*Devart has recently introduced a long-awaited update of SecureBridge, its robust security solution. The new features are aimed to strengthen the protection of TCP traffic.*

![SecureBridge Got a Huge Update](https://www.devart.com/sbridge/images/sbridge_ide.png)

Devart, a recognized vendor of professional database management software and Delphi data access components for developers and DBAs, has released **[SecureBridge 9.1](https://www.devart.com/sbridge/)** with support for macOS 64-bit, Lazarus 2.0.4 and the SignalR protocol 2.2. Other notable updates include a new elliptic Diffie-Hellman key exchange algorithm and improved certificate server verification for the TLS / SSL protocol.

The full list of new and improved features inсludes:

• macOS 64-bit is supported;
• Lazarus 2.0.4 is supported;
• Support for the SignalR protocol version 2.2 is added;
• The TScHubConnection component to support the SignalR client is added;
• Support for the x25519 algorithm for the TLS/SSL/SSH protocol is added;
• Support for Certificate Revocation List (CRL) is added;
• Certificate server validation in the TLS/SSL protocol is improved;
• The chunked transfer encoding for sending out data via HTTP/HTTPS is added;
• The TScHttpWebRequest.BeforeSendData event is added.

**SecureBridge** offers components that can be used as clients and servers for SSH, SFTP, SSL, FTPS, HTTP/HTTPS, WebSocket, and SignalR protocols to protect data flow over an untrusted network. It is also compatible with data access components to prevent data interception and theft. To learn more about the current release, please visit **[https://blog.devart.com/securebridge-supports-macos-64bit.html](https://blog.devart.com/securebridge-supports-macos-64bit.html)**.

**About Devart**

Devart is one of the leading developers of database tools and administration software, ALM solutions, data providers for various database servers, data integration and backup solutions. The company also implements Web and Mobile development projects.

For additional information about Devart, visit **[https://www.devart.com/](https://www.devart.com/)**
How I run a hugo site on pi server 
Tags: raspberrypi, pi, server, hugo
Published: 2019-09-12 15:04:43

---
title: How I run a hugo site on pi server 
published: true
description: my simple setting for private hugo site running on raspberry pi home server
tags: raspberry, pi, server, hugo
cover_image: https://thepracticaldev.s3.amazonaws.com/i/k8leo5prmvozgw0edfli.jpeg
---

just for fun :)

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/k8leo5prmvozgw0edfli.jpeg)
Move Java-project to Kotlin
Tags: refactorit, help, discuss, java
Published: 2019-09-12 15:03:45

Hi all,

do you have experience in converting Java-files with for instance IntelliJ to Kotlin? Would I have to make a lot of changes for having idiomatic Kotlin code?

Probably I first start with a smaller module from a multi-module Maven-project :-)

kind regards
Johannes
Help with notificationcompat bigtextstyle
Tags: help, android
Published: 2019-09-12 15:01:21

Below is the code, I have small content set to be the first sentence-ish needed with an ellipses, and content is the full notification. But when the notification is created, it's only the big content, not the small content (or rather, it gets created expanded, and doesn't auto collapse, when I collapse it, it's not the created small content, but just an automatic abbreviation)

Anyone have any experience with this issue? Did I miss something? Fairly new to android dev. 

{% gist https://gist.github.com/chillhumanoid/850d6a007f84b7f31b145796da3ddca6 %}
Grayscaling my phone made the rest of the world more vibrant (literally)
Tags: ui, iphone, color, ux
Published: 2019-09-12 14:50:29

Recently I enabled an accessibility option to map "Toggle grayscale screen filter" to the triple tap of my iPhone's home button, and within a few dozen seconds, after acclimating to the change and finishing whatever it was I had needed to do on my phone, I _set it down_. I say this as someone who absent-mindedly swipes between home-screen panels and refreshes twitter and facebook even when I don't plan on reading whatever pops up.

I still picked it up easily when I needed to use it: to send a text; read an email; or respond to a twitter DM or slack message. I still easily used the map features, and still browsed instagram briefly (which looked far more artsy in coerced-b&w), but found myself almost always staying more on task and putting my phone down when I was done with that task.

## Why does this happen?

On further experimentation, I've realized this is because, from a biological standpoint, your phone is usually packed with more vibrant colors than anything in your environment. Even bright magazine covers pale in comparison to the phone screen. The lizard-brain in us sees the iPhone's home screen covered in small, bite-size applications, all in tantalizingly vibrant colors, and thinks simultaneously "nutritious berries" and "poisonous animals", both things we have become evolutionarily primed to notice and maintain focus on.

After some time on your phone, the world seems to be dulled, and for good reason. Compared to your phone, the colors of the real world _are_ much duller. They're lower contrast less saturated, and less clean.


Turning on the accessibility feature for black and white filtering flips this dynamic on its head. Suddenly, your eyes are _easily drawn away from your phone_. Like a newspaper, the act of looking away from it fills your eyes with comparatively high color and brightness. The innate draw of your phone becomes solely based on the information you can glean from it and the things you can do with it, _not_ how instinctively interesting it is to look at.

Obviously using your phone is generally a pleasurable activity, and I'm not advocating for less phone usage. I'm largely pointing this out because it draws into stark attention how _much_ color affects our enjoyment of an app, and how bright, vibrant colors can really draw us in to a device, or an app, or really _anything_. Color matters a lot; not just how we use it, but _that_ we use it.

## How to switch to a grayscale display

As much as I don't think phones are bad, I think they _can_ get in the way when you're trying to enjoy a book or movie or game, or are trying to focus on something else. If you want to be less drawn in by your iPhone, or see this phenomenon for yourself, you can map your black-and-white screen filter to a triple-tap of the home button by:

```
1. Settings > General > Accessibility > Display Accomadations > 
Color Filters > toggle 'Grayscale'
2. Settings > General > Accessibility > Accessibility Shortcut > toggle 'Color Filters'
```
Published My First PyPI Package
Tags: python, youversion, votd, api
Published: 2019-09-12 14:47:59

---
title: Published My First PyPI Package
published: true
description: Published My First PyPI Package
tags: #python #youversion #votd #api
---

I am excited to say that I finally got around to "shipping-it"! I have been working on a Python API client for the [YouVersion Public API](https://yv-public-api-docs.netlify.com/getting-started.html#getting-an-api-token) for some time, always looking for ways to make it "better". I decided that I can continue to iterate the project but it would also be best if I got it out there.

You can find the published package on [PyPI](https://pypi.org/project/youversion/) or follow the project on [GitHub](https://github.com/jyksnw/yv-api-python).

It sure does feel good to release something!

Let me know what you all think :smiley:

(P.S. this is also my first post on DEV.to)
Programming Problem
Tags: clojure, programming, problem
Published: 2019-09-12 14:24:30

---
title: Programming Problem
published: true
description: 
tags: clojure, programming, problem
---

Write a program that given a number of documents, can find all the documents with words containing the letter "a" in them.

> Using the `with-open` macro that will automatically close any I/O. The `clojure.string/includes?` function will check each line as it comes in if it contains the letter "a" and will return true or false.

```clojure
(defn contains-a?
  [document]
  (with-open [rdr (clojure.java.io/reader document)]
    (clojure.string/includes? (line-seq rdr) "a")))

(filter #(contains-a? %) [documents])
```

Next step is to:

1. __try and succeed as fast as possible__, i.e once the program detects an "a" it should return true and stop looking through that file and,

2. __leverage the `AsynchronousFileChannel`__ of Java plus `core.async` to maybe parallelize the work? Not sure how this would work.

Inspiration
[gist](https://gist.github.com/mfikes/03172ce8dd62439431026b7b94ec201f)