text:
Q: How do I get the container over my background picture in Twitter Bootstrap I´m currently trying to make a website with twitter bootstrap.
Unfortunately, I can not create a background image so that my container pushes about it. Always pushes the background over my background picture. Can someone tell me how to do this?
here you can see my problem

@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,300,700);
body {
  background: #e5e5e5;
  color: #999;
}

header {
  background-image: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url(https://static.pexels.com/photos/343299/pexels-photo-343299.jpeg);
  background-size: cover;
  background-position: center;
  height: 100vh; /* 100% of the viewport's height */
  background-attachment: fixed;
}

/*#header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 75px;
  z-index: 99999;
}*/

.container {
  position:relative
}
.content {
    background-color:red;
    height: 100%;
    min-height: 100vh;
}

.backgroundImage {
  width: 100%;
  height: auto;
  z-index: 1;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: #777;
  font-weight: 300;
}
a {
  color: #52b6ec;
  -webkit-transition: 300ms;
  -moz-transition: 300ms;
  -o-transition: 300ms;
  transition: 300ms;
}
.btn {
  font-weight: 300;
  border: 0;
}
.btn.btn-primary {
  background-color: #52b6ec;
}
.btn.btn-primary:hover,
.btn.btn-primary.active {
  background-color: #1586c3;
  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  box-shadow: none;
}
a:hover,
a:focus {
  color: #80c9f1;
  text-decoration: none;
  outline: none;
}

.box {
  padding: 50px 30px;
  background: #fff;
  border-bottom: 1px solid #e9e9e9;
  position: relative;
}

.box.first {
  margin-top: -40px;
  border-radius: 5px 5px 0 0;
}
.box.last {
  border-radius: 0 0 5px 5px;
}
.box h2 {
  padding: 10px 30px;
  display: inline-block;
  border-radius: 4px;
  position: relative;
  margin-bottom: 30px;
  font-size: 48px;
}

/* Start: Recommended Isotope styles */
/**** Isotope Filtering ****/
.isotope-item {
  z-index: 2;
}
.isotope-hidden.isotope-item {
  pointer-events: none;
  z-index: 1;
}
/**** Isotope CSS3 transitions ****/
.isotope,
.isotope .isotope-item {
  -webkit-transition-duration: 0.8s;
  -moz-transition-duration: 0.8s;
  -ms-transition-duration: 0.8s;
  -o-transition-duration: 0.8s;
  transition-duration: 0.8s;
}
.isotope {
  -webkit-transition-property: height, width;
  -moz-transition-property: height, width;
  -ms-transition-property: height, width;
  -o-transition-property: height, width;
  transition-property: height, width;
}
.isotope .isotope-item {
  -webkit-transition-property: -webkit-transform, opacity;
  -moz-transition-property: -moz-transform, opacity;
  -ms-transition-property: -ms-transform, opacity;
  -o-transition-property: -o-transform, opacity;
  transition-property: transform, opacity;
}
/**** disabling Isotope CSS3 transitions ****/
.isotope.no-transition,
.isotope.no-transition .isotope-item,
.isotope .isotope-item.no-transition {
  -webkit-transition-duration: 0s;
  -moz-transition-duration: 0s;
  -ms-transition-duration: 0s;
  -o-transition-duration: 0s;
  transition-duration: 0s;
}
/* End: Recommended Isotope styles */
/* disable CSS transitions for containers with infinite scrolling*/
.isotope.infinite-scrolling {
  -webkit-transition: none;
  -moz-transition: none;
  -ms-transition: none;
  -o-transition: none;
  transition: none;
}

#services .box {
  padding-bottom: 0;
}
#services .row > div {
  margin-bottom: 50px;
}
.center {
  text-align: center;
}
#team-scroller .designation {
  margin-top: 10px;
  display: block;
}
.member {
  margin: 0 50px;
  text-align: center;
}

.navbar-default {
  background: #fff;
  border-radius: 0 0 5px 5px;
  border: 0;
  padding: 0;
  -webkit-box-shadow: 0 1px 3px 0 rgba(0,0,0,.2);
  -moz-box-shadow: 0 1px 3px 0 rgba(0,0,0,.2);
  box-shadow: 0 1px 3px 0 rgba(0,0,0,.2);
  overflow: hidden;
}
.navbar-default .first a {
  border-radius: 0 0 0 5px;
}
.navbar-default .navbar-brand {
  margin-right: 50px;
  margin-left: 20px;
  width: 200px;
  height: 78px;
  background: url(../images/logo.png) no-repeat 0 50%;
}
.navbar-default .navbar-nav > li {
  margin-left: 1px;
}
.navbar-default .navbar-nav > li > a {
  padding: 30px 25px;
  font-size: 16px;
  line-height: 18px;
  color: #000;
}
.navbar-default .navbar-nav > li > a > i {
  display: inline-block;
}
.navbar-default .navbar-nav > li.active > a,
.navbar-default .navbar-nav > li.active:focus > a,
.navbar-default .navbar-nav > li.active:hover > a,
.navbar-default .navbar-nav > li:hover > a,
.navbar-default .navbar-nav > li:focus > a,
.navbar-default .navbar-nav > li.active > a:focus,
.navbar-default .navbar-nav > li.active:focus > a:focus,
.navbar-default .navbar-nav > li.active:hover > a:focus,
.navbar-default .navbar-nav > li:hover > a:focus,
.navbar-default .navbar-nav > li:focus > a:focus {
  background-color: #999;
  color: #fff;
}

.icon-lg {
  font-size: 48px;
  height: 108px;
  width: 108px;
  line-height: 108px;
  color: #fff;
  margin: 10px;
  background-color: rgba(0, 0, 0, 0.4);
  text-align: center;
  display: inline-block !important;
  border-radius: 100%;
}
.icon-md {
  font-size: 24px;
  height: 68px;
  width: 68px;
  line-height: 68px;
  color: #fff;
  margin-right: 10px;
  background-color: rgba(0, 0, 0, 0.4);
  text-align: center;
  display: inline-block;
  border-radius: 100%;
  margin-bottom: 10px;
}
.icon-color1 {
  background-color: #e74c3c;
}
.icon-color2 {
  background-color: #2ecc71;
}
.icon-color3 {
  background-color: #3498db;
}
.icon-color4 {
  background-color: #8e44ad;
}
.icon-color5 {
  background-color: #1abc9c;
}
.icon-color6 {
  background-color: #2c3e50;
}
.gap {
  margin-bottom: 50px;
}
.big-gap {
  margin-bottom: 100px;
}
#footer {
  padding-top: 30px;
  padding-bottom: 30px;
  color: #999;
}
#footer a {
  color: #999;
}
#footer a:hover {
  color: #52b6ec;
}
ul.social {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}
ul.social > li {
  margin: 0 0 20px;
}
ul.social > li > a {
  display: block;
  font-size: 18px;
}
ul.social > li > a i {
  margin-right: 10px;
}
textarea#message {
  padding: 10px 15px;
  height: 220px;
}
@keyframes scaleUp {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
@-moz-keyframes scaleUp {
  0% {
    opacity: 0;
    -moz-transform: scale(0.3);
  }
  100% {
    opacity: 1;
    -moz-transform: scale(1);
  }
}
@-webkit-keyframes scaleUp {
  0% {
    opacity: 0;
    -webkit-transform: scale(0.3);
  }
  100% {
    opacity: 1;
    -webkit-transform: scale(1);
  }
}
@-ms-keyframes scaleUp {
  0% {
    opacity: 0;
    -ms-transform: scale(0.3);
  }
  100% {
    opacity: 1;
    -ms-transform: scale(1);
  }
}
@-o-keyframes scaleUp {
  0% {
    opacity: 0;
    -o-transform: scale(0.3);
  }
  100% {
    opacity: 1;
    -o-transform: scale(1);
  }
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>example</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/font-awesome.min.css" rel="stylesheet">
    <link href="css/main.css" rel="stylesheet">

    <link rel="shortcut icon" href="images/ico/favicon.ico">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="images/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="images/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="images/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="images/ico/apple-touch-icon-57-precomposed.png">

                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        Toggle navigation

                    </button>

example

example

example

example

example

example

                    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

                    Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

                    Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.

                    Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.

                    Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis.

                    At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.

                    Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus.

                    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

                    Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

                    Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.

                    Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo

                    © 2017 example. All Rights Reserved.

here a link to my files

A: I assume you want to move the page background from header to body?

@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,300,700);
body {
  color: #999;
  background-image: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url(https://static.pexels.com/photos/343299/pexels-photo-343299.jpeg);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.navbar-fixed-top {
  right: none;
  left: none
}

.container.header + * {
  margin-top: 100vh;
}

    .container {
      position:relative
    }
    .content {
        background-color:red;
        height: 100%;
        min-height: 100vh;
    }

    .backgroundImage {
      width: 100%;
      height: auto;
      z-index: 1;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
      color: #777;
      font-weight: 300;
    }
    a {
      color: #52b6ec;
      -webkit-transition: 300ms;
      -moz-transition: 300ms;
      -o-transition: 300ms;
      transition: 300ms;
    }
    .btn {
      font-weight: 300;
      border: 0;
    }
    .btn.btn-primary {
      background-color: #52b6ec;
    }
    .btn.btn-primary:hover,
    .btn.btn-primary.active {
      background-color: #1586c3;
      -webkit-box-shadow: none;
      -moz-box-shadow: none;
      box-shadow: none;
    }
    a:hover,
    a:focus {
      color: #80c9f1;
      text-decoration: none;
      outline: none;
    }

    .box {
      padding: 50px 30px;
      background: #fff;
      border-bottom: 1px solid #e9e9e9;
      position: relative;
    }

    .box.first {
      margin-top: -40px;
      border-radius: 5px 5px 0 0;
    }
    .box.last {
      border-radius: 0 0 5px 5px;
    }
    .box h2 {
      padding: 10px 30px;
      display: inline-block;
      border-radius: 4px;
      position: relative;
      margin-bottom: 30px;
      font-size: 48px;
    }

    /* Start: Recommended Isotope styles */
    /**** Isotope Filtering ****/
    .isotope-item {
      z-index: 2;
    }
    .isotope-hidden.isotope-item {
      pointer-events: none;
      z-index: 1;
    }
    /**** Isotope CSS3 transitions ****/
    .isotope,
    .isotope .isotope-item {
      -webkit-transition-duration: 0.8s;
      -moz-transition-duration: 0.8s;
      -ms-transition-duration: 0.8s;
      -o-transition-duration: 0.8s;
      transition-duration: 0.8s;
    }
    .isotope {
      -webkit-transition-property: height, width;
      -moz-transition-property: height, width;
      -ms-transition-property: height, width;
      -o-transition-property: height, width;
      transition-property: height, width;
    }
    .isotope .isotope-item {
      -webkit-transition-property: -webkit-transform, opacity;
      -moz-transition-property: -moz-transform, opacity;
      -ms-transition-property: -ms-transform, opacity;
      -o-transition-property: -o-transform, opacity;
      transition-property: transform, opacity;
    }
    /**** disabling Isotope CSS3 transitions ****/
    .isotope.no-transition,
    .isotope.no-transition .isotope-item,
    .isotope .isotope-item.no-transition {
      -webkit-transition-duration: 0s;
      -moz-transition-duration: 0s;
      -ms-transition-duration: 0s;
      -o-transition-duration: 0s;
      transition-duration: 0s;
    }
    /* End: Recommended Isotope styles */
    /* disable CSS transitions for containers with infinite scrolling*/
    .isotope.infinite-scrolling {
      -webkit-transition: none;
      -moz-transition: none;
      -ms-transition: none;
      -o-transition: none;
      transition: none;
    }

    #services .box {
      padding-bottom: 0;
    }
    #services .row > div {
      margin-bottom: 50px;
    }
    .center {
      text-align: center;
    }
    #team-scroller .designation {
      margin-top: 10px;
      display: block;
    }
    .member {
      margin: 0 50px;
      text-align: center;
    }

    .navbar.navbar-default {
      background: #fff;
      border-radius: 0 0 5px 5px;
      border: 0;
      padding: 0;
      -webkit-box-shadow: 0 1px 3px 0 rgba(0,0,0,.2);
      -moz-box-shadow: 0 1px 3px 0 rgba(0,0,0,.2);
      box-shadow: 0 1px 3px 0 rgba(0,0,0,.2);
      overflow: hidden;
    }
    .navbar-default .first a {
      border-radius: 0 0 0 5px;
    }
    .navbar-default .navbar-brand {
      margin-right: 50px;
      margin-left: 20px;
      width: 200px;
      height: 78px;
      background: url(../images/logo.png) no-repeat 0 50%;
    }
    .navbar-default .navbar-nav > li {
      margin-left: 1px;
    }
    .navbar-default .navbar-nav > li > a {
      padding: 30px 25px;
      font-size: 16px;
      line-height: 18px;
      color: #000;
    }
    .navbar-default .navbar-nav > li > a > i {
      display: inline-block;
    }
    .navbar-default .navbar-nav > li.active > a,
    .navbar-default .navbar-nav > li.active:focus > a,
    .navbar-default .navbar-nav > li.active:hover > a,
    .navbar-default .navbar-nav > li:hover > a,
    .navbar-default .navbar-nav > li:focus > a,
    .navbar-default .navbar-nav > li.active > a:focus,
    .navbar-default .navbar-nav > li.active:focus > a:focus,
    .navbar-default .navbar-nav > li.active:hover > a:focus,
    .navbar-default .navbar-nav > li:hover > a:focus,
    .navbar-default .navbar-nav > li:focus > a:focus {
      background-color: #999;
      color: #fff;
    }

    .icon-lg {
      font-size: 48px;
      height: 108px;
      width: 108px;
      line-height: 108px;
      color: #fff;
      margin: 10px;
      background-color: rgba(0, 0, 0, 0.4);
      text-align: center;
      display: inline-block !important;
      border-radius: 100%;
    }
    .icon-md {
      font-size: 24px;
      height: 68px;
      width: 68px;
      line-height: 68px;
      color: #fff;
      margin-right: 10px;
      background-color: rgba(0, 0, 0, 0.4);
      text-align: center;
      display: inline-block;
      border-radius: 100%;
      margin-bottom: 10px;
    }
    .icon-color1 {
      background-color: #e74c3c;
    }
    .icon-color2 {
      background-color: #2ecc71;
    }
    .icon-color3 {
      background-color: #3498db;
    }
    .icon-color4 {
      background-color: #8e44ad;
    }
    .icon-color5 {
      background-color: #1abc9c;
    }
    .icon-color6 {
      background-color: #2c3e50;
    }
    .gap {
      margin-bottom: 50px;
    }
    .big-gap {
      margin-bottom: 100px;
    }
    #footer {
      padding-top: 30px;
      padding-bottom: 30px;
      color: #999;
    }
    #footer a {
      color: #999;
    }
    #footer a:hover {
      color: #52b6ec;
    }
    ul.social {
      list-style: none;
      margin: 10px 0 0;
      padding: 0;
    }
    ul.social > li {
      margin: 0 0 20px;
    }
    ul.social > li > a {
      display: block;
      font-size: 18px;
    }
    ul.social > li > a i {
      margin-right: 10px;
    }
    textarea#message {
      padding: 10px 15px;
      height: 220px;
    }
    @keyframes scaleUp {
      0% {
        opacity: 0;
        transform: scale(0.3);
      }
      100% {
        opacity: 1;
        transform: scale(1);
      }
    }
    @-moz-keyframes scaleUp {
      0% {
        opacity: 0;
        -moz-transform: scale(0.3);
      }
      100% {
        opacity: 1;
        -moz-transform: scale(1);
      }
    }
    @-webkit-keyframes scaleUp {
      0% {
        opacity: 0;
        -webkit-transform: scale(0.3);
      }
      100% {
        opacity: 1;
        -webkit-transform: scale(1);
      }
    }
    @-ms-keyframes scaleUp {
      0% {
        opacity: 0;
        -ms-transform: scale(0.3);
      }
      100% {
        opacity: 1;
        -ms-transform: scale(1);
      }
    }
    @-o-keyframes scaleUp {
      0% {
        opacity: 0;
        -o-transform: scale(0.3);
      }
      100% {
        opacity: 1;
        -o-transform: scale(1);
      }
    }

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<!DOCTYPE html>

          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            Toggle navigation

          </button>

Example

Example

Example

example

                    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
                    labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores
                    et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
                    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
                    labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores
                    et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
                    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
                    labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores
                    et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

                    Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum
                    dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit
                    praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit
                    amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna
                    aliquam erat volutpat.

                    Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut
                    aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit
                    esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et
                    iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla
                    facilisi.

                    Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim
                    placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
                    nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim
                    veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo
                    consequat.

                    Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum
                    dolore eu feugiat nulla facilisis.

                    At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata
                    sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed
                    diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
                    vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata
                    sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, At
                    accusam aliquyam diam diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt
                    justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed takimata ut vero
                    voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
                    sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.

                    Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna
                    aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
                    clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit
                    amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna
                    aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
                    clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit
                    amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna
                    aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
                    clita kasd gubergren, no sea takimata sanctus.

                    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
                    labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores
                    et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
                    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
                    labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores
                    et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
                    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
                    labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores
                    et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

                    Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum
                    dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit
                    praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit
                    amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna
                    aliquam erat volutpat.

                    Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut
                    aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit
                    esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et
                    iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla
                    facilisi.

                    Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim
                    placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
                    nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim
                    veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo

                © 2017 example. All Rights
                Reserved.

Updated with fixed header, as per comment request.


text:
Q: Weird CSS image hover I'm creating a hover effect on an image with SCSS on a WordPress site (see gif: https://gyazo.com/1a35247e40d74b5fc756d508de4231eb)
As you see the image gets a "distorted" after hovering over it, maybe the ease-in property is wrong, or I'm not doing the hover effect properly. I'm wondering what I'm doing wrong in the code when it behaves like this.
This is the code that is working:
(left out some SCSS because it was so wast but the & is used to use parent class)
Edit: The HTML & SCSS

      Test event

      2018

-
&_container {
position: relative;
height: 300px;
width: 300px;

&:hover {
  & > img {
    opacity: .2;
  }

  & > .project_content {
    opacity: 1;
  }
}

& img {
  position: absolute;
  width: 100%;
  height: 100%;

  /*
  object-fit: none;
  background-size: cover;
  background-position: 50% 50%;
  background-repeat: no-repeat;
  */

  // Hover tranisiton
  transition: opacity .5s;
 }
}

&_content {
 opacity: 0;
 transition: opacity .5s;

// Center Position
 position: absolute;
 top: 50%;
 left: 50%;
 transform: translate(-50%, -50%);

 color: $purple;
 z-index: 2;
 text-transform: uppercase;
 font-size: 20px;
 font-weight: 500;
 text-align: center;
 }
}

So using :hover; on the &_container gives the project_content: opacity: 1;. Then it also blurs the background image with the opacity: .2;, and the effect is achieved with a transition;
Thank you!

A: I rewrote everything with the hover effect so now I use an overlay class which has opacity: 0; on it (and a transition that takes care of the effect on :hover)
This is a simple version of the HTML:

Content

and the simplified SCSS:
.project {
 &_container {
  position: relative;
  height: 300px;
  width: 300px;

  &:hover .project_overlay,
  &:hover .project_content {
   opacity: 1;
   transition: opacity .5s;
  }
 }

 & img {
  position: absolute;
  width: 100%;
  height: 100%;
 }

 &_overlay {
  background-color: rgba(255, 255, 255, .5);
  position: absolute;
  height: 100%;
  width: 100%;

  opacity: 0;
  transition: opacity .5s;
 }
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to make PDO query work inside a function I am try to make an PDO sql inside function but it doesn't work. got no response from it. it works when not using function. my purpose is to make my code small. anyone can shed a light. thanks.
function Test() {

    $get_name = $smt->prepare("SELECT * FROM customer WHERE id = '1'");
    $get_name->execute();

    foreach ($get_name as $temp) {
        $name = $temp['name'];
        $address = $temp['address'];
        $phone = $temp['phone'];
        $page = $temp['page'];
    }

    eval("\$page = \"$page\";");
    echo $page;

    eval("\$page = \"$page\";");
    echo $page;

}

Test();

A: You need to make the pdo instance global within the function
function Test() {

    global $smt;

A: I'd probably refactor your code to something like:

function getCustomerInfo(PDO $pdo, $customerId)
{
    // use a prepared statement that can get you info on any customer
    $statement = $pdo->prepare(
        "SELECT * FROM customer WHERE id = :customerId LIMIT 1");
    // get the result resource from the database
    $result = $statement->execute(array(
        ':customerId' => $customerId
    ));
    // fetch the first row in the result as an associative array
    // and return it to the caller.
    return $result->fetchFirst(PDO::FETCH_ASSOC);
}

// use your connection in place of $pdo
$customerData = getCustomerInfo($pdo, 1);

// now you can do stuff with your data
var_dump($customerData);

This is better because it does not rely on global state, functions should never-ever-ever do that. and it uses prepared, parameterized sql that makes it faster and the function more useful for customers other that the one where id=1.


text:
Q: How to make String array into Int Array Kotlin Android I'm very new to Kotlin and Android. I have created an array that accepts input from EditText of 10 values separated by commas, however It is a String array and I need a Int array. Any Help would be very Appreciated. Below is my code:
private fun array() {
        val ed = findViewById<View>(R.id.et_addNum) as EditText
        var text = ed.text.toString()
        val array: List<String> = text.split(",")

        for (element in array) {
            Log.e("elements", element)

            storednumber.setText(array.toString())
        }
    }

A: If you absolutely sure your Strings are correct numbers you can use mapping like this:
val stringList: List<String> = listOf("1", "2", "3")
val intList: List<Int> = stringList.map { it.toInt() }

or like this if want to avoid throwing NumberFormatException:
val stringList: List<String> = listOf("1", "2", "3")
val intList: List<Int> = stringList.map { it.toIntOrNull() ?: 0 }


text:
Q: How to use tf dataset sharding AFTER a shuffle operation, but not repeat entries I am trying to solve the following problem:
I have 128 files that I want to break into 4 subsets. Each time around, I want the division to be different.
If I do tf.data.Dataset.list_files('glob_pattern', shuffle=False), the dataset has the right number of files. Sharding this works as expected, but each shard only ever has the same files.
I want to shard and end up with a different division of the files each go-through the data. However, if I turn shuffle=True, then each shard seems to have its own copy of the original dataset, meaning that I can see the same file multiple times before seeing all the files once.
Is there an idiomatic way of splitting these files?
Basically, I'm wondering why the original list_files dataset is able to have some files show up multiple times before all the files have been seen.
Here is some TF2.0 code to see the problem:
ds = tf.data.Dataset.from_tensor_slices([f'train_{str(i).zfill(5)}' for i in range(128)])
ds = ds.shuffle(128)

n_splits = 4
sub_datasets = [ds.shard(n_splits, i) for i in range(n_splits)]

output = []

# go through each of the subsets
for i in range(n_splits):
    results = [x.numpy().decode() for x in sub_datasets[i]]
    output.extend(results)

print(len(set(output)), 'is the number of unique files seen (128 desired)')

A: Here's an answer from what I can understand of your question. To generate a new subset of 4 datasets (shared) each time randomly shuffled, you can use the following code.
import numpy as np
import tensorflow as tf

# ####################
# I used numbers for visualization ... feel free to replace with your demo code
# ####################
#   ds = tf.data.Dataset.from_tensor_slices([f'train_{str(i).zfill(5)}' for i in range(128)])
# ####################
arr = np.arange(128)
ds = tf.data.Dataset.from_tensor_slices(arr)

def get_four_datasets(original_ds, window_size=32, shuffle_size=128):
    """ Every time you call this function you will get a new four datasets """
    return original_ds.shuffle(shuffle_size).window(window_size)

remake_ds_1 = list()
remake_ds_2 = list()
for i, (dataset_1, dataset_2) in enumerate(zip(get_four_datasets(ds), get_four_datasets(ds))):
    print(f"\n\nDATASET #1-{i+1}")
    ds_subset = [value for value in dataset_1.as_numpy_iterator()]
    print("\t", ds_subset)
    remake_ds_1.extend(ds_subset)

    print(f"\nDATASET #2-{i+1}")
    ds_subset_2 = [value for value in dataset_2.as_numpy_iterator()]
    print("\t", ds_subset_2)
    remake_ds_2.extend(ds_subset_2)

print("\n\nCounts\n")
print("DS 1 ALL: ", len(remake_ds_1))
print("DS 1 UNIQUE: ", len(set(remake_ds_1)))
print("DS 2 ALL: ", len(remake_ds_2))
print("DS 2 UNIQUE: ", len(set(remake_ds_2)))

OUTPUT
DATASET #1-1
     [96, 4, 66, 120, 42, 54, 110, 57, 67, 7, 13, 9, 69, 86, 122, 88, 10, 55, 27, 106, 77, 107, 114, 87, 59, 81, 1, 49, 118, 17, 36, 11]

DATASET #2-1
     [47, 26, 122, 10, 110, 31, 86, 34, 52, 121, 36, 112, 55, 48, 50, 108, 100, 103, 113, 68, 58, 29, 32, 84, 124, 15, 38, 51, 6, 66, 24, 41]

DATASET #1-2
     [56, 80, 94, 124, 52, 109, 83, 90, 112, 35, 6, 101, 20, 84, 73, 74, 100, 99, 108, 15, 14, 12, 89, 24, 8, 29, 68, 85, 125, 3, 33, 58]

DATASET #2-2
     [125, 127, 74, 97, 12, 39, 109, 126, 98, 40, 99, 93, 35, 107, 91, 88, 45, 13, 106, 120, 19, 73, 83, 11, 105, 61, 16, 114, 79, 95, 94, 44]

DATASET #1-3
     [105, 38, 43, 60, 0, 26, 127, 65, 22, 18, 123, 82, 121, 71, 51, 23, 113, 30, 63, 40, 2, 61, 16, 98, 64, 25, 41, 28, 45, 19, 117, 39]

DATASET #2-3
     [75, 64, 1, 17, 7, 42, 80, 92, 3, 9, 54, 33, 82, 56, 118, 102, 115, 43, 28, 90, 60, 119, 0, 57, 123, 62, 22, 72, 65, 23, 30, 87]

DATASET #1-4
     [48, 62, 31, 102, 111, 46, 103, 44, 116, 79, 21, 50, 53, 78, 93, 32, 95, 34, 92, 126, 104, 47, 119, 37, 5, 70, 97, 91, 76, 75, 72, 115]

DATASET #2-4
     [4, 85, 21, 116, 78, 27, 117, 2, 59, 111, 69, 46, 63, 20, 49, 5, 81, 53, 18, 37, 8, 76, 71, 89, 14, 104, 25, 96, 67, 101, 77, 70]

Counts

DS 1 ALL: 128
DS 1 UNIQUE: 128
DS 2 ALL: 128
DS 2 UNIQUE: 128

If you just want to generate a dataset where every 32 examples pulled from the dataset is shuffled and you want to iterate over the dataset multiple times getting new 32-set samples every time, you can do the following.
import numpy as np
import tensorflow as tf

arr = np.arange(128)
N_REPEATS = 10

ds = tf.data.Dataset.from_tensor_slices(arr)
ds = ds.shuffle(128).batch(32).repeat(N_REPEATS)

OUTPUT
BATCH 1: [92, 94, 76, 38, 58, 9, 44, 16, 86, 28, 64, 7, 60, 42, 31, 0, 46, 1, 83, 57, 18, 102, 67, 110, 113, 101, 93, 61, 96, 17, 105, 6]
BATCH 2: [59, 15, 121, 3, 72, 100, 50, 52, 45, 23, 87, 43, 33, 29, 62, 25, 74, 65, 75, 68, 4, 56, 117, 47, 73, 109, 106, 35, 88, 91, 119, 66]
BATCH 3: [98, 78, 125, 24, 99, 51, 14, 114, 26, 22, 54, 89, 79, 63, 30, 124, 20, 13, 2, 34, 95, 41, 85, 39, 37, 77, 90, 107, 104, 118, 27, 97]
BATCH 4: [49, 5, 53, 115, 126, 40, 108, 48, 8, 84, 120, 32, 82, 11, 112, 55, 80, 69, 12, 70, 111, 123, 81, 116, 71, 122, 36, 21, 103, 19, 127, 10]
BATCH 5: [74, 61, 97, 6, 127, 119, 65, 15, 78, 72, 99, 18, 41, 76, 79, 33, 0, 105, 103, 46, 14, 50, 113, 26, 43, 45, 100, 90, 28, 48, 19, 9]
BATCH 6: [35, 20, 3, 64, 5, 96, 114, 34, 126, 85, 124, 69, 110, 54, 109, 24, 104, 32, 73, 92, 11, 13, 58, 107, 84, 88, 59, 75, 95, 40, 16, 101]
BATCH 7: [93, 66, 106, 44, 102, 125, 7, 30, 12, 116, 87, 111, 81, 56, 83, 37, 31, 77, 67, 21, 118, 1, 120, 36, 86, 62, 71, 98, 82, 52, 25, 27]
BATCH 8: [112, 68, 60, 70, 115, 117, 29, 91, 57, 10, 121, 89, 4, 2, 122, 39, 51, 22, 53, 63, 108, 94, 42, 17, 8, 23, 80, 38, 55, 49, 47, 123]
BATCH 9: [67, 20, 101, 123, 109, 4, 39, 65, 34, 71, 22, 62, 73, 81, 114, 112, 66, 35, 43, 49, 92, 68, 1, 54, 27, 103, 46, 12, 82, 6, 119, 99]
BATCH 10: [86, 69, 13, 44, 16, 50, 75, 61, 58, 104, 64, 47, 95, 10, 79, 70, 97, 63, 45, 17, 56, 74, 87, 53, 91, 21, 48, 76, 9, 51, 28, 126]
...
...
...
BATCH 40: [10, 41, 29, 39, 57, 127, 101, 106, 55, 62, 72, 76, 124, 81, 66, 126, 53, 24, 33, 49, 102, 75, 34, 61, 47, 15, 21, 121, 8, 94, 52, 13]

Please let me know if I misunderstood and I can update accordingly.

A: You need to set reshuffle_each_iteration=False:
ds = ds.shuffle(128, reshuffle_each_iteration=False)

Full code:
import tensorflow as tf

ds = tf.data.Dataset.from_tensor_slices([f'train_{str(i).zfill(5)}' for i in range(128)])
ds = ds.shuffle(128, reshuffle_each_iteration=False)

n_splits = 4
sub_datasets = [ds.shard(n_splits, i) for i in range(n_splits)]

output = []

# go through each of the subsets
for i in range(n_splits):
    results = [x.numpy().decode() for x in sub_datasets[i]]
    output.extend(results)

print(len(set(output)), 'is the number of unique files seen (128 desired)')

128 is the number of unique files seen (128 desired)


text:
Q: Reference on simplicial homotopy theories I read a very user-friendly and modern treatment of closed model categories in Homotopy theories and model categories by Dwyer and Spalinski and I liked it very much. This basically covers Chapter I of Quillen's Homotopical Algebra.
I was wondering if there are modern treatments of chapter II, i.e. are there any user-friendly modern exposition on simplicial homotopy theory? The more similar to Dwyer and Spalinski's the better. Thank you!

A: Try Goerrs and Jardine's Simplicial Homotopy Theory.


text:
Q: Most approprite place for storing registration info in the registry I'm aware that any licensing registry key can be detected using monitoring tools, just want to secure it against ordinary users.
What places of registry look fit for storing a key?

A: HKLM\Software\<YourCompany>\<TheApp>
Anywhere else borders on the malicious.


text:
Q: PHP base64_decode eval found in all .php files for site. WHY? A friend of mine asked to make some changes to his website. When looking at the code I found every php file had this single line of code. So I had to Decode the string and replace the file with the result. From there I was able to make the proper adjustments to the site.
<?php eval("?>".base64_decode("PD9waHANCglpbmNsdWRlX29uY2UoJ2Z1bmN0aW9ucy5waHAnKTsNCj8+DQo8IURPQ1RZUEUgaHRtbCBQdWJsaWMgIi0vL1czQy8vRFREIFhIVE1MIDEuMCBUcmFuc2l0a......=")); ?>

My question is why would someone do such a thing? Doesn't this add an extra process to every page?

A: He just thought that this may protect the code from being stolen, but that 's wrong off course.


text:
Q: Table usage in mysql I've a database and log files. I would like to know the least used/unused tables. So, can anyone help me with ways to get details like table usage statistics?

A: Use percona toolkit for analyzing logs https://www.percona.com/doc/percona-toolkit/2.2/index.html
for slow logs ./pt-query-digest /path/to/slow.log
or ./pt-table-usage /path/to/log


text:
Q: WCF DataMember attribute for read-only fields? I am trying to create a class with a read-only Id field, however I am having problems retaining the value when the object passes through the WCF server.
I cannot set the [DataMember] attribute on the public property since there is no set method, and I would like to keep it that way if possible since I do not want this value changed by external means. I cannot set the [DataMember] attribute on the private field since it throws an error in partial trust environments.
public class MyClass
{
    private int _id;

    public int Id
    {
        get { return _id; }
    }

    private string _otherProperties;

    [DataMember]
    public string OtherProperties
    {
        get { return _otherProperties; }
        set { _otherProperties = value; }
    }
}

Is there a way to maintain the value of the Id field while going through the WCF server without making my property public?

A: You can do this:
public int Id
{
     get;
     private set;
}

This will keep the deserializer happy, while not letting people actually set the ID value. You'll have to set it in the constructor, or in the setter of another property.
However, I do agree with Sanders, in that your DTO should be a dumb container.

A: Generally speaking, your data contract classes should be very lightweight data transfer objects without any logic or deeper meaning attached to them. Just containers to ferry data across the cloud. They should be public classes, with just a set of public read-write properties. In your business logic classes, you should convert these into some internal business entities and do the reverse when transmitting data.
This separates the data transfer model from any internal entity model and ensures optimal maintainability, allowing you to avoid problems such as the one you are facing - where OO design issues conflict with WCF operating behavior.
With very small projects the overhead of keeping a separate model might not be worth it. AutoMapper can be of some help minimizing the manual labor required.
Speaking of your specific scenario, I am not sure I exactly understand the problem statement. You do not want some field to be modified? But this field is just a part of the data model - parts of the data model are never "modified" - there is no "old" data, just data your client makes up. Your client code just sends a data object to the server. If the server does not care about one member of the class, it should just ignore it.
It's not like instnaces of the data contract objects exist on the server and wait for clients to manipulate them. A read-only field might conceptually make sense in such a scenario but this is not so with WCF. The client just makes up an object and sends it to the server. If you do not want the server to listen to some data, either do not add it to the data model or (if perhaps it is sometimes needed, only for specific users or such) make the server ignore it when it is not desired.

A: No. Data member has to have getter and setter to be serializable. It is service responsibility to validate that Id was not changed on the client.


text:
Q: Android Studio - mergeDebugResources exception I recently updated the Android Studio to it's latest version, and now I am experiencing a headache with an exception in Gradle build.
Every time I run the project, two or three times before it succeed, I get the following error:
Gradle: Execution failed for task ': ProjectName:
mergeDebugResources'.
Java.lang.NullPointerException (no error message)

After trying again a couple times, the error does not happen again until the next run.
Does anybody have any idea of why this is happening? The project worked just fine 'til the update, never got any error before...
Thanks!

A: It happens to me only when modifying the XML files on the project. If you rebuild the entire project before running (Build > Rebuild Project) it doesn't show up anymore.

A: inside your project directory, run:
./gradlew clean build

or from Android Studio select:
Build > Clean Project

Updated: As @VinceFior pointed out in a comment below

A: You may have a corrupted .9.png in your drawables directory

A: This error could also happen if the generated build file path exceeds the windows max path length of 255 characters. Make sure your project path is not too long, use short names as well.

A: I found a solution to the problem.
There is an issue reported about gradle build problems, it is not the same, but the solution seems to solve the mergeResourceDebug issues too. (issue here https://code.google.com/p/android/issues/detail?id=56158). In the comments it is stated that the solution is solved in Gradle 0.4.3.
To use Gradle 0.4.3, the build.gradle file needs to be updated manually.  (Updating Android Studio does not change the build file)
Here is what I changed In build.gradle:
dependencies {
    classpath 'com.android.tools.build:gradle:0.4.3'
}

Since changing this, I have not seen any more mergeDebugResource issues when running my project.  Hope this helps!
Edit: to stay up to date with Gradle you can change the version number to 0.4.+

A: This would also happen if there is/are any additional folder/files in resource folder which are not supported by Android.

A: I had the same problem and managed to solve, it simply downgrade your gradle version like this:
dependencies {
    classpath 'com.android.tools.build:gradle:YOUR_GRADLE_VERSION'
}

to
dependencies {
    classpath 'com.android.tools.build:gradle:OLDER_GRADLE_VERSION_THAT_YOUR'
}

for example:
YOUR_GRADLE_VERSION  =  3.0.0
OLDER_GRADLE_VERSION_THAT_YOUR  =  2.3.2

A: In my case none of above works, I have just renamed the project name, everything works well.
Example:
My project name Before -  sticky-headers-recyclerview-master
My project name After -  SHRV
Hope this will help you.

A: My problem solve this one
compile fileTree(dir: 'libs', include: ['*.jar'])

to
provided fileTree(dir: 'libs', include: ['*.jar'])

A: In my case, when I changed package name this issue appeared, I just followed below steps to fix my problem:

*

*Removed previously installed apk (uninstall)

*Applied project clean

*Run the app

A: Had to change build tools version from some old one in build.gradle for project module:
android {
    ...
    buildToolsVersion "24.0.2"
    ...
}

A: There is a new Gradle task called "cleanBuildCache" just run this task clean the cache then re-build the project.

A: In my case I just removed the space from project folder name
From:
MyApp latest
To:
MyApp_latest
and it worked.

A: I just upgraded to the latest gradle build tool version and it works.
 classpath 'com.android.tools.build:gradle:3.0.1

A: It could be a faulty name of a drawable file.  I had an image I was using that was named Untitled.  Changing the name solved my problem.


text:
Q: Jackson Serialization excludes fields First of all I want to give you a bit of context.
We have an interface A which is implemented by class B. Class B also extends abstract class C.
What we usually return when the requests are called (rest GET endpoint) are the values in B and the values in all the classes that form the hierarchy (D extending B and so on).
B contains getters to access these values. These getters are NOT DEFINED in the A interface.
But the response works, the values are converted into a JSON so there's no problem so far. Jackson is able to call the getters and create the JSON based on them
Now we're upgrading Jackson to a newer version from 2.6.7. We tried 2.10.3 and upward.
The problem is that those getters are not being serialized anymore. If we define them in the interface is ok but the risk of doing this in our context is high.
Does anyone know why with the newer versions of Jackson the getters which are not defined in the interface are ignored?
Is there a configuration, tweak or something which can force its previous behavior?
Later Edit 1
Important to note how the objects are created:
Interface A obj = new Class C() or whichever is needed from the hierarchy;
Later Edit 2
Maybe it helps also providing the information that Spring was updated from version 4.0.0 to 5.3.0. The application uses
Spring-mvc, Spring-core, it's a non-spring-boot application.
The dependencies used:
<dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-databind</artifactId>
    <version>${com.fasterxml.jackson.databind}</version>
</dependency>

<dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-annotations</artifactId>
    <version>${com.fasterxml.jackson.databind}</version>
</dependency>

<dependency>
    <groupId>com.fasterxml.jackson.datatype</groupId>
    <artifactId>jackson-datatype-jdk8</artifactId>
    <version>${com.fasterxml.jackson.version}</version>
</dependency>

<dependency>
    <groupId>com.fasterxml.jackson.datatype</groupId>
    <artifactId>jackson-datatype-jsr310</artifactId>
    <version>${com.fasterxml.jackson.version}</version>
</dependency>

A: Back since 2018 or so the exploitation of serialization validation limitations in authenticity were being abused and led to vulnerability patches.
These were called "serialization gadgets"; but by the time the vulnerability reports made it into public eye - many different serialization frameworks and libraries,including Jackson, had already distributed bundled packages with their installers.
For Java - some example datatypes which may be exploitable may be:
java.lang.Object
java.io.Serializable
java.util.Comparable

For Jackson - around 2.10.x a change to serialization was released, but I was unable to find a specific reference to patching Gadgets.
Typically the resolution is to blacklist serialization of Classes which contain such datatypes. Luckily, the developers often include a flag (like a ToS agreement) which you can specify to re-enable serialization of these Classes.
Unfortunately, I last programmed in Java 5 years ago - but based on quick reading I imagine the "flag" would include some form of annotation decorator or xml config tag.


text:
Q: How to link DOCUVALUE table to related business metadata I am trying to pull a report of all the documents referenced in AX, and I'm having a heck of a time figuring out the AX database structure. Ideally I want to pull a list of documents and the Journal / Batch # each is associated with.
In our AX environment, all documents are stored on a share (i.e. they're not actually stored as BLOBs in the AX database).
It looks like the DOCUVALUE table is the principal table that references the documents, having the ORIGINALFILENAME and other columns that seem to "point" to the files on the AX share. But DOCUVALUE doesn't contain any useful business metadata.
After a bit of exploring, it looks like like the DOCUREF table relates to DOCUVALUE (DOCUVALUE.RECID = DOCUREF.VALUERECID) which helps a little - gives you the Company #, but that's about it.
After a bit more exploring, it looked like it would be possible to join across to LEDGERJOURNALTABLE as shown below:
select ljt.journalnum, filename + '.' + filetype filename, ljt.name journal_name,
dr.refcompanyid, convert(varchar(10), ljt.posteddatetime,111) posted_date,
ljt.createdby, convert(numeric, ljt.journaltotalcredit) journalamount
from LEDGERJOURNALTABLE ljt, DOCUREF dr, DOCUVALUE dv
where dv.RECID = dr.VALUERECID and dr.refrecid = ljt.recid
order by 1,2
This looked promising, so I pulled out a data listing and asked one of our key business users to review the results. She indicated that it was accurate to some extent, but there were other areas where the document referenced just didn't have any relation to the JournalNum in the listing.
So - I'm at a bit of a dead end - I've spent further time generating SQL statements to harvest data using specific RECID values, trying other joins, but each time I just disappear down a rabbit hole.
Any ideas? Any help gratefully received!!

A: The AX document management framework is designed so that a document can be attached to any data row in any table. What you're trying to do is far easier in AX, but we'll stick with SQL for the question.
The problem you're having is you don't know the reference objects because you're ignoring REFTABLEID.
The key fields that connect a denormalized "document" to the associated business data are REFTABLEID, REFCOMPANYID, and REFRECID (you already have the last one).
So start with this query below:
SELECT sd.NAME
    ,sd.SQLNAME
    ,dr.*
    ,dv.*
FROM DOCUREF dr
    ,DOCUVALUE dv
    ,SQLDICTIONARY sd
WHERE dv.RECID = dr.VALUERECID
    AND sd.TABLEID = dr.REFTABLEID
    AND sd.FIELDID = 0 -- Indicates it is a table and not a table field
    AND sd.NAME = 'LEDGERJOURNALTABLE' -- Instead of hardcoding, join & query

You'll have to get creative depending on your use with SQL, You'll want to remove the hardcoded 'LEDGERJOURNALTABLE' and then use sd.SQLNAME to join to the actual SQL table. Then if that SQL table has DataAreaId, you'd likely want to join it to dr.REFCOMPANYID.
Or you can hardcode the tables or whatever you want to do. You should be aware you can attach documents to journal headers OR lines...or many other rows for that matter.
Just start exploring the data and you should be able to figure out what you want with that query above.
So for your sample query, you can see I added 2 lines. Your query will only work when joined for LedgerJournalTable. You'll have to do some dynamic SQL or use a cursor or something if you want to report on every attachment.
SELECT ljt.journalnum
    ,filename + '.' + filetype filename
    ,ljt.name journal_name
    ,dr.refcompanyid
    ,convert(VARCHAR(10), ljt.posteddatetime, 111) posted_date
    ,ljt.createdby
    ,convert(NUMERIC, ljt.journaltotalcredit) journalamount
FROM LEDGERJOURNALTABLE ljt
    ,DOCUREF dr
    ,DOCUVALUE dv
WHERE dv.RECID = dr.VALUERECID
    AND dr.REFRECID = ljt.RECID
    AND dr.REFCOMPANYID = ljt.DATAAREAID -- ADDED
    AND dr.REFTABLEID = 211 -- ADDED TableId for LedgerJournalTable
ORDER BY 1
    ,2


text:
Q: TSQL RAND() Issue I'm trying to generate a string formatted like: 99-88-77 where the three 2digit numbers are randomly generated.
My TSQL that works:
declare @result nvarchar(50)
    DECLARE @counter smallint, @ci smallint, @cu smallint, @dc smallint

      SET @ci=RAND()*100
      SET @cu=RAND()*100
      SET @dc=RAND()*100

      --SET @counter = @counter + 1

   set @result = CAST(@ci AS varchar(2)) +'-'+CAST(@cu AS varchar(2))+'-'+CAST(@dc AS varchar(2))
   print @result

Produces (this time): 16-37-30
I need to get this string for every record inserted into a table.
Now I would like to wrap this into a function, but apparently I can't use RAND() in a UDF.
How can I wrap this to call when using an insert statement?

A: You can do this as a two-step process.
First, create a view to generate your random number:
CREATE VIEW vRandNumber
AS
SELECT RAND() as RandNumber

Second, create your UDF to pull from the view:
CREATE FUNCTION dbo.udfTest
(
)
RETURNS nvarchar(50)
AS
BEGIN

    DECLARE @result  nvarchar(50)
    DECLARE @counter smallint, @ci smallint, @cu smallint, @dc smallint

    SET @ci=(SELECT RandNumber FROM vRandNumber)*100
    SET @cu=(SELECT RandNumber FROM vRandNumber)*100
    SET @dc=(SELECT RandNumber FROM vRandNumber)*100

    set @result = CAST(@ci AS varchar(2)) +'-'+CAST(@cu AS varchar(2))+'-'+CAST(@dc AS varchar(2))

RETURN @result
END

This will return your value that you just requested. Then when you want your value your just use and you will get your random answer:
SELECT dbo.udfTest()

OR
INSERT INTO yourTable
(
    randNumber
)
SELECT dbo.udfTest()

I just tested this in sql server 2005 and it worked.


text:
Q: Java Spring Boot OpenApi 3 - How to add description for RequestBody? I want to have a description for RequestBody in spring boot openapi 3 .
so i make my code like this :
@PostMapping(produces = "application/json", consumes = "application/json")
    public ResponseEntity<Book> addBook(
            @Schema(
                    description = "Book to add.",
                    required=true,
                    schema=@Schema(implementation = Book.class))
            @Valid @RequestBody Book book
    ) {
        return ResponseEntity.ok(bookRepository.add(Book));
}

RequestBody description is Book to add.
My desire UI is like this :

But nothings happen ! There is no description in my UI.
description was added to Schemas panel Book entity !!!

What is the problem ?

A: Thanks to Gabriel Frassl.
we should use

io.swagger.v3.oas.annotations.parameters.RequestBody

instead of

org.springframework.web.bind.annotation.RequestBody

so we have good stuffs like description , content , ...

A: From your Code Snippet it seems to me as if your description actually belongs into the @RequestBody Annotation instead of the @Schema Annotation.
With @Schema you define and describe your Models but what you actually want to do is to describe the parameter in the context of your operation.
Try something along the lines of:
@PostMapping(produces = "application/json", consumes = "application/json")
    public ResponseEntity<Book> addBook(
            @RequestBody(description = "Book to add.", required = true,
                        content = @Content(
                                schema=@Schema(implementation = Book.class)))
            @Valid Book book
    ) {
        return ResponseEntity.ok(bookRepository.add(Book));
}

A: @PostMapping(produces = "application/json", consumes = "application/json")
public ResponseEntity<Book> addBook(
        @RequestBody(description = "Book to add.", required = true,
                    content = @Content(
                            schema=@Schema(implementation = Book.class)))
        @Valid @org.springframework.web.bind.annotation.RequestBody Book book
) {
    return ResponseEntity.ok(bookRepository.add(Book));
}

For that I add @RequestBody from springframework. It works to me.


text:
Q: Crosstab with multiple items In SPSS, it is (relatively) easy to create a cross tab with multiple variables using the factors (or values) as the table heading.  So, something like the following (made up data, etc.).  Q1, Q2, and Q3 each have either a 1, a 2, or a 3 for each person.  I just left these as numbers, but they could be factors, neither seemed to help solve the problem.

                        1 (very Often)   2 (Rarely)   3 (Never)
   Q1. Likes it           12              15             13
   Q2. Recommends it      22              11             10
   Q3. Used it            22              12             9

In SPSS, one can even request row, column, or total percentages.
I've tried table(), ftable(), xtab(), CrossTable() from gmodels, and CrossTable() from descr, and none of these can handle (afaik) multiple variables; they mostly seem to handle 1 variable crossed with another variable, and the 3rd creates layers.
Is there a package with some good cross tabbing/table examples that I could use to figure this out?   I'm sure I'm missing something simple, so I appreciate you pointing out what I missed.  Perhaps I have to generate each row as a separate list and then make a dataframe and print the dataframe?
UPDATE: I've now discovered ctab() in package catspec, which is also on the right track.  It's interesting that R has no consistent equivalent to Ctables in SPSS, which is basically a "tabbing" tool ala the old tabulate tools used for survey research.   ctab() is trying, and is an admirable 1st step... but you still can't make this table (above) with it.

A: The Hmisc package has the summary.formula function that can do something along the lines you want. It is very flexible, so look at the help page for examples, but here is an application to your problem:
library(Hmisc)
dd <- data.frame(Q1=sample(1:3, 20, replace=T), Q2=sample(1:3, 20, replace=T),
                 Q3=sample(1:3, 20, replace=T))  #fake data
summary(~Q1+Q2+Q3, data=dd, fun=table)

This gives the following result:
 Descriptive Statistics  (N=20)

 +------+-------+
 |      |       |
 +------+-------+
 |Q1 : 1|25% (5)|
 +------+-------+
 |    2 |45% (9)|
 +------+-------+
 |    3 |30% (6)|
 +------+-------+
 |Q2 : 1|30% (6)|
 +------+-------+
 |    2 |35% (7)|
 +------+-------+
 |    3 |35% (7)|
 +------+-------+
 |Q3 : 1|35% (7)|
 +------+-------+
 |    2 |30% (6)|
 +------+-------+
 |    3 |35% (7)|
 +------+-------+

The possible values are given in rows, because it has the flexibility of different sets of values for different variables. You might be able to play with the function parameters (like method and fun) to get the other direction.

A: Modifying a previous example
library(Hmisc)
library(plyr)
dd <- data.frame(q1=sample(1:3, 20, replace=T),
 q2=sample(1:3, 20, replace=T),
 q3=sample(1:3, 20, replace=T))  #fake data

cross <- ldply(describe(dd), function(x) x$values[1,])[-1]

rownames(cross) <- c("Q1. Likes it","Q2. Recommends it","Q3. Used it")
names(cross) <- c("1 (very Often)","2 (Rarely)","3 (Never)")

Now cross looks like this
> cross
                  1 (very Often) 2 (Rarely) 3 (Never)
Q1. Likes it                   4         10         6
Q2. Recommends it              7          9         4
Q3. Used it                    6          4        10

A: The underlying issue is that this data is not in tidy format.  Crosstabbing multiple variables will be easier when the data is reshaped into "long" form.  We can do that with gather from the tidyr package.
After reshaping, many crosstab functions will work; I'll use tabyl from the janitor package (since - full disclosure - I maintain that package and built the function for this purpose).
# Create reproducible sample data
set.seed(1)
possible_values <- c("1 (Very Often)", "2 (Rarely)", "3 (Never)")
some_values <- sample(possible_values, 100, replace = TRUE)
dat <- data.frame(Q1 = some_values[1:25], Q2 = some_values[26:50],
                 Q3 = some_values[51:75], Q4 = some_values[76:100])

library(tidyr)
library(janitor)

dat %>%
  gather(question, response) %>%
  tabyl(question, response)
#>   question 1 (Very Often) 2 (Rarely) 3 (Never)
#> 1       Q1              8          8         9
#> 2       Q2              4         11        10
#> 3       Q3              8         12         5
#> 4       Q4              7          7        11

From there, you can format with functions like janitor::adorn_percentages().

A: just check Hadley Wickham's reshape package.
AFAIS, you need cast function from the package.

A: xtabs has a formula interface that can take some practice to get used to, but this can be done. If you have the data in a dataframe df and your variables are called ques and resp, you can use:
xtabs(~ques+resp,data=df)

For example:
> t1 <- rep(c("A","B","C"),5)
> t2 <- rpois(15,4)
> df <- data.frame(ques=t1,resp=t2)
> xtabs(~ques+resp,data=df)
     resp
names 2 3 4 5 6 7 9
    A 1 0 2 1 0 0 1
    B 1 0 0 2 1 1 0
    C 1 2 0 1 0 1 0

A: Check out tableStack() from the epiDisplay package. I think it might be what you're looking for.

A: You could use a custom function to use rbind() on several tables, something like this:
multitab <- function(...){
   tabs<-list(...)
   tablist<-lapply(tabs,table)
   bigtab<-t(sapply(tablist,rbind))
   bigtab }


text:
Q: What is a WhereSelectArrayIterator in Linq? I have an array of strings.  I'm trying to write them to an element.  When I create a new element it works as it's supposed to, when i try to SetElementValue it doesnt. Any help would be appreciated.  I don't even know what to look up.
Working Properly:
new XElement("tags", blog.tags.Select(x =>
    new XElement("tag", PageUtilities.AddCDATAElements(PageUtilities.SanitizeXmlString(x)))))

Result in Xml File:
<tags>
  <tag><![CDATA[tag1]]></tag>
  <tag><![CDATA[tag2]]></tag>
  <tag><![CDATA[tag3]]></tag>
  <tag><![CDATA[tag4]]></tag>
</tags>

The problem comes in when i try to update:
Not Working:
xBlog.SetElementValue("tags", blog.tags.Select(x =>
    new XElement("tag", PageUtilities.AddCDATAElements(PageUtilities.SanitizeXmlString(x)))));

Result:
<tags>System.Linq.Enumerable+WhereSelectArrayIterator`2[System.String,System.String]</tags>

At a total loss.  Please help.  Thanks you guys!
For Simplicity I tried it without the AddCDATAElements and SanitizeXMLString and still the exact same result
xBlog.SetElementValue("tags", blog.tags.Select(x => new XElement("tag", x)));

System.Linq.Enumerable+WhereSelectArrayIterator`2[System.String,System.String]

A: In the first case, you're passing an IEnumerable into the constructor, and the code is smart enough to figure out what you're doing and loop on it. I took a peek at the constructor (with ReSharper), and it seems that if what you're passing is an IEnumerable, it loops and creates an XNode for each item in the list.
In the second case, you're passing an IEnumerable to SetElementValue. But it doesn't check to see if the parameter is an IEnumerable. It does some basic type checking to see if it's a string, int, etc, and finally it just calls ToString, which in your case returns the name of the type of variable that is being produced by blog.tags.Select(x => ...).
Storing the result in a list first, and looping should solve the issue, but then I'm not sure what you want to do with each item in the list.
var elements = blog.tags.Select(x =>
    new XElement("tag", PageUtilities.AddCDATAElements(PageUtilities.SanitizeXmlString(x))))

foreach (var element in elements)
{
    // do something with each element
}

A: Select will always return an Enumerable of items.  Looks like SetElementValue will just do a ToString() on the value of that parameter.  If you want a single element's value, use .First().Value after the .Select().  If you want all of them, you'll probably need to add more code to generate multiple elements and add them to the value.

A: Not too sure what your data is, but did you try to put a ToList() or ToArray() after the linq? that will make the enumerable into either.


text:
Q: Subordinate clause inversion. Is it correct in English? While writing English text, I sometimes inverse the principal and subordinate clauses (as I think they are named).
But Grammarly systematically flags this as an error and proposes to rewrite the sentence in the "correct" order. For example:

In that case, we may find solutions to protect your keys and credentials.

Grammarly suggests rewriting the sentence as:

We may find solutions to protect your keys and credentials in that case.

In the first form, my feelings are that a greater emphasis is put on the subordinate clause "in that case". But it may be a bias coming from my native language (French).

*

*Is the first form grammatically correct?

*Should I follow Grammarly's suggestion and systematically rewrite those sentences as suggested by the application?

A: A phrase such as "in that case" (which would usually be considered a prepositional phrase, not a clause) may come at the beginning of a clause, so your original sentence is fine. (The comma is correct, too.) It should not be flagged as an error, and there is no need to follow Grammarly's suggestion.
Placing the prepositional phrase at the beginning of the sentence does place more emphasis on it, but in this case the difference is very minor.


text:
Q: Php strrpos detects no string, always 0 position Hi guys this is really stunning questions.
I have many experience with strrpos but this is really out of sense . First the array:
arrCopy => {
  ["Codice"]=>
  string(33) "Per sport d è numerico"
  ["Maniche"]=>
  string(15) " maniche corte "
  ...
  ["Taglia"]=>
  string(8) "tg tg XL"
}

I want to isolate behaviour of "Taglia" in a Foreach loop, but I cannot detect it!
foreach ($arrCopy as $key=>$spec){
         echo gettype($key); // prints string
         $tg= strpos(strtolower($key) , 'taglia'); // gives me
//always 0 also with "Taglia" key
            if (  $tg !== false || ....
                 // never goes there

Where I am wrong?

A: You should test the retval of strpos() against FALSE, to determine whether the string is contained.
From http://php.net/manual/en/function.strpos.php:

This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE, such as 0 or "". Please read the section on Booleans for more information. Use the === operator for testing the return value of this function.

Probably better to use strcmp - you're not so much trying to find a substring, as to ensure a match.


text:
Q: get_headers(): SSL operation failed with code 1 Hey i try to get header information of url ,
when i use the protocol http it's work fine , but when i use https it's not working
the url : https://200.35.78.130/
Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in
Warning: get_headers(): Failed to enable crypto in
Warning: get_headers(https://200.35.78.130/): failed to open stream: operation failed in /

this is my code
print_r(get_headers("https://200.35.78.130/", 1));

A: That error occurs when you're trying to access a URL without a valid SSL certificate. You can work around this by overriding the default stream context, which will affect all subsequent file operations (including remote URLs)
<?php
stream_context_set_default( [
    'ssl' => [
        'verify_peer' => false,
        'verify_peer_name' => false,
    ],
]);

print_r(get_headers('https://200.35.78.130/'));

Alternatively, if you're using PHP 7.1+, you can create a temporary context using stream_context_create and pass it directly to the function, to avoid overriding the default:
$context = stream_context_create( [
    'ssl' => [
        'verify_peer' => false,
        'verify_peer_name' => false,
    ],
]);

print_r(get_headers('https://200.35.78.130/', 0, $context));

Thanks to Matthijs Wessels in the comments for pointing it out.

A: Because you installed the SSL certificate without an intermediate key


text:
Q: Storing subclasses with same properties in a data store What's the best way to store inheritance in a database like Neo4j?
Let's say I have two types of vehicle; car and test car, where test car inherits from car. In our example there's no difference in properties so all data stored in the data store is the same, but in our app's model, test car has methods that car doesn't.
Is it best to store a new property like car_type with some kind of enum? Or is there a better way to store/determine a subclass when downloading and initting it in an application?

A: I would suggest using labels.  So if you had vehicles, of which you had cars and buses, you might have the labels Vehicle, Car, and Bus and all nodes with the labels Car and Bus would also have the label Vehicle.
If you want to see an example, the neo4j gem for ruby does this to represent class inheritance for models which users of the gem define.


text:
Q: Do I need to uninstall Ubuntu to upgrade to Windows 8? All that was an awesome experience using Ubuntu 12.04. I want to upgrade my Windows 7 to Windows 8.
So do I need to uninstall my Ubuntu (as a Precaution)? Right now I have both the operating systems on my Laptop. If I have to uninstall please tell me the procedure.

A: If you used wubi.exe i would uninstall it. I made the mistake of not uninstalling it now when I try to boot to Ubuntu I get an error screen.

A: No, you do not. You can upgrade to windows 8. As long as you only modify your windows partition this will be fine. After you install windows 8 you will no longer be able to boot into linux because grub will have been replaced, but you can just put it back using a rescue cd.
Start the rescue cd then run something like
sudo mount /dev/sda3 /mnt

sudo grub-install /dev/sda --boot-directory=/mnt/boot/

adjusting the command for your hard drive partitions and locations.


text:
Q: How to connect to Amazon aws instance using mindterm? I just signed up for AWS and would like to connect to my instance using mindterm as per one of the option in the doc.
But the following step seems impossible:
Click A Java SSH client directly from my browser (Java required).

because there is no such option to click on.
Is the documentation out of date, or am I missing something?
I am using Chrome on Windows 7. Java is working in Chrome (I had to install Java 32-bit version to make it work).


text:
Q: Raspberry Pi 3 Model B setup startx or sudo startx gives: command not found How can I get startx to work?
I have my SD set -used pi filler and image raspbian jessie.
However, I did download the zip Raspbian Jessie Lite (usually I have done the full desktop image, not lite)
After I log in as pi I want to get to my GUI. I type:
$startx
-bash: startx: command not found

So then I try with sudo, still: command not found.
I have done my steps in the sudo raspi-config to extend file system, set correct time and keyboard.
When I try to install some python packages
I want to configure my wi-fi by running the GUI. But, I cannot get to my gui with startx.
I know a few things (I've had startx work before on other pi 3s, but I'm a big noob, so please be detailed if you can help me out.
Thank you, in advance!

A: sudo apt-get install lxde

after this one gets installed, used the command
startlxde

A: My solution was to install these packages
sudo apt-get --no-install-recommends install xserver-xorg xserver-xorg-video-fbdev xinit pciutils xinput xfonts-100dpi xfonts-75dpi xfonts-scalable

A: The lite version of Raspian Jessie doesn't come with X installed. That's why you cannot start it.
Raspbian lite is intended for a headless system usage, however you can still install X (don't ask me how, the web is plenty of tutorials)

A: use sudo apt-get install xinit instead.
Don't forget to expand your File System and reboot: sudo raspi-config


text:
Q: Mongoose auto-increment I would like to create auto increment ID with Mongoose for MongoDB. I was already looking for some examples, but there aren't anything useful other the MongoDB's documentation.

A: Use mongoose-sequence, For eg: In the below model, it increments order number by one when a new document is inserted.
const mongoose = require('mongoose'),
Schema = mongoose.Schema;

const AutoIncrement = require('mongoose-sequence')(mongoose);

const orderSchema = new Schema({
   _id: mongoose.Schema.Types.ObjectId,
   orderId: {
     type: Number
   }
   ...
});

orderSchema.plugin(AutoIncrement, {inc_field: 'orderId'});
module.exports = mongoose.model('Order', orderSchema);

There is an important thing that needs to be understood. If you add required: true in the schema, the operation breaks.
In your route file, you can create a mongoose order object and call save.
...
const order = new Order(body);
order.save()
     .then(doc => {
       res.json(doc);
       res.end();
     });

A: On npm we have mongoose-auto-increment and mongoose-sequence packages to achieve this functionality very easily.


text:
Q: Implementation of google places using VueJs in Hybrid mobile application I am trying to implement searching of google places using vue js in hybrid mobile application. Searching functionality is working fine but when I click on the list of the places I can't select any of them.
I have used vue-google-places library and vue-google-autocomplete library. In both libraries I am facing the same issue.
<template>
  <q-item>
    <q-item-main>
      <q-field :error="$v.serial.$error">
        <VueGooglePlaces
          api-key="api-key"
          class="subheading"
          :enable-geolocation="true"
          types="(cities)"
          @placechanged="onPlaceChanged"
        >
          <input
            ref="address"
            float-label="Serial Number"
            type="text"
            v-model="address"
            clearable
            @blur="$v.serial.$touch"
          />
        </VueGooglePlaces>

        <vue-google-autocomplete
          id="map"
          class="form-control"
          placeholder="Start typing"
          v-on:placechanged="getAddressData"
        ></vue-google-autocomplete>
      </q-field>
    </q-item-main>
  </q-item>
</template>

import VueGoogleAutocomplete from "vue-google-autocomplete";
import Vue from "vue";

export default {
  name: "ScanBarcodePage",
  components: {
    "page-title": PageTitleComponent
  },
  mounted() {
    if (this.$refs.address) {
      this.$refs.address.focus();
    }
  },
  data() {
    return {
      address: "",
      serial: "",
      places: []
    };
  },
  methods: {
    getAddressData: function(addressData, placeResultData, id) {
      this.address = addressData.formatted_address;
    },
    onPlaceChanged: function(addressData, placeResultData, id) {
      this.address = addressData.formatted_address;
    }
  }
}

I have added the sample code above. I am not getting any error but when I type some character in text field it shows list of places but I can't select any of them. But the same plugin is working fine for browser.

A: My guess is that these libraries are conflicting with each other due to calling the Maps API twice. Try implementing only one of them to rule this out.
Here's what I did to make vue-google-autocomplete work on mobile (Android) in a hybrid app via Apache cordova.
First some context here, I created a vue + cordova app via vue-cli-plugin-cordova.
In /public/index.html, add your Maps API script with a valid API key within the  element:

Then go to /src/App.vue and replace all content with the code from the library's documentation's example:
<template>

Your Address

        <vue-google-autocomplete
            ref="address"
            id="map"
            classname="form-control"
            placeholder="Please type your address"
            v-on:placechanged="getAddressData"
            country="sg"
        >
        </vue-google-autocomplete>

</template>

Then plug in a device (or emulator) and run your app. You should be able to select a place from Autocomplete predictions without problem.
If you still can't, then check that your API key is in fact valid, i.e. it must be properly (un)restricted and belong to a Cloud project that has billing, JavaScript API & Places API enabled. More info in Google's guide here.
Really hope this helps you!


text:
Q: Magento 2 - Checkout - Payment methods not visible I'm trying to extend checkout page, I copied the

checkout_index_index.xml

in my layout folder (vendor/theme/Magento_Checkout/layout) I change some thing in the file, now in the payment method I can't find method I set on the admin page. If I remove my custom layout file, the method come's back and they work's fine.
This'is my custom xml file (I remove jsLayout part I didn't modify it):
<?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <css src="css/checkout.css" media="screen,projection" />
</head>
<body>
    <referenceContainer name="page.messages" remove="true"/>
    <move element="logo" destination="top-header" before="header-links"/>
    <referenceContainer name="newsletternewsletter" remove="true"/>
    <referenceBlock name="page.main.title">
        <action method="setPageTitle">
            <argument translate="true" name="title" xsi:type="string">Checkout</argument>
        </action>
    </referenceBlock>
    <referenceContainer name="content">
        <container name="checkout-container" as="checkout-container" htmlTag="div" htmlClass="row no-margin">
            <container name="checkout-center" as="checkout-center" htmlTag="div" htmlClass="col s12 m10 l10 offset-m1 offset-l1">
                <container name="checkout-border" as="checkout-border" htmlTag="div" htmlClass="dashboard-container">

                    <block class="Magento\Checkout\Block\Onepage" name="checkout.root" template="Magento_Checkout::onepage.phtml" cacheable="false">
                        <arguments>
                            <argument name="jsLayout" xsi:type="array">
                                <!-- NO CHANGE HERE -->
                            </argument>
                        </arguments>
                    </block>

                </container>
            </container>
        </container>
    </referenceContainer>
</body>

A: I saw many developers who did the same way. We shouldn't try to override the layouts by copying them to our module or theme. And then, we modify them.
In your case, we overridden "completely" the original layout. So, any changes will affect to the global layout node.

Rather than copy extensive page layout or page configuration code and
  then modify what you want to change, in the Magento system, you only
  need to create an extending layout file that contains the changes you
  want.

Magento 2 Layout


text:
Q: How to pass a top-level object to a low-level one? What I mean by top-level is an object which is created in one of the top layers of the program (for example the main function). A low-level object is created far deep in the other objects' code.
So let's say my main function looks like this :
public static void Main(String[] args)
{
    SomeClass topLevelObject = ...
    SomeOtherClass otherTopLevelObject = ...
}

Now, let's say that otherTopLevelObject creates an object, which itself creates another object, and so on to an object that we'll call lowLevelObject
Then what if lowLevelObject needs topLevelObject ? What is a good way to tackle this ? Does topLevelObject simply needs to be passed along the constructor tree ? Or maybe it is best to avoid completely such cases. If so, how do I avoid them ?

A: Usually you don't want to create a dependency in lowLevelObject on topLevelObject.  For example, if lowLevelObject is a thing that saves data to disk, and topLevelObject is the current state of a game, you probably don't want lowLevelObject to have to know how to interpret the state of the game.  Instead, you should have topLevelObject be able to implement some interface or method such as Serialize, then all lowLevelObject needs to do is know how to handle serialized data.
That way, when you create a new SomeOtherClass2 that implements crash logging, you don't need to modify lowLevelObject to now know how to interpret crash data.  Just implement Serialize for SomeOtherClass2, which lowLevelObject already knows how to deal with.


text:
Q: Composer create the project at an unknown location I tried to execute
composer create-project laravel/laravel

It is saying that it is creating the project at "C:\Users\FXFX\" but there is no visible project at "C:\Users\FXFX\", I wonder where is my projects gone?

A: This happens because of the "Comodo Internet security sandbox". It always sand box the composer and that resulted to creating it's files inside the sandbox in my case "C:\VTRoot\HarddiskVolume3\Users\FXFX".
Solution :
I exclude composer directory from the sandbox.


text:
Q: Android Database usage This may be a simple question as I have not done any database work for a while!
I have two tables with data like the below
Table 1
Rows with Primary Keys 1,2
Table 2
Rows with Foreign keys 1,2,3,4
I was to be able to perform a DELETE statement which will remove all rows from Table 2 that do not have a corresponding primary key in table 1, which in this case would result in only rows with foreign keys 1 & 2 being left in the table.
I should mention that this is on Android so I am using SQLite and also I am interested in the ease of doing this via a content provider.
Thanks for any help

A: Try this:
String SQL="DELETE FROM Table2
WHERE (Table2.FQ1,Table2.FQ2) NOT IN (SELECT PK1,PK2 FROM Table1)";
db.SQL(SQL);

But i'm not sure that the (Table2.FQ1,Table2.FQ2) sentence will run into the NOT IN


text:
Q: How to expose a range of ports in Kubernetes? How can we expose a range of ports in Kubernetes?
My cloud application is using a range of ports when running(40000 ~42000).
How do I specify a range of exposed ports in Kubernetes service yaml file?

A: Kubernetes services currently do not support port ranges, see https://github.com/kubernetes/kubernetes/issues/23864
Update: As of 2021 there is a kubernetes enhancement proposal field for this requirement: https://github.com/kubernetes/enhancements/pull/2611

A: One option is to use go-templates to generate the yaml for all of the ports, then deploy that yaml, then use gomplate to compile the yaml
lotsofports.yaml
apiVersion: v1
kind: Service
metadata:
  namespace: some-service
  labels:
    name: some-service
spec:
  ports:
  {{- range seq 0 2000}}
  - port: {{add 40000 .}}
    targetPort: {{add 40000 .}}
    name: exposed-port-{{add 40000 .}}
  {{- end -}}
  selector:
    name: some-service
  sessionAffinity: None
  type: ClusterIP

Then compile the yaml:
gomplate -f lotsofports.yaml > service.yaml

A: As @Thomas pointed is not supported yet.
However, as workaround you can try to use Helm templates.
Create chart with service template and ports in values.yaml file.


text:
Q: Why UpdateModel() binding of IList does not work, but as a method parameter it does? I have a simple class:
[Serializable]
public class RatePerPurpose
{
    public int ValueId { get; set; }

    public double Rate { get; set; }
}

, and simple data to POST:
<input type="hidden" name="[0].ValueId" value="1" />
<input type="hidden" name="[0].Rate" value="2.34" />
<input type="hidden" name="[1].ValueId" value="10" />
<input type="hidden" name="[1].Rate" value="20.34" />

This works without any problems:
[HttpPost]
public virtual ActionResult MyActionPost(List<RatePerPurpose> rates)
{
  // no problem, this works
}

My question is, why these does NOT work (I have tested ASP.NET MVC 5)? Or how to change this, to make it work?
[HttpPost]
public virtual ActionResult MyActionPost()
{
  List<RatePerPurpose> rates = new List<RatePerPurpose>();
  this.UpdateModel(rates);
  // This DOES NOT work, 'rates' is empty :-(

  this.UpdateModel(rates, prefix:"");
  // Setting 'none' prefix, also DOES NOT work. 'rates' is still empty
}

PS: I have tested List<> and IList<> also, but same problem occurs.

A: The problem is that in the second example, you have an empty list. UpdateModel will update items if they exist and it can find a correlation, but it won't fill an empty list for you. If you instead did something like:
var rates = db.RatePerPurposes.ToList();
UpdateModel(rates);

That would probably work, assuming it could match RatePerPurpose instances from the POST body to RatePerPurpose instances in what was returned from the database.

A: I have finally figured it out (after three sleepless days). There were actually two problems.
Problem 1
There was buggy DoubleModelBinder deeply-fried (registered) in my application's global.asax called on Application_Start:
...
ModelBinders.Binders.Add(typeof(double), new DoubleModelBinder());
...

This binder was dependent on UICulture, so binding from action method parameter worked. But body of MyActionPost() had different culture, so my DoubleModelBinder was throwing some internal exception. It is a bit strange, that this exception was not propagated out of UpdateModel().
Problem 2
Using UpdateModel() (or TryUpdateModel()) like in my example is perfectly fine. I have found similar example also in a book Pro ASP.NET MVC 5 from Adam Freeman on page 654, but the "correct" version should use FormCollection as a action method parameter. So working example:
[HttpPost]
public virtual ActionResult MyActionPost(FormCollection form)
{
  List<RatePerPurpose> rates = new List<RatePerPurpose>();
  this.UpdateModel(rates, "MyList", form);
  // This works, 'rates' is binded properly
}

PS:
And one last advice. Use .Index when binding collections. (It is not required, when indexes are from 0 and there are no gaps between items, but I can sleep better now. :) So data should look like this:
<input type="hidden" name="MyList.Index" value="0" />
<input type="hidden" name="MyList[0].ValueId" value="1" />
<input type="hidden" name="MyList[0].Rate" value="2.34" />

<input type="hidden" name="MyList.Index" value="1" />
<input type="hidden" name="MyList[1].ValueId" value="10" />
<input type="hidden" name="MyList[1].Rate" value="20.34" />


text:
Q: Solcx compile source erroe Exception has occurred: SolcNotInstalled
solc 0.6.0 has not been installed. Use solcx.install_solc('0.6.0') to install.
File "C:\Users\gilld\Documents\Demos\vstoolbox\web3_py_simple_storage\deploy.py", line 8, in
compiled_sol = compile_standard(

A: you need to install solidity compiler you can install it through this website
https://www.npmjs.com/package/solc


text:
Q: Styled-Component : I want to use Variable in Styled-Component I am working on app . Here I created separate file for style I used style-component for custom css but the problem is that I don't have access to use variable instead of HEX value . I put color value in variable but I am not able to use it in styled-component .
import styled from 'styled-components';

// App Colors
let text ='#fff';

// Top Header Component Main Style
export const HeaderContainer= styled.div `
    margin-top: 67px;
    margin-left: 220px;
    margin-bottom: 30px;
    color: {text};
`

A: You are missing a $ before the brackets.
color: ${text};


text:
Q: I want to close the app but do not go back to the previous Activity I used an activity and several pieces in my app
sometimes when I'm on the first page (activity) and back pressed not going out of app and returns to the fragment or the same page
When this happens I've done a lot of work in the program
I used this code to fix this problem but
it also applied to the fragments
@Override
    public void onBackPressed() {
       this.finish();
    }

Why returns to the fragment or the same page
How this problem is solved
I'm using this now
boolean doubleBackToExitPressedOnce = false;

    @Override
    public void onBackPressed() {
        if (getSupportFragmentManager().getBackStackEntryCount() > 0) {
            getSupportFragmentManager().popBackStack();
        } else if (!doubleBackToExitPressedOnce) {
            this.doubleBackToExitPressedOnce = true;
            Toast.makeText(this, "Click to exit again", Toast.LENGTH_SHORT).show();
            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                    doubleBackToExitPressedOnce = false;
                }
            }, 2000);
        } else {
            super.onBackPressed();
            return;
        }
    }

Way is going to be a fragment
TabirFragment tabirFragment = new TabirFragment();
            Bundle bundle = new Bundle();
            bundle.putInt("id", id);
            bundle.putString("name", name);
            tabirFragment.setArguments(bundle);
            FragmentManager manager = getSupportFragmentManager();
            FragmentTransaction transaction = manager.beginTransaction().addToBackStack(null);
            transaction.replace(R.id.main_activity, tabirFragment).commit();

A: If you have multiple activities on the stack, then:

finish() - finishes the activity where it is called from and you see
  the previous activity.

There is also system.exit but that would not work in your case:

System.exit(0) - restarts the app with one fewer activity on the
  stack. So, if you called ActivityB from ActivityA, and System.exit(0)
  is called in ActivityB, then the application will be killed and
  started immediately with only one activity ActivityA

I recommend you use finishAffinity(). It will finish the current activity as well as all activities immediately below it. I remind you that it is supported by only API level 16+

A: several pieces what? fragments, getting trouble to understand, anyway if you want to manage frag and onBackPress, use this
 private void setUpBackStackListener() {
    getFragmentManager().addOnBackStackChangedListener(new FragmentManager.OnBackStackChangedListener() {
        @Override
        public void onBackStackChanged() {
            Fragment currentFragment = getFragmentManager().findFragmentById(R.id.am_frameLayout);
            if (currentFragment != null) {

                int myCount = getFragmentManager().getBackStackEntryCount();
                if (LOG_DEBUG) Log.e(TAG, "backStackCount : " + myCount);

                String currentFragName = currentFragment.getClass().getSimpleName();

                if (currentFragName.equalsIgnoreCase(FragOne.class.getSimpleName())) {
                    shouldExit = true;

                } else if (currentFragName.equalsIgnoreCase(FragTwo.class.getSimpleName())) {
                    shouldExit = false;

                    }
                }
            }
        }
    });
}
 @Override
public void onBackPressed() {
    if (shouldExit == true) {
        if (LOG_DEBUG)
            Log.e(TAG, " Yeah exit douche:" + shouldExit + " isLastEntry : Testing :" + isLastEntry);
 super.onBackPressed();
    } else {
        getFragmentManager().popBackStack();
    }
}

,if this not you seeking, you might want to clear what you want in a bit subtle way

A: When you used multiple fragment and activity When you switch activity by using method startActivity(), always use method finish(); when you back pressed then you will never get multiple activity and fragment and use onBackPressed method on main activity.
boolean doubleBackToExitPressedOnce=false;

@Override
public void onBackPressed() {
    //Checking for fragment count on backstack
    if (getSupportFragmentManager().getBackStackEntryCount() > 0) {
        getSupportFragmentManager().popBackStack();
    } else if (!doubleBackToExitPressedOnce) {
        this.doubleBackToExitPressedOnce = true;
        Toast.makeText(this,"Please click back again to exit.", Toast.LENGTH_SHORT).show();

        new Handler().postDelayed(new Runnable() {

            @Override
            public void run() {
                doubleBackToExitPressedOnce = false;
            }
        }, 2000);
    } else {
        super.onBackPressed();
        return;
    }
}

A: The easiest solution i can give you is to keep no-history for the activity in the manifest file. and then override the back method for each activity.
    <activity
        android:name=".example"
        android:noHistory="true">
    </activity>