teleren/devto huggingface dataset:
Where to initialize components selectors in Angular?
Tags: angular, ngrx, javascript, typescript
Published: 2020-09-16 13:51:39

## TL;DR

When using the selector in the component, it is recommended not to initialize them in the declaration and instead initialize them in the constructor.

```typescript
export class FindBookPageComponent {
  searchQuery$: Observable<string>;
  books$: Observable<Book[]>;
  loading$: Observable<boolean>;
  error$: Observable<string>;

  constructor(private store: Store<fromBooks.State>) {
    this.searchQuery$ = store.pipe(
      select(fromBooks.selectSearchQuery),
      take(1)
    );
    this.books$ = store.pipe(select(fromBooks.selectSearchResults));
    this.loading$ = store.pipe(select(fromBooks.selectSearchLoading));
    this.error$ = store.pipe(select(fromBooks.selectSearchError));
  }

  search(query: string) {
    this.store.dispatch(FindBookPageActions.searchBooks({ query }));
  }
}
```

## Angular Type Safety

Initializing in the constructor helps because when using the **strict mode in TypeScript**, the compiler will not be able to know that the selectors were initialized on `ngOnInit`

The strictPropertyInitialization was added by default in the `--strict` mode in Angular 9.


The following checks where also added:
```json
{
  "//": "tsconfig.json",
  "compilerOptions": {
    "noImplicitAny": true,
    "noImplicitReturns": true,
    "noImplicitThis": true,
    "noFallthroughCasesInSwitch": true,
    "strictNullChecks": true
  }
}
```


>The strict-mode allows us to write much safe and robust application. Honestly, I think all Angular application should be written in strict-mode, but it is a little hard to understand every error messages caused by the compiler.

---
## References

- Angular 9 Strict Mode [here](https://indepth.dev/a-look-at-major-features-in-the-angular-ivy-version-9-release/#strict-mode)
- Angular Type safety [here] (https://medium.com/lacolaco-blog/guide-for-type-safe-angular-6e9562499d93)
- Strict Property Initialization in TypeScript [here](https://mariusschulz.com/articles/strict-property-initialization-in-typescript)
How does being a programmer affects your world view?
Tags: discuss, career
Published: 2020-09-16 13:44:10

We deal with complex systems on a regular basis and companies literally pay us to solve problems. 

Sometimes I find myself trying to optimize some aspects of my personal life and it makes me wonder if being a programmer sorta leaks into everything we do.

I'm curious about the community's thoughts on that, what do you think?
Elastic Compute Cloud(EC2)
Published: 2020-09-16 13:35:31

What is EC2-
Amazon is a web service that enables you to launch and manage server instances in Amazon’s data centers using APIs or available tools and utilities. We can use Amazon EC2 server instances at any time, for as long as you need, and for any legal purposes.

✓How EC2 Instance works?
Here are the steps:

Step 1: Launch Virtual Machine from AMI

Step2: Install software of that instance

Step 3: Create a new AMI

✓The Features include:

1.On Demand – It can be accessed from anywhere
2.Elasticity – It would be elastic when accessing Amazon Instances
3.Resource pulling – Amazon does multi-tenancy.  In simpler terms, they would have a huge data center which they would be virtualizing and offering through various channels.

✓Amazon Machine Images (AMI)-
An Amazon Machine Image (AMI) provides the information required to launch an instance. You must specify an AMI when you launch an instance. You can launch multiple instances from a single AMI when you need multiple instances with the same configuration. You can use different AMIs to launch instances when you need instances with different configurations.

✓To connect from the Amazon EC2 console-
-Open the Amazon EC2 console.
-In the left navigation pane, choose Instances and select the instance to which to connect.
-Choose Connect.
-On the Connect To Your Instance page, choose EC2 Instance Connect (browser-based SSH connection), Connect.
How to revert a pull request and apply the changes manually ? 
Tags: git, tutorial
Published: 2020-09-16 13:28:51

﻿It is a very common practice to following the git branching in your project to maintain a stable code base in production by having a development , staging and master branches.

First thing first, always commit your code everytime you make a significant changes in the respective branch. At some point your commit history would look like this. Let us call this branch as *feature/cancel-order-buton.*

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

The next thing you do is create a pull request to your development branch, that is it, you are done with your task. Then your usual development process continues and 5 other team members creates PR to development branch as well, at this point we have 6 PRs created including your PR.

Now, you need to remove complete code changes that you did in the development for some reason. If you are using a tool like eg. Bitbucket, you will be able to unmerge your PR easily. Once this is done, a new branch will be created with all the changes removed and then you can merge it back to development branch.

The next thing to do is cherry-pick the changes from the remaining 5 PRs and merge it to development branch

    git cherry-pick <commit-id>

Once all the changes from other branches are cherry picked and applied, you have successfully reverted your PR code from your development branch and you can continue the deployment process.
Any recommendations for a chair to pair with a standing desk?
Tags: discuss, help
Published: 2020-09-16 13:25:32

---
title: Any recommendations for a chair to pair with a standing desk?
published: true
description: I'm looking for a stool or chair to pair with my adjustable standing desk... got any recommendations?
tags: discuss, help
//cover_image: https://direct_url_to_image.jpg
---

I'm looking for a stool or chair to pair with my adjustable standing desk... got any recommendations?
🐛🐛🐛JS/TS npm templates
Tags: javascript, typescript, npm
Published: 2020-09-16 13:20:58

I wrote two templates, one is to build JavaScript and publish npm package, the other is to build TypeScript.

Copy the template, you can quickly create a package, no longer have to worry about annoying project configuration✨✨✨.

* https://github.com/webdev-template/js-npm-template
* https://github.com/webdev-template/ts-npm-template


---

Please help check, if you can provide star✨✨✨, it will be more perfect.
What's New In Odoo V14? Odoo V14 Updates, Features & Road Map
Tags: opensource, erp, update, features
Published: 2020-09-16 13:14:12

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/jjo0xusp8vov0qm50j26.png)
Odoo covers all of your business requirements which helps you to enhance the standard and therefore the efficiency of your business. there's the flexibility to customize as per the workflow of any business with highly useful data security measures.

With the discharge of Odoo 14 getting closer and closer, we thought now would be an excellent time to possess a fast check out the recently announced features, improvements, and changes that are coming with v14.

Get in-tuned with our [Odoo Consultant](#https://www.techultrasolutions.com/odoo-consulting) at TechUltra Solutions to urge the advantage of Odoo ERP solution built using the newest version of Odoo. 

The Odoo v14 is predicted to be released during the Odoo experience to be held in October 2020.

Odoo V14 New and Updated Features

As Odoo matures and therefore the functionality is enhanced, one among the goals is to make sure that it remains easy to use and navigate. Odoo 14 brings significant UI and UX changes to make sure that simple use isn't overrun by functionality as has occurred with a number of their competitors.

Here is a quick list of some changes coming in Odoo 14: 


Read more >[TechUltra Solutions] (https://www.techultrasolutions.com/blog/our-blog-2/post/what-s-new-in-odoo-v14-odoo-v14-updates-features-road-map-6)
VC investment is not right for most startups
Tags: venturecapital, startup
Published: 2020-09-16 13:04:05

---
title: VC investment is not right for most startups
published: true
description: VCs are just one among the many growth levers you have. But, are you ready to live with the consequences of being a VC-funded startup?
tags: venturecapital, startups
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/ihuc0ubx1ohp8f491te1.png
canonical_url: https://2.flexiple.com/no-vc-reports/i-want-to-know-if-i-should-work-towards-getting-vc-funding
---

Let's be honest, more often than not when a startup makes headlines, it is because they raised a VC round.

Sure, it does deserve some celebration. But VC funding is a means to an end, not the end itself, isn't it? Moreover, it is not a make or break for your startup. Rather it is just one of the many growth levers.

In the report, we look at some stats:
- Only 1% of startups actually get funded
- On average, startups spend about 6 months to get funding

Also, we breakdown the VC model and realise that its economics requires startups to make a 100x return. So, the question ask yourself - what is your motivation behind starting up?

I share my reports regularly on twitter - you can follow me there :)

{% twitter 1306205603770109954 %}

If you want to read the full report, you can [here](https://2.flexiple.com/no-vc-reports/i-want-to-know-if-i-should-work-towards-getting-vc-funding).
Make Node.js app realtime with less effort. 
Tags: node, mongoose, realtime, feathers
Published: 2020-09-16 13:00:56

It is easy to build Rest API using the express framework in node.js. But if you want to build a realtime application the change in the database reflects suddenly to the users then implementing socket.io you can make it but it is quite hard to implement the realtime feature, here comes the easy solution for you feathers js.


# what is feathers js ??
 It is a framework for real-time application and for making the rest API at no cost. this will provide a real backend framework where the code structure has maintained you easily build an application with minimum efforts. It supports databases like mongoose, post grays, almost every database.

# How you can install it 
  TO start with feathers backend you have to start with installing the feathers-cli, which is a command-line interface tool that helps you to generate an application.

# how to generate Feathers app

1. `feathers generate app` this command will going to ask questions like what should be your project name your preferences javascript or typescript. 

then it going to ask you question which database you like to implement
would you like to use the user authentication?

after some questions, it will go to generate an app for you.


#how it going to work

it has 3 main things in the src folder where 90% of our work we do.
  => model Folder
  => hooks folder
  => sevices


  Models: the model folder contains the model of your data you want to use in your project which is linked to your preferred databases. when you create any service it is going to automatically generate.

  Hooks: Hooks are the functions that are implemented before, after, or error the application. hooks have the context
of an object that contains the app, user-related data that can be manipulated before and after the data used. you can create a hook by running `feathers generate hook` It will generate a hook

  Services: Services contain the whole application rest API operation done through the services. you can make a change in the services to manipulate the data of the API. you can generate service by running the command `feathers generate service`

Feathers is easy to learn to go through the documentation for a clear understanding.

[Go to feathers](https://feathersjs.com/)
Introducing the Gatsby and TailwindCSS starter
Tags: gatsby, starters, tailwindcss
Published: 2020-09-16 12:52:34

This starter ships with the main Gatsby configuration files you might need to get up and running blazing fast with the blazing fast app generator for React. It is bundled with Tailwind CSS, a utility-first, highly customizable, low-level CSS framework that gives you all of the building blocks you need to build bespoke designs without any annoying opinionated styles you have to fight to override.

To clone this starter:

1. *Create a Gatsby site.* Use the Gatsby CLI to clone this repo, specifying the default starter.

`gatsby new my-default-starter https://github.com/kosvrouvas/gatsby-tailwindcss-starter`

2. *Start developing.* Navigate into your new site’s directory and start it up.

`cd my-default-starter/ gatsby develop`

3. *Open the source code and start editing!* Your site is now running at `http://localhost:8000`

If you want to contribute or just report an issue, you can find the Github repo [here](https://github.com/kosvrouvas/gatsby-tailwindcss-starter).
My first ever Github Action!
Tags: actionshackathon, django, github
Published: 2020-09-16 12:34:14

[Instructions]: # (To submit to the GitHub Actions x DEV Hackathon, please fill out all sections.)


This was my first ever encounter with any Github Action, so I have made a pretty basic workflow :sweat_smile:.

### My Workflow
[Note]: # (Make sure to include the name of your GitHub Action and share where it's being used!)
I built upon the existing [python action](https://docs.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions) to make sure that any user who merges to the `master` branch or creates a Pull Request to the `master` branch has to pass through the tests that have been built in the Django application.
This also makes sure that the code changed through the commit or PR also runs on the correct python version and does not break the existing code.


### Submission Category: 

[Note]: # (Maintainer Must-Haves, DIY Deployments, Interesting IoT, Phone Friendly, or Wacky Wildcards)
Wacky Wildcards


### Yaml File or Link to Code

[Note]: # (Our markdown editor supports pretty embeds. Try this syntax: `{% github link_to_your_repo %}` to share a GitHub repository)
{% github https://github.com/shrey27tri01/just-post-it %} 


### Additional Resources / Info

[Reminder]: # (Submissions are due on September 12th (11:59 PM PDT) and winners will be announced on September 23!)
Existing actions I have used: 
- {% github https://github.com/actions/checkout %}
- {% github https://github.com/actions/setup-python %}
Drawing a drive time polygon on a Google Map: how far you can go in 1 hour or more?
Tags: tutorial, webdev, datascience, javascript
Published: 2020-09-16 12:17:36

---
title: Drawing a drive time polygon on a Google Map: how far you can go in 1 hour or more?
published: true
description: A tutorial to explain how to use JavasScript to draw a travel time polygon on a Google Map. Sometimes known as a driving radius or isochrone.
tags: tutorial, webdev, datascience, javascript
cover_image: https://i.ibb.co/B6JCj58/15min-Driving.png
---

If you've ever wondered 'how far can I drive within 30 minutes?' you're not alone. Hundreds of people each week are looking to discover a way to draw a driving polygon on a Google map. 

Using Google Distance Matrix to make this shape means you'll either need to fire lots of expensive requests to the Google Routing API or you'll end up with a very basic polygon. The tutorial linked below is a walkthrough of how to make this visualization using the TravelTime API. You can sign up for a free trial key from TravelTime without adding your billing details.

The API works by calculating every possible latitude/longitude coordinate that rests on the travel time parameter. You will only need to make 1 API request to visualize a travel time polygon (aka isochrone).  

![15 minute driving](https://i.ibb.co/B6JCj58/15min-Driving.png)
<figcaption>15 minute driving travel time polygon using Google Maps & TravelTime API</figcaption>

The shape above is an example of a 15 minute drive time area in Central London. Travel time polygons can be any size from 5 minutes to 4 hours. It's also possible to use the tutorial to create polygons for walking, cycling, public transport, or combined transport modes.  

# Use cases
1. Draw many polygons for 5, 10, 15, 20, 25, 30 mins to see a heat map of where's reachable in different time catchments.
2. Overlap polygons and visualise where's mutually reachable by two or more start locations.
3. Combine polygons together. For example draw a 30 minute travel time area around every supermarket in the country. Combining this shapes will polarise the map to see the total accessible zones and total inaccessible zones.

#[READ TUTORIAL WALKTHROUGH](https://traveltime.com/blog/google-maps-drive-time-polygon-tutorial-driving-radius)
Wednesday Links - Edition 2020-09-16

Tags: java, kotlin, spring, rust
Published: 2020-09-16 12:08:36

JDK 15 G1/Parallel GC changes ( 4 min read ) 🧹
https://tschatzl.github.io/2020/09/01/jdk15-g1-parallel-gc-changes.html

EdDSA in JDK 15 ( 20 sec read ) 🔒
https://twitter.com/seanjmullan/status/1305867983823269892

Java Cryptography Uses in the Wild ( 24 min read ) 🔐
https://arxiv.org/pdf/2009.01101.pdf

Referencing other Properties in Spring ( 1 min read ) ↔️
https://www.mscharhag.com/spring/property-references

Kotlin 1.4.10 ( 2 min read ) 🆕
https://github.com/JetBrains/kotlin/releases/tag/v1.4.10

R2DBC support for MariaDB ( 20 sec read ) 🗄️
https://twitter.com/mp911de/status/1304305758192971776

Four common pitfalls of the BigDecimal class and how to avoid them ( 13 min read ) 🛑
https://blogs.oracle.com/javamagazine/four-common-pitfalls-of-the-bigdecimal-class-and-how-to-avoid-them

JEP 387: Elastic Metaspace in JDK 16 ( 5 min read ) 🦆
https://openjdk.java.net/jeps/387

Venkat Subramaniam: Java is changing in a responsible manner ( 7 min read ) 🎂
https://blogs.oracle.com/javamagazine/venkat-subramaniam-java-is-changing-in-a-responsible-manner

Customizing your GitHub profile - Scripting ( 8 min read ) 👤
https://blog.frankel.ch/customizing-github-profile/1/

Rust for Java developers ( 30 min read ) 🛢️
https://blog.codecentric.de/en/2020/09/rust-for-java-developers/
Daily Developer Jokes - Wednesday, Sep 16, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-09-16 12:00:08

---
title: "Daily Developer Jokes - Wednesday, Sep 16, 2020"
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%20Sep%2016%2C%202020"
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/5e1258c20b362.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:___ Why did the computer keep sneezing?

___A:___ It had a virus!
 -->
One Page For Bootstrap UI Library - Copy-Paste, With one Click
Tags: html, css, webdev
Published: 2020-09-16 11:30:02

Hello,

Last month we launched the first version of our Frontendor UI Library.

It was a very enjoyable start, full of excitement, and so far there are many positives from our customers, but many of them used to face the problem of forgetting in any file there is a specific block, so we to increase the work speed and productivity, we created one page in which they can copy the HTML & CSS of any block with one click.

Visit: https://frontendor.com/

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/r4ajgjnf4ts0hvisqa5c.png)
GitEye is released !
Tags: github, javascript, showdev, mongodb
Published: 2020-09-16 11:25:29

GitEye is a chrome extension which essentially provides an eye button for each file in GitHub. If the watched file is changed, you will receive an email from GitEye

This was my first project using Node JS , MongoDB. Really started to appreciate Node  now. 

Chrome extensions are fun and tricky to develop, I recommend anyone to try to develop one for fun.

If you want to try GitEye checkout it in the [chrome store](https://chrome.google.com/webstore/detail/giteye/ealpicjfmdaopfehcplgmghbbepcejli)

Also checkout the [official website](https://www.git-eye.com/)
Understanding Docker: part 6 – Scan Docker images
Tags: docker, devops, beginners, cloud
Published: 2020-09-16 11:23:28

---
title: Understanding Docker: part 6 – Scan Docker images
published: true
description: Serie of sketchnotes about Docker. Explaining in a visual way Docker principles.
tags: Docker, DevOps, beginners, Cloud
series: Understanding Docker in sketchnotes
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/nou0dfs4te5hipw4x2mh.jpg
---

Understanding Docker can be difficult or time-consuming. In order to spread knowledges about Cloud technologies I started to create sketchnotes about Docker. I think it could be a good way, more visual, to explain Docker (and others technologies like Kubernetes and Istio).

We continue the serie of Docker Sketchnotes with a focus about a useful (internal) tool: Scan.
It's not a tool you can find in Github, or in a Git repository, but it's a feature in Docker (only in Beta in Docker Desktop Edge for the moment).

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/nou0dfs4te5hipw4x2mh.jpg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/n1i4u873rjwae97e5ny0.jpg)

If you are interested, I published all the sketchnotes on Docker (and new ones!) to make a "book" of 93 pages: ["Understanding Docker in a visual way"](https://gumroad.com/aurelievache#YTLzM).

As usual, if you like theses sketchnotes, you can follow me, and tell me what do you think. I will publish others sketchs shortly :-).
A new syntax for Gwion!
Tags: proglangdesign, gwion, programminglanguagedesign, discuss
Published: 2020-09-16 11:22:39

# Syntax changes for Gwion

 > Check it [here](https://github.com/fennecdjay/Gwion/tree/NewSyntax)

I tried to address the syntax problems in Gwion.
Here's what I changed:

## Declaration

Declarations needs a prefix
  * `var`
  * `ref`
  * `nonnull`
  * `const`
  * `nonnull ref`
  * `const ref`
  * `const nonnull`
  * `const nonnull ref`

This fixes the ambiguity of placement between `const`, `nonnull` and `ref` and makes it easy both for the reader and the parser to know when a variable is declared.


Also, there is no longer a need to use `->` when declaring member types.
> old syntax
``` cpp
class C {
  class D {}
}

C->D d;
```

> new syntax
``` cpp
class C {
  class D {}
}

#! with the new 'var' modifier
var C.D d;
```

## Acces Specifier

Attained consistency in placement.
Now it is always:
  `static` or `global` or nothing
  followed by
  `private` or `protect` or nothing

## Templates

  * improve template placement consistency: now always on the right.
  * change `<~xxx~>` to `:[xxx]`. shorter and can be *packed* `Ptr:[:[int]Ptr]` (before: `<~<~int~>Ptr ~>Ptr` with he space mandatory)

So now all template can be written `xxx:[y,z]`

## new keyword: *funcdef*

to disambiguate with *typedef* used for type aliases.

## Ability to fix functions

Inspired by a similar feature in haskell, you can now write

``` cpp
#! Automatic conversion to pointer for the first argument
#! default of value 1 for the second argument
fun int add(Ptr:[int] i, int j : 1) {
  return j +=> *i;
}

#! declare a variable
var int i;

#! traditionnal
<<< add(i,1)     >>>;

#! chuck style
<<< (i,1) => add >>>;

#! infix
<<< i @add 1     >>>;

#! prefix
<<< ($add) i     >>>;

#! postfix
<<< i $add       >>>;
```

## Conclusion

I think that's all (well that and the usual bug fix here and there).

In my opinion, this is a huge improvement, but it's now up to you to tell me if there is something wrong, if you like it,  whatever...

If nobody sees a problem with it, I'll merge next week.