teleren/devto huggingface dataset:
Risk Based Authentication
Tags: riskbasedauthentication, cybersecurity, datasecurity, dataprivacy
Published: 2021-03-04 08:31:08

RBA is a method of applying different stringency levels to authentication processes based on the probability of being compromised by access to the system. Authentication becomes more restrictive as the level of risk increases.

Read this article to learn more:
https://www.loginradius.com/blog/start-with-identity/2021/02/risk-based-authentication/
HTML Form Elements
Tags: html
Published: 2021-03-04 08:29:40

When creating a HTML form, the <input> tag can be a jack of all trades. ``<input type="text">`` prompts a user with a small text box. ``<input type="button">`` prompts the user with a clickable button. There are a bunch of other input types including "email","username","password","checkbox", and of course "submit".

All of these input types cover alot of bases, but there are a couple of other HTML form elements that can be useful too. Here's some others that I used when making my first Sinatra app, which lets users make their own custom spells for D&D.

**<h3>The ``<textarea>`` Element</h3>**
The ``<textarea>`` tag creates a larger input field for when you want to give the user more room to respond. In my spellmaker app, I wanted the user to have more room for the spell description, so I did the following:

```
<label for="desc">Description:</label>

<textarea name="desc" rows="5" cols="50">Type Description here...</textarea>
```

The size of the textarea can be adjusted with the rows and cols attributes, and if you'd like to have some sort of message or default text in the box, just place it in between the start and end tags!

**<h3>The ``<select>`` Element</h3>**
The ``<select>`` tag creates a drop down list. Perfect for presenting the user with a selection of options, like Schools of magic:

```
<label for="school">School:</label>
    <select name="school">
        <option value="Abjuration">Abjuration</option>
        <option value="Conjuration">Conjuration</option>
        <option value="Divination">Divination</option>
        <option value="Enchantment">Enchantment</option>
        <option value="Evocation">Evocation</option>
        <option value="Illusion">Illusion</option>
        <option value="Necromancy">Necromancy</option>
    </select>
```

Now the user can select from a curated list of options. You'll notice we simply use the ``<option>`` tag to make each option.

**The ``<fieldset>`` Element**
This tag is a way of breaking up a form into two separate boxes. I didn't actually use this one for my project, but here's an example nonetheless:

```
<form>
  <fieldset>
    <legend>Person:</legend>
    <label for="fname">First name:</label>
    <input type="text" id="fname" name="fname"><br><br>
    <label for="lname">Last name:</label>
    <input type="text" id="lname" name="lname"><br><br>
  </fieldset>
  <fieldset>
    <legend>Pet:</legend>
    <label for="pname">Name:</label>
    <input type="text" id="pname" name="pname"><br><br>
  </fieldset>
  <input type="submit" value="Submit">
</form>
```
This is a stylistic element that draws a box around different parts of your form. The ``<legend>`` tag can be used to caption each box.
Inspect Perl values prettily with Data::Printer
Tags: perl, debugging
Published: 2021-03-04 08:07:35

# A word about complex structures and debugging
In Perl (as in majority of other programming languages), you can construct **complex data structures**. By complex, I mean *mixed* hash and arrays or *nested* (hash of hashes, array of hashes etc...).

Then it typically requires time and effort to do **"printf debugging"** on these complex structures so that's the reason why **data dumpers** exist!

So let's go with the code!

## First fill a variable to dump
I propose this small snippet to create and fill an array with some content:
```perl
#!/usr/bin/env perl

my @array = ();
push @array, "apple";
push @array, "banana";
push @array, "strawberry";
push @array, { name => "tib", color => "blue" };
push @array, { name => "bob", color => "red" };
```

An array with items where some of them are hashes (refs).

## Data::Dumper
First I will dump with the classic [Data::Dumper](https://metacpan.org/pod/Data::Dumper) :smiley:

```perl
use Data::Dumper;
print Dumper(@array);
```

The output is already not bad (hash is indented):
![Data::Dumper](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/phw94z8n0r2p83v84pbm.png)

To improve output, we can tweak a bit the [behavior of Data::Dumper](https://metacpan.org/pod/Data::Dumper#Configuration-Variables-or-Methods) but if you want my opinion there is a better option...

## Data::Printer
First, install [Data::Printer](https://metacpan.org/pod/Data::Printer) with a CPAN client `cpanm Data::Printer`.

**Data::Printer** is not in the core (**Data::Dumper** is) but has no "non-core" dependencies! :dancer: 

```perl
use DDP;
p @array;
```

And tadaa! A nicely formatted and colored data dump :+1:
![Data::Printer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tvi6qez55zantjt7edi7.png)
The Web Share API In Chrome 89
Tags: chrome
Published: 2021-03-04 07:34:04

#The Web Share API In Chrome 89


>**Intro:**  4/3/21 - Chrome Web Devs Announced The Chrome Version 89! (Stable)

**They Added Some Features, A New Navigator API Has Been Added - `navigator.share()`.**

**Refer To:**  [developer.chrome.com](https://developer.chrome.com/blog/new-in-chrome-89/)
###Video: 
{% youtube O-gv6zLZHKw %}

As Per The Video, The API Was Supported On Chrome Mobile Version. 

> To update Chrome: Click On 3 Dots 
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ph21mx8wgat7baaznmwj.png)Then Hover Over Help![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0c5rfdzj7uffpvf5flwj.png)Then Click On About Chrome![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p0q3fdo4ofsu68fgyptj.png)Then Click on Update Chrome, It Will Take Some Time To update And then Click On Relaunch Chrome
  
 

>**Your Chrome Should Be Updated To Version 89 Or This Code Will Not Work, Try To Run The Code By Clicking A Button Or It May Give A Must be handling a user gesture to perform a share request Error**


  
##Try It Out:
```javascript
if("share" in navigator){
navigator.share({

   title: "Coding Articles - Dev.to",
   text: "Dev.to",
   url: 'https://dev.to'

});
}
```

##### Note: You Can Also Use .then, .catch as it is a Promise.
when i run my protractor code on chrome then its working fine but for Mozilla its shows error
Published: 2021-03-04 07:25:40

hi everyone
when i run my protractor code on chrome then its working fine but for Mozilla its shows error
Started
[01:14:12] E/protractor - Could not find Angular on page https://juliemr.github.io/protractor-demo/ : angular never provided resume Bootstrap
[31mF[0m
Failures:
1) Protractor Element Demo Locators
  Message:
[31m    Failed: Angular could not be found on the page https://juliemr.github.io/protractor-demo/. If this is not an Angular application, you may need to turn off waiting for Angular.
                              Please see 
                              https://github.com/.../blob/master/docs/timeouts.md...[0m
  Stack:
    Error: Angular could not be found on the page https://juliemr.github.io/protractor-demo/. If this is not an Angular application, you may need to turn off waiting for Angular.
                              Please see 
                              https://github.com/.../blob/master/docs/timeouts.md...
        at E:\Jsworkspace\ProtractorTutorial\protractor\built\browser.js:718:27
        at ManagedPromise.invokeCallback_ (E:\Jsworkspace\ProtractorTutorial\protractor\node_modules\selenium-webdriver\lib\promise.js:1376:14)
        at TaskQueue.execute_ (E:\Jsworkspace\ProtractorTutorial\protractor\node_modules\selenium-webdriver\lib\promise.js:3084:14)
        at TaskQueue.executeNext_ (E:\Jsworkspace\ProtractorTutorial\protractor\node_modules\selenium-webdriver\lib\promise.js:3067:27)
        at E:\Jsworkspace\ProtractorTutorial\protractor\node_modules\selenium-webdriver\lib\promise.js:2927:27
        at E:\Jsworkspace\ProtractorTutorial\protractor\node_modules\selenium-webdriver\lib\promise.js:668:7
        at processTicksAndRejections (internal/process/task_queues.js:93:5)
    From: Task: Run it("Locators") in control flow
        at UserContext.<anonymous> (E:\Jsworkspace\ProtractorTutorial\protractor\node_modules\jasminewd2\index.js:94:19)
    From asynchronous test: 
    Error
        at Suite.<anonymous> (E:\Jsworkspace\ProtractorTutorial\ElementBasic.js:3:6)
        at Object.<anonymous> (E:\Jsworkspace\ProtractorTutorial\ElementBasic.js:1:1)
        at Module._compile (internal/modules/cjs/loader.js:1063:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
        at Module.load (internal/modules/cjs/loader.js:928:32)
        at Function.Module._load (internal/modules/cjs/loader.js:769:14)
1 spec, 1 failure
Finished in 11.378 seconds
[01:14:14] I/launcher - 0 instance(s) of WebDriver still running
[01:14:14] I/launcher - firefox #01 failed 1 test(s)
[01:14:14] I/launcher - overall: 1 failed spec(s)
[01:14:14] E/launcher - Process exited with error code 1
Already tried  browser.ignoreSynchronization = false but its  not working.
Ionic modals passing and receiving data
Tags: ionic, ios, android
Published: 2021-03-04 07:16:56

Yesterday we made a [modal in Ionic](https://daily-dev-tips.com/posts/adding-modals-to-an-ionic-app/), modals are really cool, but generally, we want to pass or receive data from them.

That will be what we'll be making today, a modal that passes, modifies, and returns data.

The end result for today will look something like this:

![Ionic modal passing and receiving data](https://cdn.hashnode.com/res/hashnode/image/upload/v1614439268244/391Y4zECX.gif)

## Passing data to an Ionic modal

Let's first start by passing data to our modal. This is as simple as calling the `componentProps` on our modalController create function.

```js
number: number = 3;

const modal = await this.modalController.create({
  component: DetailPage,
  componentProps: {
    number: this.number
  }
});
```

Then in the `DetailPage` we can retrieve these values by defining them inside our component!

```js
export class DetailPage implements OnInit {
  number: number;

  ngOnInit() {
    console.log(this.number);
  }
}
```

That is how easy it is to pass data to our modal component.

## Ionic modal dismiss receive data

Of course, we also want to be able to receive this data back in our main component (`tab1.page.ts`).

Before we pass the data back, let's add a function that can modify the number for us.

In our `detail.page.html` we add the following markup:

```html
<ion-item>
  <ion-icon name="remove-circle" (click)="sub()" item-right></ion-icon>
  <ion-input
    type="number"
    min="1"
    class="ion-text-center"
    [value]="number"
    [(ngModel)]="number"
  ></ion-input>
  <ion-icon name="add-circle" (click)="plus()" item-right></ion-icon>
</ion-item>
```

Now let's add the `plus` and `sub` functions in the `detail.page.ts` file:

```js
plus() {
	this.number++;
}

sub() {
	this.number--;
}
```

This will modify our number, but we still need to pass it back to our initial `tab1.page`. For that, we need to modify the `dismiss` function.

```js
dismiss() {
	this.modalController.dismiss({
	  number: this.number,
	});
}
```

This will send the number as the variable `number`.

In our `tab1.page.ts` we can receive this, but adding a `onDidDismiss` callback in the `presentModal` function:

```js
modal.onDidDismiss().then(data => {
  this.number = data.data.number;
});
```

This will receive the data and update the number.
Then the next time we will open the modal, the new number will reflect.

And there you have it, passing and receiving data in Ionic Modals.

You can find today's code on [GitHub](https://github.com/rebelchris/ionic-app/tree/modal-data).

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
Infra2: Consul Registrator
Tags: consul, traefik, docker, cloudnative
Published: 2021-03-04 07:01:27

Вторая статья из цикла про инфраструктуру RNDSOFT. Сегодня про Consul Registrator - замечательный инструмент, который нас никогда не подводил: [https://blog.rnds.pro/009-infra2](https://blog.rnds.pro/009-infra2?utm_source=devto&utm_medium=post)


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/msl3caqegpp1ehp3f69r.png)
WHY LEARNING LOWER LEVEL LANGUAGES IS ESSENTIAL!
Tags: programming, python, computerscience
Published: 2021-03-04 06:40:35

When I started writing software at the age of 14 years old, I picked up the programming language Python. Python was great and easy to understand for the most part, but later down the line, I began to do more intensive computation that python was a bit too slow for! 

This led me to move to different languages such as JavaScript, Kotlin, and then C/C++. I began to visualize the lower-level computational concepts like memory and addresses which made me feel like I was connected to the computer! Picking up lower-level ideas really helped visualize data structures and time complexity. For example, you visualize why an array in the worst case would take O(n) complexity for insertion/deletion since you have to manually copy/deallocate the first array and create/allocate the second.


 These tasks are expensive and are taken for granted in higher-level programming languages! Learning at least one lower-level language will help your overall understanding of computation and make you a better software engineer!
Ninth week web dev
Tags: beginners, programming, webdev
Published: 2021-03-04 06:38:58

Hi Everyone!! It has been 9 weeks since started doing web development. This week I have worked on more small projects with simple HTML, CSS, and javascript, and believe me I am learning a lot. If you have any feedback you can give me if you are a beginner, you can go ahead and try to make these projects.

1)Change-Background-color-with-on-click-with-simple-html-css-and-Javascript
https://github.com/Gauravrandheer/Change-Background-color-with-on-click-with-simple-html-css-and-Javascript

2)Countdown-to-new-year-with-simple-HTML-CSS-and-Javascript
https://github.com/Gauravrandheer/Countdown-to-new-year-with-simple-HTML-CSS-and-Javascript

3)Random-Quotes-generator-with-simple-html-css-and-Javascript
https://github.com/Gauravrandheer/Random-Quotes-generator-with-simple-html-css-and-Javascript

4)Drum-kit-with-simple-HTML-CSS-and-Javascript
https://github.com/Gauravrandheer/Drum-kit-with-simple-HTML-CSS-and-Javascript

The last project, I learned from https://javascript30.com/
there are lots of projects, I will try to make more.

Thanks for reading!!
What is Brute Force Attack

Tags: bruteforceattack, datasecurity, dataprivacy, cybersecurity
Published: 2021-03-04 05:54:10

You do not exploit any vulnerability in brute force attacks on the web application. Rather, you try out all the combinations and permutations of the victim's passwords and usernames and try to see if you get one.

Read this article to learn more in detail: https://www.loginradius.com/blog/start-with-identity/2021/02/brute-force-lockout/
TIL How to Input Without Focus
Tags: todayilearned, gamedev, unity3d, inputs
Published: 2021-03-04 05:40:26

2021-03-03

Sometimes you just want to change values in the editor with your keyboard/mouse while controlling your character with a gamepad.
Of course in Unity, the moment you click in the editor, you remove focus from the Game view and your inputs are not used. So you tend to have to click back and forth and it's kind of not fun.

However, if you happen to be using the Input System instead of the Input Manager, you can get around this with one simple checkbox click.
![List of options](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/548zof4mkzlorho4u2p8.png)
Under Window > Analysis > Input Debugger, you can find this option underneath Options.

It's worth noting that this option is meant for debugging and not really editing. Also, if you click or right-click in the editor, you will dispatch those to the game. So really this solution is only good if you are making a controller-centric game or if your keyboard/mouse inputs are routed through the Input Manager.
How to make a Strong LinkedIn Profile?
Tags: leadership, branding, career, discuss
Published: 2021-03-04 05:12:15

If you just follow the following steps, you'll have a pretty strong LinkedIn profile that potential clients, employers and recruiters love ❤️.

#Steps to make Strong LinkedIn Profile

**1. Professional Profile Picture:** Upload a picture on a professional/formal dress and don't forget to smile.
Also if you can, *remove the background* using tools like Photoshop or Canva.
Or Take a picture in plain background.

**2. Cover Picture (Background):** For your cover picture, you can be creative. Try displaying your workspace or list what you do or you're doing on a plain background.

**3. About Section:** In about section, Select 3-5 keywords, that define your work, role, interests and add them in your headline and on your about Summary.
In your about section, Try including things like 
Who’re you? 
Why’re you using LinkedIn? 
What are your goals?, etc.

**4. Featured Content:** In this section, you can add links to your current projects, accomplishments or projects/works that you love from other creators relevant to your industry 

**5. Experience Description:** Add the places you've worked, your roles, activities and projects you're involved in and proud of.
You can also share best memories/experiences from the workplaces.

**6. Skills and Endorsement:** In this section, you add the skills that you have or use in your work or you're currently building/learning. 
And Endorsement is like someone Liking or Vouching for you and your skill. 
(*Hack: Ask your friends, staffs, teachers, colleagues, employers, teachers, etc. to endorse on your skills*)

**7. Recommendations:** It's similar to endorsement but people write short descriptions about your work or experience on working with you. And recommend to further clients/employers. 
(*Similar to Endorsement, Ask your teachers, employers and colleague to write you a recommendation. There's also a feature on LinkedIn where you can ask for recommendation (Top right corner of Recommendation section).*)

**8. Accomplishments:** In this section, you can add achievements/projects that you've completed, with short description and links if you've any.

**9. Interests:** Here, the people or influencer, Company and Groups you follow are shown. So, always follow those who are relevant to your industry or things you're currently involved/interested in. 

**Grow your Network:** Now you need to grow your network by connecting with the people you know or people who're relevant to your industry.
Also react and comment to the posts that you find interesting. Communicate more, Be more valuable. But don't use it as any other social networks like facebook and instagram or dating sites.

> **"Be Professional and Trust Worthy."**

### Connect with me on LinkedIn 👇
https://www.linkedin.com/in/vijaythapa/
iOS devices connecting and disconnecting rapidly
Tags: ios, ipad, iphone
Published: 2021-03-04 03:59:34

I have been struggled with this issue for years. When connect my iPad to  my Macbook Pro, it connected and disconnected then connected and disconnected.... This make me crazy sometime. Today I decided to research for a solution.

After googling, I found this thread https://www.ifixit.com/Answers/View/473839/iOS+devices+connecting+and+disconnecting+rapidly.

Below are some methods I tried.
#### 1. Reset SMC
```
- Unplug the power, then shut down your Mac.
- Hold the left Shift+Control+Option keys down, then press and hold the power button down. Keep all four buttons pressed down for ten seconds, then let go.
- Plug the power cable back in, then turn on your Mac.
```
#### 2. Reset the privacy settings in iOS
```
Settings > General > Reset > Reset Location & Privacy
```
#### 3. Restart `usbd` deamon program
Open terminal, run this
```
sudo killall usbd
```
If not work, try this
```
sudo killall -STOP -c usbd
```

And lucky me. My iPad can connect with my Macbook Pro after running `sudo killall -STOP -c usbd` and now I can debug using my iPad.

You can add alias to make quick access to it
```
echo -n "alias fix-ios='sudo killall -STOP -c usbd'" >> ~/.zshrc
```
Later then, just run `fix-ios`

If you got this issue, please try then let me know which one works for you.

Happy ending!
Update Badge in React Native Stack Navigator Header
Tags: reactnative, reactnavigation, badge, notification
Published: 2021-03-04 03:55:10

I have added badges in react native stack navigator for cart and wish-list count. These counts must be fetched from API on every screen change or back event. I also want to update these count on "add to cart" and "add to wish-list" event from Product screen.

Can anyone suggests me how to do this ? Any reference code or article will be very helpful.

Thanks in Advance.
Day 31: Radix Sort
Tags: 100daysofcode, javascript
Published: 2021-03-04 03:37:58

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

```javascript
function radixSortUint32(input) {
  const arrayConstr = input.length < (1 << 16) ?
    Uint16Array :
    Uint32Array;
  const numberOfBins = 256 * 4;
  let count = new arrayConstr(numberOfBins);

  let output = new Uint32Array(input.length);

  // count all bytes in one pass
  for (let i = 0; i < input.length; i++) {
    let val = input[i];
    count[val & 0xFF]++;
    count[((val >> 8) & 0xFF) + 256]++;
    count[((val >> 16) & 0xFF) + 512]++;
    count[((val >> 24) & 0xFF) + 768]++;
  }

  // create summed array
  for (let j = 0; j < 4; j++) {
    let t = 0,
      sum = 0,
      offset = j * 256;
    for (let i = 0; i < 256; i++) {
      t = count[i + offset];
      count[i + offset] = sum;
      sum += t;
    }
  }

  for (let i = 0; i < input.length; i++) {
    let val = input[i];
    output[count[val & 0xFF]++] = val;
  }
  for (let i = 0; i < input.length; i++) {
    let val = output[i];
    input[count[((val >> 8) & 0xFF) + 256]++] = val;
  }
  for (let i = 0; i < input.length; i++) {
    let val = input[i];
    output[count[((val >> 16) & 0xFF) + 512]++] = val;
  }
  for (let i = 0; i < input.length; i++) {
    let val = output[i];
    input[count[((val >> 24) & 0xFF) + 768]++] = val;
  }

  return input;
}
```