teleren/devto huggingface dataset:
Feynman
Published: 2020-08-25 03:33:59

I think you need to read all of Feynman's novels as well as his technical books. I also re-watch Infinity once in awhile. We watched it for some class but I don't remember which one. If you haven't taken some basic chemistry classes, I want you to know the man comes up there right away as well. He was super well rounded. As well as Joan, Feynman's sister and collaborator.

Recently I heard somebody saying Feynman was known as a philanderer. This is from a someone else's lens and perspective and was not how he was perceived as-alive one bit. Please reconsider labeling anyone alive or dead for a story's sake. I now see this academic as emotionally closed off. I don't see why else someone would bring that up about a person who was kind and isn't even around to continue hurting anyone if he ever did. It's weird!

There were people who misunderstood him but that is not even possible to add to his legacy. Almost anyone could have misunderstood Dr. F, as he was one lucky human to be endowed with loving parents who had the brains to help his intelligence grow early. Dr. F loved himself first, as we should note. That doesn't make someone a bad person at all. As he built up his knowledge in solitude or at work, he was able to explain it so clearly with natural linguistic compression, the only thing that could stop someone from enjoying his work is a) it was censored from them (this includes many of us) or b) they have no need to understand it.

Feynman observed what was happening at the time and expounded upon it enthusiastically. If there is anyway to make a backup of someone's useful know-how, we should be figuring that out. In case they are alive and hurting people, we can duplicate their work and not depend on evil to create good.

Later, I am going to talk about my current tech obsession Digital Equipment Corporation. This will lead me to Xerox Park, I am sure, but I haven't learned the roadmap yet. I am definitely most knowledgable on history from 1880s-1950's and then it jumps to 1977.
Dynamic programming and memoization
Tags: 100daysofcode, memoization, interview, javascript
Published: 2020-08-25 03:26:40

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

# Description:
Dynamic programming technique (memoization) with factorial and Pascal triangle. Dynamic programming is a concept that tends to be quite confusing when it comes to applying it, but memoization (not memorization) is one of the characteristics that identifies it for me. In computing, memoization or memoisation is an optimization technique used primarily to speed up computer programs by storing the results of expensive function calls and returning the cached result when the same inputs occur again.  

### Problem:

Implement pascal's triangle with combinations.

### Recursive factorial function:

#### Example:
 ``` 
    factorial de 4! =  4*3*2*1*0!
    0! = 1
  ```

#### Factorial function with memoization and recursive:
```js
function factorialDynamic() {

    let cache = new Map();

    return function factorial(n) {
        if (cache.has(n)) {
            return cache.get(n)
        } else {
            if (n <= 1) return 1;
            cache.set(n, n * factorial(n - 1));
            return cache.get(n);

    }

}
const factorial = factorialDynamic();
```

### Combinatorial function:

##### Example:
```
    Function: (P Q) = P! / (Q!-(P-Q)!)
```
```js
function combinatorial(p, q) {
    return (factorial(p) / (factorial(q) * factorial(p - q)));
}
```

### Pascal triangle function:

##### Example:

```
Combinatorial:

fila          (p q)
0             (0 0)
1           (1 0) (1 1)
2        (2 0) (2 1) (2 2)
3     (3 0) (3 1) (3 2) (3 3)
```

##### Row function:
```js
function row(p) {

    let row = [];

    for (let q = 0; q <= p; ++q) {
        row.push(combinatorial(p, q));
    }
    return row;

}
```

#### Triangle function (main):
```js
function trianglePascal(rows) {

    let triangle = [];

    for (let p = 0; p < rows; ++p) {
        triangle.push(row(p))
    }
    return triangle;
}
```

#### Print funtion (test result):

```js
function print(triangle) {

    for (let row of triangle) {
        console.log(row);
    }
}
```

`print(trianglePascal(6));`

```

1              [ 1 ]
2             [ 1, 1 ]
3           [ 1, 2, 1 ]
4         [ 1, 3, 3, 1 ]
5       [ 1, 4, 6, 4, 1 ]
6     [ 1, 5, 10, 10, 5, 1 ]

```

You can check  [code by @difo23](https://github.com/difo23/interviewQuestAnsJS)
Generic Static Site Generator
Published: 2020-08-26 06:27:03

---
title: Generic Static Site Generator
published: true
date: 2020-08-25 03:19:30 UTC
tags: 
canonical_url: https://theabbie.github.io/blog/Generic-Static-Site-Generator
---

By [Abhishek Chaudhary](mailto:abhishek7gg7@gmail.com)

**Published** 2020-08-24

_This is a Generic Static Site Generator, It is written in JavaScript, It can be used to create static websites.It is an organised and completely customisable Static Site Generator, It treats webpages as objects which can be evaluated.This can be used to created all kinds of websites._

 ![Generic Static Site Generator](https://theabbie.github.io/files/logo.png)

[Generic Static Site Generator Github](https://github.com/theabbie/Generic-Static-Site-Generator "Generic Static Site Generator Github")

[Generic Static Site Generator NPM](https://www.npmjs.com/package/generic-static-site-generator "Generic Static Site Generator NPM")

[Generic SSG](https://able.bio/theabbie/project/generic-ssg "Generic SSG")

[Generic Static Site Generator Gitter](https://gitter.im/Generic-Static-Site-Generator/community "Generic Static Site Generator Gitter")

[Generic Static Site Generator openbase](https://openbase.io/js/generic-static-site-generator "Generic Static Site Generator openbase")

[Generic Static Site Generator WNW](https://workingnotworking.com/projects/236753-generic-static-site-generator "Generic Static Site Generator WNW")

[Generic Static Site Generator Yarn](https://yarnpkg.com/package/generic-static-site-generator "Generic Static Site Generator Yarn")

[Generic Static Site Generator indie hackers](https://www.indiehackers.com/post/generic-static-site-generator-20bbc1c10b "Generic Static Site Generator indie hackers")

[Generic Static Site Generator DevPost](https://devpost.com/software/generic-static-site-generator "Generic Static Site Generator DevPost")
77: Visual thinking Drawing
Published: 2020-08-25 03:11:20


I found using frameworks can be productive, after all, one year figuring out vanilla Javascript, doubting the process I made without senior's approval, I made a result: this is not for me. The two developers I got inspired in the beginning, they emphasize 'vanilla JS'. Because they had been through the hardship missing the fundamentals. ME? I have no clue.

-------------------------------


However, to be short, I am not them, It didn't work on me positively. So those who feel left out not connecting the major opinion, that is okay, I can prove. 

No matter how much I was understanding their career and experienced advice, sometimes, that could be incorrect. And, I can't fix myself to fit them! Well, I had to leave them.

-------------------------------
 

I am capable of studying web frontend development with my design thinking, Do you like drawing? Let me give an example of what is my drawing applying to study web front end development. 

-------------------------------

1. Think about what I can draw from learning every step(HTML, CSS, JavaScript, React, Node JS, DataBase.... endless source) and Record the reasons why it is necessary to know, and discover the points. Get Ready for solving problems!

2. Time to acutalize my idea by encoding. Programming was not as same logic as learning linguistic langauge, speaking in programming world, we have 'google'. 

3. Finally, Moving on The stage of Projects, Just be yourself! Enjoy whatever I like to make my imagination happen in real! Can't wait for the right moment.  


[The article](https://academind.com/learn/javascript/vanilla-js-vs-frameworks/)
Simple React Folder Structure
Tags: react, javascript, typescript, beginners
Published: 2020-08-25 02:54:14

So you manage to finish all of those tutorial and you already run those generate commands, so what's next? Most of the time after generating new react project developers don't know where to put or organize their codes.

![Developer](https://dev-to-uploads.s3.amazonaws.com/i/jivw790nf88oen304aup.jpg)

After doing some research, trial and error on different react projects, I found the folder structure that works best for me and for my team.

This article is opinionated and you are welcome to adjust it for your own use case. Here's how I organize my React applications:

```text
.
├── README.md
├── package.json
├── tsconfig.json
├── public/
└── src/
    ├── index.tsx
    ├── routes.ts
    ├── api/
    ├── assets/
    ├── config/
    ├── containers/
    ├── context/
    ├── types/
    ├── utils/
    └── components/
        └── common/
```
####Here's a quick overview for each item or folder.

`src/` - Contains all of our react codebase.
`index.tsx` - Base react component. If you are not using typescript just change this to *'index.js'* or *'index.jsx'*.
`routes.ts` - App navigation. If you are not using typescript just change this to *'routes.js'*.
`api/` - Api call related functions.
`assets/` - Images, fonts and other static files.
`config/` - Config files
`containers/` - [Smart Components](https://medium.com/@thejasonfile/dumb-components-and-smart-components-e7b33a698d43)
`context/` - [React context](https://reactjs.org/docs/context.html)
`types/` - Typescript related files or functions.
`utils/` - Helper functions
`components/` - [Dumb Components](https://medium.com/@thejasonfile/dumb-components-and-smart-components-e7b33a698d43)
`components/common/` - Shared components

You can check this folder structure [here](https://github.com/pcofilada/simple-react-starter).
If you are also using redux on your react application you can check how does it looks [here](https://github.com/pcofilada/simple-react-starter/tree/redux).
I have implemented it with React Native application also, check it [here](https://github.com/pcofilada/simple-react-native-starter).

##Wrap Up
If you have any questions or recommendations, please leave them in the comments below.

Thanks for reading.
<!--
Photo by Startup Stock Photos from Pexels
Photo by Tim Gouw from Pexels
-->
10 Reasons Why EVERYONE Should Use GitHub
Tags: github, devops, top10, codenewbie
Published: 2020-08-25 02:53:08

What makes GitHub so popular? Can it be used for Startups, SMBs and Enterprises?  What are the top features?

It's again time for a Top 10. 

Let's talk about the __10 reasons why everyone should use Github__.

_(Note: the reasons are not in any specific order)_

### Reasons

1. It's home of more than 50 Million developers
2. It is the best Git provider out there
3. Free unlimited public and private repos, and unlimited collaborators
4. It's backed by Microsoft
5. Automation aka GitHub Actions
6. Dependabot, Security alerts and Automatic PRs
7. Native Mobile App
8. GitHub Insights
9. Activity Report
10. Marketplace and Integrations

### Video

Here you have the video with the full list, discussion, and explanation:

{% youtube wjHUwhRrGk8 %}

### Conclusion

What do you all think? Are my top 10 reasons the same as yours?  
Let me know in the comment section below if you think there are others reasons and features that are even better!
Will you map Ctrl to CapLock?
Tags: discuss, vim, emacs
Published: 2020-08-25 02:52:25

In my keyboard setting, I always map ctrl key to caplock such that I could press the ctrl key easier. However, this makes a big trouble when someone uses my keyboard lol. I tried to find a keycap that will indicate this change but cannot find any vendors provided this printing service.

How's about you? Do you map the key?
React Class to Functional Component Babel Plugin
Tags: showdev, react, webdev, javascript
Published: 2020-08-25 02:15:56

I was interested in how tools that analyze and change your code like `Babel`, `ESLint`, and `Prettier` work. I thought to myself, why not make a `Babel` plugin? So I did.

# Overview
This `Babel` plugin searches for `VariableDeclaration`s and converts them into functional components. Because of limitations and such components cannot use ES6 classes or JSX.

## Demo
This:
```javascript
import React from "react";

const Hey = React.createClass({
  componentDidMount() {
    console.log("a");
    console.log("b");
  },

  render() {
    return React.createElement("div", null, "Hey!");
  },
});

export default Hey;
```
becomes this:
```javascript
import React from "react";

function Hey(props) {
  function componentDidMount() {
    console.log("a");
    console.log("b");
  }

  useEffect(componentDidMount);
  return React.createElement(
    "div",
    null,
    "Hey!"
  );
}

export default Hey;
```

# Contributing
Pull requests are welcome if they add new features or integrate more hooks.

[Github](https://github.com/shadowtime2000/react-class-functional)
[NPM](https://www.npmjs.com/package/react-class-functional)
Kubecon 2020: Istio Simplified
Tags: kubernetes
Published: 2020-08-25 00:53:21

Last week I attended Kubecon 2020 Europe and have tried to write a summary on Istio simplified session which talks about changes in Istio 1.6 and a shift from microservices design pattern to a monolith design. Please do share your views in the comment section.
[Medium post](https://link.medium.com/Vjv18OSqc9)
Pull Request Reviewer’s Checklist
Tags: git, codequality
Published: 2020-08-25 00:43:50

What are some things you keep an eye out for when reviewing pull requests? These are some of mine:

* Does this code comply with the team’s selected architecture?
* Clean coding practices
    * Is this function too long, or does it do too many things? (Generally no more than 15-20 lines) 
    * Does this function or variable belong in this class?
    * Would this naming make sense to the next reader?
* Is this value being accessed safely, especially if it were null?
* Could this array/dictionary access cause an indexing crash?
* Could this cause a potential data race with unexpected value changes?
* Does the algorithm perform efficiently?
* Is this code written idiomatically with the language?
* Is this code unit tested? If not, should it be?
CSS3: Blending and flexing
Tags: css, discuss, html, webdev
Published: 2020-08-25 00:03:42

In applications like photoshop, you are spoilt for choice when it comes to giving your graphics that X factor. Over the years many of these effects have been implemented in CSS3. one such effect is the mixed-blend-mode CSS property.  This property can take the following values: screen, multiply, overlay, darken, lighten, color-dodge, color-burn, hard-light, soft-light, difference, exclusion, hue, saturation, color, and luminosity. These effects are mainly categorized into the lightening or darkening effect categories.  To see how CSS interprets these effects I put together this tutorial, which looks at the screen blend mode.

{% youtube Y1SLjHOBHbs %}

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0ghpcjh1sqrxpwusj7ex.jpg)

In screen blend mode you have a top layer of solid colors (this can be considered as a mask ) and a bottom layer that contains a color image. In the example above, the top layer is black, white, and shades of gray.  After you apply the effect, the left side of the image is clear, this is because black areas become totally transparent. But as you gradually look towards the right of the image, the gray areas have half transparency, while the white area is opaque. Knowing how this works you can use black text on a white background and use as a mask over an image.

In the tutorial, I put together a little demo page with a vibrant background image which is overlayed with a flex grid with eight boxes., Then I applied the screen blend modes to select a group of boxes as shown below.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/9oyefrlzdl87nxqgog67.PNG)

You can have a play around with different colors, gradients, transparency to get many effects. Hope you enjoy the video.
Setting Up and Running Apache Kafka on Windows OS
Tags: kafka, windows
Published: 2020-09-01 10:54:27

---
title: Setting Up and Running Apache Kafka on Windows OS
published: true
date: 2020-08-25 00:00:00 UTC
tags: Kafka,Windows
canonical_url: https://www.loginradius.com/engineering/blog/quick-kafka-installation/
---

In this post, we will look at the step-by-step process for Kafka Installation on Windows. Kafka is an open-source stream-processing software platform and comes under the Apache software foundation. What is Kafka? Kafka is used for real-time streams of data, to collect big data…

   
[Read On](https://www.loginradius.com/engineering/blog/quick-kafka-installation/)
Lowercase URLs in ASP.NET Core.
Tags: aspnetcore
Published: 2021-01-17 17:26:38

---
title: Lowercase URLs in ASP.NET Core.
published: true
date: 2020-08-25 00:00:00 UTC
tags: aspnetcore
canonical_url: https://driesdeboosere.dev/blog/lowercase-urls-in-aspnet-core/
---

When you create links in your ASP.NET Core web application with TagHelpers then each word in your URL will start with a capital letter.

Take this for example:

```
<a asp-controller="About" asp-action="Index">About</a>
<a asp-controller="Tools" asp-action="Index">Tools</a>
```

This will result in following HTML code where each word from the controller and action name starts with a capital letter in the URL:

```
<a href="https://driesdeboosere.dev/About">About</a>
<a href="https://driesdeboosere.dev/Tools">Tools</a>
```

And even in your web browsers address bar the generated URL from the controller and action name starts with a capital letter:

![URL in address bar](https://driesdeboosere.dev/blog/files/lowercase-urls-in-asp-net-core/lowercase-urls-in-asp-net-core-01.png)

I would like to have all my URLs in lowercase, like this:

```
<a href="https://driesdeboosere.dev/about">About</a>
<a href="https://driesdeboosere.dev/tools">Tools</a>
```

Luckily we can easily set this up in our **Startup.cs** class in the **ConfigureServices** method. We just need to setup the route options by adding the AddRouting extension method to services and set the [RouteOptions LowercaseUrls property](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.routing.routeoptions.lowercaseurls?view=aspnetcore-3.1) to true.

```
services.AddRouting(options => options.LowercaseUrls = true);
```

**Be aware that you put this options BEFORE services.AddMvc() or services.AddControllersWithViews()!!**

See this example:

```
public void ConfigureServices(IServiceCollection services)
{
    services.AddRouting(options => options.LowercaseUrls = true);
    services.AddControllersWithViews().AddRazorRuntimeCompilation();
    // other configurations
}
```

Now all our URLs created by our TagHelpers will be in lowercase.
How to wait for the HTML or DOM to load using JavaScript?
Tags: javascript
Published: 2020-08-25 00:00:00

---
  title: How to wait for the HTML or DOM to load using JavaScript?
  published: true
  tags: JavaScript
  date: Tue Aug 25 2020 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/wait-till-html-loads-javascript
  cover_image: https://melvingeorge.me/_next/static/images/main-aa52ffcac2be748e8a48230a85a4f7ad.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/wait-till-html-loads-javascript)
  
To do operations and to ensure the application runs smoothly while performing operations on DOM, we have to wait till DOM or the whole HTML elements loads.

There are 2 types of load event we can listen on the DOM:

- `load` event on the `window` object
- `DOMContentLoaded` event on the `document` object

## The `load` event in the `window` object

The `load` event in the `window` object waits until the DOM is fully loaded like all the resources including the images, iframes, etc is loaded.

The `load` event is triggered after everything on a page is loaded.

To do that, Let's add an event listener to listen for the `load` event in the global `window` object.

```javascript
// listen for load event in the window
window.addEventListener("load", function () {
  // do things after the DOM loads fully
  console.log("Everything is loaded");
});
```

## The `DOMContentLoaded` event in the `document` object

The `DOMContentLoaded` event in the `document` object is a bit different from the `load` event as this event is triggered when the browser loads the HTML and the DOM is built. It won't wait for resources like images, iframes etc.to load.

To do that, Let's add an event listener to listen for the `DOMContentLoaded` event in the `document` object.

```javascript
// listen for DOMContentLoaded event in teh document
document.addEventListener("DOMContentLoaded", function () {
  // do things after the DOM loads partially
  console.log("DOM is loaded");
});
```

### Feel free to share if you found this useful 😃.

---
Vue.js vs Django/Python which would you prefer when and for what? 
Tags: django, python, vue, react
Published: 2020-08-24 23:54:22

In between Vue and Python/Django

Which do you prefer for to use for what? 

I’ve been using django and I like it. It kinda goes back to a more of a “vanilla” way of things, where vue has more condensed components and state, ect...

But, which one has more demand or stable? 

Is Vue/React in more demand than Python? 
Which has more “entry” opportunities? 


It seems like a GUI like Kivy, looks like how components/objects are made in a JS framework (kinda), when would you use a GUI, how often?
How to make an accurate and precise timer in JavaScript
Tags: javascript, timer, accurate, drums
Published: 2020-08-24 23:42:55

If you want to use a #timer in #JavaScript for something where it's important that it's #accurate - like playing a drum loop - the built in JavaScript timer functions are virtually unusable.

In this tutorial we will have a look at how inaccurate the built in JavaScript timer functions are. We will hear how horrible it sounds when using them to play a drum loop. Then we will explore how we can account for the drift and create our own accurate timer. AND we will create our very own timer constructor function, so we can have multiple accurate and precise timer instances running simultaneously. We will also talk about why that is not always a good idea, and then - as a bonus - we will create a cute little drum machine. https://www.youtube.com/watch?v=x8PBWobv6NY
Where to put the business logic ?
Tags: php, mvc, businesslogic
Published: 2020-08-24 23:26:20

I am writing a web application using PHP without using any framework 'just for learning'.
My app consists of a small routing system, MVC components, some entities that represents the database tables and  repository classes that deals with the database.
The controller crate a repository object and that object load its entities from the database then return it as an array to the controller and the controller render the data.
What is the right place to put the domain or business logic,
in the models or repositories

View > Controller > Model > Repository > Database
View < Controller < Model < Repository < Database