teleren/devto huggingface dataset:
Yogi Berra Explains Agile
Tags: agile
Published: 2020-11-05 15:52:09

---
title: Yogi Berra Explains Agile
published: true
description: Famous baseball player, noted for his 'Berraisms', sheds some light on Agile practices
tags: agile
//cover_image: https://direct_url_to_image.jpg
---
Interviewer: Can you explain Agile?

Yogi: I can't, but I will. 90% of all Agile is half improvisation. The other half is the part people work on while others are working on something they never worked on with anyone who worked on that team. So if you work on the wrong part, it's right. If you work on the right part, it might be right if you work on it wrong enough. But if you work on it too right, it's wrong.

Interviewer: I don't understand.

Yogi: Anyone who understands Agile knows that you can't understand it. It's too complicated. That's what's so simple about it.

Interviewer: Do you understand it?

Yogi: No. That's why I can explain it. If I understood it, I wouldn't know anything about it.

Interviewer: Are there any great Agilists working today?

Yogi: No. All the great Agilists working today are retired. Except for the ones that are still working. But so many of them are retired, that the ones that are still working are retiring to be like the ones that are retired. Some would kill for it.

Interviewer: What is TDD?

Yogi: That's when the test that you should run now happens either before or after you actually run it. In Agile, you don't run tests when they happen because that would be some other type of development. Other types of development can be Agile, but only if they're the same as something different from those other kinds.

Interviewer: Now I really don't understand.

Yogi: I haven't taught you enough for you to not understand Agile that well.
Time Series Data / Audio Labeling
Tags: datascience, machinelearning
Published: 2020-11-05 15:31:43

If you haven’t heard of the [the Universal Data Tool](http://universaldatatool.com), it’s an open-source web or desktop program to collaborate, build and edit text, image, video, and audio datasets with labels and annotations. 

This is our ninth community update! By releasing these videos, we hope to engage the community and encourage new contributors. 

You can [watch the full video here](https://youtu.be/q20WrCRcG4k)

#New Feature: Time Series Interface
We now support the annotation of time series data with the “time_series” interface! Using this interface, you can import audio, JSON time data or CSVs, then add durations or timestamps. Check it out!

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

#Other Updates
-Fixed importing files from a directory in desktop application
-Fixed sample numbers issue: so now users can see samples number. (thanks, brian)
-Fixed multiple label classification bug, now users can click on multiple classifications.

That’s it for our ninth community update, be sure to follow us on [Twitter](http://twitter.com/UniversalDataTl), or join our [Slack](https://workaroundon.slack.com) to hear more!
Get a Free Food Delivery App Template 🍉 by UI Bakery 
Tags: webdev, opensource, startup, frontend
Published: 2020-11-05 15:47:19

Digitize a food delivery business in a day. Signup & login, a product catalog, a payment, and more pages – included. Suitable for personal & commercial needs.

– Free
– Customizable
– Responsive design
– Downloadable code

Get it now -> https://uibakery.io/templates/food-delivery-web-app-template?utm_campaign=ui_bakery%20-%20template%20-%20Food%20delivery%20-%20cacq%20-%20xx%20-%20views&utm_source=DevTo&utm_medium=General&utm_content=template_release
Seed a Laravel Application with Media Files
Tags: laravel, php, webdev, testing
Published: 2020-11-05 15:30:31

[Laravel-medialibrary](https://spatie.be/docs/laravel-medialibrary/v9/introduction) is a [Laravel](https://laravel.com) package for associating all sorts of files with Eloquent models. 

We have an `Auction` model that uses the library to associate an image with each object, 

	namespace App\Models;

	use Illuminate\Database\Eloquent\Factories\HasFactory;
	use Illuminate\Database\Eloquent\Model;
	
	use Spatie\MediaLibrary\HasMedia;
	use Spatie\MediaLibrary\InteractsWithMedia;
	
	class Auction extends Model implements HasMedia
	{
	    use HasFactory;
	    
	    use InteractsWithMedia;
	}

We wanted to seed an Eloquent model that has associated images  using a [seeder](https://laravel.com/docs/8.x/seeding#introduction) `AuctionSeeder`:

	class AuctionSeeder extends Seeder
	{
	    /**
	     * Run the database seeds.
	     *
	     * @return void
	     */
	    public function run()
	    {
	        Auction::factory()
			        	->count(10)
			        	->create();
	     }
	}	

running a [factory](https://laravel.com/docs/8.x/database-testing#creating-factories) `AuctionFactory`, 

	namespace Database\Factories;

	use App\Models\Auction;

	use Illuminate\Database\Eloquent\Factories\Factory;

	class AuctionFactory extends Factory
	{
	    /**
	     * The name of the factory's corresponding model.
	     *
	     * @var string
	     */
	    protected $model = Auction::class;
	
	    /**
	     * Define the model's default state.
	     *
	     * @return array
	     */
	    public function definition()
	    {
	        return [
	            'name' => Str::substr($this->faker->words(5, true), 0, 30),
	            'description' => $this->faker->text(600),
	        ];
	    }

To have each generated model associated with an image, we used [Unsplash Source](https://source.unsplash.com) to get random images of the required size, by configuring an `afterCreating` factory callback, 

    /**
     * Configure the model factory.
     *
     * @return $this
     */
    public function configure()
    {
        return $this->afterCreating(function (Item $item) {
            $url = 'https://source.unsplash.com/random/1200x800';
            $item
               ->addMediaFromUrl($url)
               ->toMediaCollection('auctions');                
        });
    }

One should note that if you plan to generate many images, you need to use the [Unsplash API](https://unsplash.com/developers) with an API key because of usage limits.
Become the protagonist of the movie
Tags: javascript, canvas, marketing, showdev
Published: 2020-11-05 15:27:31

---
title: Become the protagonist of the movie
published: true
description: Idea to get free advertising for movies.
tags: javascript, canvas, marketing, showdev
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/dz29ud32lrnitruc60pi.jpg
---

**TL;DR**

- [Video](https://twitter.com/vivirenremoto/status/1324364467908579328)
- [Demo](https://vivirenremoto.github.io/your_movie/)
- [Source code](https://github.com/vivirenremoto/your_movie)

Note: I recommend you to use chrome mobile, because you can take a selfie directly and you don't need to choose an image from your photo gallery.

**Long story**

The last day I got an idea to get free advertising and I want to share it with you.

Imagine you are the company Marvel and do you want to promote the last movie Venom.

The idea is simple, just put a QR code in your movie ticket like this:

![movie ticket](https://dev-to-uploads.s3.amazonaws.com/i/q2n7o8qoy04n0buo942j.png)

When someone scan this QR code will see a website where they can take a selfie and become the protagonist of the movie.

![Web app](https://dev-to-uploads.s3.amazonaws.com/i/vrcz7s0nrll8x636vj4x.jpg)

Then they can download the image and share it on social networks like instagram stories and this is free advertising for the movie.

I wrote a simple web app to do this using only javascript and canvas, the image is generated on browser, no server is required to upload the image.

Hope you like it
ใช้ std::cmp::Ordering ใน Rust
Published: 2020-11-05 15:10:09

โค้ดจากตัวอย่างในหนังสือ Rust Programming Language เวลาที่ต้องการ match ผลลัพธ์ของการ compare ค่าเราจะใช้ `use::std::cmp::Ordering`
ตัวอย่างเช่น

```rust
use::std::cmp::Ordering;

fn main() {
    let target = 5;
    let limit = 10;
    match target.cmp(&limit) {
        Ordering::Less => println!("less than limit"),
        Ordering::Greater => println!("greater than limit"),
        Ordering::Equal => println!("lucky"),
    }
}
```

ถ้าเข้าไปดู source ใน lib ของฟังชั่น `cmp` จะพบว่าฟังชั่นถูกเขียนอยู่ในรูปแบบนี้
```rust
fn cmp(&self, &other) -> Ordering;
```

ฟังชั่นนี้จึงรีเทิร์น `Ordering` ที่เป็นผลลัพธ์ของการเปรียบเทียบกันระหว่างค่า `self` และ `other` สังเกตุว่า `other` ที่เอามาเทียบนั้นอ้างถึงค่า slice ของมันนั้นคือ `&other` นะครับ เราจึงเห็นว่าโค้ดตัวอย่างด้านบนใส่ค่าของ `&limit` เข้าไปใน `cmp` เช่นกัน (ลองเปลี่ยนเป็น `limit` เฉยๆ Rust จะด่าเราว่า type ที่ใส่เข้ามาไม่ถูกต้อง)
Drash Middleware v0.6.0 Release Notes
Tags: deno, drashmiddleware, typescript, webdev
Published: 2020-11-05 14:30:49

Drash Middleware v0.6.0 was released! This release comes with two new tools for your Drash application. Here's what we've added:

* [Front-end TypeScript Support](#frontend-typescript-support)
* [Improved Templating System Support](#improved-templating-system-support)
* [Cookie Support For CSRF](#cookie-support-for-csrf)

## Front-end TypeScript Support

Want to write your front-end using TypeScript? Now you can with [ServeTypeScript](https://github.com/drashland/deno-drash-middleware/tree/v0.6.0/serve_typescript)!

ServeTypeScript is middleware that allows you to write front-end TypeScript. How does it work? Here's the workflow:

1. You give this middleware TypeScript files to compile when your Drash application starts up.
2. When your application is starting up, the middleware compiles the files into JavaScript and saves the JavaScript in memory -- ready to be used when your application is running.
3. When a request is made to a TypeScript file from your front-end, the middleware sends back the compiled JavaScript -- allowing your browser to execute it.

Since the TypeScript files are compiled and cached when your application starts up, your application stays quick to respond to requests.

Want to scale your front-end using TypeScript with a single tool? Check out the ServeTypeScript [tutorial](https://github.com/drashland/deno-drash-middleware/tree/v0.6.0/serve_typescript).

## Improved Templating System Support

Want to power your Drash application with the template engine of your choice? Now you can with [Tengine](https://github.com/drashland/deno-drash-middleware/tree/v0.6.0/tengine)!

Tengine is middleware that allows you to tell your Drash application how it should render HTML; and you can use the template engine of YOUR choice. This means you can use it with Eta, Dinja, dejs, or any other Deno template engine framework that you love.

Don't have a template engine in mind to use? That's okay too! Tengine comes with a default template engine called Jae and getting started with it is super easy. At Drash Land, we're very documentation-driven, so we've written some [tutorials](https://github.com/drashland/deno-drash-middleware/tree/v0.6.0/tengine) for you to get started quickly.

Want to render HTML in an easy, scalable fashion? Check out the Tengine [tutorials](https://github.com/drashland/deno-drash-middleware/tree/v0.6.0/tengine).

## Cookie Support For CSRF

Protect your application with this middleware. Learn more about Drash's CSRF middleware [here](https://github.com/drashland/deno-drash-middleware/tree/v0.6.0/csrf).

---

View the Drash Middleware project [here](https://github.com/drashland/deno-drash-middleware).

More information on this release can be found at https://github.com/drashland/deno-drash-middleware/releases/tag/v0.6.0

Want to contribute to the Drash Land projects? View our "Good First Issues" [here](https://github.com/orgs/drashland/projects/1?card_filter_query=label%3A%22Good+First+Issue%22).
Fed up with Git conflicts😤?: Rebase regularly and chill!
Tags: git, webdev, beginners, productivity
Published: 2020-11-05 14:48:24

>Git is a blessing, isn't it?

Absolutely yes, if used properly.

The general workflow that we follow in the project development is like
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/j5g50quhrhl7f88gbff6.png)

If you have observed the above flowchart, there is a red line drawn from the master branch to the merge commit and that is intentional. 

Most of the time, many developers work on the same project and on different issues, and while we work, the master branch could have been updated with other's change and the master branch could have new commits. So let's update the diagram.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/q4tdfujfe1rriczy6ru1.png)

OK, updated the diagram. But what is the issue? 
The issue is, there are possibilities of getting conflicts and we have to resolve either by merging the master branch to your branch or rebasing your branch with the master.

Now let's get this straight why I choose to rebase over merge
> No extra merge commit
> Master's history remain clean and linear

So when we merge master to our branch, we need to resolve the conflicts, and then it adds a new merge commit. 

While in rebasing our branch is first updated with master and then our commits will be applied one by one.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/viliz2lk78qace29a76z.png)

If you are working on a complex task, you might need more time and the master branch will not wait for you, so I suggest to rebase your branch regularly(daily) and if there are conflicts resolve it, Otherwise at creating a pull-request or merge-request of a big task, conflicts may haunt you.
#1 Introduction to MongoDB
Tags: mongodb
Published: 2020-11-05 15:04:19

MongoDB is a NoSQL Database. 
Instead of storing data in the form of table and rows, in mongoDB data in stored in the form of objects.
Mongoose is ODM, which makes it easier to communicate with MongoDB.

In this series we will learn about 
MongoDB and Mongoose
CRUD application 
and a testing framework called Mocha.
🤬 Make users' input polite with PoliteText
Tags: ruby, rails, codenewbie, opensource
Published: 2020-11-05 14:53:43

Hey devs ✌️,

At [stanza.dev](https://stanza.dev?ref=gem) we help developers to share coding concepts and learn from each others. 👨‍💻 👩‍💻

We can't monitor each post by hand but as Stanza must be a place full of love 🌞, we have developed a gem that removes the bad words from the website : [polite_text](https://github.com/OpenGems/polite_text)

### Remove swear words 🤬

```
include PoliteText

str = "This gem is a fucking big shit but let's try it"

PoliteText.be_polite!(str)
=> "This gem is a *** big *** but let's try it"
```

### Check if string is polite 🙅‍♂️ 🙅‍♀️
```
include PoliteText

str = "This gem is a fucking big shit but let's try it"

PoliteText.is_polite?(str)
=> false
```

### Example for an Article model
```
# == Schema Information
#
# Table name: articles
#
#  id         :bigint           not null, primary key
#  text      :string           default(""), not null
#  created_at :datetime         not null
#  updated_at :datetime         not null
#

class Article < ApplicationRecord
  include PoliteText

  # Callbacks
  before_save :make_text_polite

  # Methods
  def make_text_polite
    PoliteText.be_polite!(text)
  end
end
```

### Custom swear words list 🌞

You can even pass your custom swear words list that is relevant for your app.

We have opensourced it and we hope that you will like it and contribute to improve it if you want 🙏

👉 [stanza.dev](https://stanza.dev?ref=gem) - Learn coding concepts faster

Access the gem repo [here](https://github.com/OpenGems/polite_text)
What are some good Interview questions?
Tags: discuss, python, datascience, database
Published: 2020-11-05 14:43:50

---
title: What are some good Interview questions?
published: true
description: I am not asking for take home work, or whiteboarding questions.  I am looking to distinguish between someone who knows their stuff and willing to learn versus someone who is can word vomit hot tech terms in an interview.
tags: discuss, python, datascience, database
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/j7193b6zhchkroc72q5e.png
---


What are some good interview questions that you have asked or have been asked?  

What resources do you use to come up with good questions?

I am not asking for take home work, or whiteboarding questions.  I am looking to distinguish between someone who knows their stuff, willing to learn, and adopt good practice versus someone who is can word vomit hot tech terms in an interview.
Updated my React UI Kits Post
Tags: update, react, frontend
Published: 2020-11-05 14:42:56

---
title: Updated my React UI Kits Post
published: true
description: 
tags: update, react, frontend
---

My [React UI Kits](https://dev.to/kayis/react-ui-kits-3fm2) post is still the most viewed post I've ever written, so I thought it would be appropriate to update the numbers a bit. 

I didn't have the time to search for new UI kits, though. If you think an awesome UI Kit is missing: **Tell me in the comments!**
dmm v1.2.0 Release Notes
Tags: deno, dmm, typescript, webdev
Published: 2020-11-05 14:29:15

dmm v1.2.0 was released! This release contains improvements to the CLI. Here are some highlights:

* Added support for nest.land modules
* `info` command can now fetch info on multiple modules

Don't know what dmm is? Find out more at https://drash.land/dmm or read [this](https://dev.to/drash_land/dmm-a-deno-module-manager-3dd8) short article.

---

View the dmm project [here](https://github.com/drashland/dmm).

More information on this release can be found at https://github.com/drashland/dmm/releases/tag/v1.2.0.

Want to contribute to the Drash Land projects? View our "Good First Issues" [here](https://github.com/orgs/drashland/projects/1?card_filter_query=label%3A%22Good+First+Issue%22).
Alert when user leaves the web page
Tags: webapi, javascript
Published: 2020-11-06 15:11:09

---
title: Alert when user leaves the web page
published: true
date: 2020-11-05 14:41:59 UTC
tags: webapi, javascript
canonical_url: https://phongduong.dev/blog/alert-when-user-leaves-the-web-page/
---
To know when users leave the web page, you listen to `beforeunload`**.** This event is fired before the `window` is unloaded. 

 It is because of the browser's support. In the event handler, you can call `preventDefault()` on the event, assign a string to the event's `returnValue` property and return a string. You should combine these methods if your web page runs on multiple browsers.

```javascript
window.addEventListener('beforeunload', (event) => {
  event.preventDefault();
  event.returnValue = '';
});
```

When the user tries to leave the page like refreshing, closing the tab, or going back, it is going to show a confirm dialog.
I Built An Open-Source Resource for Data Scientists In an Evening
Tags: motivation, datascience, opensource, productivity
Published: 2020-11-05 14:35:16

I built the first version of [Use Pandas](https://www.usepandas.com) in one evening. It's a collection of easy to use Python pandas recipes for Data Scientists, Data Analysts, and Machine Learning engineers. 

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

Leveraging existing tools, I was able to quickly spin up and deploy a new site. I shared it with my LinkedIn and quickly got some decent traffic. The site went live October 22nd.

## Quick highlights of the first 14 days
- 2622 Unique Visitors
- 5055 pageviews
- A principal research from Microsoft (contributed)[https://github.com/kennethcassel/usepandas/pull/20] to the project!
- Tons of new [LinkedIn](https://www.linkedin.com/in/kenneth-cassel/) and [Twitter](https://twitter.com/KennethCassel) followers 

So let's get on to how I actually made the site! 
 

## Resources I used to make the service

- [Namecheap Logo Maker](https://www.namecheap.com/logo-maker/)
- [Gatsby](https://www.gatsbyjs.com/)
- [Netlify](https://www.netlify.com/)


## How I built it

### 1. Choose a Gatsby theme. 
My site is for code recipes so I had to find a gatsby theme that would take care of the bulk of this. 

I was looking for a theme that had code blocks, syntax highlighting, dynamic page routes, and was mobile responsive. 

I ended up finding [this theme](https://www.gatsbyjs.com/starters/Rocketseat/gatsby-starter-rocket-docs) which met all my criteria. 

### 2. Choose a name. 
I was heavily inspired by Gabe Raglands site for react hooks called [usehooks](https://www.usehooks.com), so I chose a similar name. I purchased the domain usepandas.com from NameCheap. 

### 3. Make it your own
I used the [Namecheap Logo Maker](https://www.namecheap.com/logo-maker/) to easily create a logo. I'm not a graphic designer but I understand the importance of something looking nice. The NameCheap logo creator is pretty awesome and it's FREE! 

### 4. Deploy it
The gatsby + netlify integration is so easy to use. On merge's to the master branch of my repo, the site is updated. I never used it before this project and it was pretty easy to learn. 

### 5. Share it with the world!

When I launched Use Pandas, I only had a few basic recipes on the site. I still got overwhelming positive feedback which gave me the motivation to add more. 

I'm adding more recipes all the time! 

If you'd like to here more from me, I build in public [@KennethCassel](https://twitter.com/KennethCassel)
Quick tip: Manage Node versions for your projects
Tags: beginners, node, tutorial
Published: 2020-11-05 14:22:53

When I start a new project, I am likely going to run [`npm init`](https://docs.npmjs.com/cli/init/). It can be a backend API, a frontend application, or a simple static site.

This means that [Node.js](https://nodejs.org/) is powering all of my projects and it's unlikely that I am able to keep all of them working with the same Node version. For example, I may have a legacy project that uses Node v8 while a newer project uses Node v14.

A tool to help with this problem exists and you may already be aware of it: [Node Version Manager (NVM)](https://github.com/nvm-sh/nvm). It allows you to install and use different versions:

```sh
# Install and use Node v14
nvm install 14
nvm use 14
```

However, this manual process can be tedious when switching between projects. Imagine opening a project and instinctly trying to run `npm start`. Uh oh, you see some errors. You begin debugging until realizing that you're on a wrong Node.js version! You then have to remember the right version or look at the readme.

## 💡 Solution: the `.nvmrc` file

Did you know that [NVM](https://github.com/nvm-sh/nvm) can automatically detect which version to use in a project? You can enable this by adding a [`.nvmrc` file](https://github.com/nvm-sh/nvm#nvmrc) which should contain a Node version:

```
14.15.0
```

Now run `nvm use` in the project and NVM will figure out to install and use `14.15.0`.

> **Bonus**: You can even have your shell automatically run `nvm use` when it detects an `.nvmrc` file! [Read the NVM docs](https://github.com/nvm-sh/nvm#deeper-shell-integration) to learn how to set it up.

## 🏎 Honorable mention: the `engines` field

NVM obviously uses the `.nvmrc` file, but some other tools and services may as well. Notably, [Netlify uses nvmrc](https://docs.netlify.com/configure-builds/manage-dependencies/#node-js-and-javascript) to detect which Node.js version to build your site with.

However, other services [such as Heroku](https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version) use the [engines field in package.json](https://docs.npmjs.com/cli/v6/configuring-npm/package-json#engines):

```json
{
  "name": "my-package",
  "engines": {
    "node": ">=14.15.0",
    "npm": ">=6.14.8"
  }
}
```

This field actually matters significantly when it comes to publishing packages to NPM with version requirements, and also has the added benefit of being able to specify the version of the package manager (NPM or Yarn) as well.

---

Maintaining different Node.js versions is now a problem of the past. Did you like this quick tip? Maybe you have one to suggest? Leave a comment or send me [a tweet](https://twitter.com/sunnysinghio).