问:
Does a child div inherit parent's height?
As far as I know, child divs normally inherit parent's style. However this isn't the case when I am trying to copy the parent's height. Any clarification on how this works would be very appreciated

Parent Div

Child Div

I've tried switching to position:relative and display:inline but am yet to find anything that modifies the child div's height relative to the parent.

// Plot our graphs
var data = [
  {
    z: [[1, 20, 30], [20, 1, 60], [30, 60, 1]],
    type: 'heatmap'
  }
];

Plotly.newPlot('chart_div', data);```
<pre class="snippet-code-css lang-css prettyprint-override"><code>/*//////////////////////////////////////////////////////////////////
[ FONT ]*/
@font-face {
  font-family: Ubuntu-Regular;
  src: url('../fonts/ubuntu_regular-webfont.woff') format('woff');
}

@font-face {
  font-family: Ubuntu-Bold;
  src: url('../fonts/ubuntu-bold-webfont.woff') format('woff');
}

@font-face {
  font-family: Montserrat-Regular;
  src: url('../fonts/montserrat-regular-webfont.woff') format('woff');
}

@font-face {
  font-family: FontAwesome;
  src: url('../fonts/fontawesome-webfont.woff') format('woff');
}

@font-face {
  font-family: Material-Design-Iconic-Font;
  src: url('../fonts/Material-Design-Iconic-Font.woff') format('woff');
}

fontawesome-webfont.woff

/*//////////////////////////////////////////////////////////////////
[ RESTYLE TAG ]*/

* {
 margin: 0px;
 padding: 0px;
 box-sizing: border-box;
}

body, html {
 height: 100%;
 font-family: Ubuntu-Regular, sans-serif;
}

/*---------------------------------------------*/
a {
 font-family: Ubuntu-Regular;
 font-size: 14px;
 line-height: 1.7;
 color: #666666;
 margin: 0px;
 transition: all 0.4s;
 -webkit-transition: all 0.4s;
  -o-transition: all 0.4s;
  -moz-transition: all 0.4s;
}

a:focus {
 outline: none !important;
}

a:hover {
 text-decoration: none;
  color: #403866;
}

/*---------------------------------------------*/
h1,h2,h3,h4,h5,h6 {
 margin: 0px;
}

p {
 font-family: Ubuntu-Regular;
 font-size: 14px;
 line-height: 1.7;
 color: #666666;
 margin: 0px;
}

ul, li {
 margin: 0px;
 list-style-type: none;
}

/*---------------------------------------------*/
input {
 outline: none;
 border: none;
}

textarea {
  outline: none;
  border: none;
}

textarea:focus, input:focus {
  border-color: transparent !important;
}

input::-webkit-input-placeholder { color: #8f8fa1;}
input:-moz-placeholder { color: #8f8fa1;}
input::-moz-placeholder { color: #8f8fa1;}
input:-ms-input-placeholder { color: #8f8fa1;}

textarea::-webkit-input-placeholder { color: #8f8fa1;}
textarea:-moz-placeholder { color: #8f8fa1;}
textarea::-moz-placeholder { color: #8f8fa1;}
textarea:-ms-input-placeholder { color: #8f8fa1;}

label {
  display: block;
  margin: 0;
}

/*---------------------------------------------*/
button {
 outline: none !important;
 border: none;
 background: transparent;
}

button:hover {
 cursor: pointer;
}

iframe {
 border: none !important;
}

/*//////////////////////////////////////////////////////////////////
[ Utility ]*/
.txt1 {
  font-family: Ubuntu-Regular;
  font-size: 16px;
  color: #827ffe;
  line-height: 1.4;
}

.app-explanation {
  font-family: Ubuntu-Regular;
  font-size: 13px;
  color: #403866;
  line-height: 1.4;
  text-align: center;
  font-style: italic;
  width: 100%;
}

/*//////////////////////////////////////////////////////////////////
[ login ]*/

.limiter {
  width: 100%;
  margin: 0 auto;
}

.container-login100 {
  width: 100%;
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding: 15px;
  position: relative;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;;
}

.wrap-login100 {
  width: 390px;;
  background: #fff;
  border-radius: 10px;
  position: relative;
}

.wrap-data100 {
  width: 90%;
  background: #fff;
  border-radius: 10px;
  position: relative;
}

/*==================================================================
[ Form ]*/

.login100-form {
  width: 100%;
}

.login100-form-title {
  font-family: Ubuntu-Bold;
  font-size: 30px;
  color: #403866;
  line-height: 1.2;
  text-transform: uppercase;
  text-align: center;

  width: 100%;
  display: block;
}

/*------------------------------------------------------------------
[ Input ]*/

.wrap-input100 {
  width: 100%;
  position: relative;
  background-color: #e6e6e6;
  border: 1px solid transparent;
  border-radius: 3px;
}

/*---------------------------------------------*/
.input100 {
  font-family: Ubuntu-Bold;
  color: #403866;
  line-height: 1.2;
  font-size: 18px;

  display: block;
  width: 100%;
  background: transparent;
  height: 62px;
  padding: 0 20px 0 38px;
}
/*------------------------------------------------------------------
[ Focus Input ]*/

.focus-input100 {
  position: absolute;
  display: block;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  top: -1px;
  left: -1px;
  pointer-events: none;
  border: 1px solid #827ffe;
  border-radius: 3px;

  visibility: hidden;
  opacity: 0;

  -webkit-transition: all 0.4s;
  -o-transition: all 0.4s;
  -moz-transition: all 0.4s;
  transition: all 0.4s;

  -webkit-transform: scaleX(1.1) scaleY(1.3);
  -moz-transform: scaleX(1.1) scaleY(1.3);
  -ms-transform: scaleX(1.1) scaleY(1.3);
  -o-transform: scaleX(1.1) scaleY(1.3);
  transform: scaleX(1.1) scaleY(1.3);
}

.input100:focus + .focus-input100 {
  visibility: visible;
  opacity: 1;

  -webkit-transform: scale(1);
  -moz-transform: scale(1);
  -ms-transform: scale(1);
  -o-transform: scale(1);
  transform: scale(1);
}

.eff-focus-selection {
  visibility: visible;
  opacity: 1;

  -webkit-transform: scale(1);
  -moz-transform: scale(1);
  -ms-transform: scale(1);
  -o-transform: scale(1);
  transform: scale(1);
}

/*==================================================================
[ Restyle Checkbox ]*/

.input-checkbox100 {
  display: none;
}

.label-checkbox100 {
  font-family: Ubuntu-Regular;
  font-size: 16px;
  color: #999999;
  line-height: 1.2;

  display: block;
  position: relative;
  padding-left: 26px;
  cursor: pointer;
}

.label-checkbox100::before {
  content: "\f00c";
  font-family: FontAwesome;
  font-size: 13px;
  color: transparent;

  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  background: #fff;
  border: 2px solid #827ffe;
  left: 0;
  top: 50%;
  -webkit-transform: translateY(-50%);
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -o-transform: translateY(-50%);
  transform: translateY(-50%);
}

.input-checkbox100:checked + .label-checkbox100::before {
  color: #827ffe;
}

/*------------------------------------------------------------------
[ Button ]*/
.container-login100-form-btn {
  width: 100%;
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  flex-wrap: wrap;
}

.login100-form-btn {
  font-family: Ubuntu-Bold;
  font-size: 16px;
  color: #fff;
  line-height: 1.2;
  text-transform: uppercase;

  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  width: 100%;
  height: 62px;
  background-color: #827ffe;
  border-radius: 3px;

  -webkit-transition: all 0.4s;
  -o-transition: all 0.4s;
  -moz-transition: all 0.4s;
  transition: all 0.4s;
}

.login100-form-btn:hover {
  background-color: #403866;
}

/*------------------------------------------------------------------
[ Alert validate ]*/

.validate-input {
  position: relative;
}

.alert-validate::before {
  content: attr(data-validate);
  position: absolute;
  max-width: 70%;
  background-color: #fff;
  border: 1px solid #c80000;
  border-radius: 3px;
  padding: 4px 25px 5px 10px;
  top: 50%;
  -webkit-transform: translateY(-50%);
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -o-transform: translateY(-50%);
  transform: translateY(-50%);
  right: 12px;
  pointer-events: none;

  font-family: Ubuntu-Regular;
  color: #c80000;
  font-size: 14px;
  line-height: 1.4;
  text-align: left;

  visibility: hidden;
  opacity: 0;

  -webkit-transition: opacity 0.4s;
  -o-transition: opacity 0.4s;
  -moz-transition: opacity 0.4s;
  transition: opacity 0.4s;
}

.alert-validate::after {
  content: "\f12a";
  font-family: FontAwesome;
  display: block;
  position: absolute;
  color: #c80000;
  font-size: 18px;
  top: 50%;
  -webkit-transform: translateY(-50%);
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -o-transform: translateY(-50%);
  transform: translateY(-50%);
  right: 18px;
}

.alert-validate:hover:before {
  visibility: visible;
  opacity: 1;
}

@media (max-width: 992px) {
  .alert-validate::before {
    visibility: visible;
    opacity: 1;
  }
}

/*==================================================================
[ Restyle Select2 ]*/

.select2-container {
  display: block;
  max-width: 100% !important;
  width: auto !important;
}

.select2-container .select2-selection--single {
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  align-items: center;
  background-color: rgba(171, 171, 189, 0.233);
  border: none;
  height: 40px;
  outline: none;
  position: relative;
  left: -40px;
}

/*------------------------------------------------------------------
[ in select ]*/
.select2-container .select2-selection--single .select2-selection__rendered {
  font-family: Ubuntu-Bold;
  font-size: 18px;
  color: #555555;
  line-height: 1.2;
  padding-left: 0px ;
  background-color: transparent;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 100%;
  top: 50%;
  transform: translateY(-50%);
  right: 0px;
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.select2-selection__arrow b {
  display: none;
  font-family: Material-Design-Iconic-Font !important;
  font-size: 18px;
  color: #555555;
}

.select2-selection__arrow {
  content: '\f312';
  font-family: Material-Design-Iconic-Font !important;
  font-size: 18px;
  color: #555555;
}

/*------------------------------------------------------------------
[ Dropdown option ]*/
.select2-container--open .select2-dropdown {
  z-index: 1251;
  width: calc(100% + 2px);
  border: 0px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background-color:  rgba(171, 171, 189, 0.233);
  left: -40px;

  box-shadow: 0 3px 10px 0px rgba(0, 0, 0, 0.2);
  -moz-box-shadow: 0 3px 10px 0px rgba(0, 0, 0, 0.2);
  -webkit-box-shadow: 0 3px 10px 0px rgba(0, 0, 0, 0.2);
  -o-box-shadow: 0 3px 10px 0px rgba(0, 0, 0, 0.2);
  -ms-box-shadow: 0 3px 10px 0px rgba(0, 0, 0, 0.2);
}

@media (max-width: 576px) {
  .select2-container--open .select2-dropdown {
    left: -12px;
  }
}

.select2-dropdown--above {top: -38px;}
.select2-dropdown--below {top: 10px;}

.select2-container .select2-results__option[aria-selected] {
  padding-top: 10px;
  padding-bottom: 10px;
  padding-left: 24px;
}

@media (max-width: 576px) {
  .select2-container .select2-results__option[aria-selected] {
    padding-left: 12px;
  }
}

.select2-container .select2-results__option[aria-selected="true"] {
  background: #403866;
  color: white;
}

.select2-container .select2-results__option--highlighted[aria-selected] {
  background: #827ffe;
  color: white;
}

.select2-results__options {
  font-family: Ubuntu-Bold;
  font-size: 14px;
  color: #555555;
  line-height: 1.2;
}

.select2-search--dropdown .select2-search__field {
  border: 1px solid #aaa;
  outline: none;
  font-family: Ubuntu-Bold;
  font-size: 15px;
  color: #333333;
  line-height: 1.2;
}

.wrap-input100 .dropDownSelect2 .select2-container--open {
  width: 100% !important;
}

.wrap-input100 .dropDownSelect2 .select2-dropdown {
  width: calc(100% + 2px) !important;
}</code>```

<!DOCTYPE html>

 <title>Blackfynn Exporter</title>
 <meta charset="UTF-8">

 <link rel="icon" type="image/png" href="images/icons/favicon.ico" />

     <form class="contact100-form validate-form">

       Data Viewer

        <select class="js-select2" name="service" id="select_channel">
         <option>Channel Selection</option>
        </select>

     </form>

```

答:
A child element does not inherit the height of its parent.

Reference: MDN

You can however set its value to height:inherit; CodePen Example

You could also use height: 100% or max-height: 100%

In any situation you have to think what you want to do with the content if it is too much to fit in that set height: overflow: hidden; overflow-y:hidden; overflow-y: scroll.

Body:
As far as I know, child divs normally inherit parent's style. However this isn't the case when I am trying to copy the parent's height. Any clarification on how this works would be very appreciated

Parent Div

Child Div

I've tried switching to position:relative and display:inline but am yet to find anything that modifies the child div's height relative to the parent.

// Plot our graphs
var data = [
  {
    z: [[1, 20, 30], [20, 1, 60], [30, 60, 1]],
    type: 'heatmap'
  }
];

Plotly.newPlot('chart_div', data);

/*//////////////////////////////////////////////////////////////////
[ FONT ]*/
@font-face {
  font-family: Ubuntu-Regular;
  src: url('../fonts/ubuntu_regular-webfont.woff') format('woff');
}

@font-face {
  font-family: Ubuntu-Bold;
  src: url('../fonts/ubuntu-bold-webfont.woff') format('woff');
}

@font-face {
  font-family: Montserrat-Regular;
  src: url('../fonts/montserrat-regular-webfont.woff') format('woff');
}

@font-face {
  font-family: FontAwesome;
  src: url('../fonts/fontawesome-webfont.woff') format('woff');
}

@font-face {
  font-family: Material-Design-Iconic-Font;
  src: url('../fonts/Material-Design-Iconic-Font.woff') format('woff');
}

fontawesome-webfont.woff

/*//////////////////////////////////////////////////////////////////
[ RESTYLE TAG ]*/

* {
 margin: 0px;
 padding: 0px;
 box-sizing: border-box;
}

body, html {
 height: 100%;
 font-family: Ubuntu-Regular, sans-serif;
}

/*---------------------------------------------*/
a {
 font-family: Ubuntu-Regular;
 font-size: 14px;
 line-height: 1.7;
 color: #666666;
 margin: 0px;
 transition: all 0.4s;
 -webkit-transition: all 0.4s;
  -o-transition: all 0.4s;
  -moz-transition: all 0.4s;
}

a:focus {
 outline: none !important;
}

a:hover {
 text-decoration: none;
  color: #403866;
}

/*---------------------------------------------*/
h1,h2,h3,h4,h5,h6 {
 margin: 0px;
}

p {
 font-family: Ubuntu-Regular;
 font-size: 14px;
 line-height: 1.7;
 color: #666666;
 margin: 0px;
}

ul, li {
 margin: 0px;
 list-style-type: none;
}

/*---------------------------------------------*/
input {
 outline: none;
 border: none;
}

textarea {
  outline: none;
  border: none;
}

textarea:focus, input:focus {
  border-color: transparent !important;
}

input::-webkit-input-placeholder { color: #8f8fa1;}
input:-moz-placeholder { color: #8f8fa1;}
input::-moz-placeholder { color: #8f8fa1;}
input:-ms-input-placeholder { color: #8f8fa1;}

textarea::-webkit-input-placeholder { color: #8f8fa1;}
textarea:-moz-placeholder { color: #8f8fa1;}
textarea::-moz-placeholder { color: #8f8fa1;}
textarea:-ms-input-placeholder { color: #8f8fa1;}

label {
  display: block;
  margin: 0;
}

/*---------------------------------------------*/
button {
 outline: none !important;
 border: none;
 background: transparent;
}

button:hover {
 cursor: pointer;
}

iframe {
 border: none !important;
}

/*//////////////////////////////////////////////////////////////////
[ Utility ]*/
.txt1 {
  font-family: Ubuntu-Regular;
  font-size: 16px;
  color: #827ffe;
  line-height: 1.4;
}

.app-explanation {
  font-family: Ubuntu-Regular;
  font-size: 13px;
  color: #403866;
  line-height: 1.4;
  text-align: center;
  font-style: italic;
  width: 100%;
}

/*//////////////////////////////////////////////////////////////////
[ login ]*/

.limiter {
  width: 100%;
  margin: 0 auto;
}

.container-login100 {
  width: 100%;
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding: 15px;
  position: relative;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;;
}

.wrap-login100 {
  width: 390px;;
  background: #fff;
  border-radius: 10px;
  position: relative;
}

.wrap-data100 {
  width: 90%;
  background: #fff;
  border-radius: 10px;
  position: relative;
}

/*==================================================================
[ Form ]*/

.login100-form {
  width: 100%;
}

.login100-form-title {
  font-family: Ubuntu-Bold;
  font-size: 30px;
  color: #403866;
  line-height: 1.2;
  text-transform: uppercase;
  text-align: center;

  width: 100%;
  display: block;
}

/*------------------------------------------------------------------
[ Input ]*/

.wrap-input100 {
  width: 100%;
  position: relative;
  background-color: #e6e6e6;
  border: 1px solid transparent;
  border-radius: 3px;
}

/*---------------------------------------------*/
.input100 {
  font-family: Ubuntu-Bold;
  color: #403866;
  line-height: 1.2;
  font-size: 18px;

  display: block;
  width: 100%;
  background: transparent;
  height: 62px;
  padding: 0 20px 0 38px;
}
/*------------------------------------------------------------------
[ Focus Input ]*/

.focus-input100 {
  position: absolute;
  display: block;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  top: -1px;
  left: -1px;
  pointer-events: none;
  border: 1px solid #827ffe;
  border-radius: 3px;

  visibility: hidden;
  opacity: 0;

  -webkit-transition: all 0.4s;
  -o-transition: all 0.4s;
  -moz-transition: all 0.4s;
  transition: all 0.4s;

  -webkit-transform: scaleX(1.1) scaleY(1.3);
  -moz-transform: scaleX(1.1) scaleY(1.3);
  -ms-transform: scaleX(1.1) scaleY(1.3);
  -o-transform: scaleX(1.1) scaleY(1.3);
  transform: scaleX(1.1) scaleY(1.3);
}

.input100:focus + .focus-input100 {
  visibility: visible;
  opacity: 1;

  -webkit-transform: scale(1);
  -moz-transform: scale(1);
  -ms-transform: scale(1);
  -o-transform: scale(1);
  transform: scale(1);
}

.eff-focus-selection {
  visibility: visible;
  opacity: 1;

  -webkit-transform: scale(1);
  -moz-transform: scale(1);
  -ms-transform: scale(1);
  -o-transform: scale(1);
  transform: scale(1);
}

/*==================================================================
[ Restyle Checkbox ]*/

.input-checkbox100 {
  display: none;
}

.label-checkbox100 {
  font-family: Ubuntu-Regular;
  font-size: 16px;
  color: #999999;
  line-height: 1.2;

  display: block;
  position: relative;
  padding-left: 26px;
  cursor: pointer;
}

.label-checkbox100::before {
  content: "\f00c";
  font-family: FontAwesome;
  font-size: 13px;
  color: transparent;

  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  background: #fff;
  border: 2px solid #827ffe;
  left: 0;
  top: 50%;
  -webkit-transform: translateY(-50%);
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -o-transform: translateY(-50%);
  transform: translateY(-50%);
}

.input-checkbox100:checked + .label-checkbox100::before {
  color: #827ffe;
}

/*------------------------------------------------------------------
[ Button ]*/
.container-login100-form-btn {
  width: 100%;
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  flex-wrap: wrap;
}

.login100-form-btn {
  font-family: Ubuntu-Bold;
  font-size: 16px;
  color: #fff;
  line-height: 1.2;
  text-transform: uppercase;

  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  width: 100%;
  height: 62px;
  background-color: #827ffe;
  border-radius: 3px;

  -webkit-transition: all 0.4s;
  -o-transition: all 0.4s;
  -moz-transition: all 0.4s;
  transition: all 0.4s;
}

.login100-form-btn:hover {
  background-color: #403866;
}

/*------------------------------------------------------------------
[ Alert validate ]*/

.validate-input {
  position: relative;
}

.alert-validate::before {
  content: attr(data-validate);
  position: absolute;
  max-width: 70%;
  background-color: #fff;
  border: 1px solid #c80000;
  border-radius: 3px;
  padding: 4px 25px 5px 10px;
  top: 50%;
  -webkit-transform: translateY(-50%);
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -o-transform: translateY(-50%);
  transform: translateY(-50%);
  right: 12px;
  pointer-events: none;

  font-family: Ubuntu-Regular;
  color: #c80000;
  font-size: 14px;
  line-height: 1.4;
  text-align: left;

  visibility: hidden;
  opacity: 0;

  -webkit-transition: opacity 0.4s;
  -o-transition: opacity 0.4s;
  -moz-transition: opacity 0.4s;
  transition: opacity 0.4s;
}

.alert-validate::after {
  content: "\f12a";
  font-family: FontAwesome;
  display: block;
  position: absolute;
  color: #c80000;
  font-size: 18px;
  top: 50%;
  -webkit-transform: translateY(-50%);
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -o-transform: translateY(-50%);
  transform: translateY(-50%);
  right: 18px;
}

.alert-validate:hover:before {
  visibility: visible;
  opacity: 1;
}

@media (max-width: 992px) {
  .alert-validate::before {
    visibility: visible;
    opacity: 1;
  }
}

/*==================================================================
[ Restyle Select2 ]*/

.select2-container {
  display: block;
  max-width: 100% !important;
  width: auto !important;
}

.select2-container .select2-selection--single {
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  align-items: center;
  background-color: rgba(171, 171, 189, 0.233);
  border: none;
  height: 40px;
  outline: none;
  position: relative;
  left: -40px;
}

/*------------------------------------------------------------------
[ in select ]*/
.select2-container .select2-selection--single .select2-selection__rendered {
  font-family: Ubuntu-Bold;
  font-size: 18px;
  color: #555555;
  line-height: 1.2;
  padding-left: 0px ;
  background-color: transparent;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 100%;
  top: 50%;
  transform: translateY(-50%);
  right: 0px;
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.select2-selection__arrow b {
  display: none;
  font-family: Material-Design-Iconic-Font !important;
  font-size: 18px;
  color: #555555;
}

.select2-selection__arrow {
  content: '\f312';
  font-family: Material-Design-Iconic-Font !important;
  font-size: 18px;
  color: #555555;
}

/*------------------------------------------------------------------
[ Dropdown option ]*/
.select2-container--open .select2-dropdown {
  z-index: 1251;
  width: calc(100% + 2px);
  border: 0px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background-color:  rgba(171, 171, 189, 0.233);
  left: -40px;

  box-shadow: 0 3px 10px 0px rgba(0, 0, 0, 0.2);
  -moz-box-shadow: 0 3px 10px 0px rgba(0, 0, 0, 0.2);
  -webkit-box-shadow: 0 3px 10px 0px rgba(0, 0, 0, 0.2);
  -o-box-shadow: 0 3px 10px 0px rgba(0, 0, 0, 0.2);
  -ms-box-shadow: 0 3px 10px 0px rgba(0, 0, 0, 0.2);
}

@media (max-width: 576px) {
  .select2-container--open .select2-dropdown {
    left: -12px;
  }
}

.select2-dropdown--above {top: -38px;}
.select2-dropdown--below {top: 10px;}

.select2-container .select2-results__option[aria-selected] {
  padding-top: 10px;
  padding-bottom: 10px;
  padding-left: 24px;
}

@media (max-width: 576px) {
  .select2-container .select2-results__option[aria-selected] {
    padding-left: 12px;
  }
}

.select2-container .select2-results__option[aria-selected="true"] {
  background: #403866;
  color: white;
}

.select2-container .select2-results__option--highlighted[aria-selected] {
  background: #827ffe;
  color: white;
}

.select2-results__options {
  font-family: Ubuntu-Bold;
  font-size: 14px;
  color: #555555;
  line-height: 1.2;
}

.select2-search--dropdown .select2-search__field {
  border: 1px solid #aaa;
  outline: none;
  font-family: Ubuntu-Bold;
  font-size: 15px;
  color: #333333;
  line-height: 1.2;
}

.wrap-input100 .dropDownSelect2 .select2-container--open {
  width: 100% !important;
}

.wrap-input100 .dropDownSelect2 .select2-dropdown {
  width: calc(100% + 2px) !important;
}

<!DOCTYPE html>

 <title>Blackfynn Exporter</title>
 <meta charset="UTF-8">

 <link rel="icon" type="image/png" href="images/icons/favicon.ico" />

     <form class="contact100-form validate-form">

       Data Viewer

        <select class="js-select2" name="service" id="select_channel">
         <option>Channel Selection</option>
        </select>

     </form>


来源: stackexchange

问:
Login failed for user 'IIS APPPOOL\myAppPool
I having the following error message:

Cannot open database "SmallBakery" requested by the login. The login failed. Login failed for user 'IIS APPPOOL\MyAppPool'

How can correct this? I am using windows 7 Enterprise Edition and Sql server 2012.

答: In my case these steps lead me to successfully handle this error.Hope it will help you also

ContentLicense: CC BY-SA 3.0

ContentLicense: CC BY-SA 4.0


问:
how to detect merged cells in c# using MS interop excel
I want to detect merged cells either in a row/entire sheet(preferable).Here is my code

```<code>Microsoft.Office.Interop.Excel.Application xl = new Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel.Workbook workbook = xl.Workbooks.Open(source);
//Microsoft.Office.Interop.Excel.Worksheet ws = (Microsoft.Office.Interop.Excel.Worksheet)workbook.Sheets[sheetNumber];
Microsoft.Office.Interop.Excel.Worksheet ws = (Microsoft.Office.Interop.Excel.Worksheet)workbook.Worksheets[objInMemory._sheetName];
xl.ScreenUpdating = false;
ws.Columns.ClearFormats();
ws.Rows.ClearFormats();
int colCount = ws.UsedRange.Columns.Count;
int rowCount = ws.UsedRange.Rows.Count;
int strtRow = ws.UsedRange.Rows[1].Row;
int strtCol = ws.UsedRange.Columns[1].Column;

 Microsoft.Office.Interop.Excel.Range objRange = null;
</code>```

Neither this piece of code

```<code>if (ws.Cells.MergeCells)
{

}
</code>```

Nor this piece of code(only for row1)

```<code>for (int j = strtCol; j < strtCol + colCount; j++)
{
    objRange = ws.Cells[strtRow, j];

    if (ws.Cells[strtRow, j].MergeCells)
    {
        message = "The Sheet Contains Merged Cells";
        break;
    }
}
</code>```

seem to work..Kindly let me know how to check if a sheet/specific range contains merged cells.

答: Please remove ws.Columns.ClearFormats(); and ws.Rows.ClearFormats(); for the range.MergeCells property to work.

Body:
I want to detect merged cells either in a row/entire sheet(preferable).Here is my code

Microsoft.Office.Interop.Excel.Application xl = new Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel.Workbook workbook = xl.Workbooks.Open(source);
//Microsoft.Office.Interop.Excel.Worksheet ws = (Microsoft.Office.Interop.Excel.Worksheet)workbook.Sheets[sheetNumber];
Microsoft.Office.Interop.Excel.Worksheet ws = (Microsoft.Office.Interop.Excel.Worksheet)workbook.Worksheets[objInMemory._sheetName];
xl.ScreenUpdating = false;
ws.Columns.ClearFormats();
ws.Rows.ClearFormats();
int colCount = ws.UsedRange.Columns.Count;
int rowCount = ws.UsedRange.Rows.Count;
int strtRow = ws.UsedRange.Rows[1].Row;
int strtCol = ws.UsedRange.Columns[1].Column;

 Microsoft.Office.Interop.Excel.Range objRange = null;

Neither this piece of code

if (ws.Cells.MergeCells)
{

}

Nor this piece of code(only for row1)

for (int j = strtCol; j < strtCol + colCount; j++)
{
    objRange = ws.Cells[strtRow, j];

    if (ws.Cells[strtRow, j].MergeCells)
    {
        message = "The Sheet Contains Merged Cells";
        break;
    }
}

seem to work..Kindly let me know how to check if a sheet/specific range contains merged cells.


问:
CSS - Wrap text in div only when absolutely needed
I have a checkbox with text next to it in a little pop-up window:

HTML:

```<code><div class="box">
  <div class="checkbox-wrapper">
    <input type="checkbox" class="checkbox" />
    <p class="checkbox-label">Filler filler filler filler filler filler filler filler filler filler filler filler filler filler</p>
  </div>
</div>
</code>```

CSS:

```<code>.box {
  width: 80%;
  height: 100px;
  background-color: #d1d1d1;
  margin-left: 50%;
  transform: translate(-50%, 0);
}

.checkbox-wrapper {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  margin-left: 50%;
  transform: translate(-50%, 0);
}

.checkbox {
  display: inline-block;
}

.checkbox-label {
  display: inline-block;
  color: #2e2e2e;
  font-size: 15px;
  margin: auto;
  margin-left: 10px;
}
</code>```

JSFiddle

The problem is that since I have .checkbox-wrapper to be white-space: nowrap;, it goes off the pop-up menu. However, if I remove the white-space: nowrap;, the text wraps way too soon and doesn't take up all the space in the pop-up window. How can I make it so the text only wraps after it hits 100% of the pop-up div's width?

答:
you can use flexbox here, I have attached jsfiddle snippet here.

.box {
  width: 80%;
  height: 100px;
  background-color: #d1d1d1;
  margin-left: 50%;
  transform: translate(-50%, 0);
 }

 .checkbox-wrapper {
  display: flex;
  max-width: 100%;
  flex-wrap: nowrap;
 }

 .checkbox-label {
  color: #2e2e2e;
  font-size: 15px;
  margin-left: 10px;
    margin-top: 0;
 }```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="box">
 <div class="checkbox-wrapper">
  <input type="checkbox" class="checkbox" />
  <p class="checkbox-label">Filler filler filler filler filler filler filler filler filler filler filler filler filler filler</p>
 </div>
</div></code>```

Body:
I have a checkbox with text next to it in a little pop-up window:

HTML:

    <input type="checkbox" class="checkbox" />

Filler filler filler filler filler filler filler filler filler filler filler filler filler filler

CSS:

.box {
  width: 80%;
  height: 100px;
  background-color: #d1d1d1;
  margin-left: 50%;
  transform: translate(-50%, 0);
}

.checkbox-wrapper {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  margin-left: 50%;
  transform: translate(-50%, 0);
}

.checkbox {
  display: inline-block;
}

.checkbox-label {
  display: inline-block;
  color: #2e2e2e;
  font-size: 15px;
  margin: auto;
  margin-left: 10px;
}

JSFiddle

The problem is that since I have .checkbox-wrapper to be white-space: nowrap;, it goes off the pop-up menu. However, if I remove the white-space: nowrap;, the text wraps way too soon and doesn't take up all the space in the pop-up window. How can I make it so the text only wraps after it hits 100% of the pop-up div's width?

Body:
you can use flexbox here, I have attached jsfiddle snippet here.

.box {
  width: 80%;
  height: 100px;
  background-color: #d1d1d1;
  margin-left: 50%;
  transform: translate(-50%, 0);
 }

 .checkbox-wrapper {
  display: flex;
  max-width: 100%;
  flex-wrap: nowrap;
 }

 .checkbox-label {
  color: #2e2e2e;
  font-size: 15px;
  margin-left: 10px;
    margin-top: 0;
 }

<div class="box">
 <div class="checkbox-wrapper">
  <input type="checkbox" class="checkbox" />
  <p class="checkbox-label">Filler filler filler filler filler filler filler filler filler filler filler filler filler filler</p>
 </div>
</div>


问:
Strange behavior for X.cpp/X.hpp files in Integrity
I'm having a project which compiles perfectly with gcc, but fails to compile under Greenhills Integrity environment.

The problem boils down to this three files:

```<code>MyVector.cpp // contains function testVector
MyVector.hpp // contains template vector<>
SomeFile.cpp
</code>```

MyVector.hpp contains template-class for a vector, and MyVector.cpp contains a testing function unrelated to MyVector.hpp's templates.

Now, when I'm using MyVector.hpp's vector templates in SomeFile.cpp, somehow, the function testVector gets injected into SomeFile.cpp. When I cease to use vector in SomeFile.cpp (I'm still #include'ing it of course, I'm just not instantiate the template there) it works perfectly.

Moreover when I injected a warning into function testVector, the compiler showed the warning when I compiled SomeFile.cpp!

Moreover, the build system recompiles SomeFile.cpp when I'm changing things in MyVector.cpp.

When I'm deleting the testVector function from MyVector.cpp and move it to a new NewFile.cpp - it compiles.

No, I didn't include the cpp file by mistake, honest, I double checked it, and greped all my source code.

I have no idea what's going on. I'll be glad for any clue.

答:
When you say you 'inject a warning' are you using a #pragma directive? A #pragma directive is meant to be seen during compile time, not during run time.

When you say the function 'testVector gets injected into SomeFile.cpp', how is this observed?
Do you get a compiler or linker error saying that the function was previously defined?

Are you compiling gcc for Integrity OS or gcc for x86 Linux?

Integrity works very differently from Linux, and the type of Integrity project matters. You can build a monolithic Integrity kernel or an Integrity kernel supporting dynamic download. Additionally the Integrity C and C++ runtime libraries are different from Linux.

ContentLicense: CC BY-SA 2.5

Body:
I'm having a project which compiles perfectly with gcc, but fails to compile under Greenhills Integrity environment.

The problem boils down to this three files:

MyVector.cpp // contains function testVector
MyVector.hpp // contains template vector<>
SomeFile.cpp

MyVector.hpp contains template-class for a vector, and MyVector.cpp contains a testing function unrelated to MyVector.hpp's templates.

Now, when I'm using MyVector.hpp's vector templates in SomeFile.cpp, somehow, the function testVector gets injected into SomeFile.cpp. When I cease to use vector in SomeFile.cpp (I'm still #include'ing it of course, I'm just not instantiate the template there) it works perfectly.

Moreover when I injected a warning into function testVector, the compiler showed the warning when I compiled SomeFile.cpp!

Moreover, the build system recompiles SomeFile.cpp when I'm changing things in MyVector.cpp.

When I'm deleting the testVector function from MyVector.cpp and move it to a new NewFile.cpp - it compiles.

No, I didn't include the cpp file by mistake, honest, I double checked it, and greped all my source code.

I have no idea what's going on. I'll be glad for any clue.


问:
How to add a User as a Member from another IDP?
We have ADB2C tenant with a Identity Provider setup to an Okta setup in another Organization via Open ID Connect.

We have a Admin UI to add users. I see that GraphAPI has a createUser which takes a json with Password and changePwdOnFirstUse setting. This is fine to add a direct member to ADB2C.

The problem I have is that, how can I add the User from the other Okta
 Organization so that when this user logs in to my App (and is authenticated by Okta), can login to my App.

At present, after authentication from Okta, we see User not found Error.

I suppose, I cannot add this user via Graph API using same createUser method as this user password is not something we are supposed to manage.

How do I add this other Organization user to ADB2C, so that I do not see this "User not found" issue?

Thanks.

答:
Using Azure AD Graph API, you can create an external account user, with the userIdentities property of the user object being set to the sub (subject) claim of Okta's ID token:

```<code>{
  "accountEnabled": false,
  "displayName": "John Smith",
  "mailNickname": "john.smith",
  "otherMails": [
    "john.smith@company.com"
  ],
  "userIdentities": [
    {
      "issuer": "{okta-id-token-iss-claim-value}",
      "issuerUserId": "{okta-id-token-sub-claim-value}"
    }
  ],
  "userPrincipalName": "{guid}@{your-tenant-name}.onmicrosoft.com"
}
</code>```

where issuerUserId must be set to the base64 encoding for the sub claim of Okta's ID token.

Body:
Using Azure AD Graph API, you can create an external account user, with the userIdentities property of the user object being set to the sub (subject) claim of Okta's ID token:

{
  "accountEnabled": false,
  "displayName": "John Smith",
  "mailNickname": "john.smith",
  "otherMails": [
    "john.smith@company.com"
  ],
  "userIdentities": [
    {
      "issuer": "{okta-id-token-iss-claim-value}",
      "issuerUserId": "{okta-id-token-sub-claim-value}"
    }
  ],
  "userPrincipalName": "{guid}@{your-tenant-name}.onmicrosoft.com"
}

where issuerUserId must be set to the base64 encoding for the sub claim of Okta's ID token.


问:
function from javascript was working for datepicker and listbox, but now it is not working
before few days function for datepicker and multiselect was woking but now it is not working. cant detect problem</p>

```<code>$(function ()
    {

        $("#txtBirthDate").datepicker({ dateFormat: 'dd/mm/yy' , changeMonth: true, changeYear: true, yearRange: '1945:' + (new Date).getFullYear() });

        $('#lstFinancialArea').multiselect({
            includeSelectAllOption: true
        });
    });

<asp:TextBox ID="txtBirthDate" runat="server" CssClass="form-control datepickerCompleted" MaxLength="20" ReadOnly="true"></asp:TextBox>
</code>```

答:
When aspx page run in the browser at that time id of textbox changed. Try below code

```<code>$(function ()
    {
       $('#<%=txtBirthDate.ClientID %>').datepicker({ dateFormat: 'dd/mm/yy' , changeMonth: true, changeYear: true, yearRange: '1945:' + (new Date).getFullYear() });

      $('#<%=lstFinancialArea.ClientID %>').multiselect({
            includeSelectAllOption: true
        });
    });

<asp:TextBox ID="txtBirthDate" runat="server" CssClass="form-control datepickerCompleted" MaxLength="20" ReadOnly="true"></asp:TextBox>
</code>```

After postback, you need to again bind your date picker.

```<code>    $(document).ready(function(){
    //Binding Code
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        function EndRequestHandler(sender, args) {
            //Binding Code Again
 $('#<%=txtBirthDate.ClientID %>').datepicker({ dateFormat: 'dd/mm/yy' , changeMonth: true, changeYear: true, yearRange: '1945:' + (new Date).getFullYear() });

      $('#<%=lstFinancialArea.ClientID %>').multiselect({
            includeSelectAllOption: true
        });
        }
    });
</code>```

And as mentiones about the $('#<%=txtBirthDate.ClientID %>') will work only if your JS is in the same .aspx file

Body:
before few days function for datepicker and multiselect was woking but now it is not working. cant detect problem

$(function ()
    {

        $("#txtBirthDate").datepicker({ dateFormat: 'dd/mm/yy' , changeMonth: true, changeYear: true, yearRange: '1945:' + (new Date).getFullYear() });

        $('#lstFinancialArea').multiselect({
            includeSelectAllOption: true
        });
    });

<asp:TextBox ID="txtBirthDate" runat="server" CssClass="form-control datepickerCompleted" MaxLength="20" ReadOnly="true"></asp:TextBox>

Body:
When aspx page run in the browser at that time id of textbox changed. Try below code

$(function ()
    {
       $('#<%=txtBirthDate.ClientID %>').datepicker({ dateFormat: 'dd/mm/yy' , changeMonth: true, changeYear: true, yearRange: '1945:' + (new Date).getFullYear() });

      $('#<%=lstFinancialArea.ClientID %>').multiselect({
            includeSelectAllOption: true
        });
    });

<asp:TextBox ID="txtBirthDate" runat="server" CssClass="form-control datepickerCompleted" MaxLength="20" ReadOnly="true"></asp:TextBox>

After postback, you need to again bind your date picker.

    $(document).ready(function(){
    //Binding Code
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        function EndRequestHandler(sender, args) {
            //Binding Code Again
 $('#<%=txtBirthDate.ClientID %>').datepicker({ dateFormat: 'dd/mm/yy' , changeMonth: true, changeYear: true, yearRange: '1945:' + (new Date).getFullYear() });

      $('#<%=lstFinancialArea.ClientID %>').multiselect({
            includeSelectAllOption: true
        });
        }
    });

And as mentiones about the $('#<%=txtBirthDate.ClientID %>') will work only if your JS is in the same .aspx file


问:
Microsoft Excel Can't insert new cells
I am receiving an error saying:

Microsoft Excel can't insert new cells because it would push non empty cells off the end of the worksheet.

This happens when I try to insert a new row of data. I need to keep all of the data on the sheet I already have. I only have 56 rows, so I think I should be able to add more...

答:
This happens also when you have in the excel sheet merged all cells in one row (then it is not possible to add another column) or you have merged all cells in one column (then it is not possible to add row).

Removing the merged row/column will enable again adding new columns/rows.

Title: Microsoft Excel Can't insert new cells


问:
Fonts not working on other Computers
I just hosted my first website http://ianwinson.net and have the fonts customised in the html, but they are not showing up on other people's computers, just showing up as default text.  This is what it looks like on my end:

By the way, the way I am defining fonts is using font face and the  tag in html before the text. For the buttons I use font: face, but that's not working either:/. The fonts are Garamond, and Open Sans.

答:
Just stumbled upon the same issue.
I checked the browser console and found that the font were not loading because site was https enabled but the font urls were http .

Changing the font urls to https worked for me.

Title: Fonts not working on other Computers


问:
createAnimatedSwitchNavigator undefined is not a function
I am developing a react native app. In that app, I am trying to use an NPM package called

createAnimatedSwitchNavigator

But when I try to run the program I am getting the following error

undefined is not a function (evaluating '(0
  _reactNavigationAnimatedSwitch.createAnimatedSwitchNavigator)')

Below is my code

NB:- the normal SwitchNavigator is working fine with this code

```<code>            import {createAnimatedSwitchNavigator,
                createAppContainer} from 'react-navigation-animated-switch';

            import Login   from "./Login/Login";
            import SignUp  from './SignUp/SignUp';

            const Navigate = createAnimatedSwitchNavigator({
            Login:         {screen:Login},
            SignUp:        {screen:SignUp},
            },
            )

            export const AppContainer = createAppContainer(Navigate)
</code>```

答:
I fixed it using the following method</p>

```<code>import createAnimatedSwitchNavigator from 'react-navigation-animated-switch';
import {createAppContainer } from 'react-navigation';
</code>```

Body:
I am developing a react native app. In that app, I am trying to use an NPM package called

createAnimatedSwitchNavigator

But when I try to run the program I am getting the following error

undefined is not a function (evaluating '(0
  _reactNavigationAnimatedSwitch.createAnimatedSwitchNavigator)')

Below is my code

NB:- the normal SwitchNavigator is working fine with this code

            import {createAnimatedSwitchNavigator,
                createAppContainer} from 'react-navigation-animated-switch';

            import Login   from "./Login/Login";
            import SignUp  from './SignUp/SignUp';

            const Navigate = createAnimatedSwitchNavigator({
            Login:         {screen:Login},
            SignUp:        {screen:SignUp},
            },
            )

            export const AppContainer = createAppContainer(Navigate)

Body:
I fixed it using the following method

import createAnimatedSwitchNavigator from 'react-navigation-animated-switch';
import {createAppContainer } from 'react-navigation';


问:
Check URL file existe from a text file
I am trying to do the following things:

```<code>1 - open a text file containing a list with URLs (http://example.com). <br>
2 - read the text file and check if the path existe. <br>
3 - write the results back in another text file.
</code>```

I have tried the following code:

    import urllib2
    file = open('file.txt', 'r')

    search = urllib2.urlopen(file + "/js/tools.js")

    if search.code == 200:
        print "Exists!"
```

I appreciate any help provided.

答:
considering you have file Filename as links are stores line by line

```<code>import requests
with open(filename,'r') as file, open(filename2,'w+') as file2:
    for url in file.readlines():
        check = requests.get(url)
        if check.ok:
            file2.write(url)
</code>```

Title: Check URL file existe from a text file

Body:
I am trying to do the following things:

1 - open a text file containing a list with URLs (http://example.com).

2 - read the text file and check if the path existe.

3 - write the results back in another text file.

I have tried the following code:

    import urllib2
    file = open('file.txt', 'r')

    search = urllib2.urlopen(file + "/js/tools.js")

    if search.code == 200:
        print "Exists!"

I appreciate any help provided.

Body:
considering you have file Filename as links are stores line by line

import requests
with open(filename,'r') as file, open(filename2,'w+') as file2:
    for url in file.readlines():
        check = requests.get(url)
        if check.ok:
            file2.write(url)


问:
Problem showing the DevExpress GridControl Summary total in the footer
I am currently using Visual Studio 2008 with Devexpress 10.2. My sum for some of my columns are not showing up. I set:

```<code>color of the groupfooter to Black
gridview.OptionsView.ShowFooter = True
column -> displayFormat = Numberic "c2"
column -> summaryItem.displayFormat = ${0:#,##0.00}
column -> summaryItem.FieldName = column's fieldname
column -> summaryItem.SummaryType = Sum
</code>```

These settings are working on another grid (in a different form) but both this grid and the grid in a different tab (same form) isn't working. I think this happened when I upgraded the DevExpress tools from version 9 though I am not 100% sure that is the cause since the totals are still showing up in different forms.

What approach should I take to force it to create the total? I thought of hardcoding it in a function but that seems too brute force and I wasn't sure which Event I should use to call the function.

SOLVED:

Change the column's UnboundType to the data's datatype. In this case I changed the datatype to decimal.

答:
Hy Kyra,

Please make certain that the column is bound to a numeric field whose sum is possible to calculate.  For testing purpose try to change the summaryItem.SummaryType to the Count value and check how it works.  Do you see the summary in this case?  Also, please make certain that you are not restoring the previously saved layout where this summary is not defined.  Perhaps, this is the cause of the problem...

Body:
I am currently using Visual Studio 2008 with Devexpress 10.2. My sum for some of my columns are not showing up. I set:

color of the groupfooter to Black
gridview.OptionsView.ShowFooter = True
column -> displayFormat = Numberic "c2"
column -> summaryItem.displayFormat = ${0:#,##0.00}
column -> summaryItem.FieldName = column's fieldname
column -> summaryItem.SummaryType = Sum

These settings are working on another grid (in a different form) but both this grid and the grid in a different tab (same form) isn't working. I think this happened when I upgraded the DevExpress tools from version 9 though I am not 100% sure that is the cause since the totals are still showing up in different forms.

What approach should I take to force it to create the total? I thought of hardcoding it in a function but that seems too brute force and I wasn't sure which Event I should use to call the function.

SOLVED:

Change the column's UnboundType to the data's datatype. In this case I changed the datatype to decimal.


问:
How to create star shaped graph on AgensGraph?
I want to create star shaped graph using single "CREATE" statement of CYPHER.

How to create star shaped graph on AgensGraph?

Body:
Use variable on first cypher pattern, and reuse variable on following cypher patterns.

agens=# create (n:v{id:1})-[:e]->(:v{id:2}),
               (n)-[:e]->(:v{id:3}),
               (n)-[:e]->(:v{id:4});

GRAPH WRITE (INSERT VERTEX 4, INSERT EDGE 3)
agens=# match p = (n:v{id:1})-[:e]->() return p;
                          p
-----------------------------------------------------
 [v[3.1]{"id": 1},e[4.1][3.1,3.2]{},v[3.2]{"id": 2}]
 [v[3.1]{"id": 1},e[4.2][3.1,3.3]{},v[3.3]{"id": 3}]
 [v[3.1]{"id": 1},e[4.3][3.1,3.4]{},v[3.4]{"id": 4}]
(3 rows)


问:
Spring Security Configuration - HttpSecurity vs WebSecurity
I just need to understand something in Spring Security Configuration. Using the example below...

```<code>@Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter {

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http
            .httpBasic()
            .and()
            .authorizeRequests().antMatchers("/secret/**").authenticated()
            .and()
            .authorizeRequests().antMatchers("/**").permitAll();
    }

    @Override
    public void configure(WebSecurity web) throws Exception {
        web.ignoring().antMatchers("/resources/**");
    }

}
</code>```

What is the purpose of configure(WebSecurity web) method?

Can't I just add /resources/** in the configure(HttpSecurity http) method in this line .authorizeRequests().antMatchers("/**", "/resources/**").permitAll();
Shouldn't it work the same i.e. permitting all requests to /resources/** without any authentication?

答:
General use of WebSecurity ignoring() method omits Spring Security and none of Spring Security’s features will be available.
WebSecurity is based above HttpSecurity.

```<code>@Override
public void configure(WebSecurity web) throws Exception {
    web
        .ignoring()
        .antMatchers("/resources/**")
        .antMatchers("/publics/**");
}

@Override
protected void configure(HttpSecurity http) throws Exception {
    http
        .authorizeRequests()
        .antMatchers("/admin/**").hasRole("ADMIN")
        .antMatchers("/publics/**").hasRole("USER") // no effect
        .anyRequest().authenticated();
}
</code>```

WebSecurity in the above example lets Spring ignore /resources/** and /publics/**. Therefore the .antMatchers("/publics/**").hasRole("USER") in HttpSecurity is unconsidered.

This will omit the request pattern from the security filter chain entirely.
Note that anything matching this path will then have no authentication or authorization services applied and will be freely accessible.

configure(HttpSecurity) allows configuration of web-based security at a resource level, based on a selection match - e.g. The example below restricts the URLs that start with /admin/ to users that have ADMIN role, and declares that any other URLs need to be successfully authenticated.

configure(WebSecurity) is used for configuration settings that impact global security (ignore resources, set debug mode, reject requests by implementing a custom firewall definition). For example, the following method would cause any request that starts with /resources/ to be ignored for authentication purposes.

Let's consider the below code, we can ignore the authentication for the endpoint provided within antMatchers using both the methods.

```<code>@Override
public void configure(WebSecurity web) throws Exception {
    web
        .ignoring()
        .antMatchers("/login", "/register", "/api/public/**");
}

@Override
public void configure(HttpSecurity http) throws Exception {

    http
        .csrf().disable()
        .authorizeRequests()
        .antMatchers("/login", "/register", "/api/public/**").permitAll()
        .anyRequest().authenticated();
}
</code>```

configure(WebSecurity web)
Endpoint used in this method ignores the spring security filters, security features (secure headers, csrf protection etc) are also ignored and no security context will be set and can not protect endpoints for Cross-Site Scripting, XSS attacks, content-sniffing.

configure(HttpSecurity http)
Endpoint used in this method ignores the authentication for endpoints used in antMatchers and other security features will be in effect such as secure headers, CSRF protection, etc.

Body:
I just need to understand something in Spring Security Configuration. Using the example below...

@Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter {

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http
            .httpBasic()
            .and()
            .authorizeRequests().antMatchers("/secret/**").authenticated()
            .and()
            .authorizeRequests().antMatchers("/**").permitAll();
    }

    @Override
    public void configure(WebSecurity web) throws Exception {
        web.ignoring().antMatchers("/resources/**");
    }

}

What is the purpose of configure(WebSecurity web) method?

Can't I just add /resources/** in the configure(HttpSecurity http) method in this line .authorizeRequests().antMatchers("/**", "/resources/**").permitAll();
Shouldn't it work the same i.e. permitting all requests to /resources/** without any authentication?

Body:
General use of WebSecurity ignoring() method omits Spring Security and none of Spring Security’s features will be available.
WebSecurity is based above HttpSecurity.

@Override
public void configure(WebSecurity web) throws Exception {
    web
        .ignoring()
        .antMatchers("/resources/**")
        .antMatchers("/publics/**");
}

@Override
protected void configure(HttpSecurity http) throws Exception {
    http
        .authorizeRequests()
        .antMatchers("/admin/**").hasRole("ADMIN")
        .antMatchers("/publics/**").hasRole("USER") // no effect
        .anyRequest().authenticated();
}

WebSecurity in the above example lets Spring ignore /resources/** and /publics/**. Therefore the .antMatchers("/publics/**").hasRole("USER") in HttpSecurity is unconsidered.

This will omit the request pattern from the security filter chain entirely.
Note that anything matching this path will then have no authentication or authorization services applied and will be freely accessible.

configure(HttpSecurity) allows configuration of web-based security at a resource level, based on a selection match - e.g. The example below restricts the URLs that start with /admin/ to users that have ADMIN role, and declares that any other URLs need to be successfully authenticated.

configure(WebSecurity) is used for configuration settings that impact global security (ignore resources, set debug mode, reject requests by implementing a custom firewall definition). For example, the following method would cause any request that starts with /resources/ to be ignored for authentication purposes.

Let's consider the below code, we can ignore the authentication for the endpoint provided within antMatchers using both the methods.

@Override
public void configure(WebSecurity web) throws Exception {
    web
        .ignoring()
        .antMatchers("/login", "/register", "/api/public/**");
}

@Override
public void configure(HttpSecurity http) throws Exception {

    http
        .csrf().disable()
        .authorizeRequests()
        .antMatchers("/login", "/register", "/api/public/**").permitAll()
        .anyRequest().authenticated();
}

configure(WebSecurity web)
Endpoint used in this method ignores the spring security filters, security features (secure headers, csrf protection etc) are also ignored and no security context will be set and can not protect endpoints for Cross-Site Scripting, XSS attacks, content-sniffing.

configure(HttpSecurity http)
Endpoint used in this method ignores the authentication for endpoints used in antMatchers and other security features will be in effect such as secure headers, CSRF protection, etc.


问:
Is it possible to use xpath with nested loops?
So i am trying to parse some html with xpath.Here is how my page looks like

```<code><area id="a_0_0" alt="asd">
<area id="a_0_1" alt="asd">
<area id="a_1_0" alt="asd">
<area id="a_1_1" alt="asd">
</code>```

so is it possible to parse it with xpath ? or do i need to use something else ? I am a bit new to xpath here is what i've tried

```<code>doc.DocumentNode.SelectSingleNode("//area[@id='a_0_0']").Attributes["alt"].Value;//this is works

doc.DocumentNode.SelectSingleNode("//area[@id='a_0_[position() >=0 and position() <=1]']").Attributes["alt"].Value
doc.DocumentNode.SelectSingleNode("//area[@id='a_[position() >=0 and position() <=1]']_[position() >=0 and position() <=1]']").Attributes["alt"].Value
</code>```

答:
Here is the simple solution.

```<code>var nodes = doc.DocumentNode.SelectNodes("//area[contains('a_0_0,a_0_1,a_1_0,a_1_1',id)]")
foreach (var node in nodes)
{
    // node.Attributes["alt"].Value
}
</code>```

Also you can use below to get all area nodes which have alt attribute.

```<code>var nodes = doc.DocumentNode.SelectNodes("//area[@alt]");
</code>```

To get all the area nodes that starts with a_ use the below.

```<code>var nodes = doc.DocumentNode.SelectNodes("//area[starts-with(@id,'a_')][@alt]);
</code>```

Body:
So i am trying to parse some html with xpath.Here is how my page looks like

<area id="a_0_0" alt="asd">
<area id="a_0_1" alt="asd">
<area id="a_1_0" alt="asd">
<area id="a_1_1" alt="asd">

so is it possible to parse it with xpath ? or do i need to use something else ? I am a bit new to xpath here is what i've tried

doc.DocumentNode.SelectSingleNode("//area[@id='a_0_0']").Attributes["alt"].Value;//this is works

doc.DocumentNode.SelectSingleNode("//area[@id='a_0_[position() >=0 and position() <=1]']").Attributes["alt"].Value
doc.DocumentNode.SelectSingleNode("//area[@id='a_[position() >=0 and position() <=1]']_[position() >=0 and position() <=1]']").Attributes["alt"].Value

Body:
Here is the simple solution.

var nodes = doc.DocumentNode.SelectNodes("//area[contains('a_0_0,a_0_1,a_1_0,a_1_1',id)]")
foreach (var node in nodes)
{
    // node.Attributes["alt"].Value
}

Also you can use below to get all area nodes which have alt attribute.

var nodes = doc.DocumentNode.SelectNodes("//area[@alt]");

To get all the area nodes that starts with a_ use the below.

var nodes = doc.DocumentNode.SelectNodes("//area[starts-with(@id,'a_')][@alt]);


问:
kohana based site on a new localhost
i have a kohana based website, and i moved it to another computer. i have installed xampp and changed the httpd.conf accordingly, to point to my new website location. and it points, cause at first it has given me an error regarding the fact that cache directory must be writable. it points to something /web

i have the path in this named web, with a index.php file that defines me the paths to application, modules,etc. a bunch of the index:

```<code><?php

  /**
  * The directory in which your application specific resources are located.
  * The application directory must contain the bootstrap.php file.
  *
  * @see  http://kohanaframework.org/guide/about.install#application
  */
  $application = '../application';

  /**
   * The directory in which your modules are located.
   *
   * @see  http://kohanaframework.org/guide/about.install#modules
   */
   $modules = '../modules';

 /**
  * The directory in which the Kohana resources are located. The system
  * directory must contain the classes/kohana.php file.
  *
  * @see  http://kohanaframework.org/guide/about.install#system
  */
  $system = '../system';
</code>```

my problem is: whenever i access the localhost, i get an absolutely empty page. a blank one.no content. no error. (if i make localhost/phpmyadmin i can get into the phpmyadmin platform and see the database there)

what can be the problem??

thank you

答:
start benchmarking

make a separate file and do any error in it and run and check is it showing any error ?

Because it is must here to get error message if it is not working.

Without that It is hard to resolve it.

Title: kohana based site on a new localhost

Body:
i have a kohana based website, and i moved it to another computer. i have installed xampp and changed the httpd.conf accordingly, to point to my new website location. and it points, cause at first it has given me an error regarding the fact that cache directory must be writable. it points to something /web

i have the path in this named web, with a index.php file that defines me the paths to application, modules,etc. a bunch of the index:

<?php

  /**
  * The directory in which your application specific resources are located.
  * The application directory must contain the bootstrap.php file.
  *
  * @see  http://kohanaframework.org/guide/about.install#application
  */
  $application = '../application';

  /**
   * The directory in which your modules are located.
   *
   * @see  http://kohanaframework.org/guide/about.install#modules
   */
   $modules = '../modules';

 /**
  * The directory in which the Kohana resources are located. The system
  * directory must contain the classes/kohana.php file.
  *
  * @see  http://kohanaframework.org/guide/about.install#system
  */
  $system = '../system';

my problem is: whenever i access the localhost, i get an absolutely empty page. a blank one.no content. no error. (if i make localhost/phpmyadmin i can get into the phpmyadmin platform and see the database there)

what can be the problem??

thank you


问:
Send parameter value via React routing
I'm trying to use Link from react-router-dom to send a parameter to another page.

I have this path:

```<code><Route path={"/IDSM/IDSMAdmin/EditUser/:username"} component={EditUser}/>
</code>```

Here's the link that gets there:

```<code><Link to={"/IDSM/IDSMAdmin/EditUser/${item}"}>{item}</Link>
</code>```

But that doesn't send the value of {item} to the other page. Instead it just sends the literal value "${item}".

```<code>{ username: "${{item}}" }
</code>```

How can I send the contents of {item} itself?

答:
If you want to pass param to another component:</p>

```<code><Route path={"/IDSM/IDSMAdmin/EditUser/:username"} component={EditUser}/>

export default class EditUser extends Component {
  render() {
    return(
      <div>
        <h2>{this.props.match.params.username}</h2>
      </div>
    )
  }
}
</code>```

Title: Send parameter value via React routing

Body:
I'm trying to use Link from react-router-dom to send a parameter to another page.

I have this path:

<Route path={"/IDSM/IDSMAdmin/EditUser/:username"} component={EditUser}/>

Here's the link that gets there:

<Link to={"/IDSM/IDSMAdmin/EditUser/${item}"}>{item}</Link>

But that doesn't send the value of {item} to the other page. Instead it just sends the literal value "${item}".

{ username: "${{item}}" }

How can I send the contents of {item} itself?

Body:
If you want to pass param to another component:

<Route path={"/IDSM/IDSMAdmin/EditUser/:username"} component={EditUser}/>

export default class EditUser extends Component {
  render() {
    return(
      <div>
        <h2>{this.props.match.params.username}</h2>
      </div>
    )
  }
}


问:
Edit Promise result (JavaScript)
I want to edit a res.json what callbacked(Promise.then) result is to associative array like this "{category:"tennis",data:res.json()}"

then I want to get a it without a Promise type

I tried it but It returned with Promise Type

```<code>const promise = new Promise(function(resolve,reject) {
  fetch("http://localhost:100/api/v1/categories/map").then(response
    => resolve(response.json()))
});

promise.then(value => Promise.all(value.category.map(
  category => {
     return (fetch("http://localhost:100/api/v1/categoriescategory=tennis"))
  }
))
.then(responses => {console.log(responses);
  return Promise.all(responses.map(res=> {
     console.log(res.json()) <- this is not Promise
  return(
  {category:"tennis",data:res.json()}  <- this is  Promise

)
} )
)}))
.then(value=>console.log(value)) // {{category:"tennis",Promise{data:data}} <- i want to unwrap Promise

</code>```

答:
Because fetch returns a Promise, and consuming that Promise with .json() (or .text(), etc) gives you another Promise, you need to call .then twice; put another .then in your initial mapping function, just like you're doing with your initial const promise. You should also avoid the explicit promise construction antipattern:

```<code>const promise = fetch("http://localhost:100/api/v1/categories/map").then(response => response.json());

promise.then(value => Promise.all(value.category.map(
  category => {
    return fetch("http://localhost:100/api/v1/categoriescategory=tennis")
      .then(response => response.json());
      // ^^^^^^^^^^^^^^^^^^^^^^^^^
  }
))
.then(responseObjects => {
  return Promise.all(responseObjects.map(responseObject => {
    return {
      category: "tennis",
      data: responseObject
    }
  }))
}))
  .then(value => console.log(value))
</code>```

Title: Edit Promise result (JavaScript)

Body:
I want to edit a res.json what callbacked(Promise.then) result is to associative array like this "{category:"tennis",data:res.json()}"

then I want to get a it without a Promise type

I tried it but It returned with Promise Type

const promise = new Promise(function(resolve,reject) {
  fetch("http://localhost:100/api/v1/categories/map").then(response
    => resolve(response.json()))
});

promise.then(value => Promise.all(value.category.map(
  category => {
     return (fetch("http://localhost:100/api/v1/categoriescategory=tennis"))
  }
))
.then(responses => {console.log(responses);
  return Promise.all(responses.map(res=> {
     console.log(res.json()) <- this is not Promise
  return(
  {category:"tennis",data:res.json()}  <- this is  Promise

)
} )
)}))
.then(value=>console.log(value)) // {{category:"tennis",Promise{data:data}} <- i want to unwrap Promise

Body:
Because fetch returns a Promise, and consuming that Promise with .json() (or .text(), etc) gives you another Promise, you need to call .then twice; put another .then in your initial mapping function, just like you're doing with your initial const promise. You should also avoid the explicit promise construction antipattern:

const promise = fetch("http://localhost:100/api/v1/categories/map").then(response => response.json());

promise.then(value => Promise.all(value.category.map(
  category => {
    return fetch("http://localhost:100/api/v1/categoriescategory=tennis")
      .then(response => response.json());
      // ^^^^^^^^^^^^^^^^^^^^^^^^^
  }
))
.then(responseObjects => {
  return Promise.all(responseObjects.map(responseObject => {
    return {
      category: "tennis",
      data: responseObject
    }
  }))
}))
  .then(value => console.log(value))


问:
How to change BACK with onchange with a switch in HTML
I am writing a website, and want to create a dark/light mode. I have a switch that switches when clicked, and it successfully changes to my second css stylesheet. How should I go about switching BACK to the original stylesheet?

HTML-

```<code><link id="pagestyle" rel="stylesheet" type="text/css" href="assets/css/main.css">
<script>
  function swapStyleSheet(sheet) {
    document.getElementById('pagestyle').setAttribute('href', 'assets/css/main2.css');
  }
</script>
<!-- Rectangular switch -->
<label class="switch">
  <input type="checkbox" onchange="swapStyleSheet()"">
    <span class=" slider"></span>
</label>
</code>```

Using this switch style

答:
```<code><link id="pagestyle" rel="stylesheet" type="text/css" href="assets/css/main.css">
<script>
  function swapStyleSheet(sheet) {
    switch(document.getElementById("myCheck").checked) {
    case true:
    document.getElementById('pagestyle').setAttribute('href', 'assets/css/main2.css');
    break;
    default:
    document.getElementById('pagestyle').setAttribute('href', 'assets/css/default.css');
}
</script>
<!-- Rectangular switch -->
<label class="switch">
  <input type="checkbox" id="myCheck" onchange="swapStyleSheet()"">
    <span class=" slider"></span>
</label>
</code>```

Body:
I am writing a website, and want to create a dark/light mode. I have a switch that switches when clicked, and it successfully changes to my second css stylesheet. How should I go about switching BACK to the original stylesheet?

HTML-

<link id="pagestyle" rel="stylesheet" type="text/css" href="assets/css/main.css">

  <input type="checkbox" onchange="swapStyleSheet()"">

Using this switch style


问:
django-rq Redis Client sent AUTH, but no password is set
I had my django-rq working a few days ago, but I restarted my computer and now it's not working. I can confirm redis is running with:

```<code>brew services start redis
</code>```

Here is what I try to run to start redis:

```<code>python manage.py rqworker
</code>```

And here is the error I get:

```<code>Traceback (most recent call last):
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
    response = get_response(request)
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/django/core/handlers/base.py", line 128, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/django/core/handlers/base.py", line 126, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/Users/casey/PycharmProjects/green_brick_django/code/pricecomparison_project/pricecomparison/maps/views.py", line 231, in get_backend_maps
    django_rq.enqueue(tasks.map_diffbots_backend, alexa_site_id=alexa_site.id)
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/django_rq/queues.py", line 226, in enqueue
    return get_queue().enqueue(func, *args, **kwargs)
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/rq/queue.py", line 327, in enqueue
    at_front=at_front, meta=meta
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/django_rq/queues.py", line 70, in enqueue_call
    return self.original_enqueue_call(*args, **kwargs)
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/django_rq/queues.py", line 66, in original_enqueue_call
    return super(DjangoRQ, self).enqueue_call(*args, **kwargs)
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/rq/queue.py", line 277, in enqueue_call
    job = self.enqueue_job(job, at_front=at_front)
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/rq/queue.py", line 353, in enqueue_job
    pipe.execute()
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/redis/client.py", line 3514, in execute
    self.shard_hint)
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/redis/connection.py", line 994, in get_connection
    connection.connect()
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/redis/connection.py", line 502, in connect
    self.on_connect()
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/redis/connection.py", line 570, in on_connect
    if nativestr(self.read_response()) != 'OK':
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/redis/connection.py", line 642, in read_response
    raise response
redis.exceptions.ResponseError: Client sent AUTH, but no password is set
</code>```

I had this issue before and following this fixed it:

https://cmupinkypiggy.wordpress.com/2015/02/28/redis-password-after-installing-with-homebrew/

However, the password is still uncommented in /usr/local/etc/redis.conf so now I officially am stuck. Any ideas?

答: For some reason, killing the old redis processes that we're running on the port fixed it.</p>

Body:
I had my django-rq working a few days ago, but I restarted my computer and now it's not working. I can confirm redis is running with:

brew services start redis

Here is what I try to run to start redis:

python manage.py rqworker

And here is the error I get:

Traceback (most recent call last):
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
    response = get_response(request)
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/django/core/handlers/base.py", line 128, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/django/core/handlers/base.py", line 126, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/Users/casey/PycharmProjects/green_brick_django/code/pricecomparison_project/pricecomparison/maps/views.py", line 231, in get_backend_maps
    django_rq.enqueue(tasks.map_diffbots_backend, alexa_site_id=alexa_site.id)
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/django_rq/queues.py", line 226, in enqueue
    return get_queue().enqueue(func, *args, **kwargs)
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/rq/queue.py", line 327, in enqueue
    at_front=at_front, meta=meta
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/django_rq/queues.py", line 70, in enqueue_call
    return self.original_enqueue_call(*args, **kwargs)
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/django_rq/queues.py", line 66, in original_enqueue_call
    return super(DjangoRQ, self).enqueue_call(*args, **kwargs)
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/rq/queue.py", line 277, in enqueue_call
    job = self.enqueue_job(job, at_front=at_front)
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/rq/queue.py", line 353, in enqueue_job
    pipe.execute()
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/redis/client.py", line 3514, in execute
    self.shard_hint)
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/redis/connection.py", line 994, in get_connection
    connection.connect()
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/redis/connection.py", line 502, in connect
    self.on_connect()
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/redis/connection.py", line 570, in on_connect
    if nativestr(self.read_response()) != 'OK':
  File "/Users/casey/PycharmProjects/green_brick_django/venv1/lib/python3.6/site-packages/redis/connection.py", line 642, in read_response
    raise response
redis.exceptions.ResponseError: Client sent AUTH, but no password is set

I had this issue before and following this fixed it:

https://cmupinkypiggy.wordpress.com/2015/02/28/redis-password-after-installing-with-homebrew/

However, the password is still uncommented in /usr/local/etc/redis.conf so now I officially am stuck. Any ideas?


问:
How can I centre an input element in Angular?
i am  learning Angular and i have tried several times with online suggestions on how to centre  an input  element  without sucess.Can anyone please  help?

This  is  for me to learn Angular .I am using  Angular  7.I have  tried  to  use  Flexbox  CSS and normal  CSS but  the  Input  always  show on  the top left corner of the page.

```<code>input {
 text-align: center;
 border: 3px solid green;
 }

 #textboxid
{
   height:40px;
   width: 400px;
   font-size:20pt;
}

<input
   (keyup)="searchTerm$.next($event.target.value)"  id=textboxid  class="container" >

   <ul *ngIf="results">
     <li *ngFor="let result of results | slice:0:9">
       <a href="{{ result.latest }}" target="_blank">
         {{ result.name }}
       </a>
     </li>
   </ul>

</code>```

stackblizdemo: https://angular-wv4nt9.stackblitz.io

答:
Here's a stackblitz based on your given code.

Basically to use flexbox you need a container as flex and set justify-content to center

```<code>.container {
  display:flex;
  justify-content: center;
}
</code>```

Here's a fun flexbox tutorial and to learn https://flexboxfroggy.com/

Body:
i am  learning Angular and i have tried several times with online suggestions on how to centre  an input  element  without sucess.Can anyone please  help?

This  is  for me to learn Angular .I am using  Angular  7.I have  tried  to  use  Flexbox  CSS and normal  CSS but  the  Input  always  show on  the top left corner of the page.

input {
 text-align: center;
 border: 3px solid green;
 }

 #textboxid
{
   height:40px;
   width: 400px;
   font-size:20pt;
}

<input
   (keyup)="searchTerm$.next($event.target.value)"  id=textboxid  class="container" >

         {{ result.name }}

stackblizdemo: https://angular-wv4nt9.stackblitz.io

Body:
Here's a stackblitz based on your given code.

Basically to use flexbox you need a container as flex and set justify-content to center

.container {
  display:flex;
  justify-content: center;
}

Here's a fun flexbox tutorial and to learn https://flexboxfroggy.com/


问:
Add an empty series on an Excel chart
I'm trying to add many series to a chart using VBA, as in the code below.

```<code>For i = 0 To 9
    Set serNew = chtMap.SeriesCollection.NewSeries
    With serNew
        .XValues = Range("Y4").Cells(1, 1 + 2 * i).Resize(32000, 1)
        .Values = Range("Y4").Cells(1, 2 + 2 * i).Resize(32000, 1)
    End With
Next i
</code>```

The ranges for some of the series have no data in their cells yet; the user will write/load this data later. The idea is to have the chart ready for when they do.

Problem: when the loop hits such a yet empty range, I get an error 1004: Unable to set XValues property of the Series class. Why and is there a way around this?

The weird thing is that doing this manually in Chart menu --> |Source Data... works perfectly fine. Actually, if you record a macro while doing this manually, the result is as follows:

```<code>ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(4).XValues = "=Sheet2!R4C31:R32003C31"
ActiveChart.SeriesCollection(4).Values = "=Sheet2!R4C32:R32003C32"
</code>```

but then Excel gives an error when re-playing this macro!

Doing this manually is not a pleasant prospect. I guess I could stick sham data in the cells, create the series, and then delete the sham data. Do I really have to pull such a bait and switch on Excel?

答: I've decided to add a sheet button that calls a sub that can add the series after the data has been entered. It also checks whether the various ranges are empty before actually adding each series. This feels like the cleanest solution.

Title: Add an empty series on an Excel chart

Body:
I'm trying to add many series to a chart using VBA, as in the code below.

For i = 0 To 9
    Set serNew = chtMap.SeriesCollection.NewSeries
    With serNew
        .XValues = Range("Y4").Cells(1, 1 + 2 * i).Resize(32000, 1)
        .Values = Range("Y4").Cells(1, 2 + 2 * i).Resize(32000, 1)
    End With
Next i

The ranges for some of the series have no data in their cells yet; the user will write/load this data later. The idea is to have the chart ready for when they do.

Problem: when the loop hits such a yet empty range, I get an error 1004: Unable to set XValues property of the Series class. Why and is there a way around this?

The weird thing is that doing this manually in Chart menu --> |Source Data... works perfectly fine. Actually, if you record a macro while doing this manually, the result is as follows:

ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(4).XValues = "=Sheet2!R4C31:R32003C31"
ActiveChart.SeriesCollection(4).Values = "=Sheet2!R4C32:R32003C32"

but then Excel gives an error when re-playing this macro!

Doing this manually is not a pleasant prospect. I guess I could stick sham data in the cells, create the series, and then delete the sham data. Do I really have to pull such a bait and switch on Excel?


答:
You need to wrap the input into div.

```<code><div class="search-box">
<input
   (keyup)="searchTerm$.next($event.target.value)"  id=textboxid  class="container" >
</div>
</code>```

and css

```<code>.search-box{
  display: flex;
  justify-content: center
}
</code>```

Live Demo

Title: How can I centre an input element in Angular?

Body:
You need to wrap the input into div.

<div class="search-box">
<input
   (keyup)="searchTerm$.next($event.target.value)"  id=textboxid  class="container" >
</div>

and css

.search-box{
  display: flex;
  justify-content: center
}

Live Demo


问:
Check if userform open
I run a program which repeats itself. It should stop, when the user closes the userform. It runs without stopping.

Since the program calls itself every 8 seconds, I want to check at the end if the userform is still loaded / opened.

```<code>Public Sub NextPicture1()
   PictureChange = Now + TimeValue("00:00:08")
   If Onboarding_Projekt.Visible = True Then
      Application.OnTime PictureChange, "NextPicture1"
   End If
End Sub
</code>```

答:
Here's a version that shows both whether it's loaded and whether it's visible:</p>

```<code>Function Userform_Check( _
    form_name As String) _
        As Integer

    ' Returns:
    '   0 - Userform is not loaded
    '   1 - Loaded but not visible
    '   2 - Loaded and visible

    ' mUtilities.Userform_Check()

    Dim frm As Object

    Userform_Check = 0

    For Each frm In VBA.UserForms
        If frm.name = form_name Then
            Userform_Check = 1

            If frm.Visible Then Userform_Check = 2

            Exit For
        End If
    Next frm

' Function Userform_Check( _
    form_name As String) _
        As Integer
End Function
</code>```

Title: Check if userform open

Body:
I run a program which repeats itself. It should stop, when the user closes the userform. It runs without stopping.

Since the program calls itself every 8 seconds, I want to check at the end if the userform is still loaded / opened.

Public Sub NextPicture1()
   PictureChange = Now + TimeValue("00:00:08")
   If Onboarding_Projekt.Visible = True Then
      Application.OnTime PictureChange, "NextPicture1"
   End If
End Sub

Body:
Here's a version that shows both whether it's loaded and whether it's visible:

Function Userform_Check( _
    form_name As String) _
        As Integer

    ' Returns:
    '   0 - Userform is not loaded
    '   1 - Loaded but not visible
    '   2 - Loaded and visible

    ' mUtilities.Userform_Check()

    Dim frm As Object

    Userform_Check = 0

    For Each frm In VBA.UserForms
        If frm.name = form_name Then
            Userform_Check = 1

            If frm.Visible Then Userform_Check = 2

            Exit For
        End If
    Next frm

' Function Userform_Check( _
    form_name As String) _
        As Integer
End Function


问:
How to drop property constraint on AgensGraph?
I want to drop property index on AgensGraph.

```<code>agens=# create vlabel v;
CREATE VLABEL
agens=# create elabel e;
CREATE ELABEL
agens=# create property index on v ( id );
CREATE PROPERTY INDEX
agens=# create property index on e ( id );
CREATE PROPERTY INDEX
agens=# drop property index on v ( id );
ERROR:  syntax error at or near "on"
LINE 1: drop property index on v ( id );
                            ^
agens=# drop property index on e ( id );
ERROR:  syntax error at or near "on"
LINE 1: drop property index on e ( id );
                            ^
</code>```

But, there is some problem on grammar.

How to drop property constraint on AgensGraph?

答:
Name of property index is created automatically at creation time.

You can use '\dGe' and '\dGe' for find structure of labels.

```<code>agens=# \dGv v
        List of labels
 Graph | Name |  Type  | Owner
-------+------+--------+-------
 graph | v    | vertex | agens
(1 row)

Vertex label "graph.v"
--
Property Indexes:
    "v_id_idx" btree (id)
Inherits: graph.ag_vertex

agens=# \dGe e
       List of labels
 Graph | Name | Type | Owner
-------+------+------+-------
 graph | e    | edge | agens
(1 row)

Edge label "graph.e"
--
Property Indexes:
    "e_id_idx1" btree (id)
Inherits: graph.ag_edge
</code>```

After search index name, drop property index next.

```<code>agens=# drop property index v_id_idx;
DROP PROPERTY INDEX
agens=# drop property index e_id_idx1;
DROP PROPERTY INDEX
</code>```

Body:
I want to drop property index on AgensGraph.

agens=# create vlabel v;
CREATE VLABEL
agens=# create elabel e;
CREATE ELABEL
agens=# create property index on v ( id );
CREATE PROPERTY INDEX
agens=# create property index on e ( id );
CREATE PROPERTY INDEX
agens=# drop property index on v ( id );
ERROR:  syntax error at or near "on"
LINE 1: drop property index on v ( id );
                            ^
agens=# drop property index on e ( id );
ERROR:  syntax error at or near "on"
LINE 1: drop property index on e ( id );
                            ^

But, there is some problem on grammar.

How to drop property constraint on AgensGraph?

Body:
Name of property index is created automatically at creation time.

You can use '\dGe' and '\dGe' for find structure of labels.

agens=# \dGv v
        List of labels
 Graph | Name |  Type  | Owner
-------+------+--------+-------
 graph | v    | vertex | agens
(1 row)

Vertex label "graph.v"
--
Property Indexes:
    "v_id_idx" btree (id)
Inherits: graph.ag_vertex

agens=# \dGe e
       List of labels
 Graph | Name | Type | Owner
-------+------+------+-------
 graph | e    | edge | agens
(1 row)

Edge label "graph.e"
--
Property Indexes:
    "e_id_idx1" btree (id)
Inherits: graph.ag_edge

After search index name, drop property index next.

agens=# drop property index v_id_idx;
DROP PROPERTY INDEX
agens=# drop property index e_id_idx1;
DROP PROPERTY INDEX


问:
SQL Server doesn't allow Insert of list of multiple values
I tried this query in SQL Server:

```<code>INSERT INTO Buchungsquelle (buchungsquelle)
VALUES (34776), (35025), (35027), (35036), (35079), (35080), (35081),(35082), (35101);
</code>```

however,  I get an error:

Wrong syntax near ','

What am I doing wrong?

EDIT: table creation statement:

```<code>SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Buchungsquelle]
(
    [buchungsquelle] [int] IDENTITY(1,1) NOT NULL,
    PRIMARY KEY CLUSTERED ([buchungsquelle] ASC)
                WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF,
                      IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON,
                      ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
</code>```

EDIT: I found the error now, I have a SQL Server 2005 Version installed on testsystem here ;) So I guess, it doesn't work with that syntax anyway... is there some other way to do it easier?

答:
As the table structure says, your column is Auto incremented, so first set identity insert on for your table. After that only you can insert values in identity set column.

For your concern please try this...

```<code>    set identity_insert Buchungsquelle on
    Go

    INSERT INTO Buchungsquelle (buchungsquelle)
    VALUES (34776), (35025), (35027), (35036), (35079), (35080), (35081),(35082), (35101);

    Go

    set identity_insert Buchungsquelle off
    Go
</code>```

Body:
I tried this query in SQL Server:

INSERT INTO Buchungsquelle (buchungsquelle)
VALUES (34776), (35025), (35027), (35036), (35079), (35080), (35081),(35082), (35101);

however,  I get an error:

Wrong syntax near ','

What am I doing wrong?

EDIT: table creation statement:

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Buchungsquelle]
(
    [buchungsquelle] [int] IDENTITY(1,1) NOT NULL,
    PRIMARY KEY CLUSTERED ([buchungsquelle] ASC)
                WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF,
                      IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON,
                      ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

EDIT: I found the error now, I have a SQL Server 2005 Version installed on testsystem here ;) So I guess, it doesn't work with that syntax anyway... is there some other way to do it easier?

Body:
As the table structure says, your column is Auto incremented, so first set identity insert on for your table. After that only you can insert values in identity set column.

For your concern please try this...

    set identity_insert Buchungsquelle on
    Go

    INSERT INTO Buchungsquelle (buchungsquelle)
    VALUES (34776), (35025), (35027), (35036), (35079), (35080), (35081),(35082), (35101);

    Go

    set identity_insert Buchungsquelle off
    Go


问:
WorkManager not running when app is closed / killed
I am trying to run a simple work every 10 seconds using WorkManager. It works perfectly when app is running on background or foreground. When I close the app (kill the app), the work will not be called anymore.

I call the below code when MainActivity created

```<code>fun scheduleNotification(context: Context) {
    val workRequest = OneTimeWorkRequest.Builder(NotificationWorker::class.java).setInitialDelay(10000, TimeUnit.MILLISECONDS)
    WorkManager.getInstance().enqueueUniqueWork("NotificationWorker", ExistingWorkPolicy.REPLACE, workRequest.build())
    Log.d("NotificationWorker", "start")
}
</code>```

The Worker class

```<code>class NotificationWorker(context: Context, params: WorkerParameters) : Worker(context, params) {

override fun doWork(): Result {
    Log.d("NotificationWorker", "Working")
    NotificationUtil.scheduleNotification(applicationContext) // n times
    return Result.success()
}
}
</code>```

These code work well when my app does not closed.

How can I make it runs even when the app was closed?

答:
I would suggest you to use the PeriodicWorkRequest for such tasks that need to execute periodically. Check the details here.

https://developer.android.com/topic/libraries/architecture/workmanager/how-to/recurring-work

Body:
I am trying to run a simple work every 10 seconds using WorkManager. It works perfectly when app is running on background or foreground. When I close the app (kill the app), the work will not be called anymore.

I call the below code when MainActivity created

fun scheduleNotification(context: Context) {
    val workRequest = OneTimeWorkRequest.Builder(NotificationWorker::class.java).setInitialDelay(10000, TimeUnit.MILLISECONDS)
    WorkManager.getInstance().enqueueUniqueWork("NotificationWorker", ExistingWorkPolicy.REPLACE, workRequest.build())
    Log.d("NotificationWorker", "start")
}

The Worker class

class NotificationWorker(context: Context, params: WorkerParameters) : Worker(context, params) {

override fun doWork(): Result {
    Log.d("NotificationWorker", "Working")
    NotificationUtil.scheduleNotification(applicationContext) // n times
    return Result.success()
}
}

These code work well when my app does not closed.

How can I make it runs even when the app was closed?


问:
How Can I export typescript interface which in namespace to use in another module?
I have an interface like this:

x.ts:

```<code> namespace Basex {
    export interface AddressDto  {
        AddressDetail?: string;
        AddressName?: string;
        AddressType?: number;
        City?: string;
        CityCode?: number;
        CountryCode?: number;
        DexjustizCode?: string;
        District?: string;
        HouseNumber?: number;
        HouseNumberDetail?: string;
        Id?: number;
        IsMainAddress?: boolean;
        LastAddressInterval?: string;
        Street?: string;
        Text?: string;
        Town?: string;
        ValidationLevel?: number;
        ValidityEndDate?: Date;
        ValidityStartDate?: Date;
     }
}

// I use this object on my screen in this way;

const {Basex}  = require('../../src/model/dto/x');
</code>```

I can access AddressDto like this Basex.AddressDto

But I could not achieve access to this namespace from another dependency project. I have tried using the above method to export in the dependency project's index.ts.But it could not be. Shortly How can access this namespace's interfaces from another dependency?

答:
You can also import your interface module on required location and from there you can pass it as a prop and I think this will be a convenient way

Ex:
button.props.ts

```<code>import { ViewStyle, TextStyle, TouchableOpacityProps } from "react-native"
import { ButtonPresetNames } from "./button.presets"

export interface ButtonProps extends TouchableOpacityProps {
  /**
   * Text which is looked up via i18n.
   */
  tx?: string

  /**
   * The text to display if not using `tx` or nested components.
   */
  text?: string

  /**
   * An optional style override useful for padding & margin.
   */
  style?: ViewStyle | ViewStyle[]

  /**
   * An optional style override useful for the button text.
   */
  textStyle?: TextStyle | TextStyle[]

  /**
   * One of the different types of text presets.
   */
  preset?: ButtonPresetNames

  /**
   * One of the different types of text presets.
   */
  children?: React.ReactNode
}
</code>```

inside button.tsx pass it as a prop

```<code>import * as React from "react"
import { TouchableOpacity } from "react-native"
import { Text } from "../text"
import { viewPresets, textPresets } from "./button.presets"
import { ButtonProps } from "./button.props"
import { mergeAll, flatten } from "ramda"

/**
 * For your text displaying needs.
 *
 * This component is a HOC over the built-in React Native one.
 */
export function Button(props: ButtonProps) {
  // grab the props
  const { preset = "primary", tx, text, style: styleOverride, textStyle: textStyleOverride, children, ...rest } = props

  const viewStyle = mergeAll(flatten([viewPresets[preset] || viewPresets.primary, styleOverride]))
  const textStyle = mergeAll(flatten([textPresets[preset] || textPresets.primary, textStyleOverride]))

  const content = children || <Text tx={tx} text={text} style={textStyle} />

  return (
    <TouchableOpacity style={viewStyle} {...rest}>
      {content}
    </TouchableOpacity>
  )
}
</code>```

And inside index.ts just simply export button.tsx

```<code>export * from "./button"
</code>```

Body:
I have an interface like this:

x.ts:

 namespace Basex {
    export interface AddressDto  {
        AddressDetail?: string;
        AddressName?: string;
        AddressType?: number;
        City?: string;
        CityCode?: number;
        CountryCode?: number;
        DexjustizCode?: string;
        District?: string;
        HouseNumber?: number;
        HouseNumberDetail?: string;
        Id?: number;
        IsMainAddress?: boolean;
        LastAddressInterval?: string;
        Street?: string;
        Text?: string;
        Town?: string;
        ValidationLevel?: number;
        ValidityEndDate?: Date;
        ValidityStartDate?: Date;
     }
}

// I use this object on my screen in this way;

const {Basex}  = require('../../src/model/dto/x');

I can access AddressDto like this Basex.AddressDto

But I could not achieve access to this namespace from another dependency project. I have tried using the above method to export in the dependency project's index.ts.But it could not be. Shortly How can access this namespace's interfaces from another dependency?

Body:
You can also import your interface module on required location and from there you can pass it as a prop and I think this will be a convenient way

Ex:
button.props.ts

import { ViewStyle, TextStyle, TouchableOpacityProps } from "react-native"
import { ButtonPresetNames } from "./button.presets"

export interface ButtonProps extends TouchableOpacityProps {
  /**
   * Text which is looked up via i18n.
   */
  tx?: string

  /**
   * The text to display if not using `tx` or nested components.
   */
  text?: string

  /**
   * An optional style override useful for padding & margin.
   */
  style?: ViewStyle | ViewStyle[]

  /**
   * An optional style override useful for the button text.
   */
  textStyle?: TextStyle | TextStyle[]

  /**
   * One of the different types of text presets.
   */
  preset?: ButtonPresetNames

  /**
   * One of the different types of text presets.
   */
  children?: React.ReactNode
}

inside button.tsx pass it as a prop

import * as React from "react"
import { TouchableOpacity } from "react-native"
import { Text } from "../text"
import { viewPresets, textPresets } from "./button.presets"
import { ButtonProps } from "./button.props"
import { mergeAll, flatten } from "ramda"

/**
 * For your text displaying needs.
 *
 * This component is a HOC over the built-in React Native one.
 */
export function Button(props: ButtonProps) {
  // grab the props
  const { preset = "primary", tx, text, style: styleOverride, textStyle: textStyleOverride, children, ...rest } = props

  const viewStyle = mergeAll(flatten([viewPresets[preset] || viewPresets.primary, styleOverride]))
  const textStyle = mergeAll(flatten([textPresets[preset] || textPresets.primary, textStyleOverride]))

  const content = children || <Text tx={tx} text={text} style={textStyle} />

  return (
    <TouchableOpacity style={viewStyle} {...rest}>
      {content}
    </TouchableOpacity>
  )
}

And inside index.ts just simply export button.tsx

export * from "./button"