teleren/devto huggingface dataset:
Gaussian Distribution
Tags: datascience, machinelearning, probability, statistics
Published: 2020-08-05 18:08:33

It is a type of continuous probability distribution for a random variable. It is also called as Normal distribution.

The general form of its probability density function is;

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

Here the parameter µ is the mean or expectation of the distribution and σ is the standard deviation.

When the mean becomes 0 and variance becomes 1 in a Gaussian distribution, it becomes a Standard Normal Distribution.

Gaussian distribution follows a bell-shaped curve and hence generally known as a bell curve.

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

Let us consider a random variable *'X'* such that *'X'* belongs to Gaussian distribution.

**X∈G(µ,σ)**
>
The mean is given as
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1qjp23kud7pyd37y9kog.png)
The variance is given as
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1qjp23kud7pyd37y9kog.png)
The Standard deviation **σ=√variance**

Now we look onto the empirical formula in Gaussian distribution.

• The first empirical formula is given as

**P(µ-σ≤X≤µ+σ)≈68%**.

i.e.,68% of the total distribution will be present in the first standard deviation range.

• The second empirical formula is given as

**P(µ-2σ≤X≤µ+2σ)≈95%**.

This means that 95% of the total distribution will be present in the second standard deviation range.

• The third empirical formula is given as

**P(µ-3σ≤X≤µ+3σ)≈99.7%**.

This means that 99.7% of the total distribution will be present in the third standard deviation range.

Now we look onto what is called as log-normal distribution.

###**Log-Normal Distribution**

Consider a random variable ‘X’ such that it has the datapoints

**X={x1,x2,x3,…..,xn)}**

Then **ln(X)={ln(x1),ln(x2),ln(x3),…..,ln(xn)}**

We say that this random variable *'X'* belongs to log-normal distribution if *ln(X)* is normally distributed and follows the Gaussian distribution.
Flatten Array using Arr::flatten() in Laravel
Tags: laravel, php, array, code
Published: 2020-08-05 17:52:25

During development, the developer needs to go through loops to prepare a single dimensional array out of a multi-dimensional array.

Laravel provides many helpers which come handy in multiple ways and saves developers work.

One of such is `Arr::flatten()` which flattens a multi-dimensional array into a single level by default.

Tested with Laravel versions **5.8**, **6** and **7**.

We need to import `Illuminate\Support\Arr` namespace with `use` keyword.

Kindly check for your version on the official DOC for [Laravel Helper Arr::flatten()](https://laravel.com/docs/7.x/helpers#method-array-flatten). This link will take you to **Laravel 7 Documentation**.

### Syntax

```php
Arr::flatten(array $array, [int $depth = INF])
```

### Parameters

#### \$array (necessary)

- The first parameter is necessary and must be an **array** that needs to be flattened.
- Laravel will extract elements and provides us with a new single dimension array based on the depth parameter.

#### \$depth (optional)

- The second parameter specifies the depth and it's an optional parameter.
- This value must be an integer type.
- The depth specifies how deep a nested array should be flattened.
- The default value for depth is infinity(`INF`) from which Laravel will extract elements and provides us with a new single dimension array.

### Return value

It returns a new 1-D flattened array.

### Example

```php
$data = [
    'country' => 'India 🇮🇳',
    'languages' => [
        'Gujarati',
        'Hindi',
        'Sanskrit',
        'Tamil',
        'Urdu',
    ],
];

dd(
   Arr::flatten($data)
);
```

#### Output

```output
array:3 [
  0 => "India 🇮🇳"
  1 => "Gujarati"
  2 => "Hindi"
  3 => "Sanskrit"
  4 => "Tamil"
  5 => "Urdu"
]
```

Read the complete post on our site [MeshWorld](https://meshworld.in/)  - [ Flatten Array using Arr::flatten() in Laravel](https://meshworld.in/flatten-array-in-laravel/)

Read others post on our site [MeshWorld](https://meshworld.in/)

## Resources
- Laravel Arr flatten method documentation

Happy 😄 coding
With ❤️ from 🇮🇳
Wednesday Links - Edition 2020-08-05
Tags: java, microservices, spring, database
Published: 2020-08-05 17:50:02

Preview APIs in the Java Platform ( 2 min read ) 👀
https://mail.openjdk.java.net/pipermail/jdk-dev/2020-August/004568.html

Good Logging ( 5 min read ) 🪓
https://henrikwarne.com/2020/07/23/good-logging/

JetBrains Release IntelliJ 2020.2 ( 2 min read )
https://www.infoq.com/news/2020/08/jetbrains-intellij-2020-2

Development on Kubernetes: IDE & Tools ( 4 min read ) 🧰
https://piotrminkowski.com/2020/08/03/development-on-kubernetes-ide-tools/

An Advanced Guide to GraphQL with Spring Boot ( 10 min read ) 📈
https://piotrminkowski.com/2020/07/31/an-advanced-guide-to-graphql-with-spring-boot/

Guide to building Spring Boot library ( 6 min read ) 🏗️
https://piotrminkowski.com/2020/08/04/guide-to-building-spring-boot-library/

Integrating JSON Schema validation in Spring using a custom HandlerMethodArgumentResolver ( 4 min read ) ✅
https://www.mscharhag.com/spring/json-schema-validation-handlermethodargumentresolver

Gradle plugin for generating BuildConstants ( 2 min read ) 🔠
https://github.com/gmazzo/gradle-buildconfig-plugin

Hexagon, Schmexagon? – Part 1 ( 15 min read ) 💠
https://blog.codecentric.de/en/2020/07/hexagon-schmexagon-1/

Disruption free release of services ( 1 min read ) 💡
https://twitter.com/copyconstruct/status/1290199788231614469

JPA AttributeConverter – A Beginner’s Guide ( 4 min read ) 🔌
https://vladmihalcea.com/jpa-attributeconverter/

R2DBC - PostgreSQL Support for geospatial types ( 30 sec read ) 🌐
https://github.com/pgjdbc/r2dbc-postgresql/pull/306

How GPT3 Works - Visualizations and Animations ( 5 min read ) 🧠
https://jalammar.github.io/how-gpt3-works-visualizations-animations/

New Relic Changes Business Model, Open Sources Agents and Instrumentation ( 6 min read ) 🗿
https://thenewstack.io/new-relic-changes-business-model-open-sources-agents-and-instrumentation/
#30DaysOfCJS: Hitchhiker's Guide to Web Standards
Tags: community, web, javascript, conferences
Published: 2020-08-05 17:22:50

---
title: #30DaysOfCJS: Hitchhiker's Guide to Web Standards
published: true
description: #30DaysOfCJS Day 4, Hitchhiker's Guide to Web Standards
tags: community, web, javascript, conferences
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/4etm26uug0hszie9x1vd.png
series: 30DaysOfCJS
---

*This is a follow up post for Day 4 of* **#30DaysOfCJS**, *learn more about* **#30DaysOfCJS** *here* {% link jimcalliu/30daysofcjs-1jd3 %}

**Hitchhiker's Guide to Web Standards // Dominic Farolino // CascadiaJS 2018**

We all use this little technology call "Web". Do you know who set the standard for Web? Would you like to learn about how to contribute to Web standard?

If you'd like to watch the talk, here is the Youtube link.
{% youtube z2SbknMWtp0%}

Further readings:
- [WHATWG](https://whatwg.org/)
- [Console Spec](https://console.spec.whatwg.org/)
Responsive Voice-controlled News App with Alan AI, React, Material-UI
Tags: showdev, webdev, javascript, react
Published: 2020-08-05 17:15:03

This is so far the most fun I had in a project! Have you ever wanted to know how to add AI to your website? Would you like to create a project that will catch the interviewers' eyes? Check out the complete front-end project below!:point_down:

{% github mrshawnhum/alan-ai-news %}

## :alembic:Technologies

I used React to create my project. Instead of using CSS, I used Material-UI as it is a fast convenient tool for responsive web design. Classnames to use multiple classnames within the components. For AI, I use Alan AI as it is a great AI to add to a website. This AI is free to use up to a certain amount of voices. There is a promo code in the video I mention to get you enough free credits for 10 projects with no need to add credit information. The API used was [News API](https://newsapi.org/).

## :triangular_flag_on_post:Issues I found

The main problem I had was the functions and syntax for Alan AI seem weird to me at first, but can be easily understood if you read the documentation. Another issue I found is that the video does not mention to hide your alan key before pushing to GitHub. [If you are unaware of how to add dotenv, here is my recommended source to get started.](https://stackoverflow.com/questions/42182577/is-it-possible-to-use-dotenv-in-a-react-project)

## :see_no_evil:How to get started

This video is where I recommend getting started. **:rotating_light:Don't blindly code along with the video, learn what you are coding and why.** Comment down below if you would like a technical article on this project!

{% youtube rqw3OftE5sA %}

## Thank You

Thank you for reading this article! Let me know what you think of this project! Leave a :heart: if you enjoyed the article! Check out some of my other articles as well!

{% user mrshawnhum %}
YouTube video title updater
Tags: youtube, dev, api
Published: 2020-08-05 17:10:48

Hey! I liked this video made by [Tom Scott](https://www.youtube.com/watch?v=BxV14h0kFs0) go and watch it, kinda interesting video to spend few minutes in your evening, but story is not about this.. He made video and attached YouTube data API to it that automatically changes title to "This video has XXX views.", so i tried to imitate it and make my own version of it.

This was my first experience making youtube video, so don't be too harsh, but coding part was nice and simple and i made it to work easily.. 

# Video
[![Video](http://img.youtube.com/vi/XbvQZTotBU8/0.jpg)](http://www.youtube.com/watch?v=XbvQZTotBU8)

My video here: http://www.youtube.com/watch?v=XbvQZTotBU8

## Source code
Take a look at file update-tile.php if you are interested in code that updates title. 
{% github arturssmirnovs/youtube-video-views-title-update no-readme %}

### Original idea
Tom Scott original video - https://www.youtube.com/watch?v=BxV14h0kFs0
nang explanation using python - https://www.youtube.com/watch?v=X4xtZv5nFIk
Committing To One Project
Tags: productivity
Published: 2020-08-05 17:05:26

At this time, when most of us techies are working from home, I am finding it difficult to stayed tethered to a single project at one time. If we are being honest with ourselves, I have more than 20 projects that are currently "in development". How did that happen? And, most importantly, how did I get to a point where the projects that I once had the most passion for haven't been touched in months? 

As I sit here and recognize that I've bailed on these projects that meant so much to me, I find myself coming up with ideas for new ones. Does it ever stop? How do YOU commit to a single project and see it to the "end"? 

I understand committing to a single project is quite easy to do when the projects are for a corporation, but when it comes to your own ideas and developments, how do you pick that point in which you can say to yourself 

"I am finished"
My beginning - JavaScript
Tags: javascript, codenewbie, beginners
Published: 2020-08-05 16:57:29

**I started out on the journey of learning to code on 18 June 2020.**

That morning, I woke up, checked my phone and saw a post on LinkedIn. It was written by someone I didn't know, an ex-Uber driver, and they simply expressed how glad they were that they'd learned to code. I declared to my husband then and there that I was going to learn to code. He just looked back at me sleepily. 

I have since found out that, by utter coincidence, the ex-Uber driver is in fact Nat Sharpe, a software engineer whose wife, Martha Sharpe, I own the book of and met within the Twitter community.

My role as an Executive Assistant to the CEO of a FinTech startup had been made redundant due to the pandemic and I was feeling a little lost, spending all my time walking and running and just generally feeling like I should be doing something - but I just didn't know what.

I had exactly no knowledge of coding, bar a little dabble in VBA in my previous job - again, I had mostly taught myself. I had never opened or thought to look at Visual Studio Code before, and would half listen to my husband (a solution architect at a FinTech company) when he talked about his latest API adventures.

After discussing what language I should learn with my husband, I settled on JavaScript due to the amount of options I would have regarding front or back end development. After a coffee, I searched on Udemy, a site I'd used before, for JavaScript beginner courses and found one on sale. A bargain! I had prepared to invest in my knowledge journey, but the sale price was about £10.

So far, I would say I'm a little less than a quarter of the way through my 'JavaScript basics' course and as I'm participating in the #100DaysOfCode challenge on Twitter, I think I'll need to get a new course by the end of that - which I fully intend to do. This isn't only a 100 day learning journey! I'm enjoying it immensely so far, and I've learned a lot - just don't ask me how to use .reduce()......




Speaking of Twitter - I have been blown away by the level of support that the tech community offers! I have had complete strangers, from the other side of the world, spend considerable time trying to help me fix a problem in a load of code that I've written but don't fully understand. People from all stages of their learning journey - #CodeNewbies like me, and developers with 20+  years experience - all mingle together and teach, learn, make silly memes about each other, and encourage each other! I can post that I'm having real trouble understanding a new concept that I've come across and would like to learn, and I'll often be inundated with peoples code snips, examples, explanations and offers of help! 
I've used Twitter in the past, but it's never felt as inclusive or supportive as it does now.

My family has also been a wonderful support - my husband, with degrees everywhere and over a decade experience in seemingly everything except JavaScript - my mum, who doesn't understand what I'm doing but says she's proud, and my younger brother who says 'that's well cool!'
React MD
Published: 2020-08-05 16:44:18

# JSX

JSX produces React Elements. It isn't HTML even though it looks similar. It comes with the full power of JS. Instead of separating concerns by file type, React separates concerns by Component. You can put any JS expression in a JSX element by using curly braces 👉 **{**x + 5**}** 👈        

```jsx
If a JSX element is empty (<div></div>), you can close it immediately like this <div />
```

# Rendering React Elements

Elements are the smallest building blocks of React. React Components are made up of Elements. Elements are immutable and represent the UI at a certain point in time.

# Components and Props

Components can feel like JS functions. They take an argument called "Props" and describe what an application element should look like. Users of React can define their own components. They will look like HTML but with custom names defined by the user.

```jsx
render() {
	return (
		<MyCustomReactElement />
	)
}
//The custom component can have custom "attributes", also defined by the user
```

> *Always start component names with a capital letter.*

### All React components must act like pure functions with respect to their props.

# State and Lifecycle

State is similar to props (short for properties of a React Element) except that it is PRIVATE and fully controlled by the component.

State is an object declared inside the component with **key: value** pairs.

### Whenever a component is rendered for the first time, the term is "mounted"

                                                                                                                                                 👆

                                                                               **👉ComponentDidMount(), or later...useEffect()** 

  Special methods we can  declare inside the component to run some code after the component mounts are called Lifecycle methods.

# Handling Events

Pass camelCased functions inside curly brackets as React element event handlers. Like this...

```jsx
<Button onClick={doSomething} /> //Notice no parenthases
```

Keep in mind that preventDefault() must be explicitly called if you want to prevent default behavior of a component.

# Lifting State Up

If two or more components need to reflect shared data, "lift their state" up to their next common ancestor → parent possibly

I think this can be explained best with an example...Lets try...

```jsx
<CustomComponentOne /> //I hold some state to display
<CustomComponentTwo /> //I also show the same state as CustomComponentOne

<CustomComponentHolder /> // I render the above two components, so I could hold their states
```
Node.js : Winston Logging
Tags: discuss, help, javascript, node
Published: 2020-08-05 16:40:47

Hey,

I am working on Nodejs and building a logger for the application I am working on. I am using Winston for logging purposes. I am having issues with logging the module/file name from where I am logging it.

If anyone has worked on it, can you please guide on the same. I do not want alternates for Winston, if anyone could help me with it please drop it in the comments.

It will be very useful. 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/7hooplr4zc9dgl0fe801.png)

```
Disclaimer : Don't give StackOverflow answers, I have tried them already. Apart from that, anything solution would do.```

Thanks :)
Build A Flutter 💙 Tinder Clone with Firebase & BLoC #13/40 Login Form
Tags: flutter, tutorial, dart, career
Published: 2020-08-05 16:37:07

---
title: Build A Flutter 💙 Tinder Clone with Firebase & BLoC #13/40 Login Form
published: true
description: Tutorial on building a Tinder clone with Flutter, Firebase and Bloc
tags: #Flutter #Tutorial #dart #career
//cover_image: https://direct_url_to_image.jpg
---
In this series of videos we are going to build a Tinder clone using Flutter, Firebase as a backend and Bloc as our state management solution.

Here we set up the Login Form.

Protip: Watch video at 1.25 speed.


{% youtube YcUl2WNO97k %}
Meme: Auto-import components with Nuxt 2.13+
Published: 2020-08-05 16:34:59

With Nuxt 2.13 and above (or the @nuxt/components library), you can auto-import components.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/p74c77rj1x3vxfq1h4zo.jpg)
Learning more about ethics in tech
Tags: watercooler, discuss
Published: 2020-08-05 16:30:05

Hey everyone!

I'm really interested in devoting my skills to ethical causes as my career, but I'm not quite sure how to do this. 

I'd love to learn more about ethics in tech - from small things we should think about in our daily lives (like accessibility) to big ethical dilemmas (like AI or data privacy).

Do you know of any good resources, mailing lists, or Twitter accounts for these kind of issues?
How to Delete Tweets and Likes from Twitter
Tags: howto, socialmedia, twitter
Published: 2020-08-24 18:31:40

---
title: How to Delete Tweets and Likes from Twitter
published: true
date: 2020-08-05 16:21:13 UTC
tags: HowTo,howto,socialmedia,twitter
canonical_url: https://vancelucas.com/blog/how-to-delete-tweets-and-likes-from-twitter/
---

I [recently quit Twitter](https://vancelucas.com/blog/scorched-earth-quitting-twitter-and-deleting-everything/) and deleted all my tweets and likes. This post shows how you can do the same.

### Delete All Your Tweets

Start out by deleting all your tweets. You can use a [3rd party tweet delete tool](https://tweetdelete.net) to do this for you for free for up to 3200 tweets, and it’s quick and easy.

I think I had right around 3,100 or so tweets, so I was just under the free limit.

### Delete All Your Likes

Deleting all your likes seems to be a lot more difficult than deleting all your tweets. I am not sure why, but a lot of tools don’t offer it as an option. It also appears to be rate-limited, so you may have to make multiple attempts at this over several days before you are able to unlike everything if you have lots of likes.

Go to your likes page: `https://twitter.com/<username>/likes`

[Open up the Developer Tools](https://developers.google.com/web/tools/chrome-devtools/open) console, and paste in the following script:

```
function _unlikeAll() {
  const randomNumber = (x, y) => ~~(Math.random() * y) + x;
  let unlikes = Array.from(document.querySelectorAll('[data-testid="unlike"]'));

  unlikes.forEach((unlikeEl) => {
    setTimeout(() => {
      unlikeEl.click();
    }, randomNumber(100, 8500));
  });

  window.scrollTo(0, document.body.scrollHeight);
}
var interval = setInterval(_unlikeAll, 12000);
```

Let this run for a while. Use a tool like [Caffieine](https://www.intelliscapesolutions.com/apps/caffeine) to keep your computer awake while this is running if needed.

This script stopped a few times for me, so I had to re-run it over the course of a few days to get everything. Twitter seems to have some kind of rate-limiting built into their web API, so you may run into it also.

### Cleanup

After authorizing apps to delete tweets for you (which requires full read and write access), make sure to head over to the [authorized applications settings](https://twitter.com/settings/applications) page on your Twitter account and revoke access to all the various apps you have used over the years.

### Other Options

Here are a few more scripts and things I found when researching how to do this. Some of them worked, and some of them did not. If the above script is not working well for you, feel free to try a few others:

GitHub Gist: delete-likes-from-twitter.js: [https://gist.github.com/aymericbeaumet/d1d6799a1b765c3c8bc0b675b1a1547d](https://gist.github.com/aymericbeaumet/d1d6799a1b765c3c8bc0b675b1a1547d)

GitHub Gist: delete-rt-and-tweets.js: [https://gist.github.com/FocusWho/5a8e74895293eae0071cec612477c72f](https://gist.github.com/FocusWho/5a8e74895293eae0071cec612477c72f)
Tell Me: What is the biggest (or funniest) data blunder you've encountered?
Tags: explainlikeimfive, discuss
Published: 2020-08-05 16:18:29

Companies with analytics debt (read: essentially every company) often have silly, unusual, and broken naming conventions, typos, and similarly incorrectly named metrics.

Example: https://twitter.com/quaesita/status/1283787303886954498

Let's laugh about it together! Share your experiences in the comments!
100 Signups For TeraCrawler
Published: 2020-08-05 16:07:00

Thank you Dev.to. A majority of them came from here. Dev.to posts have deceptively small number of upvotes but it gave me a ton of visits with conversions along with Reddit and some Facebook groups. and oh, TeraCrawler is a web crawler in the cloud. Go check it out https://teracrawler.io/
Kyle Simpson (@getify) is Partnering with Codota!
Tags: javascript
Published: 2020-08-05 16:06:10

Our mission is to make software development better with Artificial Intelligence. Now, we are taking it to the next level with the help of the iconic @getify, who will be working with Codota (and TabNine) to help empower developers with our AI code completion tools. 
All details are here:
https://blog.codota.com/kyle-simpson-getify-is-partnering-with-codota-to-expand-our-developer-empowerment-program/