teleren/devto huggingface dataset:
ng serve ...'@angular/compiler not loaded
Published: 2022-03-26 23:35:36

I'm a little green to Ionic/Angular and am not entirely sure where the dividing line between the two is so...

Angular CLI: 9.1.2
OS: win32 x64
Angular: 9.1.13
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.29
@angular-devkit/build-angular     0.1000.8
@angular-devkit/build-optimizer   0.1000.8
@angular-devkit/build-webpack     0.1000.8
@angular-devkit/core              10.2.4
@angular-devkit/schematics        10.2.4
@angular/http                     7.2.16
@ngtools/webpack                  10.0.8
@schematics/angular               13.3.0
@schematics/update                0.901.2 (cli-only)
rxjs                              6.6.7
typescript                        3.8.2
webpack                           4.43.0

Using "ionic serve" or "ng serve" at the command line, my app seems to compile with no errors present in the terminal window. At the completion of compiling in the terminal window, a browser (chrome) tab is opened and I can see my favicon in the tab but the browser tab is blank. F12 shows the console and this is what it says:

Error: Angular JIT compilation failed: '@angular/compiler' not loaded!
  - JIT compilation is discouraged for production use-cases! Consider AOT mode instead.
  - Did you bootstrap using '@angular/platform-browser-dynamic' or '@angular/platform-server'?
  - Alternatively provide the compiler with 'import "@angular/compiler";' before bootstrapping.

I've googled every piece of this message and gone down some trippy rabbit holes and I always come back to this. I'm sure this isn't enough info to get the help I need so I'm happy to provide whatever details I can. Thanks in advance.

Joe
Toggling state of a bool value
Tags: csharp, unity3d, beginners, gamedev
Published: 2022-04-29 14:59:47

I have seen many beginners do this mistake and when I started out I did this mistake too so lets see what the mistake is and how to fix it.
So lets say you have a bool Variable called _LightState_ which manages if the light switch is on or off. Now say when player presses a key for example "F" then you want to change it most people write the following.
```cs
    bool LightState = false;
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.F))
        {
            // If the Lightstate is false then make it true
            if (LightState == false)
            {
                LightState = true;
            }
            else //If Lightstate is true make it false
            {
                LightState = false;
            }
        }
    }
```
Now this code is simple but it will take a little more time to read so instead you can do the following
```cs
    bool LightState = false;
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.F))
        {
            //Whatever the lighstate is make it opposite of that.
            LightState = !LightState;
        }
    }
```
Tips to get a job as a Python developer
Published: 2022-04-29 14:50:15

Here are some useful tips for making a career in a Python job.

**1.Gain mastery over the language**

Form a solid groundwork with the principles of Python and then check out covering up advanced subject areas like data models, bytecode semantics, runtime stack inspection, metaclasses, coroutines, multithreading, etc.  Only when you have a firm grasp on the language, would you like to feel confident about using it in the workplace.

**2.Get relevant certifications**

Learning  Python on the own is a wonderful alternative but if you wish to be able to make your expertise look more legit, it is very best to complete some sort of course or have a [Python Training](https://www.igmguru.com/data-science-bi/python-training/)  certificate. In the event you have some sort of particular vocation or perhaps job profile throughout mind, you can easily get a certificates in a even more specific module or perhaps area. It will probably put weight towards your  CV and make the impression on some sort of future employer.

**3.Follow blogs and tutorials**

It is very important stay up to date with everything that is new in the world of Python as well as its applications. One way to do this is to apply the World wide web to follow interesting sites and helpful tutorials which upgrade regularly on new developments regarding Python and its real-life uses.

**4.Complete Python projects**

No matter if done independently or as part of a course, completed projects are necessary so that you can master the language. It truly does not only brings to work experience, but also makes it possible to improve as a programmer. You can use more advanced functions as you development to sharpen your Python skills over time.
Know more : https://youtu.be/slSDox6mzIE
One new kind of hackathon
Tags: stripe, motivation, todayilearned, productivity
Published: 2022-04-29 14:50:04

> A hackathon is any event of any duration where people come together to solve problems.

This is a complete and synthetic definition of what an hackathon is.
Usually in the tech field an Hackathon is a big event where promoters/companies challenge teams to overcome challenges and solve problems in a time constrained environment.

The teams can be both "pre-made" or formed on the fly during the event.

This kind of event is mainly used by the companies for two reason:

- Finding new talents
- Marketing the company itself who is organising/promoting the hack

The hackers instead find this a good way of connecting to fellow hackers and to up skill theirselves.


Personally I've participated into lots of those hackathon and just recently I experienced a new kind of hack, which really made my dev life, a lot better.

---


I currently work in a Tech department (1.5 years old)  as a backend software engineer of a non-tech related company (~15 years old) doing the best to modernise it and make a huge breakthrough with a "digital wave" of solutions.
I'm also part of a team (that ourselves) called "Flexers" and we, as a team, decided to take on a big challenge and make an hackathon out of it.

We set the epics, investigated on feasibility and profitability for the company and then we just took a flight to Portugal to reach the goals in a week.

It is a really game changer in the team-building routine you might have in a company, since it will put have the team creating bonds while cooking or deciding what to do for the evenings.

On top of that, communication and exchange of ideas is 200% (really accurate rate) increased and better because everyone has an high level of comfort while working.

---

These were my outtakes of the last week, I sure it won't apply to everybody, but I just wanted to make it public as a good way of learning stuff and creating good synergies between people.

Please comment with your opinion on this :D



P.s. of course we reached the goal by implementing Stripe in-person terminal and Call-center payments for our CRM ;)
Why did Ubuntu did this?!? Every Ubuntu users will be crying after hearing this😭😭😭😭😭
Tags: ubuntu, bugfix, discuss, tutorial
Published: 2022-04-29 14:46:49

**To all the users who use Ubuntu 22.04 - **
You may be finding a bit of problem with the gnome-extension or your browser seems to be not right. It is slow and not opening fast, right?

This is why it happened. Ubuntu 22.04 has Pre-installed browser - which is Firefox. It is a nice browser but Ubuntu have done a wrong thing!

All the time, Firefox debian package was installed using apt in all the recent versions but in Ubuntu 22.04, it has changed. They used the Snap package. It had made Firefox worse. The snap package made the app open slow and there are problems with gnome-extension. 

After hearing this, I immediately Uninstalled the Firefox using the command below 👇 -
`sudo snap remove firefox`

Then I added the apt-universal package using the command below 👇
`sudo add-apt repository ppa:mozillateam/ppa`

Now add these line of code in the given file using the given command -
First type the command below in the terminal 👇 -
`sudo nano /etc/apt/preferences.d/mozillateamppa`
Now you will be in the nano file text editor. After that, Type these lines of code in it. You can also use nvim instead of nano.
Copy these lines and paste it in the file -

```
Package: firefox*
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 501
```

Now install the Firefox browser again by using the command below 👇 -
`sudo apt install firefox`

Now see the magic! It will be open again and Your Gnome-extensions will work fine. Try it yourself. If there is any issues then comment. 

Signing off,
Gautham G Nair.
TruStacks Demo Release!
Tags: devops, react, python, kubernetes
Published: 2022-04-29 14:46:37

We are excited to release our first demo version of TruStacks! The video will show how TruStacks turns the CI toolchain into a rapidly deployed and orchestrated commodity. We would like to answer any questions you may have as well as your feedback. Thanks :)

https://www.youtube.com/watch?v=SjpAXKI1xMA
How to send promotion emails with Shopify Orders at random, with a Pipedream workflow
Tags: productivity, tutorial, node
Published: 2022-04-29 14:35:35

Discount codes are a great way to build customer loyalty. Even better, adding a layer of chance adds an element of excitement to the order.

In this episode we show you how to generate promotional emails from your Shopify orders without adding any apps to your store.

You can control how chances each order has of triggering a discount code in an email. Or you can remove this random portion altogether for a post-purchase email message.

{% embed https://youtu.be/ogTFZXiibTQ %}

Here's the random number generator code step you can use in your workflows:

```javascript
export default defineComponent({
  props: {
    minimum: { type: 'string' },
    maximum: { type: 'string' }
  },
  async run({ steps, $ }) {
    const max = parseInt(this.maximum);
    const min = parseInt(this.minimum);

    return Math.floor(Math.random() * (max - min + 1) + min);
  },
})
```

Learn more and get connected!

🔨  Start building at https://pipedream.com
📣  Read our blog https://pipedream.com/blog
💬  Join our community https://pipedream.com/community
AWS Secret Manager - Complete Tutorial
Tags: aws, devops, cloud, security
Published: 2022-04-29 14:16:14

## How to use AWS Secret Manager

This article it's a complete tutorial that you need to read before getting started.

[How to use AWS Secret Manager](https://www.bitslovers.com/how-to-use-aws-secret-manager/)

Some Topics:
- What is AWS Secret Manager?
- Why use it?
- What are the best practices?
- How do you use it?
- How to rotate your password the right way.

Enjoy the reading.
Webinar: ¿Cómo crear un API con NestJs, GraphQL y MongoDB?
Published: 2022-04-29 14:13:51

**¿Te gustaría aprender a crear un API con NestJs, GraphQL y MongoDB?** Este webinar es para ti.

Link grabación en Youtube: https://youtu.be/vsHRlt9cFwA

Veremos una introducción a **Nestjs**, un popular framework progresivo de **Node.js** para la creación de aplicaciones eficientes, confiables y escalables del lado del servidor, el cual está construido y es completamente compatible con **TypeScript**, combinando elementos de la programación orientada a objetos, programación funcional y reactiva.
Junto a Nestjs también veremos **GraphQL**, una alternativa a las API REST, que permite que los desarrolladores creen consultas para extraer datos de varias fuentes en una sola llamada a la API.

Además usaremos **MongoDB** que es un sistema de base de datos NoSQL orientado a documentos de código abierto. También usaremos junto a el, el ORM **Mongoose**, que es una librería que nos permite crear consultas y con otras características como validaciones, construcción de queries, middlewares, conversión de tipos y muchas mas cosas.

Crearemos una API sencilla para saber como usar el cli de NestJs, conoceremos como funcionan los modulos, servicios, resolvers, crearemos los modelos de datos de MongoDB y GraphQL de manera conjunta, crearemos relaciones entre 2 colecciones de Mongo distintas y veremos cómo usar la aplicación Altair GraphQL Client para probar nuestro API cómodamente.
Kotlin Sealed Class primer
Tags: kotlin, android
Published: 2022-04-29 14:14:12

---
title: Kotlin Sealed Class primer
published: true
date: 2022-04-29 14:05:52 UTC
tags: Kotlin,Android
canonical_url: https://www.rockandnull.com/sealed-class-kotlin/
---

 ![Kotlin Sealed Class primer](https://images.unsplash.com/photo-1470566528253-41c75fc933c8?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxMTc3M3wwfDF8c2VhcmNofDF8fHNlYWxlZHxlbnwwfHx8fDE2NTEyNDEwODg&ixlib=rb-1.2.1&q=80&w=2000)

When coming back to using Kotlin I re-remember the great features of this language that make it a joy to work with. In this post, I want to give a quick primer on the sealed classes feature.

It's not a new feature. Most experienced engineers working with Kotlin and/or Android probably already know about this. But people are joining the Kotlin/Android world with all kinds of experiences and backgrounds. So I think, it's worth revisiting some "old" features of this great language, even if it helps just a single less experienced engineer learn about something that will make their work more efficient :)

Without further ado, a **sealed class** is a class that allows having a very **specific number** of sub-classes.

Where is this useful? Almost every engineer who defined an `enum` at some point needed to have some additional data stored for (at least) **some** of the enum values. The ugliest solution to this problem comes in the form of variables that are only used when specific enum values are active with the comment:

```
// ONLY filled when "status == DISCONNECTED"
var reason = ""
```

Sealed classes give a very elegant solution to this very common use case (among others). Since a sealed class has a very specific number of subclasses, similar to the predefined values of an `enum`, we are able to group "enum" values + data, only when necessary.

```
sealed class Status { // 1.
    object Unknown : Status() // 2.
    class Disconnected(val reason: String? = null) : Status() // 3.
    object Connecting : Status()
    object Connected : Status()
}
```

1. All subclasses inheriting the sealed classes must be present in the same Kotlin file. Note that by default the sealed class is abstract. You cannot initialize the class itself, only a sub-class.
2. If a subclass has no additional data to hold, you can use the `object` keyword (instead of `class`) to create a singleton instead.
3. Here the (disconnected) reason is grouped together with the disconnected status. The rest of the sub-classes can have their own related data (or none at all).

For business logic specific to sub-classes, use the powerful `when` statement with smart-casting:

```
when (status) {
    is Status.Unknown -> [...]
    is Status.Disconnected -> // Access `it.status.reason`
    is Status.Connected, is Status.Connecting -> [...]
}
```

Hopefully, this was useful and you can use it in your apps to make your coding life a bit more pleasant.

Happy coding!
New Things Added - Laravel 9.10 , 9.11 Released
Tags: php, laravel, webdev, tutorial
Published: 2022-04-29 13:47:45

Let's get started quickly I found new things in Laravel 9.10 , 9.11 Released I wanted to share with you.

- Before Refreshing Database Function
Run code before the database starts refreshing
```php
class DataExportTest extends TestCase
{
    use RefreshDatabase;
 
    protected $seed = true;
 
    protected function beforeRefreshingDatabase()
    {
        $this->artisan('db:wipe --database another-database-connection');
    }
 
    // ...
}
```

- Eloquent "findOr" Method
https://github.com/laravel/framework/pull/42092

```php
User::findOr(1, fn () => throw new RuntimeException);
User::findOr(1, fn () => abort(403));
User::findOr(1, fn () => 'return something');
User::findOr(1, ['columns'], fn () => '...');
 
// Also works with relations
$user->posts()->findOr(1, fn () => '...');
```

- Retrieve Input from the Request as Stringable
https://github.com/laravel/framework/commit/c9d34b7be0611d26f3e46669934cf542cc5e9e21

```php
$name = $request->string('name');
// or
$name = $request->str('name');
```

- Add doesntExpectOutputToContain assertion method
https://github.com/laravel/framework/pull/42096

```php
Artisan::command('contains', function () {
    $this->line('My name is Taylor Otwell');
});

$this->artisan('contains')
    ->doesntExpectOutputToContain('Taylor Otwell') // false
```

- Add Arr::join() Method
https://github.com/laravel/framework/pull/42197

```php
$stack = ['Tailwind', 'Alpine', 'Laravel', 'Livewire'];
 
Arr::join($stack, ', ', ' and ');
// Tailwind, Alpine, Laravel and Livewire
 
Arr::join($stack, ', ', ', and ');
// Tailwind, Alpine, Laravel, and Livewire
```

- Methods to Check the Existence of Validated Input Data
https://github.com/laravel/framework/pull/42184

```php
$validatedName = $request->safe()->has('name'); // True
$validatedAge = $request->safe()->has('age'); // False
 
$validatedName = $request->safe()->missing('name'); // False
$validatedAge = $request->safe()->missing('age'); // True
 
// Check each key in the array
$validatedName = $request->safe()->has(['name', 'age']);
```

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

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

I hope you enjoyed with me and to learn more about this release visit the sources and search more. I adore you who search for everything new.
Source :- https://laravel-news.com/laravel-9-10-0
Source :- https://www.youtube.com/watch?v=vO-uRGPtlP0
Source :- https://laravel-news.com/laravel-9-11-0
Source :- https://www.youtube.com/watch?v=uViQgxDZi1M
I've joined the Forem team! 🌱
Tags: meta, career, personal
Published: 2022-04-29 13:47:24

Hey all! I'm delighted to share that I've joined [Forem](https://www.forem.com) full-time in the role of **Social Media Manager** 🎉 

In this new role, I'll primarily be overseeing operations for Forem, DEV, and CodeNewbie's social media channels, as well as developing and executing content strategies across platforms.

A little bit about me...


## How did you land at Forem?
I worked as a freelance digital strategist for a year and a half prior to this role, and around the beginning of my freelance journey, I joined the DEV content coordination team part-time. I've really enjoyed working with the team, reading all your posts, and uplifting my favorites on social since I started — and now I get to do it even more! 🤩

Before my freelance career, I worked as a content writer for an eLearning agency (while doing some marketing and PR work for [my friends' bands](https://open.spotify.com/playlist/64IhUDPWxrEzc5aq9wd9sI?si=380adab4b38b4b84) on the side 😉). Before that, I interned in social and content for commercial radio stations and local small businesses while studying journalism and media studies at Kalamazoo College in my home city of Kalamazoo, Michigan, USA.


## Why did you choose a career in social media?
It's so dynamic! It requires a lot of quick thinking, creativity, strategy, and willingness to pivot from said strategy. I love that every day of work is a fresh challenge.

I also appreciate that I have the opportunity to show up on these platforms every day and lead with humanity and compassion. I am not under any illusion that today's social media landscape is all puppies and rainbow GIFs! It can be really tough out there! My goal is always to use the power I have to make it less so—especially for users who have been marginalized by these platforms.


## If you could only follow one (1) person on Twitter, who would it be?
THE sickeningly entertaining & educational coding drag queen [Anna Lytical](https://twitter.com/theannalytical)! She's fierce, she's fun, she is the moment. As a fellow queer person on the internet, her content always makes me feel seen and held. 🏳️‍🌈💖


### Ok, enough about me! Your turn:

_If you could only follow one (1) person on Twitter, who would it be?_
Emporter - a saviour for exposing localhost to web
Tags: webdev, macos, mobile, responsive
Published: 2022-04-29 13:37:32

**TLDR:** Emporter is a simple tool using which you can expose your localhost to web in realtime. It's free and no complex configuration.

[Jump to "How to use"](#how-to-use)

So the requirement was I wanted to work on the responsiveness of a web application but I wanted for a specific device and a real device because I wanted to test the "Reachability" mode on iOS.

I tried multiple solutions from [stackoverflow](https://stackoverflow.com/) and few [youtube](https://www.youtube.com/) videos as well. I will give the examples because I know when someone visits this article they might already have the knowledge of other tools. If not they will have with this info :)

The below are the solutions which I have tried.

1. [access localhost from mac to iPhone using network/sharing settings and connecting cable](https://stackoverflow.com/questions/3132105/how-do-you-access-a-website-running-on-localhost-from-iphone-browser)
Initially I thought it's a simple solution but may be because the laptop was provided by my organisation (network settings). I am not very sure though. Ideally it should have been worked with a simple solution like [this](https://stackoverflow.com/a/9304094)

2. [ngrok](https://ngrok.com/) - I was unable to install it because it was a third party tool and my mac doesn't allow me.

3. [Port2 app for mac](https://apps.apple.com/us/app/port2/id1522650072?mt=12) - It was not free and the only one session it provided didn't work for me. It shows `undefined` url and simply didn't work

Then I found [this](https://apps.apple.com/nl/app/emporter/id1406832001?mt=12) mac app from app store and it worked like a charm.

## How to use

-  Once you install this app, you will see the icon on the top menu bar. Once you click on that you will see there are no connections.
![Emporter step1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e4h4y52e75guky4ngylb.png)

- Click on the '+' icon![Emporter step2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i7sadv35pcuutu8nmxai.png)
![Emporter step3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pzhyu1vlo8f0krv8nevq.png)
![Emporter step4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h9ldt8dz0yf3w2nxw3zo.png)
   
 Because it's a premium version, it will generate a random url instead of the given name. You can click on the connection and "Reveal in browser". It's live and it's realtime.


If at all this article is helpful, do give it a 'Heart'. Always appreciate it. :)