teleren/devto huggingface dataset:
New eBook Content and Video Course on Ionic Framework VueJS Mobile Development
Tags: ionic, vue, tutorial, javascript
Published: 2021-01-27 02:46:42

[LIMITED TIME DISCOUNT COUPON FOR MY READERS HERE ON DEV.TO] (https://www.udemy.com/course/using-ionic-framework-vuejs-firebase-vuex-for-image-diary/?couponCode=IONIC-VUEJS-1-9.99)

![app-gumroad](https://dev-to-uploads.s3.amazonaws.com/i/q7bbs5gfiilheuzqsrrw.png)

### The Book
#### Beta Release: Build a VueJS App with Ionic Framework, SQLite And Capacitor.
It is an ebook that I am self-publishing on Gumroad. The book is written using vuejs without typescript and walks you through the process of building a CRUD application using SQLite as the data storage mechanism. We also step through the process of running the app on IOS and Android since the SQLite Plugin only works on the device.

You can get more specifics about the contents of the book by checking out the  [**book landing page**](https://gumroad.com/l/iZrwrK) .

### The Video Course
#### Learn To Build Mobile Apps With Ionic Framework VueJS and Capacitor 
*Early Access - Using Ionic Framework VueJS, Firebase & Vuex Store For Image Diary App*

The new Ionic Framework VueJS Web Components are a great way to leverage your javascript skills with VueJS to build professional looking Mobile Applications and PWAs efficiently.

Vue3 and Vuex 4 are the latest releases and we hope that this video tutorial will expose you to the important features and patterns to start you on the journey to build something amazing.

- [**See Course On Gumroad**](https://gumroad.com/l/YfZfU)
- [**See Course On Udemy**](http://bit.ly/ionic-vue-vuex-udemy1)

### Ionic VueJS Video Playlist
- [https://bit.ly/ionic-vue-playlist](https://bit.ly/ionic-vue-playlist)
The Little Prince [Solution | Javascript] - Computational Thinking 101 | Beginner
Tags: javascript, algorithms, beginners, programming
Published: 2021-01-27 02:37:53


Earlier I posted a Computational Thinking problem at this [link](https://dev.to/wahidd/the-little-prince-computational-thinking-101-beginner-ach). In this post, I am going to explain a solution written in Javascript.


### A Javascript solution
- Let's get first input `N` for test cases and spin-up a loop which runs `N` times for all test cases. Also, include `crossings` variable which counts number of crossings for each test case.

```js
// assume user enters valid value only
test_cases = prompt('')
while(test_cases)
{
    let crossings = 0;

    test_cases--;
}
```

- Now, we are going to read **start** and **destination** points.

```js
    // start and end points
    let points_input = prompt('').split(' ');
    let start = { x: points_input[0], y: points_input[1] };
    let end = { x: points_input[2], y: points_input[3] };
```

- Read `M` for number of planetary systems and make a loop which run `M` times. All the hard work happens inside that loop.
```js
    // M planetary systems
    let M = prompt('');
    while(M)
    {
        // do something nice for each planetary system
        M--;
    }
```

- Let's talk about the main Algorithm now! The Little prince has to **enter** or **exit** any planetary system, *if and only if* the **start point** OR **destination point** (only one of them) is inside the planetary system.

Let's find out if he has to cross THIS planet, and if so increase the **count**.
```js
        let planet_input = prompt('').split(' ') // x, y, r -> center and radius of a planet
        let planet = { x: planet_input[0], y: planet_input[1], r: planet_input[2] };

        if(hasToCross(planet, start, end))
        {
            crossings++;
        }
```

- We need to use logical `XOR` to check if ONLY start or end is in planetary system.
```js
function hasToCross(planet, start, end)
{
    // simulated logical XOR
    // (start in planet) XOR (end in planet)
    if( (isInPlanet(planet, start) || isInPlanet(planet, end)) 
    && !(isInPlanet(planet, start) && isInPlanet(planet, end)) )
    {
        return true;
    }
    else
    {
        return false;
    }
}
```

> For any point to be in a circle, distance between the point and circle center must be less than the radius of the circle.
- Now, you know from middle school that you need **pythagorean theorem** to detect distance between points.
```js
function isInPlanet(planet, start)
{
    let a_squared = Math.pow(planet['x'] - start['x'], 2);
    let b_squared = Math.pow(planet['y'] - start['y'], 2);
    let distance_to_center = Math.sqrt(a_squared + b_squared);

    return distance_to_center < planet['r'] ? true : false;
}
```

- Finally, we just need to print `crossings` after we process the 'planets loop'.
```js
console.log(crossings);
```


### Source code
Try copying and pasting the below input into repl!
```
2
-5 1 12 1
7
1 1 8
-3 -1 1
2 2 2
5 5 1
-4 5 1
12 1 1
12 1 2
-5 1 5 1
1
0 0 2
```
{% replit @codwiznet/TheLittlePrince %}
My pet project
Tags: javascript, webdev, beginners, portfolio
Published: 2021-01-27 02:32:47

Hello all, I have been learning web development for about a year now, and I have been looking to strengthen my portfolio. So I just deployed one of my projects which is supposed to be a like clone of imgur and I decided to share (please don't judge me by my design skills haha). It's live here on https://imagepload.herokuapp.com 

I initially got the idea from a book I was following and I decided to improve it by adding more features.
COBOL gets a hip replacement
Tags: cobol, legacy
Published: 2021-01-27 02:24:24

[Pete Dashwood](https://nz.linkedin.com/in/peter-e-c-dashwood-0165b84?trk=author_mini-profile_title), from [PRIMA Computing](https://primacomputing.co.nz/PRIMAMetro/default.aspx) in New Zealand has written "[COBOL gets a hip replacement](https://www.linkedin.com/pulse/cobol-gets-hip-replacement-peter-e-c-dashwood/?trackingId=I0inNl2yTnKgL5AoM9PUNw%3D%3D)". Check it out!

Oh, and if you're up to it, the COBOL stream at [Programming-Idioms](https://programming-idioms.org/about#about-block-language-coverage) needs some TLC. Other languages need help too.
What's the proper way to run a DotNet ef migrations when deploying with Docker
Tags: help, dotnet, docker
Published: 2021-01-27 02:23:01

Hello Devs, im looking for the best aproach to update the app database (DotNet WebApi) when deploying to a Docker Container. This is what i have so far:
1 - Tried to run a migration inside the startup class using context.Database.Migrate(), for some reason didnt work. 
2 - Compose build and up, then manually 😅 run bash inside the aspnet container, install ef tool, add the migration and update database. 
3 - Get the SQL script runing DotNet ef migrations script and putting it inside a seed. SQL on the Postgres container. 

Im wondering if there is a automatic way to do that?
Tagged Template Literals in a Nutshell
Tags: javascript
Published: 2021-01-27 02:17:34

---
title: Tagged Template Literals in a Nutshell
published: true
date: 2021-01-27 02:14:51 UTC
tags: JavaScript
canonical_url: https://h.shadowtime2000.com/tagged-template-literals-in-a-nutshell
cover_image: https://carbon.now.sh/?bg=rgba%28171%2C+184%2C+195%2C+1%29&t=solarized+dark&wt=none&l=javascript&ds=true&dsyoff=20px&dsblur=68px&wc=true&wa=true&pv=56px&ph=56px&ln=false&fl=1&fm=Hack&fs=14px&lh=133%25&si=false&es=2x&wm=false&code=taggedTemplateLiteralFunction%2560%250A%2509my%2520%2524%257Btagged%257D%2520template%2520%2524%257Bliteral%2520%252B%2520%2522function%2522%257D%250A%2560%253B
---

Hi, in this post I will be writing about tagged template literals. Tagged template literals are like normal template literals but with more control given to functions you pass these as parameters to.

## Syntax

The syntax for tagged template literals is pretty simple. It uses backticks like normal template literals and allows you to have JavaScript expressions inside `${}` parts. Tagged template literals can only be used on functions though and when you are using them you omit the parentheses on the function call.
```js
taggedTemplateLiteralFunc`
	the stuff i put ${here}
`
```

## What They Do

So basically, instead of just calling the function as if it was a simple template literal being put as the first argument, it will take the string and compose it into a couple arguments which are called. It will follow the loop of taking all the string until it finds an interpolated expression, add that to one array, then take the value of that expression, and add that to another array. The JS engine will follow that loop until it reaches the end of the template literal. The first argument to the function is the first array, and then the second array is spread as if the `...` spread operator was used on it as all of the rest of the arguments of the function. 

This is an example of the same function being called with the same parameters just without the tagged template literals:
```js
myFunction`
1 + 2 = ${1 + 2}3 + 51 = ${3 + 51} = ${3 + 51}
`

myFunction(["1 + 2 = ", "3 + 51 = ", " = "], 3, 54, 54);
```

> 📚 Reading more:
> [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)

## Other Articles You Might Like

1. [What is ES6 Tree Shaking](https://h.shadowtime2000.com/what-is-es6-tree-shaking)
2. [Everything You Don't Know About ES Modules](https://h.shadowtime2000.com/everything-you-dont-know-about-es-modules)
JavaScript Best Practices — Classes
Tags: webdev, programming, javascript, codequality
Published: 2021-01-27 02:11:41

**Check out my books on Amazon at https://www.amazon.com/John-Au-Yeung/e/B08FT5NT62**

**Subscribe to my email list now at http://jauyeung.net/subscribe/**

Cleaning up our JavaScript code is easy with default parameters and property shorthands.

In this article, we’ll look at the best practices for creating classes.

* * *

### ES6 Class Basics

To make the prototypical inheritance model of JavaScript less confusing, the class syntax has been introduced in ES6.

It has the `constructor` , instance variables, and methods just like classes in languages like Java do, but they act differently.

For instance, we can create a class by writing:

We have the `name` instance variable and the `speak` method. `this` is the instance of the class itself.

* * *

### Getters and Setters

Getters are methods that only return values, whereas setters are methods that let us set a value to an instance variable.

They let us do either in a controlled manner rather than accessing instance variables directly.

We can also add getters and setters to the class as follows:

With these getters and setters, we can write the following to get `name`:

```
const person = new Person('joe');
console.log(person.name);
```

And set `name`:

```
const person = new Person('joe');
person.name = 'jane';
console.log(person.name);
```

* * *

### Child or Subclasses

We can also create child classes with the `extends` keyword. For instance, we can write:

We created a `Dog` class that overrides the `speak` method of the `Animal` class.

Also, we call the parent constructor with `super` in the `Dog`’s `constructor` and call `super.speak` to call the `speak` method of `Animal`.

This is much cleaner than the old constructor function syntax for inheritance.

* * *

### Static Methods and Properties

We can add static properties to a class by using the `static` keyword.

Doing that will help us add a property to it that’s shared by all instances.

For instance, we can write:

```
class Dog {
  static type() {
    return 'dog';
  }
}
```

Then we can call it as a static method as follows:

```
console.log(Dog.type())
```

To create static properties, we write the following:

```
class Dog {}
Dog.type = 'dog';

console.log(Dog.type);
```

We set the `type` property to `'dog'` and it’s shared across all instances.

This syntax is valid since classes are just functions and functions are treated the same as any other object in JavaScript.

* * *

### Private Fields

Future versions of JavaScript can also let us define private class fields. There’s no equivalent of this in constructor functions.

They are denoted by the `#` symbol in front of the field name.

* * *

### Conclusion

We can define constructors with the class syntax to make them look easier to understand than constructor functions.

The classes look similar to Java classes but act very differently underneath. We have to understand the underlying behavior before we use it. This means that we should understand prototypical inheritance before using JavaScript classes.
JavaScript Scope - Codecademy PRO version
Tags: tutorial, webdev, javascript, beginners
Published: 2021-01-27 00:46:54

**TL;DR:** I completed a **Scope** course in **JavaScript: Arrays, Loops, and Objects** module on Codecademy. This is a part of the 🔗 [**Codecademy Web Development Career Path**](https://youtube.com/playlist?list=PL7K3igiHYVk1_ulFuHesiv7BP_ALn82o8) series.



You can find the video on YouTube below ⬇️
{% youtube 9vN0yyJ2WOU %}



*If you like the video, don't forget to smash that like icon* 👍 *and subscribe* ❤️*. It will help a lot! Thanks!* 🙏



⏱️ Chapters:
🔗 [0:00](https://www.youtube.com/watch?v=9vN0yyJ2WOU) Intro
🔗 [0:35](https://www.youtube.com/watch?v=9vN0yyJ2WOU&t=35s) Scope
🔗 [1:40](https://www.youtube.com/watch?v=9vN0yyJ2WOU&t=100s) Blocks and Scope
🔗 [5:25](https://www.youtube.com/watch?v=9vN0yyJ2WOU&t=325s) Global Scope
🔗 [9:00](https://www.youtube.com/watch?v=9vN0yyJ2WOU&t=540s) Block Scope
🔗 [12:38](https://www.youtube.com/watch?v=9vN0yyJ2WOU&t=758s) Scope Pollution
🔗 [16:42](https://www.youtube.com/watch?v=9vN0yyJ2WOU&t=1002s) Practice Good Scoping
🔗 [21:20](https://www.youtube.com/watch?v=9vN0yyJ2WOU&t=1280s) Review: Scope
🔗 [23:14](https://www.youtube.com/watch?v=9vN0yyJ2WOU&t=1394s) Training Days
🔗 [32:02](https://www.youtube.com/watch?v=9vN0yyJ2WOU&t=1922s) Scope Quiz



📚 Materials/References:
🔗 [Scope cheatsheet](https://www.codecademy.com/learn/paths/web-development/tracks/web-dev-js-arrays-loops-objects/modules/learn-javascript-scope/cheatsheet)

Thanks for reading! I hope you find it useful.
Best keyboard for programming — change my mind.
Tags: keyboard, productivity, programming, discuss
Published: 2021-01-27 01:31:51

It's been over 20 years and believe it or not, I'm using the same **Chicony** natural keyboard throughout my entire [cybersecurity](https://www.pelock.com) career.

It's my first keyboard and I'm wondering why this trend has been abandoned and besides myself, I don't know or seem to have seen this type of keyboard on anyone else.

![Chicony Natural Keyboard](https://dev-to-uploads.s3.amazonaws.com/i/ayx26hdk317wn51nldus.jpg)

It's the best keyboard I have tried. Period.

* natural layout, very ergonomic
* it's built like a tank, years and years of hard work & abuse

I know it's a matter of getting used to it, but when I have to write something on a traditional keyboard it's terribly uncomfortable and I feel like I have to bang my elbows into my ribs to keep my hands straight.

My friends who have never seen a keyboard like this have a hard time hitting the keys.

I remember magazines from `199x-2000` - Chip, Computer World, where there were tests, reviews - Chicony, Microsoft, Cherry, different styles, some broken, with touchpad:

### Chicony 7903 Model

![Chicony 7903 Model](https://dev-to-uploads.s3.amazonaws.com/i/0gr6jjwfq0mq0ni4rrvn.jpg)

### Cherry 5000 Natural Keyboard

![Cherry 5000 Natural Keyboard](https://dev-to-uploads.s3.amazonaws.com/i/zlqn9kc0rbbh4keiqk9f.jpg)

### Microsoft Ergonomic Keyboard

![Microsoft Ergonomic Keyboard](https://dev-to-uploads.s3.amazonaws.com/i/flqu3pv6k64qy3eke4yr.jpg)

Chicony, as far as I know, no longer makes such keyboards (which is why I bought a second one a few years ago as a backup in case mine died), the Cherry 5000 is an archaeological relic that you can occasionally come across on eBay, and the only manufacturer of such keyboards that keeps improving them is Microsoft and recently Logitech:

### Microsoft Natural Ergonomic Keyboard 4000

![Microsoft Natural Ergonomic Keyboard 4000](https://dev-to-uploads.s3.amazonaws.com/i/gq51papym7q1sz5omqt8.jpg)

### Logitech ERGO K860 Wireless Split Keyboard

![Logitech ERGO K860 Wireless Split Keyboard](https://dev-to-uploads.s3.amazonaws.com/i/afjedaavgl8f7iexlw28.jpg)

### Kinesis Advantage2 Ergonomic Keyboard (KB600)

![Kinesis Advantage2 Ergonomic Keyboard (KB600)](https://dev-to-uploads.s3.amazonaws.com/i/9g0phz7yydp9ig7pbox8.jpg)

### What is your keyboard fellow programmer?

Do you use such keyboards, how do you feel about natural keyboards? Which keyboard is the most comfortable to type on and what can you recommend?

Leave the comment with the:

1. Keyboard model
2. Pros & cons
3. Images
4. Links

Thank you :)
C++ Pointer to Function
Tags: cpp, todayilearned, beginners
Published: 2021-01-27 01:15:57

Hey guys! I haven't written anything in a while, and this post will be very brief too. That said, I think you can greatly benefit from it, especially if you regularly have to deal with C/C++ (and even more likely if you learned C++ in school together with OOP).

Anyhow, I will show you a paraphrased snipped from Google's crypto library BoringSSL. It is a great example of using a pointer to function.

Here it is!

```c++
#include <iostream>
#include <string>

typedef void (*tool_func_t)();

struct Tool {
  const char *name;
  tool_func_t func;
};

void info_func() { std::cout << "You selected info" << std::endl; }

void help_func() { std::cout << "You selected help" << std::endl; }

const Tool kTools[] = {
    {"info", info_func},
    {"help", help_func},
};

tool_func_t find_tool(const std::string &name) {
  for (size_t i = 0;; i++) {
    const Tool &tool = kTools[i];
    if (tool.func == nullptr || name == tool.name) {
      return tool.func;
    }
  }
}

int main(int argc, char **argv) {
  if (argc == 1) {
    std::cout << "You didn't povide any arguments" << std::endl;
    return 1;
  }
  tool_func_t tool = nullptr;
  tool = find_tool(argv[1]);
  if (tool == nullptr) {
    std::cout << "You can either get info, or ask for help!" << std::endl;
    return 2;
  }
  tool();
  return 0;
}
```

The key step is `typedef` declaration which defines the function's signature (in this example takes no arguments and returns void). After that, you have great flexibility in working with functions having this signature.

Of course, you can read more about it on [www.learncpp.com](https://www.learncpp.com/cpp-tutorial/function-pointers/).
How to Install Node on Linux the Easy Way.
Tags: node, linux, npm
Published: 2021-01-27 18:05:04

---
title: How to Install Node on Linux the Easy Way.
published: true
date: 2021-01-27 00:00:00 UTC
tags: node,linux,npm
canonical_url: https://chand1012.dev//NodeTheEasyWay/
---

I recently started working on a few major NodeJS project, and found that installing the latest LTS release could be rather cumbersome on Linux. The application we’re developing is being hosted on Heroku, and will not be using a Docker container, and for a few reasons we would rather develop locally rather than in a container. Here is how I installed NodeJS and NPM on my Linux installations, and I found it quite easy. While this tutorial will be using Ubuntu’s `apt` and Arch Linux’s `pacman`, the process should be similar for most distributions. See [here](https://nodejs.org/en/download/package-manager/) for more information about installing NodeJS and NPM via your package manager.

First, install whatever versions of NodeJS and NPM are available in your distro’s package manager. For example, this is how you would install on Ubuntu 20.04.

```
sudo apt update
sudo apt install nodejs npm

```

This would be the command for Arch Linux.

```
sudo pacman -Syu nodejs npm

```


This will install a (probably) outdated version of NodeJS and NPM.

Next, you need to update NPM. To update NPM, simply run the following.

```
sudo npm i -g npm

```

Then, install the package [`n`](https://www.npmjs.com/package/n). This is a nice NodeJS installation manager similar to Ruby’s [RVM](https://rvm.io/).

```
sudo npm i -g n

```

To use `n` to install the latest or latest long-term support version of Node.

```
sudo n latest # for the newest version
sudo n lts # for the latest LTS

```

If you are just getting started, or you don’t know which to install, I _highly_ recommend you install the LTS version, as it is the most stable and has the best package support.

To finish the install, you either have to log out and log back into your terminal, or you can execute `PATH=$PATH`.

That’s it! You now have the latest version (or LTS version) of NodeJS and NPM installed on your Linux machine, ready to start your latest big project!
How to check if the cookie is enabled in a browser using JavaScript?
Tags: javascript
Published: 2021-01-27 00:00:00

---
  title: How to check if the cookie is enabled in a browser using JavaScript?
  published: true
  tags: JavaScript
  date: Wed Jan 27 2021 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/check-whether-cookie-enabled-browser-javascript
  cover_image: https://melvingeorge.me/_next/static/images/main-c86bfed8600a5caf3f7eedcd48d0b235.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/check-whether-cookie-enabled-browser-javascript)
  
To check whether a setting a cookie is enabled in the browser, you can use the `cookieEnabled` property in the `window.navigator` global object in JavaScript.

```js
// check if cookie enabled in browser
const isCookieEnabled = navigator.cookieEnabled;

console.log(isCookieEnabled); // true
```

- The property will return a Boolean `true` if cookie enabled and return `false` if not enabled.

See this example live in [JSBin](https://jsbin.com/vovococoko/2/edit?js,console).

### Feel free to share if you found this useful 😃.

---
Embed Video Meetings into a Website or App
Tags: video, meeting, webrtc
Published: 2021-01-27 21:37:22

---
title: Embed Video Meetings into a Website or App
published: true
date: 2021-01-27 00:00:00 UTC
tags: video,meeting,webrtc
canonical_url: https://igotablog.com/embed-video-meetings-with-jaas/
---

 ![Embed Video Meetings into a Website or App](https://igotablog.com/content/images/2021/01/Screenshot-from-2021-01-26-20.13.52@2x.png)

[Jitsi](https://meet.jit.si) is a great alternative to things like Zoom, Google Hangouts, and Skype. [It's open source](https://github.com/jitsi) and we use it daily at work for video meetings, happy hours, and building apps that require video and/or voice chat. It's both free as in beer (Open Source), plus 8x8 offers a hosted (paid) version called [Jitsi as a Service](https://jaas.8x8.vc)—or JaaS. If you don't want to figure out the infrastructure or maintenance, but want to customize your video meeting experience then JaaS is the answer. It works on Android, iOS and the web.

This short video covers how you can copy, paste, Jitsi. The first minute shows you how fast you can embed a video meeting in your website. Everything else is just me playing with webhooks, flashing lights, and customizing the colors. Check it out:

{% vimeo 502720048 %}

<iframe src="https://player.vimeo.com/video/502720048?app_id=122963" width="1280" height="720" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>

[Jitsi Docs](https://developer.8x8.com/jaas)