teleren/devto huggingface dataset:
Learn TypeScript by Creating a Simple Memory Game 
Tags: react, typescript, webdev, showdev
Published: 2020-06-05 12:30:03

#TypeScript a quick definition
  TypeScript is a typed **superset** of JavaScript compiled in JavaScript *since the browser/compiler knows to compile only JavaScript*. You would've heard this often ! what's this actually, TypeScript is JavaScript along with some additional features.

#How it can help developers of different domain ? 
  The major two division in the web development is JavaScript developers and C#,Java,Visual Basic .NET , ... (*from my point of view*) 

  If JavaScript developers checks the code in any of the  C#,Java,Visual Basic .NET project or if .C#,Java,Visual Basic .NET checks the code of any JavaScrip project then this will happen .. 

![Alt text of image](https://media.giphy.com/media/xhN4C2vEuapCo/giphy.gif)

If TypeScript is used it would bring some common things not full but some. A minimal thing ! C#,Java,Visual Basic .NET will not see TypeScript as a new things but for JavaScript developers this a huge thing! Probably a new world we're getting into .... 

# In-to TypeScript 

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

**interface**: where we declare the types of the values/parameters 

now the interface Person consist of two objects *firstName* & *lastName* of type string and Person is assigned to the parameter in the function ```function greeter(person: Person)``` so now the parameter for the function greeter is type checked. Parameters should be of type string.  ```let user = { firstName: 123, lastName: "User" };``` TS plays here! this this throw an error.

All the data type supported in JavaScript can be assigned in the interface to any of the variable.This is the first thing to be learnt!

Check this out to explore more data types and how to use them [link](https://dev.to/ganeshmani/typescript-basics-a-definitive-guide-57j) one of my colleague explained this well

##So what's in this memory game ? 

This game is created using Typescript along with the **useReducer**
 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/a7nu1w97l4v1sc31lk10.png)

this shows some of the TypeScript usage in Reactjs . You can check the repo [here](https://github.com/karthick3018/memoryGame-reactTS)

Spent some time to play the game [here](https://karthick3018.github.io/memoryGame-reactTS/)

#Has all TypeScript points over?  

Undoubtedly a big no there's way big things to explore in TypeScript check this docs and make great projects ! 

https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html

https://www.tutorialspoint.com/typescript/typescript_overview.htm 

If you haven't checked things about **react-query**
 check [this](https://dev.to/karthick3018/what-is-react-query-a-curd-operation-using-react-query-2ep4) out . It's really cool and save your time a lot,increases your productivity. 

 
*Thanks for your time !!
See you all then
Happy Coding stay safe!*
Which DEV theme & FONT do you use?
Tags: discuss, watercooler
Published: 2020-06-05 12:11:55

Let's have a chat :)

**Theme: JUST BLACK**
**Font : JetBrains Mono**
![code snap](https://dev-to-uploads.s3.amazonaws.com/i/6a2yf0gnv4ur5k8s7quy.png)

Confused right, share DEV as well as IDE configs 😄
Lazy Load Images in 2 seconds
Tags: html, javascript, css
Published: 2020-06-05 12:09:33

## The Story

I have this internal tool for some purpose. Now, this has a page where it displays like 50+ images grid in smaller sizes.
The page always load very slow and I hated it.

So We can solve this by **properly generating smaller thumbnails** of the images and/or **lazy loading** the images.

This isn't really isn't used by anyone else other than me. So I decided to skip the thumbnail part and add 2 lines of js to lazy load the hack out of these stupid images.

Then I stumbled upon something I completely forgot that existed.

## loading="lazy"

```html
<img src="..." loading="lazy" />
```

That's pretty much everything you need to make your images lazy load.

Now this is an HTML5 Feature and probably might not be supported by every browser out there.
It might not bring fancy animations and fade transitions onto the table

But IT WORKS!!

The previous webpage is atleast 3 times as fast.

Read more here: [MDN](https://developer.mozilla.org/en-US/docs/Web/Performance/Lazy_loading#:~:text=On%20this%20Page&text=Lazy%20loading%20is%20a%20strategy,into%20reduced%20page%20load%20times.)

## TL;DR

Use the `loading` attribute in HTML

```html
<img src="..." loading="lazy" />
```

## Update

You definitely should not use it in anything important.
You need a polyfill to get it work on all browsers.
Read my story and see why I used it.
HOWTO Create Beautiful Gantt 
Published: 2020-06-05 12:04:02

#Intro
So first of all, what `Gantt` chart is? and why should you use it?
`Gantt` chart is bar chart that illustrates a project schedule, this chart lists all the tasks we need to perform in order to complete the project, by doing this type of bar chart we can get a clear view of our project dependencies and make better planning decisions.

# How To
In this post I'll create the `Gantt` using Google Spreadsheets, but you can use any type of "Excel" like program for that.
We will start by adding table with 3 columns:
```Task, Start Date, End Date```
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/hsd3w7bh2rnxz1age1hm.png)

Next we will add another table with only dates
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0dbabhjuemd33s8fw0z9.png)

Now the idea is we want to color only the cells in the second table which the current date is between the start and the end dates from our first table,
And for that we will use Conditional Formatting, Go to Format -> Conditional Formatting
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/aeripb008hac2qzml9rh.png)

We want to apply to the entire range of the second table, with the rule: Custom Formula
```
=AND(E$1 >= $B2, E$1<=$C2)
```

Note that your columns might be different, the idea is we want to check if our date (`E$1`) is between the start and end date (`$B2`,`$C2`), if you are not familiar with the `$` you can read more about it [here](https://exceltutorialonline.com/what-does-dollar-sign-mean-in-excel-formulas/)

you can also play with the colors for your liking.

and now we have something that looks like this:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/irc37v93iiioptvq3eer.png)

And lets add the current date indicator, for that we will need to add another conditional formatting on our dates, with this formula:
```
=E$1=TODAY()
```

And by using this formula if the date in the header is the same as `TODAY()` the current cell will get highlighted:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0n2l9yhdlxfpeaz6zrli.png)

And we have our basic `Gantt` Chart :)
You can see this spreadsheet [here](https://docs.google.com/spreadsheets/d/1Q1YMRIC609t4zJmAVok4r6Q3h4ZymeETDzWOkIQKFm4/edit?usp=sharing)

Enjoy 
> Like this post?
> Support me via [Patreon](https://www.patreon.com/eranelbaz)
> Subscribe to my [YouTube Channel](https://www.youtube.com/channel/UCVUNeBGM5wZJKcOx0QwAaTA?sub_confirmation=1)
Daily Developer Jokes - Friday, Jun 5, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-06-05 12:00:22

---
title: "Daily Developer Jokes - Friday, Jun 5, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Friday%2C%20Jun%205%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258999910d.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ Why did 10 get paid less than "10"?

___A:___ There was workplace inequality.
 -->
Training,Best Data Science Training In Bangalore
Published: 2020-06-05 11:59:27

Primarily, knowledge science refers to a area of examine that makes use of the scientific strategy to get an perception into the given knowledge. So, prepare your self for the new world of rising career opportunities within the platform of Azure Knowledge Science by enrolling for OST institutes superior Azure DP-one hundred Information Science Certification Training. A Knowledge Science professional is able to present an actual perspective of the continued enterprise activities, the result or effects of innovation, and an overview of underlying mistakes that are being repeated 12 months after yr.

The information science online coaching in Hyderabad covers sensible issues in statistical computing, which includes programming in R & Python, studying data into R & Python, accessing R packages & Python data science library and frameworks, writing R & Python functions, debugging, profiling R & Python code. Our trainers are subject material specialists and industry leaders who have in depth information in the area of Knowledge Science.

Information Science, along with statistics and Machine Learning algorithms, allows individuals to make higher decisions. Aspirants who really passionate a few profession in Data science, then Magnitia IT is the best choice to study Knowledge Science Course. Upon course completion, you'll grasp the important tools of Knowledge Science with Python. The course curriculum is designed by high industry professionals with extensive expertise in Knowledge Science and Enterprise Analytics.

The course is mainly focussed on Python for core information science programing; it also consists of R as necessary to enable professionals working in R. Numerous firms have invested some huge cash to be able to shortly get hold of related information from the information. Then read on.Consider learning Information Science because it lets you keep related as a IT professional. Data science coaching at Integrum would improve the technical expertise on Artificial Intelligence, Git, Python, Machine Learning, Deep Learning, Tableau, R, SAS, Excel, and Unix.

As part of our advanced Knowledge Science Training In Hyderabad program, students will likely be mastering information of Data Science skills and instruments required for achievement - from fundamentals like statistics and knowledge modeling to superior instruments and applied sciences like R, Python, Synthetic Intelligence, Machine Studying Deep Studying and TensorFlow, Pure Language Processing, Neural Networks, Image Recognition, Business Analytics, Predictive Analytics, Apache Hadoop and Spark and lots of extra.

<a href="https://g.page/ExcelRSolutionsBanaglore?share
">Data Science courses</a>   

We are located at : 
Location : 
ExcelR - Data Science, Data Analytics Course Training in Bangalore
49, 1st Cross, 27th Main BTM Layout stage 1 Behind Tata Motors Bengaluru, Karnataka 560068
Phone: 1800-212-2120/ 070224 51093
Hours: Sunday - Saturday 7AM - 11PM
LocalBitcoins
Tags: localbitcoins, cryptocurrency, blockchain
Published: 2020-06-05 11:54:44

Latest Updates:
18 March 2020
LocalBitcoins did not deliver in german on the account of the BitLicense issue. But on the update of terms, Germany users can also Buy/Sell bitcoins over Localbitcoins.

2 June 2020
Russia happens to be the leader in Global BTC trading volume on LocalBitcoins for April and May 2020 months. 

9 June 2020
Egypt has recorded an all-time bitcoin trading volume, a high of 2.2m EGP has been traded on Localbitcoins.com. 

If you are interested in or looking for Bitcoin Trading, then I suggest you to go with LocalBitcoins Exchange.
Source: https://coinpedia.org/exchange/localbitcoins/
Simple Sum Types In TypeScript Without Common Fields
Tags: typescript, types, react, tips
Published: 2020-06-05 22:11:45

---
title: Simple Sum Types In TypeScript Without Common Fields
published: true
date: 2020-06-05 11:53:00 UTC
tags: TypeScript, types, React, tips
canonical_url: https://hoichi.io/blog/ts-simple-sum
---

[Discriminated unions](https://www.typescriptlang.org/docs/handbook/advanced-types.html#discriminated-unions) are well known in TypeScript. Their only (?) downside is they need a common property usually named `kind` or `tag`, e.g.:

```ts
type RenderProps<T> =
| { kind: 'children',
    children: (x: T) => ReactElement | null;
  }
| { kind: 'render',
    render: (x: T) => ReactElement | null;
  }

```

Which makes it a tad too wordy to use:

```ts
const RPComponent = (props: RenderProps<number>) => {
    switch(props.kind) {
    case ('children'):
        return props.children(42);
    case ('render')
        return props.render(42);
    }
}

// elsewhere
<RPComponent kind="render" render={n => <i>{n}</i>} />

```

Now, I’m fine with JS in templates (if you still call of JSX as of templates, and why not), but that unnecessary `kind` prop gets my goat.

So here’s a more compact solution:

```ts
type RenderProps<T> =
| { children: (x: T) => ReactElement | null;
    render?: never;
  }
| { children?: never;
    render: (x: T) => ReactElement | null;
  }

const RPComponent = (props: RenderProps<number>) =>
    (props.children || props.render)(42);

// and
<RPComponent render={n => <i>{n}</i>} />

```

It’s still a sum type (you can neither omit both `children` and `render` nor provide them both), but now you don’t need no stinking `kind` anywhere.

Mind that for some reason it’s not enough to declare the union variants as `{ chidlren: SomeType, render: undefined }`. At least for JSX, TypeScript will want you to still _specify_ a prop and give it a value of `undefined`. But `render?: undefined` (or `never`, which, I think, better conveys your intention) does the trick.

* * *

Posted first at [hoichi.io](https://hoichi.io), because you can’t be too paranoid.
What will be the ripple price in 2020?

Tags: ripple, rippleprice, cryptocurrency, blockchain
Published: 2020-06-05 11:52:36

Ripple acts both as a cryptocurrency and a digital payment network for financial activities. It establishes quick, secure and cheap exchange procedures all over the world. In the year 2019, technology targets to expand its operations to many more countries. Ripple came to existence in August 2013 to the crypto market. Ripple is going to rule all international transactions worldwide. The platform owns a currency (XRP) that allows everybody to use it in order to create their own via RippleNet.

Why invest in Ripple?
1.Currently, 55 billion out of 100 bln XRP coins are secured. This means it avoids the fall in the Ripple price.
2.Ripple aims to set up quick, safe and cheap exchange procedures all over the world.
3.Ripple platform allows only the pre-approved members to manage a node and verify XRP transactions.

Ripple Price Analysis
Ripple Price  can be forecasted by the related sources.Ripple was trading at $0.005882 resistance levels at the beginning. As days passed by, the Ripple price started trading at higher rates.During March 2018, Ripple was trading at the rate of $0.697269, which was clearly an 11,752.28 percent increase.

Ripple Price Prediction 2020
 A various set of experiments were executed in the year 2019.If the growth of XRP is successful, then Ripple can reach up to the heights of $2 by the end of 2020. Ripple price prediction can be forecasted by the related sources as in 2020, the price will be the same and in November and December will grow to 0.37 USD. 

So what are your views about Ripple price predictions?

Read further at https://coinpedia.org/price-prediction/xrp-ripple-price-prediction/
Twitter Bot - Vue 3 Updates
Tags: showdev, vue, tutorial
Published: 2020-06-05 11:45:08

Say hello to [Vue 3 bot](https://twitter.com/vue_3)

{% twitter 1264515170455388160 %}

I created a Twitter bot that listens to Vue 3 related projects and when a new version is released it will give a tweet about it with a link to the changelog.

So if you want to stay up to date with the latest of Vue you might want to [follow the account](https://twitter.com/vue_3). The bot is watching the projects vue-next, vue-router-next, Vue Class Component v8, Vuex 4, Vite, and VitePress.

The Twitter bot was made with Kotlin and runs in AWS as a Lambda function. You can find the source code on [GitHub](https://github.com/gautemo/twitter-bot-vue-3). It's not that much code, but it's a lot of pieces that needs to work together so this will be a tutorial series on how to get everything working with Kotlin in AWS and the Twitter API.
Algorithms Problem Solving: Even Number of Digits
Tags: algorithms, python, computerscience, interview
Published: 2020-06-05 10:51:31

---
title: Algorithms Problem Solving: Even Number of Digits
published: true
description: Solving algorithms problems with TK
tags: algorithms, python, computerscience, interview
cover_image: https://raw.githubusercontent.com/leandrotk/tk/master/series/algorithms-problem-solving/assets/buildings.jpg
canonical_url: https://leandrotk.github.io/tk/series/algorithms-problem-solving/even-number-of-digits.html
series: Algorithms Problem Solving Series
---

This post is part of the [Algorithms Problem Solving](https://leandrotk.github.io/tk/series/algorithms-problem-solving/index.html) series.

## Problem description

This is the [Find Numbers with Even Number of Digits](https://leetcode.com/problems/find-numbers-with-even-number-of-digits/) problem. The description looks like this:

Given an array nums of integers, return how many of them contain an even number of digits.

## Examples

```python
Input: nums = [12,345,2,6,7896]
Output: 2

Input: nums = [555,901,482,1771]
Output: 1
```

## Solution

The solution idea is to iterate through the numbers list and for each number, verify how many digits it has and if it has an even digits number, increment the counter.

Using Python3, we can transform the number into a string and get the length of it. If it is divisible by 2, it is an even number of digits.

```python
def find_numbers(nums):
    counter = 0

    for num in nums:
        if len(str(num)) % 2 == 0:
            counter += 1

    return counter
```

## Resources

- [Learning Python: From Zero to Hero](https://leandrotk.github.io/tk/2017/09/learning-python-from-zero-to-hero/index.html)
- [Algorithms Problem Solving Series](https://leandrotk.github.io/tk/series/algorithms-problem-solving/index.html)
- [Big-O Notation For Coding Interviews and Beyond](https://www.educative.io/courses/big-o-notation-for-interviews-and-beyond?aff=x8bV)
- [Learn Python from Scratch](https://www.educative.io/courses/learn-python-from-scratch?aff=x8bV)
- [Learn Object-Oriented Programming in Python](https://www.educative.io/courses/learn-object-oriented-programming-in-python?aff=x8bV)
- [Data Structures in Python: An Interview Refresher](https://www.educative.io/courses/data-structures-in-python-an-interview-refresher?aff=x8bV)
- [Data Structures and Algorithms in Python](https://www.educative.io/courses/ds-and-algorithms-in-python?aff=x8bV)
- [Data Structures for Coding Interviews in Python](https://www.educative.io/courses/data-structures-coding-interviews-python?aff=x8bV)
- [One Month Python Course](https://mbsy.co/lG6tv)
GitHub Status action
Tags: github, actions, devops, ci
Published: 2020-05-23 08:58:03

---
title: GitHub Status action
published: true
description: GitHub Action to check GitHub Status in your workflow.
tags: github,actions,devops,ci
---

{% github crazy-max/ghaction-github-status %}

With yesterday's disruption on GitHub, I thought it would be a good idea to create a GitHub Action to check the status of GitHub's services. So here it is! 

### Features

* Threshold management for each GitHub service or global (rollup)
* Display status of all services
* Display active incidents and updates

### Basic worflow

The following workflow is purely informative and will only display the current status of GitHub services:

![GitHub Status OK](https://dev-to-uploads.s3.amazonaws.com/i/es8hj8wpqbaig60cwa9i.png)

```yaml
name: build

on: push

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      -
        name: Check GitHub Status
        uses: crazy-max/ghaction-github-status@v1
      -
        name: Checkout
        uses: actions/checkout@v2
```

### Trigger error if GitHub services are down

In the example below we will set some status thresholds so that the job can fail if these thresholds are exceeded.

This can be useful if you have an action that publishes to GitHub Pages but the service is down.

![GitHub Status - Failed](https://dev-to-uploads.s3.amazonaws.com/i/4mayoyq0yrweuciok3ip.png)

```yaml
name: build

on: push

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      -
        name: Check GitHub Status
        uses: crazy-max/ghaction-github-status@v1
        with:
          overall_threshold: minor
          pages_threshold: partial_outage
      -
        name: Checkout
        uses: actions/checkout@v2
```

Many others thresholds are available like Git Operations, GitHub Packages, Webhooks, etc...

Check it out: https://github.com/crazy-max/ghaction-github-status/

---

Support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max) 👏 or by making a [Paypal donation](https://www.paypal.me/crazyws) to ensure this journey continues indefinitely! 🚀

Thanks again for your support, it is much appreciated! 🙏
ERP CRM Software Manufacturing IT Company.
Tags: crm, erp, businessautomation, corona
Published: 2020-06-05 10:10:16

Teknovative Solutions is India's leading Customized ERP Software development Company, We served our Services Across the Glob.  We are providing world-class Business Management Solutions to a wide range of enterprises. We have a number of years of expertise in analyzing the requirements of different business segments and developing software to meet their business needs. We have very strong expertise in implementing business management solutions as per requirements.We evaluate the leading software whether it be a Comprehensive Solution for Manufacturing, Trading as well as Service Industry that helps to Integrate and Streamline Complete Business Processes from …

 Taking orders from Customer/dealers 
(with dealer Login) ? Automatic scheduling production if not in stock ? maintaining inventory movements 
(with serial no. & Barcode) within the internal location or warehouse/ Live inventory valuation 
(location/company/ warehouse wise) ? Production/Batch, & customer wise production coasting management/ Product wise
margin ? Quality Control & Maintenance automation as per manufacturing cycle ? Dispatch and Shipping automation 
? Receiving records and Ensuring all the Financial Movement ? Accounting data synced. ? Manage multi-company from 
single dashboard ? CRM (lead management & followup automation) for marketing automation ? HRMS & Payroll 
? EPC & Project Management (project wise coasting & task analysis) ? After-sale service Management and 
lots of more Business Automation Tools for making any business on Autopilot mode & Transparent.  
And lots 
lots more Business Automation Modules to implement it for our clients. We have expertise in developing 
Enterprise-grade business applications and provide a consolidated service throughout the various phases 
of development of an enterprise solution including > Business Process Analysis. Requirements Gathering. 
Choosing appropriate Architecture & Design. Development. Implementation & Roll-out User Training and service.