teleren/devto huggingface dataset:
To Be too harsh with yourself
Tags: improvement, liar, awareness
Published: 2022-05-23 08:43:38

Sometimes, I get involved in activities for not pure honest reasons. I do them because of my ego, my success, or my earnings.

So, meanwhile, I declare to want to improve the world, in the fact, I'm pursuing my own interests.

So, when I become aware of this aspect of my behavior then I feel unmotivated, I see myself as a liar. 

Then, I promise to not do it anymore but inevitably I fall into the same mistakes again and have the same unmotivate liar-base process.

Does this mean I'm not improving? Of course, not. Only that the path toward improvements is not linear. We have ups and downs, We have to repeat mistakes, and above all, we have to not give up.

Our genuine desires should emerge in the future and we will be revealed for what we are. And this time we should decide if to change or not and how.
Build Things And Learn. How Do You?
Tags: productivity, discuss, beginners, api
Published: 2022-05-23 08:41:49

---
title: Build Things And Learn. How Do You?
published: true
description: Whatever keeps you from building something, you better start removing it, because it also keeps you from learning.
tags: productivity, discuss, beginners, api
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oy48tnvek3oraz392xy1.png
---

A friend and colleague recently asked me how I choose side projects. I wasn't quite sure how to answer this, because I never thought too much about what I *should* do as a side thing. It's always been more about what I *want* to do. 
My recent project, a custom LED installation controlled through a Raspberry Pi (later an ESP8266), was brought to life because I wanted to learn about the producer side of APIs, how I would make controls available internally and on a public network, how to make it discoverable and document it. Things that I don't essentially need on my day job (a Program Manager on Developer Relations at Postman), but that would help me a lot with understanding challenges. 

That's how I learn. 

![Screenshot of an editor showing a snippet that details an API](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ywt34y2rfhh8bh02egr2.png)

The other part to it, the soldering, woodworking, breadboarding - that's a welcome alternation to working in front of a computer screen. And it emphasises how I emotionally attach to the actual learning and thus increases my productivity. 

What about you? How do you learn best?
Kodi video addons
Published: 2022-05-23 08:33:00

A short list of Kodi 19 (Matrix) repositories with video addons for popular video streaming platforms:

- [[CastagnaIT]](https://github.com/castagnait/repository.castagnait/raw/matrix/repository.castagnait-1.0.0.zip) → **Netflix**
- [[SlyGuy]](https://k.slyguy.xyz/repository.slyguy.zip) → **HBO Max**, Disney+, Showmax, Hulu & more
- [[Sandmann79]](https://github.com/Sandmann79/xbmc/releases/download/Repository/repository.sandmann79.plugins-1.0.4.zip)  → Amazon **Prime Video**
- [[mbebe]](https://mbebe.github.io/blomqvist/repository.mbebe.zip) → **CDA**, TVP, TVN, Polsat & more
Make your first open-source contribution
Tags: git, github, programming, opensource
Published: 2022-05-23 08:31:38

By doing open-source contributions, you will learn a lot. It allows you to become a part of the open-source community. It can be hard at the beginning, but it’s definitely worth it.

How do you make a pull request? How to ask the maintainers to merge it?

### Let’s start!
First of all, you should know the basics of git. You’ll need a GitHub account as well.
If you don’t have one, you can create it [here](https://github.com/).

### Step 1: Find a project you want to contribute to.
If you want to practice a little bit first, you can use this [demo repository](https://github.com/markodenic/git-demo).
Don’t worry, I created it for this purpose.

### Step 2: Fork the repository.
Once you’re there, click the “Fork” button.
This will copy the whole project under your GitHub user.
The link will look like this `https://github.com/<YourUsername>/git-demo`.

### Step 3: Clone the repository.
Open your terminal, and run the following command:

```      
git clone https://github.com/<YourUsername>/git-demo.git    
```
This will create a local copy of the repository.

### Step 4: Create a new remote for the upstream repository.
For this we will use the following command:

```
git remote add upstream https://github.com/markodenic/git-demo
```       
    
### Step 5: Create a new branch.
We can do this by running the command:

```          
git checkout -b my-branch
```     
    
This will create a new branch, and switch to it.

### Step 6: Add some code.
Now, the time has come, we actually add some code. 🙂
After adding the changes, you can check them by running `git status`.

If everything is as expected, we can add the code to the staging area:

```        
git add . 
```          
    
### Step 7: Commit your changes.
This is the last step before pushing the code to the repository.
Run the command:

```
git commit -m "Adding an awesome feature to my-branch"
```     
    
### Step 8: Push the changes to your repository.
Finally, we’re ready to push the changes.
git push is the command we need in this case. Let’s run it:

```
git push -u origin my-branch
```        
    
### Step 9: Create a pull request.
Once we pushed the changes to our repository, we are ready to open the pull request.
Go back to your repository and click on the “Compare and Pull Request” button.

If everything went OK, the maintainer of the repository will merge your pull request.

## Congratulations, you made your first open-source contribution!
### Quick recap:
1. Find a project you want to contribute to.
2. Fork the repo.
3. Clone the repository.
4. Create a new remote for the upstream repository.
5. Create a new branch.
6. Add your changes.
7. Commit your changes.
8. Push the changes to your repository.
9. Create a pull request.

See you on GitHub.
*If you have any questions, you can write me on  [Twitter](https://twitter.com/denicmarko) .*

### Join the newsletter.
I write monthly emails full of real-world web development tips and resources.
No spam, unsubscribe at any time. Subscribe  [here](https://www.getrevue.co/profile/denicmarko) .
Why do I like to learn?
Tags: develop, relationships, improvement
Published: 2022-05-23 08:18:14

I think I can't stop improving my knowledge. But why?

Why do I need to improve, more and more if this, in fact, leads me to dissatisfaction?

When do I feel satisfaction about what I know?

The problem is that I always feel as if I'm at the beginning. Even though I have covered a lot of roads: it's such as my knowledge is just a little. 

I don't have a clear understanding of what I'm doing and the environment surrounding me.

This is the problem. Is it such clearness reachable or am I confined always in the field of approximation?

I think the last is the correct one.

What I know is always an approximation of reality and I have to make peace with this.

Improvement is always necessary but it alone is not enough. What I miss are meaningful connections. And If I don't achieve this, I will be always dissatisfied and improvement won't save me.
Transpiler and Polyfill
Tags: javascript, babel, corejs
Published: 2022-05-23 07:08:19

## Transpiler
It is a type of compiler that takes code written in one programming language and converts it to another language that has a similar level of abstraction. An example of this is TypeScript, which transpiles TypeScript code to JavaScript.

Babel is a transpiler, check the online repl [Babel repl](https://babeljs.io/repl/#?browsers=defaults%2C%20not%20ie%2011%2C%20not%20ie_mob%2011&build=&builtIns=false&corejs=3.21&spec=false&loose=false&code_lz=Q&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=true&presets=env%2Creact%2Cstage-2&prettier=false&targets=&version=7.18.1&externalPlugins=&assumptions=%7B%7D)

Babel transforms our code into understandable code for browsers, especially the old versions 

for example, it transforms this code 
```js
let total = 10;
let sum = total ?? 100;
```

to 
```js
"use strict";

let total = 10;
let sum = total !== null && total !== void 0 ? total : 100;
```

So it means it transforms the new feature `??` Nullish operator to an understandable code for the browsers that don't know what is Nullish operator. 

That is known as a transpiler 

caveat: not every modern javascript feature can be transpiled. but these cases developers use another tool name `polyfill`, like promises and fetch 


## Polyfill
polyfill in general means we are going to write code which should work in the older browsers
for instance, look this example we want to use function `Number.isNaN` in our code, and we write this piece of code before use it. 

```js
// These method is a sample of making polyfill
if (!Number.isNaN) {
  Number.isNaN = function isNaN(x) {
    return x!==x;
  };
}
```

If you check `Number.isNaN` in the website [CanIUse](https://caniuse.com/?search=Number.isNaN), you will see the IE browser doesn't support it, but it works in new browsers. So with that piece of code we first check if it works on the browser or not, if it's not available, then we are writing an equivalent piece of code, so the code will not break on older browsers. 
You know there are lots of features and function like this if we want to write a polyfill for them.
Shall we write for all of them? Obviously, it's not possible.

So there are some famous libraries to manage it.
for instance, `core-js` is a polyfill library that supports almost all new features for all older browsers

you just need to install and import it, then write the code without worrying about the browser support

```js
import 'core-js/actual/array/from';       // <- at the top of 
import 'core-js/actual/set'; 

Array.from(new Set([1, 2, 3, 2, 1]));  

```

Let's have your reasons as well
Do you use SwiftUI for your Mac apps?
Tags: swiftui, swift, macos
Published: 2022-05-23 08:04:07

We are currently re-writing the UI of our [flash card vocabulary learning app Wokabulary](https://wokabulary.com) with SwiftUI.
Wokabulary is available for iPhone, iPad and Mac; so having a platform independent UI system saves us a lot of time.
However, we face quite a few challenges with SwiftUI especially on the Mac. For example performance of SwiftUI on the Mac is often worse than with AppKit (e.g. lists). Also the documentation for Mac specific features is very sparse and some things just cannot be done (e.g. customizable toolbars).

So we are wondering: **Are you using SwiftUI for your Mac apps in production? What Mac apps have you built or are you building in SwiftUI? What challenges do you face?**
Enjoy Programming-Themed Humor? Here's today's daily developer joke!
Tags: jokes, dailydeveloperjokes
Published: 2022-05-23 08:00:33

---
title: "Enjoy Programming-Themed Humor? Here's today's daily developer joke!"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e125969479bf.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_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:___ What did XHR say to AJAX when it thought it was being a Mean Girl?

___A:___ Stop trying to make fetch happen!
 -->
rm command removes the file, really?
Tags: linux, cli, shell, shred
Published: 2022-05-23 07:43:31

Do you really think that just doing rm "your file name" will remove the file completely? if **YES** you need to read this blog till end.

just do a 

```
rm --help
```
 and see the information, you will see a note there like this

> ![rm information](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ut2gqdnza23tbz6iweqf.png)

this note suggests to use the **shred** command so do I did

```
shred --help
```

![shred info](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/82kf6i2714tr8p0xxozh.png)

This seems like a good note and I was relaxed that my file will be removed completely now or at least will be harder to recover. and made my mind to use **shred** instead of **rm** from now but wait got this **CAUTION** in the end.

![shred cautuion](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wwx9bf0jlhv6cnjoh2pj.png)

at last I red a few blogs but could not find a command which does the JOB, can anyone suggest a better command than these two or a way to remove the file as I have some important credentials file which I need to remove completely ? 

Tell me in your answers [here](https://stackoverflow.com/questions/72344885/which-linux-shell-command-can-completely-remove-a-file-from-the-system-and-make).
JDBC Tutorial [Crash Course]
Tags: java, database
Published: 2022-05-23 07:43:10

Ever looked for a comprehensive intro to JDBC that is fun and entertaining at the same time? Then have a look at this brand-new episode of the "Marco Codes" YouTube channel: [JDBC Tutorial - Nice & Easy](https://youtu.be/KgXq2UBNEhA).

In this video, you'll learn how to use JDBC, i.e. the basic API that every Java program uses to access databases:

Understand what JDBC drivers are and where to get them. How to use an embedded H2 database, in addition to the usual suspects like MySQL or Postgres. Fire off SQL select, insert, update and delete statements from Java. And finally learn about connection pools and the overall Java database framework/library landscape. 

By the end of the tutorial, there won't be many questions left when it comes to accessing databases with Java.

👉JDBC Tutorial: Nice and Easy

{% embed https://youtu.be/KgXq2UBNEhA %}

Let us know what you think in the comments!
Learn React and Tailwind CSS - One Color Website With a Theme Switcher
Tags: react, tailwindcss, webdev, beginners
Published: 2022-05-23 07:33:50

In the following tutorial you will learn how to get started with Tailwind CSS in React by creating a one color website with a theme switcher.

Enjoy!

###Video tutorial 👇

{% youtube 6ZIBTPkaDVI %}
Send Multiple Email in Excel using Python
Published: 2022-05-23 07:24:30

Some time ago, Google suddenly change its policy for academic account limit on Google Drive where it used to be unlimited. At that time, I was working at some private university in Indonesia and we need to inform about 18K non-active users that their entire accounts were about to be deleted because some of the accounts has like 1TB of data in their drive. Apparently, some of them use their student google account for storing their full-time work. So we cannot just delete their entire hard work in a snap. 

So, my boss hands me an excel file consisting of email, academic state (active or not), and another private field that is irrelevant to mention in this article. What I needed to do was actually simple. I just need to read the excel using pandas, then send a pre-determine text about the situation.

## Read and filter Email

  
Let's pretend we have an excel/CSV file like in the picture named "student_email.xlsx"
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ax2vvnxze79rtdi1vs5s.png)
 
I use [pandas ](https://pandas.pydata.org/) to read the file

```python
import pandas as pd

df = pd.read_excel("student_email.xlsx")
```
After reading the file, we only need to get a non-active account. We can do this with pandas!

```python
is_non_active = df['acdm_state'] == "not_active"
non_active_df = df[is_non_active ]
```

Bear in mind, Google limit email 3000 recipient per day. So I did simple grouping for 20 email.
```python
email = []
t_email = []
count = 0
for i, row in df[is_non_aktif].iterrows():
    t_email.append(row['email'])
    if count % 20 == 0 and count > 1:
        email.append(t_email)
        t_email = []
    count += 1
email.append(t_email)
```

## Send the mail
The good news is python already had a smtplib as their standard library so I don't have to install it. 

In my case, every 20 mail I set a sleep timer for 60 seconds (my server is just old). 

```python
import smtplib, ssl
from email.mime.text import MIMEText
import time

for i in range(0, len(email)):
    sender = 'some@university.email.ac.id'
    receiver = email[i]
    
    user = 'some@university.email.ac.id'
    password = 'secretpassword'
    msg = MIMEText(
        """
        <h1>Your Email About to DIE!!!</h1>
        """, "html")

    msg['Subject'] = 'Bye Bye'
    msg['From'] = 'some@university.email.ac.id'
    msg['To'] = ", ".join(email[i])
    context=ssl.create_default_context()

    with smtplib.SMTP('smtp.gmail.com', port=587) as server:
        server.starttls(context=context)
        server.login(user, password)
        server.sendmail(sender, receiver, msg.as_string())
        print("%s mail successfully sent" % i)
    print("waiting")
    # break
    time.sleep(60)
```

You can see the flaw in my code that after 3000 emails were sent my code would break for the next 24 hours. I'm just lazy so I run the code every day and edited the range with the last index that it's been printed before. You can also set error handling at every time when limit is reached, the code would pause for 24 hours (the smart way).

## Conclusion
Python saved my a$$
Running OpenSearch locally on Windows 10/11
Tags: opensearch, windows11, devops, elasticsearch
Published: 2022-05-23 07:07:22

Important Links:

1. [OpenSearch Documentation](https://opensearch.org/lines/1x.html)


The reason I am writing this article even though the process of running OpenSearch is quite straightforward using docker-compose is because Docker Desktop on Windows is configured to use WSL2 backend by default. 

The problem with WSL2 backend is you do not get the Settings->Advanced option in the settings menu for Docker Desktop and hence you cannot change the default RAM usage by Docker Desktop more than 2GB(OpenSearch requires at least 4). So when you run `docker compose up`, it will fail.

Steps to run OpenSearch on Windows 10/11
1. Go to this link, https://opensearch.org/versions/opensearch-1-3-2.html , and download the docker-compose.yaml file.
2. Go to the settings for Docker Desktop->General. Turn "Use the WSL 2 based engine" OFF.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qhflg05oxvqhr1sp7hd4.png)
3. Wait for it to finish.
4. Once done, you will now get the Resources->Advanced option in Docker Desktop. Set the RAM to more than or equal to 4GB. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jk8i93krogn0fhhaugv0.png) 
4. Run `docker compose up` while inside the directory containing the docker-compose.yaml file we downloaded.
5. Access OpenSearch Dashboard on http://localhost:5601/


Thanks
How to Install R on Ubuntu
Published: 2022-05-05 10:08:33

The Advanced Packaging Tool (APT) that comes along with Ubuntu uses a file called sources.list to decide where to search for packages.

Before we can install R language, we need to inform Ubuntu to look into the CRAN R repositories and also add a public key for secure download.

1. Open the sources.list file(usually located at /etc/apt/sources.list) in a text editor and add the following line at the end
`deb https://<my.favorite.cran.mirror>/bin/linux/ubuntu <distribution>/`
For instance, If you are running Ubuntu trusty and want to use the RStudio CRAN mirror, the line would be

`deb https://cran.rstudio.com/bin/linux/ubuntu trusty/`
If you are lazy like all fineset programmers, you can do this directly from the terminal without having to open a text editor as

`sudo sh -c 'echo "deb http://cran.rstudio.com/bin/linux/ubuntu trusty/" >> /etc/apt/sources.list'`

2.** Authenticate the Ubuntu packages on CRAN**
The packages for Ubuntu that are stored on CRAN mirrors are all signed using a key with ID E084DAB9
We can download the public key from the Ubuntu keyserver using this ID and add it to our system using the command
`sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9`

**3. Update the list of available packages**
Since we modified the sources.list, we need to tell APT to download the packages that are available from the CRAN servers by running the command.
`sudo apt-get update`

**4. Download and install R**
Almost done. NOw, Just download and install the R package by running the command:
`sudo apt-get -y install r-base`
Open up the R console and issue the following command.
`$ R`
If there were no issues occured during installation. The R console should open successfully with information about your R package installation. You can also learn R via [r programming course](https://www.igmguru.com/data-science-bi/data-science-with-r/)
Getting Started with the Angular DatePicker Component
Tags: angular, webdev
Published: 2022-05-23 06:37:42

Learn how easily you can create and configure the Syncfusion Angular DatePicker using the Angular CLI command. This video also explains how to configure a few of the control’s basic features like setting specific date values, formats, and range restrictions for date selection. I will also show you how to convert Angular DatePicker to select only month. 

Product Overview: https://www.syncfusion.com/angular-ui-components/angular-datepicker

Download an example from GitHub: https://github.com/SyncfusionExamples/getting-started-with-the-angular-datepicker-component

Refer to the following documentation: https://ej2.syncfusion.com/angular/documentation/datepicker/getting-started/

Check out this online example: https://ej2.syncfusion.com/angular/demos/#/bootstrap5/datepicker/default

{% youtube tVCdgVol-uI %}
Weather App developed with React
Tags: typescript, react, opensource
Published: 2022-05-23 06:34:33

Weather App is a simple weather app developed in typescript using React, HTML and SASS. The app allows you to see the weather from your current location or another location around the globe using OpenWeather Api and Google Maps Api. Using One Call API the app displays the current weather, 24 hours and 6 days forecast. You can change the unit system from metric to imperial. The app is available in light and dark mode.

[DEMO with mock data](https://gheorghedarle.github.io/React-WeatherApp/)

![Light Mode](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2bacbhnmyihvhf08tsyy.png)

![Dark Mode](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pjowf84mymjopl7q4129.png)

You can find the full code [here](https://github.com/gheorghedarle/React-WeatherApp).

If you like this repository you can support me on [buymeacoffee](https://www.buymeacoffee.com/gheorghedarle).