teleren/devto huggingface dataset:
My Inspiration for a Chart class came from the trendet Python package
Tags: chart, class, python, trend
Published: 2020-07-16 01:24:22

---
title: My Inspiration for a Chart class came from the trendet Python package
published: true
date: 2020-06-04 07:22:24 UTC
tags: chart, class, python, trend
canonical_url: https://fxgit.netlify.app/post/my-inspiration-for-a-chart-class-came-from-the-trendet-python-package/
---

My idea from the [trendet](https://github.com/alvarobartt/trendet) Python package is to create a general method for a ChartCls class, that conveniently draws a span of vertical lines to highlight up and down trends on a given chart.

Read to the end of article for the **SPOILER**.

![](https://fxgit.netlify.app/img/my-inspiration-for-a-chart-class-came-from-the-trendet-python-package/introduction.png)

## What is trendet?

The [**trendet**](https://github.com/alvarobartt/trendet) Python package comes with an easy trend detection tool. It conveniently plots a chart that highlights both the uptrend regions and downtrend regions, in green color and red color, respectively.

![](https://fxgit.netlify.app/img/my-inspiration-for-a-chart-class-came-from-the-trendet-python-package/what-is-trendet-.gif)

## Prerequisites

- [**trendet**](https://github.com/alvarobartt/trendet) - Python package to detect trends
- [**matplotlib**](https://matplotlib.org/) - Python package to plot charts
- [**seaborn**](https://seaborn.pydata.org/) - Python package to plot lines

## Step 1 - Understand the trendet code sample

[**trendet**](https://github.com/alvarobartt/trendet) is a Python package to automatically detect trends for any given time series data, e.g. S&P 500. This package has been created to support [investpy](https://github.com/alvarobartt/investpy) features when it comes to data retrieval.

The full blog post can be found [here](https://yourls.fxgit.work/001medfr).
Will Litecoin take over the cryptocurrency market?

Tags: litecoin, blockchain, cryptocurrency
Published: 2020-06-04 07:13:32

In the world of crypto, Litecoin is called the "digital silver" whereas Bitcoin is called the "digital gold".Litecoin transactions are four times faster than Bitcoin Blockchain. Litecoin is also an alternative for bitcoin but it cannot be replaced as its parent coin. There are many ups and downs in the crypto world, we should be aware of. Let us see the Litecoin price prediction.

Litecoin is a peer-to-peer cryptocurrency that is created by Charlie Lee. The creation was based on the Bitcoin protocol which alters in terms of the hashing algorithm used.

Litecoin Price Today:
Litecoin was the one to catch us by a surprise since the last two days. Among an inbound gathering of indicators expected to probably resist its price from crawling, Litecoin acquired momentum upwards.

Litecoin Price Prediction for 2020:
Let us know what  prediction experts of the crypto world say about Litecoin price prediction for 2020 – 
1. TradingBeasts, a popular crypto forecast website, predicted that  LTC price will be around $46.23  by the end of next year,; and only a bit higher in 2021 – up to $67.23.
2. CoinFan,  a famous online forecasting service, says that Litecoin future predictions look rather promising, with LTC prognosed to end 2020 at $276.4. 
3. George Tung, a cryptocurrency analyst, says litecoin  prices might rise as high as $1,500 towards the end of 2020.
4. As per crypto ground forecast, litecoin price might reach $88 by 2020, and in five years litecoin might reach $347.
5. Long Forecast believes that the Litecoin price will fluctuate in 2020 between $30 and $50.

So,what are your views on Litecoin Price Prediction?Do share. Read more at https://coinpedia.org/information/ltc-litecoin-price-prediction/
Redirecting url trick
Tags: html
Published: 2020-06-04 07:07:20

[Submit Email to Get Thank You Gift](https://heggy231.github.io/chingu-codecademy-webdev-speedrun-challenge/frontend/thank-you/)

I want to talk about how to redirect user to a Thank you page only after the user submits one's email.

Use `form action="./new-page.html"`.  Once form is submitted; user is redirected to `your-current-page/thank.html`.  

Remember to add `input` `required` attribute to email field!  This forces user enter email before user gets redirected to the thank-you page.

```html

  <h1>Welcome sign up</h1>
  <form action="./thank-you.html">
    <label for="email">Email:</label>
    <input type="email" id="email" required>
    <input type="submit" value="Submit">
  </form>

```

In Thank-You page, `link` tag takes user to the gift!

```html

<a 
class="button" 
href="https://docs.google.com/spreadsheets/d/1k4Wbbmds0bPOaf6SQutNfiOmb8lYlUWPnj3ggbbO6ac/edit#gid=2062450288" 
target="_blank">
Download Your Gift!!
</a>

```
A 10-day programming contest for fun and learning
Tags: challenge, news, learning, motivation
Published: 2020-06-04 07:00:19

---
title: A 10-day programming contest for fun and learning
published: true
description: Join us to keep learning and improve your coding skills
tags: challenge, news, learning, motivation
cover_image: https://thibpat.now.sh/img/social/contest/unofficial-codingame-contest.png
---

As a software engineer, I like to learn regularly because I feel like I'm putting new tools in my toolbox. I wanted to offer an opportunity for others to learn.


After competing in a [codingame](https://www.codingame.com/servlet/urlinvite?u=3450300) contest, I wanted to do another one right away, but their next contest is only in fall 2020.


Enter the Unofficial codingame contest! A 10-day programming contest for fun and learning. It starts on [2020-06-05 07:00 UTC](https://www.timeanddate.com/worldclock/fixedtime.html?iso=20200605T0700). You'll be able to compete using any of the 27 available languages (including Python 3, C++, C, Rust, Go, JavaScript, TypeScript, C#, Java, Scala, Kotlin, Ruby, PHP...).


On the start of the contest, I'll share more information on the [homepage of the contest](https://thibpat.now.sh/contest/unofficial-codingame-contest) regarding which game you'll have to build an Artificial Intelligence for!


And just for fun, here is the teaser for this contest:


{% youtube l5vYYI4lSWk %}


[Register for the contest now!](https://thibpat.now.sh/contest/unofficial-codingame-contest)
Best React Tutorial
Tags: javascript, react
Published: 2020-06-04 06:59:57

Hi, everyone hopes everyone is doing fine. I am a junior react developer, recently I wanted to polish my skills in react so I took a course from egghead.io that is **The Beginner's Guide to React by kentcdodds**.

In this blog post, I wanted to explain some of the things, that I have learned from the course. I think everyone has to try this course it is completely free. Don't think this course for beginners only everyone can learn a lot from this course.


[The Beginner's Guide to React course link](https://egghead.io/courses/the-beginner-s-guide-to-react)

* Using React Error Boundaries to handle errors in React Components
* Lifting and colocating React State
* React Hooks
* Install and use React DevTools
* Build and deploy a React Application with Codesandbox, GitHub, and 
  Netlify
* Handle HTTP Errors with React
* Use a lazy initializer with useState
* Manipulate the DOM with React refs
* Create reusable custom hooks
* Manage side-effects in a React Component with the useEffect hook

[GitHub repo of the course](https://github.com/kentcdodds/beginners-guide-to-react)

If you find any topic interesting go and learn it from the course. In my next blog, I will explain a topic with decent code examples.
How to master at SRE recruiting?
Tags: sre
Published: 2020-06-04 06:55:54

To all the professionals here: 

I'm wondering if some professionals here could provide some infographic, diagrams of the Software Engineer ECO system? For each positions what are the required skillsets / what their 'titles' might be at work?

*For example MINITOR should be 'Site Reliability Engineer'
*From (Planning -> Code -> Build -> Test -> Release) could range from FULL STACK / FRONT-END Developer ...etc.

Could anyone here kindly help to resolve the puzzle for me, please?
Laravel use or force index on a query
Tags: laravel, mysql, database, todayisearched
Published: 2020-06-04 06:49:49

When you want to use or force index with Query Builder in Laravel, you can do it

```php
$query = SomeModel::query()->getModel()
$query->setTable(DB::raw($query->getTable() . ' USE INDEX(index_name)'))
$results = $query->get();
```

In complex queries with with() previous solution doesn't work. Better to overwrite base query 'from' value instead:

```php
$query = SomeModel::with('some_relations')...->orderBy();
$query->getQuery()->from(DB::raw($query->getQuery()->from . ' USE INDEX (index_name)'));
// or just
$query->getQuery()->from(DB::raw('`table` USE INDEX (index_name)'));
$results = $query->get();
```

Hope it will helpful with you.
CSS Rounded Corners
Tags: css
Published: 2020-06-04 06:35:35

One awesome thing that we can do with `CSS` is to add rounded corners to elements. This gives it that neat box look and can even be used to create cool circles.

## HTML Structure

```html
<div class="box rounded"></div>
<div class="box one-side"></div>
<div class="box round"></div>
```

In this example we are going to make one neatly rounded corner box, one with just one side rounded and a circle box.

## CSS Rounder Corners

To use the rounded corners, we use `border-radius` this accepts values as you are used from `margin` or `padding`.

To make the rounded one we use the following css:

```css
.rounded {
  border-radius: 5px;
}
```

This will give it equal `border-radius` of 5px on each side.

To make just one border rounded we can give it one of 4 values like such:

```css
border-radius: top-left | top-right | bottom-right | bottom-left;
```

In our example:

```css
.one-side {
  border-radius: 0px 5px 5px 0px;
}
```

Then one that I tend to use a lot is the version that makes it round.

```css
.round {
  border-radius: 50%;
}
```

You can see these in action on this Codepen.

<p class="codepen" data-height="265" data-theme-id="dark" data-default-tab="css,result" data-user="rebelchris" data-slug-hash="dyGymqr" style="height: 265px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;" data-pen-title="CSS Rounded Corners">
  <span>See the Pen <a href="https://codepen.io/rebelchris/pen/dyGymqr">
  CSS Rounded Corners</a> by Chris Bongers (<a href="https://codepen.io/rebelchris">@rebelchris</a>)
  on <a href="https://codepen.io">CodePen</a>.</span>
</p>
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>

## Browser Support

The border-radius is very well supported, and can safely be used.

![border-radius support](https://caniuse.bitsofco.de/image/border-radius.png)

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
Understanding Istio: part 5 – Debugging/Troubleshooting Istio
Tags: kubernetes, devops, docker, beginners
Published: 2020-06-04 06:34:23

---
title: Understanding Istio: part 5 – Debugging/Troubleshooting Istio
published: true
description: Serie of sketchnotes about Istio. Explaining in a visual way Istio principles.
tags: Kubernetes, DevOps, Docker, beginners
series: Understanding Istio in sketchnotes
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/tjocund3devaht7rhz3a.jpg
---

Understanding Cloud technologies, like Kubernetes, can be difficult or time-consuming. In order to spread knowledges about it, I started to create [sketchnotes about Kubernetes](https://dev.to/aurelievache/kubernetes-sketchnotes-pods-4ib0) and know it's time to talk about a perfect companion of Kubernetes, a service mesh, Istio.

We continue our new serie of Sketchnotes about Istio, with a sketchnote about debugging/troubleshooting Istio.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/tjocund3devaht7rhz3a.jpg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8jjs0fedhlyx70516lvo.jpg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/54qkm1pzvjawd0gau6xy.jpg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/dnj9snkq1ehssbtnx1r3.jpg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/2uuthm36ia0s3vdjn6mc.jpg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4k9phm254tgv9zm6fwzy.jpg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/3xziwyt2sjxnmsy5o5bd.jpg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1j2mkg33b43mj3o2ldyq.jpg)

If you are interested, I published a book with all the sketchnotes on Istio (and new ones!): ["Understanding Istio in a visual way"](https://gumroad.com/aurelievache#vJYhM).

As usual, if you like theses sketchnotes, you can follow me, and tell me what do you think. I will publish others sketchs shortly :-).
[From May 28 to June 3] The things I knew and thought last week
Published: 2020-06-04 06:33:47

---
title: [From May 28 to June 3] The things I knew and thought last week
published: true
description: [From May 28 to June 3] The things I knew and thought last week
tags: 
---

[Nuxt] set/get cookie in SSR
https://github.com/nuxt/nuxt.js/issues/2215

Another way

```
import Cookies from 'js-cookie'
https://github.com/js-cookie/js-cookie
Cookies.set('company.id', companyId, { expires: 7 })
```

I created a cookie util that gets cookie by key and parse

```
export const getCookie = (cookie: string, key: string): string | undefined => {
  let item = cookie.split(' ').find((v) => v.includes(key))
  if (item) {
    // remove semi colon "job.id=32;"
    if (item.includes(';')) {
      item = item.slice(0, -1)
    }
    // "job.id=32"
    const kv = item.split('=')
    item = kv[1]
  }

  return item
}
```
Actualizar la versión de Ubuntu
Tags: ubuntu, server, upgrade
Published: 2020-06-04 06:05:46

---
title: Actualizar la versión de Ubuntu
published: true
description: Este procedimiento lo uso para actualizar la versión de ubuntu server
tags: 'ubuntu, server, upgrade'
---

# Actualizar Ubuntu

Para actualizar la versión de Ubuntu se recomiendan los siguientes pasos:

> Estos pasos son para pasar de Ubuntu 16.04 a 18.04

Reemplazar el nombre clave de la versión de Ubuntu 

```bash
$ sudo sed -i 's/yakkety/bionic/g' /etc/apt/sources.list
$ sudo sed -i 's/zesty/bionic/g' /etc/apt/sources.list
$ sudo sed -i 's/^/#/' /etc/apt/sources.list.d/*.list
```

Actualizar el repositorio de paquetes

```bash
$ sudo apt update
```

Aplicar las actualizaciones disponibles

```
$ sudo apt upgrade
```

Realizar el upgrade de la distribución

```bash
$ sudo apt dist-upgrade
```

Hacer limpieza de los programas que ya no son relevantes en la nueva distribución

```bash
$ sudo apt autoremove
```

Aplicar la limpieza de paquetes viejos

```bash
$ sudo apt clean
```

Reiniciar el sistema

```bash
$ sudo shutdown -r now
```

Verificar la actualización del sistema

```bash
$ lsb_release  -a
```
You decide...
Tags: swift, beginners
Published: 2020-06-04 06:00:32

1. What makes a great app?

    A- In my own words I believe that a great app is made when you truly stand behind what you are creating. 


2. What makes you pay for an app and what makes you decide an app should be free?

    A- I feel as though the content of the app may dictate how it can be monetized.
How Do You Explain Digital Transformation?
Tags: discuss, career, startup
Published: 2020-06-04 05:45:46

![Photo by Suzanne D. Williams on Unsplash](https://dev-to-uploads.s3.amazonaws.com/i/itwr5n8t9ivr2j71ammc.jpg)

I recently had a person approaching me to ask me about the techology skills to learn regarding on **digital transformation**. What would you say to the person if you were in my shoes? 

I have a rough idea about it but I think it will be interesting to know what is your take on it?
What mobile apps do you use to assist you in your developer workflow?
Tags: discuss, webdev
Published: 2020-06-04 05:35:41

---
title: What mobile apps do you use to assist you in your developer workflow?
published: true
description: 
tags: discuss, webdev
---
I use DEV and Reddit for some dev discussions while in commute and Podcasts while doing sports/training. I also believe that putting down ideas, whenever they arrive, is crucial, so I use Trello for that. Plus E-mail to get real-time communication notifications when I'm AFK.

As you see I keep it pretty minimal and believe that main workflow should always be in your PC/Mac. I believe that putting too much stuff in phone can become a distraction sooner or later.

Could you briefly describe your mobile phone setup you use to assist you in your developer workflow? What are some apps you would recommend to try?
What is blockchain technology and its future?
Published: 2020-06-04 05:22:49

A blockchain is a technology that allows creating a distributed network in the modern digital world. Through blockchain technology, the customer could gain access to more information about where the product originated, which includes specific supplier information, by tracking the blockchains along the path. In other words, blockchain technology allows all participants in a given system to have equal access to information about the product. Blockchain in the future will revolutionize business processes in many industries, but its adoption requires time and effort.  Nevertheless, shortly, we can expect that governments will finally accept blockchain benefits and begin to use it for improving financial and public services
Runtime Complexity - Big-O
Published: 2020-06-03 20:36:05

Runtime complexity is a term that we use to describe how performant an algorithm is.

We use runtime complexity to compare different solutions to a given problem or different algorithms for solving a given problem in the context of an interview.

So in the context of interviewing you are going to be asked very frequently what the runtime complexity of a given solution is.

In other words, runtime complexity in mathematical notation is called Big-O.

Let’s see some common time complexities described in the Big-O notation.


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

#Time Complexities
###O(1) - Constant Time
The fastest possible running time for any algorithm. An algorithm is said to run in constant time if it requires the same amount of time regardless of the input size. This is the ideal runtime for an algorithm.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/wxkq30129zjij735pu2a.png)


###O(n) - Linear Time
Describes an algorithm whose performance will grow linearly and in direct proportion to the size of the input data set. So a set twice the size will take twice the time. You probably don't want to put a million objects into one of these.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/h37jciszekr8msgq833b.png)

###O(log n) - Logarithmic Time 
It basically means time goes up linearly while then goes up exponentially. So if it takes 1 second to compute 10 elements, it will take 2 seconds to compute 100 elements, 3 seconds to compute 1000 elements, and so on.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/tpc909p5731jujfjrv5j.png)

###O(n²) - Quadratic Time
Represents an algorithm whose performance is directly proportional to the squared size of the input data set. This is common with algorithms that involve nested iterations over the data set. As the input increases, the time to run the algorithm grows at the rate of its square.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/15ao39q1s0eg8nisqxoq.png)

###O(2n) - Quasilinear Time
An algorithm is said to have an exponential time or O(2^n) if its runtime doubles with each addition to the input data set, starting off very shallow, then rising meteorically. 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4okrl6oi8mcuf8yqabie.png)


*Take a look at Array Sorting Algorithms cheatsheet!*

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

I hope you will find this article helpful.
Explaining Blockchain Technology to Layman
Published: 2020-06-04 05:02:19

Imagine two friends living far away and would like to transfer money using blockchain technology

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

The blockchain is a decentralized system of secure and trusted distributed databases


Which records and shares the transaction details across many nodes(computers) so that the data is not modified

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

Note: Blockchain was introduced to timestamp digital documents and prevent tampering of records.

In simple terms, a chain of blocks that contain information is called blockchain

When a transaction occurs, its related information is recorded into a block
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/qfpnavs1unq28d5ofdc1.png)

# What is Blockchain technology?

Blockchain is a distributed database of immutable records called blocks, which are secured using cryptography.


Note: Once the data is recorded in a blockchain, it cannot be modified.

# What is a block?

A block is a record book which contains the details of transaction data. It consists of,

* Hash of previous block: It holds the hash value of the previous block.
* Transaction data: It contains the details of several transactions.
Nonce: A nonce is a random value which is used to vary the value of hash.
* Hash: A hash is a alphanumeric value which is used to identify a block.

# Blockchain is revolutionizing the World 

* Decentralised computing:

The leasing out of CPU or storage in return for rewards issued in the form of a token.

* Finance:

Instant and secure payments without the need for any financial institution.

* Citizenship:

Identification information can be stored on the blockchain

* Smart contracts:

A contract where execution is guaranteed once certain criteria has been met. This occurs without the need for a third party.

* Advertising:

Advertisers can connect with users who have a keen interest in their products and services, and in return, reward the user with tokens.

* Medical:

A blockchain for health records, which speeds up applications and medical procedures
cannot put comments on the same line with instruction in ansible.cfg
Tags: ansible
Published: 2020-06-04 04:39:24

I configure ~/.ansible.cfg

```
fact_caching_timeout = 86400 # seconds
```

and when I run playbook, I get an error

> ValueError: invalid literal for int() with base 10: '86400 # seconds'

Comments The configuration file is one variant of an INI format. Both the hash sign (“#”) and semicolon (”;”) are allowed as comment markers when the comment starts the line. However, if the comment is inline with regular values, only the semicolon is allowed to introduce the comment. For instance:

    # some basic default values...
    inventory = /etc/ansible/hosts  ; This points to the file that lists your hosts
Include files, rather than ignore
Tags: docker, git, eslint
Published: 2020-06-04 04:37:05

In short, [the syntax for `.dockerignore`](https://stackoverflow.com/questions/28097064/dockerignore-ignore-everything-except-a-file-and-the-dockerfile), which is more restrictive than `.gitignore` is

```
# Ignore everything
**

# Allow files and directories
!/file.txt
!/src/**

# Ignore unnecessary files inside allowed directories
# This should go after the allowed directories
**/*~
**/*.log
**/.DS_Store
**/Thumbs.db
```

So, my current `.dockerignore` is

```
# Ignore everything
**

# Allow files and directories
!/packages/server/src
!/packages/server/package.json
!/packages/server/yarn.lock
!/packages/server/tsconfig.json

!/packages/web/public
!/packages/web/src
!/packages/web/.browserslistrc
!/packages/web/babel.config.js
!/packages/web/package.json
!/packages/web/yarn.lock
!/packages/web/tsconfig.json
!/packages/web/vue.config.js
```

`.eslintignore` is much closer to `.gitignore`, but I am not sure about nesting, which obviously, `.gitignore` can do.

```
*.*
!*.js
!*.jsx
!*.ts
!*.tsx
!*.vue
node_modules
dist
lib
```