Is there a max limit of code rows quantity inside doPost() in servlet?

Question: I have an Android application which connects to a Servlet.
Lately when I try to add code rows to the doPost() in the servlet (Almost all the program is written inside this method), and try to run the
tomcat server I get the next error:
<code>    0006a90: 00a4 b601 9519 14b6 0198 1914 b601 9ba7
    0006aa0: 007d 192c 1306 b5b6 0110 9900 69bb 0095
    0006ab0: 5913 019c b700 9919 04b6 00a0 b600 a43a
    0006ac0: 19b2 008f bb00 9559 1301 a0b7 0099 1919
    0006ad0: b600 a0b6 00a4 b600 a52a b406 a919 19b9
    0006ae0: 0165 0200 3a0e 190e 04b9 01a2 0200 190e
    0006af0: 03b9 01a6 0200 b200 8f13 06b7 b600 a519
    0006b00: 0eb9 01ad 0100 57b2 008f 1306 b9b6 00a5
    0006b10: a700 0cb2 008f 1306 bbb6 00a5 2a13 014c
    0006b20: b801 4eb5 06bd b200 8f13 01b4 b600 a513
    0006b30: 01b6 3a17 2ab4 06bd 1917 b901 6502 003a
    0006b40: 0e19 0eb9 016b 0100 3a16 1916 b901 7101
    0006b50: 0057 b200 8f13 06bf b600 a52a 1916 04b9
    0006b60: 0183 0200 b501 bab2 008f 1306 c1b6 00a5
    0006b70: b200 8fbb 0095 5913 01be b700 992a b401
    0006b80: bab6 00a0 b600 a4b6 00a5 b200 8f13 01c0
    0006b90: b600 a513 01c2 3a17 2ab4 06bd 1917 b901
    0006ba0: 6502 003a 0e19 0eb9 01c4 0100 57a7 014a
    0006bb0: 3a2c b200 8fbb 0095 5913 06c3 b700 9919
    0006bc0: 2cb6 01c9 b600 a0b6 00a4 b600 a5b2 008f
    0006bd0: 1306 c5b6 00a5 1916 c600 0a19 16b9 01ce
    0006be0: 0100 b200 8f13 06c7 b600 a519 0ec6 000a
    0006bf0: 190e b901 cf01 00b2 008f 1306 c9b6 00a5
    0006c00: 2ab4 06a9 c600 0c2a b406 a9b9 01d0 0100
    0006c10: b200 8fbb 0095 5913 06cb b700 992a b406
    0006c20: a9b9 01d3 0100 b601 d6b6 00a4 b600 a52a
    0006c30: b406 bdc6 000c 2ab4 06bd b901 d001 00b2
    0006c40: 008f bb00 9559 1306 cdb7 0099 2ab4 06bd
    0006c50: b901 d301 00b6 01d6 b600 a4b6 00a5 a716
    0006c60: 343a 2db2 008f 1306 c5b6 00a5 1916 c600
    0006c70: 0a19 16b9 01ce 0100 b200 8f13 06c7 b600
    0006c80: a519 0ec6 000a 190e b901 cf01 00b2 008f
    0006c90: 1306 c9b6 00a5 2ab4 06a9 c600 0c2a b406
    0006ca0: a9b9 01d0 0100 b200 8fbb 0095 5913 06cb
    0006cb0: b700 992a b406 a9b9 01d3 0100 b601 d6b6
    0006cc0: 00a4 b600 a52a b406 bdc6 000c 2ab4 06bd
    0006cd0: b901 d001 00b2 008f bb00 9559 1306 cdb7
    0006ce0: 0099 2ab4 06bd b901 d301 00b6 01d6 b600
    0006cf0: a4b6 00a5 192d bfb2 008f 1306 c5b6 00a5
    0006d00: 1916 c600 0a19 16b9 01ce 0100 b200 8f13
    0006d10: 06c7 b600 a519 0ec6 000a 190e b901 cf01
    0006d20: 00b2 008f 1306 c9b6 00a5 2ab4 06a9 c600
    0006d30: 0c2a b406 a9b9 01d0 0100 b200 8fbb 0095
    0006d40: 5913 06cb b700 992a b406 a9b9 01d3 0100
    0006d50: b601 d6b6 00a4 b600 a52a b406 bdc6 000c
    0006d60: 2ab4 06bd b901 d001 00b2 008f bb00 9559
    0006d70: 1306 cdb7 0099 2ab4 06bd b901 d301 00b6
    0006d80: 01d6 b600 a4b6 00a5 a715 0a2a 04b5 0076
    0006d90: b200 8f13 06cf b600 a513 06d1 3a04 2a13
    0006da0: 014c b801 4eb5 06d3 2d12 e615 1504 60b6
    0006db0: 0262 361c 2d15 1504 6015 1cb6 00ec 3a2c
    0006dc0: b200 8fbb 0095 5913 06d5 b700 9919 2cb6
    0006dd0: 00a0 b600 a4b6 00a5 192c 1306 adb6 0110
    0006de0: 9900 8013 06af 3a17 2ab4 06d3 1917 b901
    0006df0: 6502 003a 0e19 0eb9 016b 0100 3a16 1916
    0006e00: b901 7101 0057 1916 04b9 0177 0200 b806
    0006e10: b13a 18b2 008f bb00 9559 1306 d7b7 0099
    0006e20: 1918 b600 a0b6 00a4 b600 a5bb 00df 592c
    0006e30: b900 b101 00b7 00e1 3a14 1914 bb00 9559
    0006e40: 1918 b803 e6b7 0099 12e6 b600 a0b6 00a4
    0006e50: b601 9519 14b6 0198 1914 b601 9ba7 0088
    0006e60: 192c 1306 b5b6 0110 9a00 0e19 2c13 06d9
    0006e70: b601 1099 0069 bb00 9559 1301 9cb7 0099
    0006e80: 1904 b600 a0b6 00a4 3a19 b200 8fbb 0095
    0006e90: 5913 01a0 b700 9919 19b6 00a0 b600 a4b6
    0006ea0: 00a5 2ab4 06d3 1919 b901 6502 003a 0e19
    0006eb0: 0e04 b901 a202 0019 0e03 b901 a602 00b2
    0006ec0: 008f 1306 dbb6 00a5 190e b901 ad01 0057
    0006ed0: b200 8f13 06dd b600 a5a7 000c b200 8f13
    0006ee0: 06df b600 a52a 1301 4cb8 014e b506 e1b2
    0006ef0: 008f 1301 b4b6 00a5 1301 b63a 172a b406
    0006f00: e119 17b9 0165 0200 3a0e 190e b901 6b01
    0006f10: 003a 1619 16b9 0171 0100 57b2 008f 1305
    0006f20: 90b6 00a5 2a19 1604 b901 8302 00b5 01ba
    0006f30: b200 8f13 06e3 b600 a5b2 008f bb00 9559
    0006f40: 1301 beb7 0099 2ab4 01ba b600 a0b6 00a4
    0006f50: b600 a5b2 008f 1301 c0b6 00a5 1301 c23a
    0006f60: 172a b406 e119 17b9 0165 0200 3a0e 190e
    0006f70: b901 c401 0057 a701 4a3a 2cb2 008f bb00
    0006f80: 9559 1306 e5b7 0099 192c b601 c9b6 00a0
    0006f90: b600 a4b6 00a5 b200 8f13 06e7 b600 a519
    0006fa0: 16c6 000a 1916 b901 ce01 00b2 008f 1306
    0006fb0: e9b6 00a5 190e c600 0a19 0eb9 01cf 0100
    0006fc0: b200 8f13 06eb b600 a52a b406 d3c6 000c
    0006fd0: 2ab4 06d3 b901 d001 00b2 008f bb00 9559
    0006fe0: 1306 edb7 0099 2ab4 06d3 b901 d301 00b6
    0006ff0: 01d6 b600 a4b6 00a5 2ab4 06e1 c600 0c2a
    0007000: b406 e1b9 01d0 0100 b200 8fbb 0095 5913
    0007010: 06ef b700 992a b406 e1b9 01d3 0100 b601
    0007020: d6b6 00a4 b600 a5a7 126b 3a2d b200 8f13
    0007030: 06e7 b600 a519 16c6 000a 1916 b901 ce01
    0007040: 00b2 008f 1306 e9b6 00a5 190e c600 0a19
    0007050: 0eb9 01cf 0100 b200 8f13 06eb b600 a52a
    0007060: b406 d3c6 000c 2ab4 06d3 b901 d001 00b2
    0007070: 008f bb00 9559 1306 edb7 0099 2ab4 06d3
    0007080: b901 d301 00b6 01d6 b600 a4b6 00a5 2ab4
    0007090: 06e1 c600 0c2a b406 e1b9 01d0 0100 b200
    00070a0: 8fbb 0095 5913 06ef b700 992a b406 e1b9
    00070b0: 01d3 0100 b601 d6b6 00a4 b600 a519 2dbf
    00070c0: b200 8f13 06e7 b600 a519 16c6 000a 1916
    00070d0: b901 ce01 00b2 008f 1306 e9b6 00a5 190e
    00070e0: c600 0a19 0eb9 01cf 0100 b200 8f13 06eb
    00070f0: b600 a52a b406 d3c6 000c 2ab4 06d3 b901
    0007100: d001 00b2 008f bb00 9559 1306 edb7 0099
    0007110: 2ab4 06d3 b901 d301 00b6 01d6 b600 a4b6
    0007120: 00a5 2ab4 06e1 c600 0c2a b406 e1b9 01d0
    0007130: 0100 b200 8fbb 0095 5913 06ef b700 992a
    0007140: b406 e1b9 01d3 0100 b601 d6b6 00a4 b600
    0007150: a5a7 1141 2a04 b500 76b2 008f 1306 f1b6
    0007160: 00a5 2a13 014c b801 4eb5 06f3 1306 f53a
    0007170: 04bb 0095 5913 019c b700 9919 04b6 00a0
    0007180: b600 a43a 19b2 008f bb00 9559 1301 a0b7
    0007190: 0099 1919 b600 a0b6 00a4 b600 a52a b406
    00071a0: f319 19b9 0236 0200 3a0d 190d b902 3a01
    00071b0: 0057 2a13 014c b801 4eb5 06f7 b200 8f13
    00071c0: 01b4 b600 a513 01b6 3a17 2ab4 06f7 1917
    00071d0: b901 6502 003a 0e19 0eb9 016b 0100 3a16
    00071e0: 1916 b901 7101 0057 b200 8f13 06f9 b600
    00071f0: a52a 1916 04b9 0183 0200 b501 bab2 008f
    0007200: 1306 fbb6 00a5 b200 8fbb 0095 5913 01be
    0007210: b700 992a b401 bab6 00a0 b600 a4b6 00a5
    0007220: b200 8f13 01c0 b600 a513 01c2 3a17 2ab4
    0007230: 06f7 1917 b901 6502 003a 0e19 0eb9 01c4
    0007240: 0100 57a7 014a 3a2c b200 8fbb 0095 5913
    0007250: 06fd b700 9919 2cb6 01c9 b600 a0b6 00a4
    0007260: b600 a5b2 008f 1306 ffb6 00a5 1916 c600
    0007270: 0a19 16b9 01ce 0100 b200 8f13 0701 b600
    0007280: a519 0ec6 000a 190e b901 cf01 00b2 008f
    0007290: 1307 03b6 00a5 2ab4 06f3 c600 0c2a b406
    00072a0: f3b9 01d0 0100 b200 8fbb 0095 5913 0705
    00072b0: b700 992a b406 f3b9 01d3 0100 b601 d6b6
    00072c0: 00a4 b600 a52a b406 f7c6 000c 2ab4 06f7
    00072d0: b901 d001 00b2 008f bb00 9559 1307 07b7
    00072e0: 0099 2ab4 06f7 b901 d301 00b6 01d6 b600
    00072f0: a4b6 00a5 a70f 9e3a 2db2 008f 1306 ffb6
    0007300: 00a5 1916 c600 0a19 16b9 01ce 0100 b200
    0007310: 8f13 0701 b600 a519 0ec6 000a 190e b901
    0007320: cf01 00b2 008f 1307 03b6 00a5 2ab4 06f3
    0007330: c600 0c2a b406 f3b9 01d0 0100 b200 8fbb
    0007340: 0095 5913 0705 b700 992a b406 f3b9 01d3
    0007350: 0100 b601 d6b6 00a4 b600 a52a b406 f7c6
    0007360: 000c 2ab4 06f7 b901 d001 00b2 008f bb00
    0007370: 9559 1307 07b7 0099 2ab4 06f7 b901 d301
    0007380: 00b6 01d6 b600 a4b6 00a5 192d bfb2 008f
    0007390: 1306 ffb6 00a5 1916 c600 0a19 16b9 01ce
    00073a0: 0100 b200 8f13 0701 b600 a519 0ec6 000a
    00073b0: 190e b901 cf01 00b2 008f 1307 03b6 00a5
    00073c0: 2ab4 06f3 c600 0c2a b406 f3b9 01d0 0100
    00073d0: b200 8fbb 0095 5913 0705 b700 992a b406
    00073e0: f3b9 01d3 0100 b601 d6b6 00a4 b600 a52a
    00073f0: b406 f7c6 000c 2ab4 06f7 b901 d001 00b2
    0007400: 008f bb00 9559 1307 07b7 0099 2ab4 06f7
    0007410: b901 d301 00b6 01d6 b600 a4b6 00a5 a70e
    0007420: 742a 04b5 0076 b200 8f13 0709 b600 a52a
    0007430: 1301 4cb8 014e b507 0b13 070d 3a04 bb00
    0007440: 9559 1301 9cb7 0099 1904 b600 a0b6 00a4
    0007450: 3a19 b200 8fbb 0095 5913 01a0 b700 9919
    0007460: 19b6 00a0 b600 a4b6 00a5 2ab4 070b 1919
    0007470: b902 3602 003a 0d19 0db9 023a 0100 572a
    0007480: 1301 4cb8 014e b507 0fb2 008f 1301 b4b6
    0007490: 00a5 1301 b63a 172a b407 0f19 17b9 0165
    00074a0: 0200 3a0e 190e b901 6b01 003a 1619 16b9
    00074b0: 0171 0100 57b2 008f 1307 11b6 00a5 2a19
    00074c0: 1604 b901 8302 00b5 01ba b200 8f13 0713
    00074d0: b600 a5b2 008f bb00 9559 1301 beb7 0099
    00074e0: 2ab4 01ba b600 a0b6 00a4 b600 a5b2 008f
    00074f0: 1301 c0b6 00a5 1301 c23a 172a b407 0f19
    0007500: 17b9 0165 0200 3a0e 190e b901 c401 0057
    0007510: a701 4a3a 2cb2 008f bb00 9559 1307 15b7
    0007520: 0099 192c b601 c9b6 00a0 b600 a4b6 00a5
    0007530: b200 8f13 0717 b600 a519 16c6 000a 1916
    0007540: b901 ce01 00b2 008f 1307 19b6 00a5 190e
    0007550: c600 0a19 0eb9 01cf 0100 b200 8f13 071b
    0007560: b600 a52a b407 0bc6 000c 2ab4 070b b901
    0007570: d001 00b2 008f bb00 9559 1307 1db7 0099
    0007580: 2ab4 070b b901 d301 00b6 01d6 b600 a4b6
    0007590: 00a5 2ab4 070f c600 0c2a b407 0fb9 01d0
    00075a0: 0100 b200 8fbb 0095 5913 071f b700 992a
    00075b0: b407 0fb9 01d3 0100 b601 d6b6 00a4 b600
    00075c0: a5a7 0cd1 3a2d b200 8f13 0717 b600 a519
    00075d0: 16c6 000a 1916 b901 ce01 00b2 008f 1307
    00075e0: 19b6 00a5 190e c600 0a19 0eb9 01cf 0100
    00075f0: b200 8f13 071b b600 a52a b407 0bc6 000c
    0007600: 2ab4 070b b901 d001 00b2 008f bb00 9559
    0007610: 1307 1db7 0099 2ab4 070b b901 d301 00b6
    0007620: 01d6 b600 a4b6 00a5 2ab4 070f c600 0c2a
    0007630: b407 0fb9 01d0 0100 b200 8fbb 0095 5913
    0007640: 071f b700 992a b407 0fb9 01d3 0100 b601
    0007650: d6b6 00a4 b600 a519 2dbf b200 8f13 0717
    0007660: b600 a519 16c6 000a 1916 b901 ce01 00b2
    0007670: 008f 1307 19b6 00a5 190e c600 0a19 0eb9
    0007680: 01cf 0100 b200 8f13 071b b600 a52a b407
    0007690: 0bc6 000c 2ab4 070b b901 d001 00b2 008f
    00076a0: bb00 9559 1307 1db7 0099 2ab4 070b b901
    00076b0: d301 00b6 01d6 b600 a4b6 00a5 2ab4 070f
    00076c0: c600 0c2a b407 0fb9 01d0 0100 b200 8fbb
    00076d0: 0095 5913 071f b700 992a b407 0fb9 01d3
    00076e0: 0100 b601 d6b6 00a4 b600 a5a7 0ba7 2a04
    00076f0: b500 76b2 008f 1307 21b6 00a5 2a13 014c
    0007700: b801 4eb5 0723 1307 253a 04bb 0095 5913
    0007710: 019c b700 9919 04b6 00a0 b600 a43a 19b2
    0007720: 008f bb00 9559 1301 a0b7 0099 1919 b600
    0007730: a0b6 00a4 b600 a52a b407 2319 19b9 0236
    0007740: 0200 3a0d 190d b902 3a01 0057 2a13 014c
    0007750: b801 4eb5 0727 b200 8f13 01b4 b600 a513
    0007760: 01b6 3a17 2ab4 0727 1917 b901 6502 003a
    0007770: 0e19 0eb9 016b 0100 3a16 1916 b901 7101
    0007780: 0057 b200 8f13 0729 b600 a52a 1916 04b9
    0007790: 0183 0200 b501 bab2 008f 1307 2bb6 00a5
    00077a0: b200 8fbb 0095 5913 01be b700 992a b401
    00077b0: bab6 00a0 b600 a4b6 00a5 b200 8f13 01c0
    00077c0: b600 a513 01c2 3a17 2ab4 0727 1917 b901
    00077d0: 6502 003a 0e19 0eb9 01c4 0100 57a7 014a
    00077e0: 3a2c b200 8fbb 0095 5913 072d b700 9919
    00077f0: 2cb6 01c9 b600 a0b6 00a4 b600 a5b2 008f
    0007800: 1307 2fb6 00a5 1916 c600 0a19 16b9 01ce
    0007810: 0100 b200 8f13 0731 b600 a519 0ec6 000a
    0007820: 190e b901 cf01 00b2 008f 1307 33b6 00a5
    0007830: 2ab4 0723 c600 0c2a b407 23b9 01d0 0100
    0007840: b200 8fbb 0095 5913 0735 b700 992a b407
    0007850: 23b9 01d3 0100 b601 d6b6 00a4 b600 a52a
    0007860: b407 27c6 000c 2ab4 0727 b901 d001 00b2
    0007870: 008f bb00 9559 1307 37b7 0099 2ab4 0727
    0007880: b901 d301 00b6 01d6 b600 a4b6 00a5 a70a
    0007890: 043a 2db2 008f 1307 2fb6 00a5 1916 c600
    00078a0: 0a19 16b9 01ce 0100 b200 8f13 0731 b600
    00078b0: a519 0ec6 000a 190e b901 cf01 00b2 008f
    00078c0: 1307 33b6 00a5 2ab4 0723 c600 0c2a b407
    00078d0: 23b9 01d0 0100 b200 8fbb 0095 5913 0735
    00078e0: b700 992a b407 23b9 01d3 0100 b601 d6b6
    00078f0: 00a4 b600 a52a b407 27c6 000c 2ab4 0727
    0007900: b901 d001 00b2 008f bb00 9559 1307 37b7
    0007910: 0099 2ab4 0727 b901 d301 00b6 01d6 b600
    0007920: a4b6 00a5 192d bfb2 008f 1307 2fb6 00a5
    0007930: 1916 c600 0a19 16b9 01ce 0100 b200 8f13
    0007940: 0731 b600 a519 0ec6 000a 190e b901 cf01
    0007950: 00b2 008f 1307 33b6 00a5 2ab4 0723 c600
    0007960: 0c2a b407 23b9 01d0 0100 b200 8fbb 0095
    0007970: 5913 0735 b700 992a b407 23b9 01d3 0100
    0007980: b601 d6b6 00a4 b600 a52a b407 27c6 000c
    0007990: 2ab4 0727 b901 d001 00b2 008f bb00 9559
    00079a0: 1307 37b7 0099 2ab4 0727 b901 d301 00b6
    00079b0: 01d6 b600 a4b6 00a5 a708 da2a 04b5 0076
    00079c0: b200 8f13 0739 b600 a52a 1301 4cb8 014e
    00079d0: b507 3b13 0621 3a2c 1307 3d3a 172a b407
    00079e0: 3b19 17b9 0165 0200 3a0e 190e b901 6b01
    00079f0: 003a 1619 16b9 0171 0100 5719 1604 b901
    0007a00: 8302 003a 2cb2 008f bb00 9559 1307 3fb7
    0007a10: 0099 192c b600 a0b6 00a4 b600 a513 0741
    0007a20: 3a04 bb00 9559 1302 96b7 0099 1904 b600
    0007a30: a013 04d1 b600 a0b6 00a4 3a19 b200 8fbb
    0007a40: 0095 5913 01a0 b700 9919 19b6 00a0 b600
    0007a50: a4b6 00a5 2ab4 073b 1919 b901 6502 003a
    0007a60: 0e19 0e04 192c b901 7f03 0019 0e05 04b9
    0007a70: 0212 0300 190e 04b9 01a2 0200 190e 03b9
    0007a80: 01a6 0200 190e b901 ad01 0057 2a13 014c
    0007a90: b801 4eb5 0743 b200 8f13 01b4 b600 a513
    0007aa0: 01b6 3a17 2ab4 0743 1917 b901 6502 003a
    0007ab0: 0e19 0eb9 016b 0100 3a16 1916 b901 7101
    0007ac0: 0057 b200 8f13 0745 b600 a52a 1916 04b9
    0007ad0: 0183 0200 b501 bab2 008f 1307 47b6 00a5
    0007ae0: b200 8fbb 0095 5913 01be b700 992a b401
    0007af0: bab6 00a0 b600 a4b6 00a5 b200 8f13 01c0
    0007b00: b600 a513 01c2 3a17 2ab4 0743 1917 b901
    0007b10: 6502 003a 0e19 0eb9 01c4 0100 57a7 014a
    0007b20: 3a2c b200 8fbb 0095 5913 0749 b700 9919
    0007b30: 2cb6 01c9 b600 a0b6 00a4 b600 a5b2 008f
    0007b40: 1307 4bb6 00a5 1916 c600 0a19 16b9 01ce
    0007b50: 0100 b200 8f13 074d b600 a519 0ec6 000a
    0007b60: 190e b901 cf01 00b2 008f 1307 4fb6 00a5
    0007b70: 2ab4 073b c600 0c2a b407 3bb9 01d0 0100
    0007b80: b200 8fbb 0095 5913 0751 b700 992a b407
    0007b90: 3bb9 01d3 0100 b601 d6b6 00a4 b600 a52a
    0007ba0: b407 43c6 000c 2ab4 0743 b901 d001 00b2
    0007bb0: 008f bb00 9559 1307 53b7 0099 2ab4 0743
    0007bc0: b901 d301 00b6 01d6 b600 a4b6 00a5 a706
    0007bd0: c43a 2db2 008f 1307 4bb6 00a5 1916 c600
    0007be0: 0a19 16b9 01ce 0100 b200 8f13 074d b600
    0007bf0: a519 0ec6 000a 190e b901 cf01 00b2 008f
    0007c00: 1307 4fb6 00a5 2ab4 073b c600 0c2a b407
    0007c10: 3bb9 01d0 0100 b200 8fbb 0095 5913 0751
    0007c20: b700 992a b407 3bb9 01d3 0100 b601 d6b6
    0007c30: 00a4 b600 a52a b407 43c6 000c 2ab4 0743
    0007c40: b901 d001 00b2 008f bb00 9559 1307 53b7
    0007c50: 0099 2ab4 0743 b901 d301 00b6 01d6 b600
    0007c60: a4b6 00a5 192d bfb2 008f 1307 4bb6 00a5
    0007c70: 1916 c600 0a19 16b9 01ce 0100 b200 8f13
    0007c80: 074d b600 a519 0ec6 000a 190e b901 cf01
    0007c90: 00b2 008f 1307 4fb6 00a5 2ab4 073b c600
    0007ca0: 0c2a b407 3bb9 01d0 0100 b200 8fbb 0095
    0007cb0: 5913 0751 b700 992a b407 3bb9 01d3 0100
    0007cc0: b601 d6b6 00a4 b600 a52a b407 43c6 000c
    0007cd0: 2ab4 0743 b901 d001 00b2 008f bb00 9559
    0007ce0: 1307 53b7 0099 2ab4 0743 b901 d301 00b6
    0007cf0: 01d6 b600 a4b6 00a5 a705 9a2a 04b5 0076
    0007d00: b200 8f13 0755 b600 a52a 1301 4cb8 014e
    0007d10: b507 5713 0759 3a04 bb00 9559 1301 9cb7
    0007d20: 0099 1904 b600 a0b6 00a4 3a19 b200 8fbb
    0007d30: 0095 5913 01a0 b700 9919 19b6 00a0 b600
    0007d40: a4b6 00a5 2ab4 0757 1919 b902 3602 003a
    0007d50: 0d19 0db9 023a 0100 572a 1301 4cb8 014e
    0007d60: b507 5bb2 008f 1301 b4b6 00a5 1301 b63a
    0007d70: 172a b407 5b19 17b9 0165 0200 3a0e 190e
    0007d80: b901 6b01 003a 1619 16b9 0171 0100 57b2
    0007d90: 008f 1307 5db6 00a5 2a19 1604 b901 8302
    0007da0: 00b5 01ba b200 8f13 075f b600 a5b2 008f
    0007db0: bb00 9559 1301 beb7 0099 2ab4 01ba b600
{Object[#1],Object[#196],Object[#178],Object[#214],Object[#214],Object[#214],Object[#214],Integer,Integer,Integer,Integer,Integer,Object[#214],Object[#571],Object[#364],Integer,Integer,Integer,Integer,Integer,Top,Integer,Object[#370],Object[#214],Top,Top,Top,Integer,Top,Top,Top,Top,Object[#214]},{})
        full_frame(@1267,{Object[#1],Object[#196],Object[#178],Object[#214],Object[#214],Object[#214],Object[#214],Integer,Integer,Integer,Integer,Integer,Object[#214],Object[#571],Object[#364],Integer,Integer,Integer,Integer,Integer,Top,Integer,Object[#370],Object[#214],Object[#214],Top,Top,Integer,Top,Top,Top,Top,Object[#214]},{})
        same_frame(@1275)
        same_frame(@1283)
        same_frame(@1302)
</code>
---  THERE ARE LOT OF THESE ERORR ROWS SO I CUT IT ---
<code>{Object[#1],Object[#196],Object[#178],Object[#214],Object[#214],Object[#214],Object[#214],Integer,Integer,Integer,Integer,Integer,Object[#214],Object[#571],Object[#364],Integer,Integer,Integer,Integer,Integer,Top,Integer,Object[#370],Object[#214],Top,Top,Top,Top,Top,Top,Top,Top,Object[#214],Object[#906],Object[#906],Object[#906],Object[#906],Object[#906],Object[#906],Object[#906],Object[#906],Object[#906],Object[#906],Object[#906],Object[#906],Object[#942],Top,Object[#950]},{})
        same_frame(@11566)
        full_frame(@11653
        full_frame(@22992{Object[#1],Object[#196],Object[#178],Object[#214],Object[#214],Object[#214],Object[#214],Integer,Integer,Integer,Integer,Integer,Object[#214],Object[#571],Object[#364],Integer,Integer,Integer,Integer,Integer,Top,Integer,Object[#370]},{Integer,Integer})
        same_frame_extended(@33615)
        full_frame(@33653,{Object[#1],Object[#196],Object[#178],Object[#214],Object[#214],Object[#214],Object[#214],Integer,Integer,Integer,Integer,Integer,Object[#214],Object[#571],Object[#364],Integer,Integer,Integer,Integer,Integer,Top,Integer},{Object[#458]})
        same_frame(@33682)

        at java.lang.Class.getDeclaredFields0(Native Method)
        at java.lang.Class.privateGetDeclaredFields(Unknown Source)
        at java.lang.Class.getDeclaredFields(Unknown Source)
        at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)
        at org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:270)
        at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:139)
        at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:65)
        at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:415)
        at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:892)
        at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:386)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5412)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        ... 6 more

    מאי 20, 2015 10:21:09 AM org.apache.catalina.core.ContainerBase startInternal
    SEVERE: A child container failed during start
    java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
        at java.util.concurrent.FutureTask.report(Unknown Source)
        at java.util.concurrent.FutureTask.get(Unknown Source)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:739)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:689)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
    Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
    Caused by: org.apache.catalina.LifecycleException: A child container failed during start
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:816)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        ... 6 more

    מאי 20, 2015 10:21:09 AM org.apache.catalina.startup.Catalina start
    SEVERE: The required Server component failed to start so Tomcat is unable to start.
    org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8005]]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:689)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
    Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:739)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        ... 7 more
    Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        ... 9 more
    Caused by: org.apache.catalina.LifecycleException: A child container failed during start
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        ... 11 more

    מאי 20, 2015 10:21:09 AM org.apache.coyote.AbstractProtocol pause
    INFO: Pausing ProtocolHandler ["http-bio-8080"]
    מאי 20, 2015 10:21:09 AM org.apache.coyote.AbstractProtocol pause
    INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
    מאי 20, 2015 10:21:09 AM org.apache.catalina.core.StandardService stopInternal
    INFO: Stopping service Catalina
    מאי 20, 2015 10:21:09 AM org.apache.coyote.AbstractProtocol destroy
    INFO: Destroying ProtocolHandler ["http-bio-8080"]
    מאי 20, 2015 10:21:09 AM org.apache.coyote.AbstractProtocol destroy
    INFO: Destroying ProtocolHandler ["ajp-bio-8009"]
</code>
Suprisingly , when I remove the added code OR ANY FORMER  code,
the tomcat is running well.
Is it possible there is a limit to how many rows one can adds to doPost() inside servlet ?
Answer: Which version of Java are you running on the server side? There are, apparently, some limitations on the amount of bytecode that can be generated for any method: see this answer on a slightly related question on another StackExchange site for example. Note, however, that on Java 5 and above, such limitations have been extended so much that you should never worry to bump into them.
Comment: Hi, Thanks for the response. in my check: java.runtime.version=1.7.0_71-b14. I found it by System.getProperty("java.runtime.version". Is that the version you ment to?
Comment: @Eliran yep. So, it seems the case I described is hardly yours, because the limit on the bytecode generated per method in Java > 1.5 is 4 GB.


I can't insert images to articles

Question: I installed Drupal 8 today, the release candidate 3. I had not done any modifications to it. When I edit my first article, I can't insert images. I clicked on the image button, but it keeps loading forever. I saw other people clicking the image button and a pop-up appearing.
Do I have to install a module?
Comment: press f12, switch to console tab, then click on that image button and see if there are any errors on the console.
Comment: Try using a different web browser and see what happens.
Comment: When I click the image button, the console says " uncaught AjaxError, An Ajax HTTP error occured Debugging information follows. Path: /editor/dialog/image/full_html" @IvanJaros
Comment: I used both google chrome and firefox, but still can't insert images.@NoSssweat
Comment: I have RC2, no problems here. I will update later, when I have some time, to RC3 and let you know if it's just you or if it's an RC3 bug.
Comment: check watchdog entries.
Comment: I've installed Drupal 8.0.6 and have the exact same problem. Firefox, Google Chrome, Internet Explorer. Nothing in the status report, error log on server, etc. Just in the browser's console. Without the console you don't even know that something went wrong. Just that "Loading..." stays there and nothing happens.
Comment: Solved it. It was the firewall.
Answer: My solution was simple: After updating Drupal8, ensure you run any pending scripts! Otherwise you will not be able to do certain things with your Drupal8 site.
Yesterday I updated my Drupal from some ancient version to the latest stable Drupal8. I noticed I can't add images [the forever loading problem], and I'm just a home user not behind a fancy firewall. After updating 13 pending scripts, everything was fine.
I'm not a very technical person, but I wanted to share my solution because no one else had shared this.
My website is ontu.org and thus the settings page for me was here:
http://ontu.org/admin/reports/status
Change that URL to your site and you'll quickly go to your settings page. There may be multiple issues reported on that page, so notice everything on there.
Answer: There have been a number of bugs fixed with dialogs in general and the Text Editor dialogs in particular during the RC phase of Drupal 8. It's definitely been working fine ever since Drupal 8.0.0.
Comment: I've installed Drupal 8.0.6 and have the exact same problem. Firefox, Google Chrome, Internet Explorer. Nothing in the status report, error log on server, etc. Just in the browser's console. Without the console you don't even know that something went wrong. Just that "Loading..." stays there and nothing happens.
Comment: Solved it. It was the firewall.
Comment: Oh haha. I wonder what was triggering the firewall then. Which firewall? In any case a crappy one.
Comment: I don't have any specifics. It's the new firewall in our company. There's a proxy that filters all unknown HTTP response header entries. I could use HTTPS only, until the firewall gets updated to filters that, too. :-(
Comment: The firewall is WatchGuard. And this seems to filter everything on default. Even the CORS headers that are needed to use external Google fonts.
Answer: Be sure your firewall doesn't filter too many HTTP response header lines. They are used to validate the Ajax response.
<code>X-Drupal-Ajax-Token: 1
</code>
etc.
It's a known bug: https://www.drupal.org/node/2580191

I can't insert images to articles


Flutter InAppWebView does not allow non english content in textfield

Question: I'm having a weird issue with the Flutter InAppWebView plugin version 4.0.0+4 here https://pub.dev/packages/flutter_inappwebview where I try to load the simple contact us form into the plugin and realize that I can't enter the content into html input text field if I use non English keyboard, in my case I use Vietnamese keyboard. If I switch the keyboard to English one then its working. I double checked the contact us form and made sure its working 100% on Chrome browser outside of the Flutter app using even non English keyboard. I don't use any special code or settings for the plugin, just same as the one mentioned in the pub.dev. I'm using Flutter channel stable v. 1.22.6
This is my code in case you need it:

class WebViewerWidget extends StatefulWidget {
  final Map<String, String> metaData;

  WebViewerWidget({this.metaData});

  @override
  _WebViewerWidgetState createState() => _WebViewerWidgetState();
}

class _WebViewerWidgetState extends State<WebViewerWidget> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    InAppWebViewController _webviewCtrl;
    double progressIndicator = 0;
    return Scaffold(
        backgroundColor: ColorPalette.white,
        appBar: PreferredSize(
          child: TopNavWidget(
            title: widget.metaData['title'] ?? '',
          ),
          preferredSize: Size.fromHeight(50.0),
        ),
        body: Builder(
          builder: (BuildContext context) {
            return Container(
              child: Column(
                children: [
                  Container(
                      child: progressIndicator < 1
                          ? LinearProgressIndicator(
                              value: progressIndicator,
                              backgroundColor: Colors.black12,
                              valueColor:
                                  AlwaysStoppedAnimation<Color>(Colors.blue),
                            )
                          : Container()),
                  Expanded(
                    child: InAppWebView(
                      initialUrl: widget.metaData['url'] ?? 'about:blank',
                      initialOptions: InAppWebViewGroupOptions(
                        crossPlatform: InAppWebViewOptions(
                          debuggingEnabled: true,
                          javaScriptEnabled: true,
                          useShouldInterceptAjaxRequest: true,
                          useShouldInterceptFetchRequest: true,
                        ),
                        ios: IOSInAppWebViewOptions(),
                        android: AndroidInAppWebViewOptions(),
                      ),
                      onWebViewCreated:
                          (InAppWebViewController webviewController) {
                        _webviewCtrl = webviewController;
                      },
                      onProgressChanged:
                          (InAppWebViewController controller, int progress) {
                        setState(() {
                          progressIndicator = progress / 100;
                        });
                      },
                    ),
                  ),
                ],
              ),
            );
          },
        ));
  }
}

Thanks.
Comment: Ok, now I've noticed that it will start working when I ignore the first text field on the form which is in this case the user's full name, just jump straight into the next text field which is email, type something in here then go back to user full name, this time it allows me to enter Vietnamese characters. So weird.
Answer: Ok, after spending a couple days fixing the issue, I had to give up on this one. Its definitely a bug from the plugin, found someone had the similar issue here https://github.com/pichillilorenzo/flutter_inappwebview/issues/560. I then tried another plugin called WebView https://pub.dev/packages/webview_flutter and it worked perfectly.
Answer: This has been fixed with new version 5.0.0 (the latest version now is 5.0.5+3): use useHybridComposition: true Android-specific webview option, all the issues related to the Android keyboard are fixed.
Comment: Thanks @Lorenzo. Will try it again.
Comment: still not works in emulator


what is the scale of TF-IDF results?

Question: I did a classification of review text data using the ANN model. As we know, text data must be converted into numeric first before entering the classification stage. To change this I used the TF-IDF method. I am confused whether the data scale of TF-IDF results is a ratio or interval scale.
Here's the example of TF-IDF result:

doc 1 = It is going to rain today
doc 2 = Today I am not going outside
doc 3 = I am going to watch the season premiere
the result of TF-IDF every word can be 0 to infinity
Comment: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
Answer: According to the definitions made in this article, the most important difference between an interval-scale variable and a ratio-scale variable is the notion of absolute zero point:

Zero-point in an interval scale is arbitrary. For example, the
temperature can be below 0 degrees Celsius and into negative
temperatures.

The ratio scale has an absolute zero or character of origin. Height
and weight cannot be zero or below zero.

The TF-IDF has a notion of absolute zero, when the term does not appear in the any document, i.e. term-frequency is $0$. It is, therefore, a ratio-scale variable.

what is the scale of TF-IDF results?


strongswan route traffic to specified IPs only

Question: In my company we have a strongswan vpn that we use to be able to access a git server, The problem is that we are facing MTU issues, so for example when we do something like pip install -r requirements.txt the packages that are located outside of our git server can not be reached.
Is there are a way to route throught strongswan only the traffic to the git server ip with client side config only?
currently we are using network manager to connect to the vpn which always 0.0.0.0/0 for the remote network
Answer: While the client always proposes 0.0.0.0/0 as remote traffic selector, the server is free to narrow this to a smaller subnet (or multiple subnets/IPs). So if you change the server's configuration (its local traffic selector) to the IPs you want, the client will only tunnel traffic to them and the rest will bypass the VPN.
You could also look into fixing the MTU/MSS issue (e.g. via TCPMSS target for iptables).


Iteratively Reweighted Least Squares, (Logistic Regression)

Question: I'm trying to obtain the parameters estimates in a Logistic Regression using the IRLS (Iteratively Reweighted Least Squares) algorithm.
I'm following this great and simple reference slides: (Logistic Regression)
And also this question where there are all the mathematic details and codes: Why using Newton's method for logistic regression optimization is called iterative re-weighted least squares?
I'm trying to obtain the estimates, without using the lm function, but using the matrix notation,as stated in the question I mentioned above:
$$
b^{(m+1)} = b^{(m)} + (X^T W_{(m)} X)^{-1}X^T W_{(m)} z_{(m)}
$$

the predictor is equal to (in the code case we don't have the intercept): $\eta_i = \sum_{j=1}^{2}\beta_jx_{ij}=\beta_1x_{i1}+\beta_{i2}x_{i2}$
As stated in the first link above $W$ is a diagonal matrix, where each element of the diagonal is the second partial derivative in respect of the vector of parameters $\beta$ of fitted values of the Logistic Regression
the residual $z =\frac{y_i - E[y_i]}{h'(\eta_i)}$ where $h'(\eta_n)$ is the first partial derivative of the fitted values in respect of the vector of the same parameters, and it is equal to $h'(\eta) = \frac{1}{1+e^\eta}*(1-\frac{1}{1+e^\eta})$

In the code below we have
The p = 2 is the variable to set the number of parameters (in this example it's not use the intercept).
The n = 20 is the variable to set the number of observation.
The code (the first part is copied from the question link above) of the algorithm in matrix notation is not working (estimates do not converge) when we have large matrices (i.e. when we have p = 3the matrix notation algorithm never converges, when we have p =2 and n = 200 the algorithm never converges.
In the matrix form algorithm, also the convergence is much slower than the algorithm with lm function.
By the way all the elements before the IRLS is computed (estimation of vector of betas parameters) are equal in both forms, and I also added two lists to show that are equal.
This below is the code:
#LOGISTIC REGRESSION Estimation (IRLS)
#LOGIT

set.seed(5)
p <- 2             ##for p > 3 the estimates do not converge
n <- 20
x <- matrix(rnorm(n * p), n, p)
betas <- runif(p, -2, 2)
hc <- function(x) 1 /(1 + exp(-x)) # inverse canonical link
p.true <- hc(x %*% betas)
y <- rbinom(n, 1, p.true)
tol=1e-8

#IRLS using the 'lm' function:
b.init = rep(1,p)
b.old <- b.init
change <- Inf

IRLS_canoni_ = list()

while(change > tol) {
  eta <- x %*% b.old  # linear predictor

  y.hat <- hc(eta)
  h.prime_eta <- y.hat * (1 - y.hat)     #first derivative
  z <- (y - y.hat) / h.prime_eta

  b.new <- b.old + lm(z ~ x - 1, weights = h.prime_eta)$coef  # WLS regression
  change <- sqrt(sum((b.new - b.old)^2))
  b.old <- b.new

  IRLS_canoni_$eta = cbind(IRLS_canoni_$eta,eta)
  IRLS_canoni_$y.hat = cbind(IRLS_canoni_$y.hat,y.hat)
  IRLS_canoni_$h.prime_eta = cbind(IRLS_canoni_$h.prime_eta, h.prime_eta)
  IRLS_canoni_$z = cbind(IRLS_canoni_$z, z)
  IRLS_canoni_$b.old = cbind(IRLS_canoni_$b.old, b.old)

  print(b.old)
  Sys.sleep(.1)

}

b.old

my_IRLS_canonical(x, y, rep(1,p), hc)
glm(y ~ x - 1, family=binomial())$coef      #model with no intercept

glm1 = glm(y ~ x, family=binomial())

##Trying to obtain same results with matrix notation (IRLS):
deriv2 = function(x) exp(x)/(1+exp(x))^2     #second derivative

b.init = rep(1,p)
b.old1 <- b.init
change1 <- Inf

IRLS_matrix = list()

while(change1 > tol) {

  eta1 <- x %*% b.old1  # linear predictor
  y.hat1 <- hc(eta1)
  h.prime_eta1 <- y.hat1 * (1 - y.hat1)
  z1 <- (y - y.hat1) / h.prime_eta1

  Wdiag = deriv2(eta)
  W = matrix(0,n,n)
  diag(W) = Wdiag

  H = -(t(x)%*%(W)%*%x)      #not using it

  b.new1 = b.old1 + ((solve(t(x) %*% W %*% x)) %*% (t(x)%*%W%*%z1))
  change1 = sqrt(sum((b.new1 - b.old1)^2))
  b.old1 = b.new1

  IRLS_matrix$eta = cbind(IRLS_matrix$eta, eta1)
  IRLS_matrix$y.hat = cbind(IRLS_matrix$y.hat, y.hat1)
  IRLS_matrix$h.prime_eta = cbind(IRLS_matrix$h.prime_eta, h.prime_eta1)
  IRLS_matrix$z = cbind(IRLS_matrix$z, z1)
  IRLS_matrix$b.old = cbind(IRLS_matrix$b.old, b.old1)

  print(b.new1)
  Sys.sleep(.1)

}

b.new1

glm(y ~ x - 1, family=binomial())$coef    #model with no intercept

IRLS_canoni_$eta[,1] == IRLS_matrix$eta[,1]
IRLS_canoni_$y.hat[,1] == IRLS_matrix$y.hat[,1]
IRLS_canoni_$h.prime_eta[,1] == IRLS_matrix$h.prime_eta[,1]
IRLS_canoni_$z[,1] == IRLS_matrix$z[,1]

IRLS_canoni_$b.old[,1] == IRLS_matrix$b.old[,1]

So can anyone give a try? It seems it only works with max $2$ parameters and few observation.
Anyway I think the algorithm is correct, if it wouldn't be, it wouldn't find the correct value anytime (and this is not the case).
Why is it happening this? Thank You.
Comment: https://stats.stackexchange.com/questions/236676/can-you-give-a-simple-intuitive-explanation-of-irls-method-to-find-the-mle-of-a/237384#237384
Comment: I've read your answer. What i notice that you are giving weights (in your cauchy example) w=densityf()/firstderiv(densityf()). So basically in "my code" I setted the diagonal elements of diagonal matrix w = secondderivative. Should i change those? I don't have other ideas. Any suggestions? thanks
Answer: I just found that inside the algorithm in the "matrix form" the variable it's equal to Wdiag = deriv2(eta) so in this case this variable stays always the same.
So we have to change it to Wdiag = deriv2(eta1). So now both of these algorithms works fine.
There's another error anyway with this algorithm (this is also present in the original question, linked above):

The betas starting values are all equal to $1$ as we can see it in the variable b.init = rep(1,p), in this case we can't estimate much parameters (eg. if we have 8 parameters to estimate the algorithm doesn't converge in both forms) and the algorithm converge only with few parameters and observation.

Solution: We need to change the initialization of the betas with $0$ in this way b.init = rep(0,p).
This reminds me of Non-Stationarity in time-series: when we have a parameter that is equal or bigger than $1$ the process is said to be an explosive process.
Since this is a sort of process that evolves in time i think that the b.init = rep(1,p) leads to the non convergence path. This is just an idea btw, but the code works fine.


Form not receiving a CSS class, it's block wrapper does instead

Question: I have a custom form built with Form API that I am trying to add a class to on the form tag.
In the buildForm method, I have:
$form['#attributes']['class'][] = 'hl__single-input-form__form';

But the class doesn't appear on the form tag. Instead, the class appears on the div wrapper for the block that outputs the form.
In the block, the build method has:
  /**
   * {@inheritdoc}
   */
  public function build() {
    return $this->formBuilder->getForm('\Drupal\harlib_newsletter_signup\Form\NewsletterSignup');
  }

The only way I have been able to solve this is with a custom twig file with the following:

  <form{{ attributes.addClass('hl__single-input-form__form') }}>
    {{ children }}
  </form>

But the twig shouldn't be necessary. I also notice that the form id as a css class also goes on the block wrapper, too. What is happening here?
Answer: Obviously the block plugin thinks the #attributes key in the returned array is meant for the block wrapper. So I would try to put the form in a subkey, this should prevent that the block plugin can access the attributes of the form:
  return ['form' => $this->formBuilder->getForm(...)];

By the way the core search block is also returning the form array directly like you did in the question and indeed, the resulting form tag in the search block has no classes too. I'm not sure, but this seems to be the same issue.
Comment: Yep, that fixed it.


Video for everybody with modernizr not working?

Question: I have a webpage coded in html5 using tags like header, footer, section and video.
I use modernizr to support those tags in IE 7 and IE 8.
There's a video in the page including flash fallback (video for everybody).
When I test the page in IE 8, the page is well rendered, including tags specific to html5.
The problem is that the flash fallback for the video doesn't work. I have a black area instead of the flash player.
It works only if I remove the script tag to load modernizr. If I build a custom version of modernizr without html5 shim, the flash player loads and I can play the video, but html5 tags are not recognized.
How can I use video for everybody with modernizr / html5 shim ?
Why isn't it working?
Thanks for your help

Update :
To go further in details, my page is based on html5boilerplate and use mediaelementsjs for the player.
Here's the html code

...

...

...

<video width="332" height="250" poster="img/poster.jpg" controls="controls" preload="none">

    <source type="video/mp4" src="video/myvideo.mp4" />

    <source type="video/webm" src="video/myvideo.webm" />

        <object width="332" height="250" type="application/x-shockwave-flash" data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf">
                <param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf">
                <param name="allowFullScreen" value="true">
                <param name="wmode" value="transparent">
                <param name="flashVars" value="config={'playlist':['http://.../img/poster.jpg',{'url':'http://.../video/myvideo.mp4','autoPlay':false}]}">

        </object>
    </video>

...

And what is in script.js
$(function() {

if($.browser.msie && $.browser.version.substr(0,1)<=7) {
    // $("video, audio").mediaelementplayer({defaultVideoWidth: 332,defaultVideoHeight: 250, features: ['playpause','progress','current','duration','volume','fullscreen']});
    }
    else {
    // initialize scrollable
        $(".scrollable").scrollable({circular: true, mousewheel: true}).navigator();
        $("video, audio").mediaelementplayer({defaultVideoWidth: 332,defaultVideoHeight: 250, features: ['playpause','progress','current','duration','volume','fullscreen']});
    }
});

The plugins.js file contains the code of mediaelement-and-player.min.js
https://github.com/johndyer/mediaelement/blob/master/build/mediaelement-and-player.js
It works in IE 8 only if I comment the line to load modernizr.
Comment: If you include some code or post it here http://jsfiddle.net/ this will help people help you ....
Comment: Seems a bit confused, why use MediaElementJs if you're manually specifying the flash fallback player and using another player? MEJS is a shim that includes the flash component... anyway, isn't it because the swf you're including isn't on the same domain perhaps? Also, doesn't the msie and version check in the script defeat the purpose of feature shims in the first place? And if you use modernizr the video tag is suddenly supported and the object tags inside will react differently, shouldn't they then have noscript tags as a workaround for non-script browsers... my head is spinning ^^
Answer: Do you specifically need to use "Video for Everybody"?
We use http://mediaelementjs.com in conjunction with pages marked up with HTML5 and using Modernizr with no problems across all OS/Browsers
Comment: No, I don't need specifically "video for everybody", but to keep my question simple, I mentioned "video for everybody" instead of mediaelelmentjs, because it describes the same html code.
Comment: Could you post a part of your code? I use modernizer and mediaelementsjs but it doesn't work with IE 8.
Answer: If you're using multiple javascript libraries use jQuery.noConflict();
Answer: In my case, I also suspected of modernizr but was FitVids. FitVids was messing with "embed" objects after MediaElement.js have already done its magic.
To fix this, I needed to ensure that any jQuery().fitVids() ever happened before jQuery('video,audio').mediaelementplayer().


angularjs to handle inactive users when login

Question: I want to handle the inactive users and keep them out as long as they are not active. Currently, I am just alerting them that they are not active and letting them log in. However, I just want to throw in a login error and keep them out as long as they are not active. By "active" I mean, they haven't activated the email token.
<code>'use strict';

angular.module('myapp').controller('LoginCtrl', function ($scope, alert, auth, $state, $auth, $timeout) {

  $scope.submit = function () {
    $auth.login({
      email: $scope.email,
      password: $scope.password
    })
      .then(function(res) {
        var message = 'Thanks for coming back ' + res.data.user.email + '!';
        if (!res.data.user.active)
          message = 'Just a reminder, please activate your account soon :)';
        alert('success', 'Welcome', message);
        return null;
      })
      .then(function() {
        $timeout(function() {
          $state.go('main');
        });
      })
      .catch(handleError);
  }

  function handleError(err) {
    alert('warning', 'oops there is a problem!', err.message);
  }

});
</code>
Answer: You could always log them out immediately with <code>$auth.logout()</code>.
Comment: Inside the `if (!res.data.user.active)` block. You could also show an alert message inside that block as well telling them they need to activate.


The "And of 3" in Robert Cray's song "Will You Think Of Me"

Question: What do you call the rhythm being employed in Robert Cray's song "Will You Think Of Me" -- where the drummer is emphasizing the upbeat or "and" of the third beat in the measure?
Can be heard starting at 25 seconds into this video:
Answer: Off-beat Syncopation. This Wikipedia article has a brief discussion on Syncopation. Notice that he doesn't do it on every measure, making it an effective use of the technique.


recurrence solving

Question: I need to find the complexity of the current recurrence:
T(n) = 1/(T(n-1) + 1) + 1

thanks in advance for any idea or link with useful information
Comment: @Armen Tsirunyan - I am assuming he needs help with his mathematics. The fact is, there is _nothing_ about programming in this question, it is pure maths.
Comment: Off topic - not a programming question.
Comment: @Oded - why not? I am guessing the OP has a recursive algorithm and wants to calculate its complexity.
Comment: @Oded: why? it is about complexity of the algorithms.
Comment: @Henk: What if it is? Then only the homework tag should be added. And since it's not please have some respect for the OP and answer the question if you can. If you can't why do you care?
Comment: @Oded: You know, calculating the sum of 1...n is a math formula, but it's also a legitimate programming question. There is no such thing as 'pure math' IMHO. If some piece of math, like this one, is heavily used in algorithms then this is already a programming question. Programming is not coding, you know
Comment: I'm not sure that this recurrence makes sense.  It's stating that the cost of the `n`-th recurrence is *less* than that for the `(n-1)`-th recurrence (assuming `T(n-1) > 1`)...
Comment: @Armen: It is custom for the OP to mark it as homework. And it should be mentioned, at least in a comment, to stop people from providing complete answers.
Comment: @rookie, what have you tried so far?
Comment: @Henk: Totally agree. But if it is not marked as homework then we assume it is not, unless there is a strong reason to believe otherwise. I don't see why this should necessarily be homework
Comment: @Henk Holterman: master method is not working here, so I tryed the method of iteration,  but it doesn't seem to work, I think I need to know some trick here...
Comment: Following on from my previous comment... I think the only meaningful way this relationship can be satisfied is if the complexity is `O(1)`...
Comment: @Armen: because it really smells like homework.
Answer: Expanding on my comments above...
This doesn't make sense as a real-world recurrence relationship.  T(n) denotes the runtime to solve a problem of size n; T(n-1) denotes the runtime for size (n-1).  Given that you must solve the problem for size (n-1) before you can solve for size n (otherwise it wouldn't be a recursion), the runtime must necessarily be monotonic as n increases.
However, your expression oscillates up and down with n; this doesn't make sense.
The only way this expression could ever make sense is if we assume that T(n) is constant with n, so that there is no oscillation.  It turns out that there is a constant value that allows this to happen, just set T(n) = T(n-1), and solve.  (Note that this is equally meaningless; we don't generally talk about absolute values of T(n).)

recurrence solving


How to export data from drupal to Excel?

Question: I've inherited a Drupal site. I need to extract the main page data out of the site to be able to import it into a different system, but I've never used Drupal and the site is live so I need to tread carefully in order to extract the data without affecting the site.
Currently the website has lots of content pages for manufacturers. Each manufacturer has a name, description, some images and other (mainly text) data. Say, for example, there are 2000 of these manufacturers. What I'd really like to be able to do is export an Excel file (or XML file, whatever) so each field has a different column in the spreadsheet, and each drupal page (i.e. each manufacturer) is a different row in the export spreadsheet. Ideally the images will be exported as full URLs in a column in the spreadsheet.
When I log into Drupal and click the 'content' button at the top, it gives me a list of every page on the site. I can filter this to only show 'Manufacturer' pages. When I edit a specific manufacturer page it gives me a form containing all of the editable fields for that manufacturer, prepopulated with the data to edit. I just need this information for each manufacturer dumped out into a spreadsheet.
So as a complete Drupal noob, where would I start in doing this? Would I just go straight to the database and try to piece it together (if so, is the data stored in a single table, or will there be some major queries involved in doing this - any pointers about which tables to look at would be greatly received) or is there a tool for getting a bulk export of this kind of thing? I guess I could even create a web page which displayed this information in an HTML table and just scrape it from there, but ideally an export would be nice.
Answer: You are in luck! There is a module for that. (I love saying that!)

Views Excel Export
Views

This is an extension for Views module, which pretty much can list any data from Drupal's DB; users, content, comments and any other entities. You will have to install the Views module and then install the Views Excel Export module which will export the list generated by Views to an Excel file. Without any code! Brilliant isn't it?
If you need instructions on how to install a module in Drupal, you can follow Installing modules (Drupal 7) on Drupal documentation.
Comment: Usually nothing breaks when you install a module, but you can never be sure. At least you want to make a database backup before you do anything. The safest way is to clone the site and run it on a local webserver, and use that to install modules and export data. Where did you read about the 7.8 version incompatibility? Seriously: if you're still running Drupal 7.8, perform a Drupal core security update *NOW*.
Comment: Thanks Swarad - that looks like just the thing.  My concern is installing a module (having never done it before) on a live server.  Is anything likely to break?  Are there any gotchas, or can I confidently just 'install' and be certain that nothing is going to break?
Comment: Am I correct in saying that Views XLS isn't compatible with version 7.8 of Drupal?  In which case it's not going to work?
Comment: Views XLS has a 1.0 release for 7.x, what am I missing ?
Answer: There is also Views Data Export. It supports many data formats including Excel and CSV. It also depends on Views. It is designed to handle extremely large datasets by batching the export process but producing one file.
Views Data Export
Answer: Another option to consider might be the Forena module, which also comes with quite some community documentation.
Forena is built of the idea of using SQL to get data out of a database (which can be the Drupal database or an external one such as My SQL, Oracle, MS SQL, ...) and use XHTML and CSS to format it into web reports. There are quite some reasons for considering Forena. Visit the Forena HowTos page for some links (near the bottom) to some live demo / showcase links.
Any report can be saved (exported) in various file formats, such as CSV or XLS. To do so, just add .csv as an extention to the report (output) URL. That contains the CSV equivalent of that report. As a sample, consider the sample report located at /reports/sample.states (in your own site, one of the samples shipped with Forena). Change the URL to /reports/sample.states.csv (= just add .csv to it) to get the same report in .csv format. If you'd add such .csv to the URL of the Simple Table of States in the demo site, the result is like so ...
Same technique applies for other supported extensions (export formats), such as adding .html, .xls (MS Excell), .pdf or .doc (MS Word).
By the way, all data blocks are accessible directly via their url also, provided you have permission to access that block. Here are a few samples of that, for the sample report located at /reports/sample.states:

in XML format (= demo with anonymous access).
in JSON format (= demo with anonymous access).
in XML format (= demo without anonymous access).
in JSON format (= demo without anonymous access).

For short, to answer this specific answer I'd write the various (custom) SQLs I need, format it as reports that fit my needs, and then just save it as an XLS (or CSV?).
Disclosure: I'm a co-maintainer of this module,
I hope this does not violate the site's policy on self-promotion.


Game with 4 coins

Question: Consider the following game. We have 4 fair coins, they are tossed and you have 2 options, either take the amount of money equal to the number of heads that fell, or toss 4 coins again, after you toss 4 coins again you must take the money and the game ends. Obviously, the optimal strategy is: If on the first throw there are 2, 3 or 4 heads, then we take the money, but if the number of heads is 0 or 1, then we throw the coins again. How to calculate the expected value of this strategy?
I don't understand how to calculate expectations in such games, if anybody could explain on this example, I would appreciate that!
Comment: You have an explicit strategy, so just compute.  What is the probability of getting $0,1,2,3,4$ heads on the first round?  If you go to the second round then, of course, you expect to get paid $2$, so it's really only the first round you need to compute for.
Comment: It is not obvious what you do with $2$ heads from $4$, but it may not affect the expectation, so let's adopt your strategy.  You want the probabilities of $4$ on first roll, $3$ on first roll, $2$ on first roll, $1$ on first roll and $4$ on second (which counts as $4$), $1$ on first roll and $3$ on second (which counts as $3$), ...,  $0$ on first roll and $0$ on second (which counts as $0$). Then you can find the expectation from the probabilities of the various outcomes
Comment: @Henry Could you describe this as an answer in a little more detail?
Comment: @lulu I understand but that is the problem, what do we need to calculate? Could you describe in more details, I really want to understand how to deal with such problems
Comment: I said exactly what to compute, or at least how to start.  Get those $5$ values first.  Then think about what your strategy says for each outcome.
Comment: @lulu $P(H = 0) = 1/16, P(H = 1) = 4/16, P(H = 2) = 6/16, P(H = 3) = 4/16, P(H=4) = 1/16$. So the $EV = 1/2 * something + 1/2 * 2$, as understand you correctly. What gonna be instead of "somethig"?
Comment: So, you have five outcomes for the first round and their probabilities.  Now, following your strategy, what happens in each case?  To start, if you get $H=0$ then of course you re-roll, in which case you expect to get $2$.  So that's a case that expects to yield $2$.  Also of course, if you get $H=4$ initially you do not reroll so in that case you get $4$.  Analyze the other three cases similarly.
Comment: If you find it clearer you can write out all $5\times 5=25$ possible outcomes for the two rolls.  Then write out the probability of each and use your strategy to see the payout of each.  Personally, I find it easier to remark that the second round has an expected yield of $2$ and not bother with the specific cases.
Comment: @lulu following this logic, for $H = 0, 1$ i wll get 2 and for $H=2, 3, 4$ i will get 2, 3, 4.
Comment: Exactly so.  Well, with the proviso that you should write "expect to get".  In those cases where you reroll the outcome is not certain, we are just replacing it with its expected return of $2$.
Comment: @lulu Of course i could write all of the 25 possible outcomes, but that will not help me to understand some general ideas
Comment: It's always good to have the explicit list to fall back on.  If nothing else, you can definitely get the answer that way and you can use it to check whatever else you do.
Comment: @lulu got it, but i want to understand how to approach this problem without writing all of the combinations
Comment: @lulu So, I understand the point about cases when we have $H=0, 1, 2$ and expect to get 2 for the second roll. What's next?
Comment: You are done!  Well, essentially.  There are only $3$ expected outcomes ($2,3,4$) and you can read off the probabilities of each.  So just use the definition of expectation to finish.
Comment: Specifically $E=2\times (P(0)+P(1)+P(2))+3\times P(3)+4\times P(4)$.
Comment: @lulu got it! $38/16$ is the answer.
Comment: @lulu Usually this is not asked here, but i would like to get in touch to analyze similar problems, if is it possible? If this is not possible, then no problem
Comment: Not possible, sorry.  Good luck!
Comment: @lulu okay, thank you very much!
Answer: Find the probability of each outcome. That is to say, find the probability we get 0 heads and toss again and get 0 heads, we get 0 heads, toss again and get 1 heads, etc. for every possible outcome. You can do this in a table or figure out if there's a nice expression. You can make this faster by finding the probabilities for 0, 1, 2, 3, and 4 heads in the first round and then multiplying these probabilities by the probability of 0 and 1 for the games that advance to the second round, according to your strategy. All together you should have 13 possible outcomes (I noticed in a comment you said you have 25. This is not true).
Then multiply the amount of money you get for each outcome by the outcome itself e.g. the probability of getting 4 heads the first round and stopping is $1/16$ and you get $4$ "monies" for this outcome so our product is $\frac{4}{16}=0.25$. Once you've done this for each outcome, add them all up and this is your expected value.
This comes from the formula $E[X]=\sum_x xp(x)$ where $x$ is the value of the outcome and $p(x)$ is the probability of said outcome.
Answer: The expected payoff on the first round is the expectation of a Binomial distribution with parameters $(4,\frac 12)$, i.e., it is $2$. The strategy is to toss again only if the initial number of heads is less than $2$.
Let $N_1$ (resp., $N_2$) be a random variable that models the number of heads on the first (resp., second) round. $N_1$ and $N_2$ are independent, and each has distribution $B(4,\frac 12)$.
The total payoff is $N_1 1_{N_1\geq 2} + N_21_{N_1\leq 1}$, and the expected payoff is $$E[N_1 1_{N_1\geq 2}] + E[N_2]
P(N_1\leq 1) = \frac {19}8 = 2.375.$$
Comment: could provide calculations of $E(N_1|N_1>1)$?
Comment: @wxist $E[N_1 1_{N_1\geq 2}] = \sum_{k=0}^4 k 1_{k \geq 2} \binom 4k \frac 1{2^4} = \sum_{k=2}^4 k  \binom 4k \frac 1{2^4}$.
Comment: could you explain why the expected payoff is $E(N_1 1_{N_1 \geq 2}) + E(N_2)P(N_1\leq 1)$, shouldn't it be equal $E(N_1|N_1\geq 2) P(N_1 \geq 2) + E(N_2|N_1\leq1)P(N_1\leq 1)$. And how to calculate $E(N_2|N_1\leq 1)$
Comment: @wxist By linearity of expectation, we look for $E[N_1 1_{N_1\geq 2}] + E[N_21_{N_1\leq 1}]$. Since $N_2$ and $N_1$ are independent, $N_2$ and $1_{N_1\leq 1}$ are also independent, thus $E[N_21_{N_1\leq 1}] = E[N_2]E[1_{N_1\leq 1}] = E[N_2]P(N_1\leq 1)$.
Answer: A shortcut here is to notice that if you always decided to take the second throw, your expected win would be $2$, since this is the expected result of the second throw. But if you throw three heads in the first round, you instead win $3$, gaining $1$. And if you throw four heads in the first round, you win $4$, gaining $2$. Therefore the expectation is $2+p_3+2p_4$, where $p_i$ is the probability of throwing $i$ heads in the first round.

Game with 4 coins


Delay in sound when connecting electronic drumset to a soundbar

Question: I recently got my Alesis Nitro Mesh Kit and it's awesome when I plug in my Audio Technica headphones. However, I have tried different Samsung, Sony and LG soundbars and I can sense a very very tiny delay in the output, while my headphones don't have any.
What could be the cause of this? Are there amps that you can recommend so that I don't have to worry about these delays?
Comment: How far away from the drums are you putting the sound bar?
Comment: @topomorto maybe 1 foot away from the base drum
Answer: Consumer audio products like the "sound bars" you mentioned are made for applications where precise timing is less important. Whether there's a 2.5 ms or a 25 ms delay between the input and the output isn't really important for music playback or even TV.
These products often combine analog and digital audio sources, and the easiest way to add e.g. equalization to the sound is to convert all sources to digital, then do all the processing in the digital domain, and then convert to analog again.
Conversion and digital processing inevitably adds a time delay, and if the product is not specifically aimed at musicians, minimizing this delay may not have been of prime concern during the design of the product.
What you need to amplify an instrument is either an amplifier specifically designed for that purpose, whether analog or digital, or a consumer audio product that is completely analog (for which you may have to go second-hand and probably pre-21st century). The people I know who play electronic drumsets all use either a dedicated e-drum amp, or a keyboard amp.
Comment: @summerNight Yes, something specifically made to amplify instruments. Preferable one made for e-drums, but a keyboard amp may work too. Guitar or bass amps will not be a good match.
Comment: Thanks! I will go to Guitar Center today and ask for an analog one. BTW, do you have any recommendations for an analogue amp that's less than $200?
Comment: @summerNight If you're buying an amp that's meant for e-drums or keyboards, it doesn't have to be analog; the digital ones will have minimal delay. It's just digital consumer products that you have to be wary of. Roland has a "personal drum monitor" PM-03 meant for the living room at about that price point; for band rehearsals or live gigs you'll probably need a larger amp, which start at around $300.
Comment: so I should be buying an amp and not sound bars, correct?


Why I cannot access EC2 instance public IP from inside of instance itself?

Question: Here is an example, I have an Linux instance , say, private IP is 10.10.10.10, public IP is 18.104.22.168.
Inside the instance, I could successfully ping it's private IP(10.10.10.10) and localhost. However, I cannot access it's public IP(18.104.22.168).
The reason I need to use it's public IP instead of localhost is because it's the same IP configuration which I will be used for this server as well as for other servers.
I can imagine it's related with part which how public IP associate with private IP. Therefore, the inbound and outbound traffic is somehow lost.  But I would really want to know more details.
Thanks.
Answer: I don't see an issue pinging my own public ip from inside the instance. make sure you add a rule in the security groups associated with the instance.
Comment: Thanks. I don't realise that security group will play the role if access via public IP.
Comment: You shouldn't do this, by the way -- you can be subject to bandwidth charges for the extra network overhead you create when accessing an ec2 instance on its public or elastic IP, from within ec2 and there's not really any definitive reason why that wouldn't apply to traffic that leaves the instance and returns, on the same IP.
Answer: Your elastic IP is not present on any local interfaces. If you want to bind a local service to an IP address, bind it to the private one and associate your EIP to it.
If you need to bind different instances of your service to different public EIP's, just use the same number of private IP's associated to them.
So you will end up with:
Service1 -> locally_bound_to 10.10.10.1 -> associated_to 220.127.116.11
Service2 -> locally_bound_to 10.10.10.2 -> associated_to 18.104.22.168
etc.


pandas read_csv: header/skiprows not working

Question: All-
First time asking a question here, apologies if format is bad, please let me know how to improve my question.
I am seeking a better understanding of the header and skiprows arguments of the pandas.read_csv() function.
Here is an example of the raw data I am trying to read in python:
MiniSonde 5 43656
"Log File Name : lwrhyp_deploy_20170104"
"Setup Date (MMDDYY) : 010417"
"Setup Time (HHMMSS) : 114539"
"Starting Date (MMDDYY) : 010417"
"Starting Time (HHMMSS) : 140000"
"Stopping Date (MMDDYY) : 123169"
"Stopping Time (HHMMSS) : 235959"
"Interval (HHMMSS) : 010000"
"Sensor warmup (HHMMSS) : 000100"
"Circltr warmup (HHMMSS) : 000030"

"Date","Time","","Temp","","SpCond","","Sal","","Dep25","","TDG","","TDG","","LDO%","","LDO","","IBatt",""
"MMDDYY","HHMMSS","","øC","","mS/cm","","ppt","","meters","","mmHg","","psia","","Sat","","mg/l","","Volts",""

01/04/17,14:00:00,"",7.97,"",.0691,"",.02,"",.75,"",735,"",14.22,"",52.7,"",6.15,"",11.4,""
01/04/17,15:00:00,"",7.9,"",.0692,"",.02,"",.76,"",736,"",14.23,"",52.8,"",6.17,"",11.4,""
01/04/17,16:00:00,"",7.89,"",.0694,"",.02,"",.77,"",736,"",14.23,"",52.3,"",6.12,"",11.4,""
01/04/17,17:00:00,"",7.88,"",.0699,"",.02,"",.78,"",735,"",14.21,"",51.8,"",6.06,"",11.4,""
01/04/17,18:00:00,"",7.85,"",.0699,"",.02,"",.78,"",733,"",14.18,"",51.3,"",6.01,"",11.4,""
01/04/17,19:00:00,"",7.83,"",.0706,"",.02,"",.78,"",731,"",14.14,"",51.3,"",6.01,"",11.4,""
01/04/17,20:00:00,"",7.81,"",.0706,"",.02,"",.79,"",730,"",14.12,"",51.1,"",5.99,"",11.4,""
01/04/17,21:00:00,"",7.81,"",.0699,"",.02,"",.79,"",730,"",14.11,"",50.8,"",5.95,"",11.4,""
01/04/17,22:00:00,"",7.76,"",.0702,"",.02,"",.8,"",729,"",14.1,"",50.5,"",5.92,"",11.3,""
01/04/17,23:00:00,"",7.76,"",.0704,"",.02,"",.8,"",729,"",14.09,"",50.5,"",5.93,"",11.3,""
01/05/17,00:00:00,"",7.76,"",.07,"",.02,"",.8,"",729,"",14.09,"",50.5,"",5.92,"",11.3,""

I am trying to use either the row beginning with "Date" or the row beginning with "MMDDYY" as my header row. When I open the raw data in a text editor the row that corresponds to "Date" is row 14 which would be row 13 in zero-indexed python land.
I used the following code thinking that it should skip the first 12 rows and begin reading data on row 13:
test = pd.read_csv(filepath, skiprows=12, skip_blank_lines=True)

but that produces the error:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf8 in position 0: invalid start byte

After a lot of fiddling around, trial and error style, I found that the following code produced the type of result I am after, however I do not understand why it works:
test = pd.read_csv(filepath, skiprows=[14], header=11, skip_blank_lines=True)

I do not understand how read_csv is counting the number of rows. Am I incorrect in that the header row is not on line 11 but rather is on line 13? The code only works if skiprows=[14], why is that?
On a side note, is there a way to prevent the blank columns that are present in the raw data from being read into the dataframe?
Comment: I dont think you need to have skiprows if you are using header=11
Comment: There is this "ø" character which might be causing the issue. try this first,    test = pd.read_csv(filepath, encoding = 'ISO-8859-1')
Comment: @VenkateshDurgumahanthi - changing the encoding was the ticket! Could you elaborate on why that worked?
Comment: @Ryan - the default encoding is "utf-8" which doesnot support special charecters. If we look at the error "UnicodeDecodeError" that clearly showws an encoding issue (presence of a special charecter).
Answer: First, skiprows isn't doing what you think it is here. When you give it a list as input, then it skips those rows when parsing the file. For what you want, just use header instead.
Second, pandas zero-indexes the file rows.
Third, when you have skip_blank_lines=True, it appears to reindex the rows of your file before considering the #header# value. So in your example, it will not index the blank lines 11 and 12 before your header (and the one after your headers). Remembering pandas zero-indexes the file rows, we can see how header=11 line sup on the header:
line/ : content
0:MiniSonde 5 43656
1:"Log File Name : lwrhyp_deploy_20170104"
2:"Setup Date (MMDDYY) : 010417"
3:"Setup Time (HHMMSS) : 114539"
4:"Starting Date (MMDDYY) : 010417"
5:"Starting Time (HHMMSS) : 140000"
6:"Stopping Date (MMDDYY) : 123169"
7:"Stopping Time (HHMMSS) : 235959"
8:"Interval (HHMMSS) : 010000"
9:"Sensor warmup (HHMMSS) : 000100"
10:"Circltr warmup (HHMMSS) : 000030"

11:"Date","Time","","Temp","","SpCond","","Sal","","Dep25","","TDG","","TDG","","LDO%","","LDO","","IBatt",""
12:"MMDDYY","HHMMSS","","øC","","mS/cm","","ppt","","meters","","mmHg","","psia","","Sat","","mg/l","","Volts",""

13:01/04/17,14:00:00,"",7.97,"",.0691,"",.02,"",.75,"",735,"",14.22,"",52.7,"",6.15,"",11.4,""
14:01/04/17,15:00:00,"",7.9,"",.0692,"",.02,"",.76,"",736,"",14.23,"",52.8,"",6.17,"",11.4,""
15:01/04/17,16:00:00,"",7.89,"",.0694,"",.02,"",.77,"",736,"",14.23,"",52.3,"",6.12,"",11.4,""
16:01/04/17,17:00:00,"",7.88,"",.0699,"",.02,"",.78,"",735,"",14.21,"",51.8,"",6.06,"",11.4,""
17:01/04/17,18:00:00,"",7.85,"",.0699,"",.02,"",.78,"",733,"",14.18,"",51.3,"",6.01,"",11.4,""
18:01/04/17,19:00:00,"",7.83,"",.0706,"",.02,"",.78,"",731,"",14.14,"",51.3,"",6.01,"",11.4,""
19:01/04/17,20:00:00,"",7.81,"",.0706,"",.02,"",.79,"",730,"",14.12,"",51.1,"",5.99,"",11.4,""
20:01/04/17,21:00:00,"",7.81,"",.0699,"",.02,"",.79,"",730,"",14.11,"",50.8,"",5.95,"",11.4,""
21:01/04/17,22:00:00,"",7.76,"",.0702,"",.02,"",.8,"",729,"",14.1,"",50.5,"",5.92,"",11.3,""
22:01/04/17,23:00:00,"",7.76,"",.0704,"",.02,"",.8,"",729,"",14.09,"",50.5,"",5.93,"",11.3,""
23:01/05/17,00:00:00,"",7.76,"",.07,"",.02,"",.8,"",729,"",14.09,"",50.5,"",5.92,"",11.3,""

Comment: Why must I have skiprows=[14] for the code to work? How could I make the  row that begins with 'MMDDYY' be the header row?
Comment: I don't need it, so not sure why that'd be. `df = pd.read_csv("test.txt", header=11, skip_blank_lines=True)` works fine for me.


Alterar os dados do array que vem da api

Question: Tenho uma dúvida em uma aplicação em react native gostaria da ajuda de vocês.
Como faço para incrementar um novo item no array que vem da api.
O array da api hoje retorna assim:
data:[{ id:1, name:'product01'}, {id:2, name:'product02' }];

Eu gostaria de colocar status dentro deste array para cada item. Como posso fazer?
Comment: utilizar o `.map` e fazer um novo `array`
Comment: um exemplo: https://pt.stackoverflow.com/questions/460562/javascript-map
Answer: Criar um novo array com map que vai passar por todos os itens e Object.assign que pode adicionar elementos novos em cada objeto, exemplo:

const data = [{ id:1, name:'product01'}, {id:2, name:'product02' }];

const changeData =
  data.map(function(item) {
    return Object.assign({}, item, { status: true });
  });

console.log(changeData);

Boa leitura:

Qual é a diferença entre Object.assign e spread operator?
Como listar um Array com .map()?
O que é map / reduce?
Comment: Muito obrigado, foi util pra mim.
Answer: Complementando a resposta do colega @novic pode utilizar o forEach(), conforme abaixo:

const data = [{ id: 1, name: 'product01' }, { id: 2, name: 'product02'}];
data.forEach(item => item = Object.assign(item, { status: true }));
console.log(data);


Output Not Fully Displaying When Running The Program in Java

Question: I am using BlueJ, for reference.
The program compiles and runs fine.
The problem is that the output does not output the entire thing.
Here is the current output:
H Sanders,HarlandDavid   277651 8.72 false
S Baron,James 368535 310236.0
S Moran,Blake 123456 260000.0
H Bob,Billy 654321 15.0 false
H Smith,Will 345612 10.5 true 30
6) Remove a worker who is NOT in the list
The Employee is not Found

7) Remove a worker who is the first in the list
H MacDonald,Ronald 386218 7.8 true 40
H Walton,Samuel 268517 8.21 false
H Thomas,David 131313 9.45 true 38
H Sanders,HarlandDavid   277651 8.72 false
S Baron,James 368535 310236.0
S Moran,Blake 123456 260000.0
H Bob,Billy 654321 15.0 false
H Smith,Will 345612 10.5 true 30

8) Find a worker who is the middle of the list
Found at 4

9) Find a worker who is NOT in the list
Found at -1

10) Find the weekly salary of a worker who is salaried
5000.0

11) Find the weekly salary of an hourly worker who has no overtime allowed [50 hours]
750.0

12) Find the weekly salary of an hourly worker who has overtime allowed [50 hours]
630.0

13) Find the weekly salary of an hourly worker who has overtime allowed [20 hours]
210.0

14) Print the sorted list
H MacDonald,Ronald 386218 7.8 true 40
H Walton,Samuel 268517 8.21 false
H Thomas,David 131313 9.45 true 38
H Sanders,HarlandDavid   277651 8.72 false
S Baron,James 368535 310236.0
S Moran,Blake 123456 260000.0
H Bob,Billy 654321 15.0 false
H Smith,Will 345612 10.5 true 30

15) End the process

As my main class WorkerApp shows, the output has about a third more to it. Instead, the output starts in the middle of 5) and shows the rest without outputting what is before 5).
import java.io.*;
import java.util.*;
public class WorkerApp{
/**
* Reads the infile, runs tests, and prints the output.
*/
public static void  main (String args[]){
    Company company = new Company();
    try{
        Scanner reader = new Scanner (new File("EmployeeData.txt"));
        while(reader.hasNext()){
            String line = reader.nextLine();
            String Employee[] = line.split("\\s+");
            String sorh = Employee[0];
            String name = Employee[1];
            String id = Employee[2];
            double salary = Double.parseDouble(Employee[3]);
            Employee e;
            if (Employee[0].equals("S")){
                e = new SalariedWorker(sorh, name, id, salary);}
            else {
                boolean overtime = Boolean.parseBoolean(Employee[4]);
                if(overtime){
                    int maxHours = Integer.parseInt(Employee[5]);
                     e = new HourlyWorker(sorh, name, id, salary, maxHours);
                }
                else{
                    e = new HourlyWorker(sorh, name, id, salary);
                }
            }
            company.add(e);
        }
    }catch (Exception err){
        //System.out.println(err);
        err.printStackTrace();
    }

    //Test Number 1
    System.out.println("1) Add a salaried worker");
    SalariedWorker SWorker1 = new SalariedWorker("S", "Moran,Blake", "123456", 260000);
    company.add(SWorker1);
    company.print();

    //Test Number 2
    System.out.println("2) Add an hourly worker who has no overtime allowed");
    HourlyWorker HWorker1 = new HourlyWorker("H", "Bob,Billy", "654321", 15);
    company.add(HWorker1);
    company.print();

    //Test Number 3
    System.out.println("3) Add an hourly worker who has overtime allowed");
    HourlyWorker HWorker2 = new HourlyWorker("H", "Smith,Will", "345612", 10.5, 30);
    company.add(HWorker2);
    company.print();

    //Test Number 4
    System.out.println("4) Add a worker that is already in the database");
    try{
        company.add(SWorker1);
    }catch(Exception err){
        System.out.println(err);
        System.out.println();
    }

    //Test Number 5
    System.out.println("5) Print the sorted list");
    company.print();

    //Test Number 6
    System.out.println("6) Remove a worker who is NOT in the list");
    company.remove("Brooks,Phil");
    System.out.println();

    //Test Number 7
    System.out.println("7) Remove a worker who is the first in the list ");
    company.remove("Washington,George");
    company.print();
    System.out.println();

    //Test Number 8
    System.out.println("8) Find a worker who is the middle of the list");
    int index = company.find("Baron,James");
    System.out.println("Found at "+ index);
    System.out.println();

    //Test Number 9
    System.out.println("9) Find a worker who is NOT in the list");
    index = company.find("Harrison,Ford");
    System.out.println("Found at "+ index);
    System.out.println();

    //Test Number 10
    System.out.println("10) Find the weekly salary of a worker who is salaried");
    System.out.println(SWorker1.FindSalary());
    System.out.println();

    //Test Number 11
    System.out.println("11) Find the weekly salary of an hourly worker who has no overtime allowed [50 hours]");
    System.out.println(HWorker1.FindSalary(50));
    System.out.println();

    //Test Number 12
    System.out.println("12) Find the weekly salary of an hourly worker who has overtime allowed [50 hours]");
    System.out.println(HWorker2.FindSalary(50));
    System.out.println();

    //Test Number 13
    System.out.println("13) Find the weekly salary of an hourly worker who has overtime allowed [20 hours]");
    System.out.println(HWorker2.FindSalary(20));
    System.out.println();

    //Test Number 14
    System.out.println("14) Print the sorted list");
    company.print();

    //Test Number 15
    System.out.println("\n15) End the process");
}
}

If it helps, this is the text file it reads:
S       Washington,George       000001      125000
H   MacDonald,Ronald        386218     7.80 true  40
H       Walton,Samuel           268517  8.21    false
H   Thomas,David            131313  9.45    true    38
H   Sanders,HarlandDavid    277651  8.72    false
S   Baron,James         368535  310236

And this is one of the major classes, Company:
import java.io.*;
import java.util.*;
public class Company{
private Employee[] employeeArray;
private final int InitialCapacity = 7;
private int employCount;

/**
* Creates the employee array and sets employCount to 0.
*/
public Company(){
    employeeArray = new Employee[InitialCapacity];
    employCount = 0;
}

/**
* Finds an employee in the list.
*/
public int find(String name){
    for (int i = 0; i < employCount; i++){
        if (employeeArray[i].getName().equals(name)){
            return i;
        }
    }

    return -1;
}

/**
* Adds an employee to the list.
*/
public int add(Employee employ){
    int index;
    for (index = 0; index < employCount; index++){
        int result = employeeArray[index].getName().compareTo(employ.getName());
        if(result == 0){
            throw new RuntimeException ("The Employee Is Not New");
        }
    }

    if (employeeArray.length == employCount){
        expand();
    }

    employeeArray[index] = employ;
    employCount++;
    return index;
}

/**
* Removes an employee to the list.
*/
public void remove(String name){
    int index = find(name);
    if (index == -1){
        System.out.println("The Employee is not Found");
        return;
    }

    for (int i = index; i < employCount - 1; i++){
        employeeArray[i] = employeeArray[i + 1];
    }

    employCount--;
}

/**
* Prints the list.
*/
public void print(){
    if(employCount == 0){
        System.out.println("The List is Empty");
        return;
    }

    for(int i = 0; i < employCount; i++){
        System.out.println(employeeArray[i]);
    }
}

/**
* Expands the list.
*/
private void expand(){
    Employee[] newArray = new Employee[employeeArray.length + InitialCapacity];
    for (int i = 0; i < employeeArray.length; i++){
        newArray[i] = employeeArray[i];
    }

    employeeArray = newArray;
}
}

Thank you in advance!
Answer: Seems as if you have to extend the outputted line numbers in BlueJ as shown here.
"In the BlueJ terminal window Go to Options and turn on Unlimited Buffering. This will solve your problem. You may also turn on Clear Screen at method calls to make each program run on a clear screen." - Extreme Coders


Likelihood test for goodness-of-fit for Accelerated Failure Time (AFT) models

Question: Background
From my understanding to the log likelihood test in survival analysis that this test calculated twice, first time its calculated for null model (no covariants) and second time its calculated to model with covariants. Then, as much we get small difference between these two values we can say that this model fit to our data well.
Applying this practically
Now let say I have two Accelerated Failure Time (AFT) AFT1 and AFT2 that fitted on the same data and same covariants but with different distributions.
Example
In R with survival package one can do the following:
Srv <- Surv(start, end, event, type="interval")# recurrent data
AFT1 <- survreg(Sur~ X1+cluster(ID)+X2,X3, data=test, dist="w") # first AFT model with Weibull distribution
AFT1 <- survreg(Sur~ X1+cluster(ID)+X2,X3, data=test, dist="exponential") # 2nd model with exponential distribution

let us check the results from two above models.
First model
Call:
survreg(formula = Sur ~ X1 +cluster(ID)+X2,X3, data=test, dist="w")

Coefficients:
  (Intercept)          X1       X2             X3
  7.606778e+00  7.419714e-05 -3.154395e-03  3.155968e-05

 Scale= 0.00198871

 Loglik(model)= -29235.1   Loglik(intercept only)= -31109.4
     Chisq= 3748.56 on 4 degrees of freedom, p= 0
 n=43416 (30 observations deleted due to missingness)

Second model
 Call:
 survreg(formula = Sur ~ X1 +cluster(ID)+X2,X3, data=test, dist="exponential")

  Coefficients:
   (Intercept)          X1       X2             X3
  7.606512e+00  7.923720e-05 -3.297417e-03  2.840966e-05

 Scale= 0.001035689

 Loglik(model)= -29144.8   Loglik(intercept only)= -31248
    Chisq= 4206.25 on 4 degrees of freedom, p= 0
 n=43416 (30 observations deleted due to missingness)

we can then check the difference in loglik value for the two models; Loglik(model) and  Loglik(intercept only) and we will get

Loglik for AFT1 = -31109.4 -(-29235.1 ) = −1874.3
Loglik for AFT2 = -31248   -(-29144.8 ) = −2103.2

Can we say that model AFT2 fit the our data better than AFT1 model?
Thanks in advance
Answer: The exponential AFT model is a special case of the Weibull regression, so you can create a likelihood ratio test to see if there is evidence against the simpler one (exponential). For this you can use the values of the log-likelihoods of the two models.
What I find strange in the outputs you presented above is that in the case of the exponential model the scale should be fixed at 1.
Answer: According to this in chapter six

When maximum likelihood estimation is used to generate the log-likelihoods, then the closer that the log-likelihood(LL) is to zero, the better is the model fit.

So we can say that AFT1 better than AFT2
Answer: Since you're doing this in R, you don't need to make inference by looking at model 1 vs null and model 2 vs null: you can compare them directly:
m1 <- survreg(formula = Sur ~ X1 +cluster(ID)+X2,X3, data=test, dist="w")
m2 <- survreg(formula = Sur ~ X1 +cluster(ID)+X2,X3, data=test, dist="exponential")

anova(m1, m2)

This will also give you a P value for the estimate that the fit is better for m2 vs m1.


A better approach to storing data in c++ with this format

Question: So I come from Python and still very new with c++. I would like to do a similar dictionary structure like this in c++
dataDict = { 1:('value 1', 'value 2',...), 2:('value 1', 'value 2',...) }
Usage: I plan on accesing them using their keys and edit/update their values if necessary. Does using a map possible or a multidimensional array?
Comment: The most direct equivalent data structure in C++ land would probably be `std::unordered_multimap` , because I think in python all maps are hash-maps.
Comment: Use a map, and a pair from STL
Comment: but if you know that the integer values are sequential and starting at 0 you're probably better off with `std::vector>`
Comment: Hi PeterT forgot to mention my keys are auto generated. I'll have a look at vector, thanks
Comment: peterT in your unordered multimap, I'm assuming your string part takes a single long string? What i need is a list of string. More like a list within a dictionary?
Comment: @eakdev a multimap is a map that can map multiple values to one key
Comment: peterT thank you, I should read more about that :)
Comment: After reading a bit about map and multimap,  i think its better i use map like this map> data; since i want the key values to be unique. Would this suffice?
Answer: You can use a
<code>std::map<std::string, T>
</code>
where T is the type of the data you want to store in the dictionary
Comment: Hi Jens, if I understand correctly your map is like a list of strings, what im aiming for isa a key:value pair where the value is a list/array of strings
Comment: Something like this: `std::map >`.


Theoretically, what is the maximum number of times any two English Premier League teams can play each other in a single season?

Question: Assuming that the two teams are eligible for every available competition, and including every scenario (such as cup replays, etc.), what would be the maximum number of times that two teams from the English Premier League could play each other in a single season?
Answer: So, let's work this out logically:

1 FA Community Shield match
3 Premier League matches (2 round-robin +  if there is a tie for championship, relegation, or qualification to other competitions, additional play-off match is played. See this question)
2 League Cup matches (semi-final with 2 legs)
2 FA Cup matches (1 tie + replay)
2 Champions League / Europa League matches (2 legs of the knockout round, because teams from the same association cannot be drawn into the same group for Champions League or Europa League. See this question)
1 UEFA Super Cup match (if one side won the Champions League and another the Europa League in the previous season)

That's 11 matches.
Comment: Nobody seems to be addressing the issue that 2 teams from the same league **cannot** play in the same champions league group... or am I making that rule up?
Comment: Initially I did think 4 Champions League, but then I remembered teams from the same league can't be in the same group... assuming I remembered correctly? In addition I have read somewhere about there being a potential league playoff for final position in the event points, GD and GF and all equal (and final position is important for qualification/relegation). I forgot about charity shield though
Comment: Sorry to pop up with another caveat for you - and for not being around much lately, but... You could play a team again if the game was abandoned.  This happened to my team, Sunderland. [Original match](http://news.bbc.co.uk/sport1/hi/football/eng_prem/4957438.stm) and [replayed match](http://news.bbc.co.uk/sport1/hi/football/eng_prem/4867558.stm). We played Fulham 3 times in the Premier League that season.
Comment: From 2007 take part to FIFA Club World Cup the six winner teams of continental competition and host nation team, so if the competition is hosted by England and an English team has won the last Championship league can take part two english teams
Comment: Is it possible for teams in the same Champions League group to meet in the quarter finals?
Comment: @musefan Correct; the Premier League will have playoffs if necessary; the details aren't specified, so there could even be more than one match.
Comment: @PhilipKendall according to the champions league website it's a free draw from the qf onwards, the round between the groups and the quarter finals two teams couldn't meet from the same group
Comment: @musefan You've asked a good question on that elsewhere. Let's see what happens here and then fix this answer up as appropriate.
Comment: @BenWhyall: I think if you could add something about the potential for 1 or more playoff games at the end of the season (as hinted [here](http://sports.stackexchange.com/a/12201/685) and mentioned above by Philip) then your answer would be pretty solid and I can accept it
Comment: If you go here: http://www.fifa.com/clubworldcup/clubs/index.html at the section Road to Japan under the Asia map, the site speaks about Guangzhou Evergrande and Sanfrecce Hiroshima.
Answer:
BPL: 2+1 playoff in case of a tie in points, GD and goals scored.
Community Shield: 1
FA Cup: 2 with a replay
League Cup: 2, in a semi-final;could be three if the semi-final can have a third match (see the Champions League section)
Club World Cup: If it was hosted in England, the teams could meet. (1)
CL: Now this is the one that noone's gotten so far: The teams could face each other up to 5 times; it is possible for two clubs from the same country to play in the same group, IF the other team qualified as the winner of the Europa League. Then there's the possibility of a quarter- or a semi-final with a third match played in the case of aggregate goals being tied after the fielding(s) of ineligible players changing result(s) to 3-0.
UEFA Super Cup: 1

I count that as 15 or 16, depending on whether a League Cup semi-final can have a replay.
Comment: Could you provide a citation for your assertions about the Champions League? The question linked from Ben Whyall's answer is pretty explicit in writing the rulebook which says that two teams from the same national association *cannot* be in the same group; ditto for your assertions about a third match.
Comment: Yeah, these are pretty interesting suggestions if you could provide some references to back them up? Particularly ability to play in same CL group, and that a 3rd CL knockout round match could occur if the first 2 legs are defaulted


Given concurrent cevians $AD$, $BE$, $CF$ of $\triangle ABC$, show $\text{area }\triangle DEF\leq \tfrac14\text{}\triangle ABC$

Question:
Let $M$ be a point in $\triangle ABC$. Lines $AM$, $BM$, $CM$ respectively intersect $BC$, $CA$, $AB$ at $D$, $E$, $F$. Prove that
  $$S_{DEF}\leq \tfrac{1}{4}S_{ABC}$$
  where $S_{XYZ}$ indicates the area of $\triangle XYZ$.
Comment: Please define $S_{ABC}$
Comment: $S_{ABC}$ is the area of $\triangle ABC$
Comment: @Cà Rốt Màu Xanh I solved your problem. If you want to see my solution, show please your attempts.
Answer:
$S_{DEF}\leq \frac{1}{4}S_{ABC}$ can be rewritten as $4S_{DEF}\leq S_{ABC}$.
You can scale this triangle so that its circumradius is equal to $\frac{1}{4}$, making $S_{ABC} = abc = (a_1+a_2)(b_1+b_2)(c_1+c_2)$. This is because $A = \frac{abc}{4R}$.
Start by finding the areas of $\triangle EDC$, $\triangle AFE$, and $\triangle FBD$.
$S_{AFE} = \frac{1}{2}c_1b_2\sin A$.  Since $2R = \frac{a}{\sin A}$, $\frac{1}{2} = \frac{a}{\sin A}$, and $\sin A=2a$. Plugging this into the area you get, $S_{AFE} = c_1b_2(a_1+a_2)$
With this method, $S_{CDE} = a_2b_1(c_1+c_2)$ and $S_{FBD} = a_1c_2(b_1+b_2)$.
Whe combined, the expressions for these areas contain all the terms from the expression of $S_{ABC}$ except $(a_1b_1c_1)$ and $(a_2b_2c_2)$. From this, you get the expression $S_{DEF}= S_{ABC}-S_{CDE}-S_{FBD}-S_{AFE} = (a_2b_2c_2) + (a_1b_1c_1)$
Ceva's Theorum states $\frac{a_1b_1c_1}{a_2b_2c_2} = 1$, so $a_1b_1c_1=a_2b_2c_2$.
$4S_{DEF}\leq S_{ABC}$ is equivilant to $3S_{DEF}\leq S_{ABC} - S_{DEF}$, which as shown above is equivalent to $3S_{DEF}\leq S_{CDE}+S_{FBD}+S_{AFE}$.
This can finally be rewritten as $3(a_2b_2c_2 + a_1b_1c_1) \leq (a_1b_1c_2+a_2b_2c_1)+(a_1c_1b_2+a_2c_2b_1)+(b_1c_1a_2+b_2c_2a_1)$
For the first set of parenthesis on the right, $a_1b_1c_2+a_2b_2c_1 = a_1b_1c_1(\frac{c_2}{c_1}) + a_2b_2c_2(\frac{c_1}{c_2}) = (\frac{c_1}{c_2}+\frac{c_2}{c_1})a_1b_1c_1$. Remember, $a_1b_1c_1=a_2b_2c_2$ due to Ceva's theorum.
Thus, the above inequality, with the first set of parenthesis, can be written as $2(a_1b_1c_1)\leq  (\frac{c_1}{c_2}+\frac{c_2}{c_1})a_1b_1c_1$, which is true. This same method can be repeated for the other two sets of parenthesis to get the required statement.
Answer: Let the segment ratios be
$$x= \frac {CD}{DB}, \>\>\> y= \frac {AE}{EC}, \>\>\> z= \frac {BF}{FA}$$
According to the Ceva's theorem,
$$xyx=1\tag{1}$$
Evaluate the area ratio
$$\frac{S_{AEF}}{S_{ABC}} = \frac{ \frac 12 AE\cdot AF\sin A}{\frac 12 AB\cdot AC\sin A}
=\frac{1}{(1+z)(1+\frac 1y)}=\frac{y}{(1+z)(1+y)}$$
Similarly,
$$\frac{S_{BDF}}{S_{ABC}} = \frac{z}{(1+x)(1+z)}, \>\>\>\>\> \frac{S_{CDE}}{S_{ABC}} = \frac{x}{(1+y)(1+x)}$$
Then,
$$\frac{S_{DEF}}{S_{ABC}} = 1 - \frac{S_{AEF} + S_{BDF}+S_{CDE} }{S_{ABC}} $$
$$= 1- \frac{y}{(1+z)(1+y)}-\frac{z}{(1+x)(1+z)}-\frac{x}{(1+y)(1+x)}$$
Simplify the expression,
$$\frac{S_{DEF}}{S_{ABC}} = \frac{2}{(1+x)(1+y)(1+z)} $$
Apply the AM-GM inequality to the denominator,
$$(1+x)(1+y)(1+z)=1+x+y+z+xy+yz+zx+xyz \ge 8[(xyz)^4]^{\frac 18}=8$$
Thus
$$\frac{S_{DEF}}{S_{ABC}} \le \frac 14$$