teleren/devto huggingface dataset:
How to Make Dynamic Routes Using React Router - Infinite Routes
Tags: react, reactrouter
Published: 2019-11-27 12:32:16

---
title: How to Make Dynamic Routes Using React Router - Infinite Routes
published: true
description: We'll learn how to create dynamic routes, that will he useful if you are making an online store.
tags: react, react-router
---

{% youtube 3P6bmhire-Y %}
Gatsby CheatSheet
Tags: gatsby, react
Published: 2019-11-27 12:15:44

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/clzlw17bx6fmt56zlj2t.png)

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/r73v71cretauomsj0hrc.png)
Discrete mathematics
Tags: beginners
Published: 2019-11-27 06:25:41

Discrete mathematics is part of mathematics devoted to study of discrete objects (distinct or unconnected object)

## Why

- Ability to understand and create mathematical arguments
- Provides foundation for many computer science courses including data structures, algorithms, compiler design, etc;

### What kind of problems can be solved by discrete mathematics

- How many ways to choose valid password on a computer system?
- How many steps is required to do such sorting ?
- How can it proved that sorting algorithm correctly sorts a list?
- How many valid internet addresses are there ?

## Logic and proof

### Logic

The rules of logic specify the meaning of mathematical statements and helps us understand and reason with statements such as
`There exists number which is not sum of two squares`,
`For every positive integer n, sum of positive integers not exceeding n is n*(n+1)/2`.
Logic is basis for all mathematical reasoning and computed reasoning.

### Proof

To understand mathematics, we must understand what makes up a correct mathematical argument, that is proof.
One we prove mathematical argument is true, we call a theorem, a collection of theorem on a topic organize what we know about a topic.
Proofs are used to verify that computer program produce correct output for  all possible input values to show that algorithm always produce correct result
to establish security of the system.
Puppetry 3 : test automation without coding
Tags: testing, webdev, javascript, showdev
Published: 2019-11-27 11:52:35

Nowadays nobody would argue the importance of automated testing. Yet end-to-end tests are often hard to write and even harder to maintain. There are many solutions to help with it. Puppetry is a test constructor, which allows you building test suites without any coding. QA-engineer can record user scenario in a built-in browser, extend the generated test case with browser commands and assertions, manage the suite structure (like drag’n’drop) and run tests. Puppetry translates Gherkins-styled test specification into a Jest/Puppeteer project, executes it and shows the report. This project can be simply plugged in CI/CD pipeline. 

![Test case](http://dsheiko.com/download/puppetry/devto-271119/main.png)

![Test report](http://dsheiko.com/download/puppetry/devto-271119/article-report-ok.png)

You may think of it as an advanced UI over Puppeteer with more than 60 visualized methods and assertions.  These are designed to make the test development as easy as possible. For example, with Puppetry you say “I assert that target FOO is currently located above BAR”. It results in the code computing styles of both targets and comparing them.

![Asserting element position](http://dsheiko.com/download/puppetry/devto-271119/article-relative-position.png)

It may sound as play-toy, but in reality we can implement with Puppetry quite sophisticated test strategies. For example we can address [dynamic content](https://docs.puppetry.app/testing-techniques/testing-dynamic-content), run [performance budgeting](https://docs.puppetry.app/testing-techniques/performance-testing), test [CSS regression](https://docs.puppetry.app/testing-techniques/css-regression-testing), [Chrome extensions](https://docs.puppetry.app/testing-techniques/testing-chrome-extensions), [web-components](https://docs.puppetry.app/testing-techniques/testing-shadow-dom), [transactional emails](https://docs.puppetry.app/testing-techniques/testing-emails) and [Google Analytics tracking](https://docs.puppetry.app/testing-techniques/testing-google-analytics-tracking-code).

![CSS Regression test report](http://dsheiko.com/download/puppetry/devto-271119/article-css-regression.png)

![Asserting Google Analytics tracking](http://dsheiko.com/download/puppetry/devto-271119/article-ga.png)

Real-world test cases can be hard to debug. Modern web applications are highly dynamic, meaning the pages are changing in response to user actions. So we have to remember when addressing an element that it can be not yet rendered or already destroyed in that particular point in time. Luckily Puppetry let use set breakpoints as well as run test in interactive mode. In both cases the test run pause when reaching the problem point, so you can observe the actual page state and call DevTools to check the DOM tree. 

Yeah, Puppetry is where the test automation makes fun. Not persuaded? Just check the video out.

{% youtube dfuNhTCRMRg %}

- Download links https://github.com/dsheiko/puppetry/releases
- Official site https://puppetry.app/
Types of Apache Spark tables and views
Tags: spark, databricks
Published: 2019-11-27 11:37:15

#####Global Managed Table
A managed table is a Spark SQL table for which Spark manages both the data and the metadata. A global managed table is available across all clusters. When you drop the table both data and metadata gets dropped.

```python
dataframe.write.saveAsTable("my_table")
```

#####Global Unmanaged/External Table
Spark manages the metadata, while you control the data location. As soon as you add ‘path’ option in dataframe writer it will be treated as global external/unmanaged table. When you drop table only metadata gets dropped. A global unmanaged/external table is available across all clusters.
```python
dataframe.write.option('path', "<your-storage-path>").saveAsTable("my_table")
```
#####Local Table (a.k.a) Temporary Table (a.k.a) Temporary View
Spark session scoped. A local table is not accessible from other clusters (or if using databricks notebook not in other notebooks as well) and is not registered in the metastore.
```python
dataframe.createOrReplaceTempView()
```
#####Global Temporary View
Spark application scoped, global temporary views are tied to a system preserved temporary database global_temp. This view can be shared across different spark sessions (or if using databricks notebooks, then shared across notebooks).

```python
dataframe.createOrReplaceGlobalTempView("my_global_view")
```
can be accessed as,
```python
spark.read.table("global_temp.my_global_view")
```
#####Global Permanent View
Persist a dataframe as permanent view. The view definition is recorded in the underlying metastore. You can only create permanent view on global managed table or global unmanaged table. Not allowed to create a permanent view on top of any temporary views or dataframe. Note: Permanent views are only available in SQL API — not available in dataframe API
```python
spark.sql("CREATE VIEW permanent_view AS SELECT * FROM table")
```
There isn’t a function like *dataframe.createOrReplacePermanentView()*

##### Reference:

http://spark.apache.org/docs/latest/api/python/pyspark.sql.html#pyspark.sql.DataFrameWriter.saveAsTable
https://docs.azuredatabricks.net/spark/latest/spark-sql/language-manual/create-table.html
http://spark.apache.org/docs/latest/api/python/pyspark.sql.html#pyspark.sql.DataFrame.createOrReplaceTempView
http://spark.apache.org/docs/latest/api/python/pyspark.sql.html#pyspark.sql.DataFrame.createOrReplaceGlobalTempView
https://stackoverflow.com/questions/48552620/is-it-possible-to-create-persistent-view-in-spark

Migrated from medium [originally posted here](https://medium.com/@subashsivaji/types-of-apache-spark-tables-and-views-f468e2e53af2)
After 40, You should be a programmer
Published: 2019-11-27 11:34:58

Developers are equipped with multiple skills ranging from designing a new product to write complex code. And the age is just a number if you truly love your profession. There are many developers who think that what they do when they turn above 40.

According to Mr. Josan senior developer, here at Codersera says- “developing software is my passion which makes me younger and self-motivated after 45.”

Mr. Josan is one of our senior developer who says that “age is just a number”, if you have the potential to learn new technologies and continuously upgrade yourself with new trends. He is 45 years old and works with young people and manage his team perfectly. He works so energetically as well as handles the projects professionally without any ” “. With the experience of over 15 years as a software developer, he learned every new technology which came in the market and always updated his team with it.

“Once a programmer always a programmer.”


There is no age limit to be a programmer, it just depends on your skills and abilities to coding and innovates something new. As we know experience is also important. In every company, most of the employees are experienced and the companies also prefer experienced people in their team.

Why companies hire experienced developers?

More experience.
Easily handle the situations.
More familiar with coding languages.
Capable of managing a complex project.
Self-motivation is more important to continue your journey as a developer. There are many people who think that developers career is ended after 40, which is a hoax but they have more experienced and skilled to work. Even after 40, some people start their career as a developer and work as remote developers and freelancers, which give them the opportunity to follow their passion. For more details, you can also read this article I get this information from this

website:-https://codersera.com/blog/should-i-still-be-a-programmer-after-40/
Pyrotechnics Of Machine Learning
Published: 2019-11-27 11:19:26

What is Machine Learning</a>? Machine learning has made it possible for the computers and machines to come up with decisions that are data-driven other than just being programmed explicitly for following through with a specific task. These types of algorithms, as well as programs, are created in such a way that the machines and computers learn by themselves and thus, are able to improve by themselves when they are introduced to data that is new and unique to them altogether.

The algorithm of machine learning is equipped with the use of training data, this is used for the creation of a model. Whenever data unique to the machine is input into the Machine learning algorithm then we are able to acquire predictions based upon the model. Thus, machines are trained to be able to foretell on their own.

These predictions are then taken into account and examined for their accuracy. If the accuracy is given a positive response then the algorithm of Machine Learning is trained over and over again with the help of an augmented set for data training.

People from all parts of India are now coming in order to study stuff about machine Learning Algorithms. A lot of online agencies and institutes are coming up and these guys are giving quite a sort of knowledge to the students Students, too are a sort of aspirants and they are now learning quite a few kinds of stuff about machine learning through these kinds of institutes.

So, study machine learning and be at the top.

Check out the URL for more of these: https://intellipaat.com/blog/tutorial/machine-learning-tutorial/
https://intellipaat.com/blog/tutorial/machine-learning-tutorial/machine-learning-algorithms/
https://intellipaat.com/machine-learning-certification-training-course/
Diving into Web Development after Android
Tags: android, webdev
Published: 2019-11-27 11:19:10

I'm pretty psyched (read proud) that I completed a year working professionally as an Android developer. Of course there is more to go but one year is a lot if that is all you do every other day. Right? RIGHT??!!

*cough*cough*

However, & bear me when I say this, after a year of coding in Java/Android, I genuinely believed I could now explore a bit more into other programming languages seriously. What a delusional noob - you might think - but I'm not leaving Android altogether so I'll be fine - I think.

I remember, when I had just begun working in Android, I had one or two week(s) of experience with NodeJS during which I had built a simple RESTful API for integrating into the mobile app. NodeJS seemed so *smooth* in every way compared to Android, but truth be told, I didn't understand shit (Mostly because I had no base knowledge of JS, nor HTML or CSS). Sad, I know.

*Android Programming Jargon incoming!**
While I was struggling to understand what Fragments were or how to use Callbacks or Interfaces, those I worked alongside had not only a great deal of knowledge with what they were hired to do, but they also had a sound knowledge of other *insert some cool programming language here*. Needless to say, I was late in the game!

So, giving my full time for Android for a year, I felt like I had enough knowledge to at least not break something. And that is when I genuinely felt *ready* to try something different.

Welcome to the wonderful world of Web Development!

Starting a few weeks back, and after being fairly successful in downloading paid (read stolen) Udemy content, I have started learning web development.

And I feel genuinely motivated.

I finished HTML, CSS and JS basics, still struggle in external, internal vs inline scripts, or even can't use float property properly, but believe me when I say this, web development is beautiful.

Or maybe I've not dived deep enough to have to deal with the *shits* of web development.

But all in all, I am doing this!


And Oh:
Here's the link to the repo that you will never open:
https://github.com/BijayKumarPun/web-dev
Explain full stack developer to me like I'm five
Tags: explainlikeimfive, career
Published: 2019-11-27 10:56:18

There seems to be a large and various definition of what a "full stack developer" is and what he is actually doing. People will likely understand different things, depending on which continent you live or try to apply to a job.

Therefore, does "full stack" has anything to do with seniority or experience or field of work? Does someone that _hack_ some stuff both in the FE and in the BE call himself "full stack developer"?

**Explain to me what full stack developer means to you like I'm five**. Maybe I'm a full stack developer already and I just don't know it yet :)
Laravel .env backup generator
Tags: laravel, env, backup
Published: 2019-11-27 10:45:23

---
title: Laravel .env backup generator
published: true
description: Time to give something back to the community!
tags: laravel,env,backup
---

I've been using Laravel for a couple of years now and I thought it's time to give something back to the community! So I tried to tackle an issue I have stumbled upon lately, that is, creating backups of the .env file. My main problem was due to the fact that multiple people have access to the file and may change it anytime in our company, having backups is always a good thing in case of any failures or even edits that you forgot and want to go back and check. 
So I developed a package to satisfy that need and here it is!

[hpez/DotEnvBackup](https://github.com/hpez/DotEnvBackup)
![hpez/DotEnvBackup](https://thepracticaldev.s3.amazonaws.com/i/1fmetlr487ave8y9b8ym.png)
Multi arch images with docker
Tags: docker, multiarch, ci, raspberrypi
Published: 2019-11-27 10:40:06

---
title: Multi arch images with docker
published: true
description: 
tags:
  - docker
  - multiarch
  - ci
  - raspberrypi
cover_image: https://images.unsplash.com/photo-1555589228-135c25ae8cf5?auto=format&fit=crop&w=1000&h=420&q=80
---

Most of the time, when I start a project, I like to try to install it everywhere to test it. Since I have a cluster of Raspberry PIs, I love to install my projects on it and see how they evolve, where they could break and fix the issues.

To do so, I try to get as close a possible to my production configuration. So I usually put in place a CI/CD that test, build and deploy my projects. But when it comes to build my Docker Images for ARMv7 on a regular CI, it tends to become a bit complicated. You need to have Qemu available on the CI to emulate the target platform.

```bash
# depending on the CI
docker run --rm --privileged hypriot/qemu-register
# or
docker run --rm --privileged multiarch/qemu-user-static:register --reset
```

When this is done, I also want to try the image on my laptop. So, on the CI, we have to build for different architectures with the same Dockerfile.

One way to do it would be to have and argument in our Dockerfile to specify the platform.

```dockerfile
ARG BASE_ARCH=amd64
FROM ${BASE_ARCH}/alpine
```

Once this is done, I "just" have to build several times on my favorite CI, create a [manifest](https://docs.docker.com/engine/reference/commandline/manifest/) and annotate each image in a final stage.

```bash
docker build --build-arg BASE_ARCH=amd64 -t my_image:amd64-latest .
docker build --build-arg BASE_ARCH=arm32v7 -t my_image:arm32v7-latest .
docker manifest create my_image:latest my_image:amd64-latest my_image:arm32v7-latest
docker manifest annotate --arch amd64 my_image:latest my_image:amd64-latest
docker manifest annotate --arch armv7 my_image:latest my_image:arm32v7-latest
```

Ok, you can say it, it's pretty verbose.

Luckily, the Docker Team (relatively) recently released [buildx](https://github.com/docker/buildx) in Tech Preview. What this does is that it will build all the images, do the manifest and annotate everything in only 1 command.

First we have to remove the argument from our dockerfile because it became useless. If we create an image from a multiarch image, buildx will manage the rest.

```bash
docker buildx build --platform linux/arm/v7,linux/amd64 -t my_image:latest .
```

At this point, I can use the image on any of the 2 platforms without having to use different images.

Ok, now this is nice but buildx is only available in experimental and requires Docker Engine 18.09+. And depending on the CI that is going to be used, the installation will more or less differ. So I prepared [a repository](https://github.com/jdrouet/docker-on-ci/) containing an example of multi arch build with [Github Actions](https://github.com/features/actions), [Circle CI](https://circleci.com/), [Travis CI](https://travis-ci.org/) and [Gitlab CI](https://about.gitlab.com/product/continuous-integration/).
Create a Free Blog on Blogger I Blogspot Platform
Published: 2019-11-27 10:27:08

The Blogger is the platform to create free blogs Google, is one of the most used in the world and you can have a professional blog working with the service. Of course there are other options that are interesting if you want to create a professional blog, but Blogger is the best free tool, as well as making money and being easier to move and get used to.It is possible to create blogs of various styles and models, to the liking of the customer (lol), from fashion blogs to technology blogs, are many options. If you went to create a free blog then I think blogspot are the best platform for beginner. And if you create a paid version or a professional blog or website I would say you can create a wordpress.com.

Read full post

https://bazzhood.blogspot.com/2019/11/how-to-create-blog-Steps-by-Steps.html
How I Fixed IntelliJ Build Problems After MacOS Update
Tags: java, todayilearned, macos
Published: 2019-11-27 10:25:48

# Backstory

Feel free to skip this section if you don't care for a short story. There's a tl;dr; at the bottom.

I came back to work after my vacation, fired up IntelliJ, punched in a few lines of code, compiled my Spring project, and... nothing changed. No errors, everything compiled and ran perfectly.

At first I thought that this was cache related, even though I was doing http requests through Postman. So I entered a few logging lines on startup and tried again just to find that they too were not shown.

I then tried to do a `Build > Rebuild Project` and got an error saying something along the lines of `Could not get UNIX mode on /ProjectDir/build/File.class. File does not exist`. It was then that I realized that there was something wrong with build folder access.

# How I Solved It
Since build folder is generated automatically I simply deleted it for the offending submodule. When I tried to rebuild the project, another submodule that previously compiled now showed different errors.

I remembered that during my vacation I upgraded MacOS to the newest version and the update probably messed with the user or permissions or something along those lines.

So I just deleted `build` and `out` folders for all the submodules, rebuilt the project successfully and voila - all was good and I started seeing the changes I've made.

Moral of the story - delete generated folders after OS upgrade, just in case.

# TL;DR;

After upgrading to the latest MacOS, new changes to my Java code didn't  make it into compiled version. I fixed it by deleting generated `build` and `out` folders for every submodule.
Back To Top Buttons For Blogger 
Published: 2019-11-27 10:22:57

Back to Top/ Go to top (^) – Friends in many website you may have seen up arrow on bottom by pressing this up-arrow you reach to top of the web page. You also can see this button on this page right side of bottom by pressing this you will go to top. It’s very use full for website visitors this feature save time of website visitors they reach to top by pressing this option.Having  the Top and back buttion on a website is a very important factor  
Read full post
https://bazzhood.blogspot.com/2019/11/how-to-add-back-to-top-button.html
How to create a website 
Published: 2019-11-27 10:10:08

 Creating a website is one the fastest growing ways to get noticed, share content and even make money online. This probably isn't surprising, considering that they're are over 100,000,000 distinct websites out there! No matter who you are, having a website can benefit you. Below are a few main reasons on why creating a website is beneficial whether you're planning on creating a website for a business or just having a personal blog.


Why a buiness should have a website:



        Can generate more sales
        Builds a stronger brand
        Adds a professional touch
        Gives information and or support to your clients



Why a indiviual should have a website:


        Share pictures or information about yourself
        Brand your name
        Make some extra moola
        Website managment and or creation experience





Getting Started


Read more
https://bazzhood.blogspot.com/2019/11/How-To-Start-A-Blog.html
Agencies or In-house, which do you prefer?
Tags: watercoolerdiscuss
Published: 2019-11-27 09:37:16

---
title: Agencies or In-house, which do you prefer?
published: true
description: 
tags: water-cooler discuss
---


I spent my first few years of as a developer working for agencies, but recently moved to an in-house company.

Since each project usually has a short deadline, agencies give you the option of changing up the tech stack, which is great for learning. The main differences I've noticed so far...

* Testing is a larger concern for in-house. Outside of VC pressure, there's not as tight of deadlines in-house compared to agency projects. However, because we're not handing-off the project(s) to clients, maintenance is also a larger responsibility. 

* More discussions happen before a solution is decided on when working in-house.

* Implementing hot-fixes and coming back to them later is possible in-house. This option isn't really there when you're going to be handing your code off for someone else to maintain. 

Which do you prefer? What are some differences you've noticed between the two?