问:
cant added foreign key on new table Laravel 5.8
I have two tables like User and Roles . i want to added foreign Roles_id on Table Users .

```<code>public function up()
{
    Schema::create('users', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->string('NIK',16);
        $table->string('nama');
        $table->string('email')->unique();
        $table->string('username');
        $table->string('password');
        $table->unsignedBigInteger('roles_id')->default(1);

        $table->timestamps();
        $table->softDeletes();

        $table->foreign('roles_id')->references('id')->on('roles');
    });
}
</code>```

and my roles table

```<code> public function up()
{
    Schema::create('roles', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->string('roles');
        $table->timestamps();
    });
}
</code>```

iam not catching the miss code , i using unsignedBigInteger , ann still error .
i am using -> nullable . but didnt work . can somone find this error ?

edit . this error :

SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table users add constraint users_roles_id_foreign foreign key (roles_id) references roles (id))

答:
First, create the roles table:

```<code> public function up(){
    Schema::create('roles', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->string('roles');
        $table->timestamps();
    });
}
</code>```

Then create a users table:

```<code>public function up()
{
    Schema::create('users', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->string('NIK',16);
        $table->string('nama');
        $table->string('email')->unique();
        $table->string('username');
        $table->string('password');

        $table->unsignedBigInteger('roles_id')->nullable();
        $table->foreign('roles_id')->references('id')->on('roles');

        $table->timestamps();
        $table->softDeletes();
    });
}
</code>```

For drop the foreign key:

```<code>Schema::table('users', function (Blueprint $table) {
    $table->dropForeign('users_roles_id_foreign');
    $table->dropColumn('roles_id');
});
</code>```

Body:
I have two tables like User and Roles . i want to added foreign Roles_id on Table Users .

public function up()
{
    Schema::create('users', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->string('NIK',16);
        $table->string('nama');
        $table->string('email')->unique();
        $table->string('username');
        $table->string('password');
        $table->unsignedBigInteger('roles_id')->default(1);

        $table->timestamps();
        $table->softDeletes();

        $table->foreign('roles_id')->references('id')->on('roles');
    });
}

and my roles table

 public function up()
{
    Schema::create('roles', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->string('roles');
        $table->timestamps();
    });
}

iam not catching the miss code , i using unsignedBigInteger , ann still error .
i am using -> nullable . but didnt work . can somone find this error ?

edit . this error :

SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table users add constraint users_roles_id_foreign foreign key (roles_id) references roles (id))

Body:
First, create the roles table:

 public function up(){
    Schema::create('roles', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->string('roles');
        $table->timestamps();
    });
}

Then create a users table:

public function up()
{
    Schema::create('users', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->string('NIK',16);
        $table->string('nama');
        $table->string('email')->unique();
        $table->string('username');
        $table->string('password');

        $table->unsignedBigInteger('roles_id')->nullable();
        $table->foreign('roles_id')->references('id')->on('roles');

        $table->timestamps();
        $table->softDeletes();
    });
}

For drop the foreign key:

Schema::table('users', function (Blueprint $table) {
    $table->dropForeign('users_roles_id_foreign');
    $table->dropColumn('roles_id');
});


来源: stackexchange

问:
How to get around the ' (quote) problem when saving text using SQL
I've a textbox that I save to a SQL Database using ASP.NET C#.

The problem is using quotes, for instance with words like he's and it's.  When you save it, I get an SQL error.

From experience to get around the issue, I use to use replace command to find all occurances of quotes and replace them with another character.  Then if I was to read the database and the text that was previously saved, I'd replace again.

Is there a better of doing this? Or do you still have to use this 'old' way.

答:
As the other answers point out, the correct answer here is to use parameterized queries.

However, this is sometimes not possible. In these cases, you're better off doubling the quotes:

```<code>String str = "he's";
str = str.Replace("'", "''");
</code>```

ContentLicense: CC BY-SA 3.0

Body:
As the other answers point out, the correct answer here is to use parameterized queries.

However, this is sometimes not possible. In these cases, you're better off doubling the quotes:

String str = "he's";
str = str.Replace("'", "''");


问:
Echo an Array and make the content look pretty on the page
I am trying to echo out my array on each line, not bunched together.

I have tried
, this only show's on the front end, but when you look at HTML code. Its still clumped together.

```<code>$arrays = [];

$arrays[] = "Good";
$arrays[] = "Bad";

foreach ($arrays as $array){
    echo $array;
}
</code>```

Result:

GoodBad

Want Result:

Good

Bad

答:
Short of using print_r, to quickly get your desired result, just make this small change:

```<code> echo $array."\n";
</code>```

Make sure it's double-quotes and it will add a new line.

(That would do what "
" does on HTML)

ContentLicense: CC BY-SA 4.0

Body:
I am trying to echo out my array on each line, not bunched together.

I have tried
, this only show's on the front end, but when you look at HTML code. Its still clumped together.

$arrays = [];

$arrays[] = "Good";
$arrays[] = "Bad";

foreach ($arrays as $array){
    echo $array;
}

Result:

GoodBad

Want Result:

Good

Bad

Body:
Short of using print_r, to quickly get your desired result, just make this small change:

 echo $array."\n";

Make sure it's double-quotes and it will add a new line.

(That would do what "<br />" does on HTML)


问:
Arithmetic operation on multidimensional array
I am doing some arithmetic operations on multidimensional array. Also tried some code using C++. But, output of my code contradict with my theoretical understanding on relation between different pointers and multidimensional array.

My understanding on 2D and 3D array.

2D Array

1)
Again, by using dereference operator

2)

3D Array

3)
Again, by using dereference operator

4)

I am confused about what B and C pointing in figure 2 and 4 respectively.

Code on 2D array

```<code>#include <iostream>
using namespace std;

int main(void){

    int B[2][2] = {1, 2, 3, 4};
    cout << B << endl;
    cout << B+1 << endl;
    return 0;
}
</code>```

Output:

0x7ffec3dd9f80

0x7ffec3dd9f88

Here, pointer to int B is increased by ((1*4)+(1*4)) = 8 unit that is pointer to int (B+1).
Though I got one explanation from Link on what actually B points in 2D array. It points first element of 2D array.

Output of my code and explanation on this Link confused me.
What actually B points in 2D array?
And, If B points the address of first element of 2D array, then why value of B is increased by 8 unit when we add 1 with it? Why not increased by (1*4) unit?

Code on 3D array

```<code>#include <iostream>
using namespace std;

int main(void){

    int C[2][2][2] = {{
                    {1, 2},
                    {3, 4}
                  },
                  {
                    {1, 2},
                    {3, 4}
                  }};

    cout << C << endl;
    cout << C[0] << endl;
    cout << C[0] +1 << endl;
    cout << C[0][0] +1 << endl;
    return 0;
}
</code>```

Output:

0x7ffeac58d130

0x7ffeac58d130

0x7ffeac58d138

0x7ffeac58d134

C gives starting address of whole array. But, which portion specifically it points? Is it pointing &C[0] or &C[0][0] or&C[0][0][0]?

```<code>cout << C[0]+1 << endl; here, C[0] is increased by 8 unit. But, if C[0] is pointing the base address of 1st 2D array inside 3D array, then it must be increased by 16 unit to get base &C[1].

cout << C[0][0] +1 << endl; here, C[0][0] is increased by 4 unit. But if it is pointing the base address of 1st 1D array of 1st 2D array inside 3D array, then it must be increased by 8 unit to get base &C[0][1].
</code>```

Thank you.

答:
Diagrams 1 and 3 are correct Diagrams 2 and 4 are not.  *B and B[0] are defined to mean exactly the same thing.  Similarly with **B and B[0][0].

So to fix Diagram 2, actually copy Diagram 1 but merely change the text B[0] to *B and so on.   B by itself refers to the whole array.   Ditto for Diagram 4.

B+1 is defined as meaning &(B[1]), it refers to a temporary pointer pointing at the object you have correctly marked as B[1] in Diagram 1.

In cout << B << endl;, treat B as saying B+0 (i.e. &(B[0])). When you use an array in a context where a pointer is expected, that is what happens (a temporary pointer is created, it behaves the same as if you had written &B[0] instead of B).  That statement does not output B, it outputs the value of this temporary pointer.

Body:
I am doing some arithmetic operations on multidimensional array. Also tried some code using C++. But, output of my code contradict with my theoretical understanding on relation between different pointers and multidimensional array.

My understanding on 2D and 3D array.

2D Array

1)
Again, by using dereference operator

2)

3D Array

3)
Again, by using dereference operator

4)

I am confused about what B and C pointing in figure 2 and 4 respectively.

Code on 2D array

#include <iostream>
using namespace std;

int main(void){

    int B[2][2] = {1, 2, 3, 4};
    cout << B << endl;
    cout << B+1 << endl;
    return 0;
}

Output:

0x7ffec3dd9f80

0x7ffec3dd9f88

Here, pointer to int B is increased by ((1*4)+(1*4)) = 8 unit that is pointer to int (B+1).
Though I got one explanation from Link on what actually B points in 2D array. It points first element of 2D array.

Output of my code and explanation on this Link confused me.
What actually B points in 2D array?
And, If B points the address of first element of 2D array, then why value of B is increased by 8 unit when we add 1 with it? Why not increased by (1*4) unit?

Code on 3D array

#include <iostream>
using namespace std;

int main(void){

    int C[2][2][2] = {{
                    {1, 2},
                    {3, 4}
                  },
                  {
                    {1, 2},
                    {3, 4}
                  }};

    cout << C << endl;
    cout << C[0] << endl;
    cout << C[0] +1 << endl;
    cout << C[0][0] +1 << endl;
    return 0;
}

Output:

0x7ffeac58d130

0x7ffeac58d130

0x7ffeac58d138

0x7ffeac58d134

C gives starting address of whole array. But, which portion specifically it points? Is it pointing &C[0] or &C[0][0] or&C[0][0][0]?

cout << C[0]+1 << endl; here, C[0] is increased by 8 unit. But, if C[0] is pointing the base address of 1st 2D array inside 3D array, then it must be increased by 16 unit to get base &C[1].

cout << C[0][0] +1 << endl; here, C[0][0] is increased by 4 unit. But if it is pointing the base address of 1st 1D array of 1st 2D array inside 3D array, then it must be increased by 8 unit to get base &C[0][1].

Thank you.


问:
django channels ImproperlyConfigured: Cannot find 'app' in ASGI_APPLICATION module
I am setting up channels asgi with Django. I have tried upgrading Django and Channels.

```<code>"Cannot find %r in ASGI_APPLICATION module %s" % (name, path)
django.core.exceptions.ImproperlyConfigured: Cannot find 'app' in ASGI_APPLICATION module <MyApp>.routing
</code>```

my routing config is as per the tutorial in mysite/routing

```<code>application = ProtocolTypeRouter({
# (http->django views is added by default)
'websocket': AuthMiddlewareStack(
    URLRouter(
        chat.routing.websocket_urlpatterns
    )
  ),
})
</code>```

and the import statement that is supposed to just be simply

```<code>import chat.routing
</code>```

my directory structure is exactly per the tutorial as well

with setting config

```<code>INSTALLED_APPS = [
'channels',
'chat',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
</code>```

and

```<code>ASGI_APPLICATION = 'chat.routing.application'
</code>```

Thanks

答:
I got this kind of error when running my Django Channels's routing.py using daphne server.

django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
```
<p>This is what documentation explain about daphne servers,</p>
<blockquote>
<p>Daphne is a HTTP, HTTP2 and WebSocket protocol server for ASGI and ASGI-HTTP, developed to power Django Channels.</p>
<p>It supports automatic negotiation of protocols; there’s no need for URL prefixing to determine WebSocket endpoints versus HTTP endpoints.</p>
<p>Note: Daphne 2 is not compatible with Channels 1.x applications, only with Channels 2.x and other ASGI applications. Install a 1.x version of Daphne for Channels 1.x support.</p>
</blockquote>
<p>As you can see, we can use both <code>HTTP</code> and <code>WS</code>protocol through daphne server without using Gunicorn server. What you can do is just add below line to top of your <code>routing.py</code> file.</p>
```from .wsgi import *
```
<p>So now your <code>routing.py</code> file should be like this,</p>
<pre class="lang-py prettyprint-override"><code># DockerDjangoNginx is my project name
# your routing.py file should be in this location where the wsgi.py file is placed
# DockerDjangoNginx/DockerDjangoNginx/routing.py

from .wsgi import *  # add this line to top of your code
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
import comapp.routing as routing

application = ProtocolTypeRouter({
    # (http->django views is added by default)
    'websocket': AuthMiddlewareStack(
        URLRouter(
            routing.websocket_urlpatterns
        )
    ),
})
</code>```

Now you can run your daphne server.

```<code>(venv) [root@t2mdocker]#daphne -b 0.0.0.0 -p 8000 DockerDjangoNginx.routing:application
2019-05-30 03:33:06,390 INFO     Starting server at tcp:port=8000:interface=0.0.0.0
2019-05-30 03:33:06,391 INFO     HTTP/2 support enabled
2019-05-30 03:33:06,391 INFO     Configuring endpoint tcp:port=8000:interface=0.0.0.0
2019-05-30 03:33:06,392 INFO     Listening on TCP address 0.0.0.0:8000
</code>```

If you see something like this HTTP/2 support not enabled (install the http2 and tls Twisted extras) when running daphne server, you can run pip install -U Twisted[tls,http2] to correct those errors.

Body:
I am setting up channels asgi with Django. I have tried upgrading Django and Channels.

"Cannot find %r in ASGI_APPLICATION module %s" % (name, path)
django.core.exceptions.ImproperlyConfigured: Cannot find 'app' in ASGI_APPLICATION module <MyApp>.routing

my routing config is as per the tutorial in mysite/routing

application = ProtocolTypeRouter({
# (http->django views is added by default)
'websocket': AuthMiddlewareStack(
    URLRouter(
        chat.routing.websocket_urlpatterns
    )
  ),
})

and the import statement that is supposed to just be simply

import chat.routing

my directory structure is exactly per the tutorial as well

with setting config

INSTALLED_APPS = [
'channels',
'chat',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]

and

ASGI_APPLICATION = 'chat.routing.application'

Thanks

Body:
I got this kind of error when running my Django Channels's routing.py using daphne server.

django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

This is what documentation explain about daphne servers,

Daphne is a HTTP, HTTP2 and WebSocket protocol server for ASGI and ASGI-HTTP, developed to power Django Channels.

It supports automatic negotiation of protocols; there’s no need for URL prefixing to determine WebSocket endpoints versus HTTP endpoints.

Note: Daphne 2 is not compatible with Channels 1.x applications, only with Channels 2.x and other ASGI applications. Install a 1.x version of Daphne for Channels 1.x support.

As you can see, we can use both HTTP and WSprotocol through daphne server without using Gunicorn server. What you can do is just add below line to top of your routing.py file.

from .wsgi import *

So now your routing.py file should be like this,

# DockerDjangoNginx is my project name
# your routing.py file should be in this location where the wsgi.py file is placed
# DockerDjangoNginx/DockerDjangoNginx/routing.py

from .wsgi import *  # add this line to top of your code
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
import comapp.routing as routing

application = ProtocolTypeRouter({
    # (http->django views is added by default)
    'websocket': AuthMiddlewareStack(
        URLRouter(
            routing.websocket_urlpatterns
        )
    ),
})

Now you can run your daphne server.

(venv) [root@t2mdocker]#daphne -b 0.0.0.0 -p 8000 DockerDjangoNginx.routing:application
2019-05-30 03:33:06,390 INFO     Starting server at tcp:port=8000:interface=0.0.0.0
2019-05-30 03:33:06,391 INFO     HTTP/2 support enabled
2019-05-30 03:33:06,391 INFO     Configuring endpoint tcp:port=8000:interface=0.0.0.0
2019-05-30 03:33:06,392 INFO     Listening on TCP address 0.0.0.0:8000

If you see something like this HTTP/2 support not enabled (install the http2 and tls Twisted extras) when running daphne server, you can run pip install -U Twisted[tls,http2] to correct those errors.


问:
Swiper.js: delay parameter ignored
I'm creating a simple slideshow using swiper.js.

My config looks like this:

```<code>var mySwiper = new Swiper( '#swiper-container',
                               {
                                   autoplay: {
                                       delay : 400000
                                   },
                                   loop: true,
                                   speed: 2800,
                                   grabCursor : true

                               }
                             );
</code>```

This pretty much works... except that the 'delay' parameter gets ignored.

I've also tried putting the 'delay' parameter outside of the autoplay object, like this:

v

```<code>ar mySwiper = new Swiper( '#swiper-container',
                               {
                                   autoplay: true,
                                   delay: 4000,
                                   loop: true,
                                   speed: 2800,
                                   grabCursor : true

                               }
                             )
</code>```

;

This doesn't help. The delay value is ignored.

What could be happening here?

答:
Autoplay takes a boolean value, that's not an option
Instead, I've found a working option. It's pretty clear in documentation

So you just have to add this parameter to your div class="swiper-slide" and it'll work:

data-swiper-autoplay="2000"

Title: Swiper.js: delay parameter ignored

Body:
I'm creating a simple slideshow using swiper.js.

My config looks like this:

var mySwiper = new Swiper( '#swiper-container',
                               {
                                   autoplay: {
                                       delay : 400000
                                   },
                                   loop: true,
                                   speed: 2800,
                                   grabCursor : true

                               }
                             );

This pretty much works... except that the 'delay' parameter gets ignored.

I've also tried putting the 'delay' parameter outside of the autoplay object, like this:

v

ar mySwiper = new Swiper( '#swiper-container',
                               {
                                   autoplay: true,
                                   delay: 4000,
                                   loop: true,
                                   speed: 2800,
                                   grabCursor : true

                               }
                             )

;

This doesn't help. The delay value is ignored.

What could be happening here?


问:
Why does my comparison clause always throw an IllegalArgumentException?
I'm trying to create a calculator method and I want to use mathematical symbols in my case statement but my error checking keeps throwing an error.

I've tried moving my ELSE statements to the bottom in case it was an issue with sequencing somehow. When I add the variable to the end of my error message it appears to assign it correctly.

public static void calculator (double firstNumber, char operation, double secondNumber){

```<code>    if (operation != '+' || operation != '-' || operation != '*' || operation != '/' || operation !='%'){
        throw new IllegalArgumentException("You must choose a number between 1 and 5 inclusive." + operation);
    }else{
        if(operation == '/' && secondNumber == 0){
            throw new IllegalArgumentException("Dividend cannot be zero.");
        }else{if(operation == '%' && secondNumber == 0){
                throw new IllegalArgumentException("Dividend cannot be zero.");
            }else

                switch (operation){
                    case '+': System.out.println("1");
                    break;

                    case '-': System.out.println("2");
                    break;

                    case '*': System.out.println("3");
                    break;
</code>```

....

Example of errors using +, %, and /:

```<code>> java.lang.IllegalArgumentException: You must choose a number between 1
> and 5 inclusive.+     at MathUtilites.calculator(MathUtilites.java:39)
> java.lang.IllegalArgumentException: You must choose a number between 1
> and 5 inclusive.%     at MathUtilites.calculator(MathUtilites.java:39)
> java.lang.IllegalArgumentException: You must choose a number between 1
> and 5 inclusive./     at MathUtilites.calculator(MathUtilites.java:39)
</code>```

I am expecting it to just return a number between 1 and 5 which I will later be replacing with actual code.

答:
Like the first comment on your question suggested, you need to replace || with && which will say all of these must be true instead of saying any of these must be true. Alter your code to look like this and it should work:

```<code>if (operation != '+' && operation != '-' && operation != '*' && operation != '/' && operation !='%'){
    throw new IllegalArgumentException("You must choose a number between 1 and 5 inclusive." + operation);
</code>```

Body:
I'm trying to create a calculator method and I want to use mathematical symbols in my case statement but my error checking keeps throwing an error.

I've tried moving my ELSE statements to the bottom in case it was an issue with sequencing somehow. When I add the variable to the end of my error message it appears to assign it correctly.

public static void calculator (double firstNumber, char operation, double secondNumber){

    if (operation != '+' || operation != '-' || operation != '*' || operation != '/' || operation !='%'){
        throw new IllegalArgumentException("You must choose a number between 1 and 5 inclusive." + operation);
    }else{
        if(operation == '/' && secondNumber == 0){
            throw new IllegalArgumentException("Dividend cannot be zero.");
        }else{if(operation == '%' && secondNumber == 0){
                throw new IllegalArgumentException("Dividend cannot be zero.");
            }else

                switch (operation){
                    case '+': System.out.println("1");
                    break;

                    case '-': System.out.println("2");
                    break;

                    case '*': System.out.println("3");
                    break;

....

Example of errors using +, %, and /:

> java.lang.IllegalArgumentException: You must choose a number between 1
> and 5 inclusive.+     at MathUtilites.calculator(MathUtilites.java:39)
> java.lang.IllegalArgumentException: You must choose a number between 1
> and 5 inclusive.%     at MathUtilites.calculator(MathUtilites.java:39)
> java.lang.IllegalArgumentException: You must choose a number between 1
> and 5 inclusive./     at MathUtilites.calculator(MathUtilites.java:39)

I am expecting it to just return a number between 1 and 5 which I will later be replacing with actual code.

Body:
Like the first comment on your question suggested, you need to replace || with && which will say all of these must be true instead of saying any of these must be true. Alter your code to look like this and it should work:

if (operation != '+' && operation != '-' && operation != '*' && operation != '/' && operation !='%'){
    throw new IllegalArgumentException("You must choose a number between 1 and 5 inclusive." + operation);


问:
TypeError: Object(...) is not a function at eval (platform.es5.js:79) at eval (platform.es5.js:81)
I am getting the following error :

```<code>platform.es5.js:79 Uncaught TypeError: Object(...) is not a function
    at eval (platform.es5.js:79)
    at eval (platform.es5.js:81)
    at Object../node_modules/@angular/cdk/esm5/platform.es5.js (vendor.bundle.js:63)
    at __webpack_require__ (inline.bundle.js:55)
    at eval (a11y.es5.js:33)
    at Object../node_modules/@angular/cdk/esm5/a11y.es5.js (vendor.bundle.js:23)
    at __webpack_require__ (inline.bundle.js:55)
    at eval (checkbox.es5.js:14)
    at Object../node_modules/@angular/material/esm5/checkbox.es5.js (vendor.bundle.js:111)
    at __webpack_require__ (inline.bundle.js:55)
</code>```

I am also getting a bunch of warnings:

```(anonymous) @ platform.es5.js:79
(anonymous) @ platform.es5.js:81
./node_modules/@angular/cdk/esm5/platform.es5.js @ vendor.bundle.js:63
__webpack_require__ @ inline.bundle.js:55
(anonymous) @ a11y.es5.js:33
./node_modules/@angular/cdk/esm5/a11y.es5.js @ vendor.bundle.js:23
__webpack_require__ @ inline.bundle.js:55
(anonymous) @ checkbox.es5.js:14
./node_modules/@angular/material/esm5/checkbox.es5.js @ vendor.bundle.js:111
__webpack_require__ @ inline.bundle.js:55
(anonymous) @ app.module.ts:3
./src/app/app.module.ts @ main.bundle.js:43
__webpack_require__ @ inline.bundle.js:55
(anonymous) @ main.ts:4
./src/main.ts @ main.bundle.js:235
__webpack_require__ @ inline.bundle.js:55
0 @ main.bundle.js:251
__webpack_require__ @ inline.bundle.js:55
webpackJsonpCallback @ inline.bundle.js:26
(anonymous) @ main.bundle.js:1
client:147 [WDS] Warnings while compiling.
warnings @ client:147
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
1119:164-170 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
1119:62-78 "export 'defineInjectable' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/material/esm5/core.es5.js
1334:59-75 "export 'defineInjectable' was not found in '@angular/core'
 @ ./node_modules/@angular/material/esm5/core.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/observers.es5.js
164:149-155 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/observers.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/observers.es5.js
164:57-73 "export 'defineInjectable' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/observers.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
1666:152-158 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
1666:182-188 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
1666:198-204 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
1666:58-74 "export 'defineInjectable' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
1858:143-149 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
1858:184-190 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
1858:55-71 "export 'defineInjectable' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/material/esm5/core.es5.js
2107:83-104 "export 'ANIMATION_MODULE_TYPE' was not found in '@angular/platform-browser/animations'
 @ ./node_modules/@angular/material/esm5/core.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
2305:140-146 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
2305:156-162 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
2305:54-70 "export 'defineInjectable' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
353:143-149 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
353:55-71 "export 'defineInjectable' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/observers.es5.js
38:65-81 "export 'defineInjectable' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/observers.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/bidi.es5.js
39:11-17 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/bidi.es5.js
 @ ./node_modules/@angular/material/esm5/core.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/material/esm5/core.es5.js
525:11-17 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/material/esm5/core.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/material/esm5/checkbox.es5.js
561:83-104 "export 'ANIMATION_MODULE_TYPE' was not found in '@angular/platform-browser/animations'
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/platform.es5.js
79:128-134 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/platform.es5.js
 @ ./node_modules/@angular/material/esm5/core.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/platform.es5.js
79:50-66 "export 'defineInjectable' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/platform.es5.js
 @ ./node_modules/@angular/material/esm5/core.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/bidi.es5.js
86:146-152 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/bidi.es5.js
 @ ./node_modules/@angular/material/esm5/core.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/bidi.es5.js
86:56-72 "export 'defineInjectable' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/bidi.es5.js
 @ ./node_modules/@angular/material/esm5/core.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
```

<p>My app.module.ts</p>

```import { BrowserModule } from '@angular/platform-browser';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {MatCheckboxModule} from '@angular/material/checkbox';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import {RouterModule, Routes} from '@angular/router';
import { FlashMessagesModule } from 'ngx-flash-messages';

import { AppComponent } from './app.component';
import { ClientComponent } from './client/client.component';
import { CompanyComponent } from './company/company.component';
import { ContactComponent } from './contact/contact.component';
import { HomeComponent } from './home/home.component';
import { LeftSideBarComponent } from './left-side-bar/left-side-bar.component';
import { NavbarComponent } from './navbar/navbar.component';
import { RoleComponent } from './role/role.component';
import { UserComponent } from './user/user.component';

const appRoutes: Routes =  [
  {path:'', component: HomeComponent},
  {path:'contact', component: ContactComponent},
  {path:'company', component:CompanyComponent},
  {path:'user', component:UserComponent},
  {path:'role', component:RoleComponent},
  {path:'client', component:ClientComponent}
]

@NgModule({
  declarations: [
    AppComponent,
    ClientComponent,
    CompanyComponent,
    ContactComponent,
    HomeComponent,
    LeftSideBarComponent,
    NavbarComponent,
    RoleComponent,
    UserComponent
  ],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    MatCheckboxModule,
    FormsModule,
    HttpModule,
    FlashMessagesModule,
    RouterModule.forRoot(appRoutes)
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
```

<p>My package.json</p>

```{
  "name": "admin-app",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^5.2.11",
    "@angular/cdk": "^6.1.0",
    "@angular/common": "^5.2.0",
    "@angular/compiler": "^5.2.0",
    "@angular/core": "^5.2.0",
    "@angular/forms": "^5.2.0",
    "@angular/http": "^5.2.0",
    "@angular/material": "^6.1.0",
    "@angular/platform-browser": "^5.2.0",
    "@angular/platform-browser-dynamic": "^5.2.0",
    "@angular/router": "^5.2.0",
    "core-js": "^2.4.1",
    "hammerjs": "^2.0.8",
    "rxjs": "^5.5.6",
    "zone.js": "^0.8.19"
  },
  "devDependencies": {
    "@angular/cli": "~1.7.4",
    "@angular/compiler-cli": "^5.2.0",
    "@angular/language-service": "^5.2.0",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~2.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "~2.5.3"
  }
}
```

I want to use angular material, but I can not as I am repeatedly getting such errors. I am following the documentations and tutorial videos.

答: I had a similar error message, which appears to be caused by version 8 modules being used with Angular 7.  The solution for me was to go through package.json looking for version 8 modules (in my case, @angular/cdk and @angular/material), changing them to the most recent version 7 modules, and then re-running npm i

Body:
I am getting the following error :

platform.es5.js:79 Uncaught TypeError: Object(...) is not a function
    at eval (platform.es5.js:79)
    at eval (platform.es5.js:81)
    at Object../node_modules/@angular/cdk/esm5/platform.es5.js (vendor.bundle.js:63)
    at __webpack_require__ (inline.bundle.js:55)
    at eval (a11y.es5.js:33)
    at Object../node_modules/@angular/cdk/esm5/a11y.es5.js (vendor.bundle.js:23)
    at __webpack_require__ (inline.bundle.js:55)
    at eval (checkbox.es5.js:14)
    at Object../node_modules/@angular/material/esm5/checkbox.es5.js (vendor.bundle.js:111)
    at __webpack_require__ (inline.bundle.js:55)

I am also getting a bunch of warnings:

(anonymous) @ platform.es5.js:79
(anonymous) @ platform.es5.js:81
./node_modules/@angular/cdk/esm5/platform.es5.js @ vendor.bundle.js:63
__webpack_require__ @ inline.bundle.js:55
(anonymous) @ a11y.es5.js:33
./node_modules/@angular/cdk/esm5/a11y.es5.js @ vendor.bundle.js:23
__webpack_require__ @ inline.bundle.js:55
(anonymous) @ checkbox.es5.js:14
./node_modules/@angular/material/esm5/checkbox.es5.js @ vendor.bundle.js:111
__webpack_require__ @ inline.bundle.js:55
(anonymous) @ app.module.ts:3
./src/app/app.module.ts @ main.bundle.js:43
__webpack_require__ @ inline.bundle.js:55
(anonymous) @ main.ts:4
./src/main.ts @ main.bundle.js:235
__webpack_require__ @ inline.bundle.js:55
0 @ main.bundle.js:251
__webpack_require__ @ inline.bundle.js:55
webpackJsonpCallback @ inline.bundle.js:26
(anonymous) @ main.bundle.js:1
client:147 [WDS] Warnings while compiling.
warnings @ client:147
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
1119:164-170 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
1119:62-78 "export 'defineInjectable' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/material/esm5/core.es5.js
1334:59-75 "export 'defineInjectable' was not found in '@angular/core'
 @ ./node_modules/@angular/material/esm5/core.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/observers.es5.js
164:149-155 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/observers.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/observers.es5.js
164:57-73 "export 'defineInjectable' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/observers.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
1666:152-158 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
1666:182-188 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
1666:198-204 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
1666:58-74 "export 'defineInjectable' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
1858:143-149 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
1858:184-190 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
1858:55-71 "export 'defineInjectable' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/material/esm5/core.es5.js
2107:83-104 "export 'ANIMATION_MODULE_TYPE' was not found in '@angular/platform-browser/animations'
 @ ./node_modules/@angular/material/esm5/core.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
2305:140-146 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
2305:156-162 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
2305:54-70 "export 'defineInjectable' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
353:143-149 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/a11y.es5.js
353:55-71 "export 'defineInjectable' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/a11y.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/observers.es5.js
38:65-81 "export 'defineInjectable' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/observers.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/bidi.es5.js
39:11-17 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/bidi.es5.js
 @ ./node_modules/@angular/material/esm5/core.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/material/esm5/core.es5.js
525:11-17 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/material/esm5/core.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/material/esm5/checkbox.es5.js
561:83-104 "export 'ANIMATION_MODULE_TYPE' was not found in '@angular/platform-browser/animations'
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/platform.es5.js
79:128-134 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/platform.es5.js
 @ ./node_modules/@angular/material/esm5/core.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/platform.es5.js
79:50-66 "export 'defineInjectable' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/platform.es5.js
 @ ./node_modules/@angular/material/esm5/core.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/bidi.es5.js
86:146-152 "export 'inject' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/bidi.es5.js
 @ ./node_modules/@angular/material/esm5/core.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
client:153 ./node_modules/@angular/cdk/esm5/bidi.es5.js
86:56-72 "export 'defineInjectable' was not found in '@angular/core'
 @ ./node_modules/@angular/cdk/esm5/bidi.es5.js
 @ ./node_modules/@angular/material/esm5/core.es5.js
 @ ./node_modules/@angular/material/esm5/checkbox.es5.js
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://0.0.0.0:0 ./src/main.ts
warnings @ client:153
onmessage @ socket.js:41
EventTarget.dispatchEvent @ sockjs.js:170
(anonymous) @ sockjs.js:883
SockJS._transportMessage @ sockjs.js:881
EventEmitter.emit @ sockjs.js:86
WebSocketTransport.ws.onmessage @ sockjs.js:2957
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566

My app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {MatCheckboxModule} from '@angular/material/checkbox';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import {RouterModule, Routes} from '@angular/router';
import { FlashMessagesModule } from 'ngx-flash-messages';

import { AppComponent } from './app.component';
import { ClientComponent } from './client/client.component';
import { CompanyComponent } from './company/company.component';
import { ContactComponent } from './contact/contact.component';
import { HomeComponent } from './home/home.component';
import { LeftSideBarComponent } from './left-side-bar/left-side-bar.component';
import { NavbarComponent } from './navbar/navbar.component';
import { RoleComponent } from './role/role.component';
import { UserComponent } from './user/user.component';

const appRoutes: Routes =  [
  {path:'', component: HomeComponent},
  {path:'contact', component: ContactComponent},
  {path:'company', component:CompanyComponent},
  {path:'user', component:UserComponent},
  {path:'role', component:RoleComponent},
  {path:'client', component:ClientComponent}
]

@NgModule({
  declarations: [
    AppComponent,
    ClientComponent,
    CompanyComponent,
    ContactComponent,
    HomeComponent,
    LeftSideBarComponent,
    NavbarComponent,
    RoleComponent,
    UserComponent
  ],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    MatCheckboxModule,
    FormsModule,
    HttpModule,
    FlashMessagesModule,
    RouterModule.forRoot(appRoutes)
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

My package.json

{
  "name": "admin-app",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^5.2.11",
    "@angular/cdk": "^6.1.0",
    "@angular/common": "^5.2.0",
    "@angular/compiler": "^5.2.0",
    "@angular/core": "^5.2.0",
    "@angular/forms": "^5.2.0",
    "@angular/http": "^5.2.0",
    "@angular/material": "^6.1.0",
    "@angular/platform-browser": "^5.2.0",
    "@angular/platform-browser-dynamic": "^5.2.0",
    "@angular/router": "^5.2.0",
    "core-js": "^2.4.1",
    "hammerjs": "^2.0.8",
    "rxjs": "^5.5.6",
    "zone.js": "^0.8.19"
  },
  "devDependencies": {
    "@angular/cli": "~1.7.4",
    "@angular/compiler-cli": "^5.2.0",
    "@angular/language-service": "^5.2.0",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~2.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "~2.5.3"
  }
}

I want to use angular material, but I can not as I am repeatedly getting such errors. I am following the documentations and tutorial videos.


问:
gradle: application run args can not pass system properties
Gradle 5.4.1

```<code>apply plugin: application

run {
   main = "mypackage.Foo"
}
</code>```

Run:

```<code>gradlew run --args="-Dfoo=bar -Dhello=world"
</code>```

Trying to pass the system properties using --args when running the application. But they were not set.

答:
gradlew -Dfoo=bar -Dhello=world run --args="arg1"

--args are what's passed to the main method.

Body:
Gradle 5.4.1

apply plugin: application

run {
   main = "mypackage.Foo"
}

Run:

gradlew run --args="-Dfoo=bar -Dhello=world"

Trying to pass the system properties using --args when running the application. But they were not set.


问:
Why \n in python gives two blank lines?
I can't understand why \n gives two blank lines in the output. For example:

```<code>>>> def my_function():
    print("ABC")
    print("\n")
    print("DEF")

>>> my_function()
ABC
                      # First blank line
                      # Second blank line
DEF
>>>
</code>```

Can anyone explain what happens here and how to fix it?

答:
Python adds a default newline when the print function is used
To print in python without a newline in python3 use

```<code>print("hello",end='')
</code>```

Source: https://docs.python.org/3/whatsnew/3.0.html#print-is-a-function

Title: Why \n in python gives two blank lines?

Body:
I can't understand why \n gives two blank lines in the output. For example:

>>> def my_function():
    print("ABC")
    print("\n")
    print("DEF")

>>> my_function()
ABC
                      # First blank line
                      # Second blank line
DEF
>>>

Can anyone explain what happens here and how to fix it?

Body:
Python adds a default newline when the print function is used
To print in python without a newline in python3 use

print("hello",end='')

Source: https://docs.python.org/3/whatsnew/3.0.html#print-is-a-function


问:
php regular expression to get the specific url
I would like to get the urls from a webpage that starts with "../category/" from these tags below:

```<code><a href="../category/product/pc.html" target="_blank">PC</a><br>
<a href="../category/product/carpet.html" target="_blank">Carpet</a><br>
</code>```

Any suggestion would be very much appreciated.

Thanks!

答:
No regular expressions is required. A simple XPath query with DOM will suffice:

```<code>$dom = new DOMDocument;
$dom->loadHTML($html);
$xpath = new DOMXPath($dom);

$nodes = $xpath->query('//a[starts-with(@href, "../category/")]');
foreach ($nodes as $node) {
    echo $node->nodeValue.' = '.$node->getAttribute('href').PHP_EOL;
}
</code>```

Will print:

```<code>PC = ../category/product/pc.html
Carpet = ../category/product/carpet.html
</code>```

Body:
I would like to get the urls from a webpage that starts with "../category/" from these tags below:

PC

Carpet

Any suggestion would be very much appreciated.

Thanks!

Body:
No regular expressions is required. A simple XPath query with DOM will suffice:

$dom = new DOMDocument;
$dom->loadHTML($html);
$xpath = new DOMXPath($dom);

$nodes = $xpath->query('//a[starts-with(@href, "../category/")]');
foreach ($nodes as $node) {
    echo $node->nodeValue.' = '.$node->getAttribute('href').PHP_EOL;
}

Will print:

PC = ../category/product/pc.html
Carpet = ../category/product/carpet.html


问:
Need to set cutoffs before creating an adjacency matrix
This is small part of the data set I have:

```<code>      Winner    Player 1    Player 2    Player 3
       Susan    Archie      Heck         Jay
       Archie   Brown       Susan        Jay
       Heck     Archie      Jay          Brown
       Jay      Brown       Archie       Susan
       Brown    Susan       Archie       Jay
       Archie   Brown       Susan        Heck
       Susan    Heck        Jay          Brown
       Jay      Heck        Susan        Brown
       Susan    Archie      Heck         Brown
       Lee      Susan       Jay          Heck
       Kyle     Heck        Jay          Susan
</code>```

I used the following code to convert this into an adjacency matrix:

```<code>   d = read.csv("res.csv")
   lvs <- sort(as.character(unique(unlist(d))))
   d[] <- lapply(d, factor, levels = lvs)
   res <- table(d[c("Player.1","Winner")]) +
   table(d[c("Player.2","Winner")]) +
   table(d[c("Player.3","Winner")])
   diag(res) <- 0
</code>```

What I need to do is set cutoffs. So the only people who should be included in the matrix are players who have played at least 2 matches against each other.

The output should be an adjacency matrix, with only players who have played each other at least twice. So, the original matrix looks like this:

```<code>          Winner    Susan   Archie  Heck    Jay     Brown   Lee     Kyle
          Susan       0       2      0       2         1     1       1
          Archie      2       0      1       1         1     0       0
          Heck        3       1      0       1         0     1       1
          Jay         2       1      1       0         1     1       1
          Brown       2       2      1       2         0     0       0
          Lee         0       0      0       0         0     0       0
          Kyle        0       0      0       0         0     0       0
</code>```

But after it eliminates players who are only matched up once, the resulting matrix is the following:

```<code>          Winner    Susan   Archie  Heck    Jay     Brown   Lee     Kyle
          Susan       0       2      0       2         1     0       0
          Archie      2       0      1       1         1     0       0
          Heck        3       1      0       1         0     0       0
          Jay         2       1      1       0         1     0       0
          Brown       2       2      0       2         0     0       0
          Lee         0       0      0       0         0     0       0
          Kyle        0       0      0       0         0     0       0
</code>```

答:
We can do this more easily with gathering into 'long' format

```<code>library(tidyverse)
out <- gather(d, key, val, -Winner) %>%
          select(-key) %>%
          mutate(val = factor(val, levels = lvs)) %>%
          table %>%
          t
</code>```

and then setting the columns to 0 values for the Player rows that are 0

```<code>out[, names(which(!rowSums(out)))] <- 0
</code>```

data

```<code>d <- structure(list(Winner = structure(c(7L, 1L, 3L, 4L, 2L, 1L, 7L,
4L, 7L, 6L, 5L), .Label = c("Archie", "Brown", "Heck", "Jay",
"Kyle", "Lee", "Susan"), class = "factor"), Player1 = structure(c(1L,
2L, 1L, 2L, 7L, 2L, 3L, 3L, 1L, 7L, 3L), .Label = c("Archie",
"Brown", "Heck", "Jay", "Kyle", "Lee", "Susan"), class = "factor"),
    Player2 = structure(c(3L, 7L, 4L, 1L, 1L, 7L, 4L, 7L, 3L,
    4L, 4L), .Label = c("Archie", "Brown", "Heck", "Jay", "Kyle",
    "Lee", "Susan"), class = "factor"), Player3 = structure(c(4L,
    4L, 2L, 7L, 4L, 3L, 2L, 2L, 2L, 3L, 7L), .Label = c("Archie",
    "Brown", "Heck", "Jay", "Kyle", "Lee", "Susan"),
 class = "factor")), row.names = c(NA,
-11L), class = "data.frame")
</code>```

Body:
This is small part of the data set I have:

      Winner    Player 1    Player 2    Player 3
       Susan    Archie      Heck         Jay
       Archie   Brown       Susan        Jay
       Heck     Archie      Jay          Brown
       Jay      Brown       Archie       Susan
       Brown    Susan       Archie       Jay
       Archie   Brown       Susan        Heck
       Susan    Heck        Jay          Brown
       Jay      Heck        Susan        Brown
       Susan    Archie      Heck         Brown
       Lee      Susan       Jay          Heck
       Kyle     Heck        Jay          Susan

I used the following code to convert this into an adjacency matrix:

   d = read.csv("res.csv")
   lvs <- sort(as.character(unique(unlist(d))))
   d[] <- lapply(d, factor, levels = lvs)
   res <- table(d[c("Player.1","Winner")]) +
   table(d[c("Player.2","Winner")]) +
   table(d[c("Player.3","Winner")])
   diag(res) <- 0

What I need to do is set cutoffs. So the only people who should be included in the matrix are players who have played at least 2 matches against each other.

The output should be an adjacency matrix, with only players who have played each other at least twice. So, the original matrix looks like this:

          Winner    Susan   Archie  Heck    Jay     Brown   Lee     Kyle
          Susan       0       2      0       2         1     1       1
          Archie      2       0      1       1         1     0       0
          Heck        3       1      0       1         0     1       1
          Jay         2       1      1       0         1     1       1
          Brown       2       2      1       2         0     0       0
          Lee         0       0      0       0         0     0       0
          Kyle        0       0      0       0         0     0       0

But after it eliminates players who are only matched up once, the resulting matrix is the following:

          Winner    Susan   Archie  Heck    Jay     Brown   Lee     Kyle
          Susan       0       2      0       2         1     0       0
          Archie      2       0      1       1         1     0       0
          Heck        3       1      0       1         0     0       0
          Jay         2       1      1       0         1     0       0
          Brown       2       2      0       2         0     0       0
          Lee         0       0      0       0         0     0       0
          Kyle        0       0      0       0         0     0       0

Body:
We can do this more easily with gathering into 'long' format

library(tidyverse)
out <- gather(d, key, val, -Winner) %>%
          select(-key) %>%
          mutate(val = factor(val, levels = lvs)) %>%
          table %>%
          t

and then setting the columns to 0 values for the Player rows that are 0

out[, names(which(!rowSums(out)))] <- 0

data

d <- structure(list(Winner = structure(c(7L, 1L, 3L, 4L, 2L, 1L, 7L,
4L, 7L, 6L, 5L), .Label = c("Archie", "Brown", "Heck", "Jay",
"Kyle", "Lee", "Susan"), class = "factor"), Player1 = structure(c(1L,
2L, 1L, 2L, 7L, 2L, 3L, 3L, 1L, 7L, 3L), .Label = c("Archie",
"Brown", "Heck", "Jay", "Kyle", "Lee", "Susan"), class = "factor"),
    Player2 = structure(c(3L, 7L, 4L, 1L, 1L, 7L, 4L, 7L, 3L,
    4L, 4L), .Label = c("Archie", "Brown", "Heck", "Jay", "Kyle",
    "Lee", "Susan"), class = "factor"), Player3 = structure(c(4L,
    4L, 2L, 7L, 4L, 3L, 2L, 2L, 2L, 3L, 7L), .Label = c("Archie",
    "Brown", "Heck", "Jay", "Kyle", "Lee", "Susan"),
 class = "factor")), row.names = c(NA,
-11L), class = "data.frame")


问:
Is there any method to embed Staticman comment system in non-jekyll site?
I hosted my website hosted on Github as Github pages without using any static site generators (example: Jekyll).
I created my own HTML webpage with my own design and code which I have hosted my webpage as Github pages.
I was wondering that, Is there any way to integrate or embed Staticman comment system directly in my HTML page as that same HTML page is hosted on Github.
Thank you,
Karunakar Pate Blog (https://www.alltechnotricks.com).</p>

答:
This is a bit of a broad question.  You might want to add details on what you have already done and what roadblocks you are running into.

Have you tried the steps in their README?
https://github.com/eduardoboucas/staticman#setting-up-a-repository

Also, you should check out this:
https://mademistakes.com/articles/improving-jekyll-static-comments/


问:
Validating password with validates_format_of
EDIT: I realized the comments about there not being a difference with :save already covered were correct, and was able to work through some errors. However, it still appears the regex validation is failing for :password.

I'm a little confused, and think the problem might be related to there being only :password_digest in the table itself, while we use password and password_confirmation as attributes in the model. But I'm also guessing Rails has this all worked out and takes care of everything with the has_secure_password function.

validates_format_of :password, :with => /\A[a-zA-Z]\z/, :on => :create, :update fails with the string password.

Obviously, this doesn't make sense and matches fine in the console (using =~ or .match(). Also notice if I set allow_nil: true for :password other tests involving the user start failing (which doesn't make sense, as the password should never be nil anyways).

答:
I don't see any use case where you need on create and update together if on: :save is already there.
For more model callbacks please refer this.


问:
How to set min value for field in form?
I have form with integer field - price.

```<code>$builder->add('list',
            CollectionType::class,
            [
                'required' => false,
                'allow_add' => true,
                'error_bubbling' => true,
            ])
            ->add('price',
            IntegerType::class,
            [
                'required' => false,
                'error_bubbling' => true,
            ]);
</code>```

How to set, for example, for validation i need min value for price 0 or greater?

I tried this one, but it's not work:

```<code>'constraints' => [
new GreaterThanOrEqual(50)
 ],
</code>```

Thanks for all help.

controller Action

```<code> public function getProductAction(Request $request)
    {
        $variables = $request->get('list');

        $price = $request->get('price');

        $form = $this->createForm(ProductForm::class, null, ['csrf_protection' => false, 'allow_extra_fields' => true]);

        $form->submit(['variables' => $variables, 'prices' => $price]);

        if(!$form->isValid()) {

            $errors = '';

            foreach ($form->getErrors() as $error) {
                $errors = $error->getMessage();
            }

            return new JsonResponse([
                'errors' => $errors
            ],Response::HTTP_BAD_REQUEST);
        } else {

            $product = $this->getDoctrine()
                ->getRepository(Product::class)
                ->findByListAndPrice($list, $price);

            if (!$product) {
                return new JsonResponse([
                    'errors' => 'Product not found.'
                ],Response::HTTP_BAD_REQUEST);
            }

            return new JsonResponse($product);
        }
    }
</code>```

Form not validate, and don't show errors, $form->isValid() === true

答:
You can use RangeType instead of IntegerType.</p>

```<code>use Symfony\Component\Form\Extension\Core\Type\RangeType;
// ...

$builder->add('list',
    CollectionType::class,
    [
        'required' => false,
        'allow_add' => true,
        'error_bubbling' => true,
    ])
    ->add('price',
    RangeType::class,
    [
        'required' => false,
        'error_bubbling' => true,
        'min' => 0,
        'max' => 50
    ]);
</code>```

Title: How to set min value for field in form?

Body:
I have form with integer field - price.

$builder->add('list',
            CollectionType::class,
            [
                'required' => false,
                'allow_add' => true,
                'error_bubbling' => true,
            ])
            ->add('price',
            IntegerType::class,
            [
                'required' => false,
                'error_bubbling' => true,
            ]);

How to set, for example, for validation i need min value for price 0 or greater?

I tried this one, but it's not work:

'constraints' => [
new GreaterThanOrEqual(50)
 ],

Thanks for all help.

controller Action

 public function getProductAction(Request $request)
    {
        $variables = $request->get('list');

        $price = $request->get('price');

        $form = $this->createForm(ProductForm::class, null, ['csrf_protection' => false, 'allow_extra_fields' => true]);

        $form->submit(['variables' => $variables, 'prices' => $price]);

        if(!$form->isValid()) {

            $errors = '';

            foreach ($form->getErrors() as $error) {
                $errors = $error->getMessage();
            }

            return new JsonResponse([
                'errors' => $errors
            ],Response::HTTP_BAD_REQUEST);
        } else {

            $product = $this->getDoctrine()
                ->getRepository(Product::class)
                ->findByListAndPrice($list, $price);

            if (!$product) {
                return new JsonResponse([
                    'errors' => 'Product not found.'
                ],Response::HTTP_BAD_REQUEST);
            }

            return new JsonResponse($product);
        }
    }

Form not validate, and don't show errors, $form->isValid() === true

Body:
You can use RangeType instead of IntegerType.

use Symfony\Component\Form\Extension\Core\Type\RangeType;
// ...

$builder->add('list',
    CollectionType::class,
    [
        'required' => false,
        'allow_add' => true,
        'error_bubbling' => true,
    ])
    ->add('price',
    RangeType::class,
    [
        'required' => false,
        'error_bubbling' => true,
        'min' => 0,
        'max' => 50
    ]);


问:
How to download all the dependencies of fabric-sdk-go?
I used command "go get github.com/hyperledger/fabric-sdk-go" to download fabric-sdk-go and its dependencies. No error happened.

In the golang documentation( https://golang.org/cmd/go/#hdr-Download_and_install_packages_and_dependencies ), it said that "Get downloads the packages named by the import paths, along with their dependencies. It then installs the named packages, like 'go install'."

So I originally thought that all the dependencies of fabric-sdk-go would be downloaded recursively. But the fact proved that I was wrong.

When I ran command "go install ./..." under fabric-sdk-go directory, many errors "cannot find package" were displayed:

So my questions are:

Does "go get" download dependencies recursively or not?

How to download all the dependencies of fabric-sdk-go, instead of using "go get [a_dependency_package]" to download every single dependency one by one?

Thanks very much.

答: There is no entry point in the root of the project (i.e. no main method) so there is nowhere for the tool to start looking as it doesn't actually do recursive downloads. Instead it looks at the files in the directory you named in the URL and fetches import paths named in those files. For future reference this command will do what you want it to, go get github.com/hyperledger/fabric-sdk-go/... you can append the triple dot right to your go get command


问:
Kubernetes equivalent of 'docker run -it'
I have one docker image and I am using following command to run it.

```<code>docker run -it -p 1976:1976 --name demo demo.docker.cloud.com/demo/runtime:latest
</code>```

I want to run the same in Kubernetes. This is my current yaml file.

apiVersion: v1
kind: Deployment
metadata:
  name: demo-deployment
  labels:
    app: demo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: demo
  template:
    metadata:
      labels:
        app: demo
    spec:
      containers:
      - name: demo
        image: demo.docker.cloud.com/demo/runtime:latest
        ports:
        - containerPort: 1976
        imagePullPolicy: Never```

This yaml file covers everything except flag "-it". I am not able to find its Kubernetes equivalent. Please help me out with this. Thanks

答:
I assume you are trying to connect a shell to your running container.  Following the guide at https://kubernetes.io/docs/tasks/debug-application-cluster/get-shell-running-container/ - You would need the following commands.  To apply your above configuration:

Create the pod: kubectl apply -f ./demo-deployment.yaml

Verify the Container is running: kubectl get pod demo-deployment

Get a shell to the running Container: kubectl exec -it demo-deployment -- /bin/bash

Body:
I have one docker image and I am using following command to run it.

docker run -it -p 1976:1976 --name demo demo.docker.cloud.com/demo/runtime:latest

I want to run the same in Kubernetes. This is my current yaml file.

apiVersion: v1
kind: Deployment
metadata:
  name: demo-deployment
  labels:
    app: demo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: demo
  template:
    metadata:
      labels:
        app: demo
    spec:
      containers:
      - name: demo
        image: demo.docker.cloud.com/demo/runtime:latest
        ports:
        - containerPort: 1976
        imagePullPolicy: Never

This yaml file covers everything except flag "-it". I am not able to find its Kubernetes equivalent. Please help me out with this. Thanks


答:
```<code>if (operation != '+' || operation != '-' || operation != '*' || operation != '/' || operation !='%'){
    throw new IllegalArgumentException("You must choose a number between 1 and 5 inclusive." + operation);
</code>```

should be

```<code>if (operation != '+' && operation != '-' && operation != '*' && operation != '/' && operation !='%'){
        throw new IllegalArgumentException("You must choose a number between 1 and 5 inclusive." + operation);
    }
</code>```

You should look up the boolean algebra related to OR and AND operators.

Title: Why does my comparison clause always throw an IllegalArgumentException?

Body:
if (operation != '+' || operation != '-' || operation != '*' || operation != '/' || operation !='%'){
    throw new IllegalArgumentException("You must choose a number between 1 and 5 inclusive." + operation);

should be

if (operation != '+' && operation != '-' && operation != '*' && operation != '/' && operation !='%'){
        throw new IllegalArgumentException("You must choose a number between 1 and 5 inclusive." + operation);
    }

You should look up the boolean algebra related to OR and AND operators.