问:
How to add one header in each line in http post request
I'm making a http post request and I have to pass the username and password in the headers.
This is how I'm doing it:

```<code> client.DefaultRequestHeaders.Accept.Clear();

 string jsonObjectA = DataDto.ToJSONString();
 HttpContent content = new StringContent(jsonObjectA, Encoding.UTF8, "application/json");
 client.DefaultRequestHeaders.Add("userName", "".AppendWebConfigValue("username"));
 client.DefaultRequestHeaders.Add("password", "".AppendWebConfigValue("Password"));

 client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
 client.BaseAddress = new Uri("https://url/");
 httpResponse = client.PostAsync("method/test", content).Result;
</code>```

This is how the request should be:

```<code>User-Agent: Fiddler
content-Type : application/json
userName: username
password: password
</code>```

However, this is what I get when I run my code above:

```<code>userName:usernamepassword:passwordAccept:application/json
</code>```

I tried adding using Environment.NewLine but it threw an error that header not in the correct format.

How can I add 2 headers each in a separate line to be able to get a response from the server?

答:
You can use HttpRequestMessage to create the request and add the headers you want:

```<code>static void Main(string[] args)
{
    var client = new HttpClient();

    client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

    var request = new HttpRequestMessage
    {
        RequestUri = new Uri("https://postb.in/1559160461304-0137126960325"),
        Method = HttpMethod.Post,
    };

    request.Headers.Add("username", "username");
    request.Headers.Add("password", "password");

    var httpResponse = client.SendAsync(request).Result;
}
</code>```

Body:
I'm making a http post request and I have to pass the username and password in the headers.
This is how I'm doing it:

 client.DefaultRequestHeaders.Accept.Clear();

 string jsonObjectA = DataDto.ToJSONString();
 HttpContent content = new StringContent(jsonObjectA, Encoding.UTF8, "application/json");
 client.DefaultRequestHeaders.Add("userName", "".AppendWebConfigValue("username"));
 client.DefaultRequestHeaders.Add("password", "".AppendWebConfigValue("Password"));

 client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
 client.BaseAddress = new Uri("https://url/");
 httpResponse = client.PostAsync("method/test", content).Result;

This is how the request should be:

User-Agent: Fiddler
content-Type : application/json
userName: username
password: password

However, this is what I get when I run my code above:

userName:usernamepassword:passwordAccept:application/json

I tried adding using Environment.NewLine but it threw an error that header not in the correct format.

How can I add 2 headers each in a separate line to be able to get a response from the server?

Body:
You can use HttpRequestMessage to create the request and add the headers you want:

static void Main(string[] args)
{
    var client = new HttpClient();

    client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

    var request = new HttpRequestMessage
    {
        RequestUri = new Uri("https://postb.in/1559160461304-0137126960325"),
        Method = HttpMethod.Post,
    };

    request.Headers.Add("username", "username");
    request.Headers.Add("password", "password");

    var httpResponse = client.SendAsync(request).Result;
}


来源: stackexchange

问:
Google Script SetFormula escaping quotes
I cannot figure out the right combination of single and double quotes and \ to get this setFormula to work right.</p>

```<code> SpreadsheetApp.getActiveSheet().getRange('F2').setFormula('=query(arrayformula(Master!A:K), "SELECT B, C, D, E, F, G, H, I, J, K where A = '"& 'Select Your Event'!A3 &"' Order By I, J",1)')
</code>```

答:
Use \' instead of ' on QUERY function literals inside the SQL argument

SpreadsheetApp.getActiveSheet().getRange('F2').setFormula('=query(arrayformula(Master!A:K), "SELECT B, C, D, E, F, G, H, I, J, K where A = \'"& \'Select Your Event\'!A3 &"\' Order By I, J",1)')

ContentLicense: CC BY-SA 4.0

Body:
I cannot figure out the right combination of single and double quotes and \ to get this setFormula to work right.

 SpreadsheetApp.getActiveSheet().getRange('F2').setFormula('=query(arrayformula(Master!A:K), "SELECT B, C, D, E, F, G, H, I, J, K where A = '"& 'Select Your Event'!A3 &"' Order By I, J",1)')


问:
Stop angular cli asking for collecting analytics when I use ng build
Angluar CLI is asking the following question when I am trying to build and deploy my project using gitlab CI/CD:

> @angular/cli@8.0.0 postinstall /workspace/node_modules/@angular/cli
> node ./bin/postinstall/script.js

? Would you like to share anonymous usage data with the Angular Team at Google u
nder
Google’s Privacy Policy at https://policies.google.com/privacy? For more details
 and
how to change this setting, see http://angular.io/analytics. (y/N) ```

Of course I cannot input anything in the CI/CD pipeline. How can I can prevent angular cli from asking this question?

答:
To solve this, run the command appointing to /dev/null

```<code>sudo npm install -g @angular/cli > /dev/null
</code>```

Body:
Angluar CLI is asking the following question when I am trying to build and deploy my project using gitlab CI/CD:

> @angular/cli@8.0.0 postinstall /workspace/node_modules/@angular/cli
> node ./bin/postinstall/script.js

? Would you like to share anonymous usage data with the Angular Team at Google u
nder
Google’s Privacy Policy at https://policies.google.com/privacy? For more details
 and
how to change this setting, see http://angular.io/analytics. (y/N)

Of course I cannot input anything in the CI/CD pipeline. How can I can prevent angular cli from asking this question?

Body:
To solve this, run the command appointing to /dev/null

sudo npm install -g @angular/cli > /dev/null


问:
ALFA(XACML) language documentation or tutorials
I'm trying to find some resources that I could use to learn ALFA language, googling doesn't seem to help me on this one, or I'm asking wrong questions. Could you recommend me some at least decent resources?</p>

答:
I'll be happy to help (as one of the authors of the spec). Here are some useful links:

The ALFA wikipedia page: I personally try to add as many examples of ALFA there to help others.

An introduction to the ALFA Plugin for Eclipse

A beginner's guide to XACML & ALFA - with YouTube videos

Part I

Part II

Part III

Webinars

Boot Camp: ABAC and XACML made easy - Using ALFA to write fine grained authorization policies


问:
Java Class.cast() vs. cast operator
Having being taught during my C++ days about evils of the C-style cast operator I was pleased at first to find that in Java 5 java.lang.Class had acquired a cast method.

I thought that finally we have an OO way of dealing with casting.

Turns out Class.cast is not the same as static_cast in C++.  It is more like reinterpret_cast.  It will not generate a compilation error where it is expected and instead will defer to runtime.  Here is a simple test case to demonstrate different behaviors.

```<code>package test;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

public class TestCast
{
    static final class Foo
    {
    }

    static class Bar
    {
    }

    static final class BarSubclass
        extends Bar
    {
    }

    @Test
    public void test ( )
    {
        final Foo foo = new Foo( );
        final Bar bar = new Bar( );
        final BarSubclass bar_subclass = new BarSubclass( );

        {
            final Bar bar_ref = bar;
        }

        {
            // Compilation error
            final Bar bar_ref = foo;
        }
        {
            // Compilation error
            final Bar bar_ref = (Bar) foo;
        }

        try
        {
            // !!! Compiles fine, runtime exception
            Bar.class.cast( foo );
        }
        catch ( final ClassCastException ex )
        {
            assertTrue( true );
        }

        {
            final Bar bar_ref = bar_subclass;
        }

        try
        {
            // Compiles fine, runtime exception, equivalent of C++ dynamic_cast
            final BarSubclass bar_subclass_ref = (BarSubclass) bar;
        }
        catch ( final ClassCastException ex )
        {
            assertTrue( true );
        }
    }
}
</code>```

So, these are my questions.

Should Class.cast() be banished to Generics land? There it has quite a few legitimate uses.

Should compilers generate compile errors when Class.cast() is used and illegal conditions can be determined at compile time?

Should Java provide a cast operator as a language construct similar to C++?

答:
Generally the cast operator is preferred to the Class#cast method as it's more concise and can be analyzed by the compiler to spit out blatant issues with the code.

Class#cast takes responsibility for type checking at run-time rather than during compilation.

There are certainly use-cases for Class#cast, particularly when it comes to reflective operations.

Since lambda's came to java I personally like using Class#cast with the collections/stream API if I'm working with abstract types, for example.

```<code>Dog findMyDog(String name, Breed breed) {
    return lostAnimals.stream()
                      .filter(Dog.class::isInstance)
                      .map(Dog.class::cast)
                      .filter(dog -> dog.getName().equalsIgnoreCase(name))
                      .filter(dog -> dog.getBreed() == breed)
                      .findFirst()
                      .orElse(null);
}
</code>```

ContentLicense: CC BY-SA 3.0

Title: Java Class.cast() vs. cast operator

Body:
Having being taught during my C++ days about evils of the C-style cast operator I was pleased at first to find that in Java 5 java.lang.Class had acquired a cast method.

I thought that finally we have an OO way of dealing with casting.

Turns out Class.cast is not the same as static_cast in C++.  It is more like reinterpret_cast.  It will not generate a compilation error where it is expected and instead will defer to runtime.  Here is a simple test case to demonstrate different behaviors.

package test;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

public class TestCast
{
    static final class Foo
    {
    }

    static class Bar
    {
    }

    static final class BarSubclass
        extends Bar
    {
    }

    @Test
    public void test ( )
    {
        final Foo foo = new Foo( );
        final Bar bar = new Bar( );
        final BarSubclass bar_subclass = new BarSubclass( );

        {
            final Bar bar_ref = bar;
        }

        {
            // Compilation error
            final Bar bar_ref = foo;
        }
        {
            // Compilation error
            final Bar bar_ref = (Bar) foo;
        }

        try
        {
            // !!! Compiles fine, runtime exception
            Bar.class.cast( foo );
        }
        catch ( final ClassCastException ex )
        {
            assertTrue( true );
        }

        {
            final Bar bar_ref = bar_subclass;
        }

        try
        {
            // Compiles fine, runtime exception, equivalent of C++ dynamic_cast
            final BarSubclass bar_subclass_ref = (BarSubclass) bar;
        }
        catch ( final ClassCastException ex )
        {
            assertTrue( true );
        }
    }
}

So, these are my questions.

Should Class.cast() be banished to Generics land? There it has quite a few legitimate uses.

Should compilers generate compile errors when Class.cast() is used and illegal conditions can be determined at compile time?

Should Java provide a cast operator as a language construct similar to C++?

Body:
Generally the cast operator is preferred to the Class#cast method as it's more concise and can be analyzed by the compiler to spit out blatant issues with the code.

Class#cast takes responsibility for type checking at run-time rather than during compilation.

There are certainly use-cases for Class#cast, particularly when it comes to reflective operations.

Since lambda's came to java I personally like using Class#cast with the collections/stream API if I'm working with abstract types, for example.

Dog findMyDog(String name, Breed breed) {
    return lostAnimals.stream()
                      .filter(Dog.class::isInstance)
                      .map(Dog.class::cast)
                      .filter(dog -> dog.getName().equalsIgnoreCase(name))
                      .filter(dog -> dog.getBreed() == breed)
                      .findFirst()
                      .orElse(null);
}


问:
html question want to move a table beside another
I have two tables. One above the other. I want to move the bottom table to the right of the top table. Right now when I run the server, the top table is positioned above the bottom table. Is there a way to move the bottom table to the right side of the top table?</p>

```<code><table>
        <tr><th>Type</th><th>Quantity</th></tr>
        </tr><td>Tape + Film</td><td>{{total_tape_and_film_items}}</td></tr>
        </tr><td>Electrical Equipment</td><td>{{total_electrical_equipment_items}}</td></tr>
</tables>

<table>
        <tr><th></th><th>Status</th><th>Quantity</th></tr>
        <tr><td><a id="new_client" href='{% url tiptop.views.in_items client.pk%}'/>View</a></td><td>In</td><td>{{in_items|length}}</td</tr>
        <tr><td><a id="new_client" href='{% url tiptop.views.out_items client.pk%}'/>View</a></td><td>Out</td><td>{{out_items|length}}</td</tr>
        <tr><td><a id="new_client" href='{% url tiptop.views.empty_items client.pk%}'/>View</a></td><td>Empty</td><td>{{empty_items|length}}</td</tr>
</table>
</code>```

答:
Something like this should work:

```<code><div style="width: 400px;">

    <div style="width: 200px; float: left;">

        <table>
                <tr><th>Type</th><th>Quantity</th></tr>
                </tr><td>Tape + Film</td><td>{{total_tape_and_film_items}}</td></tr>
                </tr><td>Electrical Equipment</td><td>{{total_electrical_equipment_items}}</td></tr>
        </tables>

    </div>

    <div style="width: 200px; float: left;">

        <table>
                <tr><th></th><th>Status</th><th>Quantity</th></tr>
                <tr><td><a id="new_client" href='{% url tiptop.views.in_items client.pk%}'/>View</a></td><td>In</td><td>{{in_items|length}}</td</tr>
                <tr><td><a id="new_client" href='{% url tiptop.views.out_items client.pk%}'/>View</a></td><td>Out</td><td>{{out_items|length}}</td</tr>
                <tr><td><a id="new_client" href='{% url tiptop.views.empty_items client.pk%}'/>View</a></td><td>Empty</td><td>{{empty_items|length}}</td</tr>
        </table>

    </div>

    <div style="clear: both;"></div>

</div>
</code>```

You should move the CSS to your stylesheet instead if you apply this to production. Good luck.

Body:
I have two tables. One above the other. I want to move the bottom table to the right of the top table. Right now when I run the server, the top table is positioned above the bottom table. Is there a way to move the bottom table to the right side of the top table?

Type	Quantity

Tape + Film	{{total_tape_and_film_items}}

Electrical Equipment	{{total_electrical_equipment_items}}

</tables>

	Status	Quantity

View	In	{{in_items|length}}</td

View	Out	{{out_items|length}}</td

View	Empty	{{empty_items|length}}</td

Body:
Something like this should work:

<div style="width: 400px;">

    <div style="width: 200px; float: left;">

        <table>
                <tr><th>Type</th><th>Quantity</th></tr>
                </tr><td>Tape + Film</td><td>{{total_tape_and_film_items}}</td></tr>
                </tr><td>Electrical Equipment</td><td>{{total_electrical_equipment_items}}</td></tr>
        </tables>

    </div>

    <div style="width: 200px; float: left;">

        <table>
                <tr><th></th><th>Status</th><th>Quantity</th></tr>
                <tr><td><a id="new_client" href='{% url tiptop.views.in_items client.pk%}'/>View</a></td><td>In</td><td>{{in_items|length}}</td</tr>
                <tr><td><a id="new_client" href='{% url tiptop.views.out_items client.pk%}'/>View</a></td><td>Out</td><td>{{out_items|length}}</td</tr>
                <tr><td><a id="new_client" href='{% url tiptop.views.empty_items client.pk%}'/>View</a></td><td>Empty</td><td>{{empty_items|length}}</td</tr>
        </table>

    </div>

    <div style="clear: both;"></div>

</div>

You should move the CSS to your stylesheet instead if you apply this to production. Good luck.


问:
Search all files in repository for pattern in Perforce
Is there a way to search a repository for a pattern that could be contained in one or more code files...

i.e I have the an application, that has a dev, UAT and Prod folders, under each of these there are multiple sub-folders for the code, resource [images, etc], binaries, etc. The program has maybe 100 different code file (.java, .cs, .net, .egl, etc). I would want to click on the application root and do a search for a specific string within each of these files, without having to click on each file.

Is this doable?

I have tried to do the suggestion at https://www.perforce.com/blog/vcs/how-add-grep-command-search-your-helix-core-depot but that only seems to look for file names not the content within a file.

TYIA

答:
Use p4 grep.

https://www.perforce.com/manuals/v18.1/cmdref/Content/CmdRef/p4_grep.html

e.g.:

```<code>p4 grep -e "a pattern" //depot/path/to/my/app/...
</code>```

Body:
Use p4 grep.

https://www.perforce.com/manuals/v18.1/cmdref/Content/CmdRef/p4_grep.html

e.g.:

p4 grep -e "a pattern" //depot/path/to/my/app/...


问:
compare an element of a list with the following in a recursively way
Hi,
Update: Thanks for all your suggestion

assuming that, this exercise it's like a rebus,
I have a list of numbers made with the concept of Cons and Nil,

```<code>List l = new Cons(**3**, new Cons(**2**,new Cons(**1**, new
Cons(**4**, new Cons(**1**, new Nil())))));
</code>```

and I want to count how many of them are immediately followed by a lower number, recursively.

For example

```<code>[5,0,5,3].count() == 2, [5,5,0].count() == 1
</code>```

The count() method is made by me (it cannot have any parameters), the rest is default, and I can't make and other method or use already defined one's like add(),size()...
The "NEXT" must have the next value after the current elem but I can't get a solution.

Any solutions are welcome.

```<code>abstract class List {

    public abstract boolean empty();

    public abstract int first();

    public abstract int count();

}

class Cons extends List {

    private int elem;

    private List next;

  public Cons(int elem, List next) {

   this.elem = elem;

   this.next = next;

}

public boolean empty(){
 return false;
}

public int first(){
 return elem;
}

@Override
public int count() {
  if(elem>NEXT) {
      return 1 + next.count();
  }else {
      return next.count();
 }

}

```![enter image description here](https://i.stack.imgur.com/kWo0v.jpg)
```

答:
```<code>public int NEXT(){
 if(next!=null)
   return next.first()
 else
   throw new Exception("No next element")
}
</code>```

Body:
Hi,
Update: Thanks for all your suggestion

assuming that, this exercise it's like a rebus,
I have a list of numbers made with the concept of Cons and Nil,

List l = new Cons(**3**, new Cons(**2**,new Cons(**1**, new
Cons(**4**, new Cons(**1**, new Nil())))));

and I want to count how many of them are immediately followed by a lower number, recursively.

For example

[5,0,5,3].count() == 2, [5,5,0].count() == 1

The count() method is made by me (it cannot have any parameters), the rest is default, and I can't make and other method or use already defined one's like add(),size()...
The "NEXT" must have the next value after the current elem but I can't get a solution.

Any solutions are welcome.

abstract class List {

    public abstract boolean empty();

    public abstract int first();

    public abstract int count();

}

class Cons extends List {

    private int elem;

    private List next;

  public Cons(int elem, List next) {

   this.elem = elem;

   this.next = next;

}

public boolean empty(){
 return false;
}

public int first(){
 return elem;
}

@Override
public int count() {
  if(elem>NEXT) {
      return 1 + next.count();
  }else {
      return next.count();
 }

}

```![enter image description here](https://i.stack.imgur.com/kWo0v.jpg)


问:
How to fix? Discord.js Bot keeps going offline because of Value error
I keep getting this error

```<code>TypeError: Cannot read property 'size' of undefined
at Client.client.on.message
(/home/colter/Code/groundskeeper/index.js:38:30)
at emitOne (events.js:116:13)
at Client.emit (events.js:211:7)
at MessageCreateHandler.handle
</code>```

I have checked for errors and compared it to the sample code. It all looks right to me.

```<code>client.on('message', message => {
    if (!message.content.startsWith(prefix) || message.author.bot)
return;

const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();

// Here is my syntax for adding commands. So far simple ones, but commands non the less!
if (command === 'ping') {
    message.channel.send('Pong');
}
else if (command === 'beep') {
    message.channel.send('Boop');
}
else if (command === 'server') {
    message.channel.send(`Server name: ${message.guild.name}\nTotal members: ${message.guild.memberCount}`);
}
else if (command === 'user-info') {
    message.channel.send(`Your username: ${message.author.username}\nYour ID: ${message.author.id}`);
}
else if (command === 'args-info') {
    if (!args.length) {
        return message.channel.send(`Your didnt provide any arguments, ${message.author}!`);
    }
    else if (args[0] === 'foo') {
        return message.channel.send('bar');
    }
    message.channel.send(`first argument: ${args[0]}`);
}
else if (command === 'kick') {
    if (!message.mentions.user.size) {
        return message.reply('you need to tag a user in order to kick them');
    }

    const taggedUser = message.mentions.users.first();

    message.channel.send(`You wanted to kick: ${taggedUser}`);
}
});

client.login(token);
</code>```

the expected output should be you need to tag a user in order to kick them from my bot when I use the ?kick command.

答:
On line 38, you have what appears to be a simple typographical error.

user (singular) is not a valid property of MessageMentions. The correct property is users (plural), which you use correctly a few lines later.

Body:
I keep getting this error

TypeError: Cannot read property 'size' of undefined
at Client.client.on.message
(/home/colter/Code/groundskeeper/index.js:38:30)
at emitOne (events.js:116:13)
at Client.emit (events.js:211:7)
at MessageCreateHandler.handle

I have checked for errors and compared it to the sample code. It all looks right to me.

client.on('message', message => {
    if (!message.content.startsWith(prefix) || message.author.bot)
return;

const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();

// Here is my syntax for adding commands. So far simple ones, but commands non the less!
if (command === 'ping') {
    message.channel.send('Pong');
}
else if (command === 'beep') {
    message.channel.send('Boop');
}
else if (command === 'server') {
    message.channel.send(`Server name: ${message.guild.name}\nTotal members: ${message.guild.memberCount}`);
}
else if (command === 'user-info') {
    message.channel.send(`Your username: ${message.author.username}\nYour ID: ${message.author.id}`);
}
else if (command === 'args-info') {
    if (!args.length) {
        return message.channel.send(`Your didnt provide any arguments, ${message.author}!`);
    }
    else if (args[0] === 'foo') {
        return message.channel.send('bar');
    }
    message.channel.send(`first argument: ${args[0]}`);
}
else if (command === 'kick') {
    if (!message.mentions.user.size) {
        return message.reply('you need to tag a user in order to kick them');
    }

    const taggedUser = message.mentions.users.first();

    message.channel.send(`You wanted to kick: ${taggedUser}`);
}
});

client.login(token);

the expected output should be you need to tag a user in order to kick them from my bot when I use the ?kick command.


问:
Reading an Excel file in PHP
I'm trying to read an Excel file (Office 2003). There is an Excel file that needs to be uploaded and its contents parsed.

Via Google, I can only find answers to these related (and insufficient topics): generating Excel files, reading Excel XML files, reading Excel CSV files, or incomplete abandoned projects. I own Office 2003 so if I need any files from there, they are available. It's installed on my box but isn't and can't be installed on my shared host.

Edit: so far all answers point to PHP-ExcelReader and/or this additional article about how to use it.

答:
You have 2 choices as far as I know:

Spreadsheet_Excel_Reader, which knows the Office 2003 binary format

PHPExcel, which knows both Office 2003 as well as Excel 2007 (XML). (Follow the link, and you'll see they upgraded this library to PHPSpreadSheet)

PHPExcel uses Spreadsheet_Excel_Reader for the Office 2003 format.

Update: I once had to read some Excel files but I used the Office 2003 XML format in order to read them and told the people that were using the application to save and upload only that type of Excel file.

OwnerDisplayName: Dinah

Title: Reading an Excel file in PHP

LastEditorDisplayName: Dinah

OwnerDisplayName: Ionut G. Stan

LastEditorDisplayName: Ionut G. Stan


问:
How can i store data from a form in the safest way possible in Django?
I'm creating a site in django; at a certain point, i should be able to store an API key. Obviosuly, this API key should not be stolen, so i need to store it in the safest way possible, just like Django does with passwords.

My question is: is there a way to encrypt data submitted from a form in django? I know how to send data from a form, but how can i store it in the safest way possible?

答:
Use a

csrf_token

As this adds an extra layer of security also try using third-party Django libraries,
If You are using Authentication System to sign in using the build in Django systems, they have good security.


问:
ng build and ng serve not working due to "Could not find the implementation for builder"
I am trying to run a project from github on my Mac.

When I run ng serve or ng build after npm install in the terminal in the correct folder I get the following error

Could not find the implementation for builder @angular-devkit/build-angular:dev-server
Error: Could not find the implementation for builder @angular-devkit/build-angular:dev-server
    at WorkspaceNodeModulesArchitectHost.resolveBuilder (/Users/x/x/x/Angular/node_modules/@angular/cli/node_modules/@angular-devkit/architect/node/node-modules-architect-host.js:49:19)
    at ServeCommand.initialize (/Users/sydney/Downloads/HealthLock-Webapp-master/Angular/node_modules/@angular/cli/models/architect-command.js:135:55)
    at async ServeCommand.validateAndRun (/Users/sydney/Downloads/HealthLock-Webapp-master/Angular/node_modules/@angular/cli/models/command.js:127:9)
    at async Object.runCommand (/Users/x/x/x/Angular/node_modules/@angular/cli/models/command-runner.js:178:24)
    at async default_1 (/Users/x/x/x/Angular/node_modules/@angular/cli/lib/cli/index.js:32:31)

I have followed all the information I could find based on other times this question has been asked here and on other websites. I have uninstalled and reinstalled. I have cleared the cache. I have tried npm install --save-dev @angular-devkit/build-angular, npm update, npm i --only=dev, ng update. I have tried all the solutions I could find but none have worked.

Here is my versions:

```<code> Angular CLI: 8.0.0

 Node: 12.3.1

 OS: darwin x64

 Angular: 8.0.0

 @angular-devkit/architect: 0.13.9

 @angular-devkit/build-angular: 0.13.9

 @angular-devkit/build-optimizer: 0.13.9

 @angular-devkit/build-webpack: 0.13.9

 @angular-devkit/core: 7.3.9

 @angular-devkit/schematics: 8.0.0

 @angular/cdk: 7.3.7

 @angular/http: 8.0.0-beta.10

 @ngtools/webpack: 7.3.9

 @schematics/angular: 8.0.0

 @schematics/update: 0.800.0

 rxjs: 6.5.2

 typescript: 3.4.5

 webpack:4.29.0
</code>```

Here is my json file

```<code> {
   "name": "x",
   "version": "0.0.0",
   "scripts": {
     "ng": "ng",
     "start": "ng serve",
     "build": "ng build",
     "test": "ng test",
     "lint": "ng lint",
     "e2e": "ng e2e"
   },
   "private": true,
   "dependencies": {
     "@angular/animations": "^8.0.0",
     "@angular/cdk": "^7.3.7",
     "@angular/common": "^8.0.0",
     "@angular/compiler": "^8.0.0",
     "@angular/core": "^8.0.0",
     "@angular/forms": "^8.0.0",
     "@angular/http": "^8.0.0-beta.10",
     "@angular/platform-browser": "^8.0.0",
     "@angular/platform-browser-dynamic": "^8.0.0",
     "@angular/router": "^8.0.0",
     "@types/moment": "^2.13.0",
     "angular2-signaturepad": "^2.8.0",
     "core-js": "^2.6.9",
     "hammerjs": "^2.0.8",
     "html2canvas": "^1.0.0-rc.2",
     "jspdf": "^1.5.3",
     "lodash": "^4.17.11",
     "moment": "^2.24.0",
     "ng-circle-progress": "^1.4.1",
     "ng-select": "^1.0.1",
     "ngx-bootstrap": "^3.3.0",
     "ngx-device-detector": "^1.3.5",
     "ngx-mask": "^6.5.18",
     "ngx-owl-carousel-o": "^0.1.2",
     "rxjs": "6.5.2",
     "rxjs-compat": "6.3.3",
     "zone.js": "^0.9.1"
        },
        "devDependencies": {
          "@angular-devkit/build-angular": "^0.13.9",
          "@angular/cli": "^8.0.0",
          "@angular/compiler-cli": "^8.0.0",
          "@angular/language-service": "^8.0.0",
          "@types/jasmine": "^2.8.16",
          "@types/jasminewd2": "^2.0.6",
         "@types/lodash": "^4.14.132",
          "@types/node": "~8.9.4",
          "codelyzer": "~4.2.1",
     "jasmine-core": "~2.99.1",
     "jasmine-spec-reporter": "~4.2.1",
     "karma": "^4.1.0",
     "karma-chrome-launcher": "~2.2.0",
     "karma-coverage-istanbul-reporter": "^2.0.5",
     "karma-jasmine": "~1.1.1",
     "karma-jasmine-html-reporter": "^0.2.2",
     "protractor": "^5.4.2",
     "ts-node": "~5.0.1",
     "tslint": "~5.9.1",
     "typescript": "^3.4.5"
   }
 }
</code>```

Angular.json file

```<code> {
    "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
    "version": 1,
   "newProjectRoot": "projects",
    "projects": {
     "healthlock": {
     "root": "",
  "sourceRoot": "src",
  "projectType": "application",
  "prefix": "app",
  "schematics": {
    "@schematics/angular:component": {
      "styleext": "scss"
    }
  },
  "architect": {
    "build": {
      "builder": "@angular-devkit/build-angular:browser",
      "options": {
        "outputPath": "dist/healthlock",
        "index": "src/index.html",
        "main": "src/main.ts",
        "polyfills": "src/polyfills.ts",
        "tsConfig": "src/tsconfig.app.json",
        "assets": [
          "src/favicon.ico",
          "src/assets"
        ],
        "styles": [
          "node_modules/ngx-owl-carousel-o/lib/styles/prebuilt-themes/owl.carousel.min.css",
          "node_modules/ngx-owl-carousel-o/lib/styles/prebuilt-themes/owl.theme.default.min.css",
          "src/styles.scss"
        ],
        "scripts": ["src/env.js"]
      },
      "configurations": {
        "production": {
          "fileReplacements": [
            {
              "replace": "src/environments/environment.ts",
              "with": "src/environments/environment.prod.ts"
            }
          ],
          "optimization": true,
          "outputHashing": "all",
          "sourceMap": false,
          "extractCss": true,
          "namedChunks": false,
          "aot": true,
          "extractLicenses": true,
          "vendorChunk": false,
          "buildOptimizer": true
        }
      }
    },
    "serve": {
      "builder": "@angular-devkit/build-angular:dev-server",
      "options": {
        "browserTarget": "healthlock:build"
      },
      "configurations": {
        "production": {
          "browserTarget": "healthlock:build:production"
        }
      }
    },
    "extract-i18n": {
      "builder": "@angular-devkit/build-angular:extract-i18n",
      "options": {
        "browserTarget": "healthlock:build"
      }
    },
    "test": {
      "builder": "@angular-devkit/build-angular:karma",
      "options": {
        "main": "src/test.ts",
        "polyfills": "src/polyfills.ts",
        "tsConfig": "src/tsconfig.spec.json",
        "karmaConfig": "src/karma.conf.js",
        "styles": [
          "src/styles.scss"
        ],
        "scripts": [],
        "assets": [
          "src/favicon.ico",
          "src/assets"
        ]
      }
    },
    "lint": {
      "builder": "@angular-devkit/build-angular:tslint",
      "options": {
        "tsConfig": [
          "src/tsconfig.app.json",
          "src/tsconfig.spec.json"
        ],
        "exclude": [
          "**/node_modules/**"
        ]
      }
    }
  }
},
"healthlock-e2e": {
  "root": "e2e/",
  "projectType": "application",
  "architect": {
    "e2e": {
      "builder": "@angular-devkit/build-angular:protractor",
      "options": {
        "protractorConfig": "e2e/protractor.conf.js",
        "devServerTarget": "healthlock:serve"
      },
      "configurations": {
        "production": {
          "devServerTarget": "healthlock:serve:production"
        }
      }
    },
    "lint": {
      "builder": "@angular-devkit/build-angular:tslint",
      "options": {
        "tsConfig": "e2e/tsconfig.e2e.json",
        "exclude": [
          "**/node_modules/**"
        ]
      }
    }
  }
}
    },
   "defaultProject": "healthlock"
</code>```

答:
Could you please share your file: angular.json

You should have something like this inside architect :{..}

for ng serve :

```<code>...
"serve": {
              "builder": "@angular-devkit/build-angular:dev-server",
              "options": {
                "browserTarget": "HealthLock-Webapp-master:build"
              },
              "configurations": {
                "production": {
                  "browserTarget": "HealthLock-Webapp-master:build:production"
                }
              }
            }, ...
</code>```

and for ng build:

```<code>...
"build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist",
            "index": "src/index.html",
            "main": "src/main.ts",
            "tsConfig": "src/tsconfig.app.json",
            "polyfills": "src/polyfills.ts",
            "assets": [
              "src/assets",
              "src/favicon.ico"
            ],
            "styles": [
              "src/styles.scss",
              "src/theme.scss"
            ],
            "scripts": []
          },
          "configurations": {
            "production": {
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ]
            }}...
</code>```

Body:
I am trying to run a project from github on my Mac.

When I run ng serve or ng build after npm install in the terminal in the correct folder I get the following error

Could not find the implementation for builder @angular-devkit/build-angular:dev-server
Error: Could not find the implementation for builder @angular-devkit/build-angular:dev-server
    at WorkspaceNodeModulesArchitectHost.resolveBuilder (/Users/x/x/x/Angular/node_modules/@angular/cli/node_modules/@angular-devkit/architect/node/node-modules-architect-host.js:49:19)
    at ServeCommand.initialize (/Users/sydney/Downloads/HealthLock-Webapp-master/Angular/node_modules/@angular/cli/models/architect-command.js:135:55)
    at async ServeCommand.validateAndRun (/Users/sydney/Downloads/HealthLock-Webapp-master/Angular/node_modules/@angular/cli/models/command.js:127:9)
    at async Object.runCommand (/Users/x/x/x/Angular/node_modules/@angular/cli/models/command-runner.js:178:24)
    at async default_1 (/Users/x/x/x/Angular/node_modules/@angular/cli/lib/cli/index.js:32:31)

I have followed all the information I could find based on other times this question has been asked here and on other websites. I have uninstalled and reinstalled. I have cleared the cache. I have tried npm install --save-dev @angular-devkit/build-angular, npm update, npm i --only=dev, ng update. I have tried all the solutions I could find but none have worked.

Here is my versions:

 Angular CLI: 8.0.0

 Node: 12.3.1

 OS: darwin x64

 Angular: 8.0.0

 @angular-devkit/architect: 0.13.9

 @angular-devkit/build-angular: 0.13.9

 @angular-devkit/build-optimizer: 0.13.9

 @angular-devkit/build-webpack: 0.13.9

 @angular-devkit/core: 7.3.9

 @angular-devkit/schematics: 8.0.0

 @angular/cdk: 7.3.7

 @angular/http: 8.0.0-beta.10

 @ngtools/webpack: 7.3.9

 @schematics/angular: 8.0.0

 @schematics/update: 0.800.0

 rxjs: 6.5.2

 typescript: 3.4.5

 webpack:4.29.0

Here is my json file

 {
   "name": "x",
   "version": "0.0.0",
   "scripts": {
     "ng": "ng",
     "start": "ng serve",
     "build": "ng build",
     "test": "ng test",
     "lint": "ng lint",
     "e2e": "ng e2e"
   },
   "private": true,
   "dependencies": {
     "@angular/animations": "^8.0.0",
     "@angular/cdk": "^7.3.7",
     "@angular/common": "^8.0.0",
     "@angular/compiler": "^8.0.0",
     "@angular/core": "^8.0.0",
     "@angular/forms": "^8.0.0",
     "@angular/http": "^8.0.0-beta.10",
     "@angular/platform-browser": "^8.0.0",
     "@angular/platform-browser-dynamic": "^8.0.0",
     "@angular/router": "^8.0.0",
     "@types/moment": "^2.13.0",
     "angular2-signaturepad": "^2.8.0",
     "core-js": "^2.6.9",
     "hammerjs": "^2.0.8",
     "html2canvas": "^1.0.0-rc.2",
     "jspdf": "^1.5.3",
     "lodash": "^4.17.11",
     "moment": "^2.24.0",
     "ng-circle-progress": "^1.4.1",
     "ng-select": "^1.0.1",
     "ngx-bootstrap": "^3.3.0",
     "ngx-device-detector": "^1.3.5",
     "ngx-mask": "^6.5.18",
     "ngx-owl-carousel-o": "^0.1.2",
     "rxjs": "6.5.2",
     "rxjs-compat": "6.3.3",
     "zone.js": "^0.9.1"
        },
        "devDependencies": {
          "@angular-devkit/build-angular": "^0.13.9",
          "@angular/cli": "^8.0.0",
          "@angular/compiler-cli": "^8.0.0",
          "@angular/language-service": "^8.0.0",
          "@types/jasmine": "^2.8.16",
          "@types/jasminewd2": "^2.0.6",
         "@types/lodash": "^4.14.132",
          "@types/node": "~8.9.4",
          "codelyzer": "~4.2.1",
     "jasmine-core": "~2.99.1",
     "jasmine-spec-reporter": "~4.2.1",
     "karma": "^4.1.0",
     "karma-chrome-launcher": "~2.2.0",
     "karma-coverage-istanbul-reporter": "^2.0.5",
     "karma-jasmine": "~1.1.1",
     "karma-jasmine-html-reporter": "^0.2.2",
     "protractor": "^5.4.2",
     "ts-node": "~5.0.1",
     "tslint": "~5.9.1",
     "typescript": "^3.4.5"
   }
 }

Angular.json file

 {
    "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
    "version": 1,
   "newProjectRoot": "projects",
    "projects": {
     "healthlock": {
     "root": "",
  "sourceRoot": "src",
  "projectType": "application",
  "prefix": "app",
  "schematics": {
    "@schematics/angular:component": {
      "styleext": "scss"
    }
  },
  "architect": {
    "build": {
      "builder": "@angular-devkit/build-angular:browser",
      "options": {
        "outputPath": "dist/healthlock",
        "index": "src/index.html",
        "main": "src/main.ts",
        "polyfills": "src/polyfills.ts",
        "tsConfig": "src/tsconfig.app.json",
        "assets": [
          "src/favicon.ico",
          "src/assets"
        ],
        "styles": [
          "node_modules/ngx-owl-carousel-o/lib/styles/prebuilt-themes/owl.carousel.min.css",
          "node_modules/ngx-owl-carousel-o/lib/styles/prebuilt-themes/owl.theme.default.min.css",
          "src/styles.scss"
        ],
        "scripts": ["src/env.js"]
      },
      "configurations": {
        "production": {
          "fileReplacements": [
            {
              "replace": "src/environments/environment.ts",
              "with": "src/environments/environment.prod.ts"
            }
          ],
          "optimization": true,
          "outputHashing": "all",
          "sourceMap": false,
          "extractCss": true,
          "namedChunks": false,
          "aot": true,
          "extractLicenses": true,
          "vendorChunk": false,
          "buildOptimizer": true
        }
      }
    },
    "serve": {
      "builder": "@angular-devkit/build-angular:dev-server",
      "options": {
        "browserTarget": "healthlock:build"
      },
      "configurations": {
        "production": {
          "browserTarget": "healthlock:build:production"
        }
      }
    },
    "extract-i18n": {
      "builder": "@angular-devkit/build-angular:extract-i18n",
      "options": {
        "browserTarget": "healthlock:build"
      }
    },
    "test": {
      "builder": "@angular-devkit/build-angular:karma",
      "options": {
        "main": "src/test.ts",
        "polyfills": "src/polyfills.ts",
        "tsConfig": "src/tsconfig.spec.json",
        "karmaConfig": "src/karma.conf.js",
        "styles": [
          "src/styles.scss"
        ],
        "scripts": [],
        "assets": [
          "src/favicon.ico",
          "src/assets"
        ]
      }
    },
    "lint": {
      "builder": "@angular-devkit/build-angular:tslint",
      "options": {
        "tsConfig": [
          "src/tsconfig.app.json",
          "src/tsconfig.spec.json"
        ],
        "exclude": [
          "**/node_modules/**"
        ]
      }
    }
  }
},
"healthlock-e2e": {
  "root": "e2e/",
  "projectType": "application",
  "architect": {
    "e2e": {
      "builder": "@angular-devkit/build-angular:protractor",
      "options": {
        "protractorConfig": "e2e/protractor.conf.js",
        "devServerTarget": "healthlock:serve"
      },
      "configurations": {
        "production": {
          "devServerTarget": "healthlock:serve:production"
        }
      }
    },
    "lint": {
      "builder": "@angular-devkit/build-angular:tslint",
      "options": {
        "tsConfig": "e2e/tsconfig.e2e.json",
        "exclude": [
          "**/node_modules/**"
        ]
      }
    }
  }
}
    },
   "defaultProject": "healthlock"

Body:
Could you please share your file: angular.json

You should have something like this inside architect :{..}

for ng serve :

...
"serve": {
              "builder": "@angular-devkit/build-angular:dev-server",
              "options": {
                "browserTarget": "HealthLock-Webapp-master:build"
              },
              "configurations": {
                "production": {
                  "browserTarget": "HealthLock-Webapp-master:build:production"
                }
              }
            }, ...

and for ng build:

...
"build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist",
            "index": "src/index.html",
            "main": "src/main.ts",
            "tsConfig": "src/tsconfig.app.json",
            "polyfills": "src/polyfills.ts",
            "assets": [
              "src/assets",
              "src/favicon.ico"
            ],
            "styles": [
              "src/styles.scss",
              "src/theme.scss"
            ],
            "scripts": []
          },
          "configurations": {
            "production": {
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ]
            }}...


问:
Is it possible to build separate CSS file with angular-cli?
By default everything is bundled in:

inline.bundle.js

polyfills.bundle.js

styles.bundle.js

vendor.bundle.js

main.bundle.js

Is it possible to have separate CSS file?

答:
Yes!  In your angular.json file the common thing to do is

"styles": [
  "styles/bootstrap.scss",
  "styles/app.scss",
  "styles/whatever-else.scss"
]
```
<p>and that all gets combined into a <code>dist/styles.5d56937b24df63b1d01d.css</code> file or whatever it decides to name it.</p>
<p><strong>INSTEAD</strong> you can use the object notation defined here</p>
<pre class="lang-json prettyprint-override"><code>"styles": [
  {
    "input": "styles/bootstrap.scss",
    "bundleName": "bootstrap"
  },
  {
    "input": "styles/app.scss",
    "bundleName": "app"
  },
  {
    "input": "styles/whatever-else.scss",
    "bundleName": "foo-bar"
  },
]
</code>```

and this will generate 3 separate CSS files:

dist/bootstrap.*.css

dist/app.*.css

dist/foo-bar.*.css

Body:
Yes!  In your angular.json file the common thing to do is

"styles": [
  "styles/bootstrap.scss",
  "styles/app.scss",
  "styles/whatever-else.scss"
]

and that all gets combined into a dist/styles.5d56937b24df63b1d01d.css file or whatever it decides to name it.

INSTEAD you can use the object notation defined here

"styles": [
  {
    "input": "styles/bootstrap.scss",
    "bundleName": "bootstrap"
  },
  {
    "input": "styles/app.scss",
    "bundleName": "app"
  },
  {
    "input": "styles/whatever-else.scss",
    "bundleName": "foo-bar"
  },
]

and this will generate 3 separate CSS files:

dist/bootstrap.*.css

dist/app.*.css

dist/foo-bar.*.css


问:
How can I simulate SerialPort interactions for testing?
I'm about to start developing a small app (C#) that communicates with a PLC and a testing unit via Serial Ports - this is my first venture into this area.

In essence, I am going to send the PLC a signal to start an operation, and then I am going to wait for the result of that operation from the test unit (which will be independently communicating with the PLC) to return a ASCII string.

Depending on the content of that string, I may want to listen to a signal from the PLC...

It's all new to me, so at the moment, I'm just researching System.IO.Ports.SerialPort; digression: are there third part products out there than simplify interaction with the Serial Port, or are the built-in classes as good as you will get? I'm thinking of ease of use as opposed to better features.

However, it will be a few weeks before the hardware is available for development and testing, so I was wondering how I could simulate communication to/from the serial port so that I can start developing my app?

[I don't yet know how the PLC and the PC are due to communicate - I understand it will be binary rather than text, but at the moment, that is all I know.]

答: I've had some success in the past using com0com.</p>


问:
How to print ★ symbol on SSRS report
While Crystal reports can handle this, we are transitioning to SSRS and we need to display it on our work travelers to comply with our suppliers.  Are there alternatives to display a black star on SSRS, that can still be pulled from a text field (image not possible)?

I haven't been able to find unicode options other than this ★ (U+2605).

When the report prints, the empty square indicating "no symbol" is displayed.

答:
You can use the Wingdings font for that.  If you paste the following character, it will appear as a black star in Wingdings:

«

Title: How to print ★ symbol on SSRS report


问:
How to remove an untitled/id'ed element and change another parent elements properties?
I have a webpage accessed via a lan connection for a screen sharing service that offers a form of a control panel that is unnecessary for functionality and reduces the size of the screen being shared. I have been manually editing the elements via chrome's inspection panels to remove said control panel and maximize the shared screen's size and placement.

Being unfamiliar with javascript I have attempted to use the get elementByID and parentNode functionalities however the attempts to remove the element always failed.

```<code><html>
    <head>
        <title>ScreenStream</title>
    </head>
    <frameset cols="208px, *" frameborder="1">
        <div id="i4c-draggable-container" style="position: fixed; z-index: 1499; width: 0px; height: 0px;">
            <div data-reactroot="" class="resolved" style="all: initial;">
            </div>
        </div>
        <frameset rows="15%, 208px, *">
            <frame src="1" name="frHeader" scrolling="auto" noresize="" marginwidth="0" marginheight="0">
            <frame src="2" name="frCamera" scrolling="no" marginwidth="0" marginheight="0">
            <frame src="3" name="frControl" scrolling="no" noresize="" marginwidth="0" marginheight="0">
        </frameset>
        <frame src="4" scrolling="auto" name="frScreen" marginwidth="0" marginheight="0">
        <div id="i4c-dialogs-container">
        </div>
    </frameset>
</html>
</code>```

I have been deleting the "<frameset rows="15%, 208px, *">" element by hand, and changing the "<frameset cols="208px, *" frameborder="1">" to "cols=100%" and it has worked for my purpose however I was looking to create a bookmark with a javascript:(function) to automate the process.

答:
```<code>javascript:(function()%7Bdocument.querySelector('frameset%5Brows%3D%2215%25%2C%20208px%2C%20*%22%5D').remove()%3B%20document.querySelector('frameset%5Bcols%3D%22208px%2C%20*%22%5D').setAttribute('cols'%2C%20'100%25')%7D)()
</code>```

Following the advice of Panther I managed to identify functioning lines of javascript to allow the selection of the needed framesets. With some testing on my end it appears that Chrome wanted to operate within a set formatting and required me to run the code through Mr.Coles' Bookmarklet Creator.

Body:
I have a webpage accessed via a lan connection for a screen sharing service that offers a form of a control panel that is unnecessary for functionality and reduces the size of the screen being shared. I have been manually editing the elements via chrome's inspection panels to remove said control panel and maximize the shared screen's size and placement.

Being unfamiliar with javascript I have attempted to use the get elementByID and parentNode functionalities however the attempts to remove the element always failed.

        <title>ScreenStream</title>

    <frameset cols="208px, *" frameborder="1">

        <frameset rows="15%, 208px, *">
            <frame src="1" name="frHeader" scrolling="auto" noresize="" marginwidth="0" marginheight="0">
            <frame src="2" name="frCamera" scrolling="no" marginwidth="0" marginheight="0">
            <frame src="3" name="frControl" scrolling="no" noresize="" marginwidth="0" marginheight="0">
        </frameset>
        <frame src="4" scrolling="auto" name="frScreen" marginwidth="0" marginheight="0">

    </frameset>

I have been deleting the "<frameset rows="15%, 208px, *">" element by hand, and changing the "<frameset cols="208px, *" frameborder="1">" to "cols=100%" and it has worked for my purpose however I was looking to create a bookmark with a javascript:(function) to automate the process.

Body:
javascript:(function()%7Bdocument.querySelector('frameset%5Brows%3D%2215%25%2C%20208px%2C%20*%22%5D').remove()%3B%20document.querySelector('frameset%5Bcols%3D%22208px%2C%20*%22%5D').setAttribute('cols'%2C%20'100%25')%7D)()

Following the advice of Panther I managed to identify functioning lines of javascript to allow the selection of the needed framesets. With some testing on my end it appears that Chrome wanted to operate within a set formatting and required me to run the code through Mr.Coles' Bookmarklet Creator.


问:
how to use flashbug
How to use flashbug? Comparing the printscreens from addon page:
https://addons.mozilla.org/en-us/firefox/addon/flashbug/

with printscreen that I made:
http://img42.imageshack.us/img42/7686/flbug.jpg
http://img840.imageshack.us/img840/1255/flbug2.jpg

On my printscreens flashbug looks empty. Additionally, I made a statement trace("aaa"); and nothing appears in tab "Trace". So obviously I must be doing something wrong.

Or maybe there is a different/easier way to debug flash from a browser.

答: Are you sure you are using the debug version of Flash Player? To figure it out, just right click on an swf in firefox, you should see:

Title: how to use flashbug


问:
Azure Media Services clip live archive
I have a live stream on Azure Media Service that I want to create a dynamic filter on to only show a small section of that stream. Imagine that we have a stream going on for 24 hours and but the content that current user cares about is only 1 minute long. So we want to create a dynamic filter on this stream that only shows this specific minute.

When I read this document https://learn.microsoft.com/en-us/azure/media-services/previous/media-services-dynamic-manifest-overview#creating-subclips-views-from-a-live-archive

It says: "With Dynamic Manifest, you can create filters using start/end times and create virtual views over the top of your live archive.".

However, when I check another page for the filters https://learn.microsoft.com/en-us/rest/api/media/operations/presentationtimerange

It says: "EndTimestamp: Applies to VoD. For the Live presentation, it is silently ignored and applied when the presentation ends and the stream becomes VoD."

Is it not possible to use dynamic filters (presentationeTimeRange) to create a small video clip for a live stream? Do the live stream needs to end before it's possible?

What am I missing?

答: It was possible with V3 of the api. I had previously only used V2.</p>

Title: Azure Media Services clip live archive


问:
How to extract a subString from android java String?
I tried to extract Sub-String from java string, but failed. i tried like this

```<code>String text = "audios/{any_number} any_audio_name.mp3";
text= text.substring(text.indexOf('/'), text.indexOf('3')-2);
</code>```

Updated

I need String contains only any_audio_name and removing audios/ , any number e.g. {123} and .mp3

For example audios/{211} new school poem.mp3 to new school poem

答:
For Your Edited Question.Following Code segment will help you but here i assume that there will be no number within "any_audio_name"</p>

```<code>String text = "audios/{any_number}any_audio_name.mp3";
text= text.substring(text.indexOf('/')+1, text.indexOf('.')).replaceAll("[\\d.]", "");;
</code>```

Body:
I tried to extract Sub-String from java string, but failed. i tried like this

String text = "audios/{any_number} any_audio_name.mp3";
text= text.substring(text.indexOf('/'), text.indexOf('3')-2);

Updated

I need String contains only any_audio_name and removing audios/ , any number e.g. {123} and .mp3

For example audios/{211} new school poem.mp3 to new school poem

Body:
For Your Edited Question.Following Code segment will help you but here i assume that there will be no number within "any_audio_name"

String text = "audios/{any_number}any_audio_name.mp3";
text= text.substring(text.indexOf('/')+1, text.indexOf('.')).replaceAll("[\\d.]", "");;


问:
Can't load 'Caret' in R
When loading the caret package the following error appears.

```<code>> library(caret)
Error: package or namespace load failed for ‘caret’:
 object ‘warnErrList’ is not exported by 'namespace:utils'
</code>```

Even I tried to install 'caret' with all dependencies, it still shows: object ‘warnErrList’ is not exported by 'namespace:utils'

答:
Xu Gao, it is likely that you are on a version of R prior to 3.5.0. Either you will need to upgrade R, or downgrade whatever package is dependent on it.

If you read R-devel NEWS, search for warnErrList, and you'll find

New warnErrList() utility (from package nlme, improved)

You can back this up by looking at the list of exported functions for utils in R-3.5.0 and you can find warnErrList, whereas utils in R-3.4.3 (the previous release of R), the function cannot be found.

Unfortunately, I cannot find utils::warnErrList in the caret source directly, which suggests one of its dependencies might be using it and you find out about it late in the game. If you run traceback() immediately after receiving that error, it may provide some insight as to which package is trying to use it. (Some sleuthing will likely be required, searching for function names, even those that are not exported by the intermediate packages.)

Also, I request that you please submit a %3D+3.5.0" rel="nofollow noreferrer">caret issue, including the steps necessary to justify the bug. (I could start an issue, but because I have R-3.5.3, caret-6.0.80, and I cannot reproduce the bug ... it could be disingenuous of me to file the bug ... not to mention that I might be completely wrong about this :-)

Title: Can't load 'Caret' in R

Body:
When loading the caret package the following error appears.

> library(caret)
Error: package or namespace load failed for ‘caret’:
 object ‘warnErrList’ is not exported by 'namespace:utils'

Even I tried to install 'caret' with all dependencies, it still shows: object ‘warnErrList’ is not exported by 'namespace:utils'

Body:
Xu Gao, it is likely that you are on a version of R prior to 3.5.0. Either you will need to upgrade R, or downgrade whatever package is dependent on it.

If you read R-devel NEWS, search for warnErrList, and you'll find

New warnErrList() utility (from package nlme, improved)

You can back this up by looking at the list of exported functions for utils in R-3.5.0 and you can find warnErrList, whereas utils in R-3.4.3 (the previous release of R), the function cannot be found.

Unfortunately, I cannot find utils::warnErrList in the caret source directly, which suggests one of its dependencies might be using it and you find out about it late in the game. If you run traceback() immediately after receiving that error, it may provide some insight as to which package is trying to use it. (Some sleuthing will likely be required, searching for function names, even those that are not exported by the intermediate packages.)

Also, I request that you please submit a caret issue, including the steps necessary to justify the bug. (I could start an issue, but because I have R-3.5.3, caret-6.0.80, and I cannot reproduce the bug ... it could be disingenuous of me to file the bug ... not to mention that I might be completely wrong about this :-)


问:
What is best control in Java for simple editor
I need to implement light editor ( recognize part of key words, syntax highlight and suggest all of word in dropdown list if user type part with same prefix). What is best control in Java for this task ?</p>

答:
I recommend to reuse the editor of NetBeans or Eclipse.

http://wiki.netbeans.org/How_to_create_support_for_a_new_language

http://platform.netbeans.org/tutorials/nbm-code-completion.html

http://netbeans.org/kb/trails/platform.html


问:
Does sequelize support SQL Server views?
I'm working on a project that I need to define a model from SQL Server views. Is it possible to define a model from views according to not to use table joins and decrease complexities.</p>

答: Yes, you can point a Sequelize model at a view, rather than a table at least for SELECT statements (e.g. model.findAll())   I doubt that model.sync() would work against a view, but haven't tested.  IIRC, some databases allow INSERT, UPDATE or DELETE against views in limited cases) and in those limited cases you might be able to use model.create(), model.update() or model.delete() also.


问:
Partial search in HashMap
I need to create phone book kind of thing. It contains name & number. Now when I type letters matching list should be returned. For the example given below, when I type H, a list containing Harmer, Harris, Hawken, Hosler should be returned. When type Ha then list containing only Harmer, Harris, Hawken should be returned. </p>

```<code>  Map<String, String> nameNum = new HashMap<String, String>();

  nameNum.put("Brown", "+1236389023");
  nameNum.put("Bob", "+1236389023");
  nameNum.put("Harmer", "+1236389023");
  nameNum.put("Harris", "+1236389023");
  nameNum.put("Hawken", "+1236389023");
  nameNum.put("Hosler", "+1236389023");
</code>```

<p>Any idea how achieve it?
Thanks in advance. </p>

答:
Remove all values which doesn't contain key part:

```<code>yourMap.keySet().removeIf(key -> !key.contains(keyPart));
</code>```

Or regex:

```<code>yourMap.keySet().removeIf(key -> !key.matches(".*keyPart.*"));
</code>```

Or filter stream and collect to a new map:

```<code>yourMap.entrySet().stream().filter(e -> e.getKey().contains(keyPart)).collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue()));
</code>```

Title: Partial search in HashMap

Body:
I need to create phone book kind of thing. It contains name & number. Now when I type letters matching list should be returned. For the example given below, when I type H, a list containing Harmer, Harris, Hawken, Hosler should be returned. When type Ha then list containing only Harmer, Harris, Hawken should be returned.

  Map<String, String> nameNum = new HashMap<String, String>();

  nameNum.put("Brown", "+1236389023");
  nameNum.put("Bob", "+1236389023");
  nameNum.put("Harmer", "+1236389023");
  nameNum.put("Harris", "+1236389023");
  nameNum.put("Hawken", "+1236389023");
  nameNum.put("Hosler", "+1236389023");

Any idea how achieve it?
Thanks in advance.

Body:
Remove all values which doesn't contain key part:

yourMap.keySet().removeIf(key -> !key.contains(keyPart));

Or regex:

yourMap.keySet().removeIf(key -> !key.matches(".*keyPart.*"));

Or filter stream and collect to a new map:

yourMap.entrySet().stream().filter(e -> e.getKey().contains(keyPart)).collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue()));


问:
API key error The variable "GOOGLE_MAPS_IOS_API_KEY" is not registered
I have a project which was created in Cordova and Ionic and should use the plugin cordova-plugin-googlemaps in version 2.6.2. I know that starting with version 2.6.0 of the GoogleMaps plugin in the config.xml file the API key of GoogleMaps has to be integrated as follows which I have:

```<code><preference name = "GOOGLE_MAPS_ANDROID_API_KEY" value = "(api_key)" />
<preference name = "GOOGLE_MAPS_IOS_API_KEY" value = "(api_key)" />
</code>```

So far I have only found the solution to regenerate the old API key which I did. I also included the old API key and generated a completely new one. I have no restrictions in it and also put a restriction. However I still get the error message

```<code>API key error
The variable "GOOGLE_MAPS_IOS_API_KEY" is not registered.
</code>```

config.xml

```<code><?xml version='1.0' encoding='utf-8'?>
<widget id="id_bundle" version="0.9.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>App_Name</name>
    <description>An awesome Ionic/Cordova app.</description>
    <author email="mail" href="URL">APP Developer Team</author>
    <content src="index.html" />
    <access origin="*" />
    <allow-navigation href="http://ionic.local/*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <preference name="webviewbounce" value="false" />
    <preference name="UIWebViewBounce" value="false" />
    <preference name="DisallowOverscroll" value="true" />
    <preference name="android-minSdkVersion" value="19" />
    <preference name="BackupWebStorage" value="none" />
    <preference name="orientation" value="portrait" />
    <preference name="SplashScreen" value="screen" />
    <preference name="AutoHideSplashScreen" value="false" />
    <preference name="SplashScreenDelay" value="20000" />
    <preference name="ShowSplashScreenSpinner" value="true" />
    <preference name="FadeSplashScreen" value="true" />
    <preference name="FadeSplashScreenDuration" value="2000" />
    <preference name="SplashShowOnlyFirstTime" value="false" />
    <platform name="android">
        <allow-intent href="market:*" />
        <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
        <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
        <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
        <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
        <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
        <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
        <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
        <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
        <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
        <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
        <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
        <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
        <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
        <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
        <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
        <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
        <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
        <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <icon height="57" src="resources/ios/icon/icon.png" width="57" />
        <icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
        <icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
        <icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
        <icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
        <icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
        <icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
        <icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
        <icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
        <icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
        <icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
        <icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
        <icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
        <icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
        <icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
        <icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
        <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
        <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
        <icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
        <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
        <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
        <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
        <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
        <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
        <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
        <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
        <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
        <splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
        <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
        <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
        <splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
        <splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
        <preference name="TopActivityIndicator" value="whiteLarge" />
    </platform>
    <icon src="resources/android/icon/drawable-xhdpi-icon.png" />
    <engine name="android" spec="^7.1.1" />
    <engine name="ios" spec="4.5.5" />
    <plugin name="cordova-plugin-device" spec="^2.0.2" />
    <plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
    <plugin name="cordova-plugin-statusbar" spec="^2.4.2" />
    <plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
    <plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
    <plugin name="cordova-plugin-geolocation" spec="^4.0.1">
        <variable name="GEOLOCATION_USAGE_DESCRIPTION" value=" " />
    </plugin>
    <plugin name="cordova-plugin-datepicker" spec="^0.9.3" />
    <plugin name="phonegap-plugin-push" spec="^1.11.1">
        <variable name="SENDER_ID" value="1234567890" />
    </plugin>
    <plugin name="cordova-plugin-ionic-webview" spec="^1.2.1" />
    <plugin name="cordova-plugin-globalization" spec="^1.11.0" />
    <plugin name="cordova-android-support-gradle-release" spec="^1.4.4">
        <variable name="ANDROID_SUPPORT_VERSION" value="27.+" />
    </plugin>
    <preference name="GOOGLE_MAPS_ANDROID_API_KEY" value="api_key" />
    <preference name="GOOGLE_MAPS_IOS_API_KEY" value="api_key" />
</widget>
</code>```

Cordova Plugin List

```<code>cordova-android-support-gradle-release 1.4.4 "cordova-android-support-gradle-release"
cordova-plugin-datepicker 0.9.3 "DatePicker"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-globalization 1.11.0 "Globalization"
cordova-plugin-googlemaps 2.6.2 "cordova-plugin-googlemaps"
cordova-plugin-ionic-webview 1.2.1 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-sqlite-storage 3.2.0 "Cordova sqlite storage plugin - cordova-sqlite-storage plugin version"
ionic-plugin-keyboard 2.2.1 "Keyboard"
phonegap-plugin-push 1.11.1 "PushPlugin"
</code>```

What can cause this error?

答: same hare the map works fine but this message is annoying me</p>

Body:
I have a project which was created in Cordova and Ionic and should use the plugin cordova-plugin-googlemaps in version 2.6.2. I know that starting with version 2.6.0 of the GoogleMaps plugin in the config.xml file the API key of GoogleMaps has to be integrated as follows which I have:

<preference name = "GOOGLE_MAPS_ANDROID_API_KEY" value = "(api_key)" />
<preference name = "GOOGLE_MAPS_IOS_API_KEY" value = "(api_key)" />

So far I have only found the solution to regenerate the old API key which I did. I also included the old API key and generated a completely new one. I have no restrictions in it and also put a restriction. However I still get the error message

API key error
The variable "GOOGLE_MAPS_IOS_API_KEY" is not registered.

config.xml

<?xml version='1.0' encoding='utf-8'?>
<widget id="id_bundle" version="0.9.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>App_Name</name>
    <description>An awesome Ionic/Cordova app.</description>
    <author email="mail" href="URL">APP Developer Team</author>
    <content src="index.html" />
    <access origin="*" />
    <allow-navigation href="http://ionic.local/*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <preference name="webviewbounce" value="false" />
    <preference name="UIWebViewBounce" value="false" />
    <preference name="DisallowOverscroll" value="true" />
    <preference name="android-minSdkVersion" value="19" />
    <preference name="BackupWebStorage" value="none" />
    <preference name="orientation" value="portrait" />
    <preference name="SplashScreen" value="screen" />
    <preference name="AutoHideSplashScreen" value="false" />
    <preference name="SplashScreenDelay" value="20000" />
    <preference name="ShowSplashScreenSpinner" value="true" />
    <preference name="FadeSplashScreen" value="true" />
    <preference name="FadeSplashScreenDuration" value="2000" />
    <preference name="SplashShowOnlyFirstTime" value="false" />
    <platform name="android">
        <allow-intent href="market:*" />
        <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
        <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
        <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
        <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
        <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
        <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
        <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
        <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
        <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
        <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
        <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
        <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
        <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
        <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
        <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
        <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
        <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
        <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <icon height="57" src="resources/ios/icon/icon.png" width="57" />
        <icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
        <icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
        <icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
        <icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
        <icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
        <icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
        <icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
        <icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
        <icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
        <icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
        <icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
        <icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
        <icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
        <icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
        <icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
        <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
        <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
        <icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
        <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
        <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
        <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
        <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
        <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
        <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
        <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
        <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
        <splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
        <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
        <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
        <splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
        <splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
        <preference name="TopActivityIndicator" value="whiteLarge" />
    </platform>
    <icon src="resources/android/icon/drawable-xhdpi-icon.png" />
    <engine name="android" spec="^7.1.1" />
    <engine name="ios" spec="4.5.5" />
    <plugin name="cordova-plugin-device" spec="^2.0.2" />
    <plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
    <plugin name="cordova-plugin-statusbar" spec="^2.4.2" />
    <plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
    <plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
    <plugin name="cordova-plugin-geolocation" spec="^4.0.1">
        <variable name="GEOLOCATION_USAGE_DESCRIPTION" value=" " />
    </plugin>
    <plugin name="cordova-plugin-datepicker" spec="^0.9.3" />
    <plugin name="phonegap-plugin-push" spec="^1.11.1">
        <variable name="SENDER_ID" value="1234567890" />
    </plugin>
    <plugin name="cordova-plugin-ionic-webview" spec="^1.2.1" />
    <plugin name="cordova-plugin-globalization" spec="^1.11.0" />
    <plugin name="cordova-android-support-gradle-release" spec="^1.4.4">
        <variable name="ANDROID_SUPPORT_VERSION" value="27.+" />
    </plugin>
    <preference name="GOOGLE_MAPS_ANDROID_API_KEY" value="api_key" />
    <preference name="GOOGLE_MAPS_IOS_API_KEY" value="api_key" />
</widget>

Cordova Plugin List

cordova-android-support-gradle-release 1.4.4 "cordova-android-support-gradle-release"
cordova-plugin-datepicker 0.9.3 "DatePicker"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-globalization 1.11.0 "Globalization"
cordova-plugin-googlemaps 2.6.2 "cordova-plugin-googlemaps"
cordova-plugin-ionic-webview 1.2.1 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-sqlite-storage 3.2.0 "Cordova sqlite storage plugin - cordova-sqlite-storage plugin version"
ionic-plugin-keyboard 2.2.1 "Keyboard"
phonegap-plugin-push 1.11.1 "PushPlugin"

What can cause this error?


问:
Docker - load base image from artifactory
I am very new to Docker, and any help would be much appreciated

Here is setup

Artifactory URL: https://www.myarti.com/directory/library/test/1.0.0

In Explorer, URL without http won't work (myarti.com/directory/library/test/1.0.0)

Images are stored under the above folder.

The user needs 'Read Access' in order to read/see the images

What I am trying to do

Load images from the artifactory, and then use as Base Image.

Efforts

In DockerFiles, I undertand 'From' keyword is necessary to load base image. I tried 3 different ways, but not working.

From https://www.myarti.com/directory/library/test:1.0.0

Service 'builder-el6' failed to build: Error parsing reference: "https://www.myarti.com/directory/library/test:1.0.0" is not a valid repository/tag: invalid reference format

From www.myarti.com/directory/library/test:1.0.0

Service 'builder-el6' failed to build: Error: Status 400 trying to pull repository myarti.com/directory/library/test/1.0.0: "{\n  \"errors\" : [ {\n    \"status\" : 400,\n    \"message\" : \"Unsupported docker v1 repository request for 'www'\"\n  } ]\n}"

From myarti.com/directory/library/test:1.0.0

Service 'builder-el6' failed to build: Get https://myarti.com/v1/_ping: proxyconnect tcp: dial tcp xxx.xx.xxx.xxx:9999: i/o timeout / or Service Unavailable

If this issue is due to 'access', how can I provide? (ex. username=test / pwd=password). I found 'Login' command, but as far as I know 'From' commnad should be the first line of DockerFile. Should be part of docker-compose.yml file?

答:
First of all you need to change the default docker registry, on the machine you're trying to build the image on, to Artifactory.

Here's the documentation on how to change the registry.

Then you should modify your Dockerfile to not use any host informations in it. So it's probably going to be this:

```<code>FROM library/test:1.0.0
</code>```

Finally you should learn the basics first. Here's a very good guided starting point. https://training.play-with-docker.com

Body:
First of all you need to change the default docker registry, on the machine you're trying to build the image on, to Artifactory.

Here's the documentation on how to change the registry.

Then you should modify your Dockerfile to not use any host informations in it. So it's probably going to be this:

FROM library/test:1.0.0

Finally you should learn the basics first. Here's a very good guided starting point. https://training.play-with-docker.com


问:
Creating chart of only certain rows
Using Google Sheets, is there a way to create charts for only certain rows?

I have created some reports, but when the source list is sorted differently the report breaks because of using the data source as 'SourceTab'!A2:X2.  In the source tab I have about 60+ rows, but only want to report on certain rows.

I thought I could add a column to each row to create groupings, then in the chart call those groupings to create the reports.

答: add a column to each row to create groupings sounds a good idea. Just create your chart from all available data then filter your data to select only the rows flagged in that column.

Title: Creating chart of only certain rows


问:
Where is the implementation of syscall.Entersyscall?
I am trying to trace down how syscalls work in Go, but I got stuck here.

The code is invoking syscall.Entersyscall, but I cannot find the definition for the Entersyscall function in the syscall package anywhere in the source tree.

Is there some magic that renames this to something else?

More generally, how does one go about finding definitions for function names (in the Go source tree) that have no apparent definition in their advertised package?

答: You cannot find it in the stdlib because it contains just a wrapper function syscall.Entersyscall(). The proper implementation is in the same package but written in asm golang.org/src/syscall/asm_linux_arm.s


问:
Plotting data gridded by latitude and longitude
I'm currently trying to plot gridded lat, lon and no2 data. Attached is a reproducible and simplified version of the problem I'm having. When I use my attached code I recieve the error:

```<code>  Warning: Matrix dimensions must agree, not rendering mesh
</code>```

I've tried using:

```<code> [X Y] = meshgrid(y,yy)
</code>```

which yielded the error:

```<code> Error using checkGeolocatedDataGrid>checkMatrixSizes (line 54)
 LAT and LON dimensions do not agree with Z.
</code>```

I've also tried meshing the grid with y, yy, and yyy and then using squeeze to remove a dimension from each variable.

```<code> clc
 clear all
 close all

 a=.5;
 b=28;
 y = a.*randn(10,1)+b;

 aa = .5;
 bb = -95;
 yy = aa.*randn(10,1)+bb;

 aaa = .3;
 bbb = .6;
 yyy = aaa.*randn(10,1)+bbb;

 figure
 lonlim = [min(yy) max(yy)]
 latlim = [min(y) max(y)]
 usamap(latlim,lonlim)
 geoshow(y,yy,yyy,'DisplayType','Surface')
</code>```

I'd like to be able to plot this data so that I can produce a figure that shows the value of variable 3 "yyy" as it corresponds to "y" and "yy" which are my "latitude and longitude" variables.

Thank you!

答:
Ended up having to mesh the grids of y and yy and then change the dimensions of yyy!</p>

```<code>clc
clear all
close all

a=.5;
b=28;
y = a.*randn(10,1)+b; % 10x10 class double

aa = .5;
bb = -95;
yy = aa.*randn(10,1)+bb; % 10x10 class double

aaa = .3;
bbb = .6;
yyy = aaa.*randn(10,10)+bbb; % 10x10 class double

[y, yy] = meshgrid(y,yy)

figure
lonlim = [min(yy) max(yy)]
latlim = [min(y) max(y)]
%usamap(latlim,lonlim)
geoshow(y,yy,yyy,'DisplayType','texturemap');
shading interp

 contourcbar
</code>```

Body:
I'm currently trying to plot gridded lat, lon and no2 data. Attached is a reproducible and simplified version of the problem I'm having. When I use my attached code I recieve the error:

  Warning: Matrix dimensions must agree, not rendering mesh

I've tried using:

 [X Y] = meshgrid(y,yy)

which yielded the error:

 Error using checkGeolocatedDataGrid>checkMatrixSizes (line 54)
 LAT and LON dimensions do not agree with Z.

I've also tried meshing the grid with y, yy, and yyy and then using squeeze to remove a dimension from each variable.

 clc
 clear all
 close all

 a=.5;
 b=28;
 y = a.*randn(10,1)+b;

 aa = .5;
 bb = -95;
 yy = aa.*randn(10,1)+bb;

 aaa = .3;
 bbb = .6;
 yyy = aaa.*randn(10,1)+bbb;

 figure
 lonlim = [min(yy) max(yy)]
 latlim = [min(y) max(y)]
 usamap(latlim,lonlim)
 geoshow(y,yy,yyy,'DisplayType','Surface')

I'd like to be able to plot this data so that I can produce a figure that shows the value of variable 3 "yyy" as it corresponds to "y" and "yy" which are my "latitude and longitude" variables.

Thank you!

Body:
Ended up having to mesh the grids of y and yy and then change the dimensions of yyy!

clc
clear all
close all

a=.5;
b=28;
y = a.*randn(10,1)+b; % 10x10 class double

aa = .5;
bb = -95;
yy = aa.*randn(10,1)+bb; % 10x10 class double

aaa = .3;
bbb = .6;
yyy = aaa.*randn(10,10)+bbb; % 10x10 class double

[y, yy] = meshgrid(y,yy)

figure
lonlim = [min(yy) max(yy)]
latlim = [min(y) max(y)]
%usamap(latlim,lonlim)
geoshow(y,yy,yyy,'DisplayType','texturemap');
shading interp

 contourcbar


问:
How to get client side data from Kendo Grid to controller
I am trying to get Kendo Grid data which is hydrated from client side to a MVC controller method. My view contains several single fields like name, date of birth etc  and tabular field which I hooked with a Kendo Grid. Since its a new operation I have no data in the grid ( and other fields) and user enters them from client side.

I have no idea how to proceed on this. Ideally I would like to get this data to a list in my viewmodal. So that when the user hits save, I  have all other data and the grid data coming into a controller method.

I am able to successfully bind a list with kendo grid and display it. I have very little experience on JavaScript and Kendo and web programming.
If any of you can point me to the right direction, sample code would be greatly appreciated.

```<code>$("#departmet").kendoGrid({
                dataSource: dataSource,
                height: 250,
                scrollable: true,
                sortable: true,
                filterable: true,
                pageable: {
                    input: true,
                    numeric: false
                },
                columns: [
                    "DepartmentName",
                    "SubDivision"
                ]
            });
</code>```

答:
So after some efforts I come up with. But I don't know where to specify the
data in the html code. Is it possible this way?</p>

```<code>@(Html.Kendo().Grid <DockData.Action> ()
    .Name("docworkflow")
    .Columns(columns =>
     {
        columns.Bound(e => e.ActionName);
        columns.Bound(e => e.ActionType);
     }).DataSource( **How do I load a script variable here***)

//This script variable should be fed to the above code.
This variable is populatedwhen the user adds data  from the UI which works fine.

var dataSource = new kendo.data.DataSource({
                data: result,
                schema: {
                    model: {
                        fields: {
                            ActionName: { type: "string" },
                            ActionType: { type: "string" }

                        }
                    }
                },
                pageSize: 20
            });

</code>```

Body:
I am trying to get Kendo Grid data which is hydrated from client side to a MVC controller method. My view contains several single fields like name, date of birth etc  and tabular field which I hooked with a Kendo Grid. Since its a new operation I have no data in the grid ( and other fields) and user enters them from client side.

I have no idea how to proceed on this. Ideally I would like to get this data to a list in my viewmodal. So that when the user hits save, I  have all other data and the grid data coming into a controller method.

I am able to successfully bind a list with kendo grid and display it. I have very little experience on JavaScript and Kendo and web programming.
If any of you can point me to the right direction, sample code would be greatly appreciated.

$("#departmet").kendoGrid({
                dataSource: dataSource,
                height: 250,
                scrollable: true,
                sortable: true,
                filterable: true,
                pageable: {
                    input: true,
                    numeric: false
                },
                columns: [
                    "DepartmentName",
                    "SubDivision"
                ]
            });

Body:
So after some efforts I come up with. But I don't know where to specify the
data in the html code. Is it possible this way?

@(Html.Kendo().Grid <DockData.Action> ()
    .Name("docworkflow")
    .Columns(columns =>
     {
        columns.Bound(e => e.ActionName);
        columns.Bound(e => e.ActionType);
     }).DataSource( **How do I load a script variable here***)

//This script variable should be fed to the above code.
This variable is populatedwhen the user adds data  from the UI which works fine.

var dataSource = new kendo.data.DataSource({
                data: result,
                schema: {
                    model: {
                        fields: {
                            ActionName: { type: "string" },
                            ActionType: { type: "string" }

                        }
                    }
                },
                pageSize: 20
            });


问:
Android Studio gets package name wrong when running .apk
I changed my package name from com.mycompany.myapplication to com.mycompany.testapp.

Everything builds fine but when I try to run it on the emulator, I get:

The session was restarted
  Target device: NexusS [emulator-5554]
  Uploading file
      local path: /home/antony/AndroidStudioProjects/testappProject/testapp/build/apk/testapp-debug-unaligned.apk
      remote path: /data/local/tmp/com.mycompany.myapplication
  Installing com.mycompany.myapplication
  DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.mycompany.myapplication"
  pkg: /data/local/tmp/com.mycompany.myapplication
  Success

Launching application: com.mycompany.myapplication/com.mycompany.testapp.MainActivity.
  DEVICE SHELL COMMAND: am start -D -n "com.mycompany.myapplication/com.mycompany.testapp.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
  Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.mycompany.myapplication/com.mycompany.testapp.MainActivity }
  Error type 3
  Error: Activity class {com.mycompany.myapplication/com.mycompany.testapp.MainActivity} does not exist.

Note the remote path ^^^ is wrong.

If I go to the emulator, I can start the app from the menu, it's just that I get this error when i try to run the app from Android Studio.

I also see in logcat, on the top-right, the drop-down offers me "No Filters" or "app:com.mycompany.myapplication".  So I can't even debug properly.

Where are these references to com.mycompany.myapplication coming from, and how can I fix this?

答:
I got the same problem. None of the solutions above helped me, so I am posting another solution, which helped me.

The problem appeared after I deleted my application 'by hand' on my smartphone.

I went to settings->apps. There was my app with 'Installed not for this user' (or something similar)
The solution was to delete for all users in apps' settings. (This was not done when I had deleted the app using main menu)


问:
I cannot found modules in Django
I'm trying to connect my Django with my MongoDB.
So, first of all, I install this:

pip install djongo
```

And all go fine, no errors.
But If you see my models.py archive:

It's like Django it's not finding and I can't import the models.
I tried to install again Django, but it says to me that it's already installed.

I think I'm installing this in another path or something like that, but I don't know how to solve this.
My Django archive its in C:\PROYECTOS\PageSpeed_Insights__Selenium-Python\miweb

答: It seems that you are installing djongo in your virtualenv paginaweb, you have to configure PyCharm (or whatever IDE you are using) to look for the packages in that virtualenv, here you can see how to do it for PyCharm. It should work after that.

Title: I cannot found modules in Django

Body:
I'm trying to connect my Django with my MongoDB.
So, first of all, I install this:

pip install djongo

And all go fine, no errors.
But If you see my models.py archive:

It's like Django it's not finding and I can't import the models.
I tried to install again Django, but it says to me that it's already installed.

I think I'm installing this in another path or something like that, but I don't know how to solve this.
My Django archive its in C:\PROYECTOS\PageSpeed_Insights__Selenium-Python\miweb


问:
Locally declared variables can not be inspected
Sometimes when I am debugging code in Eclipse it happens that although I can see and inspect class member variables without any difficulty I am unable to inspect the values of variables declared locally within functions. As an aside, any parameters to the current function lose their 'real' names and instead one sees their values listed in the Variables window as arg0, arg1, arg2, etc but at least the values are visible.

This is occurring at present in relation to classes defined within the core JDK. I have verified that the installed and current JRE is a JDK.

Is anybody able to shed some light on this behaviour?

答:
You can find the debug binaries for 1.6.0_25 at: http://download.java.net/jdk6/6u25/promoted/b03/index.html

This should let you debug into the Java library code for 1.6.

ContentLicense: CC BY-SA 2.5


问:
phpMyadmin error "continue" targeting switch is equivalent to "break"
After I installed the latest version of PHP 7.3.4 and MySQL Community Server 8.0.15 I faced this error on my phpmyadmin 4.7.7:

Warning in .\libraries\config\FormDisplay.php#661 "continue" targeting
  switch is equivalent to "break". Did you mean to use "continue 2"?

Backtrace

.\vendor\composer\ClassLoader.php#444: include()
  .\vendor\composer\ClassLoader.php#322:
  Composer\Autoload\includeFile(string
  'F:\apps\phpMyAdmin\vendor\composer/../../\libraries\config\FormDisplay.php')
  Composer\Autoload\ClassLoader->loadClass(string
  'PMA\libraries\config\FormDisplay')
  .\libraries\config\PageSettings.php#76: spl_autoload_call(string
  'PMA\libraries\config\FormDisplay')
  .\libraries\config\PageSettings.php#230:
  PMA\libraries\config\PageSettings->__construct( string 'Navi_panel',
  string 'pma_navigation_settings', )
  .\libraries\navigation\Navigation.php#66:
  PMA\libraries\config\PageSettings::getNaviSettings()
  .\libraries\Header.php#425:
  PMA\libraries\navigation\Navigation->getDisplay()
  .\libraries\Response.php#260: PMA\libraries\Header->getDisplay()
  .\libraries\Response.php#273: PMA\libraries\Response->_getDisplay()
  .\libraries\Response.php#432: PMA\libraries\Response->_htmlResponse()
  PMA\libraries\Response->response()

Anybody know how to fix this issue?

答:
I had the same, and fixed it by editing the php script FormDisplay.php.

On line 661, replace continue with break (keep the semi-colon).

If you do edit, you'll need sudo access, but back up the original one first.

Reload the page. Hope that helps.