teleren/devto huggingface dataset:
Top 5 DEV Comments from the Past Week
Tags: bestofdev
Published: 2020-04-07 18:00:29

---
title: Top 5 DEV Comments from the Past Week
published: true
description: Highlighting some of the best DEV comments from the past week.
tags: bestofdev
cover_image: https://res.cloudinary.com/practicaldev/image/fetch/s--7VrAA2ln--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://thepracticaldev.s3.amazonaws.com/i/qmb5wkoeywj06pd7p8ku.png
---

This is a weekly roundup of awesome DEV comments that you may have missed.  You are welcome and encouraged to boost posts and comments yourself using the **[#bestofdev](/t/bestofdev)** tag.

@robertorojasr offered a wonderful answer to **[Are newer developers pushed too exclusively towards web development?](https://dev.to/ben/are-newer-developers-pushed-too-exclusively-towards-web-development-2a9h)**:
{% devcomment nc4m %}

@sorxrob shared a sweet achievement in **[What was your win this week?](https://dev.to/jess/what-was-your-win-this-week-22af)**:
{% devcomment naje %}

@yaser talked about their personal experience as it relates to this global pandemic in **[Are you coding more in your spare time due to COVID—19?](https://dev.to/ben/are-you-coding-more-in-your-spare-time-due-to-covid-19-b8h)**:
{% devcomment nbec %}

@devpato hops in to the **[Describe the best manager you've ever had](https://dev.to/ben/describe-the-best-manager-you-ve-ever-had-336b)** thread to share their experience:
{% devcomment ne7g %}

@giovaniandrade talked about their choice in response to **[What library/language/tool wowed you with its developer experience?](https://dev.to/ben/what-library-language-tool-wowed-you-with-its-developer-experience-4dbm)**:
{% devcomment ndlm %}

See you next week for more great comments ✌
Do you ever need to equally compare numbers (floating points)?
Tags: computerscience, discuss
Published: 2020-04-07 17:54:04

I have long known of the existence of https://0.30000000000000004.com -- well, I don't care of bad precision in computerized floating points...

But I have never tried this,

```python
0.1 + 0.2 == 0.3
0.1 + 0.2 - 0.3 == 0.0
0.1 == 0.1 + 1e-26
```

Now, I know that floating point equality is broken in most programming languages. (I believe Lisp family are exceptions, if you use Fractions).

So, do you ever need to equally compare floating points? If so, what language do you use? And, do you need to write a comparison function, or is there a library for it?

This might be a such comparator,

```js
function eq (a, b, precision = Number.EPSILON) {
  const i = (n) => Math.round(n / precision)
  return i(a - b + 1) === i(1)
}
```
Navigating files in Linux
Tags: linux, beginners, tutorial
Published: 2020-04-07 17:48:52

---
title: Navigating files in Linux
published: true
description: learn the hierarchy
tags: linux, beginners, tutorial
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/3p98sah6ep0z2l3s61jr.jpg
---


On Linux, everything on the system is represented with a file---Keyboards, disk drives, robotic arms, running programs and the rest: All files. Naturally, a Linux system needs a lot of files---And a sensible way to organize them.

The File Hierarchy Standard (FHS for short) is the generally agreed upon way of organizing the files of a Linux system. I say "generally" because some systems *do* deviate here and there. Thus follows an outline of the FHS with some notes about those little idiosyncrasies in the form of a bulleted list. Each item represents a directory containing the items tabulated ahead of it.

* `/` "Root" Everything on the system.
   - `/bin` Essential binaries (Sometimes a link to `/usr/bin`).
   - `/boot` Boot loader files.
   - `/dev` Device files.
   - `/etc` System-wide configuration files.
   - `/home` Non-root user directories.
       + `/home/your-user-name` Your user directory.
   - `/lib` Essential libraries (Sometimes a link to `/usr/lib`).
   - `/media` Mount points for removable media (Alternatively, `/run/media`).
   - `/mnt` Temporarily mounted file systems.
   - `/opt` Optional application files (Standalone installers may use this).
   - `/proc` Process and kernel information files.
   - `/root` Home directory of the root user.
   - `/run` Run-time data since last boot.
   - `/sbin` Essential system binaries (Sometimes a link to `/bin`).
   - `/srv` Data served (*vis á vis* HTTP, FTP, etc.) by the system.
   - `/sys` Information about devices, drivers, and kernel features.
   - `/tmp` Temporary files. Your browser may cache web pages here.
   - `/usr` Read only user data: Applications and their libraries, mostly.    
       + `/usr/bin` User application binaries.
       + `/usr/lib` User application libraries.
       + `/usr/include` Development headers.
       + `/usr/share` Non-instruction user application files.
       + `/usr/local` Third-party user applications data.
   - `/var` Files expected to change frequently, caches, logs, spools, etc.
  
In your Linux journey, you may encounter all manner of unusual file system choices. [GoboLinux](https://gobolinux.org/at_a_glance.html), for instance, makes a distinct hierarchy for each program! And [NixOS](https://nixos.org/nixos/about.html) completely eschews the FHS in favor of modularity. We won't worry about all that here though. For the most part, Linux operating systems stick to the FHS. Where they do not, the variations are either slight or rigorously documented.
Use emoji as CSS Selector 😎💅
Tags: css, html, webdev
Published: 2020-04-07 17:48:44

Hi there, I hope everyone is doing well in this Corona time! 👋

Today, I uploaded a video on my YouTube channel.
I talked about a fun thing in CSS to make this corona time a bit lighter.

<h3>We can use emojis as CSS Selectors 😎</h3>

<strong>Don't try this at home(work 😉)</strong>

{% youtube mgaw30BQ6UA %}

Also, please subscribe to my Channel here <strong>https://www.youtube.com/channel/UCy5EgfydCQlVv_AM-FZyYcg </strong>


See you in my next article!

Till then,
Cheers!
:wave:
Malayalam language in Debian-11-KDE
Tags: malayalam, debian, tutorial
Published: 2020-04-07 17:36:57

# Intro
Malayalam is the language spoken in Kerala state of India (My mother tongue by the way). This is a small tutorial about installing language for typing in Debian-11 Bullseye (KDE). Also, some configuration steps.

# Installation

Everything is there. Just install it.
```bash
sudo apt install ibus ibus-m17n m17n-im-config ibus-gtk3
```

Logout. (Important, otherwise next stop will not work).

Login again, setup
1. `Alt+F2` >  ibus-setup (IBus Configurations)
2. Add malayalam language as follows
Select Input Method > Add > Click (:) like button > Malayalam > Select Swanalekha

Repeat above for all Malayalam inputs.

# Running daemon

Running IBus

If IBus doesn't automatically startup at login then you need to add it to startup applications list.

    Open System > Preferences > Startup Applications
    Click on the "Add" button
    Write command as: "ibus-daemon"
    Click on the "Add" button 

# Usage

Short cut to switch language is `Super/WinKey+Space`. Easily switch and use.
I like സ്വനലേഖ. Because, transliteration (phonetic based) is much easy to get started. 

# Test Drive (First in title നോക്കട്ടെ)

പ്രത്യേകം.. പറയാ‌ന്‍ ഒന്നുമില്ല .. പൊളി സാന

# Reference
സ്വനലേഖ (Transliteration, I like it, it's very easy to start)
https://wiki.smc.org.in/സ്വനലേഖ

ഇന്‍സ്ക്രിപ്റ്റ് രീതി (The top quality, one I want to learn)
https://wiki.smc.org.in/ഇന്‍സ്ക്രിപ്റ്റ്

Other related stuff, I didn't tried.
https://wiki.smc.org.in/പറയുംപോലെ
https://wiki.smc.org.in/വര്‍ണ്ണം
https://wiki.smc.org.in/ടക്സ്_ടൈപ്പ്
https://wiki.smc.org.in/Payyans

https://subinsb.com/varnam-easily-type-malayalam-indian-languages/
https://swanalekha.smc.org.in/#linux
https://wiki.smc.org.in/പ്രധാന_താള്‍
https://wiki.smc.org.in/Dictionary

http://www.space-kerala.org/
https://help.ubuntu.com/community/ibus
Python-Programming
Tags: python, news, gratitude
Published: 2020-04-07 17:34:46

Let’s start coding with Python…!

Python is an interpreted, high-level, general-purpose programming language. Created by Guido van Rossum and first released in 1991, Python’s design philosophy emphasizes code readability with its notable use of significant whitespace.

To be able to see all post, you will need to click into this medium article: https://medium.com/the-last/python-programming-8e2056452b57
Using xUnit to Test your C# Code
Tags: dotnetcore
Published: 2020-04-07 17:30:21

---
title: Using xUnit to Test your C# Code
published: true
description: Creating unit tests and integration tests with xUnit for C# applications.
tags: #dotnetcore 
canonical_url: https://auth0.com/blog/xunit-to-test-csharp-code/
---
TL;DR: This article will guide you in creating automated tests with xUnit for your C# applications. You will learn the basics of automated tests and how to create unit and integration tests.

[Read on 📖](https://auth0.com/blog/xunit-to-test-csharp-code/?utm_source=dev&utm_medium=sc&utm_campaign=xunit_test)
Caveats while Building Mobile Website using Vue/Nuxt
Tags: vue, frontend, css, javascript
Published: 2020-04-07 17:26:23

---
title: Caveats while Building Mobile Website using Vue/Nuxt
published: true
description: Mobile Website
tags: vue, front-end, css, js
---

While building a mobile website, you'll encounter a lot of roadblocks. I'll try to list all of them here, while I learn more about them.

1. One of the biggest caveats is everything feels slow in android firefox & iOS safari. And the reason for it is that on each click, **the browser waits for around ~300ms to know whether it was a single or double click**.
Solution & More about it here: https://stackoverflow.com/a/21062165/2963579

2. URL Bar Resizing - Different vh for a fixed element on a scroll.
Solution & more about it here:
https://dev.to/peiche/100vh-behavior-on-chrome-2hm8 

3. /deep/ property is not fully supported by all browsers.(at least firefox), so avoid using it.

4. when the user taps on any text, the text is searched on google.
make user-select: none for mobile. (don't do for desktop, as the user won't be able to select anything)

5. `position: sticky` behaves very differently in mobile chrome & firefox, avoid using it.

6. On mobile, v-model="keyword" will not updated until you press space.
https://github.com/vuejs/vue/issues/8231
Attending remote conferences
Tags: career, webdev, discuss
Published: 2020-04-07 17:17:04

During these tough times when we're pretty much all of the time inside the house, why not use it productively? 

I have started to attend remote conferences (My first conferences relating to tech & code ever) & most of them are conferences that I wouldn't have been able to attend otherwise, due to travel and  conference ticket costs.

I have plans to attend **Python Pizza Conf 2020**, **PyCon 2020** (it's not really a conference, but they are posting recorded talks, tutorials, summits & more), **GitHub Satellite 2020**, **RedisConf 2020** & **DockerCon 2020 LIVE with theCUBE**.
check out best CSS BUTTON HOVER EFFECTS
Tags: career, webdev, python, javascript
Published: 2020-04-07 17:06:09

---
title: check out best CSS BUTTON HOVER EFFECTS
published: true
description: CSS BUTTON HOVER EFFECTS
tags: career,webdev,python,javascript
---
<h1>check out More Example</h1> [www.gscode.in](https://gscode.in/css-button-hover-effects/)

<p>A few examples of flashy hover effects. Currently updating this pen. Work in Progress</p>

{% codepen https://codepen.io/davidicus/pen/emgQKJ %}


<p>Watch interactive video on Scrimba: <a 

{% codepen https://codepen.io/comehope/pen/PdaNXw %}

<p>First version <a href="https://codepen.io/aaroniker/pen/bGGVMbY" target="_blank">https://codepen.io/aaroniker/pen/bGGVMbY</a></p>

{% codepen https://codepen.io/aaroniker/pen/abzbRvo %}


{% codepen https://codepen.io/aaroniker/pen/WaJdNv %}

<h1>check out More Example</h1> [www.gscode.in](https://gscode.in/css-button-hover-effects/)
GUI to Docker Containers
Tags: docker, gui, mongodb, robomongo
Published: 2020-04-07 17:05:24

One of the main things you would like to do when you are running Docker containers is communicating with them. Although there are tools like **kitematic** which provide a GUI interface to use docker, we still somehow stick to the **CLI** version. 

# Docker in brief
In brief, a container is an encapsulated version of your source code along with its dependencies. Think of it as a box of the good stuff which will run everywhere. The host OS talks to the container which in turn allows you to access it via the host OS.

Start by showing all containers in your system at present - 

```
docker container ls
```
The leftmost part will show you the **Container Ids**

Now, what if you want to access it directly. Sure there are CLI commands for that - one such being 

```
docker exec -it <containerId> bash
```

But how about a GUI client. Well below is a small workaround.

```
docker inspect <containerId>
```

This gives you a json as follows 

![Mongo Container](https://dev-to-uploads.s3.amazonaws.com/i/bzja71jykwg2paghd9e9.jpeg)

What you will need is the **IPAddress** part. Just copy that IP address and go to your GUI client and paste it there. 

![robomongo](https://dev-to-uploads.s3.amazonaws.com/i/fdcpc3bh5je1at7cfdlh.jpeg)

For eg. I was using a mongo container in the above picture. And below is a screen of the robomongo GUI connecting to the container. 

![Robo connected](https://dev-to-uploads.s3.amazonaws.com/i/djqqyi7qpyyayadujwwm.jpeg)

I hope it helps!

***PS: Use the VSCode's awesome docker extension. Makes life super easy***

Happy coding :D
Stay safe everyone
COVID-19 Tracker for Panama made in React.js.
Tags: react, webdev, javascript, corona
Published: 2020-04-07 16:49:49


Hello everyone.

So, I made a COVID-19 tracker. Yes, yet another COVID-19 tracker hahaha. However, I made it specifically with information from my home country Panama. Perhaps you are not from Panama and chances are you don't even speak Spanish, but I wanted to share anyway.

I got my inspiration from all the hardworking people in my country right now, everyone is doing what they can do to help. I also got inspired by all the amazing work in this community during these hard times. 

Here's the URL: https://protegetepanama.com/

The website is a SPA made using React.js. Other tools include:
- Charts: react-chartjs-2 (https://github.com/jerairrest/react-chartjs-2)
- Navbar: react-burger-menu (https://github.com/negomi/react-burger-menu)
- Navigation Tabs: react-swipeable-views (https://github.com/oliviertassinari/react-swipeable-views)
- Notifications: react-toastify (https://github.com/fkhadra/react-toastify)
- Twitter Feed: react-twitter-embed (https://github.com/saurabhnemade/react-twitter-embed)
- UI Library: reactstrap (https://reactstrap.github.io/)
- Hosting: Firebase Hosting (https://firebase.google.com/products/hosting)

It's by no means the best React.js application but I think it came out pretty good. I wanted to make something simple and practical to help the people in my country find all the relevant information easily.

If you can please take a look.

Johnny Navarro
Laravel Developer Roadmap 2020
Tags: laravel, php, webdev
Published: 2020-04-07 16:44:32

Hey Laravel enthusiasts 👋, trying to put up a roadmap for "How to become a Laravel developer in 2020". Aim is to put up a straightforward sequential topics that one may need to learn to become a skilled Laravel developer so that beginners can easily figure out what to learn next. I've put up a basic layout but need more input from expert of the communities to make it more useful.

{% github hasnayeen/laravel-developer-roadmap-2020 %}

Let me know how can I improve this. Thanks!
Using Postman with Java Spring and CSRF Tokens
Tags: springboot, postman, csrf, xsrf
Published: 2020-04-07 16:40:42

---
title: Using Postman with Java Spring and CSRF Tokens
published: true
description: Java Spring CSRF Tokens VS. Postman, Who will win? 
tags: springboot, Postman, CSRF, XSRF
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/zjzg40frzfgwke0u9rkb.png
---

Java Spring will return a `403 Forbidden` if any request besides a `GET` request is missing a Cross Site Request Forgery Token (CSRF Token) in the `X-XSRF-TOKEN` Header. Here is how to fix that issue when using Postman. I have seen people online suggest that you disable CSRF Tokens but please don't do that. That is silly. Those people are sily. 


# Creating an environment

We need to create an environment in which to store our `CSRF Token`
- In the top right of Postman, click the cog.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/frzzfll8gvrz960inwuk.png)

- In the Pop Up window, Click `Add`
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/3uj3nmamli2hl9d9w7me.png)



- Enter an appropriate `Environment Name`
- Enter `xsrf-token` in the first column.
- Click `Add` in the bottom right corner

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

- Ensure your environment is selected in the drop-down in the top right.


# Getting the CSRF Token

`GET` requests do not require a CSRF Token to be allowed through our `SpringSecurityConfig`
- Create a `GET` request
- Navigate to the `Tests` tab
- Enter `pm.environment.set("xsrf-token", decodeURIComponent(pm.cookies.get("XSRF-TOKEN")));`
 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/zhxk5toyzly5o8pp3jsn.png)

Now when you call this endpoint in Postman, your CSRF Token will be stored in your environment variables.



# Using the CSRF Token
- Go to your request that requires the CSRF Token
- Navigate to the `Headers` tab
- Enter a key of `X-XSRF-TOKEN` and a value of `{{xsrf-token}}`, the `{{xsrf-token}}` value will be populated from our Environment we created earlier. 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/tsyur8aa0q0sek13xepi.png)

Your request should now be from from CSRF errors

# Things to watch out for
- Be sure you have actually selected an Environment. I have forgotten to do this several times.
- Be sure to call the `GET` request again to populate the value in case it has become invalid or has expired.
- Have a nice day
About Ruby Hash::try_convert
Tags: ruby, hash, documentation
Published: 2020-04-07 16:34:20

---
title: About Ruby Hash::try_convert
published: true
description: 
tags: ruby, hash, documentation
---

Get more information and more examples at my AboutRuby project:
* [AboutRuby project](https://github.com/BurdetteLamar/AboutRuby/blob/master/core/Hash/api/markdown.md#try_convert)

Here's the write-up over at the Ruby project:
* [Ruby project](https://ruby-doc.org/core-2.7.0/Hash.html#method-c-try_convert)

My main page is [here](https://github.com/BurdetteLamar/AboutRuby#about-ruby).

TL;DR

I've been working on enhancements to the documentation for the Ruby project.  Getting these enhancements posted to the Ruby project has been very slow.  They're not actually meeting resistance;  I know because my many PRs for enhancing class ENV were accepted (though not rapidly).  It's just that everyone is busy.

Anyhow, I'm stashing all this stuff on in my own project, called AboutRuby.  The piecemeal migration from there to the Ruby project is not going to be completed in my lifetime (I'm 77 years old).

So:  I'm going to blow my own horn here on DEV, to encourage you to use the enhanced documentation.
react-particles-js 3.0 masking background with tsParticles
Tags: react, javascript, typescript, showdev
Published: 2020-04-07 16:17:00

A sample of what [react-particles-js](https://github.com/Wufe/react-particles-js) 3.0 can do with [tsParticles](https://github.com/matteobruni/tsparticles)

These are particles revealing the background. Easy to do, it's all in the Particles config!

{% codesandbox react-particles-js-masking-background-vz4eq %}
Hello World from WayScript
Tags: beginners, python, startup
Published: 2020-04-07 16:15:18

Hi All - I'm new to the the DEV.to community and looking forward to connecting with everyone. We've been quietly building a new rapid development platform built specifically for developers. 

I'll be posting some tutorials here, asking for some input along the way and providing support to all of you when I can. 

As my first post, I just wanted to welcome everyone to [sign-up for for Free WayScript(beta)](https://wayscript.com/) and give it a whirl and let us know what you think. GA is planned for June-ish, but our beta has hundreds of active developers building great tools already. Enjoy!

Stay safe. Stay at home (for now)

Plenty of scripts and examples are listed on or website if you need help.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8h24k970ex4f2xaf1xy9.png)
If you were to start a new open source project What Problem will it be addressing Or what innovation will it bring to humankind.
Tags: discuss
Published: 2020-04-07 16:14:03

---
title: If you were to start a new open source project What Problem will it be addressing Or what innovation will it bring to humankind.
published: true
description: 
tags: discuss
cover_image: https://www.azosensors.com/images/Article_Images/ImageForArticle_775(1).jpg
---

Many technologies have been invented but still we are far far away from perfecting the information age era there is still more room for innovation.
Counting max values peaks of signals EEG
Published: 2020-04-07 16:06:48

Hello, 

I am facing problem. I want to count how many peaks are reached during one second of each EEG signals, I am using data from .edf file. I have written count function but not working well.


def count(self,data):
		# Count max values of each signal and displat it into dialog
		total_point = 2000
		total_time = 20
		max_value_peak = total_point / total_time
		self.data = data
		max_point = 100 #plots 100 points in one sec. So find max of every batch of 100 points
		point = 0
		k_point = 0
		max_peak_counter = 0
		while point <= total_point:
			if len(data)>max_point:
				if point == max_point:
					print('data length', len(data))
					print('k_point', 'max_point', k_point, max_point)
					print("Max Points in Signal are....",np.max(data[k_point:max_point]))
					max_peak_counter += 1
					k_point = k_point + 100
					max_point = max_point + 100
				point+=1
			else:
				break

		self.total_peak = QtWidgets.QLabel('Total Peak: %s' % max_peak_counter)
		self.total_peak.resize(50,32)
		grid.addWidget(self.total_peak,3, 1)