teleren/devto huggingface dataset:
Question: JSON and jQuery
Tags: javascript, jquery, json
Published: 2020-11-06 08:30:19

I am making a tutorial for learning. Works fine. I have so far localized using JqueryLocalize to French. Static page contents are translated okay, but dynamic content(content added via jquery html()) are not being translated. Does anyone have pointers on how I can achieve this?
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0dfnx6gb46ao0ihds1kz.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ira4o1lgj4jlqglx81gi.png)
Should I apply once again at a company where once I had a bad luck in interview ?
Tags: career
Published: 2020-11-06 08:29:06

I was once approached by a company they were looking for MERN stack developer, my interview didn't go well, I was unable to answer any question correctly, and at the end I was upsat and showed my little bit anger. Now they are one of the few reputed companies in my area and one of few who have jobs for MERN stack developer. 
Now I have skills but still no experience but I have gained more knowledge and even I am able to clear technical interviews. Should I apply there once again ? It seems weird to me to apply there once again
What's your best decision switching jobs?
Tags: watercooler, career, motivation
Published: 2020-11-06 08:21:19

---
title: What's your best decision switching jobs?
published: true
description: 
tags: watercooler, career, motivation
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/6otgzee5yqxhu3hantaz.jpg
---
Could you describe your best experience of switching jobs?

Maybe you increased your pay rate, met awesome co-workers, liked the environment, tech-stack, and culture way better, and get other bonuses?

Or maybe you were lucky enough to improve on all of them?
2020-11-05 | 'Would my Grandma understand this?', Self-criticism vs. Self-compassion, Reading
Tags: learninpublic, beginners, webdev, career
Published: 2020-11-06 08:09:50

---
title: "2020-11-05 | 'Would my Grandma understand this?', Self-criticism vs. Self-compassion, Reading"
description: "Summary of my day"
published: true
tags: ["LearnInPublic", "Beginners", "Webdev", "Career"]
series: "miku86 Diary"
canonical_url: "https://miku86.com/blog/day-2020-11-05"
---

I worked on my JS course, especially the chapter about booleans and loops. Writing this for non-techies and non-native speakers needs a lot of attention and effort. Writing for techies is easier for me, because I can formulate like I think. Formulating for non-techies adds the additional step of translating from my thinking. My simplest feedback question is "Would my grandma understand this?". I visualize myself talking to her about this stuff. "Hey grandma, so the lightbulb in your kitchen is either turned on or turned off. There is no other state. Either on or off. _click_".

The rest of the day was taking a rest. I learned this the last few months. It's important to take rests. There is no need to feel guilty or even ashamed if you need a rest. I try to avoid [Self-critisism](https://en.wikipedia.org/wiki/Self-criticism) and use [Self-compassion](https://en.wikipedia.org/wiki/Self-compassion). It's a very interesting topic, I recommend to read up on it.

In the evening I did my tiny workout routine, answered all messages and continued on [Rationality: A-Z](https://www.lesswrong.com/s/5g5TkQTe9rmPS5vvM). I learned most of this stuff in university, so it's a quick refresher.
#codevember - 6 - Starry Night - Made with tsParticles
Tags: codepen, javascript, showdev, html
Published: 2020-11-06 07:53:00

<h1>Starry Night</h1>

<p><strong>Made with <a href="https://github.com/matteobruni/tsparticles">tsParticles</a></strong></p>

{% codepen https://codepen.io/matteobruni/pen/bGexNaZ %}

<p>Checkout more samples on CodePen <a href="https://codepen.io/collection/DPOage">here</a></p>
Have you ever contributed to DEV?
Tags: meta, opensource, motivation
Published: 2020-11-06 07:39:47

---
title: Have you ever contributed to DEV?
published: true
description: 
tags: meta, opensource, motivation
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/rc1omyvcd57ccs9deudx.png
---
Have you ever contributed some PRs to DEV's codebase or technical docs? If so, what's something you have been most proud of?

Still on the way to making my own, so far I've done just 16 feature requests and bug reports!

I thought this would be a great start for inspiration, seeing how awesome the community is by contributing to open source and building together!
Understanding Docker: part 12 – Pass build arguments
Tags: docker, devops, beginners, cloud
Published: 2020-11-06 07:36:27

---
title: Understanding Docker: part 12 – Pass build arguments 
published: true
description: Serie of sketchnotes about Docker. Explaining in a visual way Docker principles.
tags: Docker, DevOps, beginners, Cloud
series: Understanding Docker in sketchnotes
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/oz3smc5p4jgcmdu3ax65.jpg
---

Understanding Docker can be difficult or time-consuming. In order to spread knowledge about Cloud technologies I started to create sketchnotes about Docker. I think it could be a good way, more visual, to explain Docker (and other technologies like Kubernetes and Istio).

We continue the series of Docker sketchnotes with a focus about how to pass arguments during build of a Docker images.

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

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

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

As usual, if you like theses sketchnotes, you can follow me, and tell me what do you think. I will publish others sketchs shortly :-).

If you are interested, I published all the sketchnotes on Docker (and new ones!) to make a "book" of 93 pages: ["Understanding Docker in a visual way"](https://gumroad.com/aurelievache#YTLzM).
Python De-Prioritise Performance ?
Tags: python, datascience, performance, tensorflow
Published: 2020-11-06 07:02:25

Python deprioritize the performance use-case, so does the developers using Python !
Although, there is one group that suffers because of this, the one that uses computing on data, the data scientists !!

But due to easy adaptability of learning/implementing python programmes, it gives no other choice to them but to learn python (mostly because of their non-programming background).

Hence, it becomes necessary to look out for options to have more performance oriented way to use python.

Here comes numerical programming libraries like numpy, scipy, tensorflow etc.

As per Brain Kihoon Lee, the magic for their enhanced performance lies in their PyObject use case.

“A NumPy array can hold many raw data within a single PyObject box, provided that all of those data are of the same type (int32, float32, etc.). By doing this, NumPy amortizes the cost of boxing over multiple data”

Such a simple yet complex strategy numpy adopted to increase performance by 30X !!

Many more interesting things are discussed in article titled “Data-oriented Programming in Python” by Brain Kihoon Lee.

One such thing is about pointer latency and how it affects the performance of Python code.

Link to article:

[Data Oriented Python](https://www.moderndescartes.com/essays/data_oriented_python/)

Did you like the article ? What are your views on it ?
Friday Blast #95
Tags: fridayblast, links, post
Published: 2020-11-12 15:55:18

---
title: Friday Blast #95
published: true
date: 2020-11-06 07:00:00 UTC
tags: fridayblast,links,post
canonical_url: https://horia141.com/friday-blast-95.html
series: "Friday Blast"
---

[Productionizing Spark streaming applications (2019)](https://blog.clairvoyantsoft.com/productionalizing-spark-streaming-applications-4d1c8711c7b0?gi=5cae7fb77bd1) - we had to use Spark streaming for a project at [Bolt](https://bolt.eu), and this guide proved mighty useful for getting us in the right headspace for tackling the problem.

[Asynchronous computing at Facebook (2020)](https://engineering.fb.com/2020/08/17/production-engineering/async/) - an overview of Facebook’s complex system for handling “notifications” and “notification-like events”. A message queue in a way. As a side-note, I’ve noticed that systems that are essentially message queues (chat systems, notification systems, etc.) don’t ever seem to be implemented as an infrastructure-level message queue (Kafka, SQS, etc.), but rather in a traditional fashion (mixes of databases, queues, caches, servers, etc.).

[Big data architecture patterns (2014)](https://www.youtube.com/watch?v=-N9i-YXoQBE&feature=youtu.be) - a short overview of how a modern-ish data infrastructure layer looks like - data lakes, ML systems, etc. included.

[Mutation testing - a tale of two suites (2020)](https://codeascraft.com/2020/08/17/mutation-testing-a-tale-of-two-suites/) - about how Esty used _mutation testing_ to migrate from one test framework to another. It was the first time I heard of mutation testing (with this definition at least - but the name sounds familiar). It is a test for tests essentially. It applies a batter of mutations to the code base, and runs the test suite on it. Ideally the test suite should fail in the appropriate manner. Quite an interesting and powerful code quality tool - a step above just having tests, and in the realm of code coverage tooling, fuzzing, etc.

[An introduction to CQRS and Event Sourcing patterns (2017)](https://www.youtube.com/watch?v=9a1PqwFrMP0&feature=youtu.be) - again an intro talk on these two more advanced architecture patterns.
Copy files to and from Kubernetes Pods with kubectl
Tags: kubernetes, devops, learning
Published: 2020-11-06 03:09:20

---
title: Copy files to and from Kubernetes Pods with kubectl
published: true
date: 2020-11-06 02:46:06 UTC
tags: ["kubernetes", "devops", "learning"]
canonical_url: https://www.joshkasuboski.com/posts/kubectl-cp/
---

I wanted a simple backup of some OpenEBS volumes. Why not just copy them out.

## Why bother

I run a number of things on my [Raspberry Pi kubernetes cluster](https://www.joshkasuboski.com/posts/home-k8s-raspberry-pi/) that require storage. The main one I actually care about is my [fathom](https://github.com/usefathom/fathom) instance.

It has the website analytics for my site [joshkasuboski.com](https://www.joshkasuboski.com). It's certainly not the end of the world to lose this information, but I'd really rather not. Previously, I had tried to get [velero](https://velero.io/) setup.

I tried to use both the OpenEBS specific plugin and the generic restic. The OpenEBS one failed because my setup couldn't take snapshots. My USB drives are pretty slow so I just chalk it up to that. The restic option seemed to work, but it didn't actually restore data in my test. In addition, it kept exceeding my [backblaze](https://www.backblaze.com/) s3 api limits.

Anyway, I just wanted something simple before I upgraded OpenEBS. Then I found the `kubectl cp` command.

## Backing up the volumes

I manually backed up all of my persistent volumes. This is only five items for me, but could get out of hand quickly. It was really as simple as running the command for each and storing the files locally.

Copying files from a pod to your machine`kubectl cp <namespace>/<podname>:/mount/path /local/path`

I did this for all paths I cared about. If something goes wrong you can always copy the files back to the pod. It's the same command just swapping source and destination.

Copying files to a pod from your machine`kubectl cp /local/path <namespace>/<podname>:/mount/path`

I still hope to get OpenEBS snapshots working in the future, but this worked great for now.
What to do with abandoned projects? BrowserSync
Tags: discuss, javascript
Published: 2020-11-06 06:56:40

---
title: What to do with abandoned projects? BrowserSync
published: True
description: What can be done to continue an obandoned project?
tags: 
  - discuss
  - javascript
//cover_image: https://direct_url_to_image.jpg
---
Browser sync let you view your app in multiple sizes and even multiple devices at once. Navigsting in one of the windows, All other windows will perform the same action.

BrowserSync is an openSource project of the company [jh](https://wearejh.com/). 

When I tried eleventy for the first time, it serve the ssg site via browser-sync. I found an issue about a broken link, that leads to a potentially dangerouse fraudulent website.

I created an issue, as asked on browsersyncs website.

Now some time went by, and it seems more and more issues pile up. not answered.

What do you think can we do? The tool is very cool, but it should also be safe and secure to use.
How to Learn Math for Machine Learning: Step by Step Guide?
Tags: machinelearning, datascience, career
Published: 2020-11-06 06:56:28

When it comes to learning math for machine learning, most of us stuck and don’t know **what to learn and from where to learn**…Right?. 

That’s why I thought to write an article on this topic. In this article, I’ll discuss **how to learn math for machine learning step by step**. So read this article and clear your all confusion regarding math for machine learning.

Now without further ado, let’s get started-

#**How to Learn Math for Machine Learning?**

Before learning math, you should know why math is important for machine learning and why you can’t avoid math. Alright…?. So let’s understand the importance of math in Machine Learning-

##**Importance of Math in Machine Learning**


1. With the help of mathematics, you can select the right algorithm which includes giving considerations to **accuracy, training time, model complexity, number of parameters, and number of features.**

2. Mathematics helps you to identify **under-fitting and over-fitting** by understanding the **Bias-Variance tradeoff.**

3. You can choose **parameter settings and validation strategies** with the help of math.

4. Without knowledge of math, you can’t estimate the **right confidence interval and uncertainty.**

That’s why you should have mathematics knowledge in order to become a Data Scientist or Machine Learning Engineer.

Now you understood the importance of math, so let’s see **how to learn math for machine learning and what’s the first step-**
[Click to Continue Reading...](https://www.mltut.com/how-to-learn-math-for-machine-learning-step-by-step-guide/)
Extend Express Request in TypeScript
Tags: express, node, typescript
Published: 2020-11-06 06:49:32

Utilizing the functionality of TypeScript to extend the Request type in Express allowing us to pass our own types to be used with the Request object.

In the example below, I wanted to be able to add a `services` key to the Express Request object and pass interfaces for `Query`, `Params` and `Body`.

I also reordered some of the types in order of what I most frequently used, making everything optional.

```typescript
// types.ts
import * as core from 'express-serve-static-core'
import {
  ReportService,
} from './services'

interface IRequestServices {
  ReportService: () => ReportService,
}

export interface Query extends core.Query { }

export interface Params extends core.ParamsDictionary { }

export interface Request<ReqBody = any, ReqQuery = Query, URLParams extends Params = core.ParamsDictionary>
  extends express.Request<URLParams, any, ReqBody, ReqQuery> {
    services: IRequestServices,
  }
```

```typescript
// controller.ts
import express from 'express'
import { Params, Query, Request } from '../../types'

interface RequestBody {
  name: string
}

interface RequestQuery extends Query {
  category: string
}

interface RequestParams extends Params {
  reportId: string
}

const updateNameController = async (req: Request<RequestBody, RequestQuery, RequestParams>, res: express.Response): Promise<void> => {
  const reportService = req.services.ReportService()
  const report = await reportService.updateReportName(req.params.reportId, req.query.category, req.body.name)
  return res.status(200)
}

export default updateNameController
```

Let me know your thoughts in the comments!
Add tree to git-bash on Windows 10
Tags: git, gitbash, windows10
Published: 2020-11-06 06:38:27

# Step-by-step
1. Go to http://gnuwin32.sourceforge.net/packages/tree.htm
2. Download the Binary version (see image below)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/zcb4ugnv71eynqog4uyx.png)
3. Open the zip file and double click to `bin` folder
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/oorodb6x3h3qzh9xswgp.png)
4. Extract `tree.exe` to `C:\Program Files\Git\usr\bin`
5. Try on your git-bash now. 
Result
![image](https://dev-to-uploads.s3.amazonaws.com/i/5jazystq9kad5b8kwhey.png)

Credit:
https://superuser.com/questions/531592/how-do-i-add-the-tree-command-to-git-bash-on-windows/1141489#1141489
Download latest version of Slack from the Bash terminal
Tags: terminal, bash, ubuntu, slack
Published: 2020-11-06 06:28:29

I am releasing a project to automate the download of common software latest version for Ubuntu (coming soon).

In the meantime...

Downloading the latest version of Slack from the command line is frustrating because there seems to be no official latest tag on the releases one can use. Hence one has to parse the downloads page for the correct link.

This is my solution to this problem:

Ubuntu (saved as `slack-desktop-latest.deb`):
```bash
wget -q https://slack.com/downloads/instructions/ubuntu -O - \
| tr "\t\r\n'" '   "' \
| grep -i -o '<a[^>]\+href[ ]*=[ \t]*"\(ht\|f\)tps\?:[^"]\+"' \
| sed -e 's/^.*"\([^"]\+\)".*$/\1/g' \
| grep 'slack-desktop' \
| xargs wget -q -O slack-desktop-latest.deb
```
{% collapsible Explanation of commands %} 
- `tr` is the unix character translator-- here it translates newlines and tabs to spaces, as well as converts single quotes into double quotes so we can simplify our regular expressions.
- Matching all `<a href="(ADDRESS_IS_HERE)">` on a page. `grep -i` makes the search case-insensitive `grep -o` makes it output only the matching portions.
- `sed` is the Stream EDitor unix utility which allows for filtering and transformation operations.
- `sed -e` just lets you feed it an expression.
{% endcollapsible %}

Fedora (saved as `slack-desktop-latest.rpm`):
```bash
wget -q https://slack.com/downloads/instructions/fedora -O - \
| tr "\t\r\n'" '   "' \
| grep -i -o '<a[^>]\+href[ ]*=[ \t]*"\(ht\|f\)tps\?:[^"]\+"' \
| sed -e 's/^.*"\([^"]\+\)".*$/\1/g' \
| grep 'slack.*rpm' \
| xargs wget -q -O slack-desktop-latest.rpm
```

MacOS (saved as `slack-desktop-latest.dmg`):
```bash
wget https://slack.com/ssb/download-osx -q -O slack-desktop-latest.dmg
```

To get slack in a different language, just add `intl/LANG/` in any of the above urls e.g.
```
https://slack.com/downloads/instructions/fedora
```
becomes 
```
https://slack.com/intl/ko-kr/downloads/instructions/fedora
``` 
for the Korean version

That's all, thanks!
Catch ExpressJS Async Errors
Tags: express, async, javascript, errors
Published: 2020-11-06 06:15:16

If you tried or happened to throw an error from within an async express route handler then you are probably looking at an error that looks like this:
```
UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with.catch(). (rejection id: 1)

[DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
```

Trying to find the cleanest solution to this has led me to quite a few places that offer the following solutions:
- Wrapping all request handler logic in `try`/`catch` blocks to pass the caught error to the `next()` function
- Wrapping every request handler inside a function that checks if the handler is an async function to further wrap it with a `.catch(next)`.

You can see both of these explained here: https://zellwk.com/blog/async-await-express/. These are both viable solutions. Though, I wanted to seek out a way to do this passively instead of actively.

This is what led me to utilize JavaScript's native `Proxy` built-in:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy)

Used in tandem with the `handler.apply()` method, explained here:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/apply.

Below is a singular simple patch to fix this issue, without having to do anything with each async request handler.

```javascript
const Layer = require('express/lib/router/layer')

Object.defineProperty(Layer.prototype, 'handle', {
  set: function (handle) {
    this._handle = new Proxy(handle, {
      apply: function (target, thisArg, argumentsList) {
        const type = target.constructor.name
        if (type === 'AsyncFunction') {
          const wrappedFunction = (...args) => {
            const next = args[args.length - 1] || Function.prototype
            target.apply(thisArg, args).catch(next)
          }
          wrappedFunction(...argumentsList)
          return
        }
        target.apply(thisArg, argumentsList)
        return
      }
    })
  },
  get: function () {
    return this._handle
  }
})
```
Import or run this piece of code upon server startup and it will patch express.

There is a very similar version of this here https://github.com/davidbanham/express-async-errors/blob/master/index.js as well.

Let me know your thoughts in the comments below!
My Hacktoberfest Experience
Tags: hacktoberfest
Published: 2020-11-06 06:01:32

<!-- ✨This template is only meant to get your ideas going, so please feel free to write your own title, structure, and words! ✨ -->


### [Intro Heading]
<!-- If you are new to the DEV community, introduce yourself and share a bit about why you joined DEV and decided to participate in Hacktoberfest this year.  --> 
Hello 😁, I joined DEV Community to share some of my works and learn from others, and I learned a lot from articles. Cause I can read it anytime & anywhere
### Background

<!-- Are you brand new to open source? What about coding in general? Tell us about how you got here →
While I am typing this article I am 14 years old, and Learning Python after I worked as a web developer freelancer. I knew about Hacktoberfest and Open-source projects from an admin in Python Discord, and he helped me a lot. and working on open-source projects helped me a lot in python.
### Progress

<!-- Share a bit about where you’re at in your Hacktoberfest journey. What stage are you at? How has the process been?  -->
Now I finished my 4 pull requests and got accepted, and I got a Huge experience in this journey.

### Contributions

<!-- This is where you can list the contributions you made and explain why you chose the projects you did. Don’t forget to add links!  -->
I participated in open-source projects such as:
https://github.com/c0sm0void/ProjectMRU
I participated in c0sm0void/ProjectMRU so I can share my experience with other people, and help people if they got a problem or a question in their code.
### Reflections
<!-- Overall, how has your Hacktoberfest 2020 experience been? If you’re a first-timer, will you participate again? What have you learned? Have you made any interesting connections? What is your next step in open source?  -->
I really enjoyed working on open-source projects, and I'll participate again 😁
JavaScript Callback Functions to learn
Tags: javascript, codenewbie, codepen
Published: 2020-11-06 05:45:58

A callback is a function passed as an argument to another function. Callback functions are an important part of JavaScript and once you know how callbacks work, you’ll become much better in JavaScript. Callback functions can be synchronous or asynchronous.

Syntex:

function print(callback) {  
    callback();
}