teleren/devto huggingface dataset:
Just Start that YouTube Channel - Don't think - I'm  an Accidental Youtuber
Tags: productivity, tutorial
Published: 2019-11-15 01:01:14

August 16th,2016 a Java Developer stepped into Big Data world. Someone said to him that he might need to wrap his head around the Hadoop Eco System. Udemy was not this famous back then, Youtube was but keeping in mind his teammates this guy created a "How to Install Hortonworks On Mac". This guy was me, I uploaded it and 1 more video on Cascading into my personal channel and shared the link to my teammates. 2 things happened here, I forgot to make to my uploads Unlisted and I forgot this for the next 5 months.

Happens to be that this is the same channel I used to upload my kid's funny memories and share it with my parents as unlisted videos and remove them after a while.

My mom called me in December 2016 and said I have a couple of videos and people have asked questions in comments. I was like WHAAT? That's the spark. It's now a Hobby, I even made 1$ and then came Youtube's monetization policy.

My publishings are towards a very narrow audience and people have watched my content from almost all the countries and I get at least 5-10 views a day. Each year I gain ~100 subscribers starting from 2017 and now I have ~371 subscribers. I publish only when I want to publish and even if there are 1000 other similar videos I just believe that I have my signature when I upload. I know that I'm not PewDiePie but I have this Url is my Resume now and I have seen the hiring team talk about the same during my interviews, they do visit. 

I know that many of you have this slightest idea but have this hesitation to do it or not. My advice - Just do it.

https://www.youtube.com/channel/UCcgj6uLmNPWLuBzfzDAgkZA 

I decided to write because today my channel's lifetime view crossed 100,000 views that's a big deal to me. I know a single video of Duck chasing a Squirrel will get a million views easily in a day but the thought that your work/voice/face is enabling someone somewhere in countries where you are pretty sure you will never visit in your life is kind of fascinating to me.

Just do it, you will not know what you will reap but definitely there is no downside to it.



Vinodh
Python Tears Through Mass Spectrometry Data
Tags: python, science
Published: 2019-11-15 02:03:56

{% youtube D5YQ3ZLESZM %}

At the November 2019 Python Frederick event, Conor Jenkins showed the group how mass spectrometry works and how Python saves huge amounts of time when processing the large amount of data produced by a mass spec analysis.

Questions? Feel free to mention me on Twitter at [@mblayman](https://twitter.com/mblayman) so I can try to respond to your question.

This article first appeared on [mattlayman.com](https://www.mattlayman.com/blog/2019/python-mass-spectrometry/).
Day4:From & Display & FromStr traits - 100DayOfRust
Tags: rust
Published: 2019-11-15 01:40:40

## 1, `From` trait

After you defined the `From` trait, you can convert a type A to B by calling `B::from(A)` or `B = A.into()`


```rust
use std::convert::From;

#[derive(Debug)]
struct Number {
    num: i32
}

impl From<i32> for Number {
    fn from(item: i32) -> Self {
        Number {num: item}
    }
}

fn main() {
    let i = 5;
    let num1 = Number::from(i);
    let num2: Number = i.into();
    println!("num1: {:?}, num2: {:?}", num1, num2);
}
```

Result:
```
num1: 5, num2: 5
```

## 2, `Display` & `FromStr` trait

The `Display` trait will be used when print an object, e.g. `obj.to_string()` or `println!("{}", obj)`; 
The `FromStr` will be used when trying to convert a string to the target object with `parse()` method

```rust
use std::fmt;
use std::str::FromStr;
use std::num::ParseIntError;

struct Point {
    x: i32,
    y: i32,
}

impl fmt::Display for Point {
    fn fmt(&self, f:&mut fmt::Formatter) -> fmt::Result {
        write!(f, "Point ({}, {})", self.x, self.y)
    }
}

impl FromStr for Point {
    type Err = ParseIntError;
    
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        let tuple: Vec<&str> = s.split(",").collect();
        let x = tuple[0].parse::<i32>()?;
        let y = tuple[1].parse::<i32>()?;
        Ok(Point {x:x, y:y})
    }
}

fn main() {
    let p1 = Point {x:1, y:2};
    let p2: Point = "3,4".parse().unwrap();
    println!("P1: {}\nP2: {}", p1, p2);
}
```

Result:
```
P1: Point (1, 2)
P2: Point (3, 4)
```
Creating a Link Highlighting Effect with CSS
Tags: css, codepen
Published: 2019-11-15 00:56:23

I was recently working on project where I had to create a link style that would highlight when hovered over. On hover, the highlight would appear from left, and then disappear on hoverout to the right, sort of like passing over the text. I also needed to change the color of the text, and I wanted to set it up so that it would happen as the highlight passed over the text.

My first iteration was done very simply with a pseudo element that had a red background and would go from a width of `0%` to `100%` on hover, and I would also change the position from setting it on the left to the right in order to create that passing effect:

{% codepen https://codepen.io/LegendOfLuis/pen/MWWPdRa %}

It worked well for links that didn't break into two lines, but that's not always going to be the case. As you can see in the second link that takes up two lines, the psueudo element can't do the same since it's set to a block element, so I had to find another solution.

After some digging around, I found a great way to handle this using linear gradients and no pseudo elements:

{% codepen https://codepen.io/LegendOfLuis/pen/BaaqgRX %}

How does this work? The linear gradient just goes from red to red so it's not really a gradient. Why don't I just use a background color? That's because gradients are considered background images in CSS, allowing us to use the `background-size` property to control the size of the gradient, which you can't do with background colors. This gives us that nice, smooth effect of a highlight with very little code.

The last item I wanted to setup was to make the text change color as the highlight moved over it. As it's currently setup, the text just transitions from red to black on hover with no sense of the highlight behind it. This can be very easily done using `mix-blend-mode` on a span element inside the anchor tag. Since the background color is the same as the text color, setting `mix-blend-mode` to `difference` will give us a black text color on hover:

{% codepen https://codepen.io/LegendOfLuis/pen/BaaqgKe %}

In order for `mix-blend-mode` to work, a `z-index` needs to be set on the anchor to setup the correct layering for the blend. With all of this, the entire effect can be achieved with very few lines of code:

```
a {
  color: red;
  text-decoration: none;
  
  position: relative;
  z-index: 1;
  padding: 3px;
  margin: -3px;
  
  background: linear-gradient(to right, red, red) no-repeat right;
  background-size: 0% auto;
  
  transition: background-size 0.3s, background-position 0s;
 
  &:hover {
    background-size: 100% auto;
    background-position: left;
  }
  
  span {
      mix-blend-mode: difference;
  }
}
```

Gradients are quite versatile, and I'm sure I'll be using this concept to create a few other interesting highlight effects in my projects.
How to Use Tabs in vim
Published: 2019-11-15 00:39:28

---
title: How to Use Tabs in vim
published: true
description: 
tags: 
---

I started using tabs just recently in `vim` and found it pretty useful.


Create 
======

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/4leem1mya1czcxjof9fc.gif)

There are many ways to create a new file on the command line.  

In `vim`, you can start to create a new file using tabs with the following:

Type `:tabnew` and then hit `ENTER`

On my Mac, this drops me into the editor in *insert* mode.    
You may need to enter *insert* mode manually (i.e. hit `i`).

Type away to your heart's content!

To write the file:
Hit `ESC`
Type `:w file_name` and then enter. 


Open
====
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/5n2d4ikj27609ilbkqus.gif)

Open an existing file using `:tabe name_of_file`.

Be mindful of your spelling because if `name_of_file` doesn't exist, `vim` will open a tab with an empty buffer as though you were trying to create a new file.   


Navigate
========

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/8ytbvqdy3sn68jjek0wz.gif)
In *command* mode (hit `ESC`):

Navigate forward between tabs with `gt`. 
Navigate back using `gT`.
Devoxx: a learner journey 
Tags: java, javascript, quarkus, devops
Published: 2019-11-15 00:21:39

I have attended the #devoxxma event which has been hosted in Agadir, a beautiful city of Morocco in the Atlantic Ocean.
The main event consists of conferences handed by people working on big IT companies such as IBM, RedHat, Twitter, Facebook, Oracle and so on. 
To be honest, I couldn't be present in all the conferences because most of them occur at the same time. But, I tried to attend the maximum of shows I could, prioritizing them by the relationship with the field of work I'm in. 
Among the things I have loved is the choice of the city which is amazing, with a good weather, about 20°C, and also the organization team who provided us with all the information and the tools we needed to accomplish this journey.
As a learner, I will summarize the keynotes of the topics I have attended :

- Optimize your compiler may decrease the electricity consumption, and then you will win on both sides: you will preserve energy and the benefits of your company will increase. This was the main idea of the conference handed by **Chris Thalinger** who works for Twitter. 
- A snapshot of 10 ways by which you can secure your web application : presented by **Matt Raible**, a java champion and a developer advocate at Okta, going through the layers of an http application that has to use https whenever it comes possible, enable the CORS and CSRF to prevent attacks, and also hash passwords after inserting them into a database. 

- Work with CI/CD just by using .yml configuration files of the Jenkins pipeline : it was a presentation of **Anas Moutaki** and **Ayoub Ed-dafali** who are both devOps engineers at **SQLI**. It was essentially about how to configure and automate the Jenkins builds as a code in order to have our applications up and running within few minutes. 
- Using quarkus by **RedHat** to ensure the start of web applications within milliseconds! : **Edson Yanaga** was rockibg with his special topic about the quarkus pluging and how it can enable java web app developers to let go off all the frameworks they may use and focus on the one who is promising the sustainability of java as programming language in the upcoming years, not just because it is robust, but all the inconveniences of slowness will disappear. Quarkus supports **spring** annotations, it supports also orms JPA and hibernates. 
Now, one can code and see his changes withing no time (about 200 milliseconds in a bad day, says Edson 😁). 
- Create a modern web applications with java using eclipse microprofile and liberty plugin with **Sebastian Daschner**, a java advocate at IBM who handed a good session about how the world of web apps will look like in the future.
How to use CanellationToken With ICommand A Solid Implementation of ICommand
Tags: androidappdevelopm, asynchronous, csharp, xamarin
Published: 2020-03-30 19:30:37

---
title: How to use CanellationToken With ICommand A Solid Implementation of ICommand
published: true
date: 2019-11-15 00:10:37 UTC
tags: android-app-developm,asynchronous,csharp,xamarin
canonical_url: 
---

![](https://cdn-images-1.medium.com/max/1000/0*7M9y-4W6Fj1lursy.png)

This article can be considered a part 2 of [Async Command A Modern Implementation of ICommand](https://medium.com/@csharpwriter/async-command-a-modern-implementation-of-icommand-1933ca6ea9a5) in which we were addressing the async problem in ICommand by blocking the CanExecuteStatus to false in case the previous task was not yet completed.

In this article, we will address the same problem using a different way we will use CancellationToken to cancel the pending task and execute the new one, imagine you have a news app where the user should click on one title in a listview the app will download the news article and will show it, what happens when the user clicks on a title and before the download complete he clicks on another one.

{% gist https://gist.github.com/TheFo2sh/f2155b1855438d3b02834140f66a9bf8 %}

And you can use it in your ViewModel like this

```
CommandAsync<Uri> commandAsync = new CommandAsync<Uri>(async (uri,cancellationToken)=>await client.GetAsync(uri,cancellationToken));
```

or can be simplified to this

```
CommandAsync<Uri> commandAsync = new CommandAsync<Uri>(httpclient.GetAsync);
```
Rails ActiveStorage transcoding videos
Tags: help, rails, activestorage, transcoding
Published: 2019-11-15 00:07:21

So far I have googled everything I could think of and still haven’t found an example of transcoding videos with ffmpeg using active storage. All examples were related to generating thumbnails from videos, but not transcoding mp4 video into another mp4 video.

Starting to think if it’s possible at all. Anyone have experience with this or I need to go back to paperclip?
#30DayMapChallenge: 30 days building maps (2) - tmap
Tags: r, rstats, rspatial, tmap
Published: 2020-06-09 14:38:27

---
title: #30DayMapChallenge: 30 days building maps (2) - tmap
published: true
date: 2019-11-15 00:00:00 UTC
tags: r, rstats, rspatial, tmap
canonical_url: https://statnmap.com/2019-11-15-30daymapchallenge-building-maps-2-tmap/
---

The #30DayMapChallenge was initiated by Topi Tjukanov on Twitter. This is open to anyone who would like to show a map, whatever the software is. In this blog post, I will show maps made with R. I add constraints to myself for fun. This week, I will use {tmap} to create maps.This follows previous week blog post: #30DayMapChallenge: 30 days building maps (1) - ggplot2 

## Packages 
```r
library(dplyr) 
library(sf) 
library(raster) 
library(readr) 
library(tmap) 
library(xml2) 
library(purrr) 
# remotes::install\_github("tylermorganwall/rayshader")
 library(rayshader) 
## Customize 
my_blue <- "#1e73be" 
# Test for font family 
# extrafont::font_import(prompt = FALSE) 
font <- extrafont::choose\_font(c("Nanum Pen", "Lato", "sans")) 
```
## Data  
Get World data in {tmap} package  
Get France shapefile Transform France into a regular grid of hexagons 

See more: [#30DayMapChallenge: 30 days building maps (2) - tmap](https://statnmap.com/2019-11-15-30daymapchallenge-building-maps-2-tmap/)
How to find a document in mongo using the partial value of a field
Tags: mongodb, showdev, webdev, tutorial
Published: 2020-01-16 17:17:57

---
title: How to find a document in mongo using the partial value of a field
published: true
date: 2019-11-15 00:00:00 UTC
tags: ['mongodb', 'showdev', 'webdev', 'tutorial']
canonical_url: https://learnwithparam.com/blog/case-insensitive-query-in-mongodb/
---

> I have my new FREE workshop on *API design for beginners using Node Js and MongoDB*. It is my first workshop, let's learn together. You can register for the workshop [here](https://www.eventbrite.com/e/api-design-for-beginners-using-node-js-and-mongodb-english-tickets-89601978931) 

MongoDB find syntax is pretty simple. Lets have a collection named `users` and find all the documents in the collection,

```js
// Query
db.users.find({});

// Result
[
  {
    email: 'one@email.com',
    name: 'One for like and comment',
  },
  {
    name: 'Two for Comments',
  },
  {
    email: 'three@email.com',
    name: 'Three for Like',
  },
];
```

If we need to filter by some field then,

```js
// Query
db.users.find({ name: 'One for like and comment' });

// Result
[
  {
    email: 'one@email.com',
    name: 'One for like and comment',
  },
];
```

What if we need to filter by the field but we don’t know the exact case or exact value. Let’s see the example

- list all the document which has a word `like` in the field `name`

#### Filter document using regular expression

It can be easily achieved using regular expression instead of string value,

```js
// Query
db.users.find({ name: /like/ });

// Result
[
  {
    email: 'one@email.com',
    name: 'One for like and comment',
  },
];
```

Here `/like/` is the regex which will find all the word which match `like`. But this query is case sensitive. It won’t match `Like`. But its very easy to write case insensitive query,

```js
db.users.find({ name: /like/i });

// Result
[
  {
    email: 'one@email.com',
    name: 'One for like and comment',
  },
  {
    email: 'three@email.com',
    name: 'Three for Like',
  },
];
```

Adding `i` at the end of regex denotes match the word irrespective of the case. (uppercase, lowercase, etc).

We can use any regex-based search to filter the values in MongoDB. We will learn more regex and MongoDB tricks soon.

MongoDB is very powerful and it provides a lot of methods to query what you exactly want. Hope you find this tutorial helpful 🤗

> Follow me on [twitter](https://twitter.com/learnwithparam). I share my reading list and short tips on twitter
Day 34 : Speed
Tags: hiphop, code, coding, lifelongdev
Published: 2019-11-14 23:17:20

_liner notes_:
- Professional : Got some things started and done. I have not heard back on my solution for the community members question, so I'm hoping that it worked. haha. Made some headway through making a process that a user can remix the Glitch project, enter in some details and create their own Application. Took a lot longer than I realized. Ran into some issues getting things to work. I've never done this kind of thing before. Going to keep working on it after the meetup.

- Personal : Last night I was able to cycle through the markers on the map for my Sapper/Svelte side project. Only thing is that the map tiles take a while to load in while the map transitions from marker to marker. Going to see if there is a way to speed it up, especially if a person is viewing the site on a slower connection. Also worked a little on the radio show. Probably won't be able to get to work on anything tonight because I'm going to the OrlandoJS and may live stream it. I want to demo the Vote by Phone application I made and see how it handles if a bunch of people are using it at once.

![Mountain landscape of Hoher Kasten, Appenzell Alps, Switzerland](https://thepracticaldev.s3.amazonaws.com/i/erxhf0jaacbifzwmezi8.jpg)

Tomorrow, I want to have the setup process worked out for my new application and maybe start the admin section of the application.

Came downtown early so that I wouldn't have to fight traffic to go to the meetup. Been in the library doing work. Going to head to the meetup now to set up.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube Wx5YJK4BocY %}
#200in4days, Update 1
Tags: beginners, 200in4days
Published: 2019-11-14 22:24:21

---
title: #200in4days, Update 1
published: true
description: While I got over my limitation, I did not earn a penny
tags: #beginner, #200in4days 
---

So far I have produced some sketches for a board game with lots of cards that need to be created, balanced for play and designed.
The game is something I have wanted to start a long time ago.

It is based on a problem that needs to be solved. I also want to create value in terms of an educational game about business. As a bonus I want to learn business along the way.

As a model of reality the portrayal of business in The Cashflow of the Kiyosaki empire is a game that suffers from relying on a mystery rather than doing what it set out to do - educate people in doing business. The mystery is the step from the small circle to the big circle where the jump is an unexplained ten fold increase in income. How did that happen? In reality you need to work to get every tenfold increase to come to life. Scaling does not happen as if by magic. 

My game will be turning a small group of people as a business into a trillion dollar company. Every step in the game will be a tenfold increase.

##What would be a good title?

1. Who wants to be a trillionaire?
2. 12 Steps to a Trillion 
(10*10*10* 10*10*10* 10*10*10* 10*10*10)
Share your CSS knowledge
Tags: css, discuss
Published: 2019-11-14 22:21:47

Today I learnt about the `:placeholder-shown` pseudo-selector thanks to Daniel’s Tweet.

{%twitter 1195101813793538048 %}

{%codepen https://codepen.io/nickytonline/pen/zYYmVKz %}

What are some things about CSS that you've learnt about recently or something you already knew and think others would benefit from knowing?

![Let's talk about it](https://media.giphy.com/media/WqLmcthJ7AgQKwYJbb/giphy.gif)
how to fix Index was outside the bounds of the array error?
Tags: csharp, array
Published: 2019-11-14 22:21:02

i am trying to access an array elements and make some Logic gates operations over it, so basically i am trying to get the neighbors of each element, but i am getting the error, Index was outside the bounds of the array error.. thats one of my conditional if statements, and i know i am trying to access an element which is not exist either less than 0 element position or bigger than or = array.length 

                    if (states[i] == 0 && states[i + 1] == 0)
                    {
                        states[i] = 0;
                    }


any idea how to fix it?
ReshuffleDB - the DB that's always there for you
Tags: react, beginners, javascript, backend
Published: 2019-11-14 21:29:32

One of the most fundamental aspects of fullstack development is working with databases. Even though no two web applications are the same, the need for remote data is nearly ubiquitous. You might assume that  due to the massive advancements in cloud computing over the last 10 years provisioning a DB in 2019 would be fairly painless. But it's not. 

At Reshuffle we understand that nearly all real world applications need data. This is why any application deployed to the Reshuffle platform automagically has a database provisioned alongside it. That way, the database you always end up needing is already there when you need it.

Building an app on Reshuffle is 100% free and comes with it's own DB. Here is our shiny new documentation, please let us know what you think!

[Reshuffle DB docs](https://dev.reshuffle.app/using-reshuffledb?ref=devto)
[Reshuffle homepage](https://reshuffle.com?ref=devto)
[Our Discord](https://discord.gg/M8CC5hy)
Text Reader
Tags: help, dotnet, csharp
Published: 2019-11-14 21:26:35

Hi all I'm doing a c# course just got a problem at the moment. can someone please tell me why this isn't reading each line or confirm that I have all the code right for a text reader.

        private void tSBtnOpen_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFile = new OpenFileDialog();
            StreamReader myStreamReader = StreamReader.Null;

            openFile.InitialDirectory = "";
           
            if (openFile.ShowDialog() == DialogResult.OK) {
                myStreamReader = new StreamReader(openFile.FileName);

                string line = "";

                while (line != null)
                {
                    line = myStreamReader.ReadLine();
                    if (line != null)
                        textBox1.Text += line;

                }

                myStreamReader.Close();

            }

        }
    }