teleren/devto huggingface dataset:
All about 'This'
Tags: tutorial
Published: 2020-10-05 07:56:28

"This" is a prominent (but not mandatory) keyword in various coding languages, and seeing it for the first time can be very confusing. This time we're talking about the "This" keyword as it relates to javascript. "This" is a keyword used when programming, to refer to the object, class, or other entity of which the currently running code is a part. When implementing "this" within your code, be careful to pay close attention to how, when, and where it's called, as these syntactical typos may change the functionality of, and/or what "this" references entirely.
That's where the confusion sets in. That basically means that when using "this", since its value isn't decided until run-time, misconceptions about the value of this are very common. this is never bound to a specific value, unless specified otherwise. Lack of this knowledge can leave you stuck, confused, frustrated, or all-of-the-above.
However, in certain cases, if you're taught to recognize what this is referencing, you'd have quite an easier time. Here's how: The first and most important question you need to ask yourself when you’re trying to answer this question is ”Where is this function being invoked?”. The only way you can tell what the this keyword is referencing is by looking at where the function using the this keyword was invoked.

 When you'd rather this be bound specifically to a set value, you can use the 'call' and 'apply' methods. 
The call() method allows for a function/method belonging to one object to be assigned and called for a different object. call() provides a new value of this to the function/method.
Furthermore, apply() 
The apply() method invokes a function with a given this value and arguments provided as an array. The apply() method is similar to the call() method excepts that it accepts the arguments of the function as an array instead of individually .

With the knowledge of these methods and tips, all that's left is to apply them, heres what it looks like:
Call Method -
function add(a, b) { 
    return a + b;
}

let result = add.call(this, 139093, 20);
console.log(result); - 139113
-------------------------------------------
let customer1 = { name: 'Leo', email: 'leo@gmail.com' };
let customer2 = { name: 'Nat', email: 'nat@hotmail.com' };
function greeting(text, text2) {
   console.log(`${text} ${this.name}, ${text2}`);
}
greeting.apply(customer1, ['Hello', 'How are you?']); // output Hello Leo, How are you?
greeting.apply(customer2, ['Hello', 'How are you?']); // output Hello Nat How are you?

Using such methods, if fully grasped, could greatly improve your success while using "this". All-in-all remember, while having its uses and strong suits, it also has its quirks and rough edges. Remember that "this" is never the only way to reach your programming goals, it's all about how comfortable your are with its concepts. 
If this didn't clarify enough for you, reliable online resources include: medium.com | developer.mozilla.org | https//:www.w3schools.com
Elegant & Beautiful Testimonial Sliders
Tags: codepen, slider, testimonial
Published: 2020-10-05 07:06:28

###**Responsive slider**
{% codepen https://codepen.io/qrolic/pen/mdPYdpV %}

###**Testimonial images in custom dots**
{% codepen https://codepen.io/qrolic/pen/YzqbYME %}

###**Autoplay slider**
{% codepen https://codepen.io/qrolic/pen/NWNVXaB %}
New Minishift Cheat Sheet!
Tags: howto, cheatsheet, minishift, tutorial
Published: 2020-12-19 12:13:16

---
title: New Minishift Cheat Sheet!
published: true
date: 2020-10-05 07:00:00 UTC
tags: Howto,CheatSheet,minishift,tutorial
canonical_url: http://blog.jromanmartin.io/2020/10/05/new-minishift-cheat-sheet.html
---

Is OpenShift 3 “legacy” :older\_woman: :older\_man:? Maybe, however in some organizations is already the current [Platform as a Service](https://en.wikipedia.org/wiki/Platform_as_a_service) deployed and running in production.

From time to time I have to work on that platform, reviewing deployments, architectures, or designing migration approaches to OpenShift 4 using operators. Whatever it is the cause, I need to run locally an OpenShift 3 cluster, and here[minishift](https://docs.okd.io/3.11/minishift/getting-started/index.html) helps me a lot … so:

:tada: I am pleasure to announce that a new Cheat Sheet is available :tada:

- [Minishift Cheat Sheet](/cheat-sheets/minishift)

I hope this new cheat sheet helps you when you need to install, deploy and operate your own local OpenShift 3 cluster.

My full list of Cheat Sheets are available for your records [here](/cheat-sheets). As usual, comments, ideas, PRs are welcomed!

Happy reading !!! :books:
The Weekly Challenge 081
Tags: perl, theweeklychallenge, perlweeklychallenge
Published: 2020-10-05 06:51:00

It's a public holiday in Queensland, so nothing better to do than smash out [this week's](https://perlweeklychallenge.org/blog/perl-weekly-challenge-081/) The Weekly Challenge early.

# TASK #1 › Common Base String

There probably is some CPAN module that does this, but I avoid using CPAN modules for TWC, except List::Util (which is in Perl core).

For this task, I went through a loop one letter at a time. That string can be considered a base string of both strings if the base string is repeated one or more times to match the entire string.

## Examples

```
» ./ch-1.pl abcdabcd abcdabcdabcdabcd
abcd abcdabcd

» ./ch-1.pl aaa aa
a
```

# TASK #2 › Frequency Sort

This task was more straight forward, and can be broken into the following steps:

1. Check the input is a file and readable.
2. Read the file, and slurp it into a string.
3. Remove characters to exclude.
4. Put the words (separated by white-spaces `\s+`) into a frequency hash.
5. Sort the frequencies numerical.
6. Display the strings that match the frequency in order.

## Example

```
» ./ch-2.pl input.txt 
1 But City It Jet Juliet Latino New Romeo Side Story Their Then West York adaptation any anything at award-winning away become before begin best classic climactic coexist control dance do doesn't end ending escalates families feuding form former friend gains gangs goes happened hatred heartbreaking highway hoping in know love lovers meet meeting neither no one plan planning point romantic rumble run secret sends sister streets strikes terribly their two under understanding until violence warring what when where white whoever wins with wrong younger

2 Bernardo Jets Riff Sharks The by it led tragedy

3 Maria Tony a can of stop

4 to

9 and the
```
Offen goes Hacktoberfest
Tags: hacktoberfest, watercooler, webdev, opensource
Published: 2020-10-05 06:32:36

Are you interested in **making web analytics fair** for everyone and want to snack on some **golang or javascript** during this year's **Hacktoberfest?** 

We've got a few beginner friendly issues on our repo waiting for you. [github.com/offen/offen/issues?q=is%3Aissue+is%3Aopen+label%3AHacktoberfest](https://github.com/offen/offen/issues?q=is%3Aissue+is%3Aopen+label%3AHacktoberfest)

Pfiat eich!
The Front End: S2-E5 - Stephanie Stimac
Tags: career, podcast, frontend
Published: 2020-10-05 06:29:29

Listening trumpets at the ready? Here's episode 5 of season 2.

On the show this time we have the web's own code witch,  [Stephanie Stimac](https://twitter.com/seaotta/). Stephanie shares her journey from fashion and design into web standards and the Microsoft Edge team. 

Listen to the brand new episode here:

- Apple Podcasts > https://podcasts.apple.com/gb/podcast/the-front-end/id1499349107
- Pocket casts > https://pca.st/osul2zsa
- Spotify > https://open.spotify.com/show/4GuAxptrtY8Es5iHwp09dT
- Anchor > https://anchor.fm/the-front-end

## In this episode

Stephanie is a design technologist and lives somewhere in-between the role of a designer and developer. 

With a background in digital design and many years of building things from wireframe to code, she finds herself currently working in the Microsoft Edge Developer Experiences team.

Stephanie kindly shares her route into Microsoft and how she's working to make the web a better place. 

## Listening direct

Want to listen directly from here?

{% spotify spotify:episode:47f8h4Xieuz1if3tfcX9eA %}

## Want to be a guest or sponsor the show?

We're always happy to take requests for guests to talk about a range of different development topics from careers to origin stories, learning and professional growth, frameworks and more.

Similarly, we're looking for sponsors to fill promotional slots within the show. 

You can find out more here:

- [Being a guest](https://thefrontendpodcast.site/guests)
- [Sponsorship information](https://thefrontendpodcast.site/sponsorship)

Thanks for listening!
How to Make a PDF File🤔🤔
Tags: discuss, ask
Published: 2020-10-05 06:14:35

Just curious to know how can I generate a pdf file programmatically. I mean I know there are libraries in most of the programming languages to do so but I want to do it from scratch just like creating a text file. Open file.txt, write the data and close the file. But I guess, I can't do something like open a file.pdf, write data to it and then close the file. So How can I do it without any third party libraries.
How can I add my project on Hacktoberfest to accept contributions
Tags: help, hacktoberfest
Published: 2020-10-05 05:39:53

I want to add my project on Hactoberfest to accept some contributions from the Developers community. Till now have worked alone on this and I want it to grow, and that can be possible with some more minds included in it.

How can I list my project in Hactoberfest?

Project Repository: https://github.com/gkhan205/formify-react

{% github gkhan205/formify-react %}
Getting Your Website Indexed by Google 
Published: 2020-10-05 05:32:34

If your content isn’t indexed by Google, does it even exist? 

Indexing means that Google has evaluated your content and put it to its extensive list — index — of websites that can be seen in its search results page (SERP) when users type in a relevant query. 

Overall, [Google’s indexing process](https://www.contentkingapp.com/academy/google-index/#how-google-indexing-works) is a complicated one, with many phases affecting each other.

The speed of indexing your website depends on various factors, from the size of your website, its authority, or even the quality of your hosting. The quality of your content plays a crucial role as well. And at the end of the day, Google always has the final word whether to index your website or not. 

On the other hand, there are a few strategies on how to speed up the process. 

But firstly, to make it possible for Google to index your website faster, you need to get rid of any roadblocks that may prevent it from happening. Secondly, you should let Google know that there is a website to be indexed. And finally, the content of your website should be worth indexing. 

## 12 steps to speed up Google’s indexing process 

How to get Google to index your website quickly
1. Prevent robots directives from impacting indexing
2. Set up canonical tags correctly
3. Don’t disallow content you want to get indexed
4. Prevent crawler traps and optimize crawl budget
5. Feed Google indexable content through an XML sitemap
6. Manually submit your URLs to Google Search Console
7. Automatic indexing via the Google Indexing API
8. Provide Google with high-quality content only
9. Prevent duplicate content
10. Leverage internal links and avoid using nofollow
12. Build relevant backlinks to your content
13. Create buzz around your content on social media

Learn more about [how to get Google to index your website](https://www.contentkingapp.com/academy/google-index/).
Maximum Product of Three Numbers
Tags: algorithms, maximum, product, javascript
Published: 2020-10-05 05:20:59

#### Platforms to practice

[Leetcode problem](https://leetcode.com/problems/maximum-product-of-three-numbers)

#### Implementation

```javascript
const maxProduct = arr => {
  if (arr.length < 3) return false;
  const max3 = [-Infinity, -Infinity, -Infinity];
  const min2 = [Infinity, Infinity];

  for (let i = 0; i < arr.length; ++i) {
    const n = arr[i];
    if (n > max3[0]) {
      max3[0] = n;
      max3.sort((a, b) => a - b);
    }
    if (n < min2[0]) {
      min2[0] = n;
      min2.sort((a, b) => b - a);
    }
  }
  return max3[2] * Math.max(min2[0] * min2[1], max3[0] * max3[1]);
};
```

#### Complexity

Time complexity: O(n)
Space complexity: O(1)

#### Explanation

Loop through array, while keeping 3 max elements and 2 min elements.
We want 2 min elements because min element can have bigger absolute value. When we calculating product always 2 negative numbers give 1 positive, so we need only 2 min to check if their product is not bigger that 2 smaller numbers of our 3 max.

#### My github reference

[https://github.com/gkucmierz/algorithms/blob/master/problems/maximum_product_of_three_numbers.js](https://github.com/gkucmierz/algorithms/blob/master/problems/maximum_product_of_three_numbers.js)

#### Instacode playground

[instacode.app](https://instacode.app/run/FAYw9gdgzgLgBAWwIYA8AKAnMATArieAXjiQwzkID44BvYOOASwDM4AKUjAOgBsBTCAHMYACzgAeOAGYAlHAx8YuDBDjMkPKHwDc9OOGjxkKKRTgBtALQBJCM0YRGMAJ4AaODbsOnbj7fuOLgC6ugwGsIgOAExm5v7eLu7xgc4hesxg5Gz88IxmAAzaTBIkZLwCwiJFANTVjHJ0DGGQEarEnOaMaU1MrGyq1MZS5vlBDXo9QyNBZhChPYioUlxQmTBsHO4ARnJUJB5wO-MMAL4TveyqkgjR0+MLkRBR07PHTTdPK2sbSNu71FsDkgZG8zqc9AolCpFiZzFEZgAqOAAWSQoi4xjYH2eozgSOx5gAjEF3FNcfilkSxroTrpgMZMDh8Osie5LAAWdxSNkANncAHZ3KMQcAgA)
ETHPlanet Hackathon Workshop 2: Dapp Data Analysis Using On-Chain Data
Tags: blockchain, workshop, ethereum, dapp
Published: 2020-10-05 05:13:10

Are you looking to monitor dapp (decentralized apps) activity and report on the behavior of its users? Benefit from the availability of on-chain transactions to analyze activity. 

As part of the ETHPlanet Hackathon: Building the Next Digital World, in this dapp data workshop, we will take a look at what data sources and tools are available to report on on-chain transactions.

📅 Workshop Date: 10/8 (Thursday) at 10 AM EST / 10 PM SGT / 4 PM CET; 20 mins presentation and 15 mins Q&A.
🎙️ Mentor:[Joris Bontje](https://twitter.com/mids106), founder of [State of the DApps](https://www.stateofthedapps.com/)
📍 RSVP: Click [HERE](https://www.eventbrite.com/e/ethplanet-hackathon-workshop-2-dapp-data-analysis-using-on-chain-data-tickets-123636023675)
--
About Joris Bontje: Joris is a Big Data Hacker & Software Engineer, Decentralized Autonomous Technologist and founder of the State of the DApps platform.

About State of the DApps: A not-for-profit curated directory of Decentralized Applications, also called DApps, which run on various blockchains.

--
Join ETHPlanet Building the Next Digital World Hackathon here>> https://ethplanet-hackathon.devfolio.co/
`pandoc in.md -t context -o out.pdf` doesn't have syntax highlighting
Tags: pandoc, latex, help, writing
Published: 2020-10-05 05:09:39

If I did it without `-t`, or with `-t latex`, [it will support highlighting](https://pandoc.org/MANUAL.html#syntax-highlighting).

> Currently highlighting is supported only for HTML, EPUB, Docx, Ms, and LaTeX/PDF output.

Is there a way around this?

Otherwise, can I convert all `<pre><code>` blocks to HTML blocks, highlight them with Prism.js, and convert back to PNG?

[I found this](https://github.com/adityam/filter), but couldn't make sense of it.

Why ConTeXt? It seems to be the only way I can,

- Change paper size mid-way
- Easier to centering vertically
Free monoidal functors in arbitrary categories
Published: 2020-10-05 04:58:22

It is often joked "a monad is a monoid in the category of endofunctors."

Little known fact, an Applicative functor is a monoid in the category of functors with day convolution as the product.

And day convolution unlike endofunctor composition can be defined over any strong monoidal category (basically just has tuples and functions.)

Hence

~~~
{-# LANGUAGE ExistentialQuantification, RankNTypes #-}
import Prelude hiding (Functor (..), Applicative (..))
class Functor f where
  fmap :: Hom a b -> f a -> f b
class Functor f => Monoidal f where
  pure :: Id a -> f a
  join :: Day f f a -> f a
data Day f g a = forall x y. Day (f x) (g y) (Hom (PRODUCT x y) a)
instance Functor (Day f g) where
   fmap f (Day h x y) = Day (f :.: h) x y
data Id a = Id (forall x. Hom x a)
instance Functor Id where
    fmap f (Id x) = Id (f :.: x)
data Free f a = Pure (Id a) | Ap (Day f (Free f) a)
instance Functor (Free f) where
   fmap f (Pure x) = Pure (fmap f x)
   fmap f (Ap x) = Ap (fmap f x)
instance Monoidal (Free f) where
   pure = Pure
   join (Day h (Pure x) y) = Ap h x y
~~~

Where `PRODUCT`and `Hom` are up to you to define.

In order to have full applicative functors you need functions which your category might not have.
Deep learning live coding Wednesday 
Tags: hacktoberfest, opensource, pytorch, python
Published: 2020-10-05 04:39:22

Hi everyone, as part of hacktoberfest I'll be holding a six hour live coding session on [YouTube](https://www.youtube.com/channel/UCJeAAx1mDUEVpTYEX0EWXSg?view_as=subscriber) where I will showcase  development of [flow-forecast](https://github.com/AIStream-Peelout/flow-forecast) and provide information on how you can start contributing too. The live coding session will be this Wednesday October 8th from 12pm EDT to 6pm EDT and then I will be back for a night session from 10pm EDT to 12:30 AM. 

**Things I (hope) to cover**: 

- Reviewing/Merging any outstanding Pull Requests from contributors

- [Adding the transformer bottleneck paper](https://github.com/AIStream-Peelout/flow-forecast/issues/166)

- [Finishing inference mode support and merging](https://github.com/AIStream-Peelout/flow-forecast/issues/83)

- Answering any questions you might have live. 

[For more information on flow forecast click here](https://dev.to/isaacmg/a-unified-deep-learning-for-time-series-framework-1o20).
The-latest-trend-in-top-open-source-gans-generative-adversarial-network-projects
Tags: opensource, datascience, machinelearning, architecture
Published: 2020-10-05 04:39:18

###Generative Adversarial Networks (GANs) are a powerful class of neural networks and GANs are basically made up of a system of two competing neural network models that compete with each other and are able to analyze, capture and copy the variations within a dataset.

###Get hands-on experience by implementing the Top Open-Source GANs(Generative adversarial network) Projects.

[#ai #machinelearning #machinelearning #datascience #datascience #artificialintelligence #GAN #gans ]

https://medium.com/@waliamrinal/the-latest-trend-in-top-open-source-gans-generative-adversarial-network-projects-ee3e319e3173?sk=2f184477e82b2604147e7b650ae4a8ee
What's with the customer care numbers?
Tags: discuss, meta
Published: 2020-10-05 04:16:47

Does anyone around know why there are a bunch of people spamming customer care numbers as blog posts?
My feed is filled with them 

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


I've started using dev.to actively only recently so please educate me if this is a thing
Community Library
Published: 2020-10-05 03:52:37

For my fourth project, I had to build a single page application(SPA) with a Javascript front-end and a Rails backend. For this project, I decided to build a simple library web application that an extracurricular literature club can use to facilitate the members of the club in borrowing books.

There were some big differences with how I built this project compared to the previous projects I built with just Rails. The obvious difference was the fact that, instead of using Rails to build out the frontend and backend, I was using Rails as just an api backend and using HTML, CSS, and Javascript to build my frontend. This big change made me see how I can use fetch requests to send and receive information to the backend. By using get fetch, post fetch and patch fetch for my app, I was able those fetch requests to asynchronously fire off the code I wrote, sending and receiving information to and from the backend.

The other big difference was the ability to dynamically change the DOM to make the page interactive and display information based on events. I found myself frequently using .querySelector to find and grab specific elements and I also learned the magic of using event listeners to elements to make things dynamic. In my journey of using event listeners, I was even able to use event delegation to trigger events on elements that were not there in the beginning but were dynamically added by my code and a user’s input.

All in all I really enjoyed building this single page application. Using Rails as just an api was definitely similar but also different, and using vanilla Javascript to be responsible for the frontend was something I really enjoyed learning about and also implementing.
IsPalindrome Code Challenge
Tags: javascript, 100daysofcode
Published: 2020-10-05 03:11:32

Hello, everyone. Today I will be walking you through the isPalindrome problem on LeetCode. Your approach may be different, or perhaps even better but don't rub it in, just enjoy. Ok, so let's do this.

#The Task

```Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.```

```
const isPalindrome = s => {
    // CODE GOES IN HERE
};
```

#My Approach
I started by first converting the passed in string to lowercase letters to avoid any case sensitivity issues.

```
s = s.toLowerCase()
```

Next, I created a string containing letters a-z and number 0-9 to rule out any special characters i.e !?:.

```
let alphas = "abcdefghijklmnopqrstuvwxyz0123456789"
```
Next, I created a variable called caughtAlphas which I'm going to use to push all of the alphas into that array, meanwhile ignoring special characters.

```
let caughtAlphas = []
```

Then I declared 2 let variables, one that I'll use to convert the caughtAlphas array to a string, and the second one will give me a boolean value based on whether or not the string is a palindrome

```
let caughtAlphasToString;
let checkIfPalindrome;
```

To handle the checking of each character in the string, I used a for loop like so...

```
for (let i = 0; i < s.length; i++) {
     if(alphas.includes(s[i])) { //alphas contain current char?
          caughtAlphas.push(s[i]) //great, so push it in caught alphas
     }
}
```

Now, to convert the caughtAlphas array into a string...

```
caughtAlphasToString = caughtAlphas.join('')
```

Now, checking it against itself reversed then assign it to the checkIfPalindrome variable

```
checkIfPalindrome = (caughtAlphasToString === caughtAlphasToString.split('').reverse().join(''))
```

Lastly, returning it

```
return checkIfPalindrome
```

So, now if we put it all together we have...

```
const isPalindrome = s => {
    s = s.toLowerCase()
    let alphas = "abcdefghijklmnopqrstuvwxyz0123456789"
    let caughtAlphas = []
    let caughtAlphasToString;
    let checkIfPalindrome;
    
    for (let i = 0; i < s.length; i++) {
        if(alphas.includes(s[i])) {
            caughtAlphas.push(s[i])
        }
    }

    caughtAlphasToString = caughtAlphas.join('')
    checkIfPalindrome = (caughtAlphasToString === caughtAlphasToString.split('').reverse().join(''))
    return checkIfPalindrome
}
```

This challenge was fun. Hope you enjoyed the breakdown. Post your solutions in the comment section.
Updating Dev Spam Filter is needed
Tags: devops, help, security
Published: 2020-10-05 03:01:13

Hello Dev Team, 

Could you guys please look into updating the spam filter as this is destroying my news feed.

I have already reported all those threads and it keeps appearing.


![spam](https://dev-to-uploads.s3.amazonaws.com/i/qwu10n0kys16us4qo02a.png)

![spam2](https://dev-to-uploads.s3.amazonaws.com/i/8vc9j6btccbhwavm4qml.png)

Spam Filter Rules Examples:

- Limit the number of posts that can be posted after registration 
- Simple title analysis (removing numbers) will reveal the similarity percentage to be high (60%+)
- Auto ban or disable posting when more than 5 articles are published in less than an hour
- Check age of account vs post rate 
- Add re-captcha to the publishing action