SVG animation issue. SVG moves after animation ends

Question: I've run into an issue when animating an SVG on hover. When you move the cursor away when the animation is done you can see the arrowheads move slightly by a pixel or two. Anyone know how to have them not move?
I am only animating the opacity of the arrowheads so I'm not sure why they shift.
Stack overflow wants me to add more details, but I've added all that I can to describe the problem, so I am just typing more words. Thanks for the help.

svg:hover .woven .st0 {
  animation: offset 1.5s linear forwards;
  animation-iteration-count: 1;
}
svg:hover .woven .st1 {
  opacity: 0;
  animation: opacity 1.5s linear forwards;
  animation-iteration-count: 1;
}
@keyframes offset {
  from {
    stroke-dasharray: 0 50;
    stroke-dashoffset: 0px;
  }
  to {
    stroke-dasharray: 60 60;
    stroke-dashoffset: 0px;
  }
}
@keyframes opacity {
  0% {
    opacity: 0;
  }
  90% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
<?xml version="1.0" encoding="utf-8"?>

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
  viewBox="0 0 1442.3 836.8" style="enable-background:new 0 0 1442.3 836.8;" xml:space="preserve">

<g id="Layer_1" class="woven">
 <g>
  <g>
   <g>
    <g>
     <line class="st0" x1="237.8" y1="680" x2="197.9" y2="719.9"/>
     <g>
      <path class="st1" d="M200.8,703.2c0.5,0.1,0.9,0.7,0.8,1.2l-3.4,15.2l15.2-3.4c0.5-0.1,1.1,0.2,1.2,0.8
       c0.1,0.5-0.2,1.1-0.8,1.2l-16.8,3.7c-0.3,0.1-0.7,0-0.9-0.3s-0.3-0.6-0.3-0.9l3.7-16.8c0-0.2,0.1-0.4,0.3-0.5
       C200.1,703.2,200.5,703.1,200.8,703.2z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="236.5" y1="681.3" x2="276.4" y2="641.4"/>
     <g>
      <path class="st1" d="M273.5,658.2c-0.5-0.1-0.9-0.7-0.8-1.2l3.4-15.2l-15.2,3.4c-0.5,0.1-1.1-0.2-1.2-0.8
       c-0.1-0.5,0.2-1.1,0.8-1.2l16.8-3.7c0.3-0.1,0.7,0,0.9,0.3s0.3,0.6,0.3,0.9l-3.7,16.8c0,0.2-0.1,0.4-0.3,0.5
       C274.2,658.1,273.8,658.2,273.5,658.2z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="236.9" y1="682.1" x2="197" y2="642.2"/>
     <g>
      <path class="st1" d="M213.7,645.1c-0.1,0.5-0.7,0.9-1.2,0.8l-15.2-3.4l3.4,15.2c0.1,0.5-0.2,1.1-0.8,1.2
       c-0.5,0.1-1.1-0.2-1.2-0.8l-3.7-16.8c-0.1-0.3,0-0.7,0.3-0.9c0.2-0.2,0.6-0.3,0.9-0.3l16.8,3.7c0.2,0,0.4,0.1,0.5,0.3
       C213.7,644.4,213.8,644.7,213.7,645.1z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="235.5" y1="680.7" x2="275.5" y2="720.7"/>
     <g>
      <path class="st1" d="M258.7,717.7c0.1-0.5,0.7-0.9,1.2-0.8l15.2,3.4l-3.4-15.2c-0.1-0.5,0.2-1.1,0.8-1.2
       c0.5-0.1,1.1,0.2,1.2,0.8l3.7,16.8c0.1,0.3,0,0.7-0.3,0.9c-0.2,0.2-0.6,0.3-0.9,0.3l-16.8-3.7c-0.2,0-0.4-0.1-0.5-0.3
       C258.8,718.4,258.6,718.1,258.7,717.7z"/>
     </g>
    </g>
   </g>
  </g>
  <g>
   <g>
    <g>
     <line class="st0" x1="118.3" y1="591.7" x2="78.4" y2="631.6"/>
     <g>
      <path class="st1" d="M81.3,614.9c0.5,0.1,0.9,0.7,0.8,1.2l-3.4,15.2l15.2-3.4c0.5-0.1,1.1,0.2,1.2,0.8
       c0.1,0.5-0.2,1.1-0.8,1.2l-16.8,3.7c-0.3,0.1-0.7,0-0.9-0.3s-0.3-0.6-0.3-0.9l3.7-16.8c0-0.2,0.1-0.4,0.3-0.5
       C80.6,614.9,80.9,614.8,81.3,614.9z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="116.9" y1="593" x2="156.9" y2="553.1"/>
     <g>
      <path class="st1" d="M153.9,569.9c-0.5-0.1-0.9-0.7-0.8-1.2l3.4-15.2l-15.2,3.4c-0.5,0.1-1.1-0.2-1.2-0.8s0.2-1.1,0.8-1.2
       l16.8-3.7c0.3-0.1,0.7,0,0.9,0.3c0.2,0.2,0.3,0.6,0.3,0.9l-3.7,16.8c0,0.2-0.1,0.4-0.3,0.5
       C154.6,569.8,154.3,569.9,153.9,569.9z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="117.4" y1="593.8" x2="77.4" y2="553.8"/>
     <g>
      <path class="st1" d="M94.2,556.8c-0.1,0.5-0.7,0.9-1.2,0.8l-15.2-3.4l3.4,15.2c0.1,0.5-0.2,1.1-0.8,1.2s-1.1-0.2-1.2-0.8
       L75.4,553c-0.1-0.3,0-0.7,0.3-0.9s0.6-0.3,0.9-0.3l16.8,3.7c0.2,0,0.4,0.1,0.5,0.3C94.1,556.1,94.3,556.4,94.2,556.8z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="116" y1="592.4" x2="155.9" y2="632.3"/>
     <g>
      <path class="st1" d="M139.2,629.4c0.1-0.5,0.7-0.9,1.2-0.8l15.2,3.4l-3.4-15.2c-0.1-0.5,0.2-1.1,0.8-1.2
       c0.5-0.1,1.1,0.2,1.2,0.8l3.7,16.8c0.1,0.3,0,0.7-0.3,0.9s-0.6,0.3-0.9,0.3l-16.8-3.7c-0.2,0-0.4-0.1-0.5-0.3
       C139.2,630.1,139.1,629.8,139.2,629.4z"/>
     </g>
    </g>
   </g>
  </g>
  <g>
   <g>
    <g>
     <line class="st0" x1="118.3" y1="415.3" x2="78.4" y2="455.2"/>
     <g>
      <path class="st1" d="M81.3,438.4c0.5,0.1,0.9,0.7,0.8,1.2l-3.4,15.2l15.2-3.4c0.5-0.1,1.1,0.2,1.2,0.8s-0.2,1.1-0.8,1.2
       l-16.8,3.7c-0.3,0.1-0.7,0-0.9-0.3s-0.3-0.6-0.3-0.9l3.7-16.8c0-0.2,0.1-0.4,0.3-0.5C80.6,438.5,80.9,438.4,81.3,438.4z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="116.9" y1="416.6" x2="156.9" y2="376.7"/>
     <g>
      <path class="st1" d="M153.9,393.4c-0.5-0.1-0.9-0.7-0.8-1.2l3.4-15.2l-15.2,3.4c-0.5,0.1-1.1-0.2-1.2-0.8s0.2-1.1,0.8-1.2
       l16.8-3.7c0.3-0.1,0.7,0,0.9,0.3s0.3,0.6,0.3,0.9l-3.7,16.8c0,0.2-0.1,0.4-0.3,0.5C154.6,393.4,154.3,393.5,153.9,393.4z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="117.4" y1="417.4" x2="77.4" y2="377.4"/>
     <g>
      <path class="st1" d="M94.2,380.4c-0.1,0.5-0.7,0.9-1.2,0.8l-15.2-3.4l3.4,15.2c0.1,0.5-0.2,1.1-0.8,1.2s-1.1-0.2-1.2-0.8
       l-3.7-16.8c-0.1-0.3,0-0.7,0.3-0.9s0.6-0.3,0.9-0.3l16.8,3.7c0.2,0,0.4,0.1,0.5,0.3C94.1,379.7,94.3,380,94.2,380.4z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="116" y1="416" x2="155.9" y2="455.9"/>
     <g>
      <path class="st1" d="M139.2,453c0.1-0.5,0.7-0.9,1.2-0.8l15.2,3.4l-3.4-15.2c-0.1-0.5,0.2-1.1,0.8-1.2
       c0.5-0.1,1.1,0.2,1.2,0.8l3.7,16.8c0.1,0.3,0,0.7-0.3,0.9s-0.6,0.3-0.9,0.3l-16.8-3.7c-0.2,0-0.4-0.1-0.5-0.3
       C139.2,453.7,139.1,453.4,139.2,453z"/>
     </g>
    </g>
   </g>
  </g>
  <g>
   <g>
    <g>
     <line class="st0" x1="118.3" y1="245.4" x2="78.4" y2="285.3"/>
     <g>
      <path class="st1" d="M81.3,268.5c0.5,0.1,0.9,0.7,0.8,1.2L78.7,285l15.2-3.4c0.5-0.1,1.1,0.2,1.2,0.8c0.1,0.5-0.2,1.1-0.8,1.2
       l-16.8,3.7c-0.3,0.1-0.7,0-0.9-0.3s-0.3-0.6-0.3-0.9l3.7-16.8c0-0.2,0.1-0.4,0.3-0.5C80.6,268.6,80.9,268.5,81.3,268.5z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="116.9" y1="246.7" x2="156.9" y2="206.8"/>
     <g>
      <path class="st1" d="M153.9,223.5c-0.5-0.1-0.9-0.7-0.8-1.2l3.4-15.2l-15.2,3.4c-0.5,0.1-1.1-0.2-1.2-0.8
       c-0.1-0.5,0.2-1.1,0.8-1.2l16.8-3.7c0.3-0.1,0.7,0,0.9,0.3c0.2,0.2,0.3,0.6,0.3,0.9l-3.7,16.8c0,0.2-0.1,0.4-0.3,0.5
       C154.6,223.5,154.3,223.6,153.9,223.5z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="117.4" y1="247.5" x2="77.4" y2="207.5"/>
     <g>
      <path class="st1" d="M94.2,210.5c-0.1,0.5-0.7,0.9-1.2,0.8l-15.2-3.4l3.4,15.2c0.1,0.5-0.2,1.1-0.8,1.2
       c-0.5,0.1-1.1-0.2-1.2-0.8l-3.7-16.8c-0.1-0.3,0-0.7,0.3-0.9s0.6-0.3,0.9-0.3l16.8,3.7c0.2,0,0.4,0.1,0.5,0.3
       C94.1,209.8,94.3,210.1,94.2,210.5z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="116" y1="246.1" x2="155.9" y2="286"/>
     <g>
      <path class="st1" d="M139.2,283.1c0.1-0.5,0.7-0.9,1.2-0.8l15.2,3.4l-3.4-15.2c-0.1-0.5,0.2-1.1,0.8-1.2
       c0.5-0.1,1.1,0.2,1.2,0.8l3.7,16.8c0.1,0.3,0,0.7-0.3,0.9s-0.6,0.3-0.9,0.3l-16.8-3.7c-0.2,0-0.4-0.1-0.5-0.3
       C139.2,283.8,139.1,283.4,139.2,283.1z"/>
     </g>
    </g>
   </g>
  </g>
  <g>
   <g>
    <g>
     <line class="st0" x1="237.8" y1="504.1" x2="197.9" y2="544"/>
     <g>
      <path class="st1" d="M200.8,527.3c0.5,0.1,0.9,0.7,0.8,1.2l-3.4,15.2l15.2-3.4c0.5-0.1,1.1,0.2,1.2,0.8
       c0.1,0.5-0.2,1.1-0.8,1.2l-16.8,3.7c-0.3,0.1-0.7,0-0.9-0.3s-0.3-0.6-0.3-0.9l3.7-16.8c0-0.2,0.1-0.4,0.3-0.5
       C200.1,527.3,200.5,527.2,200.8,527.3z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="236.5" y1="505.4" x2="276.4" y2="465.5"/>
     <g>
      <path class="st1" d="M273.5,482.3c-0.5-0.1-0.9-0.7-0.8-1.2l3.4-15.2l-15.2,3.4c-0.5,0.1-1.1-0.2-1.2-0.8
       c-0.1-0.5,0.2-1.1,0.8-1.2l16.8-3.7c0.3-0.1,0.7,0,0.9,0.3s0.3,0.6,0.3,0.9l-3.7,16.8c0,0.2-0.1,0.4-0.3,0.5
       C274.2,482.2,273.8,482.3,273.5,482.3z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="236.9" y1="506.2" x2="197" y2="466.2"/>
     <g>
      <path class="st1" d="M213.7,469.2c-0.1,0.5-0.7,0.9-1.2,0.8l-15.2-3.4l3.4,15.2c0.1,0.5-0.2,1.1-0.8,1.2
       c-0.5,0.1-1.1-0.2-1.2-0.8l-3.7-16.8c-0.1-0.3,0-0.7,0.3-0.9s0.6-0.3,0.9-0.3l16.8,3.7c0.2,0,0.4,0.1,0.5,0.3
       C213.7,468.5,213.8,468.8,213.7,469.2z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="235.5" y1="504.8" x2="275.5" y2="544.7"/>
     <g>
      <path class="st1" d="M258.7,541.8c0.1-0.5,0.7-0.9,1.2-0.8l15.2,3.4l-3.4-15.2c-0.1-0.5,0.2-1.1,0.8-1.2
       c0.5-0.1,1.1,0.2,1.2,0.8l3.7,16.8c0.1,0.3,0,0.7-0.3,0.9s-0.6,0.3-0.9,0.3l-16.8-3.7c-0.2,0-0.4-0.1-0.5-0.3
       C258.8,542.5,258.6,542.2,258.7,541.8z"/>
     </g>
    </g>
   </g>
  </g>
  <g>
   <g>
    <g>
     <line class="st0" x1="237.8" y1="328" x2="197.9" y2="367.9"/>
     <g>
      <path class="st1" d="M200.8,351.1c0.5,0.1,0.9,0.7,0.8,1.2l-3.4,15.2l15.2-3.4c0.5-0.1,1.1,0.2,1.2,0.8
       c0.1,0.5-0.2,1.1-0.8,1.2l-16.8,3.7c-0.3,0.1-0.7,0-0.9-0.3s-0.3-0.6-0.3-0.9l3.7-16.8c0-0.2,0.1-0.4,0.3-0.5
       C200.1,351.2,200.5,351.1,200.8,351.1z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="236.5" y1="329.3" x2="276.4" y2="289.4"/>
     <g>
      <path class="st1" d="M273.5,306.1c-0.5-0.1-0.9-0.7-0.8-1.2l3.4-15.2l-15.2,3.4c-0.5,0.1-1.1-0.2-1.2-0.8
       c-0.1-0.5,0.2-1.1,0.8-1.2l16.8-3.7c0.3-0.1,0.7,0,0.9,0.3s0.3,0.6,0.3,0.9l-3.7,16.8c0,0.2-0.1,0.4-0.3,0.5
       C274.2,306.1,273.8,306.2,273.5,306.1z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="236.9" y1="330" x2="197" y2="290.1"/>
     <g>
      <path class="st1" d="M213.7,293c-0.1,0.5-0.7,0.9-1.2,0.8l-15.2-3.4l3.4,15.2c0.1,0.5-0.2,1.1-0.8,1.2
       c-0.5,0.1-1.1-0.2-1.2-0.8l-3.7-16.8c-0.1-0.3,0-0.7,0.3-0.9s0.6-0.3,0.9-0.3l16.8,3.7c0.2,0,0.4,0.1,0.5,0.3
       C213.7,292.3,213.8,292.7,213.7,293z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="235.5" y1="328.7" x2="275.5" y2="368.6"/>
     <g>
      <path class="st1" d="M258.7,365.7c0.1-0.5,0.7-0.9,1.2-0.8l15.2,3.4l-3.4-15.2c-0.1-0.5,0.2-1.1,0.8-1.2
       c0.5-0.1,1.1,0.2,1.2,0.8l3.7,16.8c0.1,0.3,0,0.7-0.3,0.9s-0.6,0.3-0.9,0.3l-16.8-3.7c-0.2,0-0.4-0.1-0.5-0.3
       C258.8,366.4,258.6,366,258.7,365.7z"/>
     </g>
    </g>
   </g>
  </g>
  <g>
   <g>
    <g>
     <line class="st0" x1="237.8" y1="151.9" x2="197.9" y2="191.9"/>
     <g>
      <path class="st1" d="M200.8,175.1c0.5,0.1,0.9,0.7,0.8,1.2l-3.4,15.2l15.2-3.4c0.5-0.1,1.1,0.2,1.2,0.8
       c0.1,0.5-0.2,1.1-0.8,1.2l-16.8,3.7c-0.3,0.1-0.7,0-0.9-0.3c-0.2-0.2-0.3-0.6-0.3-0.9l3.7-16.8c0-0.2,0.1-0.4,0.3-0.5
       C200.1,175.1,200.5,175,200.8,175.1z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="236.5" y1="153.3" x2="276.4" y2="113.4"/>
     <g>
      <path class="st1" d="M273.5,130.1c-0.5-0.1-0.9-0.7-0.8-1.2l3.4-15.2l-15.2,3.4c-0.5,0.1-1.1-0.2-1.2-0.8
       c-0.1-0.5,0.2-1.1,0.8-1.2l16.8-3.7c0.3-0.1,0.7,0,0.9,0.3c0.2,0.2,0.3,0.6,0.3,0.9l-3.7,16.8c0,0.2-0.1,0.4-0.3,0.5
       C274.2,130.1,273.8,130.2,273.5,130.1z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="236.9" y1="154" x2="197" y2="114.1"/>
     <g>
      <path class="st1" d="M213.7,117c-0.1,0.5-0.7,0.9-1.2,0.8l-15.2-3.4l3.4,15.2c0.1,0.5-0.2,1.1-0.8,1.2
       c-0.5,0.1-1.1-0.2-1.2-0.8l-3.7-16.8c-0.1-0.3,0-0.7,0.3-0.9c0.2-0.2,0.6-0.3,0.9-0.3l16.8,3.7c0.2,0,0.4,0.1,0.5,0.3
       C213.7,116.3,213.8,116.7,213.7,117z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="235.5" y1="152.7" x2="275.5" y2="192.6"/>
     <g>
      <path class="st1" d="M258.7,189.7c0.1-0.5,0.7-0.9,1.2-0.8l15.2,3.4l-3.4-15.2c-0.1-0.5,0.2-1.1,0.8-1.2
       c0.5-0.1,1.1,0.2,1.2,0.8l3.7,16.8c0.1,0.3,0,0.7-0.3,0.9s-0.6,0.3-0.9,0.3l-16.8-3.7c-0.2,0-0.4-0.1-0.5-0.3
       C258.8,190.4,258.6,190,258.7,189.7z"/>
     </g>
    </g>
   </g>
  </g>
  <circle class="st2" cx="117.1" cy="681" r="7.9"/>
  <circle class="st2" cx="117.1" cy="505.1" r="7.9"/>
  <circle class="st2" cx="117.1" cy="329" r="7.9"/>
  <circle class="st2" cx="117.1" cy="153" r="7.9"/>
  <circle class="st2" cx="236.7" cy="768.9" r="7.9"/>
  <circle class="st2" cx="236.7" cy="592.7" r="7.9"/>
  <circle class="st2" cx="236.7" cy="416.3" r="7.9"/>
  <circle class="st2" cx="236.7" cy="65" r="7.9"/>
  <circle class="st2" cx="236.7" cy="246.4" r="7.9"/>
  <g>
   <g>
    <g>
     <line class="st0" x1="476.9" y1="680" x2="437" y2="719.9"/>
     <g>
      <path class="st1" d="M439.9,703.2c0.5,0.1,0.9,0.7,0.8,1.2l-3.4,15.2l15.2-3.4c0.5-0.1,1.1,0.2,1.2,0.8
       c0.1,0.5-0.2,1.1-0.8,1.2l-16.8,3.7c-0.3,0.1-0.7,0-0.9-0.3s-0.3-0.6-0.3-0.9l3.7-16.8c0-0.2,0.1-0.4,0.3-0.5
       C439.2,703.2,439.6,703.1,439.9,703.2z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="475.6" y1="681.3" x2="515.5" y2="641.4"/>
     <g>
      <path class="st1" d="M512.6,658.2c-0.5-0.1-0.9-0.7-0.8-1.2l3.4-15.2l-15.2,3.4c-0.5,0.1-1.1-0.2-1.2-0.8
       c-0.1-0.5,0.2-1.1,0.8-1.2l16.8-3.7c0.3-0.1,0.7,0,0.9,0.3s0.3,0.6,0.3,0.9l-3.7,16.8c0,0.2-0.1,0.4-0.3,0.5
       C513.3,658.1,512.9,658.2,512.6,658.2z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="476" y1="682.1" x2="436.1" y2="642.2"/>
     <g>
      <path class="st1" d="M452.8,645.1c-0.1,0.5-0.7,0.9-1.2,0.8l-15.2-3.4l3.4,15.2c0.1,0.5-0.2,1.1-0.8,1.2s-1.1-0.2-1.2-0.8
       l-3.7-16.8c-0.1-0.3,0-0.7,0.3-0.9c0.2-0.2,0.6-0.3,0.9-0.3l16.8,3.7c0.2,0,0.4,0.1,0.5,0.3
       C452.8,644.4,452.9,644.7,452.8,645.1z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="474.6" y1="680.7" x2="514.6" y2="720.7"/>
     <g>
      <path class="st1" d="M497.8,717.7c0.1-0.5,0.7-0.9,1.2-0.8l15.2,3.4l-3.4-15.2c-0.1-0.5,0.2-1.1,0.8-1.2
       c0.5-0.1,1.1,0.2,1.2,0.8l3.7,16.8c0.1,0.3,0,0.7-0.3,0.9c-0.2,0.2-0.6,0.3-0.9,0.3l-16.8-3.7c-0.2,0-0.4-0.1-0.5-0.3
       C497.8,718.4,497.7,718.1,497.8,717.7z"/>
     </g>
    </g>
   </g>
  </g>
  <g>
   <g>
    <g>
     <line class="st0" x1="357.4" y1="591.7" x2="317.4" y2="631.6"/>
     <g>
      <path class="st1" d="M320.4,614.9c0.5,0.1,0.9,0.7,0.8,1.2l-3.4,15.2l15.2-3.4c0.5-0.1,1.1,0.2,1.2,0.8
       c0.1,0.5-0.2,1.1-0.8,1.2l-16.8,3.7c-0.3,0.1-0.7,0-0.9-0.3s-0.3-0.6-0.3-0.9l3.7-16.8c0-0.2,0.1-0.4,0.3-0.5
       C319.7,614.9,320,614.8,320.4,614.9z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="356" y1="593" x2="395.9" y2="553.1"/>
     <g>
      <path class="st1" d="M393,569.9c-0.5-0.1-0.9-0.7-0.8-1.2l3.4-15.2l-15.2,3.4c-0.5,0.1-1.1-0.2-1.2-0.8
       c-0.1-0.5,0.2-1.1,0.8-1.2l16.8-3.7c0.3-0.1,0.7,0,0.9,0.3c0.2,0.2,0.3,0.6,0.3,0.9l-3.7,16.8c0,0.2-0.1,0.4-0.3,0.5
       C393.7,569.8,393.4,569.9,393,569.9z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="356.4" y1="593.8" x2="316.5" y2="553.8"/>
     <g>
      <path class="st1" d="M333.3,556.8c-0.1,0.5-0.7,0.9-1.2,0.8l-15.2-3.4l3.4,15.2c0.1,0.5-0.2,1.1-0.8,1.2
       c-0.5,0.1-1.1-0.2-1.2-0.8l-3.7-16.8c-0.1-0.3,0-0.7,0.3-0.9s0.6-0.3,0.9-0.3l16.8,3.7c0.2,0,0.4,0.1,0.5,0.3
       C333.2,556.1,333.3,556.4,333.3,556.8z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="355.1" y1="592.4" x2="395" y2="632.3"/>
     <g>
      <path class="st1" d="M378.3,629.4c0.1-0.5,0.7-0.9,1.2-0.8l15.2,3.4l-3.4-15.2c-0.1-0.5,0.2-1.1,0.8-1.2
       c0.5-0.1,1.1,0.2,1.2,0.8l3.7,16.8c0.1,0.3,0,0.7-0.3,0.9s-0.6,0.3-0.9,0.3l-16.8-3.7c-0.2,0-0.4-0.1-0.5-0.3
       C378.3,630.1,378.2,629.8,378.3,629.4z"/>
     </g>
    </g>
   </g>
  </g>
  <g>
   <g>
    <g>
     <line class="st0" x1="357.4" y1="415.3" x2="317.4" y2="455.2"/>
     <g>
      <path class="st1" d="M320.4,438.4c0.5,0.1,0.9,0.7,0.8,1.2l-3.4,15.2l15.2-3.4c0.5-0.1,1.1,0.2,1.2,0.8
       c0.1,0.5-0.2,1.1-0.8,1.2l-16.8,3.7c-0.3,0.1-0.7,0-0.9-0.3s-0.3-0.6-0.3-0.9l3.7-16.8c0-0.2,0.1-0.4,0.3-0.5
       C319.7,438.5,320,438.4,320.4,438.4z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="356" y1="416.6" x2="395.9" y2="376.7"/>
     <g>
      <path class="st1" d="M393,393.4c-0.5-0.1-0.9-0.7-0.8-1.2l3.4-15.2l-15.2,3.4c-0.5,0.1-1.1-0.2-1.2-0.8
       c-0.1-0.5,0.2-1.1,0.8-1.2l16.8-3.7c0.3-0.1,0.7,0,0.9,0.3s0.3,0.6,0.3,0.9l-3.7,16.8c0,0.2-0.1,0.4-0.3,0.5
       C393.7,393.4,393.4,393.5,393,393.4z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="356.4" y1="417.4" x2="316.5" y2="377.4"/>
     <g>
      <path class="st1" d="M333.3,380.4c-0.1,0.5-0.7,0.9-1.2,0.8l-15.2-3.4l3.4,15.2c0.1,0.5-0.2,1.1-0.8,1.2
       c-0.5,0.1-1.1-0.2-1.2-0.8l-3.7-16.8c-0.1-0.3,0-0.7,0.3-0.9s0.6-0.3,0.9-0.3l16.8,3.7c0.2,0,0.4,0.1,0.5,0.3
       C333.2,379.7,333.3,380,333.3,380.4z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="355.1" y1="416" x2="395" y2="455.9"/>
     <g>
      <path class="st1" d="M378.3,453c0.1-0.5,0.7-0.9,1.2-0.8l15.2,3.4l-3.4-15.2c-0.1-0.5,0.2-1.1,0.8-1.2s1.1,0.2,1.2,0.8
       l3.7,16.8c0.1,0.3,0,0.7-0.3,0.9s-0.6,0.3-0.9,0.3l-16.8-3.7c-0.2,0-0.4-0.1-0.5-0.3C378.3,453.7,378.2,453.4,378.3,453z"/>
     </g>
    </g>
   </g>
  </g>
  <g>
   <g>
    <g>
     <line class="st0" x1="357.4" y1="245.4" x2="317.4" y2="285.3"/>
     <g>
      <path class="st1" d="M320.4,268.5c0.5,0.1,0.9,0.7,0.8,1.2l-3.4,15.2l15.2-3.4c0.5-0.1,1.1,0.2,1.2,0.8
       c0.1,0.5-0.2,1.1-0.8,1.2l-16.8,3.7c-0.3,0.1-0.7,0-0.9-0.3s-0.3-0.6-0.3-0.9l3.7-16.8c0-0.2,0.1-0.4,0.3-0.5
       C319.7,268.6,320,268.5,320.4,268.5z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="356" y1="246.7" x2="395.9" y2="206.8"/>
     <g>
      <path class="st1" d="M393,223.5c-0.5-0.1-0.9-0.7-0.8-1.2l3.4-15.2l-15.2,3.4c-0.5,0.1-1.1-0.2-1.2-0.8
       c-0.1-0.5,0.2-1.1,0.8-1.2l16.8-3.7c0.3-0.1,0.7,0,0.9,0.3c0.2,0.2,0.3,0.6,0.3,0.9l-3.7,16.8c0,0.2-0.1,0.4-0.3,0.5
       C393.7,223.5,393.4,223.6,393,223.5z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="356.4" y1="247.5" x2="316.5" y2="207.5"/>
     <g>
      <path class="st1" d="M333.3,210.5c-0.1,0.5-0.7,0.9-1.2,0.8l-15.2-3.4l3.4,15.2c0.1,0.5-0.2,1.1-0.8,1.2
       c-0.5,0.1-1.1-0.2-1.2-0.8l-3.7-16.8c-0.1-0.3,0-0.7,0.3-0.9s0.6-0.3,0.9-0.3l16.8,3.7c0.2,0,0.4,0.1,0.5,0.3
       C333.2,209.8,333.3,210.1,333.3,210.5z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="355.1" y1="246.1" x2="395" y2="286"/>
     <g>
      <path class="st1" d="M378.3,283.1c0.1-0.5,0.7-0.9,1.2-0.8l15.2,3.4l-3.4-15.2c-0.1-0.5,0.2-1.1,0.8-1.2s1.1,0.2,1.2,0.8
       l3.7,16.8c0.1,0.3,0,0.7-0.3,0.9s-0.6,0.3-0.9,0.3l-16.8-3.7c-0.2,0-0.4-0.1-0.5-0.3C378.3,283.8,378.2,283.4,378.3,283.1z"/>
     </g>
    </g>
   </g>
  </g>
  <g>
   <g>
    <g>
     <line class="st0" x1="476.9" y1="504.1" x2="437" y2="544"/>
     <g>
      <path class="st1" d="M439.9,527.3c0.5,0.1,0.9,0.7,0.8,1.2l-3.4,15.2l15.2-3.4c0.5-0.1,1.1,0.2,1.2,0.8
       c0.1,0.5-0.2,1.1-0.8,1.2l-16.8,3.7c-0.3,0.1-0.7,0-0.9-0.3s-0.3-0.6-0.3-0.9l3.7-16.8c0-0.2,0.1-0.4,0.3-0.5
       C439.2,527.3,439.6,527.2,439.9,527.3z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="475.6" y1="505.4" x2="515.5" y2="465.5"/>
     <g>
      <path class="st1" d="M512.6,482.3c-0.5-0.1-0.9-0.7-0.8-1.2l3.4-15.2l-15.2,3.4c-0.5,0.1-1.1-0.2-1.2-0.8
       c-0.1-0.5,0.2-1.1,0.8-1.2l16.8-3.7c0.3-0.1,0.7,0,0.9,0.3s0.3,0.6,0.3,0.9l-3.7,16.8c0,0.2-0.1,0.4-0.3,0.5
       C513.3,482.2,512.9,482.3,512.6,482.3z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="476" y1="506.2" x2="436.1" y2="466.2"/>
     <g>
      <path class="st1" d="M452.8,469.2c-0.1,0.5-0.7,0.9-1.2,0.8l-15.2-3.4l3.4,15.2c0.1,0.5-0.2,1.1-0.8,1.2
       c-0.5,0.1-1.1-0.2-1.2-0.8l-3.7-16.8c-0.1-0.3,0-0.7,0.3-0.9s0.6-0.3,0.9-0.3L452,468c0.2,0,0.4,0.1,0.5,0.3
       C452.8,468.5,452.9,468.8,452.8,469.2z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="474.6" y1="504.8" x2="514.6" y2="544.7"/>
     <g>
      <path class="st1" d="M497.8,541.8c0.1-0.5,0.7-0.9,1.2-0.8l15.2,3.4l-3.4-15.2c-0.1-0.5,0.2-1.1,0.8-1.2
       c0.5-0.1,1.1,0.2,1.2,0.8l3.7,16.8c0.1,0.3,0,0.7-0.3,0.9s-0.6,0.3-0.9,0.3l-16.8-3.7c-0.2,0-0.4-0.1-0.5-0.3
       C497.8,542.5,497.7,542.2,497.8,541.8z"/>
     </g>
    </g>
   </g>
  </g>
  <g>
   <g>
    <g>
     <line class="st0" x1="476.9" y1="328" x2="437" y2="367.9"/>
     <g>
      <path class="st1" d="M439.9,351.1c0.5,0.1,0.9,0.7,0.8,1.2l-3.4,15.2l15.2-3.4c0.5-0.1,1.1,0.2,1.2,0.8s-0.2,1.1-0.8,1.2
       l-16.8,3.7c-0.3,0.1-0.7,0-0.9-0.3s-0.3-0.6-0.3-0.9l3.7-16.8c0-0.2,0.1-0.4,0.3-0.5C439.2,351.2,439.6,351.1,439.9,351.1z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="475.6" y1="329.3" x2="515.5" y2="289.4"/>
     <g>
      <path class="st1" d="M512.6,306.1c-0.5-0.1-0.9-0.7-0.8-1.2l3.4-15.2l-15.2,3.4c-0.5,0.1-1.1-0.2-1.2-0.8
       c-0.1-0.5,0.2-1.1,0.8-1.2l16.8-3.7c0.3-0.1,0.7,0,0.9,0.3s0.3,0.6,0.3,0.9l-3.7,16.8c0,0.2-0.1,0.4-0.3,0.5
       C513.3,306.1,512.9,306.2,512.6,306.1z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="476" y1="330" x2="436.1" y2="290.1"/>
     <g>
      <path class="st1" d="M452.8,293c-0.1,0.5-0.7,0.9-1.2,0.8l-15.2-3.4l3.4,15.2c0.1,0.5-0.2,1.1-0.8,1.2
       c-0.5,0.1-1.1-0.2-1.2-0.8l-3.7-16.8c-0.1-0.3,0-0.7,0.3-0.9s0.6-0.3,0.9-0.3l16.8,3.7c0.2,0,0.4,0.1,0.5,0.3
       C452.8,292.3,452.9,292.7,452.8,293z"/>
     </g>
    </g>
   </g>
   <g>
    <g>
     <line class="st0" x1="474.6" y1="328.7" x2="514.6" y2="368.6"/>
     <g>
      <path class="st1" d="M497.8,365.7c0.1-0.5,0.7-0.9,1.2-0.8l15.2,3.4l-3.4-15.2c-0.1-0.5,0.2-1.1,0.8-1.2
       c0.5-0.1,1.1,0.2,1.2,0.8l3.7,16.8c0.1,0.3,0,0.7-0.3,0.9s-0.6,0.3-0.9,0.3l-16.8-3.7c-0.2,0-0.4-0.1-0.5-0.3
       C497.8,366.4,497.7,366,497.8,365.7z"/>
     </g>
    </g>
   </g>
  </g>
<g id="Layer_2">
</g>
</svg>
Answer: Looks to me like a bug in Chrome.  It doesn't seem to happen in Firefox.
It looks like it's perhaps a compositing error. The arrowheads are moving slightly to the left when their opacity becomes 1.
I would recommend you report it to Chrome, and then please post the bug number here for the benefit of other readers.


change prototype script to jquery one

Question: I have this form submit code:
Event.observe(window, 'load', init, false);
function init() {
  Event.observe('addressForm', 'submit', storeAddress);
}
function storeAddress(e) {
  $('response').innerHTML = 'Adding email address...';
  var pars = 'address=' + escape($F('address'));
  var myAjax = new Ajax.Updater('response', 'ajaxServer.php', {method: 'get', parameters: pars});
  Event.stop(e);
}

How can I change it to work with jQuery?
Here is the html form:

<form id="addressForm" action="index.php" method="get">
  Email: <input type="text"  name="address" id="address" size="25">

  <input name="Submit" value="Submit" type="submit" />

<?php echo(storeAddress()); ?>

</form>

and this is php code at start of document:
<?php
require_once("inc/storeAddress.php");
?>

Answer: Something like this:
$(function() {
    $('#addressForm').submit(function() {
        $('#response')
            .html('Adding email address...')
            .load('ajaxServer.php', { address: $('#address').val() }, function() {
                $('#address').val('');
            });
        return false;
    });
});

Note: when using .load(), the POST method is used if data is provided as an object; otherwise, GET is assumed. So, if you want to pass the data as GET, use:
.load('ajaxServer.php', 'address='+$('#address').val());

Or just get the submitted data from $_POST['address'] which would be wiser and easier in my opinion.
Comment: hi this is not submitting data
Comment: can you do one more help, how can i clear the email field once the request is submitted.
thanks
Comment: @steve - Change the `.load(...` line to this: `.load('ajaxServer.php', { address: $('#address').val() }, function() { $('#address').val(''); });`
Comment: @steve, just as Nick Craver said. I added it in my example for clarity.
Comment: thanks, one last question...when i move my ajaxServer.php to a child directory (/email) and i change path  .load('ajaxServer.php..... to .load('email/ajaxServer.php...i get error... do i need to change more?
Comment: just to clearify..... if i remove the script from page, the data will submit but with page refresh ofcourse...i.e i have set all other paths correct once i move into child directory, i think i need some change in this java script only. thanks
Comment: oh sorry my mistake...working all fine now

great support

thanks a lot
Tatu Ulmanen,  Nick Craver and John Himmelman for your precious time
Answer: You can convert the script like this:
$(function() {
  $('#addressForm').submit(function(e) {
    $('#response').html('Adding email address...');
    $.ajax({
        url: 'ajaxServer.php',
        type: 'GET',
        data: {'address': $('#address').val() },
        success: function(response) {
          $('#response').html(response);
        }
    });
    e.preventDefault();
    return false;
  });
});

Here's a rundown of the equivalents:

.html() for the innerHTML call
$('#id') selector for finding by an ID
$.ajax for the ajax call

data is the passed parameters, set the pair up (address=...)
success callback runs when the request completes

put the response into the id="response" div here
Comment: although data is submitted but page is reloading aswell
Comment: @steve - Updated, this should prevent the default submit from happening now.
Comment: You would be better off observing the submit event on the form rather then the click event on the submit button. Looks like that's what the prototype code was doing too.
Comment: @ Nick Craver thanks for you time looking into this, actually i am trying to submit form with out page refresh...the updated version isnt doing that still..
is there i am missing? somr thing you need to know from my side? do let me know
Comment: @petersendidit can you kindly let me know what to chnage...i am a mess with codes :( and i need this one working soon,,,thanks
Comment: @steve, @petersendidit - Updated one more time, I'm basing this off you using jQuery 1.4 and the submit handler normalized (even in IE).  Try the updated answer again, if there are still problems, it's most likely a javascript error being thrown, and a link to a page I can see would be helpful.
Comment: still problem :( i actually dont have a page set for web preview, i am testing this on my local server, i will however provide you one link in few hours

thanks for your time
i am grateful
Comment: @steve - Something I take for granted most times, were you wrapping this in a `$(function() { });` like I added above?  If not please do.
Comment: i am actually copying your whole code
.pasting it in a java file that i call in page.
Comment: @steve - Then do that once more, should work, sorry I forgot the obvious.
Comment: hi, sorry but still no luck, data submits but still with page refresh.
Answer: Give this a whirl..
function init()
{
    $('#addressForm').submit(storeAddress);
}

function storeAddress(e)
{
    $('#response').html('Adding address...');

    var params = 'address=' + $('#address').val();

    $('#response').load('ajaxServer.php', params);

    $.ajax({
        url : 'index.php',
        data : $('#addressForm').serialize(),
        success : function(data)
        {
            alert('yay, form data sent!');
        }
    });

    // Fix - stops page reload
    return false;
}

$(document).ready(init);

Comment: i was trying that page wont reload, although data is submitted but page is reloading aswell
Comment: Try now, it sends the form data ajaxically and stops the form from submitting (by returning false).
Comment: oh yes it works
sweet
how will i remove the alert window that pops up. i dont need that, also is this submitting data twice, emails are appearing in pairs with single submit.
thanks
Comment: Tatu: The first request fetches the status, the second submits the form data (form action is index.php).

change prototype script to jquery one


How can I use loop to bring two lists together?

Question: I am learning python now and need a solution for this problem!
city_indices = list(range (0,len (cities)))

city_indices
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
city_names = ['Buenos Aires','Toronto','Pyeongchang','Marakesh', 'Albuquerque', 'Los Cabos', 'Greenville', 'Archipelago Sea', 'Walla Walla Valley', 'Salina Island', 'Solta', 'Iguazu Falls']
Your task is to assign the variable names_and_ranks to a list, with each element equal to the city name and it's corresponding rank. For example, the first element would be, "1. Buenos Aires" and the second would be "2. Toronto". Use a for loop and the lists city_indices and city_names to accomplish this.
names_and_ranks = ['change this to different elements'] # make sure the list is empty

names_and_ranks[0] # '1. Buenos Aires'

names_and_ranks[1] # '2. Toronto'

names_and_ranks[-1] # '12. Iguazu Falls'

Thanks for help. I found the solution
names_and_ranks = []
for index in city_indices:
    names_and_ranks.append(f"{index + 1}. {city_names[index]}")

Comment: Does this answer your question? [What is the best way to iterate over multiple lists at once?](https://stackoverflow.com/questions/10080379/what-is-the-best-way-to-iterate-over-multiple-lists-at-once)
Comment: seems like a homework problem of sorts, so i'll give you some hints. `city_indicies[0] = 0`, so `city_indicies[0] + 1 = 1`. Use a for loop and since the length of both lists are the same length, you only need to use one loop. also string concatenation: `myStr = 'a' + 'b' + 'c' = 'abc'`.
Comment: Smells like homework.
Comment: it is not homework , it is an exercise
Answer: Use extend in python to combine lists.
Listing_1 = [1,2,3]
Listing_2 = [4,5,6]
Listing_1.extend(Listing_2)
Listing_1
[1,2,3,4,5,6]

If you really want to use a loop, use like this.
Listing_1 = [1,2,3]
Listing_2 = [4,5,6]
for item in Listing_2:
    Listing_1.append(item)


Is there any reason to help the civilians in need?

Question: While walking around the city, you'll sometimes encounter citizens in need. ISAC will scan them for you and identify which consumable you can give them. So far, this only results in you getting an extremely minor amount of experience points - seemingly less than 1% of a level for me. What is the benefit of helping these guys?
Comment: To feel good knowing you're giving back to the community?
Answer: The main reason to help civilians in need is for the XP and for the items they drop. At least in the beta, the item was typically a cosmetic item but I've heard they can drop weapon skins as well.
Everything I've read about leveling up quickly has said to help the civilians in need for the XP. So I'd say the main reason to help them is for the XP.
I kept track of how much XP Civilians in Need gave me today, and this is what I found:

At level 6, 209 XP
At level 7, 213 XP
At level 8, 219 XP

(Note that I have already unlocked the +10% XP perk, so these numbers include that bonus.)
This means as you increase in level, so does the amount of XP they give. Of course, at lower levels this will still be a higher percentage of the amount of XP you need to get to the next level, but they definitely aren't worthless (IMO) as you progress through the game.
Comment: I have not played the game yet (at work/game is shipping and avoided the beta) but I would assume this is more effective at lower levels and is less and less effective the further you get, which could be what OP is experiencing. Unless the XP they give scales evenly with your level?
Comment: @DangerZone I updated my answer to show that the amount of XP you get from Civilians in Need does increase as you level up.
Comment: @DangerZone Yep, I agree. I'm also nearly always full on consumables, so no reason to not stop and get some XP for my efforts.
Comment: @DangerZone I haven't come across any civilians in need since the game was released yesterday. I'll try to make a note of how much XP I get for helping them and my level, and see if the amount increases or stays the same.
Comment: I played last night and ran into a couple civilians. In early levels (1-5), I seemed to be getting around 130-ish (at least from what I remember). And I'm always full on supplies anyway so I don't see a reason to not give them stuff. Plus I was getting cosmetic items like half the time. Not too shabby.
Comment: In my experience, I've only ever gotten vanity items from them or in the rare case, a consumable. I don't remember ever getting mods from them.
Comment: Awesome! So they don't scale evenly... Still worth taking advantage of though!
Comment: I'm accepting it since this seems to be the best answer, but by level 10 the experience you get for helping one still seems to be 200 base. That's a pittance. Aside from that this answer is dead on - you can earn cosmetic stuff (finally had it happen for me earlier) and you tend to have a decent number of spare consumables.
Comment: In the Beta I definitely got a weapon skin from one. Still cosmetic, but rare.
Comment: As I progress in levels (almost 20 now), cosmetic stuff seems to be an almost 100% reward from helping civilians in need. Still no weapon skins, but my clothing collection is rapidly expanding. EXP from this is basically pointless past the first few levels.
Comment: On few rare occasions I got weapons and mods, gray tier, so total crap. But 99% it's clothes.


Prove that the determinant of a square matrix can be computed by expansion about the first two columns.

Question: Suppose that $A$ is an $m \times n$ matrix. The $(i, j)$-entry of $A$ is denoted as $[A]_{i,j}$.
Suppose that $A$ is an $m \times n$ matrix. Suppose that $i_1$, $i_2$, $\dots$, $i_s$ are distinct integers less than or equal to $m$, and that $j_1$, $j_2$, $\dots$, $j_t$ are distinct integers less than or equal to $n$. The matrix obtained from $A$ by removing rows $i_1$, $i_2$, $\dots$, $i_s$ and columns $j_1$, $j_2$, $\dots$, $j_t$ is denoted as $A({i_1,\dots,i_s}|{j_1,\dots,j_t})$.
Determinants are defined here.
I will prove, by directly appealing to the definition, that
$$
\begin{aligned}
    \det {(A)}
    = \sum_{1 \leq i < k \leq n}
    {\det {
            \begin{bmatrix}
                [A]_{i,1} & [A]_{i,2} \\
                [A]_{k,1} & [A]_{k,2} \\
            \end{bmatrix}
        }
        (-1)^{i+k+1+2}
        \det {(A(i,k|1,2))}}.
\end{aligned}
$$
for any $n \times n$ matrix $A$ (in which $n > 2$).

Note that the result is simply an easy corollary of the generalized Laplace expansion. It will be useful in a proof of the alternating property of $\det$ and in a proof of the antisymmetric property of $\det$.
Answer: Suppose that $i$, $j$ are two integers. Define
$$
\rho(i, j)
= \begin{cases}
        0, & i < j;    \\
        1, & i \geq j.
    \end{cases}
$$
Note that $[A]_{d_2, 2}$ is the $(d_2 - \rho(d_2, d_1), 1)$-entry of $A(d_1|1)$, in which $d_2 \neq d_1$. Hence
$$
\begin{aligned}
            & \det {(A)}
    \\
    = {} &
    \sum_{d_1 = 1}^{n} {(-1)^{d_1+1} [A]_{d_1,1}
    \det {(A(d_1|1))}}
    \\
    = {} &
    \sum_{d_1 = 1}^{n} {(-1)^{d_1+1} [A]_{d_1,1}
    \sum_{\substack{1 \leq d_2 \leq n     \\d_2 \neq d_1}}
    {(-1)^{d_2 - \rho(d_2,d_1) + 1} [A]_{d_2,2}
        \det {(A(d_1,d_2|1,2))}}}
    \\
    = {} &
    \sum_{d_1 = 1}^{n}
    {\sum_{\substack{1 \leq d_2 \leq n    \\d_2 \neq d_1}}
    {(-1)^{d_1+1} [A]_{d_1,1}
        (-1)^{d_2 - \rho(d_2,d_1) + 1} [A]_{d_2,2}
        \det {(A(d_1,d_2|1,2))}}}
    \\
    = {} &
    \sum_{\substack{1 \leq d_1,d_2 \leq n \\d_1 \neq d_2}}
    {(-1)^{d_1+1} [A]_{d_1,1}
        (-1)^{d_2 - \rho(d_2,d_1) + 1} [A]_{d_2,2}
        \det {(A(d_1,d_2|1,2))}}
    \\
    = {} &
    \sum_{\substack{1 \leq d_1,d_2 \leq n \\d_1 \neq d_2}}
    {(-1)^{\rho(d_1,d_2)}
            [A]_{d_1,1} [A]_{d_2,2}
        (-1)^{d_1+d_2+1+2}
        \det {(A(d_1,d_2|1,2))}}
    \\
    = {} &
    \hphantom{{} + {}}
    \sum_{\substack{1 \leq d_1,d_2 \leq n \\d_1 < d_2}}
    {(-1)^{\rho(d_1,d_2)}
            [A]_{d_1,1} [A]_{d_2,2}
        (-1)^{d_1+d_2+1+2}
        \det {(A(d_1,d_2|1,2))}}
    \\
            &
    +
    \sum_{\substack{1 \leq d_1,d_2 \leq n \\d_1 > d_2}}
    {(-1)^{\rho(d_1,d_2)}
            [A]_{d_1,1} [A]_{d_2,2}
        (-1)^{d_1+d_2+1+2}
        \det {(A(d_1,d_2|1,2))}}
    \\
    = {} &
    \hphantom{{} + {}}
    \sum_{\substack{1 \leq i,k \leq n     \\i < k}}
    {(-1)^{\rho(i,k)}
            [A]_{i,1} [A]_{k,2}
        (-1)^{i+k+1+2}
        \det {(A(i,k|1,2))}}
    \\
            &
    +
    \sum_{\substack{1 \leq k,i \leq n     \\k > i}}
    {(-1)^{\rho(k,i)}
            [A]_{k,1} [A]_{i,2}
        (-1)^{k+i+1+2}
        \det {(A(k,i|1,2))}}
    \\
    = {} &
    \sum_{1 \leq i < k \leq n}
    {([A]_{i,1} [A]_{k,2} - [A]_{k,1} [A]_{i,2})\,
    (-1)^{i+k+1+2}
    \det {(A(i,k|1,2))}}
    \\
    = {} &
    \sum_{1 \leq i < k \leq n}
    {\det {
            \begin{bmatrix}
                [A]_{i,1} & [A]_{i,2} \\
                [A]_{k,1} & [A]_{k,2} \\
            \end{bmatrix}
        }
        (-1)^{i+k+1+2}
        \det {(A(i,k|1,2))}}.
\end{aligned}
$$


How to use foreach php code in registerJS() javascript code in yii2?

Question: I can't use foreach php code in javascript code of registerJS in yii2. Browser shows "PHP Parse Error – yii\base\ErrorException syntax error, unexpected 'foreach' (T_FOREACH)" error. Here is my code:
<canvas id="bar-chart" width="500" height="150"></canvas>

<?php
$lang = Yii::$app->language;
$title = 'title_'.$lang;

$this->registerJs("
                new Chart(document.getElementById('bar-chart'), {
                type: 'bar',
                data: {
                  labels: [
                                " . foreach ($models as $model) { . "
                                    ' " . $model->$title . " ',
                               " . } . "
                           ],
                  datasets: [
                    {
                      label:'Label',
                      backgroundColor: ['#3e95cd', '#8e5ea2','#3cba9f', '#e7fc00'],
                      data: [479,1654,499, 2632]
                    }
                  ]
                },
                options: {
                  legend: { display: false },
                  title: {
                    display: true,
                    text: 'Title'
                  }
                }
            });
    ", yii\web\View::POS_READY);

Comment: What version of php are you using?
Comment: I'm using php 5.5 version
Comment: Did i write right php codes in js code my code?
Answer: I'll pull out foreach code from javascript output.
<?php
$titles = [];
foreach($models as $model)
{
    $titles[] = sprintf("'%s'", $model->title);
}

$titlesText = implode(',', $titles);

$this->registerJs("
                new Chart(document.getElementById('bar-chart'), {
                type: 'bar',
                data: {
                  labels: [
                      ".$titlesText."
                           ],
                  datasets: [
                    {
                      label:'Label',
                      backgroundColor: ['#3e95cd', '#8e5ea2','#3cba9f', '#e7fc00'],
                      data: [479,1654,499, 2632]
                    }
                  ]
                },
                options: {
                  legend: { display: false },
                  title: {
                    display: true,
                    text: 'Title'
                  }
                }
            });
    ", yii\web\View::POS_READY);

Answer: You cannot use the foreach statement there, in the middle of a string. You should generate the string coming from the foreach beforehand and then join it with the js string:
$mystring = "";
foreach ($models as $model) {
  $mystring .= "' " . $model->$title . " ',";
}

$this->registerJs("
                new Chart(document.getElementById('bar-chart'), {
                type: 'bar',
                data: {
                  labels: [ $mystring ],
                  datasets: [
                    {
                      label:'Label',
                      backgroundColor: ['#3e95cd', '#8e5ea2','#3cba9f', '#e7fc00'],
                      data: [479,1654,499, 2632]
                    }
                  ]
                },
                options: {
                  legend: { display: false },
                  title: {
                    display: true,
                    text: 'Title'
                  }
                }
            });
    ", yii\web\View::POS_READY);

Comment: @AlisherNasrullayev dont forget to mark the answer correct if it solved your problem. (y)


I broke my Spore saves

Question: I had to transfer my Spore files from one of my computers to the other so what I did is I sent myself <code>%appdata%/roaming/spore/game0</code> and the game file and I just pasted all the files in not knowing anything. I might have replaced a few files with those so now on both computers all my saves are gone even though all the files are there.
How can I get my saves back? What files have to be in the games folder in order for it to work?
Answer: As per this answer, have you also copied the 'My Spore Creations' folder from your Documents folder? This, in addition to the AppData files, should ensure everything is copied over.

I broke my Spore saves


Connect Playstation Console via VPN to the internet

Question: I have a VPN connection to the internet with my PC and want to connect my Playstation 3 to the internet. I have Ubuntu 12.04 on my PC. How do I do that?
Answer: You don't connect it through your computer. You plug the playstation in to your modem or router.
Comment: The problem is: The only way for me to connect to the internet is via VPN. And as far as I know, I can't use VPN on ps3.


Proxy request to graphql server through AWS appsync

Question: I have a graphql server on one of my EC2 instances running. I also have AWS appsync running, but at the moment it's integrated only with couple of lambdas.
I'd like to connect my Appsync with graphql server, so Appsync will behave as a proxy for specific queries/mutations.
So from client side, it will look like this:

Client sends a query to the appsync, lets say that it looks like that:

{
  user {
    id
  }
}

Appsync has defined a user query, it's configured to proxy the query the graphql server, without any changes
Graphql server is able to handle following query:

{
  user {
    id
  }
}

and returns a result:
"data": {
  "user": {
    "id": "123456789"
  }
}

finally Appsync proxies response back to the client

Am I able to configure Appsync in a way that given scenario is possible? Is it the right pattern to use Appsync for?
Update 1. After @mparis response
I was able to proxy my request through AppSync, and reach my graphql server, with following resolver configuration:
{
    "version": "2018-05-29",
    "method": "POST",
    "resourcePath": "/graphql",
    "params":{
        "body": {
          "query": "$util.escapeJavaScript($ctx.info.getSelectionSetGraphQL())"
        }
    }
}

But this still does not work as expected - it's different from description in docs, and I see at least two issues:

If I have a query with arguments and nested paylod, $ctx.info.getSelectionSetGraphQL() cuts out the query name and arguments part, and gives me only nested payload, so this query:

{
  user(id: "1") {
    picture {
      url
    }
}

becomes following one, once I call $ctx.info.getSelectionSetGraphQL():
{
   picture {
     url
   }
}

But I'd like to use whole query, same as described in docs:
"selectionSetGraphQL": "{\n  getPost(id: $postId) {\n    postId\n    title\n    secondTitle: title\n    content\n    author(id: $authorId) {\n      authorId\n      name\n    }\n    secondAuthor(id: \"789\") {\n      authorId\n    }\n    ... on Post {\n      inlineFrag: comments {\n        id\n      }\n    }\n    ... postFrag\n  }\n}"

Lets say I have a query, and I've defined resolver for user query in appsync, the query looks like this:

{
  user(id: "1") {
    picture {
      url
    }
}

and I call my graphql backend through appsync, in my graphql logs I see following response logged:
{
  "data: {
    "user": {
      "picture": {
        "url": "example.com/link/to/a/picture"
      }
    }
  }
}

but appsync returns me given response instead:
{
  "data: {
    "user": {
      "picture": null
    }
  }
}

I've figured out, that appsync expects from me that I will define resolvers for both user and picture query. Appsync wants to first call user and then picture query, but what I wanna do is simply proxy the response through appsync, without calling any additional queries except user. Everything is evaluated in my graphql backend and should be just put to the response body, but appsync wants to evaluate everything one more time.
Is there any solution for no 1. and 2.?
Comment: Did you solve this proxy issue?
Comment: No, I didn't. Had to drop this approach so I didn't explore it since
Answer: As of writing, you can use the $ctx.info object to get the selection set of queries from within the resolvers and send the relevant data via an HTTP resolver to your downstream service. Go here and look for the info field on the $ctx object. To make this work, you will need to mirror the schema of your downstream API within your AppSync API.
Thanks for bringing this up. The team is aware of these use cases and this helps prioritization.
Comment: Thanks for your response! I've tried to implement your solution, but another questions/issues came in between. Would you be able to take a look at my updates in the main topic, please?
Answer: You can use the following resolver function:
I used the openly available StarWarsAPI as data source: https://swapi-graphql.netlify.app
{
  "version": "2018-05-29",
  "method": "POST",
  "resourcePath": "/.netlify/functions/index",
  "params": {
    "headers": {
      "Content-Type": "application/json"
    },
    "body": {
      "query": "query { starship (id: \"$ctx.args.id\") $util.escapeJavaScript($ctx.info.getSelectionSetGraphQL()) }"
    }
  }
}

And then you have to get the data from the graphql response using this reponse mapping:
$util.toJson($util.parseJson($ctx.result.body).data.starship)

(You have to duplicate the schema in appsync)


Database Design: Difference between using boolean fields and duplicate tables

Question: I have to design a database schema for an application I'm building. I will be using MySQL. In this application, users enter data and it gets saved in the database obviously. However, this data is not accessible to the public until the user publishes the data. Currently, I have one column for storing all the data. I was wondering if a boolean field in this table that indicates whether the data has been published is a good idea. Or, is it much better design to create one table for saved data and one table for published data and move the saved data to the published data table when the user presses Publish.
What are the advantages and disadvantages of using each one and is one of them considered better design than the other?
Comment: @YangK: I wouldn't worry about that. First have a robust and clean model to start with. Then for performance you should first an foremost use appropriate indexes. If that doen't help you can think about table partitioning preferably with the means the DBMS provides. If that doesn't help too, you can think about rolling your own -- with great care. But I suppose it's a long way till there.
Comment: If you want versioning in there do it by saving a version number to each row, not by copying/moving records around from/to different tables. That way you're far more flexible (no need to create a new table for each currently highest version).
Comment: Sounds like published or not is just another attribute of the entity your users enter. So it should go in one table with a column for that attribute. If you want to conveniently query only published things you could define a view that selects only the published rows from the table.
Comment: @stickybit thanks for your reply. do you think there might be significant query performance boosts with either of the methods? Is one faster than the other when you're trying to search only for data that has been published?
Comment: With scalability in mind, I think the second approach of having two tables may be costly (space-wise). So I'm in favour with your first approach. *Although*, come to think of it, if you want to save previous published data (in case your user wants to revert), it might be better to do so with your second approach.
Comment: @stickybit https://stackoverflow.com/questions/323065/how-to-version-control-a-record-in-a-database says otherwise. I've heard that most people create a new table for history/versioning. are you saying I shouldn't do that
Comment: Hmm, I see a subtle difference in the purpose I had in mind and the purpose the other thread seems to deal with. I was thinking you wanted to provide version control to the users. Like the revisions here for instance, when you edit a post which is a post no matter the version.  The other thread, as I get it, is addressing more the audit point of view, like in "have a log" for administrative purposes. That log may have a different structure than the original table(s) it is logging, what may require another table.
Answer: Case: Binary
They are about equal.  Use this as a learning exercise -- Implement it one way; watch it for a while, then switch to the other way.

(same) Space:  Since a row exists exactly once, neither option is 'better'.
(favor 1 table) When "publishing" it takes a transaction to atomically delete from one table and insert into the other.
(favor 2 tables) Certain SELECTs will spend time filtering out records with the other value for published.  (This applies to deleted, embargoed, approved, and a host of other possible boolean flags.)

Case: Revision history
If there are many revisions of a record, then two tables, Current data and History, is better.  That is because the 'important' queries involve fetching the only Current data.
(PARTITIONs are unlikely to help in either case.)
Comment: Is the solution you provided for `Case: Revision history` still the best approach if you're providing users with version control for their data rather than audit logging. I am not doing this for audit trails. I am doing this for user experience. Is your approach still the best approach when this is the case?
Comment: @YangK - Please explain the implementation difference between Revision history and Audit trails.
Comment: Thanks for the quick reply, mate! For revision history, the history of the data is part of the business logic. For example, users can go in and restore previous versions of the data and look at the difference between the two versions of the data. For audit trails, the history of the data is only kept for admin purposes to see which records changed at which time, etc. It is not part of the logic, its more of a change log for the data scenario. In my use case, the history of the data will be part of the business logic and isn't simply for admin purposes like it is in an audit trail. Makes sense?
Comment: @YangK - What threw me was that your Question sounded like there would be only one old copy of any particular record.  Hence, my analogy to a `deleted` flag.  Summary:  If `Current` is "small" compared to `History`, use 2 tables; else us a flag in one table.  If necessary, a `parent_id` column could chain rows together within a single table.


How do I wire my new smart switch for bathroom light & fan control?

Question: I've never installed a light switch before and I've done a ton of research but this part stumps me.
I have a two-gang switch in my bathroom. The left switch turns on the light and fan. The right switch turns on the heater.
I bought the TOPGREENER Humidity Switch, Motion Sensor Switch.
My switch that controls the light and fan only has a yellow and black wire. Please see the attached pictures.
How do I wire up the new switch with the wires I've got in the wall?
Comment: Please remove (but don't disconnect wires) the switched fan and light from the ceiling and take pictures showing all the wires and how they are connected.
Comment: Are both the photos showing the switchbox?  Can you post a photo of the wiring in the fan/heater?  This looks like the wires are run in metal conduit, correct?
Comment: Yes, can you post photos of the wiring at the fan/heater please?
Comment: Note: The pair of reds nutted together and the pair of whites nutted together are a separate circuit that just happens to be passing through this box. Using your Non-Contact Voltage Tester (NCVT) flip breakers off until you find one that disables power in these lines, too. You don't want to zap yourself should one of those nuts accidentally come off (plus, it's not a bad idea to label the back side of the cover plate indicating which breaker controls which circuit should you ever open this box again).
Answer: You have lots of wonderful colors of wires, which means you have conduit. (Or should - if these are loose wires in the wall then you've got big problems.) That's the good news, because it means you can add wires as needed to solve problems. There are no ground wires, so that would indicate metal boxes and conduits. On the other hand, very little metal is exposed - it looks like the box has been sprayed with concrete...not good.
The bad news is that we have no idea what each wire currently means.
Assuming things were done properly, the white wires are neutral. That would seem to indicate:

Black/blue = switch loop to heater

Black/Red/White and Yellow/Red/White:

one of these is incoming power and the other is light/fan. But that is a bit unusual. Typical is two wires for incoming power/neutral and three wires for outgoing switched power (one light, one fan) and neutral. Clearly that is not the case here. Except for the white wires (both neutral) we need to figure out what each wire does in order to continue. Some possibilities include:

Incoming hot - logically that would be black and really should be either yellow or black since they are connected to the switch, but could be any color here except white. Easiest way to find out is to turn off the power, disconnect (but tag so we know what goes where) all the non-white wires in the two sets (black, red x2, yellow) and turn on the power and see which wire is hot with a non-contact voltage tester (NCVT) and verify with a multimeter. Could even be multiple colors (but shouldn't be).
Switched hot - must be either black or yellow. Whichever one is not always hot.
Passing through additional switched hot - e.g., if yellow goes up to light and then comes back as red and on to a separate fan, or something like that. Not likely, but technically possible.
Passing through addition always hot - again, not likely (because not needed just split the hot where needed) but possible.
Something else???

The diagram with the new switch is based on the most common "good" situation (there are some older configurations where it just won't work without new wires). In this particular case, the most that should be needed is running one additional wire through conduit, but even that might not be needed. We just don't know yet.
Comment: indeed, it looks like the mud in the back of the box is as thick as the mud on the wall.


How to obtain more Crystocrene armour pieces?

Question: I have picked up a number of quests from Variks on Europa and they require me to be wearing four pieces of the Crystocrene armour set.
I currently have two pieces, so need to find some more but they seem to just be random world drops. I have already collected all the Variks campaign pieces but dismantled them as I did not know I needed them for a later quest.
Are there any reliable farms for these armour pieces?
Answer: High value targets drop either the Crystocrene armor or the weapons from Europa. You can double dip on the chest by sparrowing outside of the area until you switch zones, then going back and opening the chest before it despawns.
Also, as Wondercricket said, the first daily Heroic public event in the Eclipsed Zone, while having the sabotage upgrade is guaranteed to drop armor.
You can also farm Empire Hunts. The harder they are, higher the chance for the armor to drop. Good luck.
Comment: [Sabotage is the seasonal upgrades from Variks on Europa](https://www.pcinvasion.com/destiny-2-variks-sabotage-quests-herealways-pieces/). Heroic public events are regular public events which are changed to heroic by triggering specific mechanics during the event. The first heroic one completed after daily reset (5pm UTC).
Comment: What is sabotaged upgrade ? Or do you mean the quests finished, ? What do you mean by the first daily heroic ? Like the first one that Spons for each person individually, or the first after 12a, ?


Force rebase/merge master to feature branch before pull request

Question: We would like to enforce a policy in our git repositories so that master must be merged/rebased (let's ignore merge vs rebase for now) to feature branches before creating pull requests.
The reason we'd like to have this policy is to force developers to consider functionality added in other feature branches and to reduce merge conflicts later.
Is this something typically done in a development team and what tools (git-hook?, functionality in a specific CI tool?) do you use for that purpose?
Answer: First, you don't merge/rebase master.
You merge/rebase the local development/feature branch on top of master, in order to replay local commits on top of an updated (git fetch) origin/master, to make sure the pushed feature introduces only new commits on top of the most recent state of master.
You can facilitate that locally with the config pull.rebase and rebase.autostash (see "Can "git pull" automatically stash and pop pending changes?")
That is best done when only one developer is working on a given feature (because it can involve a push --force of that rebased branch if pushed often)
On the server side, hooks (like this one) are only possible if you have control of said server (not the case for instance for online servers like github.com)


how to cast object of type '[System.Data.DataView]' to type 'System.Data.DataView'.?

Question: i am using dataview and with it's skip and take methods, that will take 5 rows and skip some rows according to the page number and page size.
//creating a dataview object and assigning table[0]
dv = new DataView(ds.Tables[0]);

and next line in which i am facing error is:
dv=(DataView)dv.Cast<System.Data.DataView>().Skip((pageNum-1)*pageSize).Take(5);

At above line error occur is:
Unable to cast object of type '<TakeIterator>d__3a`1[System.Data.DataView]' to type 'System.Data.DataView'.

needs help. thanx.
Comment: `DataView` is not `IEnumerable` of `DataView`, probably `DataRow` or `DataTable`
Comment: are u dealing with anonymus objects  ?
Comment: What exactly are you trying to do ??
Comment: sorry i am not getting you..can you explain a bit.
Comment: i am binding the gridview with dataview.
Answer: It works a little bit different, you can do the following:
        var dt = ds.Tables[0];
        dt = dt.AsEnumerable().Skip((pageNum - 1) * pageSize).Take(5).CopyToDataTable();

        var dv = new DataView(dt);
        GridView1.DataSource = dv;
        GridView1.DataBind();

Not forget the "using System.Data;" and if you have time look for LINQ...


Carousel is merging with the hero image and navigation bar

Question: I am making a small website for fun... I have created the Hero Image and Navbar with help from https://www.w3schools.com and also tried adding a Carousel but it seems that it is merging in between of Navbar and Hero Image...
Ref:
Without Carousel
With Carousel: Merged!
What I want to achieve is This But it should be below it, not merged in...
I have tried a lot of ways and searched the whole StackOverFlow site, but it seems I have a stupid brain which could not understand this silly problem.
Here is some source code in case you need it:
CSS
.hero-image{
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("heroimage.jpg");
    height: 50%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
}
.button {
    background-color: #4CAF50; /* Green */
    border: none;
    color: white;
    padding: 16px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    transition-duration: 0.4s;
    cursor: pointer;
}
.hero-text{
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-family: 'Ubuntu', sans-serif;
}
nav {
    background-color: black;
    height: 50px;
}
nav a {
    float: right;
    color: white;
    background-color: 1a1a1a;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
    font-size: 16px;
    font-family: 'Open Sans', sans-serif;
}
nav a:hover {
    background-color: #3b86ff;
}
* {box-sizing:border-box}

/* Slideshow container */
.slideshow-container {
  max-width: 1000px;
  position: fixed;
  margin: auto;
  z-index:4;
}

/* Hide the images by default */
.mySlides {
  display: none;
}

/* Next & previous buttons */
.prev, .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  margin-top: -22px;
  padding: 16px;
  color: white;
  font-weight: bold;
  font-size: 18px;
  transition: 0.6s ease;
  border-radius: 0 3px 3px 0;
  user-select: none;
}

/* Position the "next button" to the right */
.next {
  right: 0;
  border-radius: 3px 0 0 3px;
}

/* On hover, add a black background color with a little bit see-through */
.prev:hover, .next:hover {
  background-color: rgba(0,0,0,0.8);
}

/* Caption text */
.text {
  color: #f2f2f2;
  font-size: 15px;
  padding: 8px 12px;
  position: absolute;
  bottom: 8px;
  width: 100%;
  text-align: center;
}

/* Number text (1/3 etc) */
.numbertext {
  color: #f2f2f2;
  font-size: 12px;
  padding: 8px 12px;
  position: absolute;
  top: 0;
}

/* The dots/bullets/indicators */
.dot {
  cursor: pointer;
  height: 15px;
  width: 15px;
  margin: 0 2px;
  background-color: #bbb;
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.6s ease;
}

.active, .dot:hover {
  background-color: #717171;
}

/* Fading animation */
.fade {
  -webkit-animation-name: fade;
  -webkit-animation-duration: 1.5s;
  animation-name: fade;
  animation-duration: 1.5s;
}

@-webkit-keyframes fade {
  from {opacity: .4}
  to {opacity: 1}
}

@keyframes fade {
  from {opacity: .4}
  to {opacity: 1}
}

HTML

        <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
        <link rel="preconnect" href="https://fonts.gstatic.com">
        <link href="https://fonts.googleapis.com/css2?family=Ubuntu:wght@300&display=swap" rel="stylesheet">
        <link rel="preconnect" href="https://fonts.gstatic.com">
        <link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300&family=Ubuntu:wght@300&display=swap" rel="stylesheet">
        <link rel="stylesheet" href="styles.css">
        <title>
        Checkmate - Chess Tournaments Online
        </title>
        <link rel = "icon" href ="CheckmateIcon.jpeg" type = "image/x-icon">

Checkmate

Chess Tournaments Online

                >

        Tournaments
        Event Plan
        Register

1 / 3

Caption Text

2 / 3

Caption Two

3 / 3

Caption Three

    ❮
    ❯

Just tell what I am doing wrong TT_TT
Answer: What i can see from here is you are using position:fixed on slideshow-container without giving it top property. It will stick to top
try this
/* Slideshow container */
.slideshow-container {
  max-width: 1000px;
  position: fixed;
  margin: auto;
  z-index:4;
  top:50px;

}

  Tournaments
  Event Plan
  Register

Checkmate

Chess Tournaments Online

1 / 3

Caption Text

2 / 3

Caption Two

3 / 3

Caption Three

  ❮
  ❯

Comment: I tried it, didn't work, the same result.
Comment: though this me the image displayed and it was in front of my navbar and hero image, but now my whole page layout is messed up...and my js buttons are not functioning


How to determine the Mori cone of curves for $\mathbb{P}^2$ blowing up a point?

Question: Let $X$ be $\mathbb{P}^2$ blowing up a point, and $E$ be the exceptional divisor. Its Picard group module numerically equivalence is generated by $\mathcal{O}_X(E)$ and $H:=\pi^*\mathcal{O}_{\mathbb{P}^2}(1)$. Hence $H_1(X)$ is of $2$ dimensional. Let $\overline{NE}(X)$ be the Mori cone of $X$ (i.e. the closure of the cone generated by effective $1$-cycles quotient out by numerical equivalence). Then what is the shape of this cone?
I initially thought it is just $\mathbb R_+ E \oplus \mathbb R_+ H$. But suppose $C$ is a general hypersurface on $X$ and $C\cdot E=a$. If $\pi_*(C) = b\mathcal{O}_{\mathbb{P}^2}(1)$, then $C = bH-aE$ in $N_1(X)$. So it is a problem to determine allowable combinations of $a$ and $b$.
Besides, I was wondering if there is a way to determine Mori cones for $\mathbb P^n$ blowing up $m$ points (maybe for smaller $n,m$?)? In my case, $X$ is toric, so should be computable. But when $m$ is large, it is no longer toric...
Comment: You should not say "numerically effective 1-cycles", because that is sometimes used as a synonym for "nef". Instead say "numerical classes of effective 1-cycles".
Answer: In the specific case you ask about, the answer is that $\overline{NE}(X)$ is spanned by $E$ and $H-E$. One way to see this is that every irreducible curve $C$ other than $E$ itself must satisfy $E \cdot C \geq 0$, and every irreducible curve $C$ must satisfy $(H-E) \cdot C \geq 0$ since the class $H-E$ is basepoint-free.
As you suggest, whenever we blow up at most $n+1$ general points in $\mathbf P^n$, the result is a toric variety $X$, and in this situation there is a straightforward way to compute $\overline{NE}(X)$.
Once we start to blow up more points, things get much trickier. Starting from $\mathbf P^2$ we can blow up at most 8 points and still end up with a del Pezzo surface; the Cone Theorem then guarantees that $\overline{NE}(X)$ is a finite rational polyhedral cone, and we can actually compute it in all these cases. (This is a good exercise so I won't write the answer; it is written in many places.) For 9 points we no longer have a del Pezzo surface, and in fact the cone no longer has finitely many extremal rays, but we can still give a good description.
(Similar results are available for blowups of $\mathbf P^3$ in at most 8 points, and in higher dimensions.)
That's about as good as it gets, though. Remarkably, as far as I am aware even for the blowup of $\mathbf P^2$ in 10 points the complete description of $\overline{NE}(X)$ is still not known, despite much work.
For more information about the limit of what is known, you can search for recent work on the so-called SHGH conjecture and Nagata's conjectire.
Comment: Thank you for your answer! However, I still did not see why $E$ and $H-E$ form the boundary of $\overline{NE}(X)$, could you give more details?
Comment: @LiYutong: it's really better to work these things out for yourself. Take an irreducible curve $C$ different from $E$. Can it have $E \cdot C <0$? Can it have $(H-E) \cdot C <0$?
Answer: Just to clarify Nefertiti's answer:
First, $|H-E|$ is base point free because one can take any line $l$ passing the point $x$ which is blown up. Then $H \sim \pi^*\mathcal{O}(l) = \mathcal{O}(\pi^{-1}(L))$, hence $\pi^{-1}(L)-E \sim H-E$. Thus $|H-E|$ is base point free, in particular, it is nef.
Suppose $xE+yH$ is a class of effective curve, then $(xE+yH)\cdot (H-E)\geq 0$. By $E \cdot E=-1, E \cdot H=0$, one has $x+y \geq 0$. As $-E+H$ is effective, we determine one edge (i.e. spanned by $-E+H$). If $E+bH$ is also effective for some $b<0$, then $(E+bH)\cdot H = b$, a contradiction. Hence $\overline{NE}(X) = \mathbb{R}_{+}(H-E)+\mathbb{R}_{+}(E)$.


Prove $\sigma_g(x) \in Aut(R(x)/R)$

Question: Let $R$ be a field and let $R(x)$ be the field of rational functions in $x$ whose coefficients are in $R$.
Let $g =
 \left( \begin{array}{cc}
a & b \\
c & d \\
\end{array} \right) \in GL_2(\mathbb{R})$ and define $\sigma_g(x)$ so that

$\forall r \in \mathbb{R}, \sigma_g(r)=r  \space\space\space (\sigma_g=Id_R)$
$\sigma_g(x) = \frac{ax+b}{cx+d}$

can I conclude  $\sigma_g(x) \in Aut(R(x)/R)$?
the opposite direction is clear to me and is detailed in this post.
any help would be appreciated =]
Answer: It's important that $(a,b)$ is not a constant multiple of $(c,d)$ so that $\frac{ax+b}{cx+d}$ isn't a constant. The equivalent condition of course is that $\det(\begin{smallmatrix}a&b\\c&d\end{smallmatrix})\ne0$.
Since $\frac{ax+b}{cx+d}$ is algebraic over $R\iff x$ is algebraic over $R$, we know $\frac{ax+b}{cx+d}$ is transcendental.
So there is an isomorphism $R(x)\to R(\frac{ax+b}{cx+d})$. Now think of this as a map $\sigma_g:R(x)\to R(x)$.
Since $\sigma_g$ has an inverse $\sigma_{g^{-1}}$ it is a field automorphism.

Prove $\sigma_g(x) \in Aut(R(x)/R)$


How to solve EOF Error in the below code?

Question: In the below code I am getting EOF error in line 2. But I found noting wrong in the code. Can someone please help me with the solution.
Code:
from datetime import datetime
a = int(input())
while a != 0:
    initial_time = input()
    initial_time = datetime.strptime(initial_time, "%I:%M %p")
    n = int(input())
    emp_str = ""
    while n != 0:
        inp = input()
        start_time = datetime.strptime(inp[:8], "%I:%M %p")
        end_time = datetime.strptime(inp[9:], "%I:%M %p")
        if initial_time >= start_time and end_time >= initial_time:
            emp_str += "1"
        else:
            emp_str += "0"
        n -= 1
    print(emp_str)
    a -= 1

Error:
Traceback (most recent call last):
  File "./prog.py", line 2, in <module>
EOFError: EOF when reading a line

Answer: I have solved the issue using try and except block as follows:
from datetime import datetime
try:
    a = int(input())

    while a != 0:
        initial_time = input()
        initial_time = datetime.strptime(initial_time, "%I:%M %p")
        n = int(input())
        emp_str = ""
        while n != 0:
            inp = input()
            start_time = datetime.strptime(inp[:8], "%I:%M %p")
            end_time = datetime.strptime(inp[9:], "%I:%M %p")
            if initial_time >= start_time and end_time >= initial_time:
                emp_str += "1"
            else:
                emp_str += "0"
            n -= 1
        print(emp_str)
        a -= 1

except EOFError as e:
    pass


Does sonarqube version 3.7.3 support java 1.7?

Question: There is a requirement to run the Project with Java 1.7 on Hudson/Jenkins and the Sonar version that we have is SonarQube 3.7.3.
So does this version of Sonar(3.7.3) support java 1.7?
Also, if not, then can we run 2 sonar servers as there are multiple projects that still run on Java 6 and only for 1 project, it would not be feasible to upgrade the Sonar version if the existing version is not compatible.
Answer: Support for Java 7 was added in Sonar 2.12. Also see the related Jira story.


UIDocumentInteractionController for Open In menu - Doesn't Work

Question: I implemented a UIDocumentInteractionController to send files to other apps. The file is a .txt file.
Here's the code:
UIDocumentInteractionController *interactionController = [[UIDocumentInteractionController alloc] init];
[interactionController setURL:[NSURL fileURLWithPath:filePath]];
[interactionController setUTI:@"public.text"];
[interactionController setDelegate:self];
[interactionController presentOpenInMenuFromBarButtonItem:actionBarButtonItem animated:YES];

The menu opens fine, showing apps like Pages, Dropbox, etc. as I expect. But when I tap one of them, the Open In menu dismisses and no action is performed (the file is not sent and the target application never opens.
I tried implementing the delegate methods documentInteractionController:canPerformAction: and documentInteractionController:performAction: for triggering copy: and print: calls using the options menu (as opposed to the open in menu) and that pulled up a menu with only Pages listed, but that still did not work.
How might this be resolved?
Answer: I found the answer, and it's memory management. I create the UIDocumentInteractionController and then present it, but I don't have it as an instance variable. ARC deallocates it before it has the opportunity to do anything. This includes sending the document to the external app.
This bug didn't appear on the iPhone, but on the iPad it gives an error because the popover architecture works a bit differently and it ends up trying to draw it when it's deallocated. That's what alerted me to the bug.
Comment: This is the answer for ARC projects. You have to declare a property for the UIDocumentInteractionController:

@property(nonatomic, strong)UIDocumentInteractionController * docController;
Comment: thanks! I have been searching on stack for a long time and I finally found this answer works for me.
Comment: thnx. have spent a couple of hours. but forget about arc. thnx a lot one more time.
Answer: This bug also appears on iPhone/iPod. Just set:
@property (nonatomic, retain) UIDocumentInteractionController *docController;

and it will be retain and the document passed to the new application.
Answer: it's enough to add the following code:
[interactionController retain];


Error with input shape in Keras while training CBOW model

Question: I am training a continuous bowl of words model for word embeddings where each of the one-hot vectors has a shape is a column vector with the shape of (V, 1). I'm using a generator to generate training examples and labels based on the corpus, but I have an error with the input shape.
(Here V = 5778)
Here's my code:
def windows(words, C):
    i = C
    while len(words) - i > C:
        center = words[i]
        context_words = words[i-C:i] + words[i+1:i+C+1]
        i += 1
        yield context_words, center

def one_hot_rep(word, word_to_index, V):
    vec = np.zeros((V, 1))
    vec[word_to_index[word]] = 1
    return vec

def context_to_one_hot(words, word_to_index, V):
    arr = [one_hot_rep(w, word_to_index, V) for w in words]
    return np.mean(arr, axis=0)

def get_training_examples(words, C, words_to_index, V):
    for context_words, center_word in windows(words, C):
        yield context_to_one_hot(context_words, words_to_index, V), one_hot_rep(center_word, words_to_index, V)

V = len(vocab)
N = 50

w2i, i2w = build_dict(vocab)

model = keras.models.Sequential([
    keras.layers.Flatten(input_shape=(V, )),
    keras.layers.Dense(units=N, activation='relu'),
    keras.layers.Dense(units=V, activation='softmax')
])

model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])

model.fit_generator(get_training_examples(data, 2, w2i, V), epochs=5, steps_per_epoch=20)

Answer: flatten layer get at least 3 dimensional numpy array but you give it 2 dimensional
Comment: you should change the V in this code:
keras.layers.Flatten(input_shape=(V, ))
Answer: I figured out what was causing the error. The model is expecting an input_shape = (None, V) where None holds the batch_size for Keras when the training starts but I was sending in arrays of shape (1, V) which when sent as a batch get an extra first dimension something like (128, 1, V) is being sent which clashes with that of the expected input_shape.


Can't use the url given by the getDownloadURL in a Image.network()

Question: I am using Flutter with image_picker and firebase_storage to store an image and then download the link to place in a firestore database. Here is my current code:
final picker = ImagePicker();
final file = await picker.pickImage(source: ImageSource.gallery);
final fileBytes = await file!.readAsBytes();

var reference = FirebaseStorage.instance.ref().child(file.name);
await reference.putData(fileBytes);

String url = await reference.getDownloadURL();
FirebaseFirestore.instance.collection('Images').add({
  'imageUrl': url,
  'timeStamp': Timestamp.now(),
});

The variable url has a value like https://firebasestorage.googleapis.com/v0/b/myproject.appspot.com/o/example.png?alt=media&token=image-token.
I want to display the images using a StreamBuilder:
StreamBuilder(
  stream: FirebaseFirestore.instance
      .collection('Images')
      .snapshots(),
  builder: (context, snapshot) {
    if (snapshot.hasData) {
      return ListView.builder(
        itemCount: snapshot.data!.docs.length,
        itemBuilder: (context, index) {
          final image = snapshot.data!.docs[index];
          return Image.network(image["imageUrl"]);
        }
      );
    } else if (snapshot.hasError) {
      return Center(
        child: Text('Error: ${snapshot.error}'),
      );
    }

    return const Center(
      child: CircularProgressIndicator(),
    );
  }
)

But I am getting the error
ImageCodecException: Failed to load network image.
Image URL:https://firebasestorage.googleapis.com/v0/b/myproject.appspot.com/o/example.png?alt=media&token=image-token
Server response code: 400

for every image.
Answer: I have recreated your setup and got your desired result. It looks like you were not awaiting for this promise to be resolved hence it was not getting stored in the firestore document.
await FirebaseFirestore.instance.collection('Images').add({ // ⇐
  'imageUrl': url,
  'timeStamp': Timestamp.now(),
});

Here's the my recreated code :
class _TestPageState extends State<TestPage> {
  final Stream<QuerySnapshot> imageStreams =
      FirebaseFirestore.instance.collection('images').snapshots();

  @override
  Widget build(BuildContext context) {
    void pickImage() async {
      final ImagePicker picker = ImagePicker();
      final image = await picker.pickImage(source: ImageSource.gallery);
      if (image != null) {
        //Upload to Firebase
        final fileBytes = await image.readAsBytes();
        Reference reference = FirebaseStorage.instance.ref().child(image.name);
        final snapshot = await reference.putData(fileBytes);
        String downloadUrl = await snapshot.ref.getDownloadURL();
        await FirebaseFirestore.instance.collection('images').add({
          'imageUrl': downloadUrl,
          'timeStamp': Timestamp.now(),
        });
      } else {
        print('No Image Path Received');
      }
    }

    return Scaffold(
      appBar: AppBar(
        title: const Text('Flutter Demo'),
      ),
      body: StreamBuilder<QuerySnapshot>(
        stream: imageStreams,
        builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot) {
          if (snapshot.hasError) {
            return const Text('Something went wrong');
          }

          if (snapshot.connectionState == ConnectionState.waiting) {
            return const Text("Loading");
          }

          return ListView.builder(
              itemCount: snapshot.data!.docs.length,
              itemBuilder: (context, index) {
                final image = snapshot.data!.docs[index];
                return Image.network(image["imageUrl"]);
              });
        },
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: pickImage,
        tooltip: 'Upload Image',
        child: const Icon(Icons.image),
      ),
    );
  }
}

Reference : Adding Documents
Comment: thanks for the answer, but unfortunately it gives the same error...
Answer: After many hours of research, and screaming to my computer, I found the answer to my problem.
Comment: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).


Does Dark Souls 2 allow random online mode?

Question: I've been playing Dark Souls 2 on XBox 360 for over a year now and have logged over 150 hours. I do not play online and I do not have XBox Gold. Every time I start Dark Souls 2 I see a message, "You do not have privileges to be in online mode" and then I play though in offline mode.
But, every now and then, I get to start in online mode. This weekend for example, I started the game and I was online. I could see all the messages, bloodstains and I was even invaded and participated in the PvP arenas.
I reset the game a few times throughout the day and each time I came back I was still online. But yesterday (Monday) and today, I was unable to go online or participate in the online features like invading or dueling in the brotherhood of blood arenas.
This has happened a few times over the last year and even happened in Dark Souls 1 once.
So does Dark Souls allow everyone to play online every now and then or is XBox 360 temporarily giving access to gold features for a weekend promotion or something? What is allowing me to participate in online mode when I clearly do not have access to online play?
Comment: Have you ever had a separate user logged in at the same time when you were able to play online?
Comment: Not sure what you mean. I only have 1 xbox live account in the house and it's not gold. Has not been for 2+ years.
Comment: That answers the question haha. As I explained in my answer, having a separate Gold account (possibly a friend?) *Might* give you Gold privileges in game, but I'm not certain.
Answer: Two possibilities:

It was a "Free Gold Weekend" - this basically allows anyone with Silver subscription to play with full Gold-level capability.
You had another sign-in with Gold signed in at the same time - I'm not certain, but this might allow you to play online. This does work for other things like DLC: if you have an account that has downloaded/purchased a DLC, leaving that profile signed in while a separate profile plays gives them access to that DLC.
Comment: +1 for free gold weekend. That's what it was I guess. I didn't get any notice when i logged in so that's really odd. I read that link and it says Oct 9-11 in 2015 was free gold weekend. I didn't even know they did that.
Comment: @DustinDavis yeah they don't really advertise it too openly.


transformation from cartesian coordinates to spherical coordinates without calculations

Question: Given this graph in the 3d cartesian coordinates i should figure out the spherical coordinates representation but without the use of calculations .
I've been trying to solve this the whole day but i don't seem to get it and i've searched on all around the internet also no results .
I'll appreciate any help if anyone has an idea about the topic .

NOTE: this is not a homework :)
Comment: I don't quite understand this question. The "spherical coordinates representation" of *what*? And what does "without calculations" mean here? Are you just supposed to draw the sphere on the left side into polar space on the right side? Ultimately, though, I'm not even sure this question is particularly computer graphics related to begin with. It seems more like a general mathematical question.
Comment: I believe the question is what would be the 3d shape of the equivalent sphere on the left, if the coordinates where R/theta/phi instead of XYZ. Probably without calculation means coming up with the shape intuitively. The answer is pretty easy, it looks like a curved sheet from 0,[0-360],0 to 2r,[0-360],90. You can think of it like this: the sphere is a bunch of circles around Z. They start at R=0,phi=0 and go to R=2r,phi=90. Each complete circle around Z is a line from theta=0 to theta=360. So, bunch of circles translates to bunch of lines. We have the start/end, and you can guess the curve.
Comment: Your question is not clear, however I believe that this image will help you: https://en.wikipedia.org/wiki/Spherical_coordinate_system#/media/File:3D_Spherical.svg
In cartesian coordinates you represent a point, by its offset along $x,y,z$ in spherical coordinates you represent a point in terms of 2 angles and a length. The equations that you do not want to use are what actually links these two.
Answer: If we take some ring around the sphere such that $\theta=const$, we can see that such a ring transforms into a line on the polar space.
Converting every possible ring to the polar space gives the desired surface. However this would involve computing many different values to get an approximation or doing some algebra, which we don't want. (I'm assuming you want to keep mathematical notation to a minimum here). However we can get a pretty close idea by figuring out just a few easy to compute values.
Now. If we grab the ring that goes around the center of the sphere and transform that one, it is clear that it ends up as a line with $\theta=45^o$ and $r=\sqrt{2}R$ (that is because its vertical distance from the origin equals its horizontal distance at every point).
There are two more rings that are useful to us here: the two very small rings around the poles of the sphere.
The ring around the bottom pole transforms into a line with $\theta=90^o$ and $r=0$.
The ring around the top pole transforms into a line with $\theta=0^o$ and $r=2R$.
We now have three lines through which we can fit our surface. You can do this with pen and paper. I'm not quite sure of what kind of curve you end up with (I haven't done the algebra haha) but my guess would be some kind of sideways parabola.
EDIT: I did the math, $r=2R\cos(\theta)$
NOTE: I measure my $\theta$ as the angle between some line crossing the origin and the Z axis
Answer: I am still not sure whether this is what you actually want, but here's how to derive it mathematically. The equation of a sphere with center $(c_x, c_y, c_z)$ and radius $\rho$ is:
$$(x-c_x)^2 + (y-c_y)^2 +(z-c_z)^2 =\rho^2$$
From the first image we can figure out that the sphere has center $(0,0,\rho)$, we also use the spherical coordinates substitution:
$$x=r\cos\phi\sin\theta, y=r\sin\phi\sin\theta, z =r\cos\theta$$
Substituting yields:
$$(r\cos\phi\sin\theta - 0)^2 + (r\sin\phi\sin\theta-0)^2 + (r\cos\theta-\rho)^2 = \rho^2$$
$$r(r-2\rho\cos\theta) = 0$$
The roots to the last equation are $$r=0, r=2\rho\cos\theta, \theta\in [0, \pi/2]$$, we can drop the $0$ since it is covered for $\theta = \pi/2$. Also $\theta$ being in $[0, \pi/2]$ restricts the sphere to being above the $xy$ plane, whereas using the full range: $[0,\pi]$ would produce also a sphere below. Thus you get the offset sphere in spherical coordinates:
$$S=\{(r,\theta,\phi) : r=2\rho\cos\theta, \theta\in [0, \pi/2], \phi \in [0,2\pi]\}$$
If you want the ball and not only its boundary, then use $r\in [0,2\rho\cos\theta]$ rather than $r=2\rho\cos\theta$.


How to duplicate rows using another data grid in Pentaho 8 CE

Question: I have a data grid with the following fields and one row:
Data Grid
Fields: A   , B   , C
Row 1:  fooA, fooB,

I have another data grid with the following rows -just one field-:
Intervals
Fields: C
Row 1:  10
Row 2:  20
Row 3:  35
Row 4:  40

I would like to understand which Pentaho Data Integration (Kettle) step/box shall be used to get:
Fields: A   , B   , C
Row 1:  fooA, fooB, 10
Row 2:  fooA, fooB, 20
Row 3:  fooA, fooB, 35
Row 4:  fooA, fooB, 40

Answer: That is a simple Join Rows (Cartesian product), though i do not know how exactly are you going to use this for variable data, if the Grid with 1 row multiple columns will ALWAYS have 1 row and multiple columns than it is fine, a cartesian product will replicate fooA, fooB in N' rows from the second grid.
All you have to do first in the second grid is split the single field into 2 columns, one with the "Row X" and another with the number value.
Your KTR should look something like this:

Which outputs this:
Comment: Actually the split step is not needed, as I need just `fooA,fooB,10` etc.


Fixed address on DHCP server isn't working

Question: I'm running Ubuntu 20.04 as a DHCP server and I tried to assign a fixed address to a client which is another Ubuntu os on a Virtual box, and both of them are in the same internal network, but, it takes only an address from the range I specified, so here's my configuration:
my /etc/netplan/01-network-manager-all.yaml
network:
  version: 2
  renderer: NetworkManager
  ethernets:
   enp0s3:
    addresses: [10.20.30.2/24]
    nameservers:
     addresses: ["192.168.1.1", "192.168.1.2"]

my /etc/dhcp/dhcpd.conf
option domain-name "marmarbre.local";
option domain-name-servers 192.168.1.1, 192.168.1.2;
option ntp-servers 10.20.30.202;
option netbios-name-servers 10.20.30.201;
option nis-domain "marmarbre.ma";
option nis-servers 10.20.30.200;
option routers 10.20.30.1;
option broadcast-address 10.20.30.255;

default-lease-time 86400;
max-lease-time 259200;

subnet 10.20.30.0 netmask 255.255.255.0 {
  range 10.20.30.50 10.20.30.59;
  range 10.20.30.71 10.20.30.150;
}

host client {
  hardware ethernet 08:00:27:7f:25:60;
  fixed-address 10.20.30.70;
}

Finally, this's the only configuration I did on the client and yeah I already changed its hostname to client
/etc/netplan/01-network-manager-all.yaml
network:
  version: 2
  renderer: NetworkManager

Answer: In your /etc/dhcp/dhcpd.conf file, move your fixed, MAC based, assignment list to before the generic dynamic pool declaration. If your client has an old, even expired, lease from the pool it will never get to the MAC based area unless it is declared first.
Note even though things might work properly, you still might get undesirable entries in your log files, which can be corrected by deleting the stale entries in your /var/lib/dhcp/dhcpd.leases file and its backup /var/lib/dhcp/dhcpd.leases~.


Criterion for a measurable function proof help (generated sigma algebra criterion)

Question: Lemma: Let ($\Omega_1,\mathfrak{F}_1$) and ($\Omega_2,\mathfrak{F}_2$) be measurable spaces.
Suppose that $\mathfrak{F}_2=\sigma(\mathfrak{A})$ (i.e. the $\sigma$-algebra generated by a set of subsets of $\Omega_2$ called $\mathfrak{A}$).
Then $f:\Omega_1 \to \Omega_2$ is a measurable function iff $f^{-1}(A)\in\mathfrak{F}_1, \forall A\in \mathfrak{A}$.
The forward proof is elementary and simple, but there is one aspect of the backwards proof that alludes me. In the proof, we consider a set $\mathfrak{G}:=$ { ${ A\subset\Omega_2 : f^{-1}(A)\in \mathfrak{F}_1}$ }. Once you accept that $\mathfrak{G}$ is a $\sigma$-algebra, the backwards proof follows by $\mathfrak{A}\subset \mathfrak{G} \implies \sigma (\mathfrak{A})\subset \sigma (\mathfrak{G}) = \mathfrak{G}$. As $\mathfrak{F}_2=\sigma(\mathfrak{A}) \implies \mathfrak{F}_2 \subset \mathfrak{G}$. This satisfies the definition of measurable functions.
However, the reason $\mathfrak{G}$ is a $\sigma$-algebra alludes me. Any help would be appreciated. Thank you.
Answer: You should verify that the preimage preserves unions and complements. Then for $\{A_n \}_{n=0}^\infty\subseteq \mathfrak{G}$
$$f^{-1}\big( \cup A_n \big)=\cup f^{-1}(A_n)\in \mathfrak{F}_1 \quad \text{and} \quad f^{-1}(A_0^c)=\big( f^{-1}(A_0) \big)^c \in \mathfrak{F}_1,$$
since $\mathfrak{F}_1$ is a $\sigma$-algebra.
Comment: Thank you, now it seems so obvious
Comment: @TooManySpidersInYourSoup You're welcome.


How to sort list in RecyclerView on Android

Question: In my application i want add some data from server into adapter of RecyclerView.
I write below codes and i can get data from server and show into RecyclerView.
But my json in not sorted with Alphabet from server.
I want before add this data into ArrayList, first sort this with Alphabet and add into ArrayList.
My json :
{
    "validationCheckResult": {
        "isValid": true,
        "message": "Success"
    },
    "internalCarBoard": [{
        "id": 0,
        "name": "S500",
        "companyName": "Benz",
    }, {
        "id": 0,
        "name": " E250",
        "companyName": "Benz",
    }, {
        "id": 0,
        "name": "TT",
        "companyName": "Audi",
    }, {
        "id": 0,
        "name": " Talisman",
        "companyName": "Renult",
    }, {
        "id": 0,
        "name": " Accord",
        "companyName": "Honda",
    }, {
        "id": 0,
        "name": "A8",
        "companyName": "Audi",
    }]
}

I want sort above json from companyName with Alphabet before add to ArrayList.
But i want sort this into Android not server.
My Java codes:
public class SortListActivity extends AppCompatActivity {

    private RecyclerView sortList_recycler;
    private SortAdapter sortAdapter;
    private List<InternalCarBoard> model = new ArrayList<>();
    private API api;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sort_list);
        sortList_recycler = findViewById(R.id.sortList_recycler);
        api = ApiClient.getClient().create(API.class);
        sortAdapter = new SortAdapter(model);
        sortList_recycler.setHasFixedSize(true);
        sortList_recycler.setLayoutManager(new LinearLayoutManager(this));
        sortList_recycler.setAdapter(sortAdapter);

        Call<VersionUpdateResponse> call = api.getCar();
        call.enqueue(new Callback<VersionUpdateResponse>() {
            @Override
            public void onResponse(Call<VersionUpdateResponse> call, Response<VersionUpdateResponse> response) {
                if (response.isSuccessful()) {
                    if (response.body() != null) {
                        if (response.body().getInternalCarBoard().size() > 0) {
                            model.clear();
                            model.addAll(response.body().getInternalCarBoard());
                            sortAdapter.notifyDataSetChanged();
                        }
                    }
                }
            }

            @Override
            public void onFailure(Call<VersionUpdateResponse> call, Throwable t) {

            }
        });
    }
}

How can i sort json with Alphabet from companyName before add into ArrayList?
Comment: use Java 8 stream API sort
Comment: @GaneshPatil, how can i it? can you help me and send to me code with my above codes? because i am amateur
Comment: ok sure.........
Comment: using collection sort you can do it
https://stackoverflow.com/questions/12901742/android-how-to-sort-jsonarray-of-jsonobjects
Comment: @WaleedAsim, can you send to me code with my above codes? because i am amateur. please
Comment: Here is the code:
https://stackoverflow.com/questions/17697568/how-to-sort-jsonarray-in-android/17698236
Comment: https://stackoverflow.com/questions/5815423/sorting-arraylist-in-alphabetical-order-case-insensitive
 also see this
Comment: @WaleedAsim, can you send to me code with my above codes? i am amateur. please
Comment: @Hock please check my answer
Comment: Collections.sort(response.body().getInternalCarBoard());
Comment: you are using retrofit for api calls , so along with retrofit you can use rx and sort  get the sorted respoonse
Answer: Use Collections.sort() like this
Collections.sort(model, new Comparator<InternalCarBoard>(){
            public int compare(InternalCarBoard obj1, InternalCarBoard obj2) {
                // ## Ascending order
                return obj1.getCompanyName().compareToIgnoreCase(obj2.getCompanyName); // To compare string values
                // return Integer.valueOf(obj1.getId()).compareTo(obj2.getId()); // To compare integer values

                // ## Descending order
                // return obj2.getCompanyName().compareToIgnoreCase(obj1.getCompanyName()); // To compare string values
                // return Integer.valueOf(obj2.getId()).compareTo(obj1.getId()); // To compare integer values
            }
        });

check this for details.
Comment: But i want another question, can i sort first with companyName , then sort name. then add into recyclerView
Comment: you can check [this](https://stackoverflow.com/questions/4805606/how-to-sort-by-two-fields-in-java) link
Answer: Please try following java 8 sorting API it will sort by ascending order
before adding to your new list
yourlist.sort((object1,object2)->object1.getCompanyName().compareTo(object2.getCompanyName())); // sort

yourlist.forEach(action->System.out.println(action.getCompanyName())); //iterate

Answer: Sort your data before adding it to Adapter. You can try Collections.sort()
You can check this: How to sort RecyclerView item in android
Collections.sort(response.body().getInternalCarBoard(), new Comparator<InternalCarBoard>() {
        @Override
        public int compare(InternalCarBoard x, InternalCarBoard y) {
            // -1 - less than, 1 - greater than, 0 - equal, all inversed for descending
            return x.companyName > y.companyName;
        }
    });

Comment: Thanks but i am amateur :( can you send to me code with my above codes? please :9


JTDS with absolute path (JDBC connection to an Access MDB File)

Question: I've spent lots of time searching a solution to this, tried Google it, BING it, tried JTDS community but no solution, or maybe I haven't searched enough, nevertheless this is my situation:
I have the JTDS library in my project, and want to connect to a local MDB database file located at a local folder (C:\path\to\databasefile.mdb), but all I see is that I need the following connection String:
<code>"jdbc:jtds:sqlserver://url:port[;option1]..."
</code>
I want to use something like this:
<code>"jdbc:jtds:sqlserver://[C:\\path\to\databasefile.mdb]:port[;option1]..."
</code>
is it possible?
Answer: jTDS is only there to connect to a running Microsoft or Sybase SQL Server.
It cannot read or write (local) MDB files.
The only way you can connect to an Access database through a JDBC driver is to use the JDBC/ODBC bridge with an url like this:
<code>jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\path\to\databasefile.mdb
</code>
Answer: Moved into using Jackcess... http://jackcess.sourceforge.net/
I needed a solution to read/write access local databases, which a jdbc-odbc bridge on a 64 bit machine cannot be accomplished.
Comment: Re: "read/write access local databases, which a jdbc-odbc bridge on a 64 bit machine cannot [do]." - Regardless of whether that statement was true at the time it was written it is not true now. Under most circumstances 64-bit Java applications can read/write Access database files using the JDBC/ODBC Bridge and the 64-bit version of the [Access Database Engine](http://www.microsoft.com/en-US/download/details.aspx?id=13255). The ODBC driver name is `{Microsoft Access Driver (*.mdb, *.accdb)}`.