teleren/devto huggingface dataset:
How to get the Square root of a number using Javascript?
Tags: javascript
Published: 2021-05-06 10:17:20

In this short tutorial, we look at how you could use the JavaScript square root method to find the square root of a number.

We also look into the various edge cases that would help you gain a holistic understanding of the concept. 

This tutorial is a part of our initiative at Flexiple, to write short curated tutorials around often used or interesting concepts. 

## Table of Contents - JavaScript Square Root:

- [Syntax & Explanation of Javascript Square root](#syntax)
- [Sample code with explanation of sqrt()](#sample)
- [Limitations and Caveats](#Limitations)

### Syntax & Explanation of Javascript Square root:<a name="syntax"></a>

The square root is one of the many arithmetic operations that the language supports.

To achieve this, JavaScript uses the `Math.sqrt()` function under the Math method.   

**Syntax of Javascript Square root function:**

```jsx
Math.sqrt(#)
```

**Parameters:**

"#" - A number or an array storing a number.

**Return Value:**

The square root of the parameter. Sqrt() returns NaN in few cases we discuss later in the tutorial.  

### Sample code with explanation of sqrt():<a name="sample"></a>

Once you have understood the syntax of the square root function the code would seem pretty straightforward.

And in case you are already experienced in other programming languages, you would notice that it's quite similar.

```jsx
console.log(Math.sqrt(25));
// Output: 5

console.log(Math.sqrt(0.25));
//output: 0.5
```

In case you are looking to write it to your webpage:

```html
<!DOCTYPE html>
<html>
   <body>
      <p id=“squareroot”></p>
      <script>
         document.getElementById(“squareroot”).innerHTML = Math.sqrt(25);
      </script>
   </body>
</html>
```

In this code block, we are passing the value within the function and the square root is returned.

### JavaScript Sqaure Root - Limitations and Caveats<a name="Limitations"></a>

The sqrt() function in JavaScript has quite a few limitations and caveats, I've listed them all below.

- When a negative value is passed as a parameter the function return `NaN`
- Arrays with one number work fine, however, for an array containing more than one number `NaN` is returned. A method to overcome this is to create a function that loops over the values and runs square root in the value individually
- Strings and empty parameters also return `NaN` when passed
- And lastly, empty arrays return 0
How to get Unstack in CODING?
Tags: webdev, biggners
Published: 2021-05-06 10:14:56

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b5rdhu18ndgl6469590u.png)
 When you retrieve data from a Storage object, you’ll always get the data as a string. Same with sessionStorage and Cookies. You can also store objects in the localStorage. We would just have to use JSON.stringify() to store the object.
10 HTML tags you need to know
Tags: webdev, html, beginners
Published: 2021-05-06 10:10:42

_If you found value in this thread you will most likely enjoy my tweets too so make sure you follow me on [Twitter](https://twitter.com/VladPasca5)  for more information about web development and how to improve as a developer. This article was first published on my [Blog](https://vladpasca.hashnode.dev/)_

### 1. Headings 
```
<h1></h1>
``` 

HTML headings are titles or subtitles that you want to display on a webpage.

You can choose from h1 which is the most important, to the h6 which is the least important heading.

### 2. Paragraph tag
```
<p></p>
``` 

The "p" tag defines a paragraph (some text)

Browsers automatically add a single blank line before and after each "p" element.

### 3. Anchor tag
```
<a></a>
``` 

The "a" tag defines a hyperlink, which is used to link from one page to another.

The most important attribute of the "a" element is the href attribute, which indicates the link's destination.

### 4. Unordered lists
```
<ul></ul>
``` 

An unordered list starts with the "ul" tag. Each list item starts with the "li" tag.

The list items will be marked with bullets (small black circles) by default.

### 5. Ordered list tag
```
<ol></ol>
``` 

An ordered list starts with the "ol" tag. Each list item starts with the "li" tag.

The list items will be marked with numbers by default.

### 6. Image tag
```
<img>
``` 

The "img" tag is used to add an image in an website.

It' usually used with the "src" attribute, which specifies the path to the image we want to use.

### 7. Input tag
```
<input>
``` 

The "input" tag specifies an input field where the user can enter data and it's also the most important form element.

It can be displayed in several ways, depending on the type attribute (button, checkbox, submit, etc)

### 8. Division tag
```
<div></div>
``` 

The "div" tag defines a division or a section in an HTML document.

It is used as a container for HTML elements - which is then styled with CSS or manipulated with JavaScript.

Any sort of content can be put inside the "div" tag!

### 9. Label tag
```
<label></label>
``` 

The <label> tag defines a label for several input elements.

Inside this tag, we usually put the text we want to display next to the "input".

The for the attribute of "label" to work must be equal to the id attribute of the input.

### 10. Span tag
```
<span></span>
``` 

The "span" tag is an inline container used to mark up a part of a text, or a part of a document.

It is much like the div element, but "div" is a block-level element and "span" is an inline element.

### The end

_I hope found this useful and if you did please let me know. If you have any question feel free to DM me on  [Twitter](https://twitter.com/VladPasca5) ._
Logitech K780 Review
Tags: keyboard, logitech, review, hardware
Published: 2021-05-06 10:00:16

*Purchase Date 25/02/2021*

## Old Device

* CoolerMaster CM Storm with Brown switches.
* Purchase date: 5 January 2016
* Replacement: faulty space-bar 4 April 2016

### Reason for the new device

Multi-device support.

## First Impressions

### Key Feel
  * Feels great to type on, good feedback from the keys.
  * Doesn't feel mushy, coming from a mechanical keyboard nothing to complain about.

### Key Layout
 
The <kbd>del</kbd> key positioning seems strange, way up top inline with the function key row.

<kbd>prt sc</kbd> wherefor art thou, had to Google to find the key combination for print screen. <kbd>fn</kbd>+<kbd>del</kbd>

The half-height arrow keys feel horrible to touch due to the convex top surface. The position under the enter key keeps throwing me off.

Not sure why Logitec decided to use  convex key-caps choice for the following keys is strange:

* <kbd>alt</kbd>
* <kbd>ctrl</kbd>
* <kbd>fn</kbd>
* <kbd>start</kbd>
* <kbd>←</kbd>
* <kbd>↑</kbd>
* <kbd>→</kbd>
* <kbd>↓</kbd>

The lack of dedicated keys for the following will take a bit of getting used to:

* <kbd>end</kbd>
* <kbd>home</kbd>
* <kbd>pg up</kbd>
* <kbd>pd dn</kbd>
* <kbd>ins</kbd>

They are all accessed via <kbd>fn</kbd> and a numeric key, or just hit that <kbd>numlock</kbd> key.


### Multi-device switching

Amazing, it just works.

### Software

The ability to have individual settings per app is a lifesaver. Can set function keys to be function keys for the apps that need them i.e., Visual Studio, SSMS...

---

## Second Impressions

I'm no longer on the mechanical keyboard train. I can only imagine what the MX Keys is like.
Why is Laravel development rapidly growing ?
Tags: laravel, webdev, website
Published: 2021-05-06 09:53:35

It is a Laravel Development Company and best suited for 2017. We have experienced & experts Laravel developers who are well-acquainted with all the aspects of the Laravel framework, thus making our services simply perfect for you. Laravel is a best PHP framework, which is built with the focus of writing code syntax that is simple and expensive. It provides the advantage of having a web application that developed friendly and code that is maintainable. Create a super web application with optimum ease.
Developers prefer Laravel over to other frameworks because of the performance, features, scalability it offers. Laravel PHP framework allow the coders to keep all the major SQL codes in a separate modular file. This modular packaging system saves a lot of time which ultimately allow the team to focus on other pressing matters.
 
Key Features of Laravel PHP framework
•	Restful routing.
•	Inherent Database Version control
•	A lightweight Blade Templating Engine
•	Composer – An amazing tool that lets you manage your application’s third-party packages easily.
•	Comes bundled with Eloquent –
•	Built-in unit testing and simply readable impressive syntax
•	Larger Community catering to thousands of programming geeks and application developers
•	Intelligently designed to offer incredible flexibility to developers that help them create each and everything from small sites to giant enterprise applications.
Why to Choose Laravel Development Company for Laravel Development Service?
•	15+ years of experience in the industry
•	We develop user friendly, all browser and all devices responsive websites.
•	We are remarkably strong in coding and creating eccentric designs.
•	Quality services at affordable prices.
•	100% Client Satisfaction.
•	Good knowledge of Laravel framework.
•	Hire Laravel developer from us.
•	24*7 Customer Support.
If you hire skilled developers? Connect with us and share your project ideas with us. Contact Us.
https://www.laravellions.com/
Cloud Drops - Beginners guide to PowerShell in Azure Functions
Tags: serverless, integration, azure, powershell
Published: 2021-05-06 09:47:58

![Cloud Drops - Beginners guide to PowerShell in Azure Functions](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kndepefrkmkvetfofpfw.jpg)

Serverless computing is a cloud computing code execution model in which the cloud provider fully manages the infrastructure needed to serve requests. In this session, we will explain why and how we should use Azure Functions and PowerShell together, and we will show you how to deploy a PowerShell based Function.

In some live demos, we will explain how to create a Function and execute some cool PowerShell code!

{% youtube 97Nrh_eETEY %}
Why get Google Cloud certified?
Published: 2021-05-06 09:46:51

1.	80% of Google Cloud-certified individuals are more confident about their cloud skills.
2.	Professional Cloud Architect was the highest paying certification of 20202 and 20193 
3.	More than 1 in 4 of Google Cloud certified individuals took on more responsibility or leadership roles at work1.

To get success in the Google Cloud Certification you can get help from JustCerts a trusted and reliable Google Cloud Certification preparation platform.

https://www.justcerts.com/google-certification-exams.html
SQL Server: The Identifier Is Too Long; Max Length Is 128
Tags: sql, tsql, azure
Published: 2021-05-06 09:45:34

In object creation, we'll either be explicitly creating objects (design/architecture) or allowing an automated process to do so. In both cases when we're using Microsoft SQL Server, we may face the following error, [ERROR: The identifier that starts with '[value]' is too long. Maximum length is 128](https://www.youtube.com/watch?v=dAhCNDvLpzA). The video discusses what this error means along with how we would proceed in fixing the error. Keep in mind that the solution may differ for explicitly versus automated creation.

Some questions that are answered in the video:

- Early in the video, what are two platforms that are mentioned where we may see this error?
- Where else may we see this error and why?
- What would happen if we created a table with column names that all had more than 25 characters, but fewer than 75 in the context of this error and what would happen as far as the creation? What would happen to the table creation if we added a column with 135 characters?
- In the context of anything that references or accesses SQL Server, what may be an underlying reason that we see this error?

Consider that if we had unlimited characters for identifiers, such as columns in this case, we would face other challenges such as referencing those columns in a report. Querying columns with long or counter-intuitive naming will not assist anyone responsible for building or maintaining reports.

On a point of architecture, we want to consider our naming in general - not just because we may be limited, but because we want to ensure that we can query and submit data easily. Consider best practices of naming that makes sense and fits the data context, avoids special character uses, abbreviates long words but not short words where there may be a conflict (ie: State vs St; shortening State to St does not help), and is memorable. By following these rules we would avoid this error in any design situation; note the context in the video of where we may experience this error.
Some Javascript Function
Published: 2021-05-06 09:32:18

1. Map
Map is a collection of keyed data items, just like an Object. But the main difference is that Map allows keys of any type.

const arrayMap= [1, 4, 9, 16];

// pass a function to map
const map1 = arrayMap.map(x => x * 2);

console.log(map1);
// expected output: Array [2, 8, 18, 32]

2. isNaN
The isNaN() function determines whether a value is an illegal number (Not-a-Number).
This function returns true if the value equates to NaN. Otherwise, it returns false.
This function is different from the Number specific Number.isNaN() method.

3.JavaScript parseFloat() Function
The parseFloat() function is used to accept the string and convert it into a floating-point number. If the string does not contain a numeral value or If the first character of the string is not a Number then it returns NaN i.e, not a number. It actually returns a floating-point number parsed up to that point where it encounters a character that is not a Number.
Example 1: The parseFloat() function ignores leading and trailing spaces and returns the floating point Number of the string.
Input : var n = parseFloat("  2018  ");
Output: n=2018 (floating point Number)
4.JavaScript Math abs( ) Method
The Math.abs() method is used to return the absolute value of a number. It takes a number as its parameter and returns its absolute value.
Syntax:
Math.abs(value)
5.JavaScript ceil() Method
The ceil() method rounds a number UPWARDS to the nearest integer, and returns the result.
Syntax
Math.ceil(x)
6.The static function Math.min() returns the lowest-valued number passed into it, or NaN if any parameter isn't a number and can't be converted into one.Math.min()
console.log(Math.min(2, 3, 1));
// expected output: 1

console.log(Math.min(-2, -3, -1));
// expected output: -3

const array1 = [2, 3, 1];

console.log(Math.min(...array1));
// expected output: 1
7.Math.max()

The Math.max() function returns the largest of the zero or more numbers given as input parameters, or NaN if any parameter isn't a number and can't be converted into one.
8.JavaScript Random
Math.random() returns a random number between 0 (inclusive),  and 1 (exclusive):
Example
Math.random();
9.JavaScript: Math round() function
In JavaScript, round() is a function that is used to return a number rounded to the nearest integer value. Because the round() function is a static function of the Math object, it must be invoked through the placeholder object called Math.
10. JavaScript Math sqrt( ) Method
The Math.sqrt() method in JavaScript is used to square root of the number passed as a parameter to the function.
Syntax
Math.sqrt(value)
Have someone ever made a profit from your idea?
Tags: watercooler, webdev, business, startup
Published: 2021-05-06 09:29:50

---
title: Have someone ever made a profit from your idea?
published: true
description: 
tags: watercooler, webdev, business, startup
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wesjn133wgp9r7uwghgw.png
---
Have you ever experienced someone taking your project idea, a part of your code that was not licensed for profit, your original blog article or other intellectual property, and made a profit out of it? 

Would love to hear your stories!
Type unknown objects
Tags: typescript
Published: 2021-05-06 09:28:44

Sometimes I need to type an object, but I don't know how it will look like. Then I type it with the [Record](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeystype) utility type:

```ts
export interface Label {
	name: string;
	options: Record<string, any>[];
}
```
Bootstrap 5 is out
Tags: bootstrap, javascript, webdev, css
Published: 2021-05-06 09:21:23

Bootstrap 5 is finally out - this time for real.

STABLE - means that a technology is ready to use in production environments. Unlike an alpha or beta version.

Bootstrap 5 is now stable.

The fifth version is superior to the previous ones.
 - jQuery is removed
 - plain Vanilla JavaScript is now the base
 - RTL (right to left) support is added

We discuss these crucial changes as well as many others in our extensive 📖 1.5H crash course on the latest Bootstrap 5.

We invite you to watch & share our tutorial with your community.
Frontend industry has to make a switch to v5 - the sooner the better.

{% youtube rQryOSyfXmI %}
Do you start with frontend, backend, or both?
Tags: watercooler, webdev, coding
Published: 2021-05-06 08:51:26

---
title: Do you start with frontend, backend, or both?
published: true
description: 
tags: watercooler, webdev, coding
cover_image: https://flyaps.com/blog/content/images/2020/05/Frame-37-1.png
---
When it comes to developing full-stack apps, what is the preferred sequence of your workflow?

Do you normally start with design and user interface or all the server stuff and databases? Or do you like to do both simultaneously?
Launched - Passwordless login with one-click, biometric, or QR-code
Published: 2021-05-06 08:51:11

Excited to share! We launched idemeum - **Passwordless Identity Platform**. You can try [idemeum](https://idemeum.com) and let us know what you think. 

We are on product hunt. 

https://www.producthunt.com/posts/idemeum 

idemeum was born out of a simple thought - passwords suck👎. For users, they are hard to create, remember, and access quickly. For developers, they are expensive to manage, create unnecessary vulnerabilities, and add extra friction to user acquisition.

Today you have 2 choices - either struggle with passwords or give up your privacy for social login convenience. We thought users and developers shouldn't have to choose. So we asked a question - can we eliminate passwords and make the sign up experience easy, while keeping it private and secure?

That is how we created idemeum. idemeum is an identity platform for developers that is:

**Passwordless** - we replaced passwords with one-click, biometric, and QR-code login flows. You choose how you want to login your users - get simplicity of JWT token authentication with one-click, add extra security of WebAuthn with biometric login, or leverage mobile convenience and multi-factor security with QR-code login.

**Private** - we architected idemeum to be private by design. We do not want to be yet another party collecting your users' data. It is none of our business. We rely on client-side encryption to keep user data away from our eyes.

**User centric** - our goal is to make login experience invisible to users. Therefore, we made Single Sign-On a priority. And not just within one domain, but rather across apps. So that users login only once, and then they get truly frictionless experience accessing native mobile and web applications.

We are so excited to launch it today on Product Hunt, and we welcome all and any feedback you might have for us! Please let us know what you think about the product and its applicability, what features you might want us to add, and any questions that you might have.
Need Help,Issue In OTP Login
Tags: reactnative, authentication, jsonwebtoken, node
Published: 2021-05-06 08:40:19

Hello to all,
Actually, I am trying to make an OTP(One Time Password) based login page in my react-native app. But I am confused to do this with proper authentication.

Processes that I am thinking about right now::
1. Enter mobile number on app, hit submit button this will take the number to backend and will save in database (via Open API(a)(no protection)).
2. Then will use 3rd Party API(b) to create OTP which will send it to the customer, as a response from API(a).
3. Customer will enter the received OTP and hit the login button, this will again go back, this time I will create JWT based token and which will be sent to the customer.[API used to create token((c)(no protection))]
4. Now this token will be stored somewhere in the app, and will get appended to each and every request that the customer will make.


Now the confusing part,
the API (a) is open like anyone can access it, and anyone can hit the OTP API(b) via my API (a).
API (c) again is open, which means anybody can hit the API by submitting the OTP received via API (a).
Hence, can receive the token.
This way anybody can hit every API in my app.
Which is not healthy.
I am not able to come up with a better and solid approach.

How do I resolve this issue, kindly help?
CloudWatch Insights - how to find the context of multiple requests?
Tags: aws, logs, cloudwatch, insights
Published: 2021-05-06 08:34:33

Recently I was searching through our application logs. The task was to extract extra context for a group of requests (ex. errors in the external provider system with the original request). For our app, we are using [CloudWatch](https://aws.amazon.com/cloudwatch/) to store the logs. I have used [CloudWatch Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AnalyzingLogData.html) as out of the box tool to analyze them. 

Our logs have a format like below, with each console output in a separate line: 

```
2021-02-06T13:38:31.730Z info [some request id 1; some user id 1] Some external provider error message
2021-02-06T14:21:00.000Z info [some request id 2; some user id 2] Some external provider error message
```

We can use Cloudwatch Insights to extract all the information related to that requests: 

```
filter @message like "Some context to error message log"
| parse @message "* * [* *] *" as timestamp,type,requestId, user, textMessage
| filter requestId in ["some request id 1;", "some request id 2"]
| sort @ingestionTime desc
```

If the field you are searching for is a JSON array, you can search it like: 

```
filter @message like "Some context to error message log {
    "someInfo": [
        some1,
        some2
    ]
}"
| parse @message "* * [* *] *" as timestamp,type,requestId, user, textMessage
| parse textMessage '"someInfo":[*]' as someInfo
| filter requestId in ["some request id 1;", "some request id 2"]
| sort @ingestionTime desc
```

You can then export the data that you need or build some stats around it. 

Let me know in the comments if you found CloudWatch Insights useful too and how you are using them.
[Live] Designing Frontend using Low-Code - DronaHQ
Tags: lowcode, frontenddeveloper, uxdesign, nocode
Published: 2021-05-06 08:27:54

**[Low Code Live Builds] Designing Frontend using Low-Code platform DronaHQ**


Get ready to take your low-code apps to the next level! 

If you are frontend developers, UX UI designer who needs to check out the flexibility and speed low-code has to offer, this one is for you.

We will be creating an advanced UI app. App on focus: Employee Self Service Portal with a Workday Control Center like theme - similar to what is shown in the image above.

We will be adding mock data sources to give you a sense on how low code can help you build and run such applications under an hour.

**Watch on-demand:** [https://youtu.be/YUphwzeJ84c](https://youtu.be/YUphwzeJ84c)

Join us if you are a: 
- Low code enthusiasts
- Frontend engineering teams
- CIO/CTO teams