text:
Q: plotting several functions: order influences Timing Consider the following, fairly long, function definition (note however that it only consist of the elementary operations addition, multiplication and exponentiation):
fun[x_] = 439.2526370226815*
    E^(300*(-3.3348195385623947 + 3.3333333333333326*x))*
    ((18.34195787125195*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x))*
       (5 + 25*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
         15*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
         E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)))^2*
       (60*E^(600*(-3.3348195385623947 + 3.3333333333333326*x)) +
        300*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x)) +
        180*E^(2400*(-3.3348195385623947 + 3.3333333333333326*x)) +
        12*E^(3300*(-3.3348195385623947 + 3.3333333333333326*x))))/
      (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
        50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
        20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
        E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^3 -
     (18.34195787125195*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x))*
       (75*E^(600*(-3.3348195385623947 + 3.3333333333333326*x)) +
        90*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x)) +
        9*E^(2400*(-3.3348195385623947 + 3.3333333333333326*x)))*
       (5 + 25*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
        15*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
        E^(2700*(-3.3348195385623947 + 3.3333333333333326*x))))/
      (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
        50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
        20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
        E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^2 -
     (55.02587361375585*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x))*
       (5 + 25*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
         15*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
         E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)))^2)/
      (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
        50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
        20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
        E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^2 +
     (60*E^(600*(-3.3348195385623947 + 3.3333333333333326*x)) +
       300*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x)) +
       180*E^(2400*(-3.3348195385623947 + 3.3333333333333326*x)) +
       12*E^(3300*(-3.3348195385623947 + 3.3333333333333326*x)))/
      (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
       50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
       20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
       E^(3600*(-3.3348195385623947 + 3.3333333333333326*x))) +
     0.007210807153437529*
      ((85536*E^(3600*(-3.3348195385623947 + 3.3333333333333326*x))*
         (5 + 25*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
           15*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
           E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)))^4*
         (60*E^(600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          300*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          180*E^(2400*(-3.3348195385623947 + 3.3333333333333326*x)) +
          12*E^(3300*(-3.3348195385623947 + 3.3333333333333326*x))))/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^5 -
       (85536*E^(3600*(-3.3348195385623947 + 3.3333333333333326*x))*
         (75*E^(600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          90*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          9*E^(2400*(-3.3348195385623947 + 3.3333333333333326*x)))*
         (5 + 25*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
           15*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
           E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)))^3)/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^4 -
       (256608*E^(3300*(-3.3348195385623947 + 3.3333333333333326*x))*
         (5 + 25*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
           15*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
           E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)))^4)/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^4 -
       (14580*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x))*
         (5 + 25*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
           15*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
           E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)))^2*
         (5 + 50*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          45*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          4*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)))*
         (60*E^(600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          300*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          180*E^(2400*(-3.3348195385623947 + 3.3333333333333326*x)) +
          12*E^(3300*(-3.3348195385623947 + 3.3333333333333326*x))))/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^4 +
       (4860*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x))*
         (150*E^(600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          270*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          36*E^(2400*(-3.3348195385623947 + 3.3333333333333326*x)))*
         (5 + 25*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
           15*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
           E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)))^2)/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^3 +
       (9720*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x))*
         (75*E^(600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          90*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          9*E^(2400*(-3.3348195385623947 + 3.3333333333333326*x)))*
         (5 + 25*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          15*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)))*
         (5 + 50*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          45*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          4*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x))))/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^3 +
       (43740*E^(2400*(-3.3348195385623947 + 3.3333333333333326*x))*
         (5 + 25*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
           15*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
           E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)))^2*
         (5 + 50*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          45*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          4*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x))))/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^3 +
       (36*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x))*
         (10575*E^(600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          81420*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          154440*E^(2400*(-3.3348195385623947 + 3.3333333333333326*x)) +
          101520*E^(3300*(-3.3348195385623947 + 3.3333333333333326*x)) +
          18225*E^(4200*(-3.3348195385623947 + 3.3333333333333326*x)) +
          972*E^(5100*(-3.3348195385623947 + 3.3333333333333326*x))))/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^2 -
       (72*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x))*
         (60*E^(600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          300*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          180*E^(2400*(-3.3348195385623947 + 3.3333333333333326*x)) +
          12*E^(3300*(-3.3348195385623947 + 3.3333333333333326*x)))*
         (360 + 3525*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          13570*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          17160*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          8460*E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          1215*E^(4500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          54*E^(5400*(-3.3348195385623947 + 3.3333333333333326*x))))/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^3 +
       (216*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x))*
         (360 + 3525*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          13570*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          17160*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          8460*E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          1215*E^(4500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          54*E^(5400*(-3.3348195385623947 + 3.3333333333333326*x))))/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^2) +
     0.0006123163010466359*
      ((40870656*E^(5400*(-3.3348195385623947 + 3.3333333333333326*x))*
         (5 + 25*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
           15*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
           E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)))^6*
         (60*E^(600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          300*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          180*E^(2400*(-3.3348195385623947 + 3.3333333333333326*x)) +
          12*E^(3300*(-3.3348195385623947 + 3.3333333333333326*x))))/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^7 -
       (40870656*E^(5400*(-3.3348195385623947 + 3.3333333333333326*x))*
         (75*E^(600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          90*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          9*E^(2400*(-3.3348195385623947 + 3.3333333333333326*x)))*
         (5 + 25*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
           15*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
           E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)))^5)/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^6 -
       (122611968*E^(5100*(-3.3348195385623947 + 3.3333333333333326*x))*
         (5 + 25*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
           15*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
           E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)))^6)/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^6 -
       (13996800*E^(4500*(-3.3348195385623947 + 3.3333333333333326*x))*
         (5 + 25*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
           15*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
           E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)))^4*
         (5 + 50*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          45*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          4*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)))*
         (60*E^(600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          300*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          180*E^(2400*(-3.3348195385623947 + 3.3333333333333326*x)) +
          12*E^(3300*(-3.3348195385623947 + 3.3333333333333326*x))))/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^6 +
       (2799360*E^(4500*(-3.3348195385623947 + 3.3333333333333326*x))*
         (150*E^(600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          270*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          36*E^(2400*(-3.3348195385623947 + 3.3333333333333326*x)))*
         (5 + 25*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
           15*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
           E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)))^4)/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^5 +
       (11197440*E^(4500*(-3.3348195385623947 + 3.3333333333333326*x))*
         (75*E^(600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          90*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          9*E^(2400*(-3.3348195385623947 + 3.3333333333333326*x)))*
         (5 + 25*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
           15*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
           E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)))^3*
         (5 + 50*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          45*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          4*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x))))/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^5 +
       (41990400*E^(4200*(-3.3348195385623947 + 3.3333333333333326*x))*
         (5 + 25*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
           15*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
           E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)))^4*
         (5 + 50*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          45*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          4*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x))))/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^5 -
       (6*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x))*
         (172350*E^(600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          2046180*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          4985820*E^(2400*(-3.3348195385623947 + 3.3333333333333326*x)) +
          4320900*E^(3300*(-3.3348195385623947 + 3.3333333333333326*x)) +
          984150*E^(4200*(-3.3348195385623947 + 3.3333333333333326*x)) +
          69984*E^(5100*(-3.3348195385623947 + 3.3333333333333326*x))))/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^2 -
       (324*E^(3600*(-3.3348195385623947 + 3.3333333333333326*x))*
         (5 + 25*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
           15*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
           E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)))^2*
         (884700*E^(600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          11875020*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          28820340*E^(2400*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20629620*E^(3300*(-3.3348195385623947 + 3.3333333333333326*x)) +
          3855600*E^(4200*(-3.3348195385623947 + 3.3333333333333326*x)) +
          203472*E^(5100*(-3.3348195385623947 + 3.3333333333333326*x))))/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^4 +
       (12*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x))*
         (60*E^(600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          300*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          180*E^(2400*(-3.3348195385623947 + 3.3333333333333326*x)) +
          12*E^(3300*(-3.3348195385623947 + 3.3333333333333326*x)))*
         (5295 + 57450*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          341030*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          553980*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          360075*E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          65610*E^(4500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          3888*E^(5400*(-3.3348195385623947 + 3.3333333333333326*x))))/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^3 -
       (36*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x))*
         (5295 + 57450*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          341030*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          553980*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          360075*E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          65610*E^(4500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          3888*E^(5400*(-3.3348195385623947 + 3.3333333333333326*x))))/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^2 +
       (1296*E^(3600*(-3.3348195385623947 + 3.3333333333333326*x))*
         (5 + 25*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
           15*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
           E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)))^2*
         (60*E^(600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          300*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          180*E^(2400*(-3.3348195385623947 + 3.3333333333333326*x)) +
          12*E^(3300*(-3.3348195385623947 + 3.3333333333333326*x)))*
         (5535 + 294900*E^(900*(-3.3348195385623947 + 3.3333333333333326*
               x)) + 1979170*E^(1800*(-3.3348195385623947 +
              3.3333333333333326*x)) + 3202260*
           E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          1719135*E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          257040*E^(4500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          11304*E^(5400*(-3.3348195385623947 + 3.3333333333333326*x))))/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^5 -
       (648*E^(3600*(-3.3348195385623947 + 3.3333333333333326*x))*
         (75*E^(600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          90*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          9*E^(2400*(-3.3348195385623947 + 3.3333333333333326*x)))*
         (5 + 25*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          15*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)))*
         (5535 + 294900*E^(900*(-3.3348195385623947 + 3.3333333333333326*
               x)) + 1979170*E^(1800*(-3.3348195385623947 +
              3.3333333333333326*x)) + 3202260*
           E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          1719135*E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          257040*E^(4500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          11304*E^(5400*(-3.3348195385623947 + 3.3333333333333326*x))))/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^4 -
       (3888*E^(3300*(-3.3348195385623947 + 3.3333333333333326*x))*
         (5 + 25*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
           15*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
           E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)))^2*
         (5535 + 294900*E^(900*(-3.3348195385623947 + 3.3333333333333326*
               x)) + 1979170*E^(1800*(-3.3348195385623947 +
              3.3333333333333326*x)) + 3202260*
           E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          1719135*E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          257040*E^(4500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          11304*E^(5400*(-3.3348195385623947 + 3.3333333333333326*x))))/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^4 -
       (1620*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x))*
         (212625*E^(600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          3279450*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          17508105*E^(2400*(-3.3348195385623947 + 3.3333333333333326*x)) +
          38682900*E^(3300*(-3.3348195385623947 + 3.3333333333333326*x)) +
          39792075*E^(4200*(-3.3348195385623947 + 3.3333333333333326*x)) +
          19115730*E^(5100*(-3.3348195385623947 + 3.3333333333333326*x)) +
          3971835*E^(6000*(-3.3348195385623947 + 3.3333333333333326*x)) +
          359640*E^(6900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          11664*E^(7800*(-3.3348195385623947 + 3.3333333333333326*x))))/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^3 +
       (4860*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x))*
         (60*E^(600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          300*E^(1500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          180*E^(2400*(-3.3348195385623947 + 3.3333333333333326*x)) +
          12*E^(3300*(-3.3348195385623947 + 3.3333333333333326*x)))*
         (3600 + 70875*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          546575*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          1945345*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          3223575*E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          2652805*E^(4500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          1061985*E^(5400*(-3.3348195385623947 + 3.3333333333333326*x)) +
          189135*E^(6300*(-3.3348195385623947 + 3.3333333333333326*x)) +
          14985*E^(7200*(-3.3348195385623947 + 3.3333333333333326*x)) +
          432*E^(8100*(-3.3348195385623947 + 3.3333333333333326*x))))/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^4 -
       (14580*E^(2400*(-3.3348195385623947 + 3.3333333333333326*x))*
         (3600 + 70875*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          546575*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          1945345*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          3223575*E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)) +
          2652805*E^(4500*(-3.3348195385623947 + 3.3333333333333326*x)) +
          1061985*E^(5400*(-3.3348195385623947 + 3.3333333333333326*x)) +
          189135*E^(6300*(-3.3348195385623947 + 3.3333333333333326*x)) +
          14985*E^(7200*(-3.3348195385623947 + 3.3333333333333326*x)) +
          432*E^(8100*(-3.3348195385623947 + 3.3333333333333326*x))))/
        (1 + 20*E^(900*(-3.3348195385623947 + 3.3333333333333326*x)) +
          50*E^(1800*(-3.3348195385623947 + 3.3333333333333326*x)) +
          20*E^(2700*(-3.3348195385623947 + 3.3333333333333326*x)) +
          E^(3600*(-3.3348195385623947 + 3.3333333333333326*x)))^3))

Upon plotting this function in combination with a modification of it, I noticed something strange: the order of the functions influences the time the plot takes:
Plot[{(-0.000189716182236671 + 1/fun[x])^-1, fun[x]}, {x, 0.997, 1.002}] // RepeatedTiming

gives me a timing of 1.960 on my machine, in contrast:
Plot[{fun[x], (-0.000189716182236671 + 1/fun[x])^-1}, {x, 0.997, 1.002}] // RepeatedTiming

results in a timing of 2.86. I have other examples where this is even more extreme.
At first I suspected the order influences the number of sampling points, after adding the option Mesh -> All I don't think so anymore. The only possible explanation I have left is that Mathematica can somehow exploit the fact that the functions are related, however I don't understand why this should only work in the first case...


text:
Q: When a Paypal billing subscription is charged for the 2nd time, what event is fired to the webhook? Let's say I created a billing plan, then billing agreement (i.e. subscription) that chrages monthly and infinitely, via the Paypal REST API, and provided I have a webhook that listens on all events: what event type will be fired next month when the client is charged?
Here's a list of all the possible events, I tried many of them in the simulator, but none returns something that resembles an ID of the associated billing agreement.

A: I found out the hard way. It is PAYMENT.SALE.COMPLETED
You get the billing agreement id via event.resource.billing_agreement_id

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to StartEdit in EditingPlugin in grid? I know row index and column name. But EditingPlugin need
startEdit( Ext.data.Model record, Ext.data.Model columnHeader )</code>.

How I can take it and give it back?

A: For the record you can do
record = grid.getStore().getAt(recordIndex);

but for the column header, I dont' think you needed it since startedit requeres the column not its header. In the CellEditing plugin doc it says column header but it describes it as the column object.
columnHeader : Ext.data.Model
The Column object defining the column to be edited
Provide a more detailed example giving the available local variables and I will try to gieve a solution for the column also.

A: If you know the column index you can also do this:
 cellEditor.startEditByPosition({row:0,column:0})


text:
Q: recursively impossible proof According to Godel's theorems, we know that some propositions are expressible in a sufficiently expressive logic system, that cannot be proven or disproven
We also have proofs that some statements cannot be proven or disproven in certain theories (eg. as the continuum hypothesis in ZFC, or the axiom of choice in ZF).
My question is, is there a statement P such as

*

*We cannot prove or disprove P

*We cannot prove or disprove that we cannot prove and disprove P

*we cannot prove or disprove (2.)

*we cannot prove or disprove (3.)

$\ldots$
n. we cannot prove or disprove (n-1)
$\ldots$ and so on for all n
What would be necessary and/or sufficient conditions on a theory that has such statements?

A: We can construct an undecidable formula $\phi$ in the language of Peano Arithmetic (PA) such that
PA $\vdash\phi\leftrightarrow\neg\Box\phi$,
where $\Box$ is the provability operator.
Iterating on $\psi$ as $\phi\leftrightarrow\neg\Box\phi$
$\psi'$ as $\psi\leftrightarrow\neg\Box\psi$
$\psi''$ as $\psi'\leftrightarrow\neg\Box\psi'$ and so on,
we get a family of undecidable formulas on the assumption that PA is consistent.
Hence, any consistent and incomplete system that we can do these operations has to suffice. By an employment of Solovay's Arithmetical Completeness Theorem, the task might be simpler.


text:
Q: java (jvm) gc logs, что это значит? Подскажите, что значит лог gc в java:

2017-10-21T01:58:13.453+0300: 163918.493: [GC (Allocation Failure) 2017-10-21T01:58:13.453+0300: 163918.493: [ParNew (0: promotion failure size = 3)
    (1: promotion failure size = 3)  (2: promotion failure size = 4)  (3: promotion failure size = 3)  (4: promotion failure size = 3)  (5: promotion
  failure size = 3)  (6: promotion failure size = 1310722)  (7: promotion failure size = 3)  (8: promotion failure size = 7)  (9: promotion failure si
  ze = 3)  (promotion failed): 552960K->552960K(552960K), 0.3093364 secs]2017-10-21T01:58:13.763+0300: 163918.802: [CMS2017-10-21T01:58:21.834+0300: 1
  63926.874: [CMS-concurrent-sweep: 8.883/9.338 secs] [Times: user=18.83 sys=0.23, real=9.33 secs]
   (concurrent mode failure): 7389105K->3921591K(9871360K), 17.0332925 secs] 7942062K->3921591K(10424320K), [Metaspace: 49844K->49844K(1095680K)], 17.3436247 secs] [Times: user=19.15 sys=0.00, real=17.35 secs]
  Heap after GC invocations=157710 (full 283):
   par new generation   total 552960K, used 0K [0x0000000540000000, 0x0000000565800000, 0x0000000565800000)
    eden space 491520K,   0% used [0x0000000540000000, 0x0000000540000000, 0x000000055e000000)
    from space 61440K,   0% used [0x000000055e000000, 0x000000055e000000, 0x0000000561c00000)
    to   space 61440K,   0% used [0x0000000561c00000, 0x0000000561c00000, 0x0000000565800000)
   concurrent mark-sweep generation total 9871360K, used 3921591K [0x0000000565800000, 0x00000007c0000000, 0x00000007c0000000)
   Metaspace       used 49844K, capacity 51634K, committed 51832K, reserved 1095680K
    class space    used 6118K, capacity 6514K, committed 6568K, reserved 1048576K
  }

1. [ParNew (0: promotion failure size = 3)
  (1: promotion failure size = 3)  (2: promotion failure size = 4)  (3: promotion failure size = 3)  (4: promotion failure size = 3)  (5: promotion
failure size = 3)  (6: promotion failure size = 1310722)  (7: promotion failure size = 3)  (8: promotion failure size = 7)  (9: promotion failure si
ze = 3)  (promotion failed)

Что значит 0: .., 1: ..., 2: ..., ... 9: — что это за 9 разделов?
2. concurrent mode failure - почему?
Итог - фриз на 17 секунд.


text:
Q: Bounce balls inside ellipsoid and other shapes vpython How?
I'm sure this should be simple...have tried this
Would love a push in right direction (newbie)
lips = ellipsoid(pos=vector(0,0,0),opacity=.4)
lips.axis=vector(2,0,0)

ball = sphere (color = color.green, radius = 0.1, make_trail=True, retain=200)
ball.mass = 1.0
ball.p = vector (-0.15, -0.23, +0.27)

dt = 0.3
while True:
    rate(200)
    ball.pos = ball.pos + (ball.p/ball.mass)*dt
    if not (lips > ball.pos.x > -lips):
        ball.p.x = -ball.p.x
    if not (lips > ball.pos.y > -lips):
        ball.p.y = -ball.p.y
    if not (lips > ball.pos.z > -lips):
        ball.p.z = -ball.p.z


text:
Q: locally isometric is not a symmetric relation. The relation of being locally isometric for Riemannian manifolds is reflexive and transitive. Is it symmetric? Can you give me an example?

A: This depends on the precise definition of the relation "$M$ and $N$ are locally isometric". For the first two definitions that sprang to my mind, the answer is "no."
If one defines "$M$ and $N$ are locally isometric if there exists a local isometry $f:M\to N$", then the relation is not symmetric. Consider, say, a closed complete hyperbolic manifold $M$. In particular, the projection map $\mathbb{H}^n\to M$ is a local isometry, but there is no local isometry $M\to \mathbb{H}^n$, for there is not even a local diffeomorphism $M\to\mathbb{H}^n$ (choose a reference point $r\in\mathbb{H}^n$ and consider $df$ at a point $p\in M$ where $d(f(p),r)$ is maximized).
(This argument works for any closed complete Riemannian manifold with infinite-diameter universal cover.)
If one defines "$M$ and $N$ are locally isometric if for any $m\in M$ there exists an $n\in N$ and neighborhoods $U_p\ni p$, $U_q\ni q$ such that $U_p$ is isometric to $U_q$", then the relation is also not symmetric. Daniel Fischer provides a counterexample in the comments.

A: The Answer to this question is according to the following definition of "locally isometric Riemannian manifolds":
DEFFINITION: Let $M$ and $N$ be Riemannian manifolds. A differentiable mapping $$f:M\rightarrow N $$
is a "local isometry" at $p\in M$ if there is a neighborhood $U\subset M$ of $p$ such that
$$f:U\rightarrow f(U) $$
is a diffeomorphism satisfying
$$\langle u,v\rangle_{p}=\langle d{f}_{p}(u),d{f}_{p}(v)\rangle_{f(p)}$$
Now a Riemannian manifold $M$ is "locally isometric" to a Riemannian manifold $N$ if for every $p$ in $M$ there exists a neighborhood $U$ of $p$ in $M$ and a local isometry
$$f:U \rightarrow f(U)\subset N$$
It is possible to see that the natural projection
$$\pi :S^{2}\rightarrow P^{2}(\mathbb{R})$$ is a local isometry. In fact with the aid of this map along with different "suitable neighborhoods" one can say that $S^{2}$ is locally isometric to $P^{2}(\mathbb{R})$.
Now assume that the "locally isometric" is a symmetric relation. Then one would have $P^{2}(\mathbb{R})$ locally isometric to $S^{2}$. Consequently, one gets $P^2\mathbb{R}$ locally diffeomorphic to $S^2$.
But this makes a contradiction:
$S^{2}$ is an orientable manifold and hence due to the existence of the local diffeomorphisms, $P^{2}(\mathbb{R})$ should be an orientable manifold which is a contradiction (Since $P^{2}(\mathbb{R})$ is not orientable).


text:
Q: Get Mamp Apache/PHP to be case sensitive like remote server I was wondering if there was a way to get MAMP and Apache on my mac behave like on the server. It is very annoying that everything works fine offline and once its online its a hassle because the system is case sensitive. Is that something I can just for my dev environment or will it mess up my whole OS?

A: The default OS X file system is case insensitive.  There is nothing you can do in Apache or PHP to simulate case sensitivity because it's handled at the OS level.  There are a few options for switching to case sensitive local files:

*

*Add a new drive or partition and use a case sensitive file system.  Place your project there.  This is probably the easiest fix.

*Reformat your Mac to be case sensitive.  This won't be a problem for OS X but can have negative side affects on other applications (e.g. Adobe).

*Run Apache and PHP inside a local virtual machine with the same OS as your server.  You can edit files locally and mount the working directory inside the VM.  This is a good method if you want to debug inside an environment very similar to your server.


text:
Q: Why is this recursive regex not working? I'm trying to write a simple regex to match nested curly brackets. So if I have this text:
{
  apple
  {second}
  banana
}

Then I want it to match the entire text between the first and last {} (including the 2nd pair of {}). Here's the regex I've written:
/{ (?:.+?|(?R) ) }/six

The output for this is:
{ apple {second}

As you can see the first curly bracket is being matched, and the 'banana' at the end is not being matched. Here's the output I want it to return:
apple {second} banana

What am I doing wrong?

A: The pattern you want to use is:
/{ (?:  (?R) | .+? )+ }/six

With your regex, the .+? would have always taken precedence. PCRE would match the longest possible string and never look for the alternative.
Only making the alternative (..)+ repetetive allows the matching to switch between the recursive part and the match-anything placeholder.

A: Does this work for you?
\{([\s\S]*)\}


text:
Q: JavaMaildir error: No provider for maildir I'm trying to develop an e-mail client for android using JavaMail and JavaMaildir. I've downloaded JavaMaildir from here: http://sourceforge.net/projects/javamaildir/, version 0.5.
I've added the .jar file into the libs folder of my android project. The project compiles without problem.
Here is the code I'm using to initialize the store object:
Properties prop = new Properties();
prop.put("mail.store.maildir.autocreatedir", true);
this.session = Session.getInstance(prop);
// Creates the directory if it doesn't exists
File dir = this.getDir(POP3ClientService.md_name, Context.MODE_PRIVATE);
String url = "maildir:" + dir.getAbsolutePath();
Log.d("DEBUG", url);
try {
    this.store = this.session.getStore(new URLName(url));
} catch (NoSuchProviderException e) {
    // TODO Auto-generated catch block
    this.store = null;
    Log.e("ERROR", e.getMessage());
}

http://javamaildir.sourceforge.net/examples/
Which is taken from the example available on the project site: http://javamaildir.sourceforge.net/examples/
Unfortunately, it throws a NoSuchProviderException and therefore I cannot use the store since it's a null pointer.
The error message says No provider for maildir. Where am I wrong?


text:
Q: Create a list from two lists based on values in another list list1=['String-1', 'String-2', 'String-1', 'String-1', 'String-2', 'String-2', 'String-1', 'String-2', 'String-1', 'String-2']
list2=['TEXT-1', 'TEXT-1', 'TEXT-1', 'TEXT-1', 'TEXT-1']
list3=['TEXT-2', 'TEXT-2', 'TEXT-2', 'TEXT-2']

i want to construct list 4 from list2 and list3 based on the values in list1
if value in list1=String-1 then pick from list2 else pick from list3
finallist=['TEXT-1', 'TEXT-2', 'TEXT-1', 'TEXT-1', 'TEXT-2', 'TEXT-2', 'TEXT-1', 'TEXT-2', 'TEXT-1', 'TEXT-2']

Any help?

A: This should do:
list1=['String-1', 'String-2', 'String-1', 'String-1', 'String-2', 'String-2', 'String-1', 'String-2', 'String-1', 'String-2']
list2=['TEXT-1', 'TEXT-1', 'TEXT-1', 'TEXT-1', 'TEXT-1']
list3=['TEXT-2', 'TEXT-2', 'TEXT-2', 'TEXT-2', 'TEXT-2']

list2chosen,list3chosen = 0,0
finallist = []
for n in list1:
    if n == "String-1":
        finallist.append(list2[list2chosen])
        list2chosen += 1
    elif n == "String-2":
        finallist.append(list3[list3chosen])
        list3chosen += 1

print(finallist)

A: Try this one:
finallist = [list2[0] if i == "String-1" else list3[0] for i in list1]
print(finallist)


text:
Q: Outer automorphisms of extraspecial groups in GAP Let $G_n$ be the extraspecial group of order $2^{1+2n}$. Its outer automorphism group is known to be isomorphic to the general orthogonal group $GO(2n)$. I'd like to get an explicit map of this isomorphism in gap. Here's what I tried so far:
n:=4;
grp:=ExtraspecialGroup(2^(2*n+1),"+");
aut:=AutomorphismGroup(grp);
inn:=InnerAutomorphismsAutomorphismGroup(aut);
ort:=GeneralOrthogonalGroup(+1,2*n,2);
Print("|out| = ",Size(aut)/Size(inn),"\n");
Print("|ort| = ",Size(ort),"\n");
gen_aut:=GeneratorsOfGroup(aut);
gen_ort:=GeneratorsOfGroup(ort);
Print("generators of aut = ",Length(gen_aut),"\n");
Print("generators of ort = ",Length(gen_ort),"\n");

|out| = 348364800
|ort| = 348364800
generators of aut = 10
generators of ort = 3

The size of the two groups (out and ort) matches as expected, but I'm not sure how to proceed from here. How would you define the outer automorphism group in GAP and how would you align its generators to those of the orthogonal group and find the isomorphism.

A: The isomorphism comes from the induced action of the automorphism group on the centre factor. Lets build this, by writing down matrices that describe the action of the automorphisms on a basis of $G/Z$:
gap> z:=Centre(grp);
Group([ f9 ])
gap> pcgs:=ModuloPcgs(grp,z); # like a basis for G/Z
[ f1, f2, f3, f4, f5, f6, f7, f8 ]
gap> mats:=List(GeneratorsOfGroup(aut),x->List(pcgs,
> y->ExponentsOfPcElement(pcgs,Image(x,y))*One(GF(2))));;
gap> mg:=Group(mats);
<matrix group with 10 generators>
gap> Size(mg);
348364800

So now mats are the matrix generators. Of course it is possible that we have chosen a basis that does not fit with the correct form, but we're lucky:
gap> mg=ort;
true

Note that this luck is not promised by the manual. It is possible that if you chose another prime/dimension you get a discrepancy and need to conjugate to get the right form.
You can build the homomorphism as:
gap> hom:=GroupHomomorphismByImages(aut,mg,GeneratorsOfGroup(aut),mats);;
gap> Kernel(hom)=inn;
true

Note that this takes a momentm, as GAP verifies that it is a homomorphism. Use GroupHomomorphismByImagesNC to skip the test.


text:
Q: extract from json object thats converte to array php I try to extract data from an json object.
I mannaged to convert the json object to an array but  i can't extract the data i want
The array and var_dump can be found here http://pastebin.com/f1ujbSCq
if you look in the array at object->object->attributes-attribute
You see values in the object class.
for example i want the the value where the name in the onject class is descr or admin-c,tech-c.
But i can't figer out how to do that
THis is the php code i use to extract data from json object to an array:
$domeinnaam = "2.0.0.0.0.0.0.1.8.6.9.0.2.0.a.2.ip6.arpa";
$ripeinfo = haalripezone($domeinnaam);

var_dump($ripeinfo);
print_r($ripeinfo);

function haalripezone ($domeinnaam)
{

$link = "https://rest.db.ripe.net/ripe/domain/$domeinnaam.json";
$downloadlink = file_get_contents($link);
$result = json_decode($downloadlink);

A: try
  $result = json_decode($downloadlink, true);

This way the decode will be totally put into an array, then accessing the data will be easier

A:
You see values in the object class. for example i want the the value
  where the name in the onject class is descr or admin-c,tech-c.

Since you have already decoded the JSON as an object, You could access your fields like this..
echo $yourObject->objects->attributes->attribute->name; //"prints" admin-c

You could alternatively loop through using a foreach construct..
<?php
$domeinnaam = "2.0.0.0.0.0.0.1.8.6.9.0.2.0.a.2.ip6.arpa";
$ripeinfo = haalripezone($domeinnaam);
echo "<pre>";
foreach($ripeinfo->objects->object[0]->attributes->attribute as $attr)
{
    echo $attr->name."<br>";
}

function haalripezone ($domeinnaam)
{

    $link = "https://rest.db.ripe.net/ripe/domain/$domeinnaam.json";
   //$downloadlink = file_get_contents($link);
    $downloadlink = '{"objects":{"object":[{"type":"domain","link":{"type":"locator","href":"http://rest.db.ripe.net/ripe/domain/2.0.0.0.0.0.0.1.8.6.9.0.2.0.a.2.ip6.arpa"},"source":{"grs-mirror":[],"id":"ripe"},"primary-key":{"attribute":[{"name":"domain","value":"2.0.0.0.0.0.0.1.8.6.9.0.2.0.a.2.ip6.arpa"}]},"attributes":{"attribute":[{"name":"domain","value":"2.0.0.0.0.0.0.1.8.6.9.0.2.0.a.2.ip6.arpa"},{"name":"descr","value":"Reverse delegation for Glue network ipv6 tunnel server"},{"name":"nserver","value":"ns3.hobby.nl"},{"name":"nserver","value":"ns2.hobby.nl"},{"name":"nserver","value":"ns1.hobby.nl"},{"link":{"type":"locator","href":"http://rest.db.ripe.net/ripe/role/HNET2-RIPE"},"name":"admin-c","value":"HNET2-RIPE","referenced-type":"role"},{"link":{"type":"locator","href":"http://rest.db.ripe.net/ripe/role/HNET2-RIPE"},"name":"tech-c","value":"HNET2-RIPE","referenced-type":"role"},{"link":{"type":"locator","href":"http://rest.db.ripe.net/ripe/role/HNET2-RIPE"},"name":"zone-c","value":"HNET2-RIPE","referenced-type":"role"},{"link":{"type":"locator","href":"http://rest.db.ripe.net/ripe/mntner/HOBBYNET-RIPE-MNT"},"name":"mnt-by","value":"HOBBYNET-RIPE-MNT","referenced-type":"mntner"},{"name":"source","value":"RIPE","comment":"Filtered"}]},"tags":{"tag":[]}}]},"terms-and-conditions":{"type":"locator","href":"http://www.ripe.net/db/support/db-terms-conditions.pdf"}}';
    $result = json_decode($downloadlink);
    return $result;
}

OUTPUT :
domain
descr
nserver
nserver
nserver
admin-c
tech-c
zone-c
mnt-by
source

Demo


text:
Q: Find irreducible representations of a reducible representation of $S_4$ Consider the complete graph $K_4$ with $4$ vertices, and choose some orientation for the edges.
The symmetric group $S_4$ acts on the vertices and thereby also induces an action on the (oriented) edges. Since there are $6$ edges, I can say that this gives me a representation $\rho$ of $S_4$ on $\mathbb{Q}^6$.
I don't know much about representation theory, so my question is this:
How do I find the irreducible representations of $\rho$?
Ideas so far: I'm pretty sure that there is no non-zero element of $\mathbb{Q}^6$ which is invariant under this $S_4$-action. This means that $\rho$ has no $1$-dimensional irreducible subrepresentation, correct?
Other than $1$-dimensionals, $S_4$ has one $2$-dimensional irreducible representation and two $3$-dimensionals.
Since $\rho$ is $6$-dimensional, it is therefore either a direct sum of three $2$-dimensional irreducible representations or a direct sum of two $3$-dimensional irreducible representations. But how do I find which it is?
Update/Another idea: The complete graph has the shape of a tetrahedron.
Name the vertices $v_1, \ldots, v_4$ and the edges $a_1, \ldots, a_6$ and fix some orientation of the edges. Let $W \cong \mathbb{Q}^6$ be the space generated by the edges (over $\mathbb{Q}$). Consider the $3$-dimensional space $U_1$ generated by three elements $x_1, x_2, x_3 \in W$, each of which is a sum of three different edges that lie on one of the sides of the tetrahedron. In my case, I've chosen
$$x_1 = a_1 +a_2+a_3, \hspace{2mm} x_2 = a_3+a_4-a_6, \hspace{2mm} x_3 = a_1+a_5-a_6$$
(but I'm guessing the choice shouldn't matter).
Now the $S_4$-action sends sides of the tetrahedron to sides of the tetrahedron.
So this implies that the space $U_1$ is invariant under the $S_4$-action and therefore an irreducible representation.
Similarly, one can define a space $U_2$ generated by three elements $y_1, y_2,y_3 \in W$, each of which is again a sum of three different edges that are incident to one vertex, I'm going to call these the edges of a "cap" of the tetrahedron.
In my case, I've chosen
$$y_1 = a_1-a_2-a_5, \hspace{2mm} y_2 = a_2 -a_3-a_6, \hspace{2mm} y_3=a_4+a_5+a_6$$
(again I guess the choice shouldn't matter).
The $S_4$-action again sends "caps" of the tetrahedron to other "caps", which implies that $U_2$ is invariant under the $S_4$-action and therefore an irreducible representation.
Since $x_1, x_2, x_3, y_1, y_2,y_3$  together form a basis of $W$, it follows that $W= U_1 \oplus U_2$ is a direct sum decomposition into irreducible representations.
By calculating the effect of the elements $id, (1,2), (1,2)(3,4), (1,2,3,4), (1,2,3) \in S_4$ (which represent all conjugacy classes of $S_4$) on $x_1, x_2, x_3$, one finds that the character of this representation $\chi_{U_1}$ corresponds to the character of the product of the standard and sign representation of $S_4$. Therefore the representation of $S_4$ on $U_1$ is the product of the standard and sign representation.
Similarly, one finds that the representation of $S_4$ on $U_2$ is the standard representation.
Could someone comment on the above explanations? Do they make sense?
Edit: The precise edges that I've used above are the following (where $(v_i, v_j)$ denotes the edge directed from vertex $v_i$ toward vertex $v_j$):
$$a_1 = (v_1, v_2), a_2 = (v_2,v_3), a_3 = (v_3, v_1), a_4 = (v_1, v_4), a_5 =(v_2, v_4), a_6=(v_3, v_4)$$

A: Let $V$ be the four-dimensional vector space spanned by the vertices. The six dimensional space spanned by the oriented edges, subject to the convention that flipping the orientation corresponds to multiplying by $-1$ can be viewed as the exterior power $\Lambda^2V$. The general theory of representations of the symmetric group with special emphasis of computing exterior and symmetric powers of representations is described very well in the warmly recommended book 'Representation Theory: A First Course' by Fulton and Harris.
Edited in: yes this makes a lot of sense. I started writing comments about this, but the system threatened to move everything to chat, so I write here. $U_2$ being standard is correct, see last two comments. $U_1$ being standard times sign is also correct. I wasn't sure first that it would actually be a representation at all. That is: I wasn't sure that any group element that maps a certain face to itself would always map the corresponding vector to either itself or its negative and not to one of the other six possibilities. However, after staring a bit at the nice picture you edited in I see that this is indeed the case: your $U_1$ is indeed a representation and then you can use characters as you did to see which one.


text:
Q: Resources error in android studio FAILURE: Build failed with an exception.

*

*What went wrong:
Execution failed for task ':app:processDebugResources'.

Failed to process resources, see aapt output above for details.

*Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

*Get more help at https://help.gradle.org
BUILD FAILED in 4s
above are  the error  i am getting when  i start the project...

A: Options like
1) Select file from a menu, select Invalidate Caches/ Restart.
2) add this lines to your build.gradle
configurations {
 all*.exclude group: 'com.android.support', module: 'support-v4'
}

3) Something is going wrong with your any XML file which contains a non-present key, check your XML files.


text:
Q: Facebook SDK login error "This page isn't available" I'm having a problem with Facebook SDK, when I log in I get the error "This page isn't available", but sometimes I log in successfully. I have searched for answers in many communities but still no results, please help me
// Button

Login Facebook

//JS
(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = "https://connect.facebook.net/en_US/sdk.js";
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

window.fbAsyncInit = function() {

    FB.init({
        appId      : xxx,
        cookie     : true,
        xfbml      : true,
        version    : 'v3.3'
    });

    FB.getLoginStatus(function(response) {
        statusChangeCallback(response);
    });
};

function statusChangeCallback(response) {
    if (response.status === 'connected') {
        console.log('logined!');
    } else {
        console.log('not login!');
    }
}

function checkLoginState() {
    FB.getLoginStatus(function(response) {
        statusChangeCallback(response);
    });
}

Screenshot:


text:
Q: Find and replace entity in xslt i need to find and replace an entity in xslt. i need to do this without using template match.
suppose my xml like this,
<root>

Master's

<blockFixed type="quotation">
let's
</blockFixed>

student's<featureFixed id=1/>

<blockFixed type="quotation">
nurse's
</blockFixed>

Master's

</root>

i need to change ' into ’ so output should be like this,
<root>

Master<apos>’</apos>s

<blockFixed type="quotation">
let<apos>’</apos>s
</blockFixed>

student<apos>’</apos>s<featureFixed id=1/><\p>

<blockFixed type="quotation">
nurse<apos>’</apos>s
</blockFixed>

Master's

</root>

i used the replace method by using template match p but after that i can not able to do any operation on other tags like blockfixed etc,. so pls suggest simple xslt to do this.
i used the following xslt,
  <xsl:template match="p">
    <xsl:copy>
   <xsl:apply-templates select="current()/node()" mode="replace"/>
    </xsl:copy>
  </xsl:template>
     <xsl:template match="text()" mode="replace">
<xsl:call-template name="replace-string">
  <xsl:with-param name="text" select="."/>
  <xsl:with-param name="from">'</xsl:with-param>
  <xsl:with-param name="to" select="'’'"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="replace-string">
<xsl:param name="text"/>
<xsl:param name="from"/>
<xsl:param name="to"/>
<xsl:choose>
    <xsl:when test="contains($text, $from)">
    <xsl:variable name="before" select="substring-before($text, $from)"/>
    <xsl:variable name="after" select="substring-after($text, $from)"/>
    <xsl:variable name="prefix" select="concat($before, $to)"/>
    <xsl:copy-of select="$before"/>
    <Apos>
      <xsl:copy-of select="$to"/>
    </Apos>
    <xsl:call-template name="replace-string">
      <xsl:with-param name="text" select="$after"/>
      <xsl:with-param name="from" select="$from"/>
      <xsl:with-param name="to" select="$to"/>
    </xsl:call-template>
   </xsl:when>
  <xsl:otherwise>
    <xsl:copy-of select="$text"/>
  </xsl:otherwise>
  </xsl:choose>
 </xsl:template>

thanks in advance.

A: The problem is with your template matching the p element
<xsl:template match="p">
  <xsl:copy>
    <xsl:apply-templates select="current()/node()" mode="replace"/>
  </xsl:copy>
</xsl:template>

In particular, you use of mode. Although you are selecting all child nodes of the p element, you have only provided a matching template for text() nodes with a mode of replace. This means all other elements won't get picked out, and so blockFixed is ignored.
Instead, remove the above template matching p from your XSLT, and replace the following line:
<xsl:template match="text()" mode="replace">

With this one
<xsl:template match="p/text()">

This assumes you building upon the identity transform in your XSLT. Here is the abridged version of the XSLT
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="xml" indent="yes"/>

  <xsl:template match="@*|node()">
      <xsl:copy>
          <xsl:apply-templates select="@*|node()"/>
      </xsl:copy>
  </xsl:template>

  <xsl:template match="p/text()">
      <xsl:call-template name="replace-string">
          <xsl:with-param name="text" select="."/>
          <xsl:with-param name="from">'</xsl:with-param>
          <xsl:with-param name="to" select="'&rsquo;'"/>
      </xsl:call-template>
  </xsl:template>

  <xsl:template name="replace-string">
      <xsl:param name="text"/>
      <xsl:param name="from"/>
      <xsl:param name="to"/>
      <xsl:choose>
          <xsl:when test="contains($text, $from)">
            <xsl:variable name="before" select="substring-before($text, $from)"/>
            <xsl:variable name="after" select="substring-after($text, $from)"/>
            <xsl:variable name="prefix" select="concat($before, $to)"/>
            <xsl:copy-of select="$before"/>
            <Apos>
                <xsl:value-of select="$to" disable-output-escaping="yes"/>
            </Apos>
            <xsl:call-template name="replace-string">
                <xsl:with-param name="text" select="$after"/>
                <xsl:with-param name="from" select="$from"/>
                <xsl:with-param name="to" select="$to"/>
            </xsl:call-template>
        </xsl:when>
        <xsl:otherwise>
            <xsl:copy-of select="$text"/>
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>
</xsl:stylesheet>

A: You mention the replace method which is only available in XSLT and XPath 2.0 so I assume that you use an XSLT 2.0 processor? And are you aware that XSLT operates on a data model with plain text nodes with Unicode string values so entity reference are not modeled in that data model. And to enforce a character in the transformation result to be output as an entity reference instead of as a Unicode character you would need to XSLT 2.0 character maps.
So what you can do is process text nodes with analyze-string e.g.
<xsl:template match="p//text()">
  <xsl:analyze-string select="." regex="'">
    <xsl:matching-substring>
       <apos>’</apos>
    </xsl:matching-substring>
    <xsl:non-matching-substring>
       <xsl:value-of select="."/>
    </xsl:non-matching-substring>
  </xsl:analyze-string>
</xsl:template>

to output an apos element with that right quote character ', then you would need to add a character map that ensures such a character is replaced with its entity reference.
And I realize I used a template to solve that, in spite of your request. But all you need to incorporate my suggestion into a more complex stylesheet is doing apply-templates in a template for p elements, so maybe you can do that.


text:
Q: How to compute sin(a * t) from sin(a) and cos(a) As the title says, I have sin(a) and cos(a) and I would like to compute sin(a * t) and cos(a * t), where t is in the closed interval [0, 1].
Is this possible?
EDIT: The comments/answers made me realise I have another restriction I didn't specify in my original question: a is in the closed interval [0, 2*pi]

A: No, this is not possible without added restrictions.
For example, if $a = \frac{\pi}{6}$, then the function $f(t)=\sin(at)$ will be a strictly increasing function from $0$ to $\frac12$:
Plot of the function when $a=\frac\pi6$
while if if $a=2\pi + \frac\pi6$, the function will take both negative and positive values and will not be strictly increasing.
Plot of the function when $a=2\pi + \frac\pi6$
However, $\sin a$ and $\cos a$ will be the same in both cases.

Perhaps even more obvious case comes if you set $a=0$ (in which case, the function $\sin(at)=\sin(0\cdot t) = 0$ is constant) or $a=2\pi$ (in which case, the function is exactly one period of $\sin$, shrunk to $[0,1]$.

However, if you restrict $a$ to $[0,2\pi)$, then the values of $\sin a$, $\cos a$ precisely determine what $a$ is, and you can calculate $a$ as being one of $\arcsin (a), 2\pi + \arcsin (a), \pi - \arcsin(a)$ (depending on the sign of $\cos (a)$). After you calculate $a$, it should be easy to see what $\sin(at)$ is.


text:
Q: Running postgresql in Mac Terminal I have a production SQL dump file that I want to restore to my local psql db for debugging reasons.
I can't access psql via the terminal though pgAdmin3 works just fine. Here is the error I'm getting:
$ psql
psql: could not connect to server: Permission denied
    Is the server running locally and accepting
    connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?

$ locate psql | grep /bin
/Library/PostgreSQL/9.0/bin/psql
/Library/PostgreSQL/versions/9.0.1/bin/psql
/opt/local/bin/psql83
/opt/local/lib/postgresql83/bin/psql
/usr/bin/psql

I tried using sudo, no change. Any Idea why I can't connect w terminal on the mac and then restore the sql db dump locally?
Thanks

A: Try specifying -h localhost as a psql parameter, to connect via tcp/ip rather than a unix socket.
Likely, your psql and postgresql have different ideas of the correct setting for unix_socket_directory. Especially seeing as you have at least two different builds of postgresql installed! You might want to make sure you're using the psql client that corresponds to your postgresql server, since they have different major versions that will have other benefits too. Failing that, you can give a unix socket directory name as the hostname, e.g. psql -h /tmp will look for /tmp/.s.PGSQL.5342.

A: You seem to have no fewer than four psql binaries on your system.
All other things being equal when you type psql in the terminal it will use the first one it finds (probably /usr/bin/psql -- the one that came with OS X).
Make sure you're using the psql command that matches the Postgres server you're running (you can modify your PATH= in the .profile file in your home directory or type the full path to the psql you want to use)


text:
Q: How to enable relationships in PHPMyAdmin? I know very little about MySQL, and PHPMyAdmin, I have am going to make a quiz program in PHP, it will allow the user(s) to create, save and do multiple choice quizzes.
The way in which the tables are currently structured (I'm open to suggestions, if this structure sounds rubbish:) )
I've got 3 tables,
Quizzes containing:
 ID, quiz title and quiz_ID,

Answers containing:
 ID, question_ID, Answer1, Answer2, Answer3, Answer4 and correct answer

Questions containing:
 ID, and the question.

I have absolutle no idea at all where to start in creating relationships to join ip various ID's. I am using PHPMyAdmin, and have looked around, and it says the relationship reature is disabled. So I think the first thing I need to do is enable this feature.
I would be so grateful for any help at all, and please explain it clearly because I'm pretty thick at all this :p
Thanks again in advance :) xx

A: In the structure view of a table you have a link just below the list saying "Relation view".
Also make sure you have indexed the field you want to make relation on

A: Link to tutorial.
It is meant for use on a webserver, but it should help you further. If you can modifiy config.inc.php, you of course don't have to install pma again.
Please note that you can easily join tables using JOIN. See here.


text:
Q: Plotting Multiple Lines for Data Frame I have a data frame that looks like this:
Date          Something    Values
2013-01-01    A            1093
2013-01-01    B            123
2013-01-01    C            4352
2013-01-02    C            13
2013-01-02    B            768
2013-01-02    A            56
2013-01-03    A            37
2013-01-03    C            1033
2013-01-03    B            3
2013-01-04    A            5
....

I would like to plot "Date" on the X axis and "Values" on Y axis for each of "Something".
How can I do that in R?

A: Just write the following:
library(ggplot2)

a<-structure(list(Date = structure(c(15706, 15706, 15706, 15707,
15707, 15707, 15708, 15708, 15708, 15709), class = "Date"), Something = structure(c(1L,
2L, 3L, 3L, 2L, 1L, 1L, 3L, 2L, 1L), .Label = c("A", "B", "C"
), class = "factor"), Values = c(1093L, 123L, 4352L, 13L, 768L,
56L, 37L, 1033L, 3L, 5L)), .Names = c("Date", "Something", "Values"
), row.names = c(NA, -10L), class = "data.frame")

ggplot(a, aes(x=Date, y=Values, color=Something, group=Something)) + geom_line()

where a is your data.frame according to your post. It will look something like:

A: If your intent is to plot a separate line(or character) for each subset on a single chart area, there are a variety of tricks with plyr you can use to organize your data in a useful way.  For simplicity, here's a long way to do it.
Val_A<-dataframe[dataframe$Something=="A",]
Val_B<-dataframe[dataframe$Something=="B",]
Val_C<-dataframe[dataframe$Something=="C",]

(etc)
plot(Val_A$Date,Val_A$Values)
points(Val_B$Date,Val_B$Values,col='red')
points(Val_C$Date,Val_C$Values,col='green')

(etc)
As you can imagine, there are much more compact ways to do this.


text:
Q: How to get several rows from csv file with Powershell I need to be able to copy/paste csv files from one directory to another, to name the first column, and to get only 3 rows of the whole file, and the whole this to be run every 24 hours.
I have already done the first two points copy/paste from one directory to another and name the first column but I struggle to complete the third part. I need only 3 rows of the whole file.
Here it is some code for what I've done so far:
$Src = 'C:\1From'
$Dst = 'C:\2To'
$header = 'Scan'

# Wildcard for filter
$Extension = '*_ALL_Scan_Details.csv'

# Get file objects recursively
Get-ChildItem -Path $Src -Filter $Extension -Recurse |
# Skip directories, because XXXReadMe.txt is a valid directory name
Where-Object {!$_.PsIsContainer} |
    # For each file
    ForEach-Object {
        # Copy file
        Copy-Item -Path $_.FullName -Destination $Dst
    }

# Get file objects recursively
Get-ChildItem -Path $Dst -Filter $Extension -Recurse |
# Skip directories, because XXXReadMe.txt is a valid directory name
Where-Object {!$_.PsIsContainer}

    ForEach-Object {
        # Add header
       (Import-Csv $_.FullName -Delimiter ",") |
       Select-Object -Skip 1 |
       ConvertFrom-CSV -UseCulture -Header $header | export-csv $_.FullName -Delimiter "," -NoTypeInformation
    }

Any help is greatly appreciated! Thanks a lot.

A: this shows one way to get the lines of a file that contain a specified target value. [grin] if you still need the header row, that will always be the 1st item in the original collection - $InStuff[0] for instance.
# fake reading in a text file
#    in real life, use Get-Content
$InStuff = @'
P_1, P_2, P_3, P_4
1, One, Wun, Run
2, Two, Tuu, Item
3, Three, Item, Tree
4, Four, Fo, Pho
5, Item, Five, Phyv
6, Six, Ziks, Psiks
'@ -split [System.Environment]::NewLine

$TargetValue = 'Item'

$InStuff -match $TargetValue

output ...
2, Two, Tuu, Item
3, Three, Item, Tree
5, Item, Five, Phyv

A: This way worked for me. Thanks for your help.
 # Setup source and destination paths
 $Src = 'C:\1From'
 $Dst = 'C:\2To'
 $header = 'Scan'

 # Wildcard for filter
 $Extension = '*_ALL_Details.csv'

 ######################################################
 ########   Copy files from src to dest folder  #######

 # Get file objects recursively
 Get-ChildItem -Path $Src -Filter $Extension -Recurse |
 # Skip directories, because XXXReadMe.txt is a valid directory name
 Where-Object {!$_.PsIsContainer} |
     # For each file
     ForEach-Object {
         # Copy file
         Copy-Item -Path $_.FullName -Destination $Dst -Force
     }

 ##########################################################
 #######  Add Dest files a header and override csv  #######

 # Get file objects recursively
 Get-ChildItem -Path $Dst -Filter $Extension -Recurse |
 # Skip directories, because XXXReadMe.txt is a valid directory name
 Where-Object {!$_.PsIsContainer} |
     ForEach-Object {
         # Add header
        (Import-Csv $_.FullName -Delimiter ",") |
        ConvertFrom-CSV -UseCulture -Header $header | ? Scan -like *Item* | export-
 csv $_.FullName -Delimiter "," -NoTypeInformation
     }


text: Q: Can I start a new Clash of Clans village on my iPhone separate from my account on my iPad? If I download Clash of Clans on my iPhone, can I start a new village despite my account on my iPad? I want to make a village for my younger brother.


text:
Q: How to submit a perforce CL of another user without admin privileges? I don't have admin privileges. Need to test other's change lists and submit them.
Tried changing the owner of the CL but didn't work without admin.
p4 change -U <creator> <CL>
Error in change specification.
Change <CL> can only be updated by user <creator>

Unshelving the original CL, then testing it, will create a duplicate CL. Duplicate CL is submittable but not the original CL.
Are there any ways to submit a perforce change list of another user without admin privileges?

A: Based on documentation I'd say no (see below). The way you are doing it is probably the best way using shelving. Another option would be to have an unstable branch that code is okay to be broken and another user can 'release' after testing to a stable branch.
From my understanding, changelists are owned by the user and not really "transferable" like you want.
From Helix 2020.2 documentation on the p4 change command

The owner of an empty pending changelist (that is, a pending changelist without any files in it) can transfer ownership of the changelist to another existing user either by editing this field, or by using the -U user option.

If you start down the "sharing a workspace" path. Don't.  "It is actively discourages by Perforce Technical Support" and "it is almost never a good idea to share a Perforce client workspace among multiple users" https://community.perforce.com/s/article/3675


text:
Q: How can I get the Methodlist while iterating? I want to iterate through all classes and packages in a special path.
After that, I want to get the MethodList.
In the command window I can use following and it's working fine:
a = ?ClassName;
a.MethodList(X);

Now I separate this into a function:
function s =  befehlsreferenz(path)
s = what(path); % list MATLAB files in folder

for idx = 1:numel(s.classes)
    c = s.classes(idx);
    b = ?c;
    b.MethodList(0);
end
end

I get an error:
Too many outputs requested.  Most likely cause is missing [] around left hand side that has a comma separated list
expansion. Error in  (line 7) b.MethodList(0);
While debugging I can see:
c: 1x1 cell = 'Chapter'
b: empty 0x0 meta.class
Why is b empty? How can I get the methodlist?

1 Edit:
Here is an example class, also not working with it.
classdef TestClass
    %TESTCLASS Summary of this class goes here
    %   Detailed explanation goes here

    properties
    end

    methods
        function [c] = hallo(a)
            c = 1;
        end
    end

end

A: When struggling with operators in Matlab, it's typically the best choice to use the underlying function instead, which is meta.class.fromname(c)
Relevant documentation: http://de.mathworks.com/help/matlab/ref/metaclass.html
Further it seems s.classes(idx); is a cell, use cell indexing: s.classes{idx} ;


text:
Q: Datatrigger appropriately changes the initial property of TextBlock but not after the object changes Issue
When setting datatriggers for my textblock it accepts the default value without issue and changes the foreground appropriately however, when the the value changes it doesn't change colors as one would expect. I looked through a few answers and I should be able to reference the relative-source in someway but it didn't change the result.
XAML Test Code
            <ListBox Name="test" Width="90" Margin="20,0,20,40" MouseDown="TextBlock_MouseDownTest"
                 ScrollViewer.VerticalScrollBarVisibility="Disabled">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <TextBlock Name="dttBlock" Text="{Binding Time}" MouseDown="TextBlock_MouseDownTest">
                        <TextBlock.Style>
                            <Style TargetType="TextBlock">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding Path =Flex}" Value="normal">
                                        <Setter Property="Foreground" Value="Blue" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

MouseDownClickEvent
        private void TextBlock_MouseDownTest(object sender, MouseButtonEventArgs e)
    {
        TimeLord item = (TimeLord) (sender as TextBlock).DataContext;
        var textBlock = sender as TextBlock;

        switch (item.Flex)
        {
            case "off":
                MessageBox.Show("Normal ON");
                item.Flex = "normal";
                break;
            case "normal":
                MessageBox.Show("Flex ON");
                item.Flex = "flex";
                break;
            case "flex":
                MessageBox.Show("OFF");
                item.Flex = "off";
                break;
        }
    }

Prior Implementation and Desired Result
If the person responding doesn't mind, I would like to have a larger discussion on this. The reason I'm using data triggers is because I was having trouble implementing a button that resets all of my listboxitem foregrounds to the default color (Black).
Current XAML Code
            <ListBox Name="friday" Width="90" Margin="20,0,20,40" MouseDown="TextBlock_MouseDown"
                 ScrollViewer.VerticalScrollBarVisibility="Disabled" IsSynchronizedWithCurrentItem="True">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding Time}" MouseDown="TextBlock_MouseDown" />
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

Current C# ButtonClickEvent Code
        private void clear_Click(object sender, RoutedEventArgs e)
    {
        List<System.Windows.Controls.ListBox> weekdays = new List<System.Windows.Controls.ListBox>
            {monday, tuesday, wednesday, jueves, friday};

        for (var i = 0; i < weekdays.Count; i++)
        {
            foreach (TimeLord item in weekdays[i].Items)
            {
                item.Flex = "off";
            }
        }
    }

I have no problems changing the object associated with the listboxitem but I have no way of changing the foreground from the button itself. I can successfully change the foreground by creating an event for when the listboxitem is clicked by using the sender being passed into the event. If there is a way I can access the textbox from the ButtonClick event, that could be an alternative solution to the Datatrigger.
This is a small clip showing off the old implementation and that I can currently change the value of the item.

A: In my TimeLord class I never implemented the INotifyPropertyChanged, after doing so everything worked as I expected it to with the DataTriggers.
TimeLord.cs
public class TimeLord : INotifyPropertyChanged {
protected void OnPropertyChanged(PropertyChangedEventArgs e)
{
    PropertyChangedEventHandler handler = PropertyChanged;
    if (handler != null)
        handler(this, e);
}

public string flex;
public string Flex
{
    get { return flex;}
    set
    {
        flex = value;
        OnPropertyChanged();
    }
}

public string Time
{
    get;
    set;
}

public event PropertyChangedEventHandler PropertyChanged;

[NotifyPropertyChangedInvocator]
public void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
    if (PropertyChanged != null)
    {
        PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    }
}

}

XAML Code Block (It's the same one as before but just to show more than the one trigger type)
<DataTemplate>
                    <TextBlock Name="dttBlock" Text="{Binding Time}" MouseDown="TextBlock_MouseDownTest">
                        <TextBlock.Style>
                            <Style TargetType="TextBlock">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding Path =Flex}" Value="normal">
                                        <Setter Property="Foreground" Value="Blue" />
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding Path =Flex}" Value="flex">
                                        <Setter Property="Foreground" Value="Red" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                </DataTemplate>


text:
Q: SASS: "Autosave" imports of partials? Novice web dev here getting set up with SASS for the first time. Currently using Grunt to compile my css from a main SASS file.
So I have three files:
//main.css
/*some css*/

//main.scss
@import 'header';

//_header.scss
/* some sass */

When I edit and save the _header.scss file, I also have to save the main.scss file. Only then will gulp compile changes in the main.css file.
Is there a way to "autosave" every file that contains an import of a partial?

A: Based on what your providing I am thinking it has something to do with your main.css stuff at the top of your file. I am assuming that you have actual css below that comment in the real file?
Best practice is to @import everything at the top of the file before you do anything else.
If that is exactly what you have in the real file then it might be with how your running grunt.. Would you be able to provide your grunt config file please?


text:
Q: Azure SQL Data Sync: Can you set up a sync that does not replicate deletes? I want to have 2 Azure Databases. One will act as an exact replica of an offsite database. That database will regularly purge data that becomes stale.
I would like to have a second database (i.e. Archive Database) which replicates the all Inserts and Updates that happen in the first database but does not replicate the DELETE transactions since I would like to continue to have an archive of those records.
Is Azure Data Sync the right solution to facilitate this and does it provide a way to perform a one way sync that excludes DELETE transactions? If not is this something that can be facilitated in another way (i.e. A complete one way sync with DELETE permission on that database table omitted)

A: Data Sync will not work for this scenario.
You might be able to use temporal tables and it's historical data retention functionality linked below.
https://learn.microsoft.com/en-us/azure/sql-database/sql-database-temporal-tables
Have you considered taking point in time restores of the database before the deletes?
Josh


text:
Q: How to connect php code to database table I am editing a laravel project and I would like to add a signature feature. I have this code down below that is mobile responsive. But I couldn't figure out how to connect it to an existing
Lets say for example that server name: localhost. username: db_test. password:db123. database name:db_test
the table I want to insert it in is $booking->signature.
<?php
if(isset($_POST['signaturesubmit'])){
    $signature = $_POST['signature'];
    $signatureFileName = uniqid().'.png';
    $signature = str_replace('data:image/png;base64,', '', $signature);
    $signature = str_replace(' ', '+', $signature);
    $data = base64_decode($signature);
    $file = 'signatures/'.$signatureFileName;
    file_put_contents($file, $data);
    $msg = "
Signature Uploaded
";
}
?>

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">

                <?php echo isset($msg)?$msg:''; ?>

Sign Here

                <button type="button" class="btn btn-danger" id="reset-btn">Clear</button>
                <button type="button" class="btn btn-success" id="btn-save">Save</button>

            <form id="signatureform" action="" style="display:none" method="post">
                <input type="hidden" id="signature" name="signature">
                <input type="hidden" name="signaturesubmit" value="1">
            </form>

A: You have to set the DB credentials in .env file. It's in the root of your project. If it does not exists, you can rename .env.example and make changes to it.
Based on your code (interaction with database in view is not standard in an MVC framework, atleast), I think it's better to get familiar with laravel first. There are a lot resources to learn it.


text:
Q: Filtering a string list with logic? I have a list of strings. I need to be able to filter them in a similar way to a Google query.
Ex: NOT water OR (ice AND "fruit juice")
Meaning return strings that do not have the word water or return strings that can have water if they have ice and "fruit juice".
Is there a mechanism in .NET that can allow the user to write queries in this form (say in a textbox) and given a List or IEnumerable of string, return the ones that contain this.
Can LINQ maybe do something like this?
I am aware that I can do this with LINQ, I'm more concerned with parsing an arbitrary string into an executable expression.

A: There is nothing built in.
You will need to parse such a string yourself and possibly use the Expression classes to build up an executable expression from which to filter.

A: For this query: Meaning return strings that do not have the word water or return strings that can have water if they have ice and "fruit juice".
Try something like this if you are going to use LINQ
 yourList.Where(i => !i.Contains("water") ||
                (i.Contains("water") &&
                 i.Contains("ice") &&
                 i.Contains("fruit juice")));

A: In LINQ: list.Where(item => !item.Contains("water") || (item.Contains("ice") && item.Contains("fruit juice")))

A: I think we can't answer you using a code sample since as you said this is more logical.
what I would do in such a scenario is to have predefined conditions (saved somewhere) which will contain all the conditions you need along with their "coding translations" like:

*

*and

*or

*and not

*and or

*etc...

and what you will do at runtime is to translate these conditions/criteria into sql or linq or whatever language you need to pass it to.

A: You can try to use the DataTable.Select method:
public static class ExpressionExtensions {

  public static IEnumerable<T> Select<T>(this IEnumerable<T> self, string expression) {
    var table = new DataTable();
    table.Columns.Add("Value", typeof(T));

    foreach (var item in self) {
      var row = table.NewRow();
      row["Value"] = item;
      table.Rows.Add(item);
    }

    return table.Select(expression).Select(row => (T)row["Value"]);
  }

}

But you have to follow its format to create your expression:
var filtered = strings.Select("NOT Value LIKE '*water*' OR (Value LIKE '*ice*' AND Value LIKE '*fruit juice*')");

Also note that in this case, since the string fruit juice already contains the string ice, the second condition is redundant. You'd have to find a way to express "words" and not "substrings".
In the end, you might be better off implementing the parsing logic yourself.


text:
Q: 'npm install websocket' dying on push I am trying to setup a WebSocket example on dotcloud... but I can't get a WS library to install with NPM. Here is my package.json:
{
    "name": "wsdemo",
    "version": "1.0.0",
    "dependencies": {
        "websocket": ""
    }
}

When I call dotcloud push myappname it errors saying that the websocket lib requires a newer version of Node to be installed. How can I get around this?

A: Add the version number 1.0.6 to the version of websockets and it will work.
{
    "name": "wsdemo",
    "version": "1.0.0",
    "dependencies": {
        "websocket": "1.0.6"
    }
}


text:
Q: Can't open web browser using selenium chromedriver on windows 10 I'm trying to open a web browser using Selenium Chromedriver on Windows 10 with python in jupyter notebooks through an ubuntu command prompt. I've read stack overflow posts and tried to solve based on their answers, but I'm stuck in a loop where I keep receiving the same 3 errors.
Here is what I have installed:

OS - Windows 10, 1709, 64-bit Selenium - 3.8.1 Chromedriver - 2.45
  Chrome - Version 71.0.3578.98 Python - 3.5.2

I tried various websites. The goal is to eventually get to a social media login page, but i'm stuck at opening a new blank web browser.
Here is my starting code:
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://www.imdb.com/")

WebDriverException: Message: 'chromedriver' executable may have wrong
  permissions.

Then I tried the following:
from selenium import webdriver
chromedriver = "C:/Users/xxxx/AppData/Local/lxss/home/xxxx/chromedriver.exe"
browser = webdriver.Chrome(chromedriver)
browser.get('https://www.imdb.com/')

WebDriverException: Message: 'chromedriver.exe' executable needs to be
  in PATH.

Here are the steps I have taken:

*

*I added a PATH under environment variables to the folder - (C:\Users\xxxxx\AppData\Local\lxss\home\xxxx),

*I tried using \, and /, and even \

*Once I added the PATH, I tried the following two codes (and various versions) and received the same error:

A.
from selenium import webdriver
driver = webdriver.Chrome(executable_path=r'C:\Users\xxxx\AppData\Local\lxss\home\xxxx)
driver.get("https://www.imdb.com/")

B.
from selenium import webdriver
chromedriver = r'C:\Users\xxxx\AppData\Local\lxss\home\xxxx\chromedriver.exe'
driver = webdriver.Chrome(chromedriver)
driver.get("https://www.imdb.com/")

WebDriverException: Message:
  'C:\Users\xxxx\AppData\Local\lxss\home\xxxx' executable may have wrong
  permissions.

Then I did the following:
- Went to file Properties, under General, took off Read-only (Windows permissions)
- Went to file Properties, under Security and changed permissions to Full Control
- In the C:\Users\xxxxx\AppData\Local\lxss\home\xxxx file, I changed the permissions
using chmod 777 -R in my command prompt. Then I tried the following code:
from selenium import webdriver
import os
chromedriver = r'C:\Users\xxxx\AppData\Local\lxss\home\xxxx\chromedriver.exe'
driver = webdriver.Chrome(os.path.join(os.getcwd(), 'chromedriver.exe'))
driver.get("https://www.imdb.com/")

WebDriverException: Message: Service /home/ariggs/chromedriver.exe
  unexpectedly exited. Status code was: 1

I am stuck between these three error messages. Does anyone have another suggestion for a beginner?

A: You can actually start Windows executables from a linux subsystem as it is described here https://learn.microsoft.com/en-us/windows/wsl/interop.
But you have to keep in mind that Selenium and ChromeDriver communicate over a network connection. Actually chromedriver starts its own http server and Selenium sends requests and receives responses over http. (see https://sqa.stackexchange.com/questions/28358/how-does-chromedriver-exe-work-on-a-core-and-fundamental-level)
According to Microsoft, WSL and Windows share the same IP address and network connections via localhost are supported. But in your case there seems to be a problem during the startup.
You can start a remote webdriver on windows with Python and connect to that.
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
import subprocess

subprocess.run(["d:\\develop\\remotewebdriver.cmd", ""])

driver = webdriver.Remote(
   command_executor='http://localhost:4444/wd/hub',
   desired_capabilities=DesiredCapabilities.CHROME)
driver.get('http://www.google.in/')

driver.close()

You need a windows script remotewebdriver.cmd for the remote webdriver that is called from Python:
SET JAVA_HOME=D:\develop\Java\jdk-11.0.2
d:
cd \develop
start D:\develop\Java\jdk-11.0.2\bin\java -Dwebdriver.chrome.driver=d:\develop\chromedriver.exe -jar selenium-server-standalone-3.141.59.jar

You have to adapt the path to your own environment. This setup works for me.

A: You can do this way.
Step 1:
Download chrome driver from this link (download the specific version as chrome):
http://chromedriver.chromium.org/downloads
Important: check your chrome version first. Go to help -> about Google Chrome, to see the version of your chrome.
Step 2:
After downloading extract and save the chromedriver file in a specific folder like, C:\selenium
go to environment variable and add a new path, C:\selenium
Step 3
Double click on the chromedriver application and then restart your command prompt. (If you are using conda environment.)


text:
Q: Delete Rows based on Date criteria from second sheet and Paste in New Rows from third sheet ok i'm new to macros but I'm decent at understanding so have gotten a fair amount of simple stuff done recently.  mostly off amending recorded macros.
let me explain my file. i don't know how to add spaces or borders in here and i just spent like 10 minutes googling that.  anyway, there are 3 columns: Report Date, Section, and CUSIP.
Sheet 2
Report Date | Section       | CUSIP
-----------------------------------
8/30/2019   | US Sales      | XYZ
8/30/2019   | US Sales      | ABC
8/30/2019   | Foreign Sales | 123
8/30/2019   | Foreign Sales | 456
8/30/2019   | Foreign Sales | 789
8/30/2019   | Foreign Sales | 1011
7/30/2019   | Foreign Sales | 1213
7/30/2019   | US Sales      | EFG
7/30/2019   | US Sales      | HIJ
7/30/2019   | US Sales      | KLM
7/30/2019   | US Sales      | NO14
7/30/2019   | Foreign Sales | 1516P

In cell A1 of Sheet_1, there is a Date i want to reference to.
For this example, let's say Sheet_1 A1 = 9/30/2019.
Now, i need the macro to look at the data in Sheet_2 Column A and delete every single row that has a date older than my reference Date by at least two months.
So, if my reference date in Sheet_1 A1 is 9/30/2019, then I need every line deleted on Sheet_2 that has the date of 7/29/2019 or before that.
There are thousands of rows of data. So, what would be the most efficient way of doing this?
Also, each month's data will likely be blocked together in groups...meaning i won't have alternating rows of one month to another.
Essentially, this is just removing data that is 2 months old from the sheet.
After it's done with that, i need the macro to go to Sheet_3, and copy the data from row 2, until the last row that has data in it.  next, it then pastes values into the first blank row of data in Sheet_2.
Hopefully that is clear.  Basically, in other words, I have a sheet that has two months of data in it.  As indicated by the Date in column A.  Each month, I need to go to this sheet, remove the data that is two months old, and paste in the data that is new (aka the value in cell A1 of Sheet_1).
any help is appreciated

A: We'll see if we got the details right...
I would probably only test this on a copy of your real Workbook...
(I am sure it is obvious to you as well, but I Just Couldn't Not Say It.)
So here it is:
Option Explicit ' I Wouldn't go without this...
' It will demand you to declare every variable you use.
' ... without that you may not know why you are having problems...

Sub DataHandling()
    Dim Number_Of_Days_To_Keep As Integer
    Dim Reference_Date_Sht_Name As String
    Dim Data_Store_Sheet_Name As String
    Dim New_Data_Sheet_Name As String

    '-------------------------------------------------------------------------------
    ' Set the number of days, of which data you want to keep...
    Number_Of_Days_To_Keep = 60

    ' Set Sheet Names
    Reference_Date_Sht_Name = "Sheet1"
    Data_Store_Sheet_Name = "Sheet2"
    New_Data_Sheet_Name = "Sheet3"
    '-------------------------------------------------------------------------------

    ' Set Reference Variable to your Workbook
    Dim WB As Workbook
    Set WB = Application.ActiveWorkbook

    ' Set Reference Variables to Worksheets
    Dim RefDateSht As Worksheet
    Dim DataStoreSht As Worksheet
    Dim NewDataSht As Worksheet
    Set RefDateSht = WB.Worksheets(Reference_Date_Sht_Name)
    Set DataStoreSht = WB.Worksheets(Data_Store_Sheet_Name)
    Set NewDataSht = WB.Worksheets(New_Data_Sheet_Name)

    ' Reference Date from Reference Date Sheet
    Dim RefDate As Date
    RefDate = CDate(RefDateSht.Cells(1, "A").Value)

    ' Calculate Cut Off Date from Reference Date and Number Of Days To Keep
    Dim CutOffDate As Date
    CutOffDate = DateAdd("d", -(Number_Of_Days_To_Keep + 1), RefDate)

    ' Last DataStore Row and the DataStore Range
    Dim LastDSRow As Long
    Dim DSRng As Range
    LastDSRow = DataStoreSht.Cells(DataStoreSht.Rows.Count, 1).End(xlUp).Row
    Set DSRng = DataStoreSht.Range(DataStoreSht.Cells(2, "A"), DataStoreSht.Cells(LastDSRow, "X"))

    ' Last NewData Row and the NewData Range
    Dim LastNDRow As Long
    Dim NDRng As Range
    LastNDRow = NewDataSht.Cells(NewDataSht.Rows.Count, 1).End(xlUp).Row
    Set NDRng = NewDataSht.Range(NewDataSht.Cells(2, "A"), NewDataSht.Cells(LastNDRow, "X"))

    ' Support Reference Variables
    Dim Celll As Range
    Dim FirstCutOffCell As Range

    ' Let's see if the Cut Off Date exists in Column 1 of DataStoreSht ...
    Set FirstCutOffCell = DSRng.Columns(1).Cells.Find(What:=Format(CutOffDate, "m/dd/yy"), LookIn:=xlFormulas, Lookat:=xlWhole, SearchDirection:=xlNext)
    If FirstCutOffCell Is Nothing Then
        ' ... if it does not, then check every Row until the Cut Off point is found
        For Each Celll In DSRng.Columns(1).Cells
            If Celll.Value < CutOffDate Then
                Set FirstCutOffCell = Celll
                Exit For
            End If
        Next
    End If

    ' -----------------------------------------------------------------------------------------------------------------------------------
    ' Delete the block of lines which have date before the Cut Off date
    ' -----------------------------------------------------------------------------------------------------------------------------------
    If Not FirstCutOffCell Is Nothing Then
        With DataStoreSht
            .Rows(FirstCutOffCell.Row & ":" & LastDSRow).EntireRow.Delete
            LastDSRow = .Cells(DataStoreSht.Rows.Count, 1).End(xlUp).Row
            Set DSRng = .Range(DataStoreSht.Cells(2, 1), DataStoreSht.Cells(LastDSRow, 3))
        End With
    End If

    ' -----------------------------------------------------------------------------------------------------------------------------------
    ' If there is any New Data on NewDataSht then ...
    ' -----------------------------------------------------------------------------------------------------------------------------------
    If LastNDRow > 1 Then
        ' ... move New Data from NewDataSht to Second Line of DataStoreSht by shifting existing data down.
        NDRng.Copy
        DataStoreSht.Rows(2).EntireRow.Insert Shift:=xlDown
        Application.CutCopyMode = False
    End If
End Sub