问:
How do I install a custom kernel on a google compute engine instance?
I would like to install a custom kernel image on a Google Compute Engine instance.  I have an instance running with:

```<code>foo@instance-1:/boot/efi$ uname -a
Linux instance-1 4.10.0-22-generic #24-Ubuntu SMP Mon May 22 17:43:20 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
</code>```

And I've built and installed my kernel image:

```<code>sudo dpkg -i linux-image-4.10.0-rc8.10.0-rc8_amd64.deb
</code>```

It shows up in the grub configuration file, I've set the default grub menu item to correct number, and I've run

```<code>sudo update-grub
</code>```

Yet, when I reboot, I get the same kernel I started with.

Google documentation on this seems to be non-existent.  There is one spot that suggests I might have to create the image externally, install the kernel, and import it.  However, I will need to do this a lot, so I'd rather just install new kernels the old fashioned way.

答:
Before attempting this, I assume you have a fallback option? Some way of falling back to your current state. This is important because it seems you may not have physical access to the system.

Please check what /boot/grub/grub.cfg shows as default kernel. It will be a section beginning with menuentry and under that, an entry starting with linux. If that points to /boot/<default-kernel> then that's what you need to update along with initrd entry so that both kernel image and initramfs point to your custom kernel.

Also, it's possible that boot order of kernel images is alphabetical so newer kernel images (later in alphabetical order) have preference over older ones. In that case if you can change kernel image's file name to be higher than default kernel image, and same for the corresponding initramfs and config files (they will all be similarly named) and then run update-grub that may be quicker way of booting into your custom kernel. You can find those files under /boot/.

Body:
I would like to install a custom kernel image on a Google Compute Engine instance.  I have an instance running with:

foo@instance-1:/boot/efi$ uname -a
Linux instance-1 4.10.0-22-generic #24-Ubuntu SMP Mon May 22 17:43:20 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

And I've built and installed my kernel image:

sudo dpkg -i linux-image-4.10.0-rc8.10.0-rc8_amd64.deb

It shows up in the grub configuration file, I've set the default grub menu item to correct number, and I've run

sudo update-grub

Yet, when I reboot, I get the same kernel I started with.

Google documentation on this seems to be non-existent.  There is one spot that suggests I might have to create the image externally, install the kernel, and import it.  However, I will need to do this a lot, so I'd rather just install new kernels the old fashioned way.


来源: stackexchange

问:
Missing C11 strerrorlen_s function under MSVC 2017
I'm trying to find which header to include for strerrorlen_s function from C11 standard under MSVC 2017. I need it for allocating space for error message which to get with strerror_s. The code is the following:

```<code>auto size = strerrorlen_s(errno) + 1;
char* errorReason = (char*)alloca(size);
strerror_s(errorReason, size, errno);
std::ostringstream oss;
oss << "Cannot open: " << fileName << " Reason: " << errorReason;
throw std::runtime_error(oss.str());
</code>```

In the documentation are the following words:

As with all bounds-checked functions, strerror_s and strerrorlen_s are only guaranteed to be available if __STDC_LIB_EXT1__ is defined by the implementation and if the user defines __STDC_WANT_LIB_EXT1__ to the integer constant 1 before including string.h.

MSVC 2017 does not define __STDC_LIB_EXT1__ and it seems that defining __STDC_WANT_LIB_EXT1__ before including string.h doesn't have effect. Although strerror_s is available.

Is strerrorlen_s available under Windows with MSVC 2017?

Is it possible some other way to get error message length if the function is not available?

Is strerror_s thread safe under Windows, because it seems that under Linux it's not and strerror_r must be used if there is need for thread safety, but it is not available on Windows?

答:
Microsoft Visual Studio, when used as C compiler, mostly follows the 1990 version of the C standard. Some attempts have been made recently to update it to the 1999 version of the language. They are still far behind with that - the compiler is nowhere near the 2011 version. If you need a standard compliant C compiler you cannot use VS.

In addition, you seem to use the compiler in C++ mode which isn't exactly helping C standard compliance... C11 and C++11 are not always compatible.

That being said, the function you ask for is part of the optional bounds-checking interface, which I believe very few, if any, compilers have yet implemented. Some functions present in the bounds-checking interface existed in VS prior C11 as non-standard extensions. They are not necessarily standard compliant.

There are no guarantees that library functions are re-entrant. They may or may not be thread-safe.

ContentLicense: CC BY-SA 3.0

Body:
I'm trying to find which header to include for strerrorlen_s function from C11 standard under MSVC 2017. I need it for allocating space for error message which to get with strerror_s. The code is the following:

auto size = strerrorlen_s(errno) + 1;
char* errorReason = (char*)alloca(size);
strerror_s(errorReason, size, errno);
std::ostringstream oss;
oss << "Cannot open: " << fileName << " Reason: " << errorReason;
throw std::runtime_error(oss.str());

In the documentation are the following words:

As with all bounds-checked functions, strerror_s and strerrorlen_s are only guaranteed to be available if __STDC_LIB_EXT1__ is defined by the implementation and if the user defines __STDC_WANT_LIB_EXT1__ to the integer constant 1 before including string.h.

MSVC 2017 does not define __STDC_LIB_EXT1__ and it seems that defining __STDC_WANT_LIB_EXT1__ before including string.h doesn't have effect. Although strerror_s is available.

Is strerrorlen_s available under Windows with MSVC 2017?

Is it possible some other way to get error message length if the function is not available?

Is strerror_s thread safe under Windows, because it seems that under Linux it's not and strerror_r must be used if there is need for thread safety, but it is not available on Windows?


问:
How to change background-color of Bootstrap column on hover?
I have a grid simulating a fake table made from divs using Bootstrap. I know how to change the background color of the row on hover. What I don't know is how to change the background of the div column on hover. I tried something but it's not working. Any ideas appreciated.

I've also made a JSFiddle.

My code so far:

.fake_table{
    background: #fdf6e3;
    overflow: hidden;
}
.istoric_row:hover{
 background: #FEFAEE;
}
.td, .th {
  position: relative;
}
.td:hover::after,
.th:hover::after {
  content: "";
  position: absolute;
  background-color: #ffa;
  left: 0;
  top: -5000px;
  height: 10000px;
  width: 100%;
  z-index: -1;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="fake_table istoric_calendar">
  <div class="ft_header">
    <div class="clearfix">
      <div class="col-md-4 th">Client</div>
      <div class="col-md-2 th">Added</div>
      <div class="col-md-6 th">
        <div class="clearfix">
          <div class="col-xs-6">
            <div class="clearfix">
              <div class="col-xs-3">
                L
              </div>
              <div class="col-xs-3">
                M
              </div>
              <div class="col-xs-3">
                Mi
              </div>
              <div class="col-xs-3">
                J
              </div>
            </div>
          </div>
          <div class="col-xs-6">
            <div class="clearfix">
              <div class="col-xs-3">
                V
              </div>
              <div class="col-xs-3">
                S
              </div>
              <div class="col-xs-3">
                D
              </div>
              <div class="col-xs-3">
                8
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="ft_content mCustomScrollbar _mCS_1 mCS_no_scrollbar">
    <div id="mCSB_1" class="mCustomScrollBox mCS-dark mCSB_vertical mCSB_inside" style="max-height: none;" tabindex="0">
      <div id="mCSB_1_container" class="mCSB_container mCS_y_hidden mCS_no_scrollbar_y" style="position:relative; top:0; left:0;" dir="ltr">
        <div class="clearfix istoric_row">
          <div class="col-md-4 td">Lorem ipsum dolor / Lorem ipsum dolor / Lorem ipsum dolor</div>
          <div class="col-md-2 td">6 months ago</div>
          <div class="col-md-6 td">
            <div class="clearfix">
              <div class="col-xs-6">
                <div class="clearfix">
                  <div class="col-xs-3">
                    1
                  </div>
                  <div class="col-xs-3">
                    2
                  </div>
                  <div class="col-xs-3">
                    3
                  </div>
                  <div class="col-xs-3">
                    4
                  </div>
                </div>
              </div>
              <div class="col-xs-6">
                <div class="clearfix">
                  <div class="col-xs-3">
                    5
                  </div>
                  <div class="col-xs-3">
                    6
                  </div>
                  <div class="col-xs-3">
                    7
                  </div>
                  <div class="col-xs-3">
                    8
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="clearfix istoric_row">
          <div class="col-md-4 td">Lorem ipsum dolor / Lorem ipsum dolor / Lorem ipsum dolor</div>
          <div class="col-md-2 td">6 months ago</div>
          <div class="col-md-6 td">
            <div class="clearfix">
              <div class="col-xs-6">
                <div class="clearfix">
                  <div class="col-xs-3">
                    1
                  </div>
                  <div class="col-xs-3">
                    2
                  </div>
                  <div class="col-xs-3">
                    3
                  </div>
                  <div class="col-xs-3">
                    4
                  </div>
                </div>
              </div>
              <div class="col-xs-6">
                <div class="clearfix">
                  <div class="col-xs-3">
                    5
                  </div>
                  <div class="col-xs-3">
                    6
                  </div>
                  <div class="col-xs-3">
                    7
                  </div>
                  <div class="col-xs-3">
                    8
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="clearfix istoric_row">
          <div class="col-md-4 td">Lorem ipsum dolor / Lorem ipsum dolor / Lorem ipsum dolor</div>
          <div class="col-md-2 td">6 months ago</div>
          <div class="col-md-6 td">
            <div class="clearfix">
              <div class="col-xs-6">
                <div class="clearfix">
                  <div class="col-xs-3">
                    1
                  </div>
                  <div class="col-xs-3">
                    2
                  </div>
                  <div class="col-xs-3">
                    3
                  </div>
                  <div class="col-xs-3">
                    4
                  </div>
                </div>
              </div>
              <div class="col-xs-6">
                <div class="clearfix">
                  <div class="col-xs-3">
                    5
                  </div>
                  <div class="col-xs-3">
                    6
                  </div>
                  <div class="col-xs-3">
                    7
                  </div>
                  <div class="col-xs-3">
                    8
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="clearfix istoric_row">
          <div class="col-md-4 td">Lorem ipsum dolor / Lorem ipsum dolor / Lorem ipsum dolor</div>
          <div class="col-md-2 td">6 months ago</div>
          <div class="col-md-6 td">
            <div class="clearfix">
              <div class="col-xs-6">
                <div class="clearfix">
                  <div class="col-xs-3">
                    1
                  </div>
                  <div class="col-xs-3">
                    2
                  </div>
                  <div class="col-xs-3">
                    3
                  </div>
                  <div class="col-xs-3">
                    4
                  </div>
                </div>
              </div>
              <div class="col-xs-6">
                <div class="clearfix">
                  <div class="col-xs-3">
                    5
                  </div>
                  <div class="col-xs-3">
                    6
                  </div>
                  <div class="col-xs-3">
                    7
                  </div>
                  <div class="col-xs-3">
                    8
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="clearfix istoric_row">
          <div class="col-md-4 td">Lorem ipsum dolor / Lorem ipsum dolor / Lorem ipsum dolor</div>
          <div class="col-md-2 td">6 months ago</div>
          <div class="col-md-6 td">
            <div class="clearfix">
              <div class="col-xs-6">
                <div class="clearfix">
                  <div class="col-xs-3">
                    1
                  </div>
                  <div class="col-xs-3">
                    2
                  </div>
                  <div class="col-xs-3">
                    3
                  </div>
                  <div class="col-xs-3">
                    4
                  </div>
                </div>
              </div>
              <div class="col-xs-6">
                <div class="clearfix">
                  <div class="col-xs-3">
                    5
                  </div>
                  <div class="col-xs-3">
                    6
                  </div>
                  <div class="col-xs-3">
                    7
                  </div>
                  <div class="col-xs-3">
                    8
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div id="mCSB_1_scrollbar_vertical" class="mCSB_scrollTools mCSB_1_scrollbar mCS-dark mCSB_scrollTools_vertical" style="display: none;">
        <div class="mCSB_draggerContainer">
          <div id="mCSB_1_dragger_vertical" class="mCSB_dragger" style="position: absolute; min-height: 30px; height: 0px; top: 0px;">
            <div class="mCSB_dragger_bar" style="line-height: 30px;"></div>
          </div>
          <div class="mCSB_draggerRail"></div>
        </div>
      </div>
    </div>
  </div>
  <div class="clearfix total_saptamanal">
    <div class="col-md-4 th">Total 123</div>
    <div class="col-md-2 th">Total daily 22</div>
    <div class="col-md-6 th">
      <div class="clearfix">
        <div class="col-xs-6">
          <div class="clearfix">
            <div class="col-xs-3">
              23
            </div>
            <div class="col-xs-3">
              44
            </div>
            <div class="col-xs-3">
              52
            </div>
            <div class="col-xs-3">
              21
            </div>
          </div>
        </div>
        <div class="col-xs-6">
          <div class="clearfix">
            <div class="col-xs-3">
              55
            </div>
            <div class="col-xs-3">
              33
            </div>
            <div class="col-xs-3">
              11
            </div>
            <div class="col-xs-3">
              8
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div></code>```

答:
You can do :

```<code>.td:hover{
    background: #ffa;
}
</code>```

For tables (advanced or normal), I recommend using DataTables.

Body:
I have a grid simulating a fake table made from divs using Bootstrap. I know how to change the background color of the row on hover. What I don't know is how to change the background of the div column on hover. I tried something but it's not working. Any ideas appreciated.

I've also made a JSFiddle.

My code so far:

.fake_table{
    background: #fdf6e3;
    overflow: hidden;
}
.istoric_row:hover{
 background: #FEFAEE;
}
.td, .th {
  position: relative;
}
.td:hover::after,
.th:hover::after {
  content: "";
  position: absolute;
  background-color: #ffa;
  left: 0;
  top: -5000px;
  height: 10000px;
  width: 100%;
  z-index: -1;
}

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

Client

Added

                L

                M

                Mi

                J

                V

                S

                D

                8

Lorem ipsum dolor / Lorem ipsum dolor / Lorem ipsum dolor

6 months ago

                    1

                    2

                    3

                    4

                    5

                    6

                    7

                    8

Lorem ipsum dolor / Lorem ipsum dolor / Lorem ipsum dolor

6 months ago

                    1

                    2

                    3

                    4

                    5

                    6

                    7

                    8

Lorem ipsum dolor / Lorem ipsum dolor / Lorem ipsum dolor

6 months ago

                    1

                    2

                    3

                    4

                    5

                    6

                    7

                    8

Lorem ipsum dolor / Lorem ipsum dolor / Lorem ipsum dolor

6 months ago

                    1

                    2

                    3

                    4

                    5

                    6

                    7

                    8

Lorem ipsum dolor / Lorem ipsum dolor / Lorem ipsum dolor

6 months ago

                    1

                    2

                    3

                    4

                    5

                    6

                    7

                    8

Total 123

Total daily 22

              23

              44

              52

              21

              55

              33

              11

              8

Body:
You can do :

.td:hover{
    background: #ffa;
}

For tables (advanced or normal), I recommend using DataTables.


问:
How to show / hide columns dynamically using checkbox
I created a table using dataTables which can sort itself.
 I want to have checkboxes for each column, which when active shows the column and hides otherwise. If anyone knows how to do it, please help me.

The code in codepena

  var dataset = [
    { "sno": "1",
      "name": "Tiger Nixon",
      "position": "System Architect",
      "salary": "$320,800",
      "start_date": "2011/04/25",
      "office": "Edinburgh",
      "extn": "5421"
    },
    {"sno": "1",
      "name": "Garrett Winters",
      "position": "Accountant",
      "salary": "$170,750",
      "start_date": "2011/07/25",
      "office": "Tokyo",
      "extn": "8422"
    },
    {"sno": "1",
      "name": "Ashton Cox",
      "position": "Junior Technical Author",
      "salary": "$86,000",
      "start_date": "2009/01/12",
      "office": "San Francisco",
      "extn": "1562"
    },
    {"sno": "1",
      "name": "Cedric Kelly",
      "position": "Senior Javascript Developer",
      "salary": "$433,060",
      "start_date": "2012/03/29",
      "office": "Edinburgh",
      "extn": "6224"
    },
    {"sno": "1",
      "name": "Airi Satou",
      "position": "Accountant",
      "salary": "$162,700",
      "start_date": "2008/11/28",
      "office": "Tokyo",
      "extn": "5407"
    },
    {"sno": "1",
      "name": "Brielle Williamson",
      "position": "Integration Specialist",
      "salary": "$372,000",
      "start_date": "2012/12/02",
      "office": "New York",
      "extn": "4804"
    },
    {"sno": "1",
      "name": "Herrod Chandler",
      "position": "Sales Assistant",
      "salary": "$137,500",
      "start_date": "2012/08/06",
      "office": "San Francisco",
      "extn": "9608"
    },
    {"sno": "1",
      "name": "Rhona Davidson",
      "position": "Integration Specialist",
      "salary": "$327,900",
      "start_date": "2010/10/14",
      "office": "Tokyo",
      "extn": "6200"
    },
    {"sno": "1",
      "name": "Colleen Hurst",
      "position": "Javascript Developer",
      "salary": "$205,500",
      "start_date": "2009/09/15",
      "office": "San Francisco",
      "extn": "2360"
    },
    {"sno": "1",
      "name": "Sonya Frost",
      "position": "Software Engineer",
      "salary": "$103,600",
      "start_date": "2008/12/13",
      "office": "Edinburgh",
      "extn": "1667"
    },
    {"sno": "1",
      "name": "Jena Gaines",
      "position": "Office Manager",
      "salary": "$90,560",
      "start_date": "2008/12/19",
      "office": "London",
      "extn": "3814"
    },
    {"sno": "1",
      "name": "Quinn Flynn",
      "position": "Support Lead",
      "salary": "$342,000",
      "start_date": "2013/03/03",
      "office": "Edinburgh",
      "extn": "9497"
    },
    {"sno": "1",
      "name": "Charde Marshall",
      "position": "Regional Director",
      "salary": "$470,600",
      "start_date": "2008/10/16",
      "office": "San Francisco",
      "extn": "6741"
    },
    {"sno": "1",
      "name": "Haley Kennedy",
      "position": "Senior Marketing Designer",
      "salary": "$313,500",
      "start_date": "2012/12/18",
      "office": "London",
      "extn": "3597"
    },
    {"sno": "1",
      "name": "Tatyana Fitzpatrick",
      "position": "Regional Director",
      "salary": "$385,750",
      "start_date": "2010/03/17",
      "office": "London",
      "extn": "1965"
    },
    {"sno": "1",
      "name": "Michael Silva",
      "position": "Marketing Designer",
      "salary": "$198,500",
      "start_date": "2012/11/27",
      "office": "London",
      "extn": "1581"
    },
    {"sno": "1",
      "name": "Paul Byrd",
      "position": "Chief Financial Officer (CFO)",
      "salary": "$725,000",
      "start_date": "2010/06/09",
      "office": "New York",
      "extn": "3059"
    },
    {"sno": "1",
      "name": "Gloria Little",
      "position": "Systems Administrator",
      "salary": "$237,500",
      "start_date": "2009/04/10",
      "office": "New York",
      "extn": "1721"
    },
    {"sno": "1",
      "name": "Bradley Greer",
      "position": "Software Engineer",
      "salary": "$132,000",
      "start_date": "2012/10/13",
      "office": "London",
      "extn": "2558"
    },
    {"sno": "1",
      "name": "Dai Rios",
      "position": "Personnel Lead",
      "salary": "$217,500",
      "start_date": "2012/09/26",
      "office": "Edinburgh",
      "extn": "2290"
    },
    {"sno": "1",
      "name": "Jenette Caldwell",
      "position": "Development Lead",
      "salary": "$345,000",
      "start_date": "2011/09/03",
      "office": "New York",
      "extn": "1937"
    },
    {"sno": "1",
      "name": "Yuri Berry",
      "position": "Chief Marketing Officer (CMO)",
      "salary": "$675,000",
      "start_date": "2009/06/25",
      "office": "New York",
      "extn": "6154"
    },
    {"sno": "1",
      "name": "Caesar Vance",
      "position": "Pre-Sales Support",
      "salary": "$106,450",
      "start_date": "2011/12/12",
      "office": "New York",
      "extn": "8330"
    },
    {"sno": "1",
      "name": "Doris Wilder",
      "position": "Sales Assistant",
      "salary": "$85,600",
      "start_date": "2010/09/20",
      "office": "Sidney",
      "extn": "3023"
    },
    {"sno": "1",
      "name": "Angelica Ramos",
      "position": "Chief Executive Officer (CEO)",
      "salary": "$1,200,000",
      "start_date": "2009/10/09",
      "office": "London",
      "extn": "5797"
    },
    {"sno": "1",
      "name": "Gavin Joyce",
      "position": "Developer",
      "salary": "$92,575",
      "start_date": "2010/12/22",
      "office": "Edinburgh",
      "extn": "8822"
    },
    {"sno": "1",
      "name": "Jennifer Chang",
      "position": "Regional Director",
      "salary": "$357,650",
      "start_date": "2010/11/14",
      "office": "Singapore",
      "extn": "9239"
    },
    {"sno": "1",
      "name": "Brenden Wagner",
      "position": "Software Engineer",
      "salary": "$206,850",
      "start_date": "2011/06/07",
      "office": "San Francisco",
      "extn": "1314"
    },
    {"sno": "1",
      "name": "Fiona Green",
      "position": "Chief Operating Officer (COO)",
      "salary": "$850,000",
      "start_date": "2010/03/11",
      "office": "San Francisco",
      "extn": "2947"
    },
    {"sno": "1",
      "name": "Shou Itou",
      "position": "Regional Marketing",
      "salary": "$163,000",
      "start_date": "2011/08/14",
      "office": "Tokyo",
      "extn": "8899"
    },
    {"sno": "1",
      "name": "Michelle House",
      "position": "Integration Specialist",
      "salary": "$95,400",
      "start_date": "2011/06/02",
      "office": "Sidney",
      "extn": "2769"
    },
    {"sno": "1",
      "name": "Suki Burks",
      "position": "Developer",
      "salary": "$114,500",
      "start_date": "2009/10/22",
      "office": "London",
      "extn": "6832"
    },
    {"sno": "1",
      "name": "Prescott Bartlett",
      "position": "Technical Author",
      "salary": "$145,000",
      "start_date": "2011/05/07",
      "office": "London",
      "extn": "3606"
    },
    {"sno": "1",
      "name": "Gavin Cortez",
      "position": "Team Leader",
      "salary": "$235,500",
      "start_date": "2008/10/26",
      "office": "San Francisco",
      "extn": "2860"
    },
    {"sno": "1",
      "name": "Martena Mccray",
      "position": "Post-Sales support",
      "salary": "$324,050",
      "start_date": "2011/03/09",
      "office": "Edinburgh",
      "extn": "8240"
    },
    {"sno": "1",
      "name": "Unity Butler",
      "position": "Marketing Designer",
      "salary": "$85,675",
      "start_date": "2009/12/09",
      "office": "San Francisco",
      "extn": "5384"
    },
    {"sno": "1",
      "name": "Howard Hatfield",
      "position": "Office Manager",
      "salary": "$164,500",
      "start_date": "2008/12/16",
      "office": "San Francisco",
      "extn": "7031"
    },
    {"sno": "1",
      "name": "Hope Fuentes",
      "position": "Secretary",
      "salary": "$109,850",
      "start_date": "2010/02/12",
      "office": "San Francisco",
      "extn": "6318"
    },
    {"sno": "1",
      "name": "Vivian Harrell",
      "position": "Financial Controller",
      "salary": "$452,500",
      "start_date": "2009/02/14",
      "office": "San Francisco",
      "extn": "9422"
    },
    {"sno": "1",
      "name": "Timothy Mooney",
      "position": "Office Manager",
      "salary": "$136,200",
      "start_date": "2008/12/11",
      "office": "London",
      "extn": "7580"
    },
    {"sno": "1",
      "name": "Jackson Bradshaw",
      "position": "Director",
      "salary": "$645,750",
      "start_date": "2008/09/26",
      "office": "New York",
      "extn": "1042"
    },
    {"sno": "1",
      "name": "Olivia Liang",
      "position": "Support Engineer",
      "salary": "$234,500",
      "start_date": "2011/02/03",
      "office": "Singapore",
      "extn": "2120"
    },
    {"sno": "1",
      "name": "Bruno Nash",
      "position": "Software Engineer",
      "salary": "$163,500",
      "start_date": "2011/05/03",
      "office": "London",
      "extn": "6222"
    },
    {"sno": "1",
      "name": "Sakura Yamamoto",
      "position": "Support Engineer",
      "salary": "$139,575",
      "start_date": "2009/08/19",
      "office": "Tokyo",
      "extn": "9383"
    },
    {"sno": "1",
      "name": "Thor Walton",
      "position": "Developer",
      "salary": "$98,540",
      "start_date": "2013/08/11",
      "office": "New York",
      "extn": "8327"
    },
    {"sno": "1",
      "name": "Finn Camacho",
      "position": "Support Engineer",
      "salary": "$87,500",
      "start_date": "2009/07/07",
      "office": "San Francisco",
      "extn": "2927"
    },
    {"sno": "1",
      "name": "Serge Baldwin",
      "position": "Data Coordinator",
      "salary": "$138,575",
      "start_date": "2012/04/09",
      "office": "Singapore",
      "extn": "8352"
    },
    {"sno": "1",
      "name": "Zenaida Frank",
      "position": "Software Engineer",
      "salary": "$125,250",
      "start_date": "2010/01/04",
      "office": "New York",
      "extn": "7439"
    },
    {"sno": "1",
      "name": "Zorita Serrano",
      "position": "Software Engineer",
      "salary": "$115,000",
      "start_date": "2012/06/01",
      "office": "San Francisco",
      "extn": "4389"
    },
    {"sno": "1",
      "name": "Jennifer Acosta",
      "position": "Junior Javascript Developer",
      "salary": "$75,650",
      "start_date": "2013/02/01",
      "office": "Edinburgh",
      "extn": "3431"
    },
    {"sno": "1",
      "name": "Cara Stevens",
      "position": "Sales Assistant",
      "salary": "$145,600",
      "start_date": "2011/12/06",
      "office": "New York",
      "extn": "3990"
    },
    {"sno": "1",
      "name": "Hermione Butler",
      "position": "Regional Director",
      "salary": "$356,250",
      "start_date": "2011/03/21",
      "office": "London",
      "extn": "1016"
    },
    {"sno": "1",
      "name": "Lael Greer",
      "position": "Systems Administrator",
      "salary": "$103,500",
      "start_date": "2009/02/27",
      "office": "London",
      "extn": "6733"
    },
    {"sno": "1",
      "name": "Jonas Alexander",
      "position": "Developer",
      "salary": "$86,500",
      "start_date": "2010/07/14",
      "office": "San Francisco",
      "extn": "8196"
    },
    {"sno": "1",
      "name": "Shad Decker",
      "position": "Regional Director",
      "salary": "$183,000",
      "start_date": "2008/11/13",
      "office": "Edinburgh",
      "extn": "6373"
    },
    {"sno": "1",
      "name": "Michael Bruce",
      "position": "Javascript Developer",
      "salary": "$183,000",
      "start_date": "2011/06/27",
      "office": "Singapore",
      "extn": "5384"
    },
    {"sno": "1",
      "name": "Donna Snider",
      "position": "Customer Support",
      "salary": "$112,000",
      "start_date": "2011/01/25",
      "office": "New York",
      "extn": "4226"
    }
  ]

/* Formatting function for row details - modify as you need */
function format ( d ) {
    // `d` is the original data object for the row
    return '
'+
        '
'+
            'CONTACT PERSON  :    '+d.name+'	'+
            'EMAIL :  asdfasdfasfasasdf	'+

        '
'+
         '
'+
            'CONTACT NUMBER  :    987654321	'+
            'WEBSITE :  asdfasdfasfasasdf	'+

        '
'+
        '
'+
            'REFERRED BY  :    '+d.extn+'	'+
            'ADDRESS  :    asdfasdfasdfasdf	'+

        '
'+
        '
'+
            'COMMENTS  :    '+d.extn+'	'+
            '	'+
        '
'+
    '
';
}

$(document).ready(function() {
    var table = $('#example').DataTable( {
      "scrollY":        "68vh",
        "scrollCollapse": true,
  "searching": false,
        "paging":         false,
        data: dataset,
        "columns": [
                      { "data": "sno" },
            { "data": "name" },
            { "data": "position" },
            { "data": "office" },
            { "data": "salary" },
             {
                "className":      'details-control',
                "orderable":      false,
                "data":           null,
                "defaultContent": ''
            },
        ],
        "order": [[1, 'asc']]
    } );

    // Add event listener for opening and closing details
    $('#example tbody').on('click', 'td.details-control', function () {
        var tr = $(this).closest('tr');
        var row = table.row( tr );

        if ( row.child.isShown() ) {
            // This row is already open - close it
            row.child.hide();
            tr.removeClass('shown');
        }
        else {
            // Open this row
            row.child( format(row.data()) ).show();
            tr.addClass('shown');
        }
    } );

      $('a.toggle-vis').on( 'click', function (e) {
        e.preventDefault();

        // Get the column API object
        var column = table.column( $(this).attr('data-column') );

        // Toggle the visibility
        column.visible( ! column.visible() );
    } );
} );```
<pre class="snippet-code-css lang-css prettyprint-override"><code>tr{
  text-align:center;
}
a {
    cursor: pointer;
    color: #3174c7;
    text-decoration: none;
}</code>```

     Toggle column: Name - Position - Office  - Salary

                S.No.
                Name
                Position
                Office
                Salary
                View

View in the list

        <input type="checkbox" name="list" value="Name" checked style="color:white; margin-left: 90px; margin-top:55px;"> Name

  <input type="checkbox" name="list" value="Services" checked style="margin-left: 90px;"> Position

  <input type="checkbox" name="list" value="City" checked style="margin-left: 90px;"> Office

<input type="checkbox" name="list" value="Categories" checked style="margin-left: 90px;"> Salary

```

答:
you need to use the on change event and connect the checkboxes with the columns using a data atribute ( in this case i used data-target ) .

see snippet below

code for JQ :

```<code>$('.list_view input[type="checkbox"]').on('change', function(e) {

    // Get the column API object
    var col = table.column($(this).attr('data-target'));

    // Toggle the visibility
    col.visible(!col.visible());
});
</code>```

var dataset = [{
  "sno": "1",
  "name": "Tiger Nixon",
  "position": "System Architect",
  "salary": "$320,800",
  "start_date": "2011/04/25",
  "office": "Edinburgh",
  "extn": "5421"
}, {
  "sno": "1",
  "name": "Garrett Winters",
  "position": "Accountant",
  "salary": "$170,750",
  "start_date": "2011/07/25",
  "office": "Tokyo",
  "extn": "8422"
}, {
  "sno": "1",
  "name": "Ashton Cox",
  "position": "Junior Technical Author",
  "salary": "$86,000",
  "start_date": "2009/01/12",
  "office": "San Francisco",
  "extn": "1562"
}, {
  "sno": "1",
  "name": "Cedric Kelly",
  "position": "Senior Javascript Developer",
  "salary": "$433,060",
  "start_date": "2012/03/29",
  "office": "Edinburgh",
  "extn": "6224"
}, {
  "sno": "1",
  "name": "Airi Satou",
  "position": "Accountant",
  "salary": "$162,700",
  "start_date": "2008/11/28",
  "office": "Tokyo",
  "extn": "5407"
}, {
  "sno": "1",
  "name": "Brielle Williamson",
  "position": "Integration Specialist",
  "salary": "$372,000",
  "start_date": "2012/12/02",
  "office": "New York",
  "extn": "4804"
}, {
  "sno": "1",
  "name": "Herrod Chandler",
  "position": "Sales Assistant",
  "salary": "$137,500",
  "start_date": "2012/08/06",
  "office": "San Francisco",
  "extn": "9608"
}, {
  "sno": "1",
  "name": "Rhona Davidson",
  "position": "Integration Specialist",
  "salary": "$327,900",
  "start_date": "2010/10/14",
  "office": "Tokyo",
  "extn": "6200"
}, {
  "sno": "1",
  "name": "Colleen Hurst",
  "position": "Javascript Developer",
  "salary": "$205,500",
  "start_date": "2009/09/15",
  "office": "San Francisco",
  "extn": "2360"
}, {
  "sno": "1",
  "name": "Sonya Frost",
  "position": "Software Engineer",
  "salary": "$103,600",
  "start_date": "2008/12/13",
  "office": "Edinburgh",
  "extn": "1667"
}, {
  "sno": "1",
  "name": "Jena Gaines",
  "position": "Office Manager",
  "salary": "$90,560",
  "start_date": "2008/12/19",
  "office": "London",
  "extn": "3814"
}, {
  "sno": "1",
  "name": "Quinn Flynn",
  "position": "Support Lead",
  "salary": "$342,000",
  "start_date": "2013/03/03",
  "office": "Edinburgh",
  "extn": "9497"
}, {
  "sno": "1",
  "name": "Charde Marshall",
  "position": "Regional Director",
  "salary": "$470,600",
  "start_date": "2008/10/16",
  "office": "San Francisco",
  "extn": "6741"
}, {
  "sno": "1",
  "name": "Haley Kennedy",
  "position": "Senior Marketing Designer",
  "salary": "$313,500",
  "start_date": "2012/12/18",
  "office": "London",
  "extn": "3597"
}, {
  "sno": "1",
  "name": "Tatyana Fitzpatrick",
  "position": "Regional Director",
  "salary": "$385,750",
  "start_date": "2010/03/17",
  "office": "London",
  "extn": "1965"
}, {
  "sno": "1",
  "name": "Michael Silva",
  "position": "Marketing Designer",
  "salary": "$198,500",
  "start_date": "2012/11/27",
  "office": "London",
  "extn": "1581"
}, {
  "sno": "1",
  "name": "Paul Byrd",
  "position": "Chief Financial Officer (CFO)",
  "salary": "$725,000",
  "start_date": "2010/06/09",
  "office": "New York",
  "extn": "3059"
}, {
  "sno": "1",
  "name": "Gloria Little",
  "position": "Systems Administrator",
  "salary": "$237,500",
  "start_date": "2009/04/10",
  "office": "New York",
  "extn": "1721"
}, {
  "sno": "1",
  "name": "Bradley Greer",
  "position": "Software Engineer",
  "salary": "$132,000",
  "start_date": "2012/10/13",
  "office": "London",
  "extn": "2558"
}, {
  "sno": "1",
  "name": "Dai Rios",
  "position": "Personnel Lead",
  "salary": "$217,500",
  "start_date": "2012/09/26",
  "office": "Edinburgh",
  "extn": "2290"
}, {
  "sno": "1",
  "name": "Jenette Caldwell",
  "position": "Development Lead",
  "salary": "$345,000",
  "start_date": "2011/09/03",
  "office": "New York",
  "extn": "1937"
}, {
  "sno": "1",
  "name": "Yuri Berry",
  "position": "Chief Marketing Officer (CMO)",
  "salary": "$675,000",
  "start_date": "2009/06/25",
  "office": "New York",
  "extn": "6154"
}, {
  "sno": "1",
  "name": "Caesar Vance",
  "position": "Pre-Sales Support",
  "salary": "$106,450",
  "start_date": "2011/12/12",
  "office": "New York",
  "extn": "8330"
}, {
  "sno": "1",
  "name": "Doris Wilder",
  "position": "Sales Assistant",
  "salary": "$85,600",
  "start_date": "2010/09/20",
  "office": "Sidney",
  "extn": "3023"
}, {
  "sno": "1",
  "name": "Angelica Ramos",
  "position": "Chief Executive Officer (CEO)",
  "salary": "$1,200,000",
  "start_date": "2009/10/09",
  "office": "London",
  "extn": "5797"
}, {
  "sno": "1",
  "name": "Gavin Joyce",
  "position": "Developer",
  "salary": "$92,575",
  "start_date": "2010/12/22",
  "office": "Edinburgh",
  "extn": "8822"
}, {
  "sno": "1",
  "name": "Jennifer Chang",
  "position": "Regional Director",
  "salary": "$357,650",
  "start_date": "2010/11/14",
  "office": "Singapore",
  "extn": "9239"
}, {
  "sno": "1",
  "name": "Brenden Wagner",
  "position": "Software Engineer",
  "salary": "$206,850",
  "start_date": "2011/06/07",
  "office": "San Francisco",
  "extn": "1314"
}, {
  "sno": "1",
  "name": "Fiona Green",
  "position": "Chief Operating Officer (COO)",
  "salary": "$850,000",
  "start_date": "2010/03/11",
  "office": "San Francisco",
  "extn": "2947"
}, {
  "sno": "1",
  "name": "Shou Itou",
  "position": "Regional Marketing",
  "salary": "$163,000",
  "start_date": "2011/08/14",
  "office": "Tokyo",
  "extn": "8899"
}, {
  "sno": "1",
  "name": "Michelle House",
  "position": "Integration Specialist",
  "salary": "$95,400",
  "start_date": "2011/06/02",
  "office": "Sidney",
  "extn": "2769"
}, {
  "sno": "1",
  "name": "Suki Burks",
  "position": "Developer",
  "salary": "$114,500",
  "start_date": "2009/10/22",
  "office": "London",
  "extn": "6832"
}, {
  "sno": "1",
  "name": "Prescott Bartlett",
  "position": "Technical Author",
  "salary": "$145,000",
  "start_date": "2011/05/07",
  "office": "London",
  "extn": "3606"
}, {
  "sno": "1",
  "name": "Gavin Cortez",
  "position": "Team Leader",
  "salary": "$235,500",
  "start_date": "2008/10/26",
  "office": "San Francisco",
  "extn": "2860"
}, {
  "sno": "1",
  "name": "Martena Mccray",
  "position": "Post-Sales support",
  "salary": "$324,050",
  "start_date": "2011/03/09",
  "office": "Edinburgh",
  "extn": "8240"
}, {
  "sno": "1",
  "name": "Unity Butler",
  "position": "Marketing Designer",
  "salary": "$85,675",
  "start_date": "2009/12/09",
  "office": "San Francisco",
  "extn": "5384"
}, {
  "sno": "1",
  "name": "Howard Hatfield",
  "position": "Office Manager",
  "salary": "$164,500",
  "start_date": "2008/12/16",
  "office": "San Francisco",
  "extn": "7031"
}, {
  "sno": "1",
  "name": "Hope Fuentes",
  "position": "Secretary",
  "salary": "$109,850",
  "start_date": "2010/02/12",
  "office": "San Francisco",
  "extn": "6318"
}, {
  "sno": "1",
  "name": "Vivian Harrell",
  "position": "Financial Controller",
  "salary": "$452,500",
  "start_date": "2009/02/14",
  "office": "San Francisco",
  "extn": "9422"
}, {
  "sno": "1",
  "name": "Timothy Mooney",
  "position": "Office Manager",
  "salary": "$136,200",
  "start_date": "2008/12/11",
  "office": "London",
  "extn": "7580"
}, {
  "sno": "1",
  "name": "Jackson Bradshaw",
  "position": "Director",
  "salary": "$645,750",
  "start_date": "2008/09/26",
  "office": "New York",
  "extn": "1042"
}, {
  "sno": "1",
  "name": "Olivia Liang",
  "position": "Support Engineer",
  "salary": "$234,500",
  "start_date": "2011/02/03",
  "office": "Singapore",
  "extn": "2120"
}, {
  "sno": "1",
  "name": "Bruno Nash",
  "position": "Software Engineer",
  "salary": "$163,500",
  "start_date": "2011/05/03",
  "office": "London",
  "extn": "6222"
}, {
  "sno": "1",
  "name": "Sakura Yamamoto",
  "position": "Support Engineer",
  "salary": "$139,575",
  "start_date": "2009/08/19",
  "office": "Tokyo",
  "extn": "9383"
}, {
  "sno": "1",
  "name": "Thor Walton",
  "position": "Developer",
  "salary": "$98,540",
  "start_date": "2013/08/11",
  "office": "New York",
  "extn": "8327"
}, {
  "sno": "1",
  "name": "Finn Camacho",
  "position": "Support Engineer",
  "salary": "$87,500",
  "start_date": "2009/07/07",
  "office": "San Francisco",
  "extn": "2927"
}, {
  "sno": "1",
  "name": "Serge Baldwin",
  "position": "Data Coordinator",
  "salary": "$138,575",
  "start_date": "2012/04/09",
  "office": "Singapore",
  "extn": "8352"
}, {
  "sno": "1",
  "name": "Zenaida Frank",
  "position": "Software Engineer",
  "salary": "$125,250",
  "start_date": "2010/01/04",
  "office": "New York",
  "extn": "7439"
}, {
  "sno": "1",
  "name": "Zorita Serrano",
  "position": "Software Engineer",
  "salary": "$115,000",
  "start_date": "2012/06/01",
  "office": "San Francisco",
  "extn": "4389"
}, {
  "sno": "1",
  "name": "Jennifer Acosta",
  "position": "Junior Javascript Developer",
  "salary": "$75,650",
  "start_date": "2013/02/01",
  "office": "Edinburgh",
  "extn": "3431"
}, {
  "sno": "1",
  "name": "Cara Stevens",
  "position": "Sales Assistant",
  "salary": "$145,600",
  "start_date": "2011/12/06",
  "office": "New York",
  "extn": "3990"
}, {
  "sno": "1",
  "name": "Hermione Butler",
  "position": "Regional Director",
  "salary": "$356,250",
  "start_date": "2011/03/21",
  "office": "London",
  "extn": "1016"
}, {
  "sno": "1",
  "name": "Lael Greer",
  "position": "Systems Administrator",
  "salary": "$103,500",
  "start_date": "2009/02/27",
  "office": "London",
  "extn": "6733"
}, {
  "sno": "1",
  "name": "Jonas Alexander",
  "position": "Developer",
  "salary": "$86,500",
  "start_date": "2010/07/14",
  "office": "San Francisco",
  "extn": "8196"
}, {
  "sno": "1",
  "name": "Shad Decker",
  "position": "Regional Director",
  "salary": "$183,000",
  "start_date": "2008/11/13",
  "office": "Edinburgh",
  "extn": "6373"
}, {
  "sno": "1",
  "name": "Michael Bruce",
  "position": "Javascript Developer",
  "salary": "$183,000",
  "start_date": "2011/06/27",
  "office": "Singapore",
  "extn": "5384"
}, {
  "sno": "1",
  "name": "Donna Snider",
  "position": "Customer Support",
  "salary": "$112,000",
  "start_date": "2011/01/25",
  "office": "New York",
  "extn": "4226"
}]

/* Formatting function for row details - modify as you need */
function format(d) {
  // `d` is the original data object for the row
  return '
' +
    '
' +
    'CONTACT PERSON  :    ' + d.name + '	' +
    'EMAIL :  asdfasdfasfasasdf	' +

    '
' +
    '
' +
    'CONTACT NUMBER  :    987654321	' +
    'WEBSITE :  asdfasdfasfasasdf	' +

    '
' +
    '
' +
    'REFERRED BY  :    ' + d.extn + '	' +
    'ADDRESS  :    asdfasdfasdfasdf	' +

    '
' +
    '
' +
    'COMMENTS  :    ' + d.extn + '	' +
    '	' +
    '
' +
    '
';
}

$(document).ready(function() {
  var table = $('#example').DataTable({
    "scrollY": "68vh",
    "scrollCollapse": true,
    "searching": false,
    "paging": false,
    data: dataset,
    "columns": [{
      "data": "sno"
    }, {
      "data": "name"
    }, {
      "data": "position"
    }, {
      "data": "office"
    }, {
      "data": "salary"
    }, {
      "className": 'details-control',
      "orderable": false,
      "data": null,
      "defaultContent": ''
    }, ],
    "order": [
      [1, 'asc']
    ]
  });

  // Add event listener for opening and closing details
  $('#example tbody').on('click', 'td.details-control', function() {
    var tr = $(this).closest('tr');
    var row = table.row(tr);

    if (row.child.isShown()) {
      // This row is already open - close it
      row.child.hide();
      tr.removeClass('shown');
    } else {
      // Open this row
      row.child(format(row.data())).show();
      tr.addClass('shown');
    }
  });

  $('a.toggle-vis').on('click', function(e) {
    e.preventDefault();

    // Get the column API object
    var column = table.column($(this).attr('data-column'));

    // Toggle the visibility
    column.visible(!column.visible());
  });
  $('.list_view input[type="checkbox"]').on('change', function(e) {

    // Get the column API object
    var col = table.column($(this).attr('data-target'));

    // Toggle the visibility
    col.visible(!col.visible());
  });

});```
<pre class="snippet-code-css lang-css prettyprint-override"><code>tr{
  text-align:center;
}
a {
    cursor: pointer;
    color: #3174c7;
    text-decoration: none;
}</code>```

  Toggle column: Name - Position - Office - Salary

      S.No.
      Name
      Position
      Office
      Salary
      View

View in the list

  <input type="checkbox" name="list"  data-target ="1" value="Name" checked style="color:white; margin-left: 90px; margin-top:55px;"> Name

  <input type="checkbox" name="list" data-target ="2" value="Services" checked style="margin-left: 90px;"> Position

  <input type="checkbox" name="list" data-target ="3" value="City" checked style="margin-left: 90px;"> Office

  <input type="checkbox" data-target ="4" name="list" value="Categories" checked style="margin-left: 90px;"> Salary

```

Body:
I created a table using dataTables which can sort itself.
 I want to have checkboxes for each column, which when active shows the column and hides otherwise. If anyone knows how to do it, please help me.

The code in codepena

  var dataset = [
    { "sno": "1",
      "name": "Tiger Nixon",
      "position": "System Architect",
      "salary": "$320,800",
      "start_date": "2011/04/25",
      "office": "Edinburgh",
      "extn": "5421"
    },
    {"sno": "1",
      "name": "Garrett Winters",
      "position": "Accountant",
      "salary": "$170,750",
      "start_date": "2011/07/25",
      "office": "Tokyo",
      "extn": "8422"
    },
    {"sno": "1",
      "name": "Ashton Cox",
      "position": "Junior Technical Author",
      "salary": "$86,000",
      "start_date": "2009/01/12",
      "office": "San Francisco",
      "extn": "1562"
    },
    {"sno": "1",
      "name": "Cedric Kelly",
      "position": "Senior Javascript Developer",
      "salary": "$433,060",
      "start_date": "2012/03/29",
      "office": "Edinburgh",
      "extn": "6224"
    },
    {"sno": "1",
      "name": "Airi Satou",
      "position": "Accountant",
      "salary": "$162,700",
      "start_date": "2008/11/28",
      "office": "Tokyo",
      "extn": "5407"
    },
    {"sno": "1",
      "name": "Brielle Williamson",
      "position": "Integration Specialist",
      "salary": "$372,000",
      "start_date": "2012/12/02",
      "office": "New York",
      "extn": "4804"
    },
    {"sno": "1",
      "name": "Herrod Chandler",
      "position": "Sales Assistant",
      "salary": "$137,500",
      "start_date": "2012/08/06",
      "office": "San Francisco",
      "extn": "9608"
    },
    {"sno": "1",
      "name": "Rhona Davidson",
      "position": "Integration Specialist",
      "salary": "$327,900",
      "start_date": "2010/10/14",
      "office": "Tokyo",
      "extn": "6200"
    },
    {"sno": "1",
      "name": "Colleen Hurst",
      "position": "Javascript Developer",
      "salary": "$205,500",
      "start_date": "2009/09/15",
      "office": "San Francisco",
      "extn": "2360"
    },
    {"sno": "1",
      "name": "Sonya Frost",
      "position": "Software Engineer",
      "salary": "$103,600",
      "start_date": "2008/12/13",
      "office": "Edinburgh",
      "extn": "1667"
    },
    {"sno": "1",
      "name": "Jena Gaines",
      "position": "Office Manager",
      "salary": "$90,560",
      "start_date": "2008/12/19",
      "office": "London",
      "extn": "3814"
    },
    {"sno": "1",
      "name": "Quinn Flynn",
      "position": "Support Lead",
      "salary": "$342,000",
      "start_date": "2013/03/03",
      "office": "Edinburgh",
      "extn": "9497"
    },
    {"sno": "1",
      "name": "Charde Marshall",
      "position": "Regional Director",
      "salary": "$470,600",
      "start_date": "2008/10/16",
      "office": "San Francisco",
      "extn": "6741"
    },
    {"sno": "1",
      "name": "Haley Kennedy",
      "position": "Senior Marketing Designer",
      "salary": "$313,500",
      "start_date": "2012/12/18",
      "office": "London",
      "extn": "3597"
    },
    {"sno": "1",
      "name": "Tatyana Fitzpatrick",
      "position": "Regional Director",
      "salary": "$385,750",
      "start_date": "2010/03/17",
      "office": "London",
      "extn": "1965"
    },
    {"sno": "1",
      "name": "Michael Silva",
      "position": "Marketing Designer",
      "salary": "$198,500",
      "start_date": "2012/11/27",
      "office": "London",
      "extn": "1581"
    },
    {"sno": "1",
      "name": "Paul Byrd",
      "position": "Chief Financial Officer (CFO)",
      "salary": "$725,000",
      "start_date": "2010/06/09",
      "office": "New York",
      "extn": "3059"
    },
    {"sno": "1",
      "name": "Gloria Little",
      "position": "Systems Administrator",
      "salary": "$237,500",
      "start_date": "2009/04/10",
      "office": "New York",
      "extn": "1721"
    },
    {"sno": "1",
      "name": "Bradley Greer",
      "position": "Software Engineer",
      "salary": "$132,000",
      "start_date": "2012/10/13",
      "office": "London",
      "extn": "2558"
    },
    {"sno": "1",
      "name": "Dai Rios",
      "position": "Personnel Lead",
      "salary": "$217,500",
      "start_date": "2012/09/26",
      "office": "Edinburgh",
      "extn": "2290"
    },
    {"sno": "1",
      "name": "Jenette Caldwell",
      "position": "Development Lead",
      "salary": "$345,000",
      "start_date": "2011/09/03",
      "office": "New York",
      "extn": "1937"
    },
    {"sno": "1",
      "name": "Yuri Berry",
      "position": "Chief Marketing Officer (CMO)",
      "salary": "$675,000",
      "start_date": "2009/06/25",
      "office": "New York",
      "extn": "6154"
    },
    {"sno": "1",
      "name": "Caesar Vance",
      "position": "Pre-Sales Support",
      "salary": "$106,450",
      "start_date": "2011/12/12",
      "office": "New York",
      "extn": "8330"
    },
    {"sno": "1",
      "name": "Doris Wilder",
      "position": "Sales Assistant",
      "salary": "$85,600",
      "start_date": "2010/09/20",
      "office": "Sidney",
      "extn": "3023"
    },
    {"sno": "1",
      "name": "Angelica Ramos",
      "position": "Chief Executive Officer (CEO)",
      "salary": "$1,200,000",
      "start_date": "2009/10/09",
      "office": "London",
      "extn": "5797"
    },
    {"sno": "1",
      "name": "Gavin Joyce",
      "position": "Developer",
      "salary": "$92,575",
      "start_date": "2010/12/22",
      "office": "Edinburgh",
      "extn": "8822"
    },
    {"sno": "1",
      "name": "Jennifer Chang",
      "position": "Regional Director",
      "salary": "$357,650",
      "start_date": "2010/11/14",
      "office": "Singapore",
      "extn": "9239"
    },
    {"sno": "1",
      "name": "Brenden Wagner",
      "position": "Software Engineer",
      "salary": "$206,850",
      "start_date": "2011/06/07",
      "office": "San Francisco",
      "extn": "1314"
    },
    {"sno": "1",
      "name": "Fiona Green",
      "position": "Chief Operating Officer (COO)",
      "salary": "$850,000",
      "start_date": "2010/03/11",
      "office": "San Francisco",
      "extn": "2947"
    },
    {"sno": "1",
      "name": "Shou Itou",
      "position": "Regional Marketing",
      "salary": "$163,000",
      "start_date": "2011/08/14",
      "office": "Tokyo",
      "extn": "8899"
    },
    {"sno": "1",
      "name": "Michelle House",
      "position": "Integration Specialist",
      "salary": "$95,400",
      "start_date": "2011/06/02",
      "office": "Sidney",
      "extn": "2769"
    },
    {"sno": "1",
      "name": "Suki Burks",
      "position": "Developer",
      "salary": "$114,500",
      "start_date": "2009/10/22",
      "office": "London",
      "extn": "6832"
    },
    {"sno": "1",
      "name": "Prescott Bartlett",
      "position": "Technical Author",
      "salary": "$145,000",
      "start_date": "2011/05/07",
      "office": "London",
      "extn": "3606"
    },
    {"sno": "1",
      "name": "Gavin Cortez",
      "position": "Team Leader",
      "salary": "$235,500",
      "start_date": "2008/10/26",
      "office": "San Francisco",
      "extn": "2860"
    },
    {"sno": "1",
      "name": "Martena Mccray",
      "position": "Post-Sales support",
      "salary": "$324,050",
      "start_date": "2011/03/09",
      "office": "Edinburgh",
      "extn": "8240"
    },
    {"sno": "1",
      "name": "Unity Butler",
      "position": "Marketing Designer",
      "salary": "$85,675",
      "start_date": "2009/12/09",
      "office": "San Francisco",
      "extn": "5384"
    },
    {"sno": "1",
      "name": "Howard Hatfield",
      "position": "Office Manager",
      "salary": "$164,500",
      "start_date": "2008/12/16",
      "office": "San Francisco",
      "extn": "7031"
    },
    {"sno": "1",
      "name": "Hope Fuentes",
      "position": "Secretary",
      "salary": "$109,850",
      "start_date": "2010/02/12",
      "office": "San Francisco",
      "extn": "6318"
    },
    {"sno": "1",
      "name": "Vivian Harrell",
      "position": "Financial Controller",
      "salary": "$452,500",
      "start_date": "2009/02/14",
      "office": "San Francisco",
      "extn": "9422"
    },
    {"sno": "1",
      "name": "Timothy Mooney",
      "position": "Office Manager",
      "salary": "$136,200",
      "start_date": "2008/12/11",
      "office": "London",
      "extn": "7580"
    },
    {"sno": "1",
      "name": "Jackson Bradshaw",
      "position": "Director",
      "salary": "$645,750",
      "start_date": "2008/09/26",
      "office": "New York",
      "extn": "1042"
    },
    {"sno": "1",
      "name": "Olivia Liang",
      "position": "Support Engineer",
      "salary": "$234,500",
      "start_date": "2011/02/03",
      "office": "Singapore",
      "extn": "2120"
    },
    {"sno": "1",
      "name": "Bruno Nash",
      "position": "Software Engineer",
      "salary": "$163,500",
      "start_date": "2011/05/03",
      "office": "London",
      "extn": "6222"
    },
    {"sno": "1",
      "name": "Sakura Yamamoto",
      "position": "Support Engineer",
      "salary": "$139,575",
      "start_date": "2009/08/19",
      "office": "Tokyo",
      "extn": "9383"
    },
    {"sno": "1",
      "name": "Thor Walton",
      "position": "Developer",
      "salary": "$98,540",
      "start_date": "2013/08/11",
      "office": "New York",
      "extn": "8327"
    },
    {"sno": "1",
      "name": "Finn Camacho",
      "position": "Support Engineer",
      "salary": "$87,500",
      "start_date": "2009/07/07",
      "office": "San Francisco",
      "extn": "2927"
    },
    {"sno": "1",
      "name": "Serge Baldwin",
      "position": "Data Coordinator",
      "salary": "$138,575",
      "start_date": "2012/04/09",
      "office": "Singapore",
      "extn": "8352"
    },
    {"sno": "1",
      "name": "Zenaida Frank",
      "position": "Software Engineer",
      "salary": "$125,250",
      "start_date": "2010/01/04",
      "office": "New York",
      "extn": "7439"
    },
    {"sno": "1",
      "name": "Zorita Serrano",
      "position": "Software Engineer",
      "salary": "$115,000",
      "start_date": "2012/06/01",
      "office": "San Francisco",
      "extn": "4389"
    },
    {"sno": "1",
      "name": "Jennifer Acosta",
      "position": "Junior Javascript Developer",
      "salary": "$75,650",
      "start_date": "2013/02/01",
      "office": "Edinburgh",
      "extn": "3431"
    },
    {"sno": "1",
      "name": "Cara Stevens",
      "position": "Sales Assistant",
      "salary": "$145,600",
      "start_date": "2011/12/06",
      "office": "New York",
      "extn": "3990"
    },
    {"sno": "1",
      "name": "Hermione Butler",
      "position": "Regional Director",
      "salary": "$356,250",
      "start_date": "2011/03/21",
      "office": "London",
      "extn": "1016"
    },
    {"sno": "1",
      "name": "Lael Greer",
      "position": "Systems Administrator",
      "salary": "$103,500",
      "start_date": "2009/02/27",
      "office": "London",
      "extn": "6733"
    },
    {"sno": "1",
      "name": "Jonas Alexander",
      "position": "Developer",
      "salary": "$86,500",
      "start_date": "2010/07/14",
      "office": "San Francisco",
      "extn": "8196"
    },
    {"sno": "1",
      "name": "Shad Decker",
      "position": "Regional Director",
      "salary": "$183,000",
      "start_date": "2008/11/13",
      "office": "Edinburgh",
      "extn": "6373"
    },
    {"sno": "1",
      "name": "Michael Bruce",
      "position": "Javascript Developer",
      "salary": "$183,000",
      "start_date": "2011/06/27",
      "office": "Singapore",
      "extn": "5384"
    },
    {"sno": "1",
      "name": "Donna Snider",
      "position": "Customer Support",
      "salary": "$112,000",
      "start_date": "2011/01/25",
      "office": "New York",
      "extn": "4226"
    }
  ]

/* Formatting function for row details - modify as you need */
function format ( d ) {
    // `d` is the original data object for the row
    return '
'+
        '
'+
            'CONTACT PERSON  :    '+d.name+'	'+
            'EMAIL :  asdfasdfasfasasdf	'+

        '
'+
         '
'+
            'CONTACT NUMBER  :    987654321	'+
            'WEBSITE :  asdfasdfasfasasdf	'+

        '
'+
        '
'+
            'REFERRED BY  :    '+d.extn+'	'+
            'ADDRESS  :    asdfasdfasdfasdf	'+

        '
'+
        '
'+
            'COMMENTS  :    '+d.extn+'	'+
            '	'+
        '
'+
    '
';
}

$(document).ready(function() {
    var table = $('#example').DataTable( {
      "scrollY":        "68vh",
        "scrollCollapse": true,
  "searching": false,
        "paging":         false,
        data: dataset,
        "columns": [
                      { "data": "sno" },
            { "data": "name" },
            { "data": "position" },
            { "data": "office" },
            { "data": "salary" },
             {
                "className":      'details-control',
                "orderable":      false,
                "data":           null,
                "defaultContent": ''
            },
        ],
        "order": [[1, 'asc']]
    } );

    // Add event listener for opening and closing details
    $('#example tbody').on('click', 'td.details-control', function () {
        var tr = $(this).closest('tr');
        var row = table.row( tr );

        if ( row.child.isShown() ) {
            // This row is already open - close it
            row.child.hide();
            tr.removeClass('shown');
        }
        else {
            // Open this row
            row.child( format(row.data()) ).show();
            tr.addClass('shown');
        }
    } );

      $('a.toggle-vis').on( 'click', function (e) {
        e.preventDefault();

        // Get the column API object
        var column = table.column( $(this).attr('data-column') );

        // Toggle the visibility
        column.visible( ! column.visible() );
    } );
} );

tr{
  text-align:center;
}
a {
    cursor: pointer;
    color: #3174c7;
    text-decoration: none;
}

     Toggle column: Name - Position - Office  - Salary

                S.No.
                Name
                Position
                Office
                Salary
                View

View in the list

        <input type="checkbox" name="list" value="Name" checked style="color:white; margin-left: 90px; margin-top:55px;"> Name

  <input type="checkbox" name="list" value="Services" checked style="margin-left: 90px;"> Position

  <input type="checkbox" name="list" value="City" checked style="margin-left: 90px;"> Office

<input type="checkbox" name="list" value="Categories" checked style="margin-left: 90px;"> Salary

Body:
you need to use the on change event and connect the checkboxes with the columns using a data atribute ( in this case i used data-target ) .

see snippet below

code for JQ :

$('.list_view input[type="checkbox"]').on('change', function(e) {

    // Get the column API object
    var col = table.column($(this).attr('data-target'));

    // Toggle the visibility
    col.visible(!col.visible());
});

var dataset = [{
  "sno": "1",
  "name": "Tiger Nixon",
  "position": "System Architect",
  "salary": "$320,800",
  "start_date": "2011/04/25",
  "office": "Edinburgh",
  "extn": "5421"
}, {
  "sno": "1",
  "name": "Garrett Winters",
  "position": "Accountant",
  "salary": "$170,750",
  "start_date": "2011/07/25",
  "office": "Tokyo",
  "extn": "8422"
}, {
  "sno": "1",
  "name": "Ashton Cox",
  "position": "Junior Technical Author",
  "salary": "$86,000",
  "start_date": "2009/01/12",
  "office": "San Francisco",
  "extn": "1562"
}, {
  "sno": "1",
  "name": "Cedric Kelly",
  "position": "Senior Javascript Developer",
  "salary": "$433,060",
  "start_date": "2012/03/29",
  "office": "Edinburgh",
  "extn": "6224"
}, {
  "sno": "1",
  "name": "Airi Satou",
  "position": "Accountant",
  "salary": "$162,700",
  "start_date": "2008/11/28",
  "office": "Tokyo",
  "extn": "5407"
}, {
  "sno": "1",
  "name": "Brielle Williamson",
  "position": "Integration Specialist",
  "salary": "$372,000",
  "start_date": "2012/12/02",
  "office": "New York",
  "extn": "4804"
}, {
  "sno": "1",
  "name": "Herrod Chandler",
  "position": "Sales Assistant",
  "salary": "$137,500",
  "start_date": "2012/08/06",
  "office": "San Francisco",
  "extn": "9608"
}, {
  "sno": "1",
  "name": "Rhona Davidson",
  "position": "Integration Specialist",
  "salary": "$327,900",
  "start_date": "2010/10/14",
  "office": "Tokyo",
  "extn": "6200"
}, {
  "sno": "1",
  "name": "Colleen Hurst",
  "position": "Javascript Developer",
  "salary": "$205,500",
  "start_date": "2009/09/15",
  "office": "San Francisco",
  "extn": "2360"
}, {
  "sno": "1",
  "name": "Sonya Frost",
  "position": "Software Engineer",
  "salary": "$103,600",
  "start_date": "2008/12/13",
  "office": "Edinburgh",
  "extn": "1667"
}, {
  "sno": "1",
  "name": "Jena Gaines",
  "position": "Office Manager",
  "salary": "$90,560",
  "start_date": "2008/12/19",
  "office": "London",
  "extn": "3814"
}, {
  "sno": "1",
  "name": "Quinn Flynn",
  "position": "Support Lead",
  "salary": "$342,000",
  "start_date": "2013/03/03",
  "office": "Edinburgh",
  "extn": "9497"
}, {
  "sno": "1",
  "name": "Charde Marshall",
  "position": "Regional Director",
  "salary": "$470,600",
  "start_date": "2008/10/16",
  "office": "San Francisco",
  "extn": "6741"
}, {
  "sno": "1",
  "name": "Haley Kennedy",
  "position": "Senior Marketing Designer",
  "salary": "$313,500",
  "start_date": "2012/12/18",
  "office": "London",
  "extn": "3597"
}, {
  "sno": "1",
  "name": "Tatyana Fitzpatrick",
  "position": "Regional Director",
  "salary": "$385,750",
  "start_date": "2010/03/17",
  "office": "London",
  "extn": "1965"
}, {
  "sno": "1",
  "name": "Michael Silva",
  "position": "Marketing Designer",
  "salary": "$198,500",
  "start_date": "2012/11/27",
  "office": "London",
  "extn": "1581"
}, {
  "sno": "1",
  "name": "Paul Byrd",
  "position": "Chief Financial Officer (CFO)",
  "salary": "$725,000",
  "start_date": "2010/06/09",
  "office": "New York",
  "extn": "3059"
}, {
  "sno": "1",
  "name": "Gloria Little",
  "position": "Systems Administrator",
  "salary": "$237,500",
  "start_date": "2009/04/10",
  "office": "New York",
  "extn": "1721"
}, {
  "sno": "1",
  "name": "Bradley Greer",
  "position": "Software Engineer",
  "salary": "$132,000",
  "start_date": "2012/10/13",
  "office": "London",
  "extn": "2558"
}, {
  "sno": "1",
  "name": "Dai Rios",
  "position": "Personnel Lead",
  "salary": "$217,500",
  "start_date": "2012/09/26",
  "office": "Edinburgh",
  "extn": "2290"
}, {
  "sno": "1",
  "name": "Jenette Caldwell",
  "position": "Development Lead",
  "salary": "$345,000",
  "start_date": "2011/09/03",
  "office": "New York",
  "extn": "1937"
}, {
  "sno": "1",
  "name": "Yuri Berry",
  "position": "Chief Marketing Officer (CMO)",
  "salary": "$675,000",
  "start_date": "2009/06/25",
  "office": "New York",
  "extn": "6154"
}, {
  "sno": "1",
  "name": "Caesar Vance",
  "position": "Pre-Sales Support",
  "salary": "$106,450",
  "start_date": "2011/12/12",
  "office": "New York",
  "extn": "8330"
}, {
  "sno": "1",
  "name": "Doris Wilder",
  "position": "Sales Assistant",
  "salary": "$85,600",
  "start_date": "2010/09/20",
  "office": "Sidney",
  "extn": "3023"
}, {
  "sno": "1",
  "name": "Angelica Ramos",
  "position": "Chief Executive Officer (CEO)",
  "salary": "$1,200,000",
  "start_date": "2009/10/09",
  "office": "London",
  "extn": "5797"
}, {
  "sno": "1",
  "name": "Gavin Joyce",
  "position": "Developer",
  "salary": "$92,575",
  "start_date": "2010/12/22",
  "office": "Edinburgh",
  "extn": "8822"
}, {
  "sno": "1",
  "name": "Jennifer Chang",
  "position": "Regional Director",
  "salary": "$357,650",
  "start_date": "2010/11/14",
  "office": "Singapore",
  "extn": "9239"
}, {
  "sno": "1",
  "name": "Brenden Wagner",
  "position": "Software Engineer",
  "salary": "$206,850",
  "start_date": "2011/06/07",
  "office": "San Francisco",
  "extn": "1314"
}, {
  "sno": "1",
  "name": "Fiona Green",
  "position": "Chief Operating Officer (COO)",
  "salary": "$850,000",
  "start_date": "2010/03/11",
  "office": "San Francisco",
  "extn": "2947"
}, {
  "sno": "1",
  "name": "Shou Itou",
  "position": "Regional Marketing",
  "salary": "$163,000",
  "start_date": "2011/08/14",
  "office": "Tokyo",
  "extn": "8899"
}, {
  "sno": "1",
  "name": "Michelle House",
  "position": "Integration Specialist",
  "salary": "$95,400",
  "start_date": "2011/06/02",
  "office": "Sidney",
  "extn": "2769"
}, {
  "sno": "1",
  "name": "Suki Burks",
  "position": "Developer",
  "salary": "$114,500",
  "start_date": "2009/10/22",
  "office": "London",
  "extn": "6832"
}, {
  "sno": "1",
  "name": "Prescott Bartlett",
  "position": "Technical Author",
  "salary": "$145,000",
  "start_date": "2011/05/07",
  "office": "London",
  "extn": "3606"
}, {
  "sno": "1",
  "name": "Gavin Cortez",
  "position": "Team Leader",
  "salary": "$235,500",
  "start_date": "2008/10/26",
  "office": "San Francisco",
  "extn": "2860"
}, {
  "sno": "1",
  "name": "Martena Mccray",
  "position": "Post-Sales support",
  "salary": "$324,050",
  "start_date": "2011/03/09",
  "office": "Edinburgh",
  "extn": "8240"
}, {
  "sno": "1",
  "name": "Unity Butler",
  "position": "Marketing Designer",
  "salary": "$85,675",
  "start_date": "2009/12/09",
  "office": "San Francisco",
  "extn": "5384"
}, {
  "sno": "1",
  "name": "Howard Hatfield",
  "position": "Office Manager",
  "salary": "$164,500",
  "start_date": "2008/12/16",
  "office": "San Francisco",
  "extn": "7031"
}, {
  "sno": "1",
  "name": "Hope Fuentes",
  "position": "Secretary",
  "salary": "$109,850",
  "start_date": "2010/02/12",
  "office": "San Francisco",
  "extn": "6318"
}, {
  "sno": "1",
  "name": "Vivian Harrell",
  "position": "Financial Controller",
  "salary": "$452,500",
  "start_date": "2009/02/14",
  "office": "San Francisco",
  "extn": "9422"
}, {
  "sno": "1",
  "name": "Timothy Mooney",
  "position": "Office Manager",
  "salary": "$136,200",
  "start_date": "2008/12/11",
  "office": "London",
  "extn": "7580"
}, {
  "sno": "1",
  "name": "Jackson Bradshaw",
  "position": "Director",
  "salary": "$645,750",
  "start_date": "2008/09/26",
  "office": "New York",
  "extn": "1042"
}, {
  "sno": "1",
  "name": "Olivia Liang",
  "position": "Support Engineer",
  "salary": "$234,500",
  "start_date": "2011/02/03",
  "office": "Singapore",
  "extn": "2120"
}, {
  "sno": "1",
  "name": "Bruno Nash",
  "position": "Software Engineer",
  "salary": "$163,500",
  "start_date": "2011/05/03",
  "office": "London",
  "extn": "6222"
}, {
  "sno": "1",
  "name": "Sakura Yamamoto",
  "position": "Support Engineer",
  "salary": "$139,575",
  "start_date": "2009/08/19",
  "office": "Tokyo",
  "extn": "9383"
}, {
  "sno": "1",
  "name": "Thor Walton",
  "position": "Developer",
  "salary": "$98,540",
  "start_date": "2013/08/11",
  "office": "New York",
  "extn": "8327"
}, {
  "sno": "1",
  "name": "Finn Camacho",
  "position": "Support Engineer",
  "salary": "$87,500",
  "start_date": "2009/07/07",
  "office": "San Francisco",
  "extn": "2927"
}, {
  "sno": "1",
  "name": "Serge Baldwin",
  "position": "Data Coordinator",
  "salary": "$138,575",
  "start_date": "2012/04/09",
  "office": "Singapore",
  "extn": "8352"
}, {
  "sno": "1",
  "name": "Zenaida Frank",
  "position": "Software Engineer",
  "salary": "$125,250",
  "start_date": "2010/01/04",
  "office": "New York",
  "extn": "7439"
}, {
  "sno": "1",
  "name": "Zorita Serrano",
  "position": "Software Engineer",
  "salary": "$115,000",
  "start_date": "2012/06/01",
  "office": "San Francisco",
  "extn": "4389"
}, {
  "sno": "1",
  "name": "Jennifer Acosta",
  "position": "Junior Javascript Developer",
  "salary": "$75,650",
  "start_date": "2013/02/01",
  "office": "Edinburgh",
  "extn": "3431"
}, {
  "sno": "1",
  "name": "Cara Stevens",
  "position": "Sales Assistant",
  "salary": "$145,600",
  "start_date": "2011/12/06",
  "office": "New York",
  "extn": "3990"
}, {
  "sno": "1",
  "name": "Hermione Butler",
  "position": "Regional Director",
  "salary": "$356,250",
  "start_date": "2011/03/21",
  "office": "London",
  "extn": "1016"
}, {
  "sno": "1",
  "name": "Lael Greer",
  "position": "Systems Administrator",
  "salary": "$103,500",
  "start_date": "2009/02/27",
  "office": "London",
  "extn": "6733"
}, {
  "sno": "1",
  "name": "Jonas Alexander",
  "position": "Developer",
  "salary": "$86,500",
  "start_date": "2010/07/14",
  "office": "San Francisco",
  "extn": "8196"
}, {
  "sno": "1",
  "name": "Shad Decker",
  "position": "Regional Director",
  "salary": "$183,000",
  "start_date": "2008/11/13",
  "office": "Edinburgh",
  "extn": "6373"
}, {
  "sno": "1",
  "name": "Michael Bruce",
  "position": "Javascript Developer",
  "salary": "$183,000",
  "start_date": "2011/06/27",
  "office": "Singapore",
  "extn": "5384"
}, {
  "sno": "1",
  "name": "Donna Snider",
  "position": "Customer Support",
  "salary": "$112,000",
  "start_date": "2011/01/25",
  "office": "New York",
  "extn": "4226"
}]

/* Formatting function for row details - modify as you need */
function format(d) {
  // `d` is the original data object for the row
  return '<table class="chil" cellpadding="5" cellspacing="0" border="0" style="padding-left:50px;border-bottom:none;">' +
    '<tr>' +
    '<td style="text-align:left;padding-left:100px;border-bottom:none;"><b>CONTACT PERSON  :</b>    ' + d.name + '</td>' +
    '<td style="text-align:left;border-bottom:none;padding-left:100px;"><b>EMAIL :</b>  asdfasdfasfasasdf</td>' +

    '</tr>' +
    '<tr>' +
    '<td style="text-align:left;border-bottom:none;padding-left:100px;"><b>CONTACT NUMBER  :</b>    987654321</td>' +
    '<td style="text-align:left;border-bottom:none;padding-left:100px;"><b>WEBSITE :</b>  asdfasdfasfasasdf</td>' +

    '</tr>' +
    '<tr>' +
    '<td style="text-align:left;border-bottom:none;padding-left:100px;"><b>REFERRED BY  :</b>    ' + d.extn + '</td>' +
    '<td style="text-align:left;border-bottom:none;padding-left:100px;"><b>ADDRESS  :</b>    asdfasdfasdfasdf</td>' +

    '</tr>' +
    '<tr>' +
    '<td style="text-align:left;border-bottom:none;padding-left:100px; "><b>COMMENTS  : </b>   ' + d.extn + '</td>' +
    '<td style="text-align:left;border-bottom:none;padding-left:50px; "></td>' +
    '</tr>' +
    '</table>';
}

$(document).ready(function() {
  var table = $('#example').DataTable({
    "scrollY": "68vh",
    "scrollCollapse": true,
    "searching": false,
    "paging": false,
    data: dataset,
    "columns": [{
      "data": "sno"
    }, {
      "data": "name"
    }, {
      "data": "position"
    }, {
      "data": "office"
    }, {
      "data": "salary"
    }, {
      "className": 'details-control',
      "orderable": false,
      "data": null,
      "defaultContent": ''
    }, ],
    "order": [
      [1, 'asc']
    ]
  });

  // Add event listener for opening and closing details
  $('#example tbody').on('click', 'td.details-control', function() {
    var tr = $(this).closest('tr');
    var row = table.row(tr);

    if (row.child.isShown()) {
      // This row is already open - close it
      row.child.hide();
      tr.removeClass('shown');
    } else {
      // Open this row
      row.child(format(row.data())).show();
      tr.addClass('shown');
    }
  });

  $('a.toggle-vis').on('click', function(e) {
    e.preventDefault();

    // Get the column API object
    var column = table.column($(this).attr('data-column'));

    // Toggle the visibility
    column.visible(!column.visible());
  });
  $('.list_view input[type="checkbox"]').on('change', function(e) {

    // Get the column API object
    var col = table.column($(this).attr('data-target'));

    // Toggle the visibility
    col.visible(!col.visible());
  });

});

tr{
  text-align:center;
}
a {
    cursor: pointer;
    color: #3174c7;
    text-decoration: none;
}

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js"></script>
<div>
  Toggle column: <a class="toggle-vis" data-column="1">Name</a> - <a class="toggle-vis" data-column="2">Position</a> - <a class="toggle-vis" data-column="3">Office</a> - <a class="toggle-vis" data-column="4">Salary</a>

</div>

<table id="example" class="display" cellspacing="0" width="100%">
  <thead>
    <tr>
      <th style="border-top-left-radius:10px;border-bottom-left-radius:10px;">S.No.</th>
      <th>Name</th>
      <th>Position</th>
      <th>Office</th>
      <th>Salary</th>
      <th style="border-top-right-radius:10px;border-bottom-right-radius:10px;">View</th>
    </tr>
  </thead>

</table>

<div class="list_view">
  <h3 style="margin-left:50px; position:absolute;">View in the list </h3>
  <input type="checkbox" name="list"  data-target ="1" value="Name" checked style="color:white; margin-left: 90px; margin-top:55px;"> Name
  <br>
  <input type="checkbox" name="list" data-target ="2" value="Services" checked style="margin-left: 90px;"> Position
  <br>
  <input type="checkbox" name="list" data-target ="3" value="City" checked style="margin-left: 90px;"> Office
  <br>
  <input type="checkbox" data-target ="4" name="list" value="Categories" checked style="margin-left: 90px;"> Salary
  <br>
</div>


问:
How to write a single query for the below scenario?
I am new to SQL and I am facing a problem in writing a query for one scenario. I have 3 tables:

Table 1 has actor names and movie-id's

```<code>Table1
Actor-ID  Actor-name    Movies_id
</code>```

Table 2 has movie-id's and corresponding movie names.

```<code>Table2
Movies_id   Movies_name
</code>```

Table 3 has movie-id's and corresponding revenue generated by the movies.

```<code>Table3
Movies_id   Revenue_generated
</code>```

I want to write a query to fetch data for the below scenario:
All the movies of any one actor which has earned more than 100 crores.

I haven't mention any data in the tables, so feel free to add data from your side.

答:
This will help you out.</p>

```<code>SELECT
    A.Actor-name,B.Movies_name
        FROM
            table1 A INNER JOIN table2 ON
                A.Movies_id= B.Movies_id
            INNER JOIN table3 C ON
                A.Movies_id= C.Movies_id
        WHERE C.Revenue_generated > 10000000000
</code>```

Body:
I am new to SQL and I am facing a problem in writing a query for one scenario. I have 3 tables:

Table 1 has actor names and movie-id's

Table1
Actor-ID  Actor-name    Movies_id

Table 2 has movie-id's and corresponding movie names.

Table2
Movies_id   Movies_name

Table 3 has movie-id's and corresponding revenue generated by the movies.

Table3
Movies_id   Revenue_generated

I want to write a query to fetch data for the below scenario:
All the movies of any one actor which has earned more than 100 crores.

I haven't mention any data in the tables, so feel free to add data from your side.

Body:
This will help you out.

SELECT
    A.Actor-name,B.Movies_name
        FROM
            table1 A INNER JOIN table2 ON
                A.Movies_id= B.Movies_id
            INNER JOIN table3 C ON
                A.Movies_id= C.Movies_id
        WHERE C.Revenue_generated > 10000000000


问:
Default header p:media with pdf player
I'm programming a
 with a streamed
 to preview external PDFs.

It works fine but i'm getting a little handicap.

When the pdf dialog is rendered it shows (on mouse over) one Header where it always display the same title: "dynamiccontent.properties".

Is there an attribute or something that I can override to customize it?

JSP code:

```<code><p:lightBox>
  <h:outputLink value="#" title="#{myDoc.fileName}">
    <i class="fa fa-eye" aria-hidden="true"></i>
  </h:outputLink>

  <f:facet name="inline">
    <p:media value="#{documentController.stream}" width="1100px" height="600px" player="pdf">
        <f:param name="idStore" value="#{myDoc.idStore}" />
    </p:media>
  </f:facet>
</p:lightBox>
</code>```

Displayed header for a PDF

Thanks for your time.

答:
I have encountered the same problem when using google chrome.

The header does not appear in IE 11.

(I'm only using IE 11 and Google Chrome so I don't know what this looks like on other browser)

This is what a rendered media with a streamed value will look like:

```<code><object type="application/pdf"
    data="/projectName/javax.faces.resource/dynamiccontent.properties.xhtml?ln=primefaces&v=6.1&pfdrid=a754229fe5cdabff72537ef0693a2399&pfdrt=sc&pfdrid_c=true"
    height="600px" width="1100px" internalinstanceid="6">
</object>
</code>```

/projectName/javax.faces.resource/dynamiccontent.properties.xhtml comes from DynamicContentSrcBuilder#build(resourcePath)

I have tried:

1. setting name in DefaultStreamedContent

```<code>new DefaultStreamedContent(getData(), "application/pdf", "test.pdf");
</code>```

this does not seem to work. name becomes null in MediaRenderer#encodeEnd so the name is not added in the src.

```<code>if (streamedContent.getName() != null) {
    int index = src.indexOf("?");
    src = src.substring(0, index) + ";/" + streamedContent.getName() + ""
        + src.substring(index, src.length());
}
</code>```

2. override MediaRenderer#encodeEnd and add a fixed value name(Test.pdf)

```<code>if ((value != null) && (value instanceof StreamedContent) && (player.getType().equals("application/pdf"))) {
    streamedContent = (StreamedContent) value;
    if (streamedContent.getName() != null) {
        int index = src.indexOf("?");
        src = src.substring(0, index) + ";/" + streamedContent.getName() + ""
                + src.substring(index, src.length());
    }

    src = src.substring(0, index) + ";/Test.pdf"
                + src.substring(index, src.length());
}
</code>```

This also did not worked. The lightBox opens but can't display the pdf file.

3. override MediaRenderer#encodeEnd and replace the value of "dynamiccontent.properties" in the src
with the value from title which is set in xhtml.

MediaRenderer#encodeEnd

```<code>if ((value != null) && (value instanceof StreamedContent) && (player.getType().equals("application/pdf"))) {
    streamedContent = (StreamedContent) value;
    if (streamedContent.getName() != null) {
        int index = src.indexOf("?");
        src = src.substring(0, index) + ";/" + streamedContent.getName() + ""
                + src.substring(index, src.length());
    }

    if (src.contains("dynamiccontent.properties")) {
        String[] urlParams = src.split("&");

        for (String param : urlParams) {
            if (param.contains("title=")) {
                String[] titleAndValue = param.split("=");
                src = src.replace("dynamiccontent.properties", titleAndValue[1]);
            }
        }
    }
}
</code>```

xhtml

```<code><p:lightBox>
    <h:outputLink value="#" title="#{myDoc.fileName}">
        <i class="fa fa-eye" aria-hidden="true"></i>
    </h:outputLink>

    <f:facet name="inline">
        <p:media value="#{documentController.stream}" width="1100px" height="600px" player="pdf">
            <f:param name="title" value="Test.pdf" />
        </p:media>
    </f:facet>
</p:lightBox>
</code>```

redered media will look something like this.

```<code><object type="application/pdf"
    data="/projectName/javax.faces.resource/Test.pdf.xhtml?ln=primefaces&v=6.1&pfdrid=a754229fe5cdabff72537ef0693a2399&pfdrt=sc&title=Test.pdf&pfdrid_c=true"
    height="600px" width="1100px" internalinstanceid="6">
    <param name="title" value="Test.pdf">
</object>
</code>```

This works but only on StreamedContent. following is a screenshot of the pdf header.

Note that ".xhtml" is needed. It will not work without it.

Hope this helps.

Title: Default header p:media with pdf player

Body:
I'm programming a
 with a streamed
 to preview external PDFs.

It works fine but i'm getting a little handicap.

When the pdf dialog is rendered it shows (on mouse over) one Header where it always display the same title: "dynamiccontent.properties".

Is there an attribute or something that I can override to customize it?

JSP code:

  <h:outputLink value="#" title="#{myDoc.fileName}">

  </h:outputLink>

  <f:facet name="inline">

        <f:param name="idStore" value="#{myDoc.idStore}" />

  </f:facet>

Displayed header for a PDF

Thanks for your time.

Body:
I have encountered the same problem when using google chrome.

The header does not appear in IE 11.

(I'm only using IE 11 and Google Chrome so I don't know what this looks like on other browser)

This is what a rendered media with a streamed value will look like:

<object type="application/pdf"
    data="/projectName/javax.faces.resource/dynamiccontent.properties.xhtml?ln=primefaces&amp;v=6.1&amp;pfdrid=a754229fe5cdabff72537ef0693a2399&amp;pfdrt=sc&amp;pfdrid_c=true"
    height="600px" width="1100px" internalinstanceid="6">
</object>

/projectName/javax.faces.resource/dynamiccontent.properties.xhtml comes from DynamicContentSrcBuilder#build(resourcePath)

I have tried:

1. setting name in DefaultStreamedContent

new DefaultStreamedContent(getData(), "application/pdf", "test.pdf");

this does not seem to work. name becomes null in MediaRenderer#encodeEnd so the name is not added in the src.

if (streamedContent.getName() != null) {
    int index = src.indexOf("?");
    src = src.substring(0, index) + ";/" + streamedContent.getName() + ""
        + src.substring(index, src.length());
}

2. override MediaRenderer#encodeEnd and add a fixed value name(Test.pdf)

if ((value != null) && (value instanceof StreamedContent) && (player.getType().equals("application/pdf"))) {
    streamedContent = (StreamedContent) value;
    if (streamedContent.getName() != null) {
        int index = src.indexOf("?");
        src = src.substring(0, index) + ";/" + streamedContent.getName() + ""
                + src.substring(index, src.length());
    }

    src = src.substring(0, index) + ";/Test.pdf"
                + src.substring(index, src.length());
}

This also did not worked. The lightBox opens but can't display the pdf file.

3. override MediaRenderer#encodeEnd and replace the value of "dynamiccontent.properties" in the src
with the value from title which is set in xhtml.

MediaRenderer#encodeEnd

if ((value != null) && (value instanceof StreamedContent) && (player.getType().equals("application/pdf"))) {
    streamedContent = (StreamedContent) value;
    if (streamedContent.getName() != null) {
        int index = src.indexOf("?");
        src = src.substring(0, index) + ";/" + streamedContent.getName() + ""
                + src.substring(index, src.length());
    }

    if (src.contains("dynamiccontent.properties")) {
        String[] urlParams = src.split("&");

        for (String param : urlParams) {
            if (param.contains("title=")) {
                String[] titleAndValue = param.split("=");
                src = src.replace("dynamiccontent.properties", titleAndValue[1]);
            }
        }
    }
}

xhtml

<p:lightBox>
    <h:outputLink value="#" title="#{myDoc.fileName}">
        <i class="fa fa-eye" aria-hidden="true"></i>
    </h:outputLink>

    <f:facet name="inline">
        <p:media value="#{documentController.stream}" width="1100px" height="600px" player="pdf">
            <f:param name="title" value="Test.pdf" />
        </p:media>
    </f:facet>
</p:lightBox>

redered media will look something like this.

<object type="application/pdf"
    data="/projectName/javax.faces.resource/Test.pdf.xhtml?ln=primefaces&amp;v=6.1&amp;pfdrid=a754229fe5cdabff72537ef0693a2399&amp;pfdrt=sc&amp;title=Test.pdf&amp;pfdrid_c=true"
    height="600px" width="1100px" internalinstanceid="6">
    <param name="title" value="Test.pdf">
</object>

This works but only on StreamedContent. following is a screenshot of the pdf header.

Note that ".xhtml" is needed. It will not work without it.

Hope this helps.


问:
Bigram Tokenization is not obtained
I am trying to do Bigram Tokenization on csv file. But it is taking a lot of time. I have checked my code with the existing codes in SO. I couldn't find any fault in it. My code is displayed below:

```<code>library(tm)
library(RWeka)
library(tmcn.word2vec)
library(openNLP)
library(NLP)

data <- read.csv("Train.csv", header=T)

corpus <- Corpus(VectorSource(data$EventDescription))
corpus <- tm_map(corpus,content_transformer(tolower))
corpus <- tm_map(corpus,removePunctuation)
corpus <- tm_map(corpus,PlainTextDocument)

BigramTokenizer <- function(x) NGramTokenizer(x, Weka_control(min = 2, max = 2))
dtm <- DocumentTermMatrix(corpus,control=list(tokenize=BigramTokenizer))
</code>```

Can anyone help me in solving this problem? Thanks in advance

答:
Consider reading the sources into a VCorpus instead of a Corpus. See:

Document-term matrix in R - bigram tokenizer not working and Creating N-Grams with tm & RWeka - works with VCorpus but not Corpus

Title: Bigram Tokenization is not obtained

Body:
I am trying to do Bigram Tokenization on csv file. But it is taking a lot of time. I have checked my code with the existing codes in SO. I couldn't find any fault in it. My code is displayed below:

library(tm)
library(RWeka)
library(tmcn.word2vec)
library(openNLP)
library(NLP)

data <- read.csv("Train.csv", header=T)

corpus <- Corpus(VectorSource(data$EventDescription))
corpus <- tm_map(corpus,content_transformer(tolower))
corpus <- tm_map(corpus,removePunctuation)
corpus <- tm_map(corpus,PlainTextDocument)

BigramTokenizer <- function(x) NGramTokenizer(x, Weka_control(min = 2, max = 2))
dtm <- DocumentTermMatrix(corpus,control=list(tokenize=BigramTokenizer))

Can anyone help me in solving this problem? Thanks in advance


问:
How to search a string for different types of numbers
I have multiple strings that each contain a year and some text. An example of one string is: "The year is 2004". But, another string may look like this "this was made in 2003.5". How would I check many strings like this and extract the correct number?

答:
You can use regular expressions. For example this will get all numbers in a given string:

```<code>>>> re.findall(r'\d+(?:\.\d+)?', 'year is 2004')
['2004']
>>> re.findall(r'\d+(?:\.\d+)?', 'this was made in 2003.5')
['2003.5']
</code>```

You can fine tune the regular expression to fit your definition of "correct" number.

Body:
You can use regular expressions. For example this will get all numbers in a given string:

>>> re.findall(r'\d+(?:\.\d+)?', 'year is 2004')
['2004']
>>> re.findall(r'\d+(?:\.\d+)?', 'this was made in 2003.5')
['2003.5']

You can fine tune the regular expression to fit your definition of "correct" number.


问:
Neural Network Number of Output Layer Nodes
I'm training a supervised neural network for six different classes. How to decide the minimum and maximum number of nodes for output layer.</p>

答:
 - If the NN is a regressor then the output layer is going to be a single node(neuron) that will return a value.

 - If the NN is a classifier then the output layer is going to be a single node(neuron) except if you use Softmax where one node per class label is needed.

ContentLicense: CC BY-SA 4.0


问:
AAPT2 compile failed: invalid dimen on Android 3.0 Canary 1
I am playing around with Instant Apps for Android.I installed all the correct packages and tired to create new Application with Instant App support (checked the box for Instant App when crating new application). The problem is that I always run into a problem with compile tools. Does anybody else have this problem and was able to find any workaround.

My environment:

Android Studio 3.0 Canary 1

Compile SDK: 25

Build Tools: "26.0.0 rc2"

Gradle plugin:3.0.0-alpha1

Gradle: tried both gradle-4.0-milestone1 and 2

Java 1.8/1.7

OS: tried both Windows 10 and Linux Ubuntu 16.4 LTS

The error:

Error: java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.internal.aapt.AaptException: AAPT2 compile failed:
aapt2 compile -o /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/res/merged/androidTest/debug /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml
Issues:
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:520 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:521 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:568 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:594 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:595 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:597 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:598 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:599 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:600 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:601 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:602 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:603 invalid dimen
:feature:mergeDebugAndroidTestResources FAILED
```

<p>The line in question contains (520):</p>

```<item format="float" name="abc_disabled_alpha_material_dark" type="dimen">0.30</item>
```

Hopefully I provided enough information to you to resolve the problem. Thank you.

答:
Required libraries for 64-bit machines:

If you are running a 64-bit version of Ubuntu, you need to install some 32-bit libraries with the following command:

```<code>sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386
</code>```

If you are running 64-bit Fedora, the command is:

```<code>sudo yum install zlib.i686 ncurses-libs.i686 bzip2-libs.i686
</code>```

Body:
I am playing around with Instant Apps for Android.I installed all the correct packages and tired to create new Application with Instant App support (checked the box for Instant App when crating new application). The problem is that I always run into a problem with compile tools. Does anybody else have this problem and was able to find any workaround.

My environment:

Android Studio 3.0 Canary 1

Compile SDK: 25

Build Tools: "26.0.0 rc2"

Gradle plugin:3.0.0-alpha1

Gradle: tried both gradle-4.0-milestone1 and 2

Java 1.8/1.7

OS: tried both Windows 10 and Linux Ubuntu 16.4 LTS

The error:

Error: java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.internal.aapt.AaptException: AAPT2 compile failed:
aapt2 compile -o /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/res/merged/androidTest/debug /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml
Issues:
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:520 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:521 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:568 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:594 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:595 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:597 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:598 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:599 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:600 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:601 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:602 invalid dimen
 - ERROR: /home/simonp/Work/201705_InstantApp/InstantAppTest/feature/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml:603 invalid dimen
:feature:mergeDebugAndroidTestResources FAILED

The line in question contains (520):

<item format="float" name="abc_disabled_alpha_material_dark" type="dimen">0.30</item>

Hopefully I provided enough information to you to resolve the problem. Thank you.

Body:
Required libraries for 64-bit machines:

If you are running a 64-bit version of Ubuntu, you need to install some 32-bit libraries with the following command:

sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386

If you are running 64-bit Fedora, the command is:

sudo yum install zlib.i686 ncurses-libs.i686 bzip2-libs.i686


问:
Merging Two HashTable with removal of duplicates in java
I am having two Hashtables with <int,string> pair. Now they both have duplicate values in each of them, and I want to merge both the hashtables to give me distinct values. How can I do that!?

thanks
Edit #1 I am reading file contents from a directory. and storing those contents as tokens in two different hashtables. Now I need to merge them into a single hashtable which would give me distinct values of both the tables.

答:
The original question-asker asserted in the comments that he means value, not key. This makes the question incomplete. In order to have duplicate values in two different tables, the key generation algorithm must be different. If that's the case, the bit of information that is missing from the question is which key does he want to retain? The one from the first hashtable or the one from the second?

The solution presented above by S.P.Floyd-seanizer is correct but needs a tiny bit of logic added if he really, really mean values. this additional logic would tell the code which key to put the thing under in the merged version.

if the question-asker is having 'value' and 'key' confusion then his solution is spot on.

ContentLicense: CC BY-SA 2.5