问:
webkitGetAsEntry object delay
I'm trying to read the directory structure of a dropped folder, however I am having an issue with chrome not reporting the correct amount of items in the object without me adding a delay.

It doesn't make any sense to me that the object can lose an item between the first and second logging and then gain it back for the third logging.

Any help would be much appreciated.

UPDATE: I did some more testing and have found that even copying values from an existing array instead of reading the file structure I still get the same issue.

Here is a jsfiddle showing the issue more clearly.

This seems to be almost the solution, However in both cases they fire multiple times if I drag multiple sub folders instead of the parent folder. I want to be able to drag a folder of sub folders or a selection of the sub folders and have the event just fire once at the end, so basically at the end of the for loop.

```<code>    // Works correctly
    console.log(itemList);

    // Doesn't log anything
    Object.keys(itemList).forEach(function(key)
    {
        console.log('where is this?', key, itemList[key]);
    });

    // Works correctly on my local server with 0ms delay
    // and on jsfiddle with 50ms
    setTimeout(function()
    {
        Object.keys(itemList).forEach(function(key)
        {
            console.log('ms delay', key, itemList[key]);
        });
    },50);
</code>```

答:
OK, I found a working solution eventually.

My jsfiddle based on this answer

```<code>const target = document.getElementById('dropTarget');
let itemList = [];

target.ondragover = function(evt) {
  evt.preventDefault();
}

target.ondrop = function(e) {
  e.preventDefault();

  let items = e.dataTransfer.items;

  function scanFiles(item, index) {
    return new Promise(function(resolve) {
      if (item.isFile) {
                itemList.push(item.fullPath);
          resolve();
      } else if (item.isDirectory) {
        let directoryReader = item.createReader();

        directoryReader.readEntries(function(entries) {
          Promise.all(entries.map(scanFiles)).then(resolve);
        });
      }
    })
  }

  var p = Promise.all(Array.from(items, item => scanFiles(item.webkitGetAsEntry())));
  p.then(function() {
    //console.log(itemList);
    Object.keys(itemList).forEach(function(key) {
      console.log(key, itemList[key]);
    });
  })
}
</code>```

Title: webkitGetAsEntry object delay

Body:
I'm trying to read the directory structure of a dropped folder, however I am having an issue with chrome not reporting the correct amount of items in the object without me adding a delay.

It doesn't make any sense to me that the object can lose an item between the first and second logging and then gain it back for the third logging.

Any help would be much appreciated.

UPDATE: I did some more testing and have found that even copying values from an existing array instead of reading the file structure I still get the same issue.

Here is a jsfiddle showing the issue more clearly.

This seems to be almost the solution, However in both cases they fire multiple times if I drag multiple sub folders instead of the parent folder. I want to be able to drag a folder of sub folders or a selection of the sub folders and have the event just fire once at the end, so basically at the end of the for loop.

    // Works correctly
    console.log(itemList);

    // Doesn't log anything
    Object.keys(itemList).forEach(function(key)
    {
        console.log('where is this?', key, itemList[key]);
    });

    // Works correctly on my local server with 0ms delay
    // and on jsfiddle with 50ms
    setTimeout(function()
    {
        Object.keys(itemList).forEach(function(key)
        {
            console.log('ms delay', key, itemList[key]);
        });
    },50);

Body:
OK, I found a working solution eventually.

My jsfiddle based on this answer

const target = document.getElementById('dropTarget');
let itemList = [];

target.ondragover = function(evt) {
  evt.preventDefault();
}

target.ondrop = function(e) {
  e.preventDefault();

  let items = e.dataTransfer.items;

  function scanFiles(item, index) {
    return new Promise(function(resolve) {
      if (item.isFile) {
                itemList.push(item.fullPath);
          resolve();
      } else if (item.isDirectory) {
        let directoryReader = item.createReader();

        directoryReader.readEntries(function(entries) {
          Promise.all(entries.map(scanFiles)).then(resolve);
        });
      }
    })
  }

  var p = Promise.all(Array.from(items, item => scanFiles(item.webkitGetAsEntry())));
  p.then(function() {
    //console.log(itemList);
    Object.keys(itemList).forEach(function(key) {
      console.log(key, itemList[key]);
    });
  })
}


来源: stackexchange

问:
Restricting re-renders to specific state change in functional component
If I have a component with three different states and I only want the component to re-render when one specific state in that component changes, how would I go about doing that?

Below I've included a code example. Say I only want this component to re-render when setSecondState() is called, not when setFirstState() or setThirdState() is called.

```<code>const ExampleComponent = () => {
     const [firstState, setFirstState] = React.useState(0);
     const [secondState, setSecondState] = React.useState(false);
     const [thirdState, setThirdState] = React.useState("");

     return (
          <div>
                Rendered
          </div>
     );
}
</code>```

答:
Don't put those in state use ref instead. You can update ref value by updating ref.current, it won't cause re-render.</p>

```<code>const ExampleComponent = () => {

     const firstRef = React.useRef(0);
     const [secondState, setSecondState] = React.useState(false);
     const secondRef = React.useRef("");

     const someFunction = () => {
         firstRef.current = 10;
         secondRef.current = "foo";
     }

     return (
          <div>
                Rendered
          </div>
     );
}
</code>```

ContentLicense: CC BY-SA 4.0

Body:
If I have a component with three different states and I only want the component to re-render when one specific state in that component changes, how would I go about doing that?

Below I've included a code example. Say I only want this component to re-render when setSecondState() is called, not when setFirstState() or setThirdState() is called.

const ExampleComponent = () => {
     const [firstState, setFirstState] = React.useState(0);
     const [secondState, setSecondState] = React.useState(false);
     const [thirdState, setThirdState] = React.useState("");

     return (

                Rendered

     );
}

Body:
Don't put those in state use ref instead. You can update ref value by updating ref.current, it won't cause re-render.

const ExampleComponent = () => {

     const firstRef = React.useRef(0);
     const [secondState, setSecondState] = React.useState(false);
     const secondRef = React.useRef("");

     const someFunction = () => {
         firstRef.current = 10;
         secondRef.current = "foo";
     }

     return (
          <div>
                Rendered
          </div>
     );
}


问:
NoMethodError: undefined method `current_sign_in_at' for #User:0x000055ce01dcf0a8 by using Devise_token_auth rails gem is not working
NoMethodError: undefined method `current_sign_in_at' for #User:0x000055ce01dcf0a8

I think it is a session method error of some sort

I have an angular6 app for frontend and rails for backend, so the best option for me was to opt for devise_token_auth and ng_token_auth for user authentication.

I installed devise_token_auth gem followed by executing this line of code in terminal

"rails generate devise_token_auth:install User auth"

and on migration there was an error, I solved the issue by adding

"extend Devise::Models"

to the USER model and then migration had worked, then I created a user in the backend and tried to call sign_in using postman and the error "NoMethodError: undefined method `current_sign_in_at' for #User:0x000055ce01dcf0a8" came

I want the user to get authenticated using this gem or some other gem if they exist

答:
I had this issue recently and it turns out I didn't have the trackable fields in my migration. There are two ways to fix this:

Option one. Add a new migration that adds the trackable fields to User

```<code>## Trackable
t.integer  :sign_in_count, default: 0, null: false
t.datetime :current_sign_in_at
t.datetime :last_sign_in_at
t.inet     :current_sign_in_ip
t.inet     :last_sign_in_ip
</code>```

Run rake db:migrate

The second option: run a down migration

Start with this command - add your migration version number

```<code>rake db:migrate:down VERSION=xxxxxxxxxxxxxx
</code>```

You should then be able to add the trackable fields to the migration file and then run

```<code>rake db:migrate up VERSION=xxxxxxxxxxxxxx
</code>```

Run rake db:migrate

Body:
I had this issue recently and it turns out I didn't have the trackable fields in my migration. There are two ways to fix this:

Option one. Add a new migration that adds the trackable fields to User

## Trackable
t.integer  :sign_in_count, default: 0, null: false
t.datetime :current_sign_in_at
t.datetime :last_sign_in_at
t.inet     :current_sign_in_ip
t.inet     :last_sign_in_ip

Run rake db:migrate

The second option: run a down migration

Start with this command - add your migration version number

rake db:migrate:down VERSION=xxxxxxxxxxxxxx

You should then be able to add the trackable fields to the migration file and then run

rake db:migrate up VERSION=xxxxxxxxxxxxxx

Run rake db:migrate


问:
"Provider com.bea.xml.stream.EventFactory not found" when loading XLSX file
I've used Apache POI successfully on Java desktop app, and would like to use it on Android for reading & writing Excel files.

Here's my Github repo:
https://github.com/anta40/StockChecker

Everytime I try to open an XLSX file, eventually the app crashes because of

org.apache.poi.javax.xml.stream.FactoryConfigurationError: Provider
  com.bea.xml.stream.EventFactory not found

Here's the content of my build.gradle:
    apply plugin: 'com.android.application'

```<code>android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.anta40.app.stockchecker"
        minSdkVersion 15
        targetSdkVersion 28
        multiDexEnabled true
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.github.SUPERCILEX.poi-android:poi:3.17'
    implementation 'com.github.angads25:filepicker:1.1.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
</code>```

How to solve this issue?

Adding this line on build.gradle:

implementation 'com.fasterxml:aalto-xml:1.1.0'

doesn't work. You'll get lots of error messages like these:

Duplicate class
  org.codehaus.stax2.ri.typed.ValueDecoderFactory$IntDecoder found in
  modules poi-3.17.jar (com.github.SUPERCILEX.poi-android:poi:3.17) and
  stax2-api-4.1.jar (org.codehaus.woodstox:stax2-api:4.1) Duplicate
  class org.codehaus.stax2.ri.typed.ValueDecoderFactory$IntegerDecoder
  found in modules poi-3.17.jar
  (com.github.SUPERCILEX.poi-android:poi:3.17) and stax2-api-4.1.jar
  (org.codehaus.woodstox:stax2-api:4.1) Duplicate class
  org.codehaus.stax2.ri.typed.ValueDecoderFactory$LongArrayDecoder found
  in modules poi-3.17.jar (com.github.SUPERCILEX.poi-android:poi:3.17)
  and stax2-api-4.1.jar (org.codehaus.woodstox:stax2-api:4.1) Duplicate
  class org.codehaus.stax2.ri.typed.ValueDecoderFactory$LongDecoder
  found in modules poi-3.17.jar
  (com.github.SUPERCILEX.poi-android:poi:3.17) and stax2-api-4.1.jar
  (org.codehaus.woodstox:stax2-api:4.1) Duplicate class
  org.codehaus.stax2.ri.typed.ValueDecoderFactory$QNameDecoder found in
  modules poi-3.17.jar (com.github.SUPERCILEX.poi-android:poi:3.17) and
  stax2-api-4.1.jar (org.codehaus.woodstox:stax2-api:4.1) Duplicate
  class org.codehaus.stax2.ri.typed.ValueEncoderFactory found in modules
  poi-3.17.jar (com.github.SUPERCILEX.poi-android:poi:3.17) and
  stax2-api-4.1.jar (org.codehaus.woodstox:stax2-api:4.1)

答:
exculde this stax2-api-4.1.jar in your dependency and rebuild the project

Edit 1- I know i am a bit late with the edit, but solved it just now, just move your System.properties in a static block where you initialize your app. This will solve your problem.

```<code>public class YourActivity extends AppCompatActivity {
      //scope......
      static {
            System.setProperty(
                    "org.apache.poi.javax.xml.stream.XMLInputFactory",
                    "com.fasterxml.aalto.stax.InputFactoryImpl"
            );
            System.setProperty(
                    "org.apache.poi.javax.xml.stream.XMLOutputFactory",
                    "com.fasterxml.aalto.stax.OutputFactoryImpl"
            );
            System.setProperty(
                    "org.apache.poi.javax.xml.stream.XMLEventFactory",
                    "com.fasterxml.aalto.stax.EventFactoryImpl"
            );
        }
</code>```

Body:
I've used Apache POI successfully on Java desktop app, and would like to use it on Android for reading & writing Excel files.

Here's my Github repo:
https://github.com/anta40/StockChecker

Everytime I try to open an XLSX file, eventually the app crashes because of

org.apache.poi.javax.xml.stream.FactoryConfigurationError: Provider
  com.bea.xml.stream.EventFactory not found

Here's the content of my build.gradle:
    apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.anta40.app.stockchecker"
        minSdkVersion 15
        targetSdkVersion 28
        multiDexEnabled true
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.github.SUPERCILEX.poi-android:poi:3.17'
    implementation 'com.github.angads25:filepicker:1.1.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

How to solve this issue?

Adding this line on build.gradle:

implementation 'com.fasterxml:aalto-xml:1.1.0'

doesn't work. You'll get lots of error messages like these:

Duplicate class
  org.codehaus.stax2.ri.typed.ValueDecoderFactory$IntDecoder found in
  modules poi-3.17.jar (com.github.SUPERCILEX.poi-android:poi:3.17) and
  stax2-api-4.1.jar (org.codehaus.woodstox:stax2-api:4.1) Duplicate
  class org.codehaus.stax2.ri.typed.ValueDecoderFactory$IntegerDecoder
  found in modules poi-3.17.jar
  (com.github.SUPERCILEX.poi-android:poi:3.17) and stax2-api-4.1.jar
  (org.codehaus.woodstox:stax2-api:4.1) Duplicate class
  org.codehaus.stax2.ri.typed.ValueDecoderFactory$LongArrayDecoder found
  in modules poi-3.17.jar (com.github.SUPERCILEX.poi-android:poi:3.17)
  and stax2-api-4.1.jar (org.codehaus.woodstox:stax2-api:4.1) Duplicate
  class org.codehaus.stax2.ri.typed.ValueDecoderFactory$LongDecoder
  found in modules poi-3.17.jar
  (com.github.SUPERCILEX.poi-android:poi:3.17) and stax2-api-4.1.jar
  (org.codehaus.woodstox:stax2-api:4.1) Duplicate class
  org.codehaus.stax2.ri.typed.ValueDecoderFactory$QNameDecoder found in
  modules poi-3.17.jar (com.github.SUPERCILEX.poi-android:poi:3.17) and
  stax2-api-4.1.jar (org.codehaus.woodstox:stax2-api:4.1) Duplicate
  class org.codehaus.stax2.ri.typed.ValueEncoderFactory found in modules
  poi-3.17.jar (com.github.SUPERCILEX.poi-android:poi:3.17) and
  stax2-api-4.1.jar (org.codehaus.woodstox:stax2-api:4.1)

Body:
exculde this stax2-api-4.1.jar in your dependency and rebuild the project

Edit 1- I know i am a bit late with the edit, but solved it just now, just move your System.properties in a static block where you initialize your app. This will solve your problem.

public class YourActivity extends AppCompatActivity {
      //scope......
      static {
            System.setProperty(
                    "org.apache.poi.javax.xml.stream.XMLInputFactory",
                    "com.fasterxml.aalto.stax.InputFactoryImpl"
            );
            System.setProperty(
                    "org.apache.poi.javax.xml.stream.XMLOutputFactory",
                    "com.fasterxml.aalto.stax.OutputFactoryImpl"
            );
            System.setProperty(
                    "org.apache.poi.javax.xml.stream.XMLEventFactory",
                    "com.fasterxml.aalto.stax.EventFactoryImpl"
            );
        }


问:
Showing List<> members in ListBox, in WPF with MVVM
I want to show some data from List<> in ListBox without code behind.

I tried to use binding through ItemsSource and DisplayMemberPath but it doesn't work.

Model:

```<code>public class PersonModel
{
    public string FirstName { get; set; }
    public string LastName { get; set; }

    public string FullName
    {
        get
        {
            return $"{FirstName} + {LastName}";
        }
    }
}
</code>```

ViewModel:

```<code>public class ShellViewModel : Screen
{
    List<PersonModel> people = new List<PersonModel>();

    public ShellViewModel()
    {
        people.Add(new PersonModel { FirstName = "John", LastName = "Snow" });
        people.Add(new PersonModel { FirstName = "Cersei", LastName = "Lannister" });
        people.Add(new PersonModel { FirstName = "Bran", LastName = "Stark" });
    }
}
</code>```

View (XAML):

```<code>    <Label Grid.Column="1" Grid.Row="1" FontSize="30" FontWeight="Bold"
           Content="Personal Data:" Margin="10"/>
    <ListBox Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="2"
             ItemsSource="{Binding people}" DisplayMemberPath="FullName"/>
</code>```

Where am I going wrong? I will be grateful for an answer.

答:
people must be a public property for you to be able to bind to it:

```<code>public List<PersonModel> people { get; } = new List<PersonModel>();
</code>```

You also need to set the DataContext of the ListBox, or its parent Window/UserControl/etc., to an instance of the ShellViewModel
, unless you are using some framework that does this for you.

If you are using Caliburn.Micro, this should work:

```<code><ListBox Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="2" x:Name="people" DisplayMemberPath="FullName"/>
</code>```

You may also want to change the name of the property to People to cope with the default C# naming convention.

Body:
I want to show some data from List<> in ListBox without code behind.

I tried to use binding through ItemsSource and DisplayMemberPath but it doesn't work.

Model:

public class PersonModel
{
    public string FirstName { get; set; }
    public string LastName { get; set; }

    public string FullName
    {
        get
        {
            return $"{FirstName} + {LastName}";
        }
    }
}

ViewModel:

public class ShellViewModel : Screen
{
    List<PersonModel> people = new List<PersonModel>();

    public ShellViewModel()
    {
        people.Add(new PersonModel { FirstName = "John", LastName = "Snow" });
        people.Add(new PersonModel { FirstName = "Cersei", LastName = "Lannister" });
        people.Add(new PersonModel { FirstName = "Bran", LastName = "Stark" });
    }
}

View (XAML):

    <ListBox Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="2"
             ItemsSource="{Binding people}" DisplayMemberPath="FullName"/>

Where am I going wrong? I will be grateful for an answer.

Body:
people must be a public property for you to be able to bind to it:

public List<PersonModel> people { get; } = new List<PersonModel>();

You also need to set the DataContext of the ListBox, or its parent Window/UserControl/etc., to an instance of the ShellViewModel
, unless you are using some framework that does this for you.

If you are using Caliburn.Micro, this should work:

<ListBox Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="2" x:Name="people" DisplayMemberPath="FullName"/>

You may also want to change the name of the property to People to cope with the default C# naming convention.


问:
Failed to connect postgresql in RedHat
My application required Postgresql's DB name, host, username and password to connect. But it fails all the time and I do not where is the problem.

I used :

DB name: postgres

Host : 127.0.0.1

Post:5432

Username: postgres

password:***

I verified them by:

For DB name and user name:

For host and port:

I run my aplication by: [zqi@localhost]$ sudo java -jar Myfile.jar

My environment:

RedHat: 8

Postgresql: 10

Java: 1.8.0

Is there anything wrong? Any suggestion would be appreciated!

答:
I have fixed this by modifying the authentication in the file of pg_hba.conf. I changed the method from ident to md5

```<code># TYPE  DATABASE        USER            IP-ADDRESS          METHOD
host    all             all             127.0.0.1           ident
</code>```

To:

```<code># TYPE  DATABASE        USER            IP-ADDRESS          METHOD
host    all             all             127.0.0.1           md5
</code>```

See more details here: https://www.postgresql.org/docs/9.1/auth-pg-hba-conf.html

Title: Failed to connect postgresql in RedHat

Body:
I have fixed this by modifying the authentication in the file of pg_hba.conf. I changed the method from ident to md5

# TYPE  DATABASE        USER            IP-ADDRESS          METHOD
host    all             all             127.0.0.1           ident

To:

# TYPE  DATABASE        USER            IP-ADDRESS          METHOD
host    all             all             127.0.0.1           md5

See more details here: https://www.postgresql.org/docs/9.1/auth-pg-hba-conf.html


问:
See treeview for branches in Atlassian Stash
Is it possible to have a treeview for branches and commits like bitbucket or github has but in Atlassian Stash?

I would like a view like these:

http://blog.bitbucket.org/wp-content/uploads/2011/07/new-commits-screen-tn.png

http://blog.bitbucket.org/wp-content/uploads/2011/07/old-commits-screen.png

(they are both from bitbucket and represent the same commits, but it's just to show my idea)

答:
This question is quite a bit old but I just wanted to inform anyone who might find this:

This feature is now available in Bitbucket Server 6.1

Release notes describing the feature: https://confluence.atlassian.com/bitbucketserver/bitbucket-server-6-1-release-notes-966687591.html

Demonstration from that link:

ContentLicense: CC BY-SA 3.0


问:
Dropping duplicate records ignoring case
I have a data frame with with several columns, one of which is company_name. I'm trying to remove duplicate records based on them having the same company_name, but I'm at a loss on how to do this while maintaining the original case of the company_name.

I've tried converting all names to lowercase and then removing duplicates, but as mentioned before I would like to maintain the original case.

```<code>df = pd.DataFrame({'company_name': ['Apple', 'apple', 'BlackBerry', 'blackberry','Blackberry'])
df['company_name'] = df['company_name'].str.strip()
df['company_name'] = df['company_name'].str.lower()
input_records.drop_duplicates(subset=['company_id'], inplace=True,
   keep="first")
</code>```

this code gets rid of duplicates, but stores the company name in all lowercase.

Desired result

```<code>company_name
Apple
BlackBerry
</code>```

Actual result

```<code>company_name
apple
blackberry
</code>```

答:
You could create a new column where you do your operations. This will allow you to keep the company name column untouched.

Here is what it could look like :

```<code>df = pd.DataFrame({'company_name':['Apple','apple','Blackberry','blackberry']})

company_name
0        Apple
1        apple
2   Blackberry
3   blackberry

df['company_name_2'] = df['company_name'].str.strip()
df['company_name_2'] = df['company_name_2'].str.lower()
df.drop_duplicates(subset=['company_name_2'], inplace=True,
   keep="first")
df.drop(columns = 'company_name_2', inplace = True)
df.reset_index(inplace = True, drop = True)
</code>```

Out :

```<code>    company_name
0   Apple
1   Blackberry
</code>```

Body:
I have a data frame with with several columns, one of which is company_name. I'm trying to remove duplicate records based on them having the same company_name, but I'm at a loss on how to do this while maintaining the original case of the company_name.

I've tried converting all names to lowercase and then removing duplicates, but as mentioned before I would like to maintain the original case.

df = pd.DataFrame({'company_name': ['Apple', 'apple', 'BlackBerry', 'blackberry','Blackberry'])
df['company_name'] = df['company_name'].str.strip()
df['company_name'] = df['company_name'].str.lower()
input_records.drop_duplicates(subset=['company_id'], inplace=True,
   keep="first")

this code gets rid of duplicates, but stores the company name in all lowercase.

Desired result

company_name
Apple
BlackBerry

Actual result

company_name
apple
blackberry

Body:
You could create a new column where you do your operations. This will allow you to keep the company name column untouched.

Here is what it could look like :

df = pd.DataFrame({'company_name':['Apple','apple','Blackberry','blackberry']})

company_name
0        Apple
1        apple
2   Blackberry
3   blackberry

df['company_name_2'] = df['company_name'].str.strip()
df['company_name_2'] = df['company_name_2'].str.lower()
df.drop_duplicates(subset=['company_name_2'], inplace=True,
   keep="first")
df.drop(columns = 'company_name_2', inplace = True)
df.reset_index(inplace = True, drop = True)

Out :

    company_name
0   Apple
1   Blackberry


问:
Unable to run react-native app on android device - installDebug error
I am trying to run my react-native app on my android device via cable with USB debugging enabled in developer mode. The android version is 5.1 (Lolipop). I keep on getting this error, please suggest how

```<code>Unable to install E:\react-native\AwesomeProject\android\app\build\outputs\apk\app-debug.apk
com.android.ddmlib.InstallException: Failed to install all
        at com.android.ddmlib.SplitApkInstaller.install(SplitApkInstaller.java:89)
        at com.android.ddmlib.Device.installPackages(Device.java:904)
        at com.android.builder.testing.ConnectedDevice.installPackages(ConnectedDevice.java:137)
        at com.android.build.gradle.internal.tasks.InstallVariantTask.install(InstallVariantTask.java:134)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute    (AnnotationProcessingTaskFactory.java:228)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute    (AnnotationProcessingTaskFactory.java:221)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute    (AnnotationProcessingTaskFactory.java:210)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:621)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:604)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
        at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
        at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:153)
        at org.gradle.internal.Factories$1.create(Factories.java:22)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:150)
        at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
        at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
        at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
        at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
        at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:239)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:212)
        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:205)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
        at org.gradle.launcher.Main.doAction(Main.java:33)
        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:55)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:36)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
12:43:11 E/1258563779: Error while uploading app-debug.apk : Unknown failure ([CDS]close[0])
                                                                                :app:installDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to install all

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1 mins 43.72 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
</code>```

I don't want to use the android emulator, instead, i want to test the app on my physical device.

I have already installed required stuff as per the react-native getting started documentation. Still, I keep on getting the same error.

Thanks in advance

答:
I also had the same issue and my issue was difference in Android version of my device and Android SDK version at my computer.

Android version for my device was Android 6 and my Android Studio was configured to build for Android 9.

How to solve?
Upgrade your Android version of the device to 9 or simply install SDK for Android 6 in your computer.

Install Android 6 SDK in computer -

Open Android Studio

Configuration -> SDK manager

Tick Android 6 and click the button Apply

After finishing the installation, try to rebuild the application using react-native run-android

Hope it will help someone.

Body:
I am trying to run my react-native app on my android device via cable with USB debugging enabled in developer mode. The android version is 5.1 (Lolipop). I keep on getting this error, please suggest how

Unable to install E:\react-native\AwesomeProject\android\app\build\outputs\apk\app-debug.apk
com.android.ddmlib.InstallException: Failed to install all
        at com.android.ddmlib.SplitApkInstaller.install(SplitApkInstaller.java:89)
        at com.android.ddmlib.Device.installPackages(Device.java:904)
        at com.android.builder.testing.ConnectedDevice.installPackages(ConnectedDevice.java:137)
        at com.android.build.gradle.internal.tasks.InstallVariantTask.install(InstallVariantTask.java:134)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute    (AnnotationProcessingTaskFactory.java:228)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute    (AnnotationProcessingTaskFactory.java:221)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute    (AnnotationProcessingTaskFactory.java:210)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:621)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:604)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
        at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
        at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:153)
        at org.gradle.internal.Factories$1.create(Factories.java:22)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:150)
        at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
        at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
        at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
        at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
        at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:239)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:212)
        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:205)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
        at org.gradle.launcher.Main.doAction(Main.java:33)
        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:55)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:36)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
12:43:11 E/1258563779: Error while uploading app-debug.apk : Unknown failure ([CDS]close[0])
                                                                                :app:installDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to install all

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1 mins 43.72 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

I don't want to use the android emulator, instead, i want to test the app on my physical device.

I have already installed required stuff as per the react-native getting started documentation. Still, I keep on getting the same error.

Thanks in advance


问:
add field in wordpress user-new.php through php
On the Users.php page I need an automatic filter to list only one type of user, without having to select an accurate filter that opens the page and is already with this filter</p>

答:
Try this inside your functions file:

Create a custom field, "Company Name". It is shown on both Add/Update user screens.
Hook “user_new_form”, will display the field on Add New User screen.

```<code>function custom_user_profile_fields($user){
    if(is_object($user))
        $company = esc_attr( get_the_author_meta( 'company', $user->ID ) );
    else
        $company = null;
    ?>
    <h3>Extra profile information</h3>
    <table class="form-table">
        <tr>
            <th><label for="company">Company Name</label></th>
            <td>
                <input type="text" class="regular-text" name="company" value="<?php echo $company; ?>" id="company" /><br />
                <span class="description">Where are you?</span>
            </td>
        </tr>
    </table>
<?php
}
add_action( 'show_user_profile', 'custom_user_profile_fields' );
add_action( 'edit_user_profile', 'custom_user_profile_fields' );
add_action( "user_new_form", "custom_user_profile_fields" );
</code>```

Save the custom field in database:

```<code>function save_custom_user_profile_fields($user_id){
    # again do this only if you can
    if(!current_user_can('manage_options'))
        return false;

    # save my custom field
    update_user_meta($user_id, 'company', $_POST['company']);
}
add_action('user_register', 'save_custom_user_profile_fields');
add_action('profile_update', 'save_custom_user_profile_fields');
</code>```

Body:
Try this inside your functions file:

Create a custom field, "Company Name". It is shown on both Add/Update user screens.
Hook “user_new_form”, will display the field on Add New User screen.

function custom_user_profile_fields($user){
    if(is_object($user))
        $company = esc_attr( get_the_author_meta( 'company', $user->ID ) );
    else
        $company = null;
    ?>
    <h3>Extra profile information</h3>
    <table class="form-table">
        <tr>
            <th><label for="company">Company Name</label></th>
            <td>
                <input type="text" class="regular-text" name="company" value="<?php echo $company; ?>" id="company" /><br />
                <span class="description">Where are you?</span>
            </td>
        </tr>
    </table>
<?php
}
add_action( 'show_user_profile', 'custom_user_profile_fields' );
add_action( 'edit_user_profile', 'custom_user_profile_fields' );
add_action( "user_new_form", "custom_user_profile_fields" );

Save the custom field in database:

function save_custom_user_profile_fields($user_id){
    # again do this only if you can
    if(!current_user_can('manage_options'))
        return false;

    # save my custom field
    update_user_meta($user_id, 'company', $_POST['company']);
}
add_action('user_register', 'save_custom_user_profile_fields');
add_action('profile_update', 'save_custom_user_profile_fields');


问:
Wildfly 13.0 failing to deploy multiple WARs while deploying from Eclipse, works fine otherwise
as the title says, I am trying to deploy two WARs on Wildfly 13.0, but if I try to do that on Eclipse by simply adding the resources, it will fail with the following error:

```<code>10:16:02,532 INFO  [org.jboss.modules] (main) JBoss Modules version 1.8.5.Final
10:16:02,845 INFO  [org.jboss.msc] (main) JBoss MSC version 1.4.2.Final
10:16:02,876 INFO  [org.jboss.threads] (main) JBoss Threads version 2.3.2.Final
10:16:02,970 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: WildFly Full 13.0.0.Final (WildFly Core 5.0.0.Final) starting
10:16:04,016 INFO  [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/core-service=management/management-interface=http-interface' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
10:16:04,038 INFO  [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 29) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/subsystem=undertow/server=default-server/https-listener=https' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
10:16:04,038 INFO  [org.wildfly.security] (ServerService Thread Pool -- 18) ELY00001: WildFly Elytron version 1.3.3.Final
10:16:04,038 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0015: Re-attempting failed deployment AmexDAPWebServices.war
10:16:04,507 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0015: Re-attempting failed deployment amexsbswebapp.war
10:16:05,772 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0004: Found AmexDAPWebServices.war in deployment directory. To trigger deployment create a file called AmexDAPWebServices.war.dodeploy
10:16:05,772 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0004: Found amexsbswebapp.war in deployment directory. To trigger deployment create a file called amexsbswebapp.war.dodeploy
10:16:05,795 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
10:16:05,811 INFO  [org.xnio] (MSC service thread 1-8) XNIO version 3.6.3.Final
10:16:05,811 INFO  [org.xnio.nio] (MSC service thread 1-8) XNIO NIO Implementation Version 3.6.3.Final
10:16:05,842 INFO  [org.jboss.as.ee] (ServerService Thread Pool -- 41) WFLYEE0119: The system property 'ee8.preview.mode' is NOT set to 'true'. For provided EE 8 APIs where the EE 8 version of the API differs from what is supported in EE 7, the EE 7 variant of the API will be used. Support for this setting will be removed once all EE 8 APIs are provided and certified.
10:16:05,842 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 45) WFLYCLINF0001: Activating Infinispan subsystem.
10:16:05,858 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 64) WFLYWS0002: Activating WebServices Extension
10:16:05,858 WARN  [org.jboss.as.txn] (ServerService Thread Pool -- 62) WFLYTX0013: The node-identifier attribute on the /subsystem=transactions is set to the default value. This is a danger for environments running multiple servers. Please make sure the attribute value is unique.
10:16:05,873 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 54) WFLYNAM0001: Activating Naming Subsystem
10:16:05,873 INFO  [org.jboss.as.jaxrs] (ServerService Thread Pool -- 47) WFLYRS0016: RESTEasy version 3.5.1.Final
10:16:05,889 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 52) WFLYJSF0007: Activated the following JSF Implementations: [main]
10:16:05,889 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 60) WFLYSEC0002: Activating Security Subsystem
10:16:05,920 INFO  [org.jboss.as.connector] (MSC service thread 1-6) WFLYJCA0009: Starting JCA Subsystem (WildFly/IronJacamar 1.4.9.Final)
10:16:05,920 INFO  [org.jboss.as.security] (MSC service thread 1-5) WFLYSEC0001: Current PicketBox version=5.0.2.Final
10:16:05,936 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 38) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.4)
10:16:05,936 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0003: Undertow 2.0.9.Final starting
10:16:05,952 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) WFLYJCA0018: Started Driver service with driver-name = h2
10:16:05,952 INFO  [org.jboss.as.naming] (MSC service thread 1-2) WFLYNAM0003: Starting Naming Service
10:16:05,952 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-1) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
10:16:06,061 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 63) WFLYUT0014: Creating file handler for path 'C:\Users\v.cappellini\wildfly-13.0.0.Final/welcome-content' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]']
10:16:06,186 INFO  [org.wildfly.extension.io] (ServerService Thread Pool -- 46) WFLYIO001: Worker 'default' has auto-configured to 16 core threads with 128 task threads based on your 8 available processors
10:16:06,201 INFO  [org.jboss.as.ejb3] (MSC service thread 1-2) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 32 (per class), which is derived from the number of CPUs on this host.
10:16:06,201 INFO  [org.jboss.as.ejb3] (MSC service thread 1-7) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 128 (per class), which is derived from thread worker pool sizing.
10:16:06,233 INFO  [org.jboss.remoting] (MSC service thread 1-8) JBoss Remoting version 5.0.7.Final
10:16:06,248 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0012: Started server default-server.
10:16:06,248 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0018: Host default-host starting
10:16:06,295 INFO  [org.jboss.as.ejb3] (MSC service thread 1-6) WFLYEJB0493: EJB subsystem suspension complete
10:16:06,311 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-7) WFLYUT0006: Undertow HTTP listener default listening on 127.0.0.1:8080
10:16:06,311 INFO  [org.jboss.as.patching] (MSC service thread 1-3) WFLYPAT0050: WildFly Full cumulative patch ID is: base, one-off patches include: none
10:16:06,342 WARN  [org.jboss.as.domain.management.security] (MSC service thread 1-6) WFLYDM0111: Keystore C:\Users\v.cappellini\wildfly-13.0.0.Final\standalone\configuration\application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost
10:16:06,342 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-4) WFLYDS0013: Started FileSystemDeploymentService for directory C:\Users\v.cappellini\wildfly-13.0.0.Final\standalone\deployments
10:16:06,358 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0027: Starting deployment of "amexsbswebapp.war" (runtime-name: "amexsbswebapp.war")
10:16:06,358 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0027: Starting deployment of "AmexDAPWebServices.war" (runtime-name: "AmexDAPWebServices.war")
10:16:06,623 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-7) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
10:16:06,795 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443
10:16:06,863 INFO  [org.jboss.ws.common.management] (MSC service thread 1-2) JBWS022052: Starting JBossWS 5.2.1.Final (Apache CXF 3.2.4.jbossorg-1)
10:16:14,642 WARN  [org.wildfly.extension.undertow] (MSC service thread 1-5) WFLYUT0081: The deployment amexsbswebapp.war will not be distributable because this feature is disabled in web-fragment.xml of the module apiee-core-1.0.1.jar.
10:16:15,023 INFO  [org.jboss.as.jpa] (MSC service thread 1-5) WFLYJPA0002: Read persistence.xml for JPAAmex
10:16:15,023 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) WFLYJPA0002: Read persistence.xml for JPAAmex
10:16:17,335 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 67) WFLYJPA0010: Starting Persistence Unit (phase 1 of 2) Service 'amexsbswebapp.war#JPAAmex'
10:16:17,347 INFO  [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool -- 67) HHH000204: Processing PersistenceUnitInfo [
    name: JPAAmex
    ...]
10:16:17,363 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit."amexsbswebapp.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."amexsbswebapp.war".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "amexsbswebapp.war"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:150)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1736)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1698)
    at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1556)
    at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class olsa.cerved.corporate.SBSTemplateManager with ClassLoader ModuleClassLoader for Module "deployment.amexsbswebapp.war" from Service Module Loader
    at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:78)
    at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:57)
    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:106)
    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:91)
    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:76)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:143)
    ... 8 more
Caused by: java.lang.NoClassDefFoundError: com/olsa/amex/services/parameters/ApplicationTemplateParameters
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
    at java.lang.Class.getDeclaredMethods(Unknown Source)
    at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:80)
    at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70)
    ... 13 more
Caused by: java.lang.ClassNotFoundException: com.olsa.amex.services.parameters.ApplicationTemplateParameters from [Module "deployment.amexsbswebapp.war" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:255)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
    ... 18 more

10:16:17,410 INFO  [org.hibernate.Version] (ServerService Thread Pool -- 67) HHH000412: Hibernate Core {5.1.14.Final}
10:16:17,410 INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 67) HHH000206: hibernate.properties not found
10:16:17,410 INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 67) HHH000021: Bytecode provider name : javassist
10:16:17,441 INFO  [org.hibernate.annotations.common.Version] (ServerService Thread Pool -- 67) HCANN000001: Hibernate Commons Annotations {5.0.2.Final}
10:16:18,410 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 67) WFLYJPA0010: Starting Persistence Unit (phase 1 of 2) Service 'AmexDAPWebServices.war#JPAAmex'
10:16:18,410 INFO  [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool -- 67) HHH000204: Processing PersistenceUnitInfo [
    name: JPAAmex
    ...]
10:16:18,412 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.unit."AmexDAPWebServices.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."AmexDAPWebServices.war".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "AmexDAPWebServices.war"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:150)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1736)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1698)
    at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1556)
    at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class amexdap.webservices.LoginUserServletDB with ClassLoader ModuleClassLoader for Module "deployment.AmexDAPWebServices.war" from Service Module Loader
    at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:78)
    at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:57)
    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:106)
    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:91)
    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:76)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:143)
    ... 8 more
Caused by: java.lang.NoClassDefFoundError: Lcom/olsa/amex/services/LoginService;
    at java.lang.Class.getDeclaredFields0(Native Method)
    at java.lang.Class.privateGetDeclaredFields(Unknown Source)
    at java.lang.Class.getDeclaredFields(Unknown Source)
    at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:72)
    at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70)
    ... 13 more
Caused by: java.lang.ClassNotFoundException: com.olsa.amex.services.LoginService from [Module "deployment.AmexDAPWebServices.war" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:255)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
    ... 18 more

10:16:19,069 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "AmexDAPWebServices.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"AmexDAPWebServices.war\".POST_MODULE" => "WFLYSRV0153: Failed to process phase POST_MODULE of deployment \"AmexDAPWebServices.war\"
    Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class amexdap.webservices.LoginUserServletDB with ClassLoader ModuleClassLoader for Module \"deployment.AmexDAPWebServices.war\" from Service Module Loader
    Caused by: java.lang.NoClassDefFoundError: Lcom/olsa/amex/services/LoginService;
    Caused by: java.lang.ClassNotFoundException: com.olsa.amex.services.LoginService from [Module \"deployment.AmexDAPWebServices.war\" from Service Module Loader]"}}
10:16:19,069 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "amexsbswebapp.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"amexsbswebapp.war\".POST_MODULE" => "WFLYSRV0153: Failed to process phase POST_MODULE of deployment \"amexsbswebapp.war\"
    Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class olsa.cerved.corporate.SBSTemplateManager with ClassLoader ModuleClassLoader for Module \"deployment.amexsbswebapp.war\" from Service Module Loader
    Caused by: java.lang.NoClassDefFoundError: com/olsa/amex/services/parameters/ApplicationTemplateParameters
    Caused by: java.lang.ClassNotFoundException: com.olsa.amex.services.parameters.ApplicationTemplateParameters from [Module \"deployment.amexsbswebapp.war\" from Service Module Loader]"}}
10:16:19,084 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 39) WFLYSRV0010: Deployed "amexsbswebapp.war" (runtime-name : "amexsbswebapp.war")
10:16:19,084 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 39) WFLYSRV0010: Deployed "AmexDAPWebServices.war" (runtime-name : "AmexDAPWebServices.war")
10:16:19,084 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."AmexDAPWebServices.war".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "AmexDAPWebServices.war"
      service jboss.deployment.unit."amexsbswebapp.war".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "amexsbswebapp.war"

10:16:19,131 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
10:16:19,131 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
10:16:19,131 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
10:16:19,131 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 13.0.0.Final (WildFly Core 5.0.0.Final) started (with errors) in 16942ms - Started 318 of 541 services (2 services failed or
missing dependencies, 312 services are lazy, passive or on-demand)
</code>```

BUT if I build the WARS with Maven, then paste the WARs manually in the

{JBOSS_HOME}\standalone\deployments

folder, the WARs will deploy without any problem.
Is there a way to solve this issue? It would save a lot time for me to deploy from Eclipse in order to test/fix issues with the code faster.

EDIT:

How my projects are currently structured:

```<code> -Amexwebappsbs (FrontEnd with Angularjs, works fine)
 -AmexDAPWebServices (Backend with servlets and stuff)
      |
      |
      --- AmexDAPLib-1.0(another project with services like db queries with JPA)
            |
            |
            ---- JPAAmex (JPA project with persistence.xml file)
</code>```

答:
I finally figured out a solution, in order to not "explode" your jars inside the WAR, you need to right click on your project ---> Maven ---> Disable Workspace Resolution.
This solved my problem, I can now deploy without any problem from Eclipse!</p>

Body:
as the title says, I am trying to deploy two WARs on Wildfly 13.0, but if I try to do that on Eclipse by simply adding the resources, it will fail with the following error:

10:16:02,532 INFO  [org.jboss.modules] (main) JBoss Modules version 1.8.5.Final
10:16:02,845 INFO  [org.jboss.msc] (main) JBoss MSC version 1.4.2.Final
10:16:02,876 INFO  [org.jboss.threads] (main) JBoss Threads version 2.3.2.Final
10:16:02,970 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: WildFly Full 13.0.0.Final (WildFly Core 5.0.0.Final) starting
10:16:04,016 INFO  [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/core-service=management/management-interface=http-interface' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
10:16:04,038 INFO  [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 29) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/subsystem=undertow/server=default-server/https-listener=https' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
10:16:04,038 INFO  [org.wildfly.security] (ServerService Thread Pool -- 18) ELY00001: WildFly Elytron version 1.3.3.Final
10:16:04,038 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0015: Re-attempting failed deployment AmexDAPWebServices.war
10:16:04,507 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0015: Re-attempting failed deployment amexsbswebapp.war
10:16:05,772 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0004: Found AmexDAPWebServices.war in deployment directory. To trigger deployment create a file called AmexDAPWebServices.war.dodeploy
10:16:05,772 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0004: Found amexsbswebapp.war in deployment directory. To trigger deployment create a file called amexsbswebapp.war.dodeploy
10:16:05,795 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
10:16:05,811 INFO  [org.xnio] (MSC service thread 1-8) XNIO version 3.6.3.Final
10:16:05,811 INFO  [org.xnio.nio] (MSC service thread 1-8) XNIO NIO Implementation Version 3.6.3.Final
10:16:05,842 INFO  [org.jboss.as.ee] (ServerService Thread Pool -- 41) WFLYEE0119: The system property 'ee8.preview.mode' is NOT set to 'true'. For provided EE 8 APIs where the EE 8 version of the API differs from what is supported in EE 7, the EE 7 variant of the API will be used. Support for this setting will be removed once all EE 8 APIs are provided and certified.
10:16:05,842 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 45) WFLYCLINF0001: Activating Infinispan subsystem.
10:16:05,858 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 64) WFLYWS0002: Activating WebServices Extension
10:16:05,858 WARN  [org.jboss.as.txn] (ServerService Thread Pool -- 62) WFLYTX0013: The node-identifier attribute on the /subsystem=transactions is set to the default value. This is a danger for environments running multiple servers. Please make sure the attribute value is unique.
10:16:05,873 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 54) WFLYNAM0001: Activating Naming Subsystem
10:16:05,873 INFO  [org.jboss.as.jaxrs] (ServerService Thread Pool -- 47) WFLYRS0016: RESTEasy version 3.5.1.Final
10:16:05,889 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 52) WFLYJSF0007: Activated the following JSF Implementations: [main]
10:16:05,889 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 60) WFLYSEC0002: Activating Security Subsystem
10:16:05,920 INFO  [org.jboss.as.connector] (MSC service thread 1-6) WFLYJCA0009: Starting JCA Subsystem (WildFly/IronJacamar 1.4.9.Final)
10:16:05,920 INFO  [org.jboss.as.security] (MSC service thread 1-5) WFLYSEC0001: Current PicketBox version=5.0.2.Final
10:16:05,936 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 38) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.4)
10:16:05,936 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0003: Undertow 2.0.9.Final starting
10:16:05,952 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) WFLYJCA0018: Started Driver service with driver-name = h2
10:16:05,952 INFO  [org.jboss.as.naming] (MSC service thread 1-2) WFLYNAM0003: Starting Naming Service
10:16:05,952 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-1) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
10:16:06,061 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 63) WFLYUT0014: Creating file handler for path 'C:\Users\v.cappellini\wildfly-13.0.0.Final/welcome-content' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]']
10:16:06,186 INFO  [org.wildfly.extension.io] (ServerService Thread Pool -- 46) WFLYIO001: Worker 'default' has auto-configured to 16 core threads with 128 task threads based on your 8 available processors
10:16:06,201 INFO  [org.jboss.as.ejb3] (MSC service thread 1-2) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 32 (per class), which is derived from the number of CPUs on this host.
10:16:06,201 INFO  [org.jboss.as.ejb3] (MSC service thread 1-7) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 128 (per class), which is derived from thread worker pool sizing.
10:16:06,233 INFO  [org.jboss.remoting] (MSC service thread 1-8) JBoss Remoting version 5.0.7.Final
10:16:06,248 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0012: Started server default-server.
10:16:06,248 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0018: Host default-host starting
10:16:06,295 INFO  [org.jboss.as.ejb3] (MSC service thread 1-6) WFLYEJB0493: EJB subsystem suspension complete
10:16:06,311 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-7) WFLYUT0006: Undertow HTTP listener default listening on 127.0.0.1:8080
10:16:06,311 INFO  [org.jboss.as.patching] (MSC service thread 1-3) WFLYPAT0050: WildFly Full cumulative patch ID is: base, one-off patches include: none
10:16:06,342 WARN  [org.jboss.as.domain.management.security] (MSC service thread 1-6) WFLYDM0111: Keystore C:\Users\v.cappellini\wildfly-13.0.0.Final\standalone\configuration\application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost
10:16:06,342 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-4) WFLYDS0013: Started FileSystemDeploymentService for directory C:\Users\v.cappellini\wildfly-13.0.0.Final\standalone\deployments
10:16:06,358 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0027: Starting deployment of "amexsbswebapp.war" (runtime-name: "amexsbswebapp.war")
10:16:06,358 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0027: Starting deployment of "AmexDAPWebServices.war" (runtime-name: "AmexDAPWebServices.war")
10:16:06,623 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-7) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
10:16:06,795 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443
10:16:06,863 INFO  [org.jboss.ws.common.management] (MSC service thread 1-2) JBWS022052: Starting JBossWS 5.2.1.Final (Apache CXF 3.2.4.jbossorg-1)
10:16:14,642 WARN  [org.wildfly.extension.undertow] (MSC service thread 1-5) WFLYUT0081: The deployment amexsbswebapp.war will not be distributable because this feature is disabled in web-fragment.xml of the module apiee-core-1.0.1.jar.
10:16:15,023 INFO  [org.jboss.as.jpa] (MSC service thread 1-5) WFLYJPA0002: Read persistence.xml for JPAAmex
10:16:15,023 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) WFLYJPA0002: Read persistence.xml for JPAAmex
10:16:17,335 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 67) WFLYJPA0010: Starting Persistence Unit (phase 1 of 2) Service 'amexsbswebapp.war#JPAAmex'
10:16:17,347 INFO  [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool -- 67) HHH000204: Processing PersistenceUnitInfo [
    name: JPAAmex
    ...]
10:16:17,363 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit."amexsbswebapp.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."amexsbswebapp.war".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "amexsbswebapp.war"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:150)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1736)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1698)
    at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1556)
    at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class olsa.cerved.corporate.SBSTemplateManager with ClassLoader ModuleClassLoader for Module "deployment.amexsbswebapp.war" from Service Module Loader
    at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:78)
    at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:57)
    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:106)
    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:91)
    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:76)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:143)
    ... 8 more
Caused by: java.lang.NoClassDefFoundError: com/olsa/amex/services/parameters/ApplicationTemplateParameters
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
    at java.lang.Class.getDeclaredMethods(Unknown Source)
    at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:80)
    at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70)
    ... 13 more
Caused by: java.lang.ClassNotFoundException: com.olsa.amex.services.parameters.ApplicationTemplateParameters from [Module "deployment.amexsbswebapp.war" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:255)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
    ... 18 more

10:16:17,410 INFO  [org.hibernate.Version] (ServerService Thread Pool -- 67) HHH000412: Hibernate Core {5.1.14.Final}
10:16:17,410 INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 67) HHH000206: hibernate.properties not found
10:16:17,410 INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 67) HHH000021: Bytecode provider name : javassist
10:16:17,441 INFO  [org.hibernate.annotations.common.Version] (ServerService Thread Pool -- 67) HCANN000001: Hibernate Commons Annotations {5.0.2.Final}
10:16:18,410 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 67) WFLYJPA0010: Starting Persistence Unit (phase 1 of 2) Service 'AmexDAPWebServices.war#JPAAmex'
10:16:18,410 INFO  [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool -- 67) HHH000204: Processing PersistenceUnitInfo [
    name: JPAAmex
    ...]
10:16:18,412 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.unit."AmexDAPWebServices.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."AmexDAPWebServices.war".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "AmexDAPWebServices.war"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:150)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1736)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1698)
    at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1556)
    at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class amexdap.webservices.LoginUserServletDB with ClassLoader ModuleClassLoader for Module "deployment.AmexDAPWebServices.war" from Service Module Loader
    at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:78)
    at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:57)
    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:106)
    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:91)
    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:76)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:143)
    ... 8 more
Caused by: java.lang.NoClassDefFoundError: Lcom/olsa/amex/services/LoginService;
    at java.lang.Class.getDeclaredFields0(Native Method)
    at java.lang.Class.privateGetDeclaredFields(Unknown Source)
    at java.lang.Class.getDeclaredFields(Unknown Source)
    at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:72)
    at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70)
    ... 13 more
Caused by: java.lang.ClassNotFoundException: com.olsa.amex.services.LoginService from [Module "deployment.AmexDAPWebServices.war" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:255)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
    ... 18 more

10:16:19,069 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "AmexDAPWebServices.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"AmexDAPWebServices.war\".POST_MODULE" => "WFLYSRV0153: Failed to process phase POST_MODULE of deployment \"AmexDAPWebServices.war\"
    Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class amexdap.webservices.LoginUserServletDB with ClassLoader ModuleClassLoader for Module \"deployment.AmexDAPWebServices.war\" from Service Module Loader
    Caused by: java.lang.NoClassDefFoundError: Lcom/olsa/amex/services/LoginService;
    Caused by: java.lang.ClassNotFoundException: com.olsa.amex.services.LoginService from [Module \"deployment.AmexDAPWebServices.war\" from Service Module Loader]"}}
10:16:19,069 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "amexsbswebapp.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"amexsbswebapp.war\".POST_MODULE" => "WFLYSRV0153: Failed to process phase POST_MODULE of deployment \"amexsbswebapp.war\"
    Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class olsa.cerved.corporate.SBSTemplateManager with ClassLoader ModuleClassLoader for Module \"deployment.amexsbswebapp.war\" from Service Module Loader
    Caused by: java.lang.NoClassDefFoundError: com/olsa/amex/services/parameters/ApplicationTemplateParameters
    Caused by: java.lang.ClassNotFoundException: com.olsa.amex.services.parameters.ApplicationTemplateParameters from [Module \"deployment.amexsbswebapp.war\" from Service Module Loader]"}}
10:16:19,084 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 39) WFLYSRV0010: Deployed "amexsbswebapp.war" (runtime-name : "amexsbswebapp.war")
10:16:19,084 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 39) WFLYSRV0010: Deployed "AmexDAPWebServices.war" (runtime-name : "AmexDAPWebServices.war")
10:16:19,084 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."AmexDAPWebServices.war".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "AmexDAPWebServices.war"
      service jboss.deployment.unit."amexsbswebapp.war".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "amexsbswebapp.war"

10:16:19,131 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
10:16:19,131 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
10:16:19,131 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
10:16:19,131 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 13.0.0.Final (WildFly Core 5.0.0.Final) started (with errors) in 16942ms - Started 318 of 541 services (2 services failed or
missing dependencies, 312 services are lazy, passive or on-demand)

BUT if I build the WARS with Maven, then paste the WARs manually in the

{JBOSS_HOME}\standalone\deployments

folder, the WARs will deploy without any problem.
Is there a way to solve this issue? It would save a lot time for me to deploy from Eclipse in order to test/fix issues with the code faster.

EDIT:

How my projects are currently structured:

 -Amexwebappsbs (FrontEnd with Angularjs, works fine)
 -AmexDAPWebServices (Backend with servlets and stuff)
      |
      |
      --- AmexDAPLib-1.0(another project with services like db queries with JPA)
            |
            |
            ---- JPAAmex (JPA project with persistence.xml file)


问:
How to fill an array with dictionary-type elements
I need to fill an array with elements which are dictionaries. For example:

```<code>a = np.empty(2,2)
</code>```

and I need to fill it in this way (which is not allowed)

```<code>for i in range(2):
   for j in range(2):
      a[i,j] = {'x': b[i], 'y': c[j]}
</code>```

where band c are other lists/arrays or columns of a dataframe.

Body:
I need to fill an array with elements which are dictionaries. For example:

a = np.empty(2,2)

and I need to fill it in this way (which is not allowed)

for i in range(2):
   for j in range(2):
      a[i,j] = {'x': b[i], 'y': c[j]}

where band c are other lists/arrays or columns of a dataframe.

Body:
import numpy as np

a = np.zeros((2, 2))
b = np.ones(a.shape[0])
c = np.ones(a.shape[1]) * [2]

list_a = a.tolist()

for i in range(2):
   for j in range(2):
      list_a[i][j] = {'x': b[i], 'y': c[j]}

a = np.array(list_a)

print(a)

Output:

array([[{'x': 1.0, 'y': 2.0}, {'x': 1.0, 'y': 2.0}],
       [{'x': 1.0, 'y': 2.0}, {'x': 1.0, 'y': 2.0}]], dtype=object)


问:
How to concatenate multiple netCDF files with varying dimension sizes?
I have 20 netCDF files containing oceanographic CTD data. Each file contains the same dimension and variable names, however they differ in the size of the vertical coordinate (ie. CTD profiles inshore have a smaller depth range than profiles offshore). I need to concatenate these separate files into one netCDF file with a record variable "station".

I have tried:

```<code>ncecat -u station *.nc outfile.nc
</code>```

This concatenates the files in the correct way, but it takes the dimension size of the first netCDF file (which is the smallest) and so I lose the data below the depth of the shallowest CTD profile for the rest of the netCDF files.

I'm assuming I need to add FillValues (or similar) in place of the data that is shallower than the maximum depth of the deepest CTD profile.

Is there a way to do this using ncecat?

答:
The closest you can get with ncecat alone is to use group aggregation to store each station profile as its own group in a netCDF4 file. Then you do not need to search for and fill-in any missing data:

```<code>ncecat --gag *.nc outfile.nc
</code>```

Body:
I have 20 netCDF files containing oceanographic CTD data. Each file contains the same dimension and variable names, however they differ in the size of the vertical coordinate (ie. CTD profiles inshore have a smaller depth range than profiles offshore). I need to concatenate these separate files into one netCDF file with a record variable "station".

I have tried:

ncecat -u station *.nc outfile.nc

This concatenates the files in the correct way, but it takes the dimension size of the first netCDF file (which is the smallest) and so I lose the data below the depth of the shallowest CTD profile for the rest of the netCDF files.

I'm assuming I need to add FillValues (or similar) in place of the data that is shallower than the maximum depth of the deepest CTD profile.

Is there a way to do this using ncecat?

Body:
The closest you can get with ncecat alone is to use group aggregation to store each station profile as its own group in a netCDF4 file. Then you do not need to search for and fill-in any missing data:

ncecat --gag *.nc outfile.nc


问:
How to use OpenGL 2.0 rather than a later version?
The goal is to make a game which will be compatible with many Graphics cards, and cross-platform. I decided to go with OpenGL 2.0 and Glut.

I quickly came to realize however, that there are no specific DLL for version OpenGL version 1.0, 2.0, 2.1... This lead me to wonder, how exactly do you choose which OpenGL version you need?

Also, I am aware that Windows Visual Studio only comes with OpenGL version 1.1. That is why I decided to use Glut, so that I could use functions from a later version of OpenGL such as 2.0.

The question remains, how do I use a certain version of OpenGL?

答:
Also, I am aware that Windows Visual Studio only comes with OpenGL version 1.1. That is why I decided to use Glut, so that I could use functions from a later version of OpenGL such as 2.0.

GLUT will not help in this respect (or, I'm tempted to say, in any other respect either). What you're looking for is GLEE or GLEW. Most implementations allow you to do this on your own as well; these libraries just make it easier -- but they do make it a lot easier.