teleren/devto huggingface dataset:
Debugging incidents in Google's Distributed Systems
Tags: sre, distributedsystems, googlecloud
Published: 2020-12-19 09:42:45

I was reading [this paper](https://research.google/pubs/pub49291/) published by Google on the research they did in 2019 into how Google debugs production issues.

Some interesting points:
* SREs(Site Reliability Engineers) and SWEs(Software Engineers) have different approaches to debugging incidents. SWEs are more likely to look at logs, whereas SREs follow a more generic approach to incident response looking at common failure patterns across service health metrics.
* Depending on the experience level (@Google), people used different tools. Newer engineers tended to use newer fancier tools while the engineers who had been around for a long time stuck to the legacy tools they trusted.
* Underlying causes for incidents (excluding security and data correctness issues), resonates with what I have seen at Booking.
    1. Code changes
    2. Configuration Changes
    3. Dependency Issues
    4. Infrastructure Issues
    5. External Traffic issues.
* The building blocks of a typical debugging journey are
    1. Detect
    2. Triage
    3. Investigate
    4. Mitigate
* They mention that mitigations often makes things worse. In many of the incidents that I was part of @ Booking, were cases where local mitigations caused a much bigger outage inadvertently. Again resonates extremely well with my experience at Booking.
They also mention that most investigations are breadth first searches both into what systems/underlying systems could cause the issue and what is exactly wrong.
They go on to describe some incident stories with most the best case scenario and another scenario where the tooling failed the user. Key lesson: **Do not rollout when there is an ongoing incident** 
* Key principles to mitigate service problems faster
    1. Establish [SLOs](https://sre.google/sre-book/service-level-objectives/) and accurate monitoring
    2. Triage effectively to find the blast radius and who you need to communicate with.
    3. Mitigate early.
    4. Apply established strategies for common issues (Errors, Performance,Capacity)
    5. Know your dependencies, 
    6. Debugging microservices requires adequate service architecture documentation and the ability to traverse the stack quickly.

By the way, you should follow me on [twitter](https://twitter.com/sidsarda)
Multiplication Tables – The hidden face
Tags: algorithms, mathematics, go
Published: 2020-12-19 09:34:04

Everybody knows the multiplication tables that we have learnt at school but less people knows a fascinating aspect of them. At first glance, the multiplication tables is an elementary subject, not exactly exciting, and yet we are going to discover the hidden face of the multiplication tables that will surely surprise you.

[Read more...](https://algomaths.tech/multiplication-tables-the-hidden-face/)

{% youtube X79Ar86ihbY %}

{% github lunatikub/AlgoMathAndCo no-readme %}
Why should we use React Hooks?
Tags: react, hooks, functional
Published: 2020-12-19 09:30:59

**What are the hooks?**
Hooks are a new feature in React >= 16.8 which allows you to use React features without having to write class components.

**Uses of Hooks:**
1.) Allows you to use React Feature without writing a class.
2.) Avoid the confusion by 'this' keyword
3.) Allows you to reuse stateful logic
4.) Allows you to organize the logic inside the component into reusable isolated units.

**Rules to use Hooks:**

**Rule1**: "Always call hooks on the top level."
       Do not call hooks in the loops, conditions, and at the 
       nested functions

**Rule2**: "Always call hooks from the React functions."
       Do not call hooks from any regular JavaScript components 
       but rather always call it from React Functional components. 

**Happy Coding!**
*- Jayant Khandelwal*

<a href="https://www.buymeacoffee.com/jackent2b" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
D1️⃣Idea fixing🌌 and brainstorming🤔 for DigitalOcean hackathon
Tags: dohackathon, help, react, webdev
Published: 2020-12-19 09:18:56

Hackathon Journey
hello all 😊👋
In this First Post, I am going to tell you guys about how I got the idea and how I am going to work on a hackathon project.
**Before Article begins i need a help with one thing**
i need a help with this if got this help then my entry is going into valid submission category 
{%twitter 1340188758570795008 %}
or else if someone added credit card to DigitalOcean how many applications i can host/deploy with help of 50$ credit.
  
*Let's Begin*
**Brief story What I am building⚙🛠?**
A few days ago dev.to team announced dohackathon **DigitalOcean hackathon** as this hackathon is about to deploy your creative project on the DigitalOcean platform
As I love space from my childhood days this time I am building an app related to that app name is **Space Travel** in this app I am going to build a react app in that app things will be work according to the following activity diagrams

**First Page of the webapp**
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/o2bp484ve9p75s7dyxqb.png)

**Second Page of the webapp**
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1sj6lc412hu1bjn4wg8j.png)
as of today, I am having these features in my app but sure in the upcoming days I will add more features to this app if you have any features then please comment I am happy to hear from you.

### Category Submission: 
* Random Roulette

### Additional Resources/Info 
* NASA API for images/content.
* reactjs for building an app.
* I am still figuring out which UI library I am going to use most probably do it with the reactjs/CSS stuff or else any library.
* for creating activity diagrams I used the Figma tool.


This is it for this article for day 1 of the hackathon 
Have a good day all and thank you for reading and all the best for the hackathon.😊❤✨🎉
![](https://media.giphy.com/media/tsUPevkxoKSQshA2Bd/giphy.gif)
Intermediate Algorithm Scripting: filter(), every(), and Object.keys() [freeCodeCamp Javascript]
Published: 2020-12-19 09:11:58

Working through the Intermediate Algorithm Scripting section of freeCodeCamp's Javascript Algorithms and Data Structures Certification, I have come across a challenging problem involving filter(), every(), and Object.keys(). 

Most of the solutions on the hints page are long and clustered with for loop iterations, that I try to avoid. Even as a beginner, I am trying to utilize ES6 arrow functions and higher order functions, when possible.

So here is the challenge: 

> Make a function that looks through an array of objects (first argument) and returns an array of all objects that have matching name and value pairs (second argument).

Here is the array of names to filter with a function:

```
var namesToFilter = 
([
{ first: "Romeo", last: "Montague" }, 
{ first: "Mercutio", last: null }, 
{ first: "Tybalt", last: "Capulet" }
])

var filter =  
({ last: "Capulet" }
)
```

First, a class function, `whatIsInAName` will be created containing the arguments `collection` and `source`. The function will check and return any array of names `['first', 'last']` in `collection` that matches the array of names `['first', 'last']` in `source`.

```
const whatIsInAName = (collection, source) =>
  collection
    .filter(item => 
      Object.keys(source)
        .every(key =>
          source[key] === item[key]
      )
  )
```

We will use `.filter()` to get all `item` elements of `collection` that satisfy a certain method's conditions.
```
  collection
    .filter(item =>
```
`Objects.keys(source)` returns the key properties of the source array. In this case, `['last']`.

The `.every()` method requires all key elements of `source` keys to satisfy the condition that, the `key` property of `source` must be the same as the `key` property of `collection`'s `item` element.  
```
      Object.keys(source)
        .every(key =>
          source[key] === item[key]
      )
  )
```
Solution: 
```
whatIsInAName(namesToFilter, filter)
// [ { first: 'Tybalt', last: 'Capulet' } ]
```
HTML Accordion
Tags: html
Published: 2020-12-19 09:05:39

When you think about creating an accordion the obvious solution is to use JavaScript - you listen for clicks and toggle the section open/closed. Simple. But what if you don't want to use JavaScript?

The other obvious alternative is to make each section a radio button, hide the button image, then open/close the section based on whether the button is checked or not. Also simple, but there's an even simpler way...

You just code the HTML using specific tags and it does the rest for you:
```
<details>
  <summary>This is always visible</summary>
  Anything inside the details tag but outside the summary tag will only be shown when the accordion is open
</details>
```
And that's it, it's done. It does allow you to open every element of the accordion at once, which may or may not be what you want. If it's not you can add JavaScript to detect if another section is open, using details.open. Although I started this by saying this is a way of getting an accordion without using JavaScript...

This works in all browsers except IE, but is anyone even supporting IE any more?
Day 19 of JavaScriptmas - Alphabet Subsequence Solution
Tags: scrimba, javascript, 24daysofjavascriptmas
Published: 2020-12-19 08:54:24

Day 19 challenge is checking a letter duplication in a string. 
To solve this a string also must be `sorted`. If there are some characters duplication in a single string return `false` otherwise return `true`

For example, 
A string `effg` will return `false` because there are 2 letter `f`. 
But the string `ace`  will return `true` since there is no letter duplication. 

There is the JavaScript Solution
```javascript
function alphabetSubsequence(str) {
    // If letters NOT in ascending order and detect duplication return false  
    let result = str.split('').map( (val, index) => (str.charCodeAt(index) >= str.charCodeAt(index+1)) ? false : true);

    // if result for ALL value are TRUE, return true, otherwise return false
    return result.every( val => val == true);    
}
```
Docker+Deno: Containerize  Deno
Tags: deno, devops, node, docker
Published: 2020-12-19 08:35:23

# What is Deno ?



[Deno](https://deno.land/) is a simple, modern and secure runtime for JavaScript and TypeScript that uses V8 and is built in Rust.


**Fun fact:** Deno is an anagram of Node. If you sort() node it becomes deno.




```
"node".split("").sort().join(""); // Output: deno

``` 

Building Deno Image

 `deno.dockerfile` 

![denodocker.png](https://dev-to-uploads.s3.amazonaws.com/i/g7dgycvyyn0llxsh4zeq.png)

```
docker build . -f .\deno.dockerfile -t YOUR_DOCKER_USERNAME/deno:1.6.1-buster-slim
``` 

We also can push to [docker hub](https://hub.docker.com/) 


```
docker push YOUR_DOCKER_USERNAME/deno:1.6.1-buster-slim
``` 

 `src/server.js` 
![server.png](https://dev-to-uploads.s3.amazonaws.com/i/7zkm8ui18qdiw0te890z.png)

 `dockerfile` 

![denoImage.png](https://dev-to-uploads.s3.amazonaws.com/i/zwc3eg851hw3byw736rq.png)


Building Hello World Deno Image

```
docker build . -f .\dockerfile -t YOUR_DOCKER_USERNAME/deno-app:v1
``` 

Running Hello World Deno Image


```
docker run -it --rm -p 5000:5000 YOUR_DOCKER_USERNAME/deno-app:v1
``` 




We also can push to [docker hub](https://hub.docker.com/) 

```
docker push YOUR_DOCKER_USERNAME/deno-app:v1
``` 



You can find all the code at my [GitHub Repository](https://github.com/Jayvirrathi/deno-docker-kubernetes). Drop a star if you find it useful.
If we override the toString() method with the code below, what would be the result of printing?
Tags: java, programming
Published: 2020-12-19 08:45:41

In java, language inheritance is done from object class directly or indirectly. The object class have some basic methods like clone(), toString(), equals(), etc. The default toString method in Object prints “class name@ hash code”. The user can override the toString() method in our class for printing the proper output of the given function.

---
title: If we overrde the tostring() method with the cde belowm what would be the result of printing?
tags: java
canonical_url: https://kodlogs.com/blog/1917/override-tostring-method-below-what-would-result-printing
---
##Example:
For example, the following code toString is overridden to print the “Real + Imag” form.

###Code:
```
// file name: Main.java

class Complex {

               private double re, im;



               public Complex(double re, double im) {

                               this.re = re;

                               this.im = im;

               }

              

               /* Returns the string representation of this Complex number.

               The format of the string is "Re + iIm" where Re is the real part

               and Im is imagenary part.*/

               @Override

               public String toString() {

                               return String.format(re + " + i" + im);

               }

}

// Driver class to test the Complex class

public class Main {

               public static void main(String[] args) {

                               Complex c1 = new Complex(10, 15);

                               System.out.println(c1);

               }

}
```
###Output:
10.0 + i15.0
**Note:
Generally, it is a good idea to override toString() as we get proper output when an object is used in println() or in print().**
Advent of Code 2020: Python Solution Day 19
Tags: adventofcode, challenge, python, algorithms
Published: 2020-12-19 08:38:48

Again Elves are back. This time a problem was not that hard to solve but still was time consuming as previous versions. I again took help from reddit thread, specially from [here](https://topaz.github.io/paste/#XQAAAQBpBAAAAAAAAAAyGUj/T0PKbV3AC51ev501bnzIAlFI+dRTQUhI7tylqh5TPSRskdiZ8dajgCcu/Gz/0e3sN7WWGGpMawwIvs9HC5mszg80pFgfbV7Q8y/dWHBqsIUy+Jey3JbFbeVJZQepPS0X5CwFZtd49gds1Jfo4NQY8PPxjCOHxW0qe+bDM943KjD6GdHE5ymzyBzHXUZGCVH8CfiSPikqwtBGBXz9dLUlYVtEGPxzRlEUvDx5sEXJg3Vv76Z2ZOKeidKOljHRlbKIgT9bbkQPCtgLaftSSfItQ7AArS5RP1pAq5wWY6CJ9MsMtX5FZnH61fMsPfL3jmbtb57v0Jtk8V2i814u7Qb8hepJEdHqNOMQ4krgShoQTf8Zxpc+km5Mr3UigsiqRJEmxYC6dWdNJ3UhbhIMBiHdGPsDxwscEENvzdMWDKF9Imckmd54zB9JUiAjyjwXN63wT+YvH3jrstzsUZPqbkUpUEmpcVubX56+nuPXfi2gK4T5HTsA64Mt4Xer7EgDlBJtwPdmKvWwNG745CDUIIRiGpFhDZJvnMowtEEhTFK3uupZhkud6bqKOXO4F6D1nP86xsrSB2dH1Gny63FTR/XceiCUNJJ9pONMIJtVLNyWDRgJUcbz0rBNIHA56ILYGFdTe+K9/zakpwA=).

```python
def rule_maker(raw_rules):
    rules = {}
    for rule in raw_rules:
        key, value = rule.split(': ')
        if value[0] == '"':
            rules[int(key)] = value[1:-1]
        else:
            values = value.split(' | ')
            temp_v = []
            for v in values:
                temp_v.append([int(vv) for vv in v.split(' ')])
            rules[int(key)] = temp_v
    return rules

def match_rule(expr, stack):
    if len(stack) > len(expr):
        return False
    elif len(stack) == 0 or len(expr) == 0:
        return len(stack) == 0 and len(expr) == 0
    
    c = stack.pop()
    if isinstance(c, str):
        if expr[0] == c:
            return match_rule(expr[1:], stack.copy())
    else:
        for rule in rules[c]:
            if match_rule(expr, stack + list(reversed(rule))):
                return True
    return False

def count_messages(rules, messages):
    total = 0
    for message in messages:
        if match_rule(message, list(reversed(rules[0][0]))):
            total += 1
    return total

with open("day19.txt") as fp:
    raw_rules, message = fp.read().split('\n\n')
    raw_rules = raw_rules.splitlines()
    message = message.splitlines()

rules = rule_maker(raw_rules)
    
print(f"Part 1: {count_messages(rules, message)}")
rules[8] = [[42], [42, 8]]
rules[11] = [[42, 31], [42, 11, 31]]
print(f"Part 2: {count_messages(rules, message)}")

# rules[0]
```
Want review on the summary section in my resume.
Tags: career, resume, help
Published: 2020-12-19 08:12:47

Hello friends, I am about to apply for my second job search as front end developer currently I am working in a startup since last one year and 30th Dec will be my last day, Initially it was an on-site job but after lockdown, I am working from home, and I liked working remotely so will be applying to companies with are hiring remotely, accordingly I had updated my summary section in my resume but not sure if it sounds good or not so need some suggestions on my resume especially the top summary part.
Here is the resume link : [Resume](https://drive.google.com/file/d/1qjMf_Umeb7Hd7AgYAd5BHP9_-CtyPqwU/view)
Thanks!
Easy 1min Laravel setup on local with HTTPS
Tags: laravel, docker, php, webdev
Published: 2020-12-19 08:02:40

#Finally a good GUI of docker.
**Local development** software on top of docker with **HTTPS** on local. Now set up local projects is about a few clicks.

* Install **[DECK](https://github.com/sfx101/docker-stacks/releases/tag/v2.1.0)**

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

* Select image for your project like **Laravel 7**

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

* Enter your project name which will be the domain name of your local setup, and select project folder

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

* Click start 

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

* Open App and start working 

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


Your laravel7 project local setup with **HTTPS** now ready

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


#Conclusion
Setting up a local development project always seems to be an extra headache for developers and so for me too and this kind of app will make developer's day saver truly. 

Love and best wishes to all creators..

_If you found this article interesting please consider following me on [Twitter](https://twitter.com/ByteNebula), [facebook](https://www.facebook.com/NebulaByte-100116265295910)_
Hello
Tags: hello, new, hi, firstpost
Published: 2020-12-19 07:39:28

## Small Sorry Note
Hi, sorry I didn't create a proper first post. This is actually my second post, supposed to be my first. My [first post](https://dev.to/whippingdot/vs-code-extensions-5fph) had no introduction and it was not too good.
# Hi
So... hello. I am new to the dev community, and I came here from @cursorweb 's post on [repl.it](https://repl.it). The post is [this](https://repl.it/talk/share/Devto-API/87142). He said he found this cool community, and so I checked it out. The dev community was very nice from the start. I loved the smoothness of the website and I loved the look of the website(I of course didn't like the light mode so I changed it to dark). I usually create accounts on a ton of websites so I created one here, and voila, it was amazing. I instantly started scrolling around, looking at the posts, and after around 1 hour, I created my first post. I was really excited with the website(as I get excited with new things) and I was really happy. I still love the website sooo much and my favorite feature is the chat. Before I couldn't interact with the [repl.it](https://repl.it) members privately, unless I invited them to a repl and then used the chat. I could also post in comments, but that wasn't really private and while getting to know someone, someone random would come and say hi. Since hopping on this website, I got to know @codemonkey51 properly, and I got to speak with him.

## Closure
I like this website a lot, and I think that you, the dev.to team, should continue doing what you always do. You CSS is out of the world, and so is you JS.
Into The Halftone-Verse
Tags: css, codepen, comics, cmyk
Published: 2020-12-19 07:34:49

About a month ago, I finally watched “Spider-Man: Into The Spider-Verse” with my son (who had seen it multiple times). Wow! What a great new take on animation, and what a wild storyline.

A few days later, my son played around with a CSS `filter`-editor, I’d been working on (to use it, see it on Codepen in [**Full Screen**](https://codepen.io/stoumann/full/MWeNmyb)):

{% codepen https://codepen.io/stoumann/pen/MWeNmyb default-tab=result %}

Especially the “hue”-rotate function grabbed his attention:
“Wow, dad, if only you could have these big dots from Spider-Man as well!” 

By “big dots” he meant halftones, and they’re used **a lot** in “Spider-Man: Into The Spider-Verse”, as well as any old comic-book you can get hold of. 

When I was his age, I drew comics all the time. 
For shades, I’d use sheets of halftones with different dot-sizes and densities. I don’t think you can buy these anymore!

Later on, I published a fanzine about comics — and for the covers, I used halftones for generating colour-effects. As an example: For light green, you’d use solid cyan with halftones of yellow, turned x amount of degrees:

![Light green](https://dev-to-uploads.s3.amazonaws.com/i/lzk5j3crafmgu9vyh2oo.png)

As I recall, there were books with info about how you’d create most colours, using solids and halftones of different sizes and densities … and degrees.

For printing you used — and still use — Cyan, Magenta, Yellow and blacK, known as CMYK. 
The *order*, in which the colours are printed, is often YMCK (almost like the song), that is, the lighter colours first. 

So … to give my son the “big dots”, I wasted one rainy Sunday creating a "Halftone Editor", allowing you to create comic-like patterns like these:

![Pattern 1!](https://dev-to-uploads.s3.amazonaws.com/i/w4m4ybdda6i1urgihj1f.png)

![Pattern 2!](https://dev-to-uploads.s3.amazonaws.com/i/5ddg8byaisszjczvlvn8.png)

![Pattern 3](https://dev-to-uploads.s3.amazonaws.com/i/5kp9rt2b07fqoaqzkyit.png)

To try it/create your own patterns, follow this (full-screen!) [Codepen link](https://codepen.io/stoumann/full/PoGPmPm).

It’s how you used to create colours back in the days *before* digital … with a twist.

Thanks for reading!