teleren/devto huggingface dataset:
What is the Prototypal Inheritance in JavaScript?
Tags: javascript, webdev
Published: 2020-09-19 12:15:18

For understanding Prototypal Inheritance in JavaScript let's first understand what Inheritance is.

Inheritance is one of the basic concepts of OOP (Object Oriented Programming). Inheritance is the capability of one class to inherit capabilities or properties from another class .let's take an example. We are humans, We inherit certain properties from the class 'Human' such as the ability to speak, breathe, eat, drink, etc.

In JavaScript, objects have a special hidden property [[Prototype]] (as named in the specification), that is either null or references another object. That object is called “a prototype”.

When we want to read a property from an object, and it’s missing, JavaScript automatically takes it from the prototype, this is called “prototypal inheritance”.

let animal = {
  eats: true
};
let rabbit = {
  jumps: true
};

rabbit.__proto__ = animal; 

alert( rabbit.eats ); // true
alert( rabbit.jumps ); // true
My experiments with the GPT-3
Published: 2020-09-19 12:08:49

GPT-3 is a Generative Pre-trained Transformer and autoregressive language model that uses deep learning to produce human-like text. 


GPT-3 is the third-generation language prediction model in the GPT-n series developed by [OpenAI](https://openai.com/).


OpenAI is an artificial intelligence research laboratory located in San Francisco.


The GPT-3 is better at generating lines of text than GPT-2, and they sound like they might have been written by a person.


*"A stairway to darkness in the blink of an eye"*, Ozzy Osbourne sang.


I typed this phase and this is what the GPT-3 responded to me:

*"Imagine a world of peace, love, and prosperity. Everyone lives in harmony with one another, everyone is happy, content, and free to do as they please without any fear of their fellow man or worry about what comes tomorrow as long as they have the means to take care of themselves. A life where you wake up every day feeling like your life has no purpose or reason but soon finds that when you get out into society everything makes sense. You go from door to door visiting friends and family with whom you share all memories (even if someone dies it can be replaced) so everyone knows who everyone else is because no one ever leaves anyone behind."*

GPT-3 is a real philosopher.


I did a lot of experiments with the previous version, but I didn't like the quality of the texts.


**Today I asked the algorithm to write an article for me about machine learning** and this is [what came of it](https://www.vproexpert.com/machine-learning-model-validation/).


I think the text is very good.


In my opinion, GPT-3 has tremendous potential for task automation. What do you think?
Daily Developer Jokes - Saturday, Sep 19, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-09-19 12:00:30

---
title: "Daily Developer Jokes - Saturday, Sep 19, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Saturday%2C%20Sep%2019%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258e619778.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ A SQL query goes into a bar, walks up to two tables and asks:

___A:___ Can I JOIN you?
 -->
[country,state,city] dropdown list using javascript - Step by Step
Tags: laravel
Published: 2020-09-19 11:59:28

Today In this tutorial, we will show you how to dynamically create a country state city dropdown list in PHP using jQuery ajax from MySQL database.

This tutorial will guide you step by step on how to create country state city in dropdown list onchange in PHP from MySQL using Ajax or populate the first, second, and third dropdown based on the first and second selection of dropdown in PHP. jquery plugin for country state city dropdown in this tutorial.

In this dependent country state city dropdown using ajax, in PHP MySQL, we will show states and cities in the dropdown list based on the selected country and state value.

```
<?php
require_once "db.php";
$country_id = $_POST["country_id"];
$result = mysqli_query($conn,"SELECT * FROM states where country_id = $country_id");
?>
<option value="">Select State</option>
<?php
while($row = mysqli_fetch_array($result)) {
?>
<option value="<?php echo $row["id"];?>"><?php echo $row["name"];?></option>
<?php
}

```

[[country,state,city] dropdown list using javascript - Step by Step](https://www.phpcodingstuff.com/blog/country-state-city-dropdown-list-in-php.html)
All that matters is legacy software
Tags: uncategorized
Published: 2020-09-20 09:51:43

---
title: All that matters is legacy software
published: true
date: 2020-09-19 11:58:28 UTC
tags: Uncategorized
canonical_url: https://lancewicks.com/2020/09/19/all-that-matters-is-legacy-software
---

Lately I have been working on a tool we use on the IJF World Tour to present real-time graphics on the live stream fo events; and it made me want to write something about how important “legacy” software is and how in fact we can argue that “legacy” software is the only software that matters.

Specifically, I have been updating an Electron app that listened for UDP packets and displays them on the screen using HTML and CSS. We then chromakey that onto the camera feed of a Judo contest.

![](https://i2.wp.com/lancewicks.com/wp-content/uploads/2020/09/Screenshot-from-2020-09-03-11-09-17.png?resize=656%2C73&ssl=1)

This software is used at every large IJF and EJU event and seen by people all over the world. So it is really “valuable”, it also “legacy”. In many sense of the term.

It is legacy in that it does not have tests, it is legacy in that it’s old and not well maintained. It is legacy in that it provides value. It is legacy in that it is relied upon.

I have been updating the software to match the latest style of graphics. But I have also been trimming away dead code, un-used features and general “cruft”.

Having done that, I am not embarking on the classic “re-write”, changing it to use Elm and elm-ui on the front-end rather than JQuery/HTML/CSS(Bootstrap).

The re-write builds on the foundations of the original. The Node code that listens to the UDP packets is not going away. It’s a slightly revised (smaller) version with less features, but fundamentally building on the legacy.

The front-end although entirely new and written in a new language, is still building on the legacy of the original code. Again some features are gone and it’s simpler.

And that is the point, legacy software informs new software. All new software builds on it’s legacy. And… within minutes of being written/released becomes legacy software itself. Which in turn becomes the legacy upon which the next thing is built.

So although I sometimes describe myself as more of a “maintainer” than a “creator” I see the two intertwined. Both greenfield and legacy software are one in the same, yin/yang, two sides of the same coin.

Creating software is an act of building on legacy software and creating legacy software. So only legacy software really matters… right?

In creating this “new” version of the software, I am extending the life of the legacy software at it’s core. The UDP listener I recall is actually built on top of an even older piece of software I wrote tweeted contest results (which never gained traction) which was built on an even older piece of software that wrote all the packets to a database for analysis later… which was used twice I think before it became apparent it was not a good idea.

So this shiny new version, written in a shiny new language is in fact just a new layer upon many layers of legacy code.

It too will soon be legacy code.
What is an event loop in JavaScript?
Tags: javascript
Published: 2020-09-19 11:42:20

The event loop is the core concept of JavaScript but for the people who just started writing code in JavaScript, they found it a bit confusing.

So, what really an event loop is?

The event loop is responsible for asynchronous programming in JavaScript. JavaScript is a single thread language but using some great data structures techniques, it gives us the ability of multi-threading. Let's take a look at how things work.

JavaScript uses call stack to keep track of executions line by line. All the operations are pushed to the stack in order and whenever an operation is completed it is popped out of the stack.

The event queue is responsible for sending new functions to the track for processing. It uses the queue data structure to maintain the correct sequence in which all operations should be sent for execution.

Let's take an example of the setTimeout method. When a setTimeout operation is processed in the call stack, it is sent to the related Browser API which waits till the specified time to send this operation back in for processing to the event queue.

The event loop facilitates this process; it constantly checks whether or not the call stack is empty. If it is empty, new functions are added from the event queue. If it is not, then the current function call is processed.
GoogletransX: Free unlimited translation
Tags: go, webdev, opensource, translate
Published: 2020-09-19 11:01:49

---
title: GoogletransX: Free unlimited translation
published: true
description: Go googletrans library on steroids
tags: go, webdev, opensource, translate
cover_image: https://resize.indiatvnews.com/en/resize/newbucket/1200_-/2019/12/google-translate-1575354629.jpg
---

Hi guys!
I'd like to share with you my work on extending existing google translate library project with some features.

https://github.com/yuriizinets/googletransx

## So, what features?

- All that original library functionality, including unlimited free translates! :)
- BulkTranslate with goroutines processing
- HTML translate support
- Built-in API server for integrations
- Dockerized server

## Why not original library?

To be honest, I started that project due to absence of normal BulkTranslate functionality. I had to translate a really huge amount of different data, and to make it fast and functional I created fork with extended features.

## API server? For what?

Golang may be not the only language in the project. For simple integration I bundled functionality as a simple API to use that as a service.

P.S.
I hope that it will be useful for you. Even if not, thank you for your attention :)
Build an Ecommerce Website With React,mongodb and Nodejs | Mern Stack Ecommerce Website
Tags: javascript, react, mongodb, ecommerce
Published: 2020-09-19 10:29:24

How Build an Ecommerce Website With React,mongodb and Nodejs | Mern Stack Ecommerce Website

[article](www.wpcodevo.com)

For the past months, I have been intimidated by the code I see people type when am watching tutorials. I decided to put all tutorials beside and then create something on my own which I did by creating this eCommerce website with React Nodejs and Mongodb

[![Ecommerce Website](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/we78to5qftdcy9feqayf.jpg)](https://youtu.be/j10ZTzgYNPs "React Nodejs Mongodb Ecommerce Website")
Video^
New Plans for Agencies
Tags: showdev, webdev
Published: 2020-09-19 09:45:39

![screpy plans & pricing](https://dev-to-uploads.s3.amazonaws.com/i/jmqsnlu8n0yyukrwi2et.png)

Many people wanted to buy a higher plan. Because the number of keywords was not enough for them.

We created a plan where users can analyze 2000 keywords per month according to their requests. And we can prepare personalized plans for those who want more.

Review and don't go without say your opinion!
[Screpy.com](https://screpy.com/pricing/)
Day 1 of #100DaysofCode: Learning UI Design Patterns
Tags: 100daysofcode, beginners, codenewbie, webdev
Published: 2020-09-19 09:38:54

####Introduction
————————————

If you're new here to the #kathycodes journey, let me start off by saying Welcome! 🎉

This is my first round of #100daysofcode so I'm starting off as a beginner and I'm learning with *Skillcrush — Break into Tech course*

I'll be documenting my journey in several ways, if you want tidbits find me on twitter at @kathyjeanjoseph to view my to the day updates of my journey. 

Visual? I'm on YouTube and view me in action and a less detailed version of my problems, solutions and takeaways.


####Today's Topic: Learning UI Design Patterns.
————————————

In my SkillCrush course, this particular module is in the *Web Design Fundamentals* Course.

The focus was particularly on defining UI, Intuitive Design & Design Patterns & Trends.


####Main Notes:
————————————
1. User Interface: _How your site graphics, layout & text work together to help users find what they need_.

2. Intuitive Design: _Designing sites that users can figure out on their own_.

3. Design Patterns: _Pre-built solutions to common web design & UI problems that are proven to work look great_.

4. Design Trends: _Popular aesthetic styles that define how things look_.

####Main Takeaways:
————————————
Common design patterns — 
1. page/layout based ways to design the things that users will commonly go to a website to click on. *i.e. linking logo to homepage, example text in email input box, etc.*

Common design trends —
1. Minimalist Design 
2. Subtle Gradients 
3. Large, bold type etc.

####Beyond the course:
————————————

Personal resources for viewing and admiring UI:
https://dribbble.com
https://behance.net
https://onepagelove.com
https://awwwards.com
https://youtube.com
https://twitter.com — #uidesign tag
What is Git? For beginners
Tags: beginners, git, devops
Published: 2020-09-19 08:59:09

𝗪𝗵𝗮𝘁 𝗶𝘀 𝗚𝗶𝘁?

Git is a 𝗗𝗶𝘀𝘁𝗿𝗶𝗯𝘂𝘁𝗲𝗱 𝗩𝗲𝗿𝘀𝗶𝗼𝗻 𝗖𝗼𝗻𝘁𝗿𝗼𝗹 𝗦𝗼𝗳𝘁𝘄𝗮𝗿𝗲 that keeps track of every modification to the code/file over time.

Git allows you to create branches of your 𝗪𝗵𝗮𝘁 𝗶𝘀 𝗚𝗶𝘁?

Git is a 𝗗𝗶𝘀𝘁𝗿𝗶𝗯𝘂𝘁𝗲𝗱 𝗩𝗲𝗿𝘀𝗶𝗼𝗻 𝗖𝗼𝗻𝘁𝗿𝗼𝗹 𝗦𝗼𝗳𝘁𝘄𝗮𝗿𝗲 that keeps track of every modification to the code/file over time.

Git allows you to create branches of your main file. 
$ 𝚐𝚒𝚝 𝚋𝚛𝚊𝚗𝚌𝚑 𝚗𝚎𝚠𝙱𝚛𝚊𝚗𝚌𝚑
$ 𝚐𝚒𝚝 𝚌𝚑𝚎𝚌𝚔𝚘𝚞𝚝 𝚗𝚎𝚠𝙱𝚛𝚊𝚗𝚌𝚑

This way you move to the new branch and you can edit or try any new feature without the fear of loosing the previous stable version.

Checkout the post for more info:

I struggled a lot to figure out what git was and how it was beneficial. 

If you are new to programming. Git is a "must have" skill.
It saves a lot of your time, hassle !!



𝗧𝗿𝘆 𝘂𝘀𝗶𝗻𝗴 𝗚𝗶𝘁 𝗰𝗼𝗺𝗺𝗮𝗻𝗱𝘀 𝗮𝗻𝗱 𝗱𝗿𝗼𝗽 𝘆𝗼𝘂𝗿 𝘁𝗵𝗼𝘂𝗴𝗵𝘁𝘀 𝗶𝗻 𝘁𝗵𝗲 𝗰𝗼𝗺𝗺𝗲𝗻𝘁 𝘀𝗲𝗰𝘁𝗶𝗼𝗻 !!

@progressiveprogrammer

#100daysofcode



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


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


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


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


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


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


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


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


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/vh6iljtbc26n37njybl5.png)
Designing OAuth Auth Flow 
Tags: oauth, ngrok, react, angular
Published: 2020-09-19 08:56:53

This articles explores the design of an OAuth2 Auth Flow in decoupled Frontend and Backend application. Get a high level understanding of how OAuth Auth Flow works in 3 legs (Frontend, Backend and OAuth Provider), then use existing libraries or design custom experience without using any libraries. Frontend could possibly a React Application or Angular Application or any other app, Backend app could be written in NodeJS, Go or any language.
 
![OAuth Flow](https://assets.digitalocean.com/articles/oauth/auth_code_flow.png)
## Understand the flow

1. **User Authorization Request**: From Client App, on a button click, open the Auth Window either in same window using `window.location.assign(oauth_provider_auth_url)` or in another window using `window.open(oauth_provider_auth_url)`
 - The oauth_provider_auth_url will generally carry the client id, scope, redirect_uri and few other parameters
 - This url can be either stored in Client Side or for security purpose this can be obtained from server.
1. **User Authorises Application**: The flow will now be handed to OAuth Provider (like Google, or Facebook), where user will approve application to login and grant permission for scope specified earlier.
1. **Authorization Code Grant**: After user confirmation, oauth provider issues an OAuth Code, and it redirects to `redirect_uri` specified earlier with an auth code. 
1. **Access Token Request**: The Redirect Controller/Page, can now send this request to backend to issue you an access token using the auth code.
1. **Access Token Grant**: Server issues the Access Token.

## Front End Concerns
1. Sign In OAuth Button
2. Redirect page in your application.
  - In Development Mode you can provide localhost:[port]/[oauth-redirect-uri] (if OAuth provider support this. Google doesn't support this) 
  - Ngrok is alternative tool which can be used to port forward your localhost and then redirect uri can be specified [your-ngrok-site-url]/[oauth-redirect-uri].
3. Required action on SignIn - global variable update

## Back End Concerns
> Obtain the Acces Token from OAuth Provider and issue custom Access Token.

1. Handling the Auth Code: Backend Sends the Auth Code Sent from the Oauth Redirect Controller in Front End Application to the OAuth provider Access Token Url (with parameters like client_id, client_secret, scope, etc).
1. On success, OAuth Provider sends a payload that has access token of the OAuth Provider and maybe refresh token and other things.
1. OAuth Provider Access Token can be wrapped in your custom JWT Token so that you can use it for further request like obtaining profile information.
1. JWT Token can be sent to Client App to store in its local storage (which can be insecure). Best is to use Http Only Cookie. 

PS: Check out my other article on [Designing Authentication System] (https://dev.to/babbarankit/designing-authentication-system-for-a-ssr-client-application-2p8e)
How can I refactor this code snippet?
Tags: vue, javascript, refactorit
Published: 2020-09-19 08:55:29

While developing vuejs project, I often meet a situation like the following:
Here "this" is the vue component.
I would love to refactor this code to look it very nice.
Please share your idea with me.
Thank you.
```javascript
const newReportPart = {
        id: this.id,
        title: this.title,
        description: this.description,
        product_id: this.product_id,
        product_title: this.product_title,
        rate: this.rate,
        saved: this.saved,
        attachments: this.attachments,
      };
      this.$emit('submitReportPart', this.index, newReportPart);
```
I'm looking to build a team for startup company - do you wanna hear more?
Tags: android, java, startup, application
Published: 2020-09-19 08:44:14

I have a school project that I took a bit farther and I think there is a need we can fill. 
prefer to say more to whom we find fit for the team :)

knowledge needed:

Java/Kotlin - very good
firebase - some knowledge
good vibes - must

see you later
The input method explained!
Tags: python
Published: 2020-09-19 08:21:03

In this post, I'll give you an in-depth use of Python's `input()` method.

### What is the input used for?
`input()` method in Python is used to take input from the user. it works similar to both `cout` and `cin` in `C++`

## Syntax
```python
variable_name = input("prompt to the user..")
```

## Reading one variable

### Example
```python
age = input("Enter your age")
```
It works similar to the below code in `C++`
```cpp
int age;
court<<"Enter your age";
cin>>age;
```

## Reading two variables
You can also read multiple variables at the same time.

### Example
```python
age, weight = input("Enter your age & weight").split()
```
You need to use the `split()` method in order to read multiple variables from a single line, The above code works like below,
For example, if you entered `18 49` in the console, the interpreter reads it as a string `"18 49"` and the `split()` method divides it into `18` and `49` and they are assigned to `age` and `weight` respectively.
It works similar to the below code in `C++`
```cpp
int age, weight;
court<<"Enter your age & weight";
cin>>age>>weight;
```
Redux vs Facebook Flux in React projects
Tags: react, redux, flux
Published: 2020-09-19 08:23:05

---
title: Redux vs Facebook Flux in React projects
published: true
description: 
tags: react, redux, flux
---

It's always interesting to see how many libraries are out there that set up to do the very same thing. 
That's usually because different providers set out to the same goal but due to company/political reasons don't arrive to merge/integrate.

One example of that is Facebook's Flux and Dan Abramov's Redux. It was interesting to see how similar these are. Only to realize the above statement later on, after reading this post:

https://stackoverflow.com/a/32920459

To me, Redux is a clear way to go and maybe would only still use Flux in experimental projects. As time is usually short and with hundreds of new frameworks out there, my approach is to just keep it simple and concentrate on the outcome.

Another issue with Redux and alikes is the boilerplate code generated. This can be fixed to some level:

https://redux.js.org/recipes/reducing-boilerplate

What is explained in reducing-boilerplate above, is very close to DSL(think how Terraform is configured) as for each reducer, you'd only write configuration. The logic is hidden under the template method, which is very nice.