teleren/devto huggingface dataset:
Getting Into Microservices? Don't Build a Spaghetti Monster.
Tags: microservices, architecture, cloud
Published: 2019-10-22 15:20:08

---
title: Getting Into Microservices? Don't Build a Spaghetti Monster.
published: true
description: Notes on architecting a healthy microservices-based system.
tags: microservices, architecture, cloud, beginners
---

The most common reason why a distributed system is unable to sustain iterative releases and turns into a horror story is **tight coupling** between components.

When building (micro)services, the key decisions are about defining their boundaries and how they communicate.

Changing one service shouldn't require changing another. If one service goes down, other services or, worse, the system as a whole should not go down. Services with well-defined boundaries allow us to to change a behavior in one place, and release that change as quickly as possible.

We don't want to end up with a system where we have to make changes in many different places in order to make a change. This process is slow and prevents clear code ownership. Deploying more than one service at a time is risky.

**A loosely coupled service** contains related behavior in one place and knows as little as possible about the rest of the system with which it collaborates.

**A loosely coupled system** is conservative in the design of communication between services. Services usually communicate by making asynchronous remote procedure calls (RPC), use a small number of endpoints and assume that failure will happen. There is no shared database, and all changes to databases are run iteratively as part of the [CI/CD pipeline](https://dev.to/markoa/ci-cd-pipeline-a-gentle-introduction-2n8k).

**Metrics and monitoring** are also an important part of the feedback loop that enables iterative development. Having metrics that can detect issues in real-time gives us confidence to make changes knowing that we can quickly recover from any error.

This is an excerpt from my book on CI/CD for cloud native applications:

{% link https://dev.to/semaphore/new-ebook-ci-cd-with-docker-and-kubernetes-4op0 %}
The Moment It Clicked
Published: 2019-10-22 15:10:44

---
title: The Moment It Clicked
published: true
description: self-realization
tags: 
---

For a couple years now I’ve been playing with the idea of starting some sort of documentation process. Whether that be YouTube videos, blog posts, or a podcast. I just wanted something I could look back on and trace my path back to how I learned some thing. The moment it clicked. The breadcrumbs back to the beginning. And I have always hesitated until I read a [medium blog post](https://link.medium.com/9gC6z2qOZ0). It described a technique that I discovered on my own a while back for how to focus by listening to the same song on repeat and then, like a zombie from the best video game ever made, it clicked. How many things have I discovered that other people haven’t yet. What secrets am I withholding from humanity through my inaction. Well no more.
Free website screenshot service
Tags: showdev, webdev, node, javascript
Published: 2019-10-22 15:01:28

---
title: Free website screenshot service
published: true
description: Screenshot websites as a service. https://webshot.deam.io/.
tags: #showdev #webdev #node #javascript
---

Hi everyone! I made a free service that screenshots websites for you and it's Open Source! The images are cached for 1 minute and it's only the first load that takes some time to process. It's fast and instant after the initial load (haven't seen better alternatives out there).

Here's the link to repository: https://github.com/deamme/webshot.
Link to service: https://webshot.deam.io/.

Since it's Open Source feel free to open PR's. There are some hacktoberfest labeled issues.

### Use cases
- You could use this as a preview image for your website in `og:image` or `twitter:image` meta tags (tutorial [here](https://dev.to/deam/easy-social-media-preview-card-generation-1ln7))
- Grab a screenshot of a bug in production, send the link instead of an image
- Always have up to date screenshots in your portfolio

### Used in
- https://github.com/deamme/usecrypto (https://usecrypto.xyz/)

### Credits
- https://github.com/styfle/screenshot-v2
Build your first blockchain from scratch (#2 DAG) 
Tags: blockchain, dag, crystal, cocol
Published: 2019-10-22 14:52:19

## How to use a DAG to find the longest chain

**1. Introduction**

In the [first part #1](https://dev.to/cerbivore/build-your-first-blockchain-from-scratch-463p) we talked about how probabilistic finality works and why it's needed. Also we saw an example of how blocks might be structured and linked to each other:

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

The data structure above resembles a Directed Acyclic Graph (DAG) and fortunately DAGs allow for an easy way to find the longest chain. This is an important part of achieving probabilistic finality.


A DAG is made up of nodes (also called vertices) and edges. An edge represents a link between 2 vertices (e.g. `3000.1->3001.1`). We can and should traverse a DAG to find out more about its structure, like how far away is vertex `3005.1` from vertex `3000.1`

Additionally a DAG has some unique properties. Find out more about it [here](https://www.youtube.com/watch?v=TXkDpqjDMHA)

**2. How to find the longest chain**

If we look again at the example above, it becomes apparent that `3005.1` is the tip of the longest chain. But how can we find it out programmatically?

We are going to use [Depth First Search](https://www.youtube.com/watch?v=7fujbpJ0LB4) to traverse the graph and mark every vertex with its distance from the starting vertex.
We start at `3000.1` and give it a distance of `0`. Now we traverse through all vertices and give each a distance of `parent distance + 1`. So `3001.1` has a `parent distance` of `0` and `+1` gives a distance of `1`.

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

**3. Conclusion**

If we store blocks as a DAG, we can use Depth First Search to find the longest chain.

**4. Next Up**

We will finally make our hands dirty and implement a DAG in [Crystal](https://crystal-lang.org)

UPDATE: [#3 Finding the longest chain](https://dev.to/cerbivore/building-your-first-blockchain-from-scratch-3-finding-the-longest-branch-glp) implementation
dbForge Studio for MySQL is a DBTA 2019 Finalist
Tags: mysql, database, productivity, dba
Published: 2019-10-22 14:27:28

---
title: dbForge Studio for MySQL is a DBTA 2019 Finalist
published: true
description: Devart team is proud to tell that dbForge Studio for MySQL became a finalist in one of the main DBTA (Database Trends and Applications) nominations
tags: MySQL, databases, productivity, dba
---
![https://blog.devart.com/wp-content/uploads/2019/10/DBTA_2019_Finalist-1.png](https://blog.devart.com/wp-content/uploads/2019/10/DBTA_2019_Finalist-1.png)

DBTA (Database Trends and Applications) is a magazine delivering news and analysis on data science, big data, information management, and analytics. Every year, they conduct surveys among readers about various database-related software solutions to choose the best offers in a variety of categories such as ‘Best BI Solution’, ‘Best Cloud Database’, ‘Best Data Analytics Solution’, and others.

One of these categories is called ‘Best DBA Solution’. It focuses on tools that would allow DBAs to increase their productivity, automate routine tasks, raise the code’s quality, and resolve performance issues. We are proud to tell that dbForge Studio for MySQL [became a finalist](http://www.dbta.com/Editorial/Trends-and-Applications/21-Best-DBA-Solution-133065.aspx) in this category. As DBTA’s readers proved, our IDE provides robust functionality for MySQL and MariaDB database development, management, and administration. Test it for yourself and evaluate the tool’s capabilities by downloading a [free 30-day trial](https://www.devart.com/dbforge/mysql/studio/download.html). You can also learn more [about dbForge Studio for MySQL](https://www.devart.com/dbforge/mysql/studio/), its features, and how it can help with all sorts of database-related tasks.
JavaScript: The Cutting Edge Language Of 2020
Published: 2019-10-22 14:16:58

JavaScript: The Cutting Edge Language Of 2020.

Note: As of 2019, <a href="https://webmasters.googleblog.com/2017/06/better-snippets-for-your-users.html">Google has announced</a> that you shouldn't focus too much on these as they will consider content first.
Goals for this October
Tags: goals, opensource, react, practice
Published: 2019-10-22 14:05:10

The past couple of months I've been trying to improve myself. Mostly with small things that I should have been doing in the first place. Like, walking more (taking farther train stops from work helps), showers at night, learning french, reading more (mostly fiction nothing for work), and other items.

Some ongoing goals - write more blog posts. You know the ongoing goal of everyone.

Originally, I was going to start "running" and calorie counting, but that involve buying things. So now I have new goals for this month, and since it's dev related I'm writing about it.

__TLDR; One React practice and Two opensource!__

A couple of years ago my previous job was moving towards React from Angularjs (but still had jQuery). Naturally, I started learning it and was getting decent with it. Fast forward to 1.5 years ago and I was hired at my current job. For this first project, they were working in Angular. I was happy to find that Angular was definitely not AngularJS. 

There are a lot of things that I like about the framework: 
- HTML instead of JSX for templates
- Baked in Routing
- Types
- state management seems better

This is also where I really started to break away from my jQuery reliance, and moved back into vanilla js and into es6. 

My point - I've forgotten a lot of the ins and outs of React.

After listening to a few podcasts it most jobs are heavily reliant on React, and after looking at a few older projects of mine I was thinking of getting some practice in. I'll have to do the same with Angular at some point since all of my current projects are vanilla js with Webpack. 

I've created a repo for practice at https://github.com/amandaIaria/react-practice-projects. I'm hoping to create a broader open source repo for this, but for now, it's just a place for anything react that will be used for practice.

On to opensource. 

This particular one was just a random thought that decided to pop ... this morning. Like, an hour ago.

I remembered a post from here about contributing for the first time, and have been looking for something small to start with. 

Article - https://dev.to/kerryja/getting-started-with-open-source-3o23b

I found these: 
- https://up-for-grabs.net/#/
- https://github.com/firstcontributions/first-contributions
- https://opensource.guide/how-to-contribute/
- https://www.firsttimersonly.com/

We'll see how that goes.
How to browse the web in the terminal - W3M (Instructional Video)
Tags: unix, terminal, linux
Published: 2019-10-22 14:02:54

## Turn your Terminal into a web browser
The tool covered in this video is called w3m and it is basically a text based web browser that runs inside of a Terminal. Here is how to use it, so that after you have watched this video, you can immediately get running with it and use it to your advantage!

## video
{% youtube 3Hfda0Tjqsg %}

## What the hell?! This exists?!
Yes, this incredibly mad and awesome tool does indeed exist... I suppose you are asking the question when/why would you use this instead of a normal browser like chrome/firefox, well the short answer is probably in most cases you wouldn't, but let me paint you a picture, if you will...

Imagine you are SSHing onto a headless server (that would be one without any graphical user interface, so its just CLI) and imagine you needed to very quickly code a fix for something or edit a config file or even just read some news whilst in this environment, well, you need a web browser to find the answers, but you have no GUI so traditional ones wont work, you get the gist...

The video above goes into all the basic keyboard shortcuts you need to command w3m to your whim. although it looks wildly different w3m has most of the features that all other browsers has they are just slightly more tricky to access or hidden away, the video will show you how to access these features so that if you wanted to you could even switch over to a full text based browser...

## Onwards

If you have ANY feedback at all please let me know in the comments below or reach out to me on twitter:

[My Twitter (@ben_kadel)](https://twitter.com/ben_kadel)

Thanks for reading and possibly watching!
JavaScript Tutorial: How to use array methods
Tags: javascript, node
Published: 2019-10-22 13:49:23

When I start learning javascript I didn't know what's the difference between each method. I am trying here to explain some array methods in javascript, and I will write an example for each array.  

**.findIndex()** method returns an index in the typed array. For example, you have this code:
```javascript
let array = [600, 400, 300, 1402, 948, 133, 200, 99]
array.findIndex((value) => value > 600) //output 3 
```
When you run it, it will return 3 because 1402 is the next biggest number. But if you use the same array with **.filter()** method it will return something else because the filter method creates a new array with all elements that pass the test implemented by the provided function.
```javascript

let array = [600, 400, 300, 1402, 948, 133, 200, 99]
array.filter((x) => x > 600) //output Array [ 1402, 948 ]
```

Another example for **.fillter()**:
```javascript
let products = [
    { name: "Math book", price: 10.99 },
    { name: "Python book", price: 43.87 },
    { name: "Physics book", price: 33 }
]

let expensiveProducts = products.filter((product) => product.price >= 15)
//output
//{ name: "Python book", price: 43.87 },
//{ name: "Physics book", price: 33 }
```



  As we can see the output is the python book and the physics book because they cost more than 15.

**.map()** method creates a new array with the results of calling a provided function on every element in the calling array. Let's use the same example but with the map method.

```javascript
let products = [
    {name: "Math book", price: 10.99},
    {name: "Python book", price: 43.87},
    { name: "Physics book", price: 33}
]

let prices = products.map((product) => product.price) 
// output Array(3) [ 10.99, 43.87, 33 ]
```

As we can see the output will be a new array with the prices. 

**.some()** method tests whether at least one element in the array passes the test implemented by the provided function. It returns a Boolean value. But **.every()** method tests whether all elements in the array pass the test implemented by the provided function. It returns a Boolean value. And here is an example:
```javascript
let users = [
    { name: "Bill Gates", age: 64},
    { name: "Mark Zuckerberg", age: 35},
    { name: "Elon Musk", age: 48},
    { name: "Sundar Pichai", age: 47},
    { name: "Satya Nadella", age: 52}
]

users.some(user => user.age <= 50) //true
users.every(user => user.age <= 50) //false

```

As you can see some users less than 50 years old so that's true. But no all of them less than 50 years old which is false.

**.reduce()** method executes a reducer function (that you provide) on each element of the array, resulting in a single output value. In the code below we used reduce method to accumulator the price for each book. 
```javascript
let products = [
    { name: "Math book", price: 10.99 },
    { name: "Python book", price: 43.87 },
    { name: "Physics book", price: 33 }
]

let sum = products.reduce((accumulator, element) => accumulator + element.price, 0)
console.log(sum) //output 87.86
```
You're Breathtaking :heart:
Tags: showdev, opensource, javascript, hacktoberfest
Published: 2019-10-22 13:28:07

Over the past few weeks, I have discovered the true meaning of life. 2 words; *Keanu. Reaves.* So I did what anyone would do when they figured out the same thing. *except i beat them to it* Make a website about it.
[Breathtaking] (https://breathtaking.gq) I would show images, but dev.to isn't really working for me.

**ALSO: I COULD USE A LITTLE HELP.** You see, my website uses SVG images, and I would like some help making it where it scrapes one of the internet, such as google images.
How can i implement a background image using Nodejs Angular 8?
Tags: angular8, node, scss, html
Published: 2019-10-22 13:20:55

---
published: true
title: How can i implement a background image using Nodejs Angular 8?
description: I am currently building my portfolio using angular 8, I can not seem to use an background image with HTML5 and CSS3(scss) in the style sheet.

tags: #Angular8, #NodeJs, #scss, #HTML5
---
Data Orchestration For Hybrid Cloud Analytics - Episode 103
Published: 2019-10-22 12:20:19

<p>The scale and complexity of the systems that we build to satisfy business requirements is increasing as the available tools become more sophisticated. In order to bridge the gap between legacy infrastructure and evolving use cases it is necessary to create a unifying set of components. In this episode Dipti Borkar explains how the emerging category of data orchestration tools fills this need, some of the existing projects that fit in this space, and some of the ways that they can work together to simplify projects such as cloud migration and hybrid cloud environments. It is always useful to get a broad view of new trends in the industry and this was a helpful perspective on the need to provide mechanisms to decouple physical storage from computing capacity.</p><p><a href='https://www.dataengineeringpodcast.com/data-orchestration-hybrid-cloud-episode-102/'>Listen Now!</a></p>
Best practices good developers follow in their careers & life
Tags: todayilearned, programming, career
Published: 2019-10-22 13:15:23

*TL;DR style notes from articles I read today. I share these every weekday in my newsletter. [You can sign up here](https://mailchi.mp/appsmith/insnippets?utm_source=devto&utm_medium=post1&utm_campaign=is) to get these straight to your inbox.*



### [Good developers are smart, not clever](http://bit.ly/2Jdgbay)

- Smart developers keep it simple. “Good code is like a joke. If it has to be explained, it is not a good one.”
- They know when to improve code and they have clarity on the reasons behind doing it.
- They start by searching for solutions that are already present in the code, before starting to write new code. 
- They are pragmatic. They don’t get enamored by tricks. 
- They don’t believe in the promises of perfect shortcuts. They understand the tradeoffs. 
- They are never shy to ask questions. 

> “Programming is not like being in the CIA, you don’t get credit for being sneaky.” - Steve McConnell

*[Full post here](http://bit.ly/2Jdgbay), 6 mins read*

---

### [Programmers: make yourself replaceable](http://bit.ly/2N2j8Mj)

IMO, making yourself replaceable is the only way to scale up in a career. 

- In the quest to be irreplaceable, developers end up stagnating in their careers. 
- You damage relationships with colleagues by hoarding information.
- It leaves you pinned and isolated. 
- As there is no replacement for you in your current role, you won’t get considered for other opportunities. 
- To grow, you must constantly strive to make yourself replaceable.
- Use best practices from open-source even in your closed-source software by creating files with examples, explanations, and conventions so that your teammates can contribute easily.
- Share responsibility & access by rotating on-call jobs.
- Share knowledge and learn together with teammates.
- Push for using new and different technologies in new projects. 
- Keep learning how to use new tools, technologies & practices, and actively identify pain points to resolve.

*[Full post here](http://bit.ly/2N2j8Mj), 6 mins read*

---

### [Strategies for long projects](http://bit.ly/2P8Vros)

- Budget your time well and tune up your attitude to succeed at long-term projects. 
- Stay optimistic, even when it seems irrational.
- Expect the unexpected, and take your time to respond to new developments or information.
- Document your progress daily.
- Expect some regression with a new team as group dynamics take time to settle.
- Invest time in the early stages to develop tools that save you time later.
- Reframe your early efforts to build a memory base you can draw on during times of adversity.
- Be a fierce guardian of your own time and prioritize long-term projects.


*[Full post here](http://bit.ly/2P8Vros), 8 mins read*

----
JavaScript animation
Tags: 2dand3danimation, productanimation
Published: 2019-10-22 13:10:54

JavaScript animation is also part of 3D Animation. JavaScript animations are done by programming gradual changes in an element's style. We are a video creation studio. Our video services team delivers excellence in 2D and 3D Animation, Product Animation, Animated E-learning and educational videos, Whiteboard Animation and Visual effects for manufactures and service-based industries. For More Details visit on http://atellier.in/
How do you bypass browser cache on a new web app update?
Tags: discuss
Published: 2019-10-22 12:38:29

When releasing a new web app update, browser caching can be a problem. 

For example, if you update the `script.js` and if the user's browser still loads that script from the cache, the app can crash.

When I searched this on Google, I found several ways to prevent this like:

* Using cache headers
* Using GET params with the script's URL
* And more...

I would like to know what is the best way according to your thoughts.

Thanks.
Illustrating The Landscape And Applications Of Deep Learning
Published: 2019-10-22 12:19:07

<p>Deep learning is a phrase that is used more often as it continues to transform the standard approach to artificial intelligence and machine learning projects. Despite its ubiquity, it is often difficult to get a firm understanding of how it works and how it can be applied to a particular problem. In this episode Jon Krohn, author of Deep Learning Illustrated, shares the general concepts and useful applications of this technique, as well as sharing some of his practical experience in using it for his work. This is definitely a helpful episode for getting a better comprehension of the field of deep learning and when to reach for it in your own projects.</p><p><a href='https://www.pythonpodcast.com/deep-learning-illustrated-episode-234/'>Listen Now!</a></p>
Anyone else intolerant of html inside javascript? yes i mean React
Tags: react, vue
Published: 2019-10-22 12:02:04

A lot of people use react for web development and mobile. It is a really cool framework. 
I don't want to be the one, but i can't stand writing or seeing html inside `js`. Even further that i don't like `html`, `xml`, or any `*ml` with opening and closing tags. 

That's why my preference is;
`Vue` with `pug` template language.

In `Vue` you can separate `html`, `js` and `css` clearly.

I haven't write anything large scale in react, but as far as i know,
you can separate template and `js` to some level but at the end there is always a mix of `js` and `html` somewhere in the same block, which makes me uncomfortable :)

How do you get used that?, or is it only my obsession :)