teleren/devto huggingface dataset:
The Science Based Pursuit of UAPs using AI
Tags: ai, machinelearning, opensource
Published: 2021-03-10 14:19:13

Join the Science Based Pursuit of UAPs. A world wide search for UAPs using a global network of machine learning, smart cameras and sensor arrays built by you with our open-source software 

Read one of our articles here on Medium
https://medium.com/skyhub10/monitoring-the-environment-with-a-sky-hub-tracker-1e540676c154

Read our Space.com article here https://www.space.com/spotting-ufos-sky-hub-surveillance
JavaScript WeakMap and WeakSet
Tags: javascript, codenewbie, tutorial, webdev
Published: 2021-03-10 14:06:45

### *WeakMap*
In the previous article, the primitive value was used as the key. This is different in `weakMap` because the object is the key.

See the example below:

```js
const weakMap = new WeakMap();

const obj = {};
const str = '';

weakMap.set(obj, "ok"); // WeakMap { <items unknown> }
weakMap.set(str, "ok");  // only use non-primitive data as key
// TypeError: Invalid value used as weak map key
```

If there's no reference to the object, it gets removed from memory automatically.

See the example below:

```js
let bello = { name: "Bello" };

const weakMap = new WeakMap();
weakMap.set(bello, 'noah');

bello = null; // changed/overriden reference

// bello is removed from memory!
```

> `WeakMap` does not support iteration methods like `keys()`, `values()`, `entries()`.

The following methods still work on `WeakMap`.

- `weakMap.get(key)`
- `weakMap.set(key, value)`
- `weakMap.delete(key)`
- `weakMap.has(key)`

The reason behind non-supported iterable methods in `WeakMap` is that JavaScript engine memory cleanup (full or partial cleanup) may be done immediately or later when more deletions happen.

---
### *WeakSet*
It is basically used as additional storage of the *yes/no* or *true/false* fact of an object like keeping track of people who visited a site:

> Mostly only objects are added to `WeakSet`.

- Supported methods are `add` `has` and `delete`. 
- It doesn't support `size` and `keys()`. 
- Like `weakMap` iteration methods are not supported and also lack the ability to get all current content.

See the example below:

```js
const visitedSet = new WeakSet();

let bello = { name: "Bello" };
const monica = { name: "Monica" };
const jennifer = { name: "Jennifer" };

visitedSet.add(bello); // Bello visited site
visitedSet.add(monica); // Monica visited site
visitedSet.add(bello); // Bello again visited site

// visitedSet has 2 users now

// check if Bello visited the site?
console.log( visitedSet.has(bello) ); // true

// check if Jennifer visited the site
console.log( visitedSet.has(jennifer) ); // false

bello = null; // visitedSet will be cleaned automatically
```

---
[![Buy me a Coffee](https://res.cloudinary.com/bizstak/image/upload/v1610317510/ko-fi-trans_fr3su4.png)](https://www.buymeacoffee.com/techstackmedia)

---
Using Modernizr with Nuxt.js to Detect Browser Features
Tags: nuxt, vue, javascript, node
Published: 2021-03-10 14:00:57

## What is Modernizr?

[Modernizr](https://github.com/Modernizr/Modernizr) is a package that detects browser features and makes them queriable via JavaScript and CSS. This is very handy to find out which CSS properties are supported, for example. The approach is much more flexible and stable than using browser vendor and version for this. I wrote a module that allows to use Modernizr with Nuxt.js.

## Using Modernizr with Nuxt.js

Modernizr uses a plugin-based architecture, and you have to build the package yourself, depending on the features you need to detect – at least if you are not using Nuxt.js! I have created the [nuxt-modernizr](https://github.com/dword-design/nuxt-modernizr) module that makes it easy to add Modernizr to your Nuxt.js app. You pass the features as module options, and the module creates a Modernizr build and places it in the `.nuxt` folder. Here is how to configure it:

First, install the module via `npm install nuxt-modernizr` or `yarn add nuxt-modernizr`.

Then, in your `nuxt.config.js`, add the module and pass the options that should be passed to Modernizr:

```js
export default {
  modules: [
    ['nuxt-modernizr', {
      'feature-detects': ['css/scrollbars', 'css/overflow-scrolling'],
      options: ['setClasses'],
    }],
  ],
}
```

Check out the [Modernizr documentation](https://modernizr.com/docs/) for details.

Now we can use the `Modernizr` variable and the generated CSS classes on the HTML root element to check for browser features. My all-time favorite among browser features is CSS scrollbars, because the support is pretty different between browsers and depending on if they are available, you can adjust container sizes and style them or not.

```js
if (Modernizr.cssscrollbar) {
  // CSS scrollbar support
}
```

```css
html.cssscrollbar {
  /* CSS scrollbar support */
}
```

## Conclusion

That was already it! Usage is pretty simple. Let me know if you find it useful or if there are any things that you are missing. Also, if you find it useful, leave a [GitHub star on the repository](https://github.com/dword-design/nuxt-modernizr).

**If you like what I'm doing, follow me on [Twitter](https://twitter.com/seblandwehr) or check out my [website](https://sebastianlandwehr.com). Also consider donating at [Buy Me a Coffee](https://www.buymeacoffee.com/dword), [PayPal](https://www.paypal.com/paypalme/SebastianLandwehr) or [Patreon](https://www.patreon.com/dworddesign). Thank you so much! ❤️**
Day 72 Of 100DaysOfCode: CSS Locator
Tags: womenintech, 100daysofcode, codenewbie, beginners
Published: 2021-03-10 13:56:11

This is my 72th day of #100DaysOfCode and #python learning. Like yesterday today also continue to learned more about web scraping in the topics text extraction, follow() method, spider, weaving the web, inspecting elements from [Datacamp.](https://campus.datacamp.com/courses/web-scraping-with-python/css-locators-chaining-and-responses?ex=6)



#Xpath and CSS locator in python
```python
from scrapy import Selector

# Create a selector object from a secret website
sel = Selector(  text = html)

# Select all hyperlinks of div elements belonging to class "course-block"
course_as = sel.css( 'div.course-block > a' )

# Selecting all href attributes chaining with css
hrefs_from_css = course_as.css( '::attr(href)' )

# Selecting all href attributes chaining with xpath
hrefs_from_xpath = course_as.xpath( './@href')
```
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Day 72 Of <a href="https://twitter.com/hashtag/100DaysOfCode?src=hash&amp;ref_src=twsrc%5Etfw">#100DaysOfCode</a> and <a href="https://twitter.com/hashtag/Python?src=hash&amp;ref_src=twsrc%5Etfw">#Python</a> <br>Web-scraping(CSS locator and changing and responses) From [Datacamp](<a href="https://t.co/fBZgTteSh7">https://t.co/fBZgTteSh7</a>)<a href="https://twitter.com/hashtag/WomenWhoCode?src=hash&amp;ref_src=twsrc%5Etfw">#WomenWhoCode</a> <a href="https://twitter.com/hashtag/CodeNewbie?src=hash&amp;ref_src=twsrc%5Etfw">#CodeNewbie</a> <a href="https://twitter.com/hashtag/100DaysOfCode?src=hash&amp;ref_src=twsrc%5Etfw">#100DaysOfCode</a> <a href="https://twitter.com/hashtag/beginner?src=hash&amp;ref_src=twsrc%5Etfw">#beginner</a> <a href="https://twitter.com/hashtag/DEVCommunity?src=hash&amp;ref_src=twsrc%5Etfw">#DEVCommunity</a> <a href="https://t.co/yuC9PoDCMI">pic.twitter.com/yuC9PoDCMI</a></p>&mdash; Durga Pokharel (@mathdurga) <a href="https://twitter.com/mathdurga/status/1369645033062768645?ref_src=twsrc%5Etfw">March 10, 2021</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
Moving on...
Published: 2021-03-10 13:53:50

It's been a long a frustrating week, attempting to learn and use data science code without really having been taught the underlying theory. This has been the only area of this particular course with which I am dissatisfied. The capstone is meant to be multivariable regression, but I have had to shelve it for a while. Once I have the opportunity to work through some data science fundamentals, I will give this section of the course another go. For now, though, it's time to move on.

I've reached the finale of the bootcamp: a series of unguided portfolio projects with only the end product defined. I am looking forward to these challenges, and have already tackled the first one: a text-based program to convert a string into Morse code.

I am looking forward even more to finally finishing this course, on which I have been working for nearly four months. I have learned a ton, and already have a handful of projects that I built from the ground up to showcase as I move back into the AWS space and learn how to deploy my code.

Onward and upward!
Data structures and algorithms
Tags: computerscience, algorithms, github, codenewbie
Published: 2021-03-10 13:48:28

Data structures and algorithms are a must for any coding interview.
There is no well set road map for learning data structures and algorithms other than hard work, consistency and practice. Since this is a very vast field, therefore, only regular practice can help you become a good programmer. 
While learning data structures and algorithms, I have solved various questions and decided to compile all the codes I come across into a git repository. Everyone and anyone enthusiastic in data structures and algorithms can contribute to the repository. All you have to do is: fork, clone, create a branch , write your code and send a pull request describing the code you have written.
Here is the link of the git repository:
[DATA STRUCTURES AND ALGORITHMS](https://github.com/SAY-droid427/DSAQuestions)
Hope this will help learners who want to learn DSA!
Follow me on [Github](https://github.com/SAY-droid427)
Happy coding!
Azure Developer League Cloud Skills Challenge Collection 2021
Tags: azure, cloudskillschallenge, azuredeveloperleague
Published: 2021-03-10 13:40:51

[Here's a breakdown: 1. Register #AzureDeveloperLeague 2. Choose #CloudSkillsChallenge & complete @MicrosoftLearn modules within challenge. 3. Update @Microsoft @Azure Skills & stand a chance to win the prices #SurfaceGo #AzureLeaguejersey #FreeExamVouchers](https://bit.ly/AzureDeveloperLeague)
Twitter Screenshot Bot
Tags: twitter, bot, twitterbot, screenshots
Published: 2021-03-10 13:39:31

Everyone say hello to **Twitter Screenshot Bot** ( [@get_screenshot](https://twitter.com/get_screenshot) ).

Simply mention [@get_screenshot](https://twitter.com/get_screenshot) in a reply tweet and the bot will take a screenshot and send it your DM. Great tool for archiving or documenting tweets that may otherwise disappear. 

**Enjoy!**
{% twitter 1332246825387110402%}
swns - a command for switching network services on Mac 🥳
Tags: productivity, commandline, macos
Published: 2021-03-10 13:38:41

---
title: swns - a command for switching network services on Mac 🥳
published: true
description: A command line tool for switching network services on Mac
tags: productivity,commandline,macos
//cover_image: https://direct_url_to_image.jpg
---

The name `swns` stands for **SW**itch **N**etwork **S**ervices.

![out](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lb8865so5k2ntz1ninzj.gif)

## Repo

Here is the link to the GitHub repo:

[![matoruru/swns - GitHub](https://gh-card.dev/repos/matoruru/swns.svg?ver=0.2)](https://github.com/matoruru/swns)

## Usage

1. Type `swns` on your termianl and then hit <kbd>Enter</kbd>.
2. Choose a number from the list.

![Screenshot 0003-03-10 at 10.13.56 PM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fw2oomuoy0imr83g3t09.png) 

## Requirements

This command is made with only `sh` and `networksetup` that should be already installed on your Mac. So there's no special requirements actually 🥳

## Conclusion

I'm waiting for your feedback!
Sentiment Analysis on ANY Length of Text With Transformers (Python)
Tags: python, datascience, machinelearning, tutorial
Published: 2021-03-10 13:31:19

{% youtube yDGo9z_RlnE %}

The de-facto standard in many natural language processing (NLP) tasks nowadays is to use a transformer. Text generation? Transformer. Question-and-answering? Transformer. Language classification? Transformer!

However, one of the problems with many of these models (a problem that is not just restricted to transformer models) is that we cannot process long pieces of text.

Almost every article I write on Medium contains 1000+ words, which, when tokenized for a transformer model like BERT, will produce 1000+ tokens. BERT (and many other transformer models) will consume 512 tokens max - truncating anything beyond this length.

Although I think you may struggle to find value in processing my Medium articles, the same applies to many useful data sources - like news articles or Reddit posts.

We will take a look at how we can work around this limitation. In this article, we will find the sentiment for long posts from the /r/investing subreddit. This video will cover:

High-Level Approach
Getting Started

Data
Initialization
- Tokenization
Preparing The Chunks
- Split
- CLS and SEP
- Padding
- Reshaping For BERT
Making Predictions
How to escape tutorial hell with actionable steps
Tags: beginners, codenewbie, webdev, programming
Published: 2021-03-10 13:29:00

_If you found value in this thread you will most likely enjoy my tweets too so make sure you follow me on [Twitter](https://twitter.com/VladPasca5)  for more information about web development and how to improve as a developer. This article was first published on my [Blog](https://vladpasca.hashnode.dev/)_

## What is tutorial hell?

When you take tutorials after tutorials and never build something on your own you are stuck in the tutorial hell.

Here is how you can escape it

## 1. Practice what you learned

To get out of tutorial hell you need to build something, right?

The idea of building something might scare you at first but remember that you should start small.

If you learned about function build 10 more functions on your own\

## 2. Use  [Codewars](http://codewars.com)

This platform helped me get out of tutorial hell. How?

It gives you different problems you need to solve using the concepts you already learned.

This way you can gain enough confidence to go to the next step.

## 3. Build a small project

This might sound scary at first but it is not.

You don't need a UI for this project.

You don't need to finish it.

Just try to build something easy and simple like a number guessing game or a dice rolling simulator in the console.

## 4. Add more features to that project

After you built that small project it's time to improve on it.

Look for inspiration on GitHub. 

Search for the project you built and see what features other developers added.

Look at their code if you get stuck.

## 5. Continue learning and building

Now that you built your first project you can go and learn more.

But remember that after you learn more you need to come back and do all of these steps over and over again.

It will get easier as you make progress.

_I hope found this useful and if you did please let me know. If you have any question feel free to DM me on  [Twitter](https://twitter.com/VladPasca5) ._
My Azure Dev challenge Journey!
Tags: azureapril, azure, azuredevchallenge
Published: 2021-03-10 13:14:26

Hello  I want to share my story of AZURE DEV CHALLENGE . I came to know about azure by my friend . I visited their website and found it very amazing and fantastic .. Their learning programs were very good and Very efficient ..... Their were question that keep us on the track and also help us to retain an get most from the course... Plus after completing the course i got $100 to use in azure. Azure is a very great everyone must try it...
I took part in azure python challenge there are three main challenges here is a link to it https://portal.azure.com/#home


Go and visit Azure
Testing Context with React Native Testing Library
Tags: reactnative
Published: 2021-03-10 13:06:40

---
title: Testing Context with React Native Testing Library
published: true
description: In this video I walk you through 3 different ways you approach writing tests in your React Native app when context is involved.
tags: reactnative
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/snpq4u4bsn4wz0msn2b5.jpeg
canonical_url: https://www.reactnativeschool.com/testing-context-with-react-native-testing-library
---

{% youtube BPAG3V5D-EY %}

- [@testing-library/react-native](https://github.com/callstack/react-native-testing-library)
- [@testing-library/jest-native](https://github.com/testing-library/jest-native)
- [Code from Video](https://github.com/ReactNativeSchool/context-testing-react-native-example)
Setup Cross Browser & Parallel Testing with SeleniumBase in under 2 mins!
Tags: python, testing, webdev, tutorial
Published: 2021-03-10 13:05:51

In this post, we will cover how you can setup Cross Browser & Parallel Testing with SeleniumBase just in under 2 mins. SeleniumBase framework comes with many great functionalities to make your testing as painless as possible. One of those functionalities is the ability to do cross-browser and parallel testing, let’s see how we can do that –

### Cross Browser Testing
By default, SeleniumBase will run your tests in the Chrome browser. However, you do have options to run your tests in other browsers such as Firefox, Edge, IE, Opera, PhantomJS, Safari, etc…

To run a test in a different browser, you simply need to pass in the browser flag during runtime –

`pytest my_first_test.py --browser=firefox`

If you have the browser configured properly in your machine, the tests will start running in that browser.

---

### Parallel Testing
To speed up your overall test execution time, SeleniumBase also allows you to be able to run your tests in parallel. Just like the cross-browser testing, this can be easily achieved by passing the appropriate flag –

`pytest test_suite.py -n=4`

-n is the number of instances it will spin up. For example, in this case, it will run the test_suite in 4 instances of the Chrome browser.

Both the cross-browser and the parallel testing can be done without any added configuration as it’s pre-baked with the SeleniumBase framework.

---

### **Check out the video below to learn more about Cross-Browser & Parallel Testing using the SeleniumBase framework –**

{% youtube nwGTARjksBU %}

To learn more about Selenium Python, check out the full [tutorial series here](https://automationbro.com/blog/selenium-python-tutorial-series/) for free!

---

📧 Subscribe to my [mailing list](https://automationbro.com/mailing-list) to get access to more content like this 

👍 Follow [automationbro](https://twitter.com/automationbro) on Twitter for the latest updates

...

I love coffees! And, if this post helped you out and you would like to support my work, you can do that by clicking on the button below and buying me a cup of coffee -

<a href="https://www.buymeacoffee.com/automationbro">![Buy me a coffee](https://dev-to-uploads.s3.amazonaws.com/i/4aw2ub3f4qkyjk0ivwt4.png)</a>

You can also support me by liking and sharing this content.

Thanks for reading!
Daily Developer Jokes - Wednesday, Mar 10, 2021
Tags: jokes, dailydeveloperjokes
Published: 2021-03-10 13:00:06

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

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

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

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

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

<!-- 
Joke text:
___Q:___ What do you get when you cross a computer with an elephant?

___A:___ Lots of memory!
 -->
Sharing common code between Rails controllers with `Scoped` pattern
Tags: ruby, rails, webdev
Published: 2021-03-10 15:27:06

---
title: Sharing common code between Rails controllers with `Scoped` pattern
published: true
date: 2021-03-10 13:00:00 UTC
tags: ruby,rails,webdev
canonical_url: https://boringrails.com/tips/rails-scoped-controllers-sharing-code
---

If you follow a strict REST / nested resources approach to building your Rails app, you might get sick of repeating common controller actions.

Try the `Scoped` concern pattern: a place to put shared code (setting variables, authorization) and slim down your controllers.

## Usage

This particular pattern comes from DHH and Basecamp – a codebase that p[rides itself of using lots of tiny concerns](https://twitter.com/dhh/status/964244090224128001) to share bits of behavior.

While the savings of repeating the same `before_action`s to look up a `Channel` would be a fine benefit on it’s own, the naming convention of `Scoped` is such a great, sharp name. Playlists are “scoped” to a channel so it makes total sense that the corresponding controller would be “channel scoped”.

```ruby
module ChannelScoped
  extend ActiveSupport::Concern

  included do
    before_action :set_channel, :authorize_channel
  end

  private

  def set_channel
    @channel = Channel.find(params[:channel_id])
  end

  def authorize_channel
    authorize @channel # check that user has access, etc
  end
end

class Channels::SubscriptionsController < ApplicationController
  include ChannelScoped
end

class Channels::VideosController < ApplicationController
  include ChannelScoped
end

class Channels::PlaylistsController < ApplicationController
  include ChannelScoped
end
```

## Additional Resources

DHH Gist: [Models for Nested Resources](https://gist.github.com/dhh/10022098)

* * *
[![](https://boringrails.com/images/twitter-banner.png)](https://twitter.com/_swanson)