问:
Spring boot embedded tomcat listening but not responding
When spring boot application is started with command "mvn spring-boot:run", tomcat server start listening at port 8080.

But when we access http://localhost:8080/index.html from browser tomcat will NOT respond.

Below is the POM.xml

```<code><?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.test.des</groupId>
    <artifactId>trackerapp</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>

    <name>trackerapp</name>
    <description>Demo project for Spring Boot</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.15.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <version.commons-io>2.4</version.commons-io>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.7</java.version>
        <tomcat.version>7.0.90</tomcat.version>
        <start-class>com.test.des.trackerapp.trackerappApplication</start-class>
    </properties>

    <dependencies>
        <!-- <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-rest</artifactId>
        </dependency> -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId>
            </dependency> -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${version.commons-io}</version>
        </dependency>
        <dependency>
            <groupId>com.jayway.jsonpath</groupId>
            <artifactId>json-path</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>2.8.0</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-mail</artifactId>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>2.8.0</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.16.20</version>
            <scope>provided</scope>
        </dependency>
        <!--WebJars -->
        <!-- <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId>
            </dependency> -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-ldap</artifactId>
            <!-- <version>2.0.8.RELEASE</version> -->
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>compile</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>
</code>```

The starter class is shown below.

```<code>package com.test.des.trackerapp;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@EnableScheduling
@ComponentScan
@EnableJpaRepositories(basePackages = "com.test.des.trackerapp.repositories")
public class trackerappApplication extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(trackerappApplication.class);
    }

    public static void main(String[] args) throws Exception {
        SpringApplication.run(trackerappApplication.class, args);
    }
}
</code>```

The folder structure for static content are shown below.

Can anyone help me to find what is the problem ?

Thanks.

答:
I have found the issue. Its with server.contextPath property in application.properties.
It was set to server.contextPath=/trackerappApplication, changing this property to server.contextPath=/ will fix the issue.

Body:
When spring boot application is started with command "mvn spring-boot:run", tomcat server start listening at port 8080.

But when we access http://localhost:8080/index.html from browser tomcat will NOT respond.

Below is the POM.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.test.des</groupId>
    <artifactId>trackerapp</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>

    <name>trackerapp</name>
    <description>Demo project for Spring Boot</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.15.RELEASE</version>
        <relativePath />
    </parent>

    <properties>
        <version.commons-io>2.4</version.commons-io>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.7</java.version>
        <tomcat.version>7.0.90</tomcat.version>
        <start-class>com.test.des.trackerapp.trackerappApplication</start-class>
    </properties>

    <dependencies>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${version.commons-io}</version>
        </dependency>
        <dependency>
            <groupId>com.jayway.jsonpath</groupId>
            <artifactId>json-path</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>2.8.0</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-mail</artifactId>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>2.8.0</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.16.20</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-ldap</artifactId>

        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>compile</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

The starter class is shown below.

package com.test.des.trackerapp;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@EnableScheduling
@ComponentScan
@EnableJpaRepositories(basePackages = "com.test.des.trackerapp.repositories")
public class trackerappApplication extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(trackerappApplication.class);
    }

    public static void main(String[] args) throws Exception {
        SpringApplication.run(trackerappApplication.class, args);
    }
}

The folder structure for static content are shown below.

Can anyone help me to find what is the problem ?

Thanks.


来源: stackexchange

问:
Numpy Zero Padding to match a certain shape
I have a file with arrays or different shapes. I want to zeropad all the array to match the largest shape. The largest shape is (93,13).

To test this I have the following code:

```<code>testarray = np.ones((41,13))
</code>```

how can I zero pad this array to match the shape of (93,13)? And ultimately, how can I do it for thousands of rows?

Edit: The solution was found in the comments:

```<code>for index, array in enumerate(mfcc):
    testarray = np.zeros((93,13))
    for index,row in enumerate(array):
        for i in range(0,len(row)-1):
            testarray[index][i]= row[i]
            mfcc[index] = testarray
</code>```

答:
Here's an approach using np.pad that can generalize to an arbitrary target shape:

```<code>def to_shape(a, shape):
    y_, x_ = shape
    y, x = a.shape
    y_pad = (y_-y)
    x_pad = (x_-x)
    return np.pad(a,((y_pad//2, y_pad//2 + y_pad%2),
                     (x_pad//2, x_pad//2 + x_pad%2)),
                  mode = 'constant')
</code>```

For the proposed example:

```<code>a = np.ones((41,13))
shape = [93, 13]
to_shape(a, shape).shape
# (93, 13)
</code>```

Lets check with another example:

```<code>shape = [100, 121]
to_shape(a, shape).shape
# (100, 121)
</code>```

 Timings

```<code>def florian(array, shape):
    #print(array)
    testarray = np.zeros(shape)
    for index,row in enumerate(array):
        for i in range(0,len(row)-1):
            testarray[index][i]= row[i]

def to_shape(a, shape):
    y_, x_ = shape
    y, x = a.shape
    y_pad = (y_-y)
    x_pad = (x_-x)
    return np.pad(a,((y_pad//2, y_pad//2 + y_pad%2),
                     (x_pad//2, x_pad//2 + x_pad%2)),
                  mode = 'constant')

a = np.ones((500, 500))
shape = [1000, 1103]

%timeit florian(a, shape)
# 101 ms ± 5.12 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)

%timeit to_shape(a, shape)
# 19.8 ms ± 318 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I have a file with arrays or different shapes. I want to zeropad all the array to match the largest shape. The largest shape is (93,13).

To test this I have the following code:

testarray = np.ones((41,13))

how can I zero pad this array to match the shape of (93,13)? And ultimately, how can I do it for thousands of rows?

Edit: The solution was found in the comments:

for index, array in enumerate(mfcc):
    testarray = np.zeros((93,13))
    for index,row in enumerate(array):
        for i in range(0,len(row)-1):
            testarray[index][i]= row[i]
            mfcc[index] = testarray

Body:
Here's an approach using np.pad that can generalize to an arbitrary target shape:

def to_shape(a, shape):
    y_, x_ = shape
    y, x = a.shape
    y_pad = (y_-y)
    x_pad = (x_-x)
    return np.pad(a,((y_pad//2, y_pad//2 + y_pad%2),
                     (x_pad//2, x_pad//2 + x_pad%2)),
                  mode = 'constant')

For the proposed example:

a = np.ones((41,13))
shape = [93, 13]
to_shape(a, shape).shape
# (93, 13)

Lets check with another example:

shape = [100, 121]
to_shape(a, shape).shape
# (100, 121)

 Timings

def florian(array, shape):
    #print(array)
    testarray = np.zeros(shape)
    for index,row in enumerate(array):
        for i in range(0,len(row)-1):
            testarray[index][i]= row[i]

def to_shape(a, shape):
    y_, x_ = shape
    y, x = a.shape
    y_pad = (y_-y)
    x_pad = (x_-x)
    return np.pad(a,((y_pad//2, y_pad//2 + y_pad%2),
                     (x_pad//2, x_pad//2 + x_pad%2)),
                  mode = 'constant')

a = np.ones((500, 500))
shape = [1000, 1103]

%timeit florian(a, shape)
# 101 ms ± 5.12 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)

%timeit to_shape(a, shape)
# 19.8 ms ± 318 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)


问:
unable to sign the unsigned APK
I'm trying to sign the unsigned APK. I followed this link.

My steps:

$ cordova build --release android (success)

$ keytool -genkey -v -keystore my-release-key.keystore -alias alias_name - keyalg RSA -keysize 2048 -validity 10000 (success)

$ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore HelloWorld-release-unsigned.apk alias_name (got problem)

The problem is:

jarsigner: unable to open jar file: HelloWorld-release-unsigned.apk

Then i followed this link.

$ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -my-release-key.keystore F:\mobile\moto\whatever_the_path_is_to_your_apk_file\HelloCordova-release-unsigned.apk alias_name (got problem)

the problem is:

Illegal option: -my-release-key.keystore

Can anyone help me. Thank you.

答:
Just use absolute path instead of relative path as:</p>

```<code>jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore myApp.keystore E:\myApp\platforms\android\app\build\outputs\apk\release\app-release-unsigned.apk myApp
</code>```

ContentLicense: CC BY-SA 3.0

Title: unable to sign the unsigned APK

Body:
Just use absolute path instead of relative path as:

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore myApp.keystore E:\myApp\platforms\android\app\build\outputs\apk\release\app-release-unsigned.apk myApp


问:
Npgsql: nested sql commands on one connection
I'm porting an app from firebird to postgres and there is a bunch of nested sql commands. The first command is necessary for the second one to run, there are some functions that have 5 or 6 nested commands and they are all using the same connection. I just wanted to know if there is a way to do all this on one connection without having to rewrite the whole thing.

```<code>    static void NestedCommandsOnOneConnection()
    {
        using (NpgsqlConnection connection = new NpgsqlConnection(ConnectionString))
        {
            using (NpgsqlCommand command = new NpgsqlCommand("SELECT * FROM tableA", connection))
            {
                using (NpgsqlDataReader reader = command.ExecuteReader())
                {
                    using (NpgsqlCommand command2 = new NpgsqlCommand("SELECT * FROM tableB where column1 = @column1", connection))
                    {
                        command2.Parameters.AddWithValue("@column1", reader["column1"]);

                        using (NpgsqlDataReader reader2 = command2.ExecuteReader())
                        {
                            while (reader2.Read())
                            {
                                //Do things
                            }
                        }
                    }
                }
            }
        }
    }
</code>```

//Edit: Would it be better if i do something like this?

```<code>    static void NestedCommandsOnOneConnection()
    {
        using (NpgsqlConnection connection = new NpgsqlConnection(ConnectionString))
        {
            var column1 = "";
            using (NpgsqlCommand command = new NpgsqlCommand("SELECT * FROM tableA LIMIT 1", connection))
            {
                using (NpgsqlDataReader reader = command.ExecuteReader())
                {
                    while(reader.Read())
                    {
                       column1 = reader["column1"].ToString();
                    }

                }
            }
            using (NpgsqlCommand command2 = new NpgsqlCommand("SELECT * FROM tableB where column1 = @column1", connection))
            {
                command2.Parameters.AddWithValue("@column1", column1);

                using (NpgsqlDataReader reader2 = command2.ExecuteReader())
                {
                    while (reader2.Read())
                    {
                        //Do things
                    }
                }
            }
        }
    }
</code>```

When the second command gets executed I get the error msg "a command is already in progress: SELECT * FROM tableA" So is there any way to do this without having to make a connection for each command?

答:
The issue is that the when you are on the context on the first command/reader, the connection is taken for that. Until you release the connection from the first command/reader, you can't run the second command, and so on.

The solution for that, is to load the data you are getting to a List, and iterate per that list and run the second command/reader. On the second command/reader you also load the result in another List, and iterate over it.

At the end, my recommendation would be for you to evaluate the data you want from the database and the querys you are doing. The way you are thinking, is right, but it adds an huge overload on the database that will create problems in other concurrent users trying to get data from the same tables.

Body:
I'm porting an app from firebird to postgres and there is a bunch of nested sql commands. The first command is necessary for the second one to run, there are some functions that have 5 or 6 nested commands and they are all using the same connection. I just wanted to know if there is a way to do all this on one connection without having to rewrite the whole thing.

    static void NestedCommandsOnOneConnection()
    {
        using (NpgsqlConnection connection = new NpgsqlConnection(ConnectionString))
        {
            using (NpgsqlCommand command = new NpgsqlCommand("SELECT * FROM tableA", connection))
            {
                using (NpgsqlDataReader reader = command.ExecuteReader())
                {
                    using (NpgsqlCommand command2 = new NpgsqlCommand("SELECT * FROM tableB where column1 = @column1", connection))
                    {
                        command2.Parameters.AddWithValue("@column1", reader["column1"]);

                        using (NpgsqlDataReader reader2 = command2.ExecuteReader())
                        {
                            while (reader2.Read())
                            {
                                //Do things
                            }
                        }
                    }
                }
            }
        }
    }

//Edit: Would it be better if i do something like this?

    static void NestedCommandsOnOneConnection()
    {
        using (NpgsqlConnection connection = new NpgsqlConnection(ConnectionString))
        {
            var column1 = "";
            using (NpgsqlCommand command = new NpgsqlCommand("SELECT * FROM tableA LIMIT 1", connection))
            {
                using (NpgsqlDataReader reader = command.ExecuteReader())
                {
                    while(reader.Read())
                    {
                       column1 = reader["column1"].ToString();
                    }

                }
            }
            using (NpgsqlCommand command2 = new NpgsqlCommand("SELECT * FROM tableB where column1 = @column1", connection))
            {
                command2.Parameters.AddWithValue("@column1", column1);

                using (NpgsqlDataReader reader2 = command2.ExecuteReader())
                {
                    while (reader2.Read())
                    {
                        //Do things
                    }
                }
            }
        }
    }

When the second command gets executed I get the error msg "a command is already in progress: SELECT * FROM tableA" So is there any way to do this without having to make a connection for each command?


问:
How to move text to New line of same row when text is bigger
I am working on HTML table and i am stuck here for very long now, I have a requirement of displaying table into four columns/grid which i have done

Now when i am rendering the table i am displaying first 17 rows in one go than next 17 after five seconds

What is the issue

some ItemNames are big like BIG BANAYAN CARBINET SAUVIGNON BY GLASS

So when page is refreshing after five seconds the the column which contains this long name gets very large width which is not good to see as on UI

I am trying to make the width of each column uniform all four will have same width

So when the long ITEM NAME is coming what I am trying to do is to use word-wrap: normal; to break it after some width,but it is not working

I am dividing the four columns into equal part, which ever screen it is rendering the table it should be divided into 4 parts and when ITEMNAME is large i want to display it into same row but in new line after that exceeds the width of column

I think i have to give some sort of height to all the rows when it can accept one single small item name then it will show in single row but when the name is large it should show in same row but in two lines with same font

$(document).ready(function() {

  var tableValue = [{
    "Item Name": "MANCHOW  V SOUP",
    "SellingPrice": 100
  }, {
    "Item Name": "MANCHOW NV SOUP ",
    "SellingPrice": 125
  }, {
    "Item Name": "CEASER SALAD V",
    "SellingPrice": 175
  }, {
    "Item Name": "CEASER SALAD NV",
    "SellingPrice": 230
  }, {
    "Item Name": "GAMBUS REBOZADAS",
    "SellingPrice": 350
  }, {
    "Item Name": "PANCO FISH FINGER",
    "SellingPrice": 270
  }, {
    "Item Name": "MUSHROOM DUPLEX",
    "SellingPrice": 160
  }, {
    "Item Name": "FRENCH FRIES",
    "SellingPrice": 99
  }, {
    "Item Name": "HONEY GARLIC PRAWN",
    "SellingPrice": 350
  }, {
    "Item Name": "CHICKEN MANCHURIAN",
    "SellingPrice": 180
  }, {
    "Item Name": "MUSHROOM CHILLY",
    "SellingPrice": 120
  }, {
    "Item Name": "SALT N PEPPER BABY CORN",
    "SellingPrice": 120
  }, {
    "Item Name": "SOUTHERN STYLE CHICKEN",
    "SellingPrice": 210
  }, {
    "Item Name": "PANEER NAGGETS",
    "SellingPrice": 210
  }, {
    "Item Name": "HARA BHARA KEBAB",
    "SellingPrice": 160
  }, {
    "Item Name": "CHICKEN TIKKA",
    "SellingPrice": 210
  }, {
    "Item Name": "KALMI KEBAB",
    "SellingPrice": 250
  }, {
    "Item Name": "PIZZA MARGARITTA",
    "SellingPrice": 200
  }, {
    "Item Name": "PIZZA VEG FARMHOUSE",
    "SellingPrice": 200
  }, {
    "Item Name": "BBQ CHICKEN PIZZA",
    "SellingPrice": 225
  }, {
    "Item Name": "CHICKEN TIKKA PIZZA",
    "SellingPrice": 225
  }, {
    "Item Name": "PESTO SAUCE",
    "SellingPrice": 175
  }, {
    "Item Name": "ARABIATA",
    "SellingPrice": 160
  }, {
    "Item Name": "PINK SAUCE",
    "SellingPrice": 160
  }, {
    "Item Name": "GARBANZO BEAN SALAD",
    "SellingPrice": 90
  }, {
    "Item Name": "MASALA PAPAD",
    "SellingPrice": 50
  }, {
    "Item Name": "PEANUT MASALA",
    "SellingPrice": 60
  }, {
    "Item Name": "GAJAR KA HALWA",
    "SellingPrice": 90
  }, {
    "Item Name": "WATERMELON MARTINI",
    "SellingPrice": 281
  }, {
    "Item Name": "Kiwi martini",
    "SellingPrice": 281
  }, {
    "Item Name": " Apple gin",
    "SellingPrice": 225
  }, {
    "Item Name": "Cucumber  cooler ",
    "SellingPrice": 281
  }, {
    "Item Name": "Martini",
    "SellingPrice": 225
  }, {
    "Item Name": "Pink lady",
    "SellingPrice": 225
  }, {
    "Item Name": " Bloody marry",
    "SellingPrice": 281
  }, {
    "Item Name": "Cosmopolitan",
    "SellingPrice": 281
  }, {
    "Item Name": "Sex on the beach",
    "SellingPrice": 281
  }, {
    "Item Name": "Bull frog",
    "SellingPrice": 506
  }, {
    "Item Name": "Long  island iced tea ",
    "SellingPrice": 393
  }, {
    "Item Name": "Pinacolada",
    "SellingPrice": 225
  }, {
    "Item Name": "Daiquiri",
    "SellingPrice": 225
  }, {
    "Item Name": "Mojito ",
    "SellingPrice": 281
  }, {
    "Item Name": "Whisky sour",
    "SellingPrice": 281
  }, {
    "Item Name": "Hot toddy",
    "SellingPrice": 225
  }, {
    "Item Name": "Margarita",
    "SellingPrice": 337
  }, {
    "Item Name": "Tequila sunrise",
    "SellingPrice": 337
  }, {
    "Item Name": "Red sangria",
    "SellingPrice": 225
  }, {
    "Item Name": "White sangria",
    "SellingPrice": 247
  }, {
    "Item Name": "Rose sangria",
    "SellingPrice": 247
  }, {
    "Item Name": "By chance special ",
    "SellingPrice": 168
  }, {
    "Item Name": "Made in heaven",
    "SellingPrice": 168
  }, {
    "Item Name": "Strawberry delight",
    "SellingPrice": 168
  }, {
    "Item Name": "DRAGON",
    "SellingPrice": 168
  }, {
    "Item Name": "Mangochil ",
    "SellingPrice": 168
  }, {
    "Item Name": "Cucumber cola",
    "SellingPrice": 168
  }, {
    "Item Name": "Virgin mojito",
    "SellingPrice": 168
  }, {
    "Item Name": "Virgin mary",
    "SellingPrice": 168
  }, {
    "Item Name": "Virgin pinacolada",
    "SellingPrice": 168
  }, {
    "Item Name": "CORONA",
    "SellingPrice": 438
  }, {
    "Item Name": "CRAFT BEERS",
    "SellingPrice": 337
  }, {
    "Item Name": "BIRA WHITE 330",
    "SellingPrice": 157
  }, {
    "Item Name": "BIRA BLONDE 330",
    "SellingPrice": 135
  }, {
    "Item Name": "BIRA STRONG 650",
    "SellingPrice": 213
  }, {
    "Item Name": "KINGFISHER PREMIUM 330",
    "SellingPrice": 123
  }, {
    "Item Name": "KINGFISHER PREMIUM 650",
    "SellingPrice": 202
  }, {
    "Item Name": "KINGFISHER STRONG 330",
    "SellingPrice": 135
  }, {
    "Item Name": "KINGFISHER STRONG 650",
    "SellingPrice": 213
  }, {
    "Item Name": "KINGFISHER ULTRA 330",
    "SellingPrice": 146
  }, {
    "Item Name": "KINGFISHER ULTRA 650",
    "SellingPrice": 281
  }, {
    "Item Name": "KINGFISHER ULTRA MAX 330",
    "SellingPrice": 146
  }, {
    "Item Name": "KINGFISHER ULTRA MAX 650",
    "SellingPrice": 281
  }, {
    "Item Name": "BUDWIESER 330",
    "SellingPrice": 146
  }, {
    "Item Name": "BUDWIESER 650",
    "SellingPrice": 270
  }, {
    "Item Name": "BUDWIESER MAGNUM 330",
    "SellingPrice": 168
  }, {
    "Item Name": "BUDWIESER MAGNUM 650",
    "SellingPrice": 281
  }, {
    "Item Name": "TUBORG 330",
    "SellingPrice": 123
  }, {
    "Item Name": "TUBORG 650",
    "SellingPrice": 191
  }, {
    "Item Name": "TUBORG STRONG 330",
    "SellingPrice": 123
  }, {
    "Item Name": "TUBORG STRONG 650",
    "SellingPrice": 213
  }, {
    "Item Name": "CRANBERRY ",
    "SellingPrice": 157
  }, {
    "Item Name": "ORANGE",
    "SellingPrice": 157
  }, {
    "Item Name": "JAMICAN",
    "SellingPrice": 157
  }, {
    "Item Name": "BLACK BERRY",
    "SellingPrice": 157
  }, {
    "Item Name": "BLUE BERRY",
    "SellingPrice": 157
  }, {
    "Item Name": "MOET CHANDON",
    "SellingPrice": 7875
  }, {
    "Item Name": "SULA BRUT",
    "SellingPrice": 1687
  }, {
    "Item Name": "MATEUS ROSE",
    "SellingPrice": 2137
  }, {
    "Item Name": "HARDYS SIRAZ CABERNET 750",
    "SellingPrice": 1890
  }, {
    "Item Name": "HARDYS SIRAZ CABERNET BY GLASS",
    "SellingPrice": 382
  }, {
    "Item Name": "JACOB CREEK SIRAZ 750",
    "SellingPrice": 1800
  }, {
    "Item Name": "JACOB CREEK SIRAZ BY GLASS",
    "SellingPrice": 360
  }, {
    "Item Name": "BIG BANAYAN CHENNIN BLANC 750",
    "SellingPrice": 990
  }, {
    "Item Name": "BIG BANAYAN CHENNIN BLANC BY GLASS",
    "SellingPrice": 202
  }, {
    "Item Name": "SULA CHENIN BLANC 750 ",
    "SellingPrice": 1293
  }, {
    "Item Name": "SULA CHENIN BLANC BY GLASS",
    "SellingPrice": 258
  }, {
    "Item Name": "FOUR SEAZON CLASSIC CHENNIN BLANC 7",
    "SellingPrice": 1125
  }, {
    "Item Name": "FOUR SEAZON CLASSIC CHENNIN BLANC B",
    "SellingPrice": 225
  }, {
    "Item Name": "BIG BANAYAN CARBINET SAUVIGNON 750",
    "SellingPrice": 1125
  }, {
    "Item Name": "BIG BANAYAN CARBINET SAUVIGNON BY G",
    "SellingPrice": 225
  }, {
    "Item Name": "SULA SATORI MERLOT 750",
    "SellingPrice": 1237
  }, {
    "Item Name": "SULA SATORI MERLOT BY GLASS",
    "SellingPrice": 247
  }, {
    "Item Name": "GROVERS LA RESERVE 750",
    "SellingPrice": 1800
  }, {
    "Item Name": "GROVERS LA RESERVE 100",
    "SellingPrice": 360
  }, {
    "Item Name": "GLENFIDDICH 12 YEARS 700 ",
    "SellingPrice": 9225
  }, {
    "Item Name": "GLENFIDDICH 12 YEARS 30",
    "SellingPrice": 405
  }, {
    "Item Name": "TALISKER 750",
    "SellingPrice": 8775
  }, {
    "Item Name": "TALISKER 30",
    "SellingPrice": 360
  }, {
    "Item Name": "GLENNLIVET 750",
    "SellingPrice": 8887
  }, {
    "Item Name": "GLENNLIVET 30",
    "SellingPrice": 360
  }, {
    "Item Name": "THE SINGLETON 750",
    "SellingPrice": 7942
  }, {
    "Item Name": "THE SINGLETON 30",
    "SellingPrice": 326
  }, {
    "Item Name": "AMRUT FUSION 750",
    "SellingPrice": 5062
  }, {
    "Item Name": "AMRUT FUSION 30",
    "SellingPrice": 202
  }, {
    "Item Name": "JACK DANIELS 750",
    "SellingPrice": 7312
  }, {
    "Item Name": "JACK DANIELS 30",
    "SellingPrice": 292
  }, {
    "Item Name": "JIM BEAM WHITE 750",
    "SellingPrice": 4095
  }, {
    "Item Name": "JIM BEAM WHITE 30",
    "SellingPrice": 168
  }, {
    "Item Name": "JAMESON 750",
    "SellingPrice": 4950
  }, {
    "Item Name": "JAMESON 30",
    "SellingPrice": 202
  }, {
    "Item Name": "JW BLACK LABEL 750",
    "SellingPrice": 8212
  }, {
    "Item Name": "JW BLACK LABEL 200",
    "SellingPrice": 2925
  }, {
    "Item Name": "JW BLACK LABEL 30",
    "SellingPrice": 337
  }, {
    "Item Name": "JW RED LABEL 200",
    "SellingPrice": 1158
  }, {
    "Item Name": "BALLENTINSE FINEST BLENDED 750",
    "SellingPrice": 4545
  }, {
    "Item Name": "BALLENTINSE FINEST BLENDED 30",
    "SellingPrice": 180
  }, {
    "Item Name": "BLACK \u0026 WHITE 375",
    "SellingPrice": 1575
  }, {
    "Item Name": "BLACK \u0026 WHITE 180",
    "SellingPrice": 787
  }, {
    "Item Name": "BLACK \u0026 WHITE 60",
    "SellingPrice": 258
  }, {
    "Item Name": "BLACK \u0026 WHITE 30",
    "SellingPrice": 135
  }, {
    "Item Name": "100 PIPERS 180",
    "SellingPrice": 787
  }, {
    "Item Name": "100 PIPERS 60",
    "SellingPrice": 258
  }, {
    "Item Name": "100 PIPERS 30",
    "SellingPrice": 135
  }, {
    "Item Name": "VAT 69 180",
    "SellingPrice": 675
  }, {
    "Item Name": "VAT 69 60",
    "SellingPrice": 225
  }, {
    "Item Name": "VAT 69 30",
    "SellingPrice": 112
  }, {
    "Item Name": "TEACHERS HIGHLAND 180",
    "SellingPrice": 787
  }, {
    "Item Name": "TEACHERS HIGHLAND 60",
    "SellingPrice": 258
  }, {
    "Item Name": "TEACHERS HIGHLAND 30",
    "SellingPrice": 135
  }, {
    "Item Name": "TEACHERS 50 60",
    "SellingPrice": 393
  }, {
    "Item Name": "TEACHERS 50 30",
    "SellingPrice": 202
  }, {
    "Item Name": "BLACK DOG TRIPPLE GOLD 180",
    "SellingPrice": 1215
  }, {
    "Item Name": "BLACK DOG TRIPPLE GOLD 30",
    "SellingPrice": 213
  }, {
    "Item Name": "BLACK DOG 8 YEARS 180",
    "SellingPrice": 731
  }, {
    "Item Name": "BLACK DOG 8 YEARS 60",
    "SellingPrice": 247
  }, {
    "Item Name": "BLACK DOG 8 YEARS 30",
    "SellingPrice": 123
  }, {
    "Item Name": "BLENDERS PRIDE 750",
    "SellingPrice": 2283
  }, {
    "Item Name": "BLENDERS PRIDE 375",
    "SellingPrice": 1147
  }, {
    "Item Name": "BLENDERS PRIDE 180",
    "SellingPrice": 573
  }, {
    "Item Name": "BLENDERS PRIDE 60",
    "SellingPrice": 191
  }, {
    "Item Name": "BLENDERS PRIDE 30",
    "SellingPrice": 90
  }, {
    "Item Name": "SIGNATURE 180",
    "SellingPrice": 450
  }, {
    "Item Name": "SIGNATURE 60",
    "SellingPrice": 168
  }, {
    "Item Name": "SIGNATURE 30",
    "SellingPrice": 90
  }, {
    "Item Name": "GREY GOOSE 750",
    "SellingPrice": 8190
  }, {
    "Item Name": "GREY GOOSE 30",
    "SellingPrice": 326
  }, {
    "Item Name": "BELVEDERE 700",
    "SellingPrice": 8122
  }, {
    "Item Name": "BELVEDERE 30",
    "SellingPrice": 360
  }, {
    "Item Name": "CIROC 750",
    "SellingPrice": 7425
  }, {
    "Item Name": "CIROC 30",
    "SellingPrice": 303
  }, {
    "Item Name": "ABSOLUT 750",
    "SellingPrice": 4556
  }, {
    "Item Name": "ABSOLUT 30",
    "SellingPrice": 191
  }, {
    "Item Name": "SMIRNOFF RED 180",
    "SellingPrice": 551
  }, {
    "Item Name": "SMIRNOFF RED 60",
    "SellingPrice": 202
  }, {
    "Item Name": "SMIRNOFF RED30",
    "SellingPrice": 101
  }, {
    "Item Name": "SMIRNOFF ORANGE 180",
    "SellingPrice": 551
  }, {
    "Item Name": "SMIRNOFF ORANGE 60",
    "SellingPrice": 202
  }, {
    "Item Name": "SMINOFF ORANGE30",
    "SellingPrice": 101
  }, {
    "Item Name": "SMIRNOFF GREEN APPLE 180",
    "SellingPrice": 551
  }, {
    "Item Name": "SMIRNOFF GREEN APPLE 60",
    "SellingPrice": 202
  }, {
    "Item Name": "SMIRNOFF GREEN APPLE30",
    "SellingPrice": 101
  }, {
    "Item Name": "BOMBAY SAPHIRE 750",
    "SellingPrice": 4725
  }, {
    "Item Name": "BOMBAY SAPHIRE 30",
    "SellingPrice": 191
  }, {
    "Item Name": "BLUE RIBBAND 750",
    "SellingPrice": 877
  }, {
    "Item Name": "BLUE RIBBAND 60",
    "SellingPrice": 78
  }, {
    "Item Name": "BACCARDI WHITE 750",
    "SellingPrice": 2418
  }, {
    "Item Name": "BACCARDI WHITE 180",
    "SellingPrice": 585
  }, {
    "Item Name": "BACCARDI WHITE 60",
    "SellingPrice": 202
  }, {
    "Item Name": "BACCARDI WHITE 30",
    "SellingPrice": 101
  }, {
    "Item Name": "BACCARDI LEMON 180",
    "SellingPrice": 585
  }, {
    "Item Name": "BACCARDI LEMON 60",
    "SellingPrice": 202
  }, {
    "Item Name": "BACCARDI LEMON 30",
    "SellingPrice": 101
  }, {
    "Item Name": "BACCARDI ORANGE 180",
    "SellingPrice": 585
  }, {
    "Item Name": "BACCARDI ORANGE 60",
    "SellingPrice": 202
  }, {
    "Item Name": "BACCARDI LEMON 30",
    "SellingPrice": 101
  }, {
    "Item Name": "BACCARDI BLACK 180",
    "SellingPrice": 393
  }, {
    "Item Name": "BACCARDI BLACK 30",
    "SellingPrice": 67
  }, {
    "Item Name": "BACCARDI GOLD 180",
    "SellingPrice": 585
  }, {
    "Item Name": "BACCARDI GOLD30",
    "SellingPrice": 101
  }, {
    "Item Name": "OLD MONK 180",
    "SellingPrice": 225
  }, {
    "Item Name": "OLD MONK 90",
    "SellingPrice": 168
  }, {
    "Item Name": "OLD MONK 60",
    "SellingPrice": 90
  }, {
    "Item Name": "OLD MONK 30 ",
    "SellingPrice": 45
  }, {
    "Item Name": "DON ANGEL 750",
    "SellingPrice": 4668
  }, {
    "Item Name": "DON ANGEL 30",
    "SellingPrice": 191
  }, {
    "Item Name": "SAUZA SILVER 700",
    "SellingPrice": 6153
  }, {
    "Item Name": "SAUZA SILVER 30",
    "SellingPrice": 270
  }, {
    "Item Name": "JAGERBOMB",
    "SellingPrice": 506
  }, {
    "Item Name": "KAMAKAZI",
    "SellingPrice": 168
  }, {
    "Item Name": "JAGERMASTER",
    "SellingPrice": 303
  }, {
    "Item Name": "COINTTRAEU",
    "SellingPrice": 303
  }, {
    "Item Name": "SAMBUCA",
    "SellingPrice": 258
  }, {
    "Item Name": "KHALUA",
    "SellingPrice": 168
  }, {
    "Item Name": "MARTINI BLANCO",
    "SellingPrice": 90
  }, {
    "Item Name": "MARTINI ROSSO",
    "SellingPrice": 90
  }, {
    "Item Name": "HENESSY VS 700",
    "SellingPrice": 7875
  }, {
    "Item Name": "HENESSY VS 30",
    "SellingPrice": 348
  }, {
    "Item Name": "MORPHEUS 750",
    "SellingPrice": 2182
  }, {
    "Item Name": "MORPHEUS 180",
    "SellingPrice": 540
  }, {
    "Item Name": "MORPHEUS 60",
    "SellingPrice": 191
  }, {
    "Item Name": "MORPHEUS 30",
    "SellingPrice": 101
  }, {
    "Item Name": "MANSION HOUSE 180",
    "SellingPrice": 292
  }, {
    "Item Name": "MANSION HOUSE 90",
    "SellingPrice": 168
  }, {
    "Item Name": "MANSION HOUSE 60",
    "SellingPrice": 90
  }, {
    "Item Name": "MC BRANDY 60",
    "SellingPrice": 90
  }, {
    "Item Name": "RED BULL ",
    "SellingPrice": 157
  }, {
    "Item Name": "COKE",
    "SellingPrice": 45
  }, {
    "Item Name": "SPRITE",
    "SellingPrice": 45
  }, {
    "Item Name": "SODA",
    "SellingPrice": 33
  }, {
    "Item Name": "DIET COKE",
    "SellingPrice": 56
  }, {
    "Item Name": "TONIC WATER",
    "SellingPrice": 67
  }, {
    "Item Name": "GINGER ALE",
    "SellingPrice": 67
  }, {
    "Item Name": "LIME SODA",
    "SellingPrice": 45
  }, {
    "Item Name": "LIME WATER",
    "SellingPrice": 45
  }, {
    "Item Name": "PACKEGED WATER 1L",
    "SellingPrice": 39
  }, {
    "Item Name": "MANSION HOUSE 650",
    "SellingPrice": 900
  }, {
    "Item Name": "Chole Kulche",
    "SellingPrice": 80
  }, {
    "Item Name": "Butter Nan",
    "SellingPrice": 65
  }, {
    "Item Name": "Dhai",
    "SellingPrice": 20
  }, {
    "Item Name": "Rice",
    "SellingPrice": 55
  }, {
    "Item Name": "Plain rice",
    "SellingPrice": 30
  }, {
    "Item Name": "MANSION HOUSE 650",
    "SellingPrice": 900
  }, {
    "Item Name": "Chole Kulche",
    "SellingPrice": 80
  }, {
    "Item Name": "Butter Nan",
    "SellingPrice": 65
  }, {
    "Item Name": "Dhai",
    "SellingPrice": 20
  }, {
    "Item Name": "Rice",
    "SellingPrice": 55
  }, {
    "Item Name": "Plain rice",
    "SellingPrice": 30
  }]

  myFun();
  window.setInterval(showRows, 5000);
  showRows();

  function myFun() {
    addTable(tableValue);
  }

  function showRows() {
    // Any TRs that are not hidden and not already shown get "already-shown" applied
    $("tr:not(.hidden):not(.already-shown)").addClass("already-shown");
    // Then your previous code
    $(".hidden:lt(15)").removeClass("hidden"); // this one is to hide previous 5 rows and show next five
  }

  function addTable(tableValue) {
    var $tbl = $("
", {
        "class": "table"
      }),

      $tb = $("
"),
      $trh = $("
");

    var split = Math.round(tableValue.length / 4);
    for (i = 0; i < split; i++) {
      $tr = $("
", {
        class: "hidden"
      }); //ading class
      for (j = 0; j < 4; j++) {
        $.each(tableValue[split * j + i], function(key, value) {

          $("", {
            "class": "text-left color" + (j + 1)
          }).html(value).appendTo($tr);
        });
      }
      $tr.appendTo($tb);
    }
    $tbl.append($tb);
    $("#DisplayTable").html($tbl);
  }
});```
<pre class="snippet-code-css lang-css prettyprint-override"><code>tbody>tr>td {
  white-space: normal;
  border-collapse: collapse;
  font-family: Verdana;
  font-weight: bold;
  white-space: nowrap;
}

td {
  word-break: break-all;
}

.color1 {
  background: #4AD184;
}

.color2 {
  background: #EA69EF;
}

.color3 {
  background: #E1A558;
}

.color4 {
  background: #F4F065;
}

.hidden,
.already-shown {
  display: none;
}</code>```

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">

```

答:
Your css cdn link is wrong. there is no such file . Please replace with below cdn link.

```<code>  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
</code>```

Then you are rendering table inside another table which is wrong practice.

Please replace with below html

```<code><div class="container-fluid">
    <div class="row">
        <div class="col-12" id="DisplayTable">

        </div>
    </div>
</div>
</code>```

Add one more css

```<code>.fixed {
        table-layout: fixed;
   }
</code>```

Then add css class to your script

```<code>function addTable(tableValue) {
            var $tbl = $("<table />", {
                "class": "table fixed"
            }),
                    $tb = $("<tbody/>"),
                    $trh = $("<tr/>");

            var split = Math.round(tableValue.length / 4);
            for (i = 0; i < split; i++) {
                $tr = $("<tr/>", {
                    class: "hidden"
                }); //ading class
                for (j = 0; j < 4; j++) {
                    $.each(tableValue[split * j + i], function (key, value) {

                        $("<td/>", {
                            "class": "text-left color" + (j + 1)
                        }).html(value).appendTo($tr);
                    });
                }
                $tr.appendTo($tb);
            }
            $tbl.append($tb);
            $("#DisplayTable").html($tbl);
        }
</code>```

Body:
I am working on HTML table and i am stuck here for very long now, I have a requirement of displaying table into four columns/grid which i have done

Now when i am rendering the table i am displaying first 17 rows in one go than next 17 after five seconds

What is the issue

some ItemNames are big like BIG BANAYAN CARBINET SAUVIGNON BY GLASS

So when page is refreshing after five seconds the the column which contains this long name gets very large width which is not good to see as on UI

I am trying to make the width of each column uniform all four will have same width

So when the long ITEM NAME is coming what I am trying to do is to use word-wrap: normal; to break it after some width,but it is not working

I am dividing the four columns into equal part, which ever screen it is rendering the table it should be divided into 4 parts and when ITEMNAME is large i want to display it into same row but in new line after that exceeds the width of column

I think i have to give some sort of height to all the rows when it can accept one single small item name then it will show in single row but when the name is large it should show in same row but in two lines with same font

$(document).ready(function() {

  var tableValue = [{
    "Item Name": "MANCHOW  V SOUP",
    "SellingPrice": 100
  }, {
    "Item Name": "MANCHOW NV SOUP ",
    "SellingPrice": 125
  }, {
    "Item Name": "CEASER SALAD V",
    "SellingPrice": 175
  }, {
    "Item Name": "CEASER SALAD NV",
    "SellingPrice": 230
  }, {
    "Item Name": "GAMBUS REBOZADAS",
    "SellingPrice": 350
  }, {
    "Item Name": "PANCO FISH FINGER",
    "SellingPrice": 270
  }, {
    "Item Name": "MUSHROOM DUPLEX",
    "SellingPrice": 160
  }, {
    "Item Name": "FRENCH FRIES",
    "SellingPrice": 99
  }, {
    "Item Name": "HONEY GARLIC PRAWN",
    "SellingPrice": 350
  }, {
    "Item Name": "CHICKEN MANCHURIAN",
    "SellingPrice": 180
  }, {
    "Item Name": "MUSHROOM CHILLY",
    "SellingPrice": 120
  }, {
    "Item Name": "SALT N PEPPER BABY CORN",
    "SellingPrice": 120
  }, {
    "Item Name": "SOUTHERN STYLE CHICKEN",
    "SellingPrice": 210
  }, {
    "Item Name": "PANEER NAGGETS",
    "SellingPrice": 210
  }, {
    "Item Name": "HARA BHARA KEBAB",
    "SellingPrice": 160
  }, {
    "Item Name": "CHICKEN TIKKA",
    "SellingPrice": 210
  }, {
    "Item Name": "KALMI KEBAB",
    "SellingPrice": 250
  }, {
    "Item Name": "PIZZA MARGARITTA",
    "SellingPrice": 200
  }, {
    "Item Name": "PIZZA VEG FARMHOUSE",
    "SellingPrice": 200
  }, {
    "Item Name": "BBQ CHICKEN PIZZA",
    "SellingPrice": 225
  }, {
    "Item Name": "CHICKEN TIKKA PIZZA",
    "SellingPrice": 225
  }, {
    "Item Name": "PESTO SAUCE",
    "SellingPrice": 175
  }, {
    "Item Name": "ARABIATA",
    "SellingPrice": 160
  }, {
    "Item Name": "PINK SAUCE",
    "SellingPrice": 160
  }, {
    "Item Name": "GARBANZO BEAN SALAD",
    "SellingPrice": 90
  }, {
    "Item Name": "MASALA PAPAD",
    "SellingPrice": 50
  }, {
    "Item Name": "PEANUT MASALA",
    "SellingPrice": 60
  }, {
    "Item Name": "GAJAR KA HALWA",
    "SellingPrice": 90
  }, {
    "Item Name": "WATERMELON MARTINI",
    "SellingPrice": 281
  }, {
    "Item Name": "Kiwi martini",
    "SellingPrice": 281
  }, {
    "Item Name": " Apple gin",
    "SellingPrice": 225
  }, {
    "Item Name": "Cucumber  cooler ",
    "SellingPrice": 281
  }, {
    "Item Name": "Martini",
    "SellingPrice": 225
  }, {
    "Item Name": "Pink lady",
    "SellingPrice": 225
  }, {
    "Item Name": " Bloody marry",
    "SellingPrice": 281
  }, {
    "Item Name": "Cosmopolitan",
    "SellingPrice": 281
  }, {
    "Item Name": "Sex on the beach",
    "SellingPrice": 281
  }, {
    "Item Name": "Bull frog",
    "SellingPrice": 506
  }, {
    "Item Name": "Long  island iced tea ",
    "SellingPrice": 393
  }, {
    "Item Name": "Pinacolada",
    "SellingPrice": 225
  }, {
    "Item Name": "Daiquiri",
    "SellingPrice": 225
  }, {
    "Item Name": "Mojito ",
    "SellingPrice": 281
  }, {
    "Item Name": "Whisky sour",
    "SellingPrice": 281
  }, {
    "Item Name": "Hot toddy",
    "SellingPrice": 225
  }, {
    "Item Name": "Margarita",
    "SellingPrice": 337
  }, {
    "Item Name": "Tequila sunrise",
    "SellingPrice": 337
  }, {
    "Item Name": "Red sangria",
    "SellingPrice": 225
  }, {
    "Item Name": "White sangria",
    "SellingPrice": 247
  }, {
    "Item Name": "Rose sangria",
    "SellingPrice": 247
  }, {
    "Item Name": "By chance special ",
    "SellingPrice": 168
  }, {
    "Item Name": "Made in heaven",
    "SellingPrice": 168
  }, {
    "Item Name": "Strawberry delight",
    "SellingPrice": 168
  }, {
    "Item Name": "DRAGON",
    "SellingPrice": 168
  }, {
    "Item Name": "Mangochil ",
    "SellingPrice": 168
  }, {
    "Item Name": "Cucumber cola",
    "SellingPrice": 168
  }, {
    "Item Name": "Virgin mojito",
    "SellingPrice": 168
  }, {
    "Item Name": "Virgin mary",
    "SellingPrice": 168
  }, {
    "Item Name": "Virgin pinacolada",
    "SellingPrice": 168
  }, {
    "Item Name": "CORONA",
    "SellingPrice": 438
  }, {
    "Item Name": "CRAFT BEERS",
    "SellingPrice": 337
  }, {
    "Item Name": "BIRA WHITE 330",
    "SellingPrice": 157
  }, {
    "Item Name": "BIRA BLONDE 330",
    "SellingPrice": 135
  }, {
    "Item Name": "BIRA STRONG 650",
    "SellingPrice": 213
  }, {
    "Item Name": "KINGFISHER PREMIUM 330",
    "SellingPrice": 123
  }, {
    "Item Name": "KINGFISHER PREMIUM 650",
    "SellingPrice": 202
  }, {
    "Item Name": "KINGFISHER STRONG 330",
    "SellingPrice": 135
  }, {
    "Item Name": "KINGFISHER STRONG 650",
    "SellingPrice": 213
  }, {
    "Item Name": "KINGFISHER ULTRA 330",
    "SellingPrice": 146
  }, {
    "Item Name": "KINGFISHER ULTRA 650",
    "SellingPrice": 281
  }, {
    "Item Name": "KINGFISHER ULTRA MAX 330",
    "SellingPrice": 146
  }, {
    "Item Name": "KINGFISHER ULTRA MAX 650",
    "SellingPrice": 281
  }, {
    "Item Name": "BUDWIESER 330",
    "SellingPrice": 146
  }, {
    "Item Name": "BUDWIESER 650",
    "SellingPrice": 270
  }, {
    "Item Name": "BUDWIESER MAGNUM 330",
    "SellingPrice": 168
  }, {
    "Item Name": "BUDWIESER MAGNUM 650",
    "SellingPrice": 281
  }, {
    "Item Name": "TUBORG 330",
    "SellingPrice": 123
  }, {
    "Item Name": "TUBORG 650",
    "SellingPrice": 191
  }, {
    "Item Name": "TUBORG STRONG 330",
    "SellingPrice": 123
  }, {
    "Item Name": "TUBORG STRONG 650",
    "SellingPrice": 213
  }, {
    "Item Name": "CRANBERRY ",
    "SellingPrice": 157
  }, {
    "Item Name": "ORANGE",
    "SellingPrice": 157
  }, {
    "Item Name": "JAMICAN",
    "SellingPrice": 157
  }, {
    "Item Name": "BLACK BERRY",
    "SellingPrice": 157
  }, {
    "Item Name": "BLUE BERRY",
    "SellingPrice": 157
  }, {
    "Item Name": "MOET CHANDON",
    "SellingPrice": 7875
  }, {
    "Item Name": "SULA BRUT",
    "SellingPrice": 1687
  }, {
    "Item Name": "MATEUS ROSE",
    "SellingPrice": 2137
  }, {
    "Item Name": "HARDYS SIRAZ CABERNET 750",
    "SellingPrice": 1890
  }, {
    "Item Name": "HARDYS SIRAZ CABERNET BY GLASS",
    "SellingPrice": 382
  }, {
    "Item Name": "JACOB CREEK SIRAZ 750",
    "SellingPrice": 1800
  }, {
    "Item Name": "JACOB CREEK SIRAZ BY GLASS",
    "SellingPrice": 360
  }, {
    "Item Name": "BIG BANAYAN CHENNIN BLANC 750",
    "SellingPrice": 990
  }, {
    "Item Name": "BIG BANAYAN CHENNIN BLANC BY GLASS",
    "SellingPrice": 202
  }, {
    "Item Name": "SULA CHENIN BLANC 750 ",
    "SellingPrice": 1293
  }, {
    "Item Name": "SULA CHENIN BLANC BY GLASS",
    "SellingPrice": 258
  }, {
    "Item Name": "FOUR SEAZON CLASSIC CHENNIN BLANC 7",
    "SellingPrice": 1125
  }, {
    "Item Name": "FOUR SEAZON CLASSIC CHENNIN BLANC B",
    "SellingPrice": 225
  }, {
    "Item Name": "BIG BANAYAN CARBINET SAUVIGNON 750",
    "SellingPrice": 1125
  }, {
    "Item Name": "BIG BANAYAN CARBINET SAUVIGNON BY G",
    "SellingPrice": 225
  }, {
    "Item Name": "SULA SATORI MERLOT 750",
    "SellingPrice": 1237
  }, {
    "Item Name": "SULA SATORI MERLOT BY GLASS",
    "SellingPrice": 247
  }, {
    "Item Name": "GROVERS LA RESERVE 750",
    "SellingPrice": 1800
  }, {
    "Item Name": "GROVERS LA RESERVE 100",
    "SellingPrice": 360
  }, {
    "Item Name": "GLENFIDDICH 12 YEARS 700 ",
    "SellingPrice": 9225
  }, {
    "Item Name": "GLENFIDDICH 12 YEARS 30",
    "SellingPrice": 405
  }, {
    "Item Name": "TALISKER 750",
    "SellingPrice": 8775
  }, {
    "Item Name": "TALISKER 30",
    "SellingPrice": 360
  }, {
    "Item Name": "GLENNLIVET 750",
    "SellingPrice": 8887
  }, {
    "Item Name": "GLENNLIVET 30",
    "SellingPrice": 360
  }, {
    "Item Name": "THE SINGLETON 750",
    "SellingPrice": 7942
  }, {
    "Item Name": "THE SINGLETON 30",
    "SellingPrice": 326
  }, {
    "Item Name": "AMRUT FUSION 750",
    "SellingPrice": 5062
  }, {
    "Item Name": "AMRUT FUSION 30",
    "SellingPrice": 202
  }, {
    "Item Name": "JACK DANIELS 750",
    "SellingPrice": 7312
  }, {
    "Item Name": "JACK DANIELS 30",
    "SellingPrice": 292
  }, {
    "Item Name": "JIM BEAM WHITE 750",
    "SellingPrice": 4095
  }, {
    "Item Name": "JIM BEAM WHITE 30",
    "SellingPrice": 168
  }, {
    "Item Name": "JAMESON 750",
    "SellingPrice": 4950
  }, {
    "Item Name": "JAMESON 30",
    "SellingPrice": 202
  }, {
    "Item Name": "JW BLACK LABEL 750",
    "SellingPrice": 8212
  }, {
    "Item Name": "JW BLACK LABEL 200",
    "SellingPrice": 2925
  }, {
    "Item Name": "JW BLACK LABEL 30",
    "SellingPrice": 337
  }, {
    "Item Name": "JW RED LABEL 200",
    "SellingPrice": 1158
  }, {
    "Item Name": "BALLENTINSE FINEST BLENDED 750",
    "SellingPrice": 4545
  }, {
    "Item Name": "BALLENTINSE FINEST BLENDED 30",
    "SellingPrice": 180
  }, {
    "Item Name": "BLACK \u0026 WHITE 375",
    "SellingPrice": 1575
  }, {
    "Item Name": "BLACK \u0026 WHITE 180",
    "SellingPrice": 787
  }, {
    "Item Name": "BLACK \u0026 WHITE 60",
    "SellingPrice": 258
  }, {
    "Item Name": "BLACK \u0026 WHITE 30",
    "SellingPrice": 135
  }, {
    "Item Name": "100 PIPERS 180",
    "SellingPrice": 787
  }, {
    "Item Name": "100 PIPERS 60",
    "SellingPrice": 258
  }, {
    "Item Name": "100 PIPERS 30",
    "SellingPrice": 135
  }, {
    "Item Name": "VAT 69 180",
    "SellingPrice": 675
  }, {
    "Item Name": "VAT 69 60",
    "SellingPrice": 225
  }, {
    "Item Name": "VAT 69 30",
    "SellingPrice": 112
  }, {
    "Item Name": "TEACHERS HIGHLAND 180",
    "SellingPrice": 787
  }, {
    "Item Name": "TEACHERS HIGHLAND 60",
    "SellingPrice": 258
  }, {
    "Item Name": "TEACHERS HIGHLAND 30",
    "SellingPrice": 135
  }, {
    "Item Name": "TEACHERS 50 60",
    "SellingPrice": 393
  }, {
    "Item Name": "TEACHERS 50 30",
    "SellingPrice": 202
  }, {
    "Item Name": "BLACK DOG TRIPPLE GOLD 180",
    "SellingPrice": 1215
  }, {
    "Item Name": "BLACK DOG TRIPPLE GOLD 30",
    "SellingPrice": 213
  }, {
    "Item Name": "BLACK DOG 8 YEARS 180",
    "SellingPrice": 731
  }, {
    "Item Name": "BLACK DOG 8 YEARS 60",
    "SellingPrice": 247
  }, {
    "Item Name": "BLACK DOG 8 YEARS 30",
    "SellingPrice": 123
  }, {
    "Item Name": "BLENDERS PRIDE 750",
    "SellingPrice": 2283
  }, {
    "Item Name": "BLENDERS PRIDE 375",
    "SellingPrice": 1147
  }, {
    "Item Name": "BLENDERS PRIDE 180",
    "SellingPrice": 573
  }, {
    "Item Name": "BLENDERS PRIDE 60",
    "SellingPrice": 191
  }, {
    "Item Name": "BLENDERS PRIDE 30",
    "SellingPrice": 90
  }, {
    "Item Name": "SIGNATURE 180",
    "SellingPrice": 450
  }, {
    "Item Name": "SIGNATURE 60",
    "SellingPrice": 168
  }, {
    "Item Name": "SIGNATURE 30",
    "SellingPrice": 90
  }, {
    "Item Name": "GREY GOOSE 750",
    "SellingPrice": 8190
  }, {
    "Item Name": "GREY GOOSE 30",
    "SellingPrice": 326
  }, {
    "Item Name": "BELVEDERE 700",
    "SellingPrice": 8122
  }, {
    "Item Name": "BELVEDERE 30",
    "SellingPrice": 360
  }, {
    "Item Name": "CIROC 750",
    "SellingPrice": 7425
  }, {
    "Item Name": "CIROC 30",
    "SellingPrice": 303
  }, {
    "Item Name": "ABSOLUT 750",
    "SellingPrice": 4556
  }, {
    "Item Name": "ABSOLUT 30",
    "SellingPrice": 191
  }, {
    "Item Name": "SMIRNOFF RED 180",
    "SellingPrice": 551
  }, {
    "Item Name": "SMIRNOFF RED 60",
    "SellingPrice": 202
  }, {
    "Item Name": "SMIRNOFF RED30",
    "SellingPrice": 101
  }, {
    "Item Name": "SMIRNOFF ORANGE 180",
    "SellingPrice": 551
  }, {
    "Item Name": "SMIRNOFF ORANGE 60",
    "SellingPrice": 202
  }, {
    "Item Name": "SMINOFF ORANGE30",
    "SellingPrice": 101
  }, {
    "Item Name": "SMIRNOFF GREEN APPLE 180",
    "SellingPrice": 551
  }, {
    "Item Name": "SMIRNOFF GREEN APPLE 60",
    "SellingPrice": 202
  }, {
    "Item Name": "SMIRNOFF GREEN APPLE30",
    "SellingPrice": 101
  }, {
    "Item Name": "BOMBAY SAPHIRE 750",
    "SellingPrice": 4725
  }, {
    "Item Name": "BOMBAY SAPHIRE 30",
    "SellingPrice": 191
  }, {
    "Item Name": "BLUE RIBBAND 750",
    "SellingPrice": 877
  }, {
    "Item Name": "BLUE RIBBAND 60",
    "SellingPrice": 78
  }, {
    "Item Name": "BACCARDI WHITE 750",
    "SellingPrice": 2418
  }, {
    "Item Name": "BACCARDI WHITE 180",
    "SellingPrice": 585
  }, {
    "Item Name": "BACCARDI WHITE 60",
    "SellingPrice": 202
  }, {
    "Item Name": "BACCARDI WHITE 30",
    "SellingPrice": 101
  }, {
    "Item Name": "BACCARDI LEMON 180",
    "SellingPrice": 585
  }, {
    "Item Name": "BACCARDI LEMON 60",
    "SellingPrice": 202
  }, {
    "Item Name": "BACCARDI LEMON 30",
    "SellingPrice": 101
  }, {
    "Item Name": "BACCARDI ORANGE 180",
    "SellingPrice": 585
  }, {
    "Item Name": "BACCARDI ORANGE 60",
    "SellingPrice": 202
  }, {
    "Item Name": "BACCARDI LEMON 30",
    "SellingPrice": 101
  }, {
    "Item Name": "BACCARDI BLACK 180",
    "SellingPrice": 393
  }, {
    "Item Name": "BACCARDI BLACK 30",
    "SellingPrice": 67
  }, {
    "Item Name": "BACCARDI GOLD 180",
    "SellingPrice": 585
  }, {
    "Item Name": "BACCARDI GOLD30",
    "SellingPrice": 101
  }, {
    "Item Name": "OLD MONK 180",
    "SellingPrice": 225
  }, {
    "Item Name": "OLD MONK 90",
    "SellingPrice": 168
  }, {
    "Item Name": "OLD MONK 60",
    "SellingPrice": 90
  }, {
    "Item Name": "OLD MONK 30 ",
    "SellingPrice": 45
  }, {
    "Item Name": "DON ANGEL 750",
    "SellingPrice": 4668
  }, {
    "Item Name": "DON ANGEL 30",
    "SellingPrice": 191
  }, {
    "Item Name": "SAUZA SILVER 700",
    "SellingPrice": 6153
  }, {
    "Item Name": "SAUZA SILVER 30",
    "SellingPrice": 270
  }, {
    "Item Name": "JAGERBOMB",
    "SellingPrice": 506
  }, {
    "Item Name": "KAMAKAZI",
    "SellingPrice": 168
  }, {
    "Item Name": "JAGERMASTER",
    "SellingPrice": 303
  }, {
    "Item Name": "COINTTRAEU",
    "SellingPrice": 303
  }, {
    "Item Name": "SAMBUCA",
    "SellingPrice": 258
  }, {
    "Item Name": "KHALUA",
    "SellingPrice": 168
  }, {
    "Item Name": "MARTINI BLANCO",
    "SellingPrice": 90
  }, {
    "Item Name": "MARTINI ROSSO",
    "SellingPrice": 90
  }, {
    "Item Name": "HENESSY VS 700",
    "SellingPrice": 7875
  }, {
    "Item Name": "HENESSY VS 30",
    "SellingPrice": 348
  }, {
    "Item Name": "MORPHEUS 750",
    "SellingPrice": 2182
  }, {
    "Item Name": "MORPHEUS 180",
    "SellingPrice": 540
  }, {
    "Item Name": "MORPHEUS 60",
    "SellingPrice": 191
  }, {
    "Item Name": "MORPHEUS 30",
    "SellingPrice": 101
  }, {
    "Item Name": "MANSION HOUSE 180",
    "SellingPrice": 292
  }, {
    "Item Name": "MANSION HOUSE 90",
    "SellingPrice": 168
  }, {
    "Item Name": "MANSION HOUSE 60",
    "SellingPrice": 90
  }, {
    "Item Name": "MC BRANDY 60",
    "SellingPrice": 90
  }, {
    "Item Name": "RED BULL ",
    "SellingPrice": 157
  }, {
    "Item Name": "COKE",
    "SellingPrice": 45
  }, {
    "Item Name": "SPRITE",
    "SellingPrice": 45
  }, {
    "Item Name": "SODA",
    "SellingPrice": 33
  }, {
    "Item Name": "DIET COKE",
    "SellingPrice": 56
  }, {
    "Item Name": "TONIC WATER",
    "SellingPrice": 67
  }, {
    "Item Name": "GINGER ALE",
    "SellingPrice": 67
  }, {
    "Item Name": "LIME SODA",
    "SellingPrice": 45
  }, {
    "Item Name": "LIME WATER",
    "SellingPrice": 45
  }, {
    "Item Name": "PACKEGED WATER 1L",
    "SellingPrice": 39
  }, {
    "Item Name": "MANSION HOUSE 650",
    "SellingPrice": 900
  }, {
    "Item Name": "Chole Kulche",
    "SellingPrice": 80
  }, {
    "Item Name": "Butter Nan",
    "SellingPrice": 65
  }, {
    "Item Name": "Dhai",
    "SellingPrice": 20
  }, {
    "Item Name": "Rice",
    "SellingPrice": 55
  }, {
    "Item Name": "Plain rice",
    "SellingPrice": 30
  }, {
    "Item Name": "MANSION HOUSE 650",
    "SellingPrice": 900
  }, {
    "Item Name": "Chole Kulche",
    "SellingPrice": 80
  }, {
    "Item Name": "Butter Nan",
    "SellingPrice": 65
  }, {
    "Item Name": "Dhai",
    "SellingPrice": 20
  }, {
    "Item Name": "Rice",
    "SellingPrice": 55
  }, {
    "Item Name": "Plain rice",
    "SellingPrice": 30
  }]

  myFun();
  window.setInterval(showRows, 5000);
  showRows();

  function myFun() {
    addTable(tableValue);
  }

  function showRows() {
    // Any TRs that are not hidden and not already shown get "already-shown" applied
    $("tr:not(.hidden):not(.already-shown)").addClass("already-shown");
    // Then your previous code
    $(".hidden:lt(15)").removeClass("hidden"); // this one is to hide previous 5 rows and show next five
  }

  function addTable(tableValue) {
    var $tbl = $("
", {
        "class": "table"
      }),

      $tb = $("
"),
      $trh = $("
");

    var split = Math.round(tableValue.length / 4);
    for (i = 0; i < split; i++) {
      $tr = $("
", {
        class: "hidden"
      }); //ading class
      for (j = 0; j < 4; j++) {
        $.each(tableValue[split * j + i], function(key, value) {

          $("", {
            "class": "text-left color" + (j + 1)
          }).html(value).appendTo($tr);
        });
      }
      $tr.appendTo($tb);
    }
    $tbl.append($tb);
    $("#DisplayTable").html($tbl);
  }
});

tbody>tr>td {
  white-space: normal;
  border-collapse: collapse;
  font-family: Verdana;
  font-weight: bold;
  white-space: nowrap;
}

td {
  word-break: break-all;
}

.color1 {
  background: #4AD184;
}

.color2 {
  background: #EA69EF;
}

.color3 {
  background: #E1A558;
}

.color4 {
  background: #F4F065;
}

.hidden,
.already-shown {
  display: none;
}

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">

Body:
Your css cdn link is wrong. there is no such file . Please replace with below cdn link.

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">

Then you are rendering table inside another table which is wrong practice.

Please replace with below html

<div class="container-fluid">
    <div class="row">
        <div class="col-12" id="DisplayTable">

        </div>
    </div>
</div>

Add one more css

.fixed {
        table-layout: fixed;
   }

Then add css class to your script

function addTable(tableValue) {
            var $tbl = $("<table />", {
                "class": "table fixed"
            }),
                    $tb = $("<tbody/>"),
                    $trh = $("<tr/>");

            var split = Math.round(tableValue.length / 4);
            for (i = 0; i < split; i++) {
                $tr = $("<tr/>", {
                    class: "hidden"
                }); //ading class
                for (j = 0; j < 4; j++) {
                    $.each(tableValue[split * j + i], function (key, value) {

                        $("<td/>", {
                            "class": "text-left color" + (j + 1)
                        }).html(value).appendTo($tr);
                    });
                }
                $tr.appendTo($tb);
            }
            $tbl.append($tb);
            $("#DisplayTable").html($tbl);
        }


问:
Is there a way to select all elements from xmlvalue.value method instead of specifying [1]
I want to access all instances and not specify in XMLvalues.value method like 1

I have joined the nodes using outer apply but I need to specify instances number

```<code>SELECT
        Id                                                            ,
        XmlValues2.value('(date1)[1]', 'DateTime')  AS date1 ,
        XmlValues.value('(name)[1]', 'varchar(1299)')    AS bank   ,
        XmlValues.value('(country)[1]', 'varchar(1299)') AS Country    ,
FROM
        Temp_board I OUTER APPLY I.board.nodes('/Report/basicInfo/report') AS xmlTableInner(XmlValues2)
        OUTER APPLY XmlValues2.nodes('/Report/basicInfo/bank') AS xmlTable(XmlValues)
WHERE
        Id ='235908235'
</code>```

So I want the result of all nodes elements and not just the first instant

Attached screenshot of xml.I want to access all instances of transactions.XML example

答:
For your next question please try to set up a MCVE. This is a stand along self-running example to reproduce your issue. And please do not provide code or data as pictures. This means, that somebody else has to type this in...

It is probleamtic, that the XML's picture does not inlcude the root tag and eventually existing namespaces. Furthermore, the targeted <Transaction> elements are completely empty in your picture... Furthermore, the code you provide in your question has nothing to do with the XML you show...

I think you can understand, that everything must be pure guessing and my magic crystall ball is out for cleaning at the moment ;-)

This time I do the mcve for you. A lot is just guessing to show the principles. Try this out and try to adopt it for your actual issues:

Declare a mockup-XML:

```<code>DECLARE @xml XML=
N'<SomeRootNode>
      <accountList>
        <Transaction SomeAttribute="blah1">
          <SomeSubElement subAttr="sub1">element1</SomeSubElement>
        </Transaction>
        <Transaction SomeAttribute="blah2">
          <SomeSubElement subAttr="sub2">element2</SomeSubElement>
        </Transaction>
        <Transaction SomeAttribute="blah3">
          <SomeSubElement subAttr="sub3">element3</SomeSubElement>
        </Transaction>
      </accountList>
    </SomeRootNode>';
</code>```

--The query

```<code>SELECT tr.value('@SomeAttribute','varchar(100)') TheAttributeInTransactionElement
      ,tr.value('(SomeSubElement/@subAttr)[1]','varchar(100)') TheAttributeInTheSubElement
      ,tr.value('(SomeSubElement/text())[1]','varchar(100)') TheSubElementsContent
FROM @xml.nodes('/SomeRootNode/accountList/Transaction') A(tr);
</code>```

The idea in short:

 - .nodes() will dive into <SomeRootNode>, deeper into <accountList> and will return all <Transaction> elements found at this level
 - The result of .nodes() is a derived table called A with one single XML-typed column tr, representing each Transaction in a single row.
 - The .value() can pick attributes directly
 - The .value() can use any kind of XPath/XQuery to fetch values from within the structure.

UPDATE Your XML has one more level Account

Try this

```<code>DECLARE @xml XML=
N'<SomeRootNode>
      <accountList>
       <Account>
        <number>1</number>
        <Transaction SomeAttribute="blah1">
          <SomeSubElement subAttr="sub1">element1</SomeSubElement>
        </Transaction>
        <Transaction SomeAttribute="blah2">
          <SomeSubElement subAttr="sub2">element2</SomeSubElement>
        </Transaction>
        <Transaction SomeAttribute="blah3">
          <SomeSubElement subAttr="sub3">element3</SomeSubElement>
        </Transaction>
       </Account>
       <Account>
        <number>2</number>
        <Transaction SomeAttribute="blah2-1">
          <SomeSubElement subAttr="sub2-1">element2-1</SomeSubElement>
        </Transaction>
        <Transaction SomeAttribute="blah2-2">
          <SomeSubElement subAttr="sub2-2">element2-2</SomeSubElement>
        </Transaction>
        <Transaction SomeAttribute="blah2-3">
          <SomeSubElement subAttr="sub2-3">element2-3</SomeSubElement>
        </Transaction>
       </Account>
      </accountList>
    </SomeRootNode>';

SELECT acc.value('(number/text())[1]','int') AccountNumber
      ,tr.value('@SomeAttribute','varchar(100)') TheAttributeInTransactionElement
      ,tr.value('(SomeSubElement/@subAttr)[1]','varchar(100)') TheAttributeInTheSubElement
      ,tr.value('(SomeSubElement/text())[1]','varchar(100)') TheSubElementsContent
FROM @xml.nodes('/SomeRootNode/accountList/Account') A(acc)
OUTER APPLY A.acc.nodes('Transaction') B(tr);
</code>```

Now we can use two calls to .nodes(). The first will return all <Account> elements within <accountList>, the second will return the nested <Transaction> elements as it is working with A.acc as input.

Body:
I want to access all instances and not specify in XMLvalues.value method like 1

I have joined the nodes using outer apply but I need to specify instances number

SELECT
        Id                                                            ,
        XmlValues2.value('(date1)[1]', 'DateTime')  AS date1 ,
        XmlValues.value('(name)[1]', 'varchar(1299)')    AS bank   ,
        XmlValues.value('(country)[1]', 'varchar(1299)') AS Country    ,
FROM
        Temp_board I OUTER APPLY I.board.nodes('/Report/basicInfo/report') AS xmlTableInner(XmlValues2)
        OUTER APPLY XmlValues2.nodes('/Report/basicInfo/bank') AS xmlTable(XmlValues)
WHERE
        Id ='235908235'

So I want the result of all nodes elements and not just the first instant

Attached screenshot of xml.I want to access all instances of transactions.XML example

Body:
For your next question please try to set up a MCVE. This is a stand along self-running example to reproduce your issue. And please do not provide code or data as pictures. This means, that somebody else has to type this in...

It is probleamtic, that the XML's picture does not inlcude the root tag and eventually existing namespaces. Furthermore, the targeted <Transaction> elements are completely empty in your picture... Furthermore, the code you provide in your question has nothing to do with the XML you show...

I think you can understand, that everything must be pure guessing and my magic crystall ball is out for cleaning at the moment ;-)

This time I do the mcve for you. A lot is just guessing to show the principles. Try this out and try to adopt it for your actual issues:

Declare a mockup-XML:

DECLARE @xml XML=
N'<SomeRootNode>
      <accountList>
        <Transaction SomeAttribute="blah1">
          <SomeSubElement subAttr="sub1">element1</SomeSubElement>
        </Transaction>
        <Transaction SomeAttribute="blah2">
          <SomeSubElement subAttr="sub2">element2</SomeSubElement>
        </Transaction>
        <Transaction SomeAttribute="blah3">
          <SomeSubElement subAttr="sub3">element3</SomeSubElement>
        </Transaction>
      </accountList>
    </SomeRootNode>';

--The query

SELECT tr.value('@SomeAttribute','varchar(100)') TheAttributeInTransactionElement
      ,tr.value('(SomeSubElement/@subAttr)[1]','varchar(100)') TheAttributeInTheSubElement
      ,tr.value('(SomeSubElement/text())[1]','varchar(100)') TheSubElementsContent
FROM @xml.nodes('/SomeRootNode/accountList/Transaction') A(tr);

The idea in short:

 - .nodes() will dive into <SomeRootNode>, deeper into <accountList> and will return all <Transaction> elements found at this level
 - The result of .nodes() is a derived table called A with one single XML-typed column tr, representing each Transaction in a single row.
 - The .value() can pick attributes directly
 - The .value() can use any kind of XPath/XQuery to fetch values from within the structure.

UPDATE Your XML has one more level Account

Try this

DECLARE @xml XML=
N'<SomeRootNode>
      <accountList>
       <Account>
        <number>1</number>
        <Transaction SomeAttribute="blah1">
          <SomeSubElement subAttr="sub1">element1</SomeSubElement>
        </Transaction>
        <Transaction SomeAttribute="blah2">
          <SomeSubElement subAttr="sub2">element2</SomeSubElement>
        </Transaction>
        <Transaction SomeAttribute="blah3">
          <SomeSubElement subAttr="sub3">element3</SomeSubElement>
        </Transaction>
       </Account>
       <Account>
        <number>2</number>
        <Transaction SomeAttribute="blah2-1">
          <SomeSubElement subAttr="sub2-1">element2-1</SomeSubElement>
        </Transaction>
        <Transaction SomeAttribute="blah2-2">
          <SomeSubElement subAttr="sub2-2">element2-2</SomeSubElement>
        </Transaction>
        <Transaction SomeAttribute="blah2-3">
          <SomeSubElement subAttr="sub2-3">element2-3</SomeSubElement>
        </Transaction>
       </Account>
      </accountList>
    </SomeRootNode>';

SELECT acc.value('(number/text())[1]','int') AccountNumber
      ,tr.value('@SomeAttribute','varchar(100)') TheAttributeInTransactionElement
      ,tr.value('(SomeSubElement/@subAttr)[1]','varchar(100)') TheAttributeInTheSubElement
      ,tr.value('(SomeSubElement/text())[1]','varchar(100)') TheSubElementsContent
FROM @xml.nodes('/SomeRootNode/accountList/Account') A(acc)
OUTER APPLY A.acc.nodes('Transaction') B(tr);

Now we can use two calls to .nodes(). The first will return all <Account> elements within <accountList>, the second will return the nested <Transaction> elements as it is working with A.acc as input.


问:
Convert string with commas to array
How can I convert a string to a JavaScript array?

Look at the code:

```<code>var string = "0,1";
var array = [string];
alert(array[0]);
</code>```

In this case alert shows 0,1. If it where an array, it would show 0. And if alert(array[1]) is called, it should pop-up 1

Is there any chance to convert such string into a JavaScript array?

答:
Example using Array.filter:

```<code>var str = 'a,b,hi,ma,n,yu';

var strArr = Array.prototype.filter.call(str, eachChar => eachChar !== ',');
</code>```

Title: Convert string with commas to array

Body:
How can I convert a string to a JavaScript array?

Look at the code:

var string = "0,1";
var array = [string];
alert(array[0]);

In this case alert shows 0,1. If it where an array, it would show 0. And if alert(array[1]) is called, it should pop-up 1

Is there any chance to convert such string into a JavaScript array?

Body:
Example using Array.filter:

var str = 'a,b,hi,ma,n,yu';

var strArr = Array.prototype.filter.call(str, eachChar => eachChar !== ',');


问:
How does the biuld task of a UWP App on azure Pipelines knows the name of the certificate to use?
When building a UWP app on Azure Pipelines, I had an error about the .pfx file not found. My pfx had another name.

Hence my questions:

how does the build task know what pfx file to take? Is there a naming convention?

Can I explictly specify another file to use?

答: The Package.appxmanifest file of the UWP app has a Packaging tab where we can specify the package. This is how the association is made and hence how the build task knows which cert file to use.</p>


问:
Plantuml Rendering Differences Online and Locally
Using plantuml's online renderer, consider the following diagram:

specified by the following code:

```<code>@startuml
title
  FooBar
endtitle
cloud Cloud {
node "Machine" #beige {
  node OPT #yellow [
    Optimizer
    ]
  }
}

node Torch #yellow

OPT    ==> Torch  : response
Torch  ==> OPT    : request
@enduml
</code>```

However, when I render the exact same code (copy-pasted) on my local machine, I get a scrunchy, ugly, unacceptable rendering:

```<code>$ cat > hairball.txt
 <<< paste the above text >>>
$ plantuml hairball.txt
$ xdg-open hairball.png
</code>```

I have the latest versions of dot and plantuml on my ubuntu machine:

```<code>$ dot -V
dot - graphviz version 2.40.1 (20161225.0304)
$ plantuml -v
(0.000 - 1008 Mo) 1000 Mo - PlantUML Version 1.2019.05
</code>```

I'm out of ideas about how to diagnose and fix this and would be grateful for help.

答:
how about:

download PyCharm

Install Plugins: PlantUML integration

Settings → Plugins → Search "PlantUML integration" → Install

Pycharm → Settings → Other Settings → PlantUML → "Graphviz doe executable: your dot.exe path"

test.puml

It looks fine.

Body:
Using plantuml's online renderer, consider the following diagram:

specified by the following code:

@startuml
title
  FooBar
endtitle
cloud Cloud {
node "Machine" #beige {
  node OPT #yellow [
    Optimizer
    ]
  }
}

node Torch #yellow

OPT    ==> Torch  : response
Torch  ==> OPT    : request
@enduml

However, when I render the exact same code (copy-pasted) on my local machine, I get a scrunchy, ugly, unacceptable rendering:

$ cat > hairball.txt
 <<< paste the above text >>>
$ plantuml hairball.txt
$ xdg-open hairball.png

I have the latest versions of dot and plantuml on my ubuntu machine:

$ dot -V
dot - graphviz version 2.40.1 (20161225.0304)
$ plantuml -v
(0.000 - 1008 Mo) 1000 Mo - PlantUML Version 1.2019.05

I'm out of ideas about how to diagnose and fix this and would be grateful for help.


问:
std::bind overload resolution
The following code works fine

```<code>#include <functional>

using namespace std;
using namespace std::placeholders;

class A
{
  int operator()( int i, int j ) { return i - j; }
};

A a;
auto aBind = bind( &A::operator(), ref(a), _2, _1 );
</code>```

This does not

```<code>#include <functional>

using namespace std;
using namespace std::placeholders;

class A
{
  int operator()( int i, int j ) { return i - j; }
  int operator()( int i ) { return -i; }
};

A a;
auto aBind = bind( &A::operator(), ref(a), _2, _1 );
</code>```

I have tried playing around with the syntax to try and explicitly resolve which function I want in the code that does not work without luck so far.  How do I write the bind line in order to choose the call that takes the two integer arguments?

答:
There are some "lift" macros available that automate passing overload sets as parameters by wrapping them into a lambda that simply forwards all parameters passed to it. One that is provided by Boost can make the code compile via

```<code>#include <boost/hof/lift.hpp>

auto aBind = bind(BOOST_HOF_LIFT(&A::operator()), ref(a), _2, _1 );
</code>```

There are also proposals for making it easier to pass overload sets, see e.g. P0834, but I don't know whether this will find or found consensus.

ContentLicense: CC BY-SA 2.5

Title: std::bind overload resolution

Body:
The following code works fine

#include <functional>

using namespace std;
using namespace std::placeholders;

class A
{
  int operator()( int i, int j ) { return i - j; }
};

A a;
auto aBind = bind( &A::operator(), ref(a), _2, _1 );

This does not

#include <functional>

using namespace std;
using namespace std::placeholders;

class A
{
  int operator()( int i, int j ) { return i - j; }
  int operator()( int i ) { return -i; }
};

A a;
auto aBind = bind( &A::operator(), ref(a), _2, _1 );

I have tried playing around with the syntax to try and explicitly resolve which function I want in the code that does not work without luck so far.  How do I write the bind line in order to choose the call that takes the two integer arguments?

Body:
There are some "lift" macros available that automate passing overload sets as parameters by wrapping them into a lambda that simply forwards all parameters passed to it. One that is provided by Boost can make the code compile via

#include <boost/hof/lift.hpp>

auto aBind = bind(BOOST_HOF_LIFT(&A::operator()), ref(a), _2, _1 );

There are also proposals for making it easier to pass overload sets, see e.g. P0834, but I don't know whether this will find or found consensus.


问:
p:messages displays but disapear almost instantly
i have a strange problem with a p:message tag. On page a have a dataTable with data from my db that i can edit in a p:dialog. Once all validations succeds and the update in db is done i refresh the dataTable and add a faces message info to display the succes of the operation. In the front-end i update the form whom contains both the dataTable and the dialog. My problem is that the message is displayed but almost instantly disapears. It's like the message tag is updated with the form. I don't get it.

I have tried to move the message tag in & out of the form in didn't change anything.
I have tried to tweak the remoteCommand to update just the dataTable and the dialog but it didn't work.

```<code><p:messages autoUpdate="true" showDetail="true" severity="info,error" />
<h:form id="form">
    <p:dataTable
    style="width: 80%; margin-left: auto; margin-right: auto; text-align:center"
        var="achievement" value="#{achievementBean.listAchievement}">
    ...
    </p:dataTable>

    <p:dialog header="#{i18n['achievement']}" widgetVar="dlg"
        dynamic="true" closable="false" resizable="false" showEffect="fade"
        hideEffect="fade">
        <h:panelGroup id="achievementDetail">
            <p:messages autoUpdate="true" severity="warn" />
            ...
            <h:panelGrid columns="2" style="width: 100%; text-align:center">
                <p:commandButton value="#{i18n['general.submit']}"
                    icon="fa fa-check"
                    actionListener="#{achievementBean.submitAchievement}"
                    oncomplete="if(!args.validationFailed){updateForm();}" />
                <p:commandButton value="#{i18n['general.cancel']}"
                    icon="fa fa-close" action="#{achievementBean.submitCancel}"
                    oncomplete="PF('dlg').hide();" update="@form" process="@this" />
            </h:panelGrid>
            <p:remoteCommand name="updateForm" update="@form" />
        </h:panelGroup>
    </p:dialog>
</h:form>
</code>```

答:
Your concrete problem boils down to this:

```<code><p:messages autoUpdate="true" />

<h:form>
    <p:dataTable ...>
       ...
    </p:dataTable>
    ...
    <p:dialog>
        ...
        <p:commandButton
            action="#{achievementBean.submitAchievement}"
            oncomplete="if(!args.validationFailed){updateForm();}" />
        <p:remoteCommand name="updateForm" update="@form" />
    </p:dialog>
</h:form>
</code>```

The autoUpdate="true" will automatically update the component on every ajax request.

The
 invokes an ajax request which adds a message and invokes the updateForm() remote command. The message is displayed on that ajax request.

The
 invokes another ajax request. But this one doesn't add any messages, so nothing is displayed on that ajax request. In effects, the message displayed in the previous ajax request gets cleared out.

You can use ignoreAutoUpdate attribute of the command component in order to let it ignore any autoUpdate-able component. So your solution is:

```<code><p:remoteCommand name="updateForm" update="@form" ignoreAutoUpdate="true" />
</code>```

That said, why do you still have both the
 and the
 in the same <h:form>? It appears that you didn't take or understood the recommendation in my answer to your previous question p:commandButton doesn't dislpay p:dialog. Therein I recommended to move the
 outside the <h:form> and give it its own <h:form>. It makes these things so much easier manageable.

You should always give the
 its own <h:form>.

```<code><p:messages autoUpdate="true" />

<h:form>
    <p:dataTable ...>
       ...
    </p:dataTable>
    <p:remoteCommand name="updateForm" update="@form" ignoreAutoUpdate="true" />
</h:form>

<p:dialog widgetVar="dlg">
    <h:form>
        ...
        <p:commandButton
            action="#{achievementBean.submitAchievement}"
            update="@form"
            oncomplete="if(!args.validationFailed){PF('dlg').hide();updateForm();}" />
    </h:form>
</p:dialog>
</code>```

See also:

How to use <h:form> in JSF page? Single form? Multiple forms? Nested forms?

Body:
i have a strange problem with a p:message tag. On page a have a dataTable with data from my db that i can edit in a p:dialog. Once all validations succeds and the update in db is done i refresh the dataTable and add a faces message info to display the succes of the operation. In the front-end i update the form whom contains both the dataTable and the dialog. My problem is that the message is displayed but almost instantly disapears. It's like the message tag is updated with the form. I don't get it.

I have tried to move the message tag in & out of the form in didn't change anything.
I have tried to tweak the remoteCommand to update just the dataTable and the dialog but it didn't work.

<h:form id="form">

    ...

        <h:panelGroup id="achievementDetail">

            ...
            <h:panelGrid columns="2" style="width: 100%; text-align:center">

            </h:panelGrid>

        </h:panelGroup>

</h:form>

Body:
Your concrete problem boils down to this:

<p:messages autoUpdate="true" />

<h:form>
    <p:dataTable ...>
       ...
    </p:dataTable>
    ...
    <p:dialog>
        ...
        <p:commandButton
            action="#{achievementBean.submitAchievement}"
            oncomplete="if(!args.validationFailed){updateForm();}" />
        <p:remoteCommand name="updateForm" update="@form" />
    </p:dialog>
</h:form>

The autoUpdate="true" will automatically update the component on every ajax request.

The <p:commandButton> invokes an ajax request which adds a message and invokes the updateForm() remote command. The message is displayed on that ajax request.

The <p:remoteCommand> invokes another ajax request. But this one doesn't add any messages, so nothing is displayed on that ajax request. In effects, the message displayed in the previous ajax request gets cleared out.

You can use ignoreAutoUpdate attribute of the command component in order to let it ignore any autoUpdate-able component. So your solution is:

<p:remoteCommand name="updateForm" update="@form" ignoreAutoUpdate="true" />

That said, why do you still have both the <p:dialog> and the <p:dataTable> in the same <h:form>? It appears that you didn't take or understood the recommendation in my answer to your previous question p:commandButton doesn't dislpay p:dialog. Therein I recommended to move the <p:dialog> outside the <h:form> and give it its own <h:form>. It makes these things so much easier manageable.

You should always give the <p:dialog> its own <h:form>.

<p:messages autoUpdate="true" />

<h:form>
    <p:dataTable ...>
       ...
    </p:dataTable>
    <p:remoteCommand name="updateForm" update="@form" ignoreAutoUpdate="true" />
</h:form>

<p:dialog widgetVar="dlg">
    <h:form>
        ...
        <p:commandButton
            action="#{achievementBean.submitAchievement}"
            update="@form"
            oncomplete="if(!args.validationFailed){PF('dlg').hide();updateForm();}" />
    </h:form>
</p:dialog>

See also:

How to use <h:form> in JSF page? Single form? Multiple forms? Nested forms?


问:
navigationClick() problem for more then one item on Blackberry
I have a ListField and ObjectChoiceField.

In the navigationClick method, how do you figure out which one is selected?

In navigationClick() method:

```<code>Field field = getFieldWithFocus();
if (field instanceof ListField)         // returns false
if (field instanceof ObjectChoiceField) // returns false
if (field == myListField)               // returns false
if (field == myObjectChoiceField)       // returns false
</code>```

答: The navigationClick() method should only fire for the object it is attached to, unlike FieldChangeListener which can be attached to more than one Field, and so the changed Field is passed as a parameter. If you want to debug it you can use System.out.println(field.toString()) and it should give you the class name of what is being clicked. Also, you may want to try using getLeafWithFocus() in case getFieldWithFocus() is returning you the Manager of the field that has focus.</p>

Body:
I have a ListField and ObjectChoiceField.

In the navigationClick method, how do you figure out which one is selected?

In navigationClick() method:

Field field = getFieldWithFocus();
if (field instanceof ListField)         // returns false
if (field instanceof ObjectChoiceField) // returns false
if (field == myListField)               // returns false
if (field == myObjectChoiceField)       // returns false


问:
Code about occurences of a word in a file in BASH
I want to count the occurences of a word in a file with only one line of code. Example: for the input: "hi, welcome to the himalaya. hihi" "hi" the output will be 4 (because the word "hi" occurs 4 times)

I tried using tr and grep, but it doesn't count "hihi" twice, but only once.

```<code>tr 'WORD' '\n' < $1 | grep $2 | wc -l
</code>```

For the given example above, the output was 3 instead of 4.
Thank you!

答:
try this:</p>

```<code>grep -o "hi" input.txt | wc -l
</code>```

Body:
I want to count the occurences of a word in a file with only one line of code. Example: for the input: "hi, welcome to the himalaya. hihi" "hi" the output will be 4 (because the word "hi" occurs 4 times)

I tried using tr and grep, but it doesn't count "hihi" twice, but only once.

tr 'WORD' '\n' < $1 | grep $2 | wc -l

For the given example above, the output was 3 instead of 4.
Thank you!

Body:
try this:

grep -o "hi" input.txt | wc -l


问:
Cucumber Undefined Step, Though Defined Using IntelliJ
I'm trying to run a .feature file to test a simple RESTEasy web application: https://github.com/dashorst/jaxrs-quickstart-resteasy.

However, the IntelliJ keeps saying that:

```<code>Undefined step: Given  I am an invalid username

Undefined step: When  I perform a hello request with null username

Undefined step: Then  I receive a http response code of 400

Undefined step: When  I perform a hello request with empty username

Undefined step: Then  I receive a http response code of 400

You can implement missing steps with the snippets below:

@Given("^I am an invalid username$")
public void I_am_an_invalid_username() throws Throwable {
    // Express the Regexp above with the code you wish you had
    throw new PendingException();
}
// similar results...
</code>```

Below is my hello.feature file:

```<code>Feature: hello

#-------------------------------------
#next block is got the GET entry point
#-------------------------------------

#verify that with malformed input hello fails
Scenario: invalid username should fail
Given I am an invalid username
When I perform a hello request with null username
Then I receive a http response code of 400
When I perform a hello request with empty username
Then I receive a http response code of 400

#verify that you can get correct hello response with valid username. This is the 'everything works fine' path.
Scenario: User can get correct hello response with valid username
Given I am a valid username
When I perform a hello request with valid username
Then I receive a http response code of 200

import cucumber.annotation.en.Given;
import cucumber.annotation.en.Then;
import cucumber.annotation.en.When;
import cucumber.runtime.PendingException;
</code>```

I used IntelliJ option "generate steps" and got the MyStepdefs file.

```<code>/**
 * Created by z on 5/21/17.
 */
public class MyStepdefs {
    @Given("^I am a valid username$")
    public void iAmAValidUsername() throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        throw new PendingException();
    }

    @Given("^I am an invalid username$")
    public void iAmAnInvalidUsername() throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        throw new PendingException();
    }

    @When("^I perform a hello request with null username$")
    public void iPerformAHelloRequestWithNullUsername() throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        throw new PendingException();
    }

    @Then("^I receive a http response code of (\\d+)$")
    public void iReceiveAHttpResponseCodeOf(int arg0) throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        throw new PendingException();
    }

    @When("^I perform a hello request with empty username$")
    public void iPerformAHelloRequestWithEmptyUsername() throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        throw new PendingException();
    }

    @When("^I perform a hello request with valid username$")
    public void iPerformAHelloRequestWithValidUsername() throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        throw new PendingException();
    }
}
</code>```

I had tried to specify glue path for each scenario, but it doesn't work. I'm not sure what went run. Thanks for any advice!

I have looked into several existing questions but none of them helps:

Cucumber: undefined step, although step should be defined

Cucumber JVM undefined step

This is my project structure:

答: Double check you 'glue' in the Idea (Configuration), in my case I caught such issue while entering incorrect (glue from dependent project not current) glue.</p>

Body:
I'm trying to run a .feature file to test a simple RESTEasy web application: https://github.com/dashorst/jaxrs-quickstart-resteasy.

However, the IntelliJ keeps saying that:

Undefined step: Given  I am an invalid username

Undefined step: When  I perform a hello request with null username

Undefined step: Then  I receive a http response code of 400

Undefined step: When  I perform a hello request with empty username

Undefined step: Then  I receive a http response code of 400

You can implement missing steps with the snippets below:

@Given("^I am an invalid username$")
public void I_am_an_invalid_username() throws Throwable {
    // Express the Regexp above with the code you wish you had
    throw new PendingException();
}
// similar results...

Below is my hello.feature file:

Feature: hello

#-------------------------------------
#next block is got the GET entry point
#-------------------------------------

#verify that with malformed input hello fails
Scenario: invalid username should fail
Given I am an invalid username
When I perform a hello request with null username
Then I receive a http response code of 400
When I perform a hello request with empty username
Then I receive a http response code of 400

#verify that you can get correct hello response with valid username. This is the 'everything works fine' path.
Scenario: User can get correct hello response with valid username
Given I am a valid username
When I perform a hello request with valid username
Then I receive a http response code of 200

import cucumber.annotation.en.Given;
import cucumber.annotation.en.Then;
import cucumber.annotation.en.When;
import cucumber.runtime.PendingException;

I used IntelliJ option "generate steps" and got the MyStepdefs file.

/**
 * Created by z on 5/21/17.
 */
public class MyStepdefs {
    @Given("^I am a valid username$")
    public void iAmAValidUsername() throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        throw new PendingException();
    }

    @Given("^I am an invalid username$")
    public void iAmAnInvalidUsername() throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        throw new PendingException();
    }

    @When("^I perform a hello request with null username$")
    public void iPerformAHelloRequestWithNullUsername() throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        throw new PendingException();
    }

    @Then("^I receive a http response code of (\\d+)$")
    public void iReceiveAHttpResponseCodeOf(int arg0) throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        throw new PendingException();
    }

    @When("^I perform a hello request with empty username$")
    public void iPerformAHelloRequestWithEmptyUsername() throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        throw new PendingException();
    }

    @When("^I perform a hello request with valid username$")
    public void iPerformAHelloRequestWithValidUsername() throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        throw new PendingException();
    }
}

I had tried to specify glue path for each scenario, but it doesn't work. I'm not sure what went run. Thanks for any advice!

I have looked into several existing questions but none of them helps:

Cucumber: undefined step, although step should be defined

Cucumber JVM undefined step

This is my project structure:


问:
Accessing JTextField Text
I have a simple program, I am trying to access the data from the textfield but I am always getting null or empty field.

For an example.

```<code>public class income {
JButton save = new JButton("save");

  public JTextField setIncomeValue() {
  ..
  ..
    JTextField incomeValue = new JTextField(10);
    return incomeValue;
  }

  public void launch_Ui{
   frame.add(setIncomeValue());
   frame.add(save);
   save.addactionlistener(new saveListener());
  }
}

class saveListener  implements ActionListener{
    @Override
    public void actionPerformed(ActionEvent e) {
        String test = new income().setIncomeValue().getText();
        System.out.println("savings...  " + test + " value ?");
    }

}
</code>```

Anybody have any idea or have stumble upon this challenge before?

答:
You're creating a new object on each call to setIncomeValue(), so you're getting null each time.

Add a JTextField member next to your JButton save and keep the reference to the first setIncomeValue():

```<code>JButton save = ...;
JTextField income = setIncomeValue(); // Created once
...

class SaveListener implements ActionListener{
    @Override
    public void actionPerformed(ActionEvent e) {
        String test = income.getText();
        ...
    }
}
</code>```

That will work because SaveListener is an inner class of class Income (please use capitals for class names), and therefore has access to its mother class' members.

Title: Accessing JTextField Text

Body:
I have a simple program, I am trying to access the data from the textfield but I am always getting null or empty field.

For an example.

public class income {
JButton save = new JButton("save");

  public JTextField setIncomeValue() {
  ..
  ..
    JTextField incomeValue = new JTextField(10);
    return incomeValue;
  }

  public void launch_Ui{
   frame.add(setIncomeValue());
   frame.add(save);
   save.addactionlistener(new saveListener());
  }
}

class saveListener  implements ActionListener{
    @Override
    public void actionPerformed(ActionEvent e) {
        String test = new income().setIncomeValue().getText();
        System.out.println("savings...  " + test + " value ?");
    }

}

Anybody have any idea or have stumble upon this challenge before?

Body:
You're creating a new object on each call to setIncomeValue(), so you're getting null each time.

Add a JTextField member next to your JButton save and keep the reference to the first setIncomeValue():

JButton save = ...;
JTextField income = setIncomeValue(); // Created once
...

class SaveListener implements ActionListener{
    @Override
    public void actionPerformed(ActionEvent e) {
        String test = income.getText();
        ...
    }
}

That will work because SaveListener is an inner class of class Income (please use capitals for class names), and therefore has access to its mother class' members.


问:
Open url method not called in app delegate using "https" as url schema in deep linking swift 4
Open URL method not called in app delegate using "https" as URL schema in deep linking swift 4
I will attach plist screenshot.

答:
when you want to call deeplink use this from any browser

like safari type yourdeeplink:// or for your deeplink type http://