teleren/devto huggingface dataset:
Vue项目搭建
Published: 2022-09-01 03:24:07

1. 搭建NodeJs环境

   - 下载地址：https://nodejs.org/zh-cn/

   - 检查node版本,出现版本号说明安装成功

     ```
     node -v
     ```

   - 切换淘宝镜像源提高速度,以后使用 cnpm 代替 npm

     ```
     npm install -g cnpm --registry=https://registry.npm.taobao.org
     ```

2. 搭建Vue环境

   - 全局安装 Vue-Cli

     ```
     cnpm install -g @vue/cli
     ```

   - 查看安装的版本

     ```
     vue -version
     ```

   - 版本过低

     ```
     npm update -g @vue/cli
     ```

3. 创建项目

   - vue create <项目名>
   - cd 该项目文件夹下
   - npm run serve 运行项目

4. 项目初始化配置

   - 项目运行起来自动打开浏览器

     ```
     --- package.json
      "scripts": {
         "serve": "vue-cli-service serve --open",
         "build": "vue-cli-service build",
         "lint": "vue-cli-service lint"
       },
     ```

     出现的问题-打开的网址是0.0.0.0:8080

     ```
     --project- vue.config.js
     module.exports = defineConfig({
       transpileDependencies: true,
       devServer: {
         host: "localhost",
         port: 8080,
       },
     });
     ```

   - 关闭eslint校验功能

     ```
     --project- vue.config.js
     lintOnSave: false
     ```

   - 配置src文件夹别名为@,@代表src文件夹,方便寻找文件

     ```
     --project--jsconfig.json
     {
       "compilerOptions": {
         "baseUrl": "./",
         "paths": {
           "@/*": [
             "src/*"
           ]
         }
       },
       exclude:[
       "node_modules",
       "dist"
       ]
     }
     ```
The Best Coloring Pages for Kids - All Ages!
Published: 2022-09-01 03:16:54

When you are a kid, it’s hard to imagine life without color. Even though our vision is constantly changing as we get older, the need to paint things in specific colors remains the same. When we are little, it’s hard to understand that sometimes, different things look the same to other people. For example, if you sent your child to visit friends who don’t have children, they might not realize that you’d be coloring books together and coloring pages together. They might think that you’re just looking for a place to hang out or play games. However, once your friend kids grow up and have their own kids, they will recognize that this is where you both spend time together as a family during the weeknight after-school program. It doesn’t matter how old you get; asking someone else to color can cause stress and anxiety for even the youngest of us. That’s why we created coloring pages for kids of every age! From toddler to adult, everyone can find something fun and enjoyable on these pages!

Download and print free coloring drawings at [kleurplatenprinten](https://kleurplatenprinten.nl/)

What is the best age to color pages?
Most kids between the ages of 2 and 5 can color without any adult help. After that, it is recommended that you practice on a smaller scale with your child. A lot of kids enjoy coloring with crayons when they’re young, but once they get a little older, they’ll likely prefer to use markers, pencils or stickers. Some kids, even as young as 2 or 3, are able to recognize colors and use them to solve simple problems like “what’s that color?” They may also be able to tell you what object is red, blue or green based on the color.

Coloring for kids of all ages
There are so many coloring books for kids on the market that it can be hard to choose the right one. If your little one is between the ages of 2 and 5, there’s probably a coloring book just right for them. If your kiddo is between the ages of 6 and 10, you may want to look into the more advanced coloring books for kids. There are many different age groups for coloring books, so you’ll want to be careful when choosing your child’s favorite coloring book.

Explore more Paw Patrol coloring pages at [paw patrol kleurplaat
](https://kleurplatenprinten.nl/film/paw-patrol/)


Coloring for adults
If you enjoy coloring, but prefer doing it by yourself, there’s no better time than now. A lot of people think that adult coloring books are just for kids, but they can be just as fun for adults as they are for kids. You may want to start coloring for adult friends or even for your boss if you work in an office environment. There are many different ways to go about this. You can browse through our huge collection of free coloring books or choose from our favorite collections below.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kt55adcywnk627bdmlim.png) 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wctqww03v5ijekw0v4ck.png)
Tracking Aircraft in Real-Time With Open Source - Apache Pulsar
Published: 2022-09-23 17:19:23

---
title: Tracking Aircraft in Real-Time With Open Source - Apache Pulsar
published: true
date: 2022-09-01 03:00:00 UTC
tags: 
canonical_url: 
---

https://youtube.com/embed/0LMOglFN8ZA
5 Fun and Unique Coloring Pages to Entertain Your Kids
Published: 2022-09-01 02:20:04


Coloring pages are some of the best ways to spend time with the kids on a Friday night. The reason why is pretty simple – coloring books get you away from the TV, computers and smartphones for a couple of hours, which is great for the family unit. Plus, they’re a fun way to keep your little ones occupied while you run to the loo or do some chores around the house. We all know that FaceTime isn’t just for parents these days; kids love seeing and talking to their friends too. So if you’ve got young ones who enjoy coloring as well, why not set up a coloring page app on their phone? That way, when they’re finished with their coloring page, they can go online and see what other people have created using the same picture or text.

Download and print free coloring drawings at [kleurplaten printen](https://kleurplaat123.nl/)

What are the benefits of using a coloring page app?
If your kids love to color, there’s no doubt they’ll love using coloring pages. These apps are designed with young kids in mind, offering coloring pages and activities that are simple enough for them to complete without being able to read. Plus, there are plenty of online coloring pages and activities to choose from so you can pick the one that’s right for your kids.

Free Printable Coloring Pages
If you’re not the creative type, or you simply don’t like creating your own free printables, there are plenty of free printable coloring pages available online. All you have to do is search for free coloring pages on the internet and view the available options. You’ll probably be surprised how many coloring pages are free.

How to Entertain Kids with Coloring Pages
If your kids love to color and you’re looking for a fun, creative way to spend time together, try to incorporate some coloring into your regular routine. Put away the markers, crayons and other coloring tools and let your kids draw pictures on paper. Ask them to choose their favorite animal or food and have them draw that too. At the end of the time you might notice your little ones are more focused and less scattered when they’re just focused on one thing – drawing pictures. Plus, there are tons of coloring pages and activities for kids that are suitable for kids of all ages, including online coloring pages and printable activities.

45+ Fun and Unique Coloring Page Designs
Ready to try some new coloring pages? Before you pick a design, check out these 45+ fun and unique coloring page designs. They might just inspire you to try out some new ideas as well! If you’re looking for a simple and easy way to spend time with the kids, a coloring page is the perfect way to go. All you have to do is pick a picture or two and get to work. No need for fancy coloring pages or fancy apps – just a picture and some markers will do.

Discover more LOL drawings at [kleurplaat lol](https://kleurplaat123.nl/film-kleurplaten/lol-surprise/)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z4c9xu6kvzvgwmfmf0r0.png)
Javascript Tagalog - Math.sqrt
Tags: javascript, tagalog, filipino, sqrt
Published: 2022-09-01 01:57:44

**Ano ngaba ang Math.sqrt sa Javascript?**
Yung Math.sqrt, re-return niyalang yung square root ng binigay mong number.(also i ta-try ni js na i convert ang mga binigay na value as a number if hindi number data-type yung binigay)

```javascript
console.log( Math.sqrt(64) ) // 8

console.log( Math.sqrt('16') ) // 4

console.log( Math.sqrt(4) ) // 2

console.log( Math.sqrt(1) ) // 1 
```

---

**More tagalog Javascript Learning Resources:**
https://javascript-methods-in-tagalog.vercel.app/
Parse Google Sheets JSON Export into JavaScript JSON Object
Published: 2022-09-01 01:44:05

*I work for [Akkio](https://akkio.com), where I'm building out a no-code predictive AI platform. If you're looking to harness the power of AI without needing a data scientist, give us a try!*

## The Problem

Google lets you conveniently export public sheets into a JSON object using a URL like the following:

https://docs.google.com/spreadsheets/d/{SPREADSHEET_ID}/gviz/tq?tqx=out:json&sheet={SHEET_NAME}"

However, there's a bit of extra data included in the parse that messes up the JSON parse:

- **At the beginning:** /*O_o*/\ngoogle.visualization.Query.setResponse(
- **At the end:** );

## The Solution
We trim the beginning and end bits off and get a perfectly usable JSON object:

```javascript

const data = await fetch(URL);
let text = await data.text();
text = text.replaceAll(
  "/*O_o*/\ngoogle.visualization.Query.setResponse(",
  ""
);
text = JSON.parse(text.substring(0, text.length - 2));
```
What is an Arrow Function? -Part 2
Tags: javascript, beginners, programming, tutorial
Published: 2022-09-01 01:05:04

![arrow functions](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jlfx7baq3278pp3qqt7t.jpeg)

###Implict Return
In JavaScript, an implicit `return undefined` occurs when the `return` statement is omitted from a function. The word implicit in this context refers to something that is implied but not directly stated. In other words, there was no `return undefined` as it would result in `undefined`.

Example:
```javascript
const sum = (a, b) => {
   a + b;
}

sum(2, 5); // undefined
```
In the above example, `sum(2,5)` returns `undefined` because we don't have the `return` keyword in the function body.

Example:
```javascript
// implicit return
const sum = (a, b) => a + b;

sum(2, 5); // 7
```
The return keyword and curly braces are not necessary if your arrow function is only one line long.

```javascript
//without implicit return
const canVote = age => {
   return age >= 18;
}
```
Let's utilize implicit return by:

- removing the curly braces

- removing the `return` keyword

```javascript
const canVote = age => age >= 18;
```
This is the clearest and shortest approach to write this function.

###Array Methods Using Implicit Returns
Now let's see how to create the callback using arrow functions and implicit returns.

###Array.filter()
```javascript
//without implicit return
const ages = [10, 15, 21 45];

const agesAboveTwentyOne = ages.filter(function(age) {
   return age > 21;
});
console.log(agesAboveTwentyOne); //[21, 45]


//with implicit return
const agesAboveTwentyOne = ages.filter(age => age > 21);
```
We filter the `ages` where the `age` is bigger than 21.

###Array.find()
```javascript
//without implicit return
const furBabies = ['Dutches', 'Monty', 'Benny', 'Lucky', 'Chili'];

const findNames = furBabies.find(function(furBaby) {
   return furBaby === 'Benny';
});
console.log(findNames); // 'Benny'


//with implicit return
const findNames = furBabies.find(furBaby => furBaby === 'Benny');
```
From the `furBabies` array, find the `furBaby` that is equal to the string `'Benny'`.

###Array.map()
```javascript
//Without implicit return
const numbers = [2, 6, 8, 10];

const tripled = numbers.map(function(number){
  return number * 3;
});
console.log(tripled); //[6, 18, 24, 30]


//with implicit return
const tripled = numbers.map(number => number *3);
```
Create a new array based on the `numbers` array, where every `number` is multiplied by 3.  

####Please share your thoughts in the comments section below. I'd love to hear your thoughts. Or please drop by and say '👋'.
Who Am I?
Published: 2022-09-01 00:09:51

## Hello! My name is Hidemichi Shimura

I am a Japanese who was born and raised in Okinawa, which is a small island located in the southern part of Japan and has beautiful beaches, nature and delicious cuisines. I spent all of my life in the small island. Although I was there for my entire life, I am currently in Vancouver, Canada. Why am I in Canada, which is very far from Japan? And what am I doing there?


## What I do in Canada

There are many reasons why people come to Canada. Then what about me? I am a student at Cornerstone International Community College of Canada, which is abbreviated to CICCC. My course at CICCC is **Web and Mobile Development**. Maybe you can guess what I learn at school from the course name. Just as your guess, I learn programming for developing web sites, web applications, mobile applications and etc. 


## Why I learn Web and Mobile Development in Canada

The reason I decided to go to Vancouver for learning web and mobile development is that Vancouver's tech industry has been growing rapidly and attracting a number of engineers from other countries. Besides those facts, there is one more attractive thing to me. It is **salary**💵. Software engineers in Vancouver tend to get paid well compared to ones in Japan. When I found out those facts, they instantly got my attention, made me decide to go to Vancouver and become a software engineer in Vancouver.


## What I learn at school

Let me tell you what I am actually learning and what I want to become in the future. I want to become a software engineer who can be engaged in various things at the later phase of my career. But for now, I am more interested in front-end development. Therefore I have been learning technical skills in regard to front-end development such as HTML, CSS and JavaScript.


## What I want to become

I am currently trying to become a front-end developer. But once I become a front-end developer and acquire years of experiences as a front-end developer, I want to learn about back-end development as well and shift to a back-end side. When I obtain experiences of both front-end and back-end, I would like to start my career as a full-stack developer. I have not made a decision of what I want to become after becoming a full-stack developer yet. But I might continue being a full-stack developer or dive into another field such as DevOps. But I am sure that I will experience a lot of things and figure out what I want to do next in the tech industry. 


## My Goal

One of the benefits to become a software engineer is that you can work from anywhere. You might be able to work from home, another work space, a cafe and maybe a beach. My goal is that I work from a beach. If I could work from a beach, I would finish work and dive into water right away. In order to make it come true, I am going to keep learning!
Backward compatibility
Tags: architecture, backwardcompatibilit, microservices, monolith
Published: 2022-10-20 06:47:14

---
title: Backward compatibility
published: true
date: 2022-09-01 00:00:00 UTC
tags: architecture,backwardcompatibilit,microservices,monolith
canonical_url: https://jhall.io/archive/2022/09/01/backward-compatibility/
---

What are the things you consider when writing code?

_Does it work?_

_Is it efficient?_

_Is it readable?_

_Will it actually be used?_

All good things to consider. And I’m sure you think of many more.

Do you also consider backward compatibility?

This is one charactaristic that I find is often overlooked. Often because it’s considered a non-issue, even in places where it actually is a very important issue.

For mobile or desktop apps like, say, Microsoft Word, the desire for backward compatibility is usually pretty obvious. Of course you want the ability to read documents you created last year. Or last decade. You likely also want to create documents that others, who aren’t using the latest version, can read.

What if your software is entirely cloud-hosted? Should you compare about backward compatibility?

Well, if you have a microservices architecture, then backward compatiblity is still important, although perhaps not for as long. A key benefit of microservices is that you can upgrade one service without upgrading all services. This implies that some level of backward compatibility must be maintained.

If service A depends on service B, then you can’t just upgrade service B willy-nilly without considering that service A depends on it in some way. This obviously applies to complete features: you can’t remove the file storage feature from service B that service A uses. But it can also be much more subtle things, like RPC formats. If service B suddenly starts expecting a new query parameter on every request that A doesn’t know about, you’ll have some serious problems.

But what if you’re running a monolith? Surely you’re out of the woods, right?

Not so fast.

If you want to take advantage of rolling, canary, or blue/green deployments, then there will always be times when you’ll have two versions of your application are running at the same time. Are these two versions compatible with each other? A change to session cookie formats, for a real-world example, could prove very frustrating for your users, even if the new version converts cookies from the old to new format… because your visitor may talk to both the old and new versions, even on a single page load (depending on how your load balancer works).

TL;DR; backward compatibility is a valid, and important, concern in most applications, at least some of the time. Learn to watch for these cases!

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
Chrome插件开发 - Icon action
Published: 2023-08-13 02:15:01

---
title: Chrome插件开发 - Icon action
published: true
date: 2022-09-01 00:00:00 UTC
tags: 
canonical_url: https://manon.icu/blog/translate/build-chrome-extensions/icon-action
---

## 浏览器扩展图标 - action

修改`public/manifest.json`

```json
{
  "action": {},
  "background": {
    "service_worker": "background.js"
  }
}
```

修改`public/background.js`

```js
chrome.action.onClicked.addListener(() => {
  chrome.tabs.create({url: './new-tab.html', active: true})
})
```

当点击图标，将会导航到新的选项卡

## Source Code

[【Source Code】](https://github.com/rebelchris/new-tab-extension/tree/action)
Trim trailing slash
Published: 2023-07-26 17:57:14

---
title: Trim trailing slash
published: true
date: 2022-09-01 00:00:00 UTC
tags: 
canonical_url: https://thomasrigby.com/articles/trim-trailing-slash/
---

 ![silver scissors on pink surface](https://thomasrigby.com/images/U7wC5ZHbkV-300.jpeg)

Sometimes a URL has a trailing slash, sometimes it doesn't. If we can't be certain, we need to handle either eventuality.

## Shut up and give me the code!

```
const trimTrailingSlash = (x) => x.split('').reverse()[0] !== '/' ? x : x.substring(0,x.split('').length -1);

```

## Let's break that down

First off we're creating an [arrow function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions) that will accept an input that we're calling `x`.

Inside the function, `x` is `split` into individual characters creating an array. The array is reversed using, well, `reverse()`. This means we can check the _first_ character (`[0]`) instead of having to work out what the _last_ character is - smart!

If that character does not equal (`!==`) a slash simply return the given string. Bouncing out of a function as soon as possible keeps our code quick!

If the character is a trailing slash, we want to get rid of it; to return part of a string, we can use `substring`.

Substring takes two parameters: the starting index and the finishing index. We will start at `0` which is the very first character and finish with the second to last character (the one before the `/`).

To figure what that number is we, again, `split` the string into an array and use the total number of items (`.length`) minus 1.

## Alternative solution!

Using [`String.prototype.endsWith()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith) and [`String.prototype.slice()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice), we can shorten this function - and make it a little more readable! 🎉

```
  const trimTrailingSlash = (x) => x.endsWith('/') ? x.slice(0,-1) : x;

```

`.endsWith()` works exactly how you would imagine: if the string _ends with_ the given character, the method returns `true`, otherwise it returns `false`.

## Conclusion

To trim a trailing slash from a URL requires two operations;

1. We must determine if the last character is a slash
2. If it is, we must remove the slash

Each of these steps can be performed in several ways, you can mix-and-match them how you want.

I've not done any performance testing on these so I couldn't tell you which is fastest when trimming the trailing slash from 40,000 URLs but, unless you _are_ working with 40,000 URLs, just pick the one you feel is the most readable.
How to create a fixed-size array in Go or Golang?
Tags: go
Published: 2022-08-31 23:47:54

---
  title: How to create a fixed-size array in Go or Golang?
  published: true
  tags: Go
  date: Thu Sep 01 2022 05:17:54 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/create-fixed-size-array-go-golang
  cover_image: https://melvingeorge.me/_next/static/images/main-b042a02b336c897966d0003586be1c38.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/create-fixed-size-array-go-golang)
  
To create a fixed-size array in Go or Golang, you need to write the `[]` symbol (square brackets), and inside the brackets, you have to write the number of items you wish to store in the array. After the square brackets symbol, you have to specify the type of elements that you wish to store in the array followed by the `{}` symbol (curly brackets).

### TL;DR

```go
package main

import "fmt"

func main(){
    // create an array of `string`
    // type that can hold `5` items
    // and add a few names to it
    names := [5]string{"John Doe", "Lily Doe", "Roy Doe"}

    // log to the console
    fmt.Println(names) // [John Doe Lily Doe Roy Doe]
}
```

For example, let's say you need to create an array of `names` and should hold only 5 items in the array.

To do that, first, we can write the `[]` symbol (square brackets) and inside the brackets, we can specify the number of items that we wish to hold in the array, which is the number `5` then the write type of the elements in the array which is the type of `string` without any whitespace followed by the `{}` symbol (curly brackets).

It can be done like this,

```go
package main

func main(){
    // create an array of `string`
    // type that can hold `5` items
    [5]string{}
}
```

Now let's assign the array to a variable called `names` like this,

```go
package main

func main(){
    // create an array of `string`
    // type that can hold `5` items
    names := [5]string{}
}
```

To add items to the array, we can simply add the `string` type elements inside the `{}` symbol separated by the `,` symbol (comma).

It can be done like this,

```go
package main

func main(){
    // create an array of `string`
    // type that can hold `5` items
    // and add a few names to it
    names := [5]string{"John Doe", "Lily Doe", "Roy Doe"}
}
```

Finally, let's print the `names` array to the console to see the added array elements.

It can be done like this,

```go
package main

import "fmt"

func main(){
    // create an array of `string`
    // type that can hold `5` items
    // and add a few names to it
    names := [5]string{"John Doe", "Lily Doe", "Roy Doe"}

    // log to the console
    fmt.Println(names) // [John Doe Lily Doe Roy Doe]
}
```

As you can see that the names have been logged to the console which proves that the `names` array is successfully created.

See the above code live in [The Go Playground](https://go.dev/play/p/a-54O2eXBpf).

That's all 😃.

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

---