text:
Q: High Linux loads on low CPU/memory usage I have quite strange situation, where my CentOS 5.5 box loads are high, but the CPU and memory used are pretty low:
top - 20:41:38 up 42 days,  6:14,  2 users,  load average: 19.79, 21.25, 18.87
Tasks: 254 total,   1 running, 253 sleeping,   0 stopped,   0 zombie
Cpu(s):  3.8%us,  0.3%sy,  0.1%ni, 95.0%id,  0.6%wa,  0.0%hi,  0.1%si,  0.0%st
Mem:   4035284k total,  4008084k used,    27200k free,    38748k buffers
Swap:  4208928k total,   242576k used,  3966352k free,  1465008k cached

free -mt
             total       used       free     shared    buffers     cached
Mem:          3940       3910         29          0         37       1427
-/+ buffers/cache:       2445       1495
Swap:         4110        236       3873
Total:        8050       4147       3903

Iostat also shows good results:
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           3.83    0.13    0.41    0.58    0.00   95.05

Here is the ps aux output:
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0  10348    80 ?        Ss    2010   2:11 init [3]
root         2  0.0  0.0      0     0 ?        S<    2010   0:00 [migration/0]
root         3  0.0  0.0      0     0 ?        SN    2010   0:00 [ksoftirqd/0]
root         4  0.0  0.0      0     0 ?        S<    2010   0:00 [watchdog/0]
root         5  0.0  0.0      0     0 ?        S<    2010   0:02 [migration/1]
root         6  0.0  0.0      0     0 ?        SN    2010   0:00 [ksoftirqd/1]
root         7  0.0  0.0      0     0 ?        S<    2010   0:00 [watchdog/1]
root         8  0.0  0.0      0     0 ?        S<    2010   0:02 [migration/2]
root         9  0.0  0.0      0     0 ?        SN    2010   0:00 [ksoftirqd/2]
root        10  0.0  0.0      0     0 ?        S<    2010   0:00 [watchdog/2]
root        11  0.0  0.0      0     0 ?        S<    2010   0:02 [migration/3]
root        12  0.0  0.0      0     0 ?        SN    2010   0:00 [ksoftirqd/3]
root        13  0.0  0.0      0     0 ?        S<    2010   0:00 [watchdog/3]
root        14  0.0  0.0      0     0 ?        S<    2010   0:03 [migration/4]
root        15  0.0  0.0      0     0 ?        SN    2010   0:00 [ksoftirqd/4]
root        16  0.0  0.0      0     0 ?        S<    2010   0:00 [watchdog/4]
root        17  0.0  0.0      0     0 ?        S<    2010   0:01 [migration/5]
root        18  0.0  0.0      0     0 ?        SN    2010   0:00 [ksoftirqd/5]
root        19  0.0  0.0      0     0 ?        S<    2010   0:00 [watchdog/5]
root        20  0.0  0.0      0     0 ?        S<    2010   0:11 [migration/6]
root        21  0.0  0.0      0     0 ?        SN    2010   0:00 [ksoftirqd/6]
root        22  0.0  0.0      0     0 ?        S<    2010   0:00 [watchdog/6]
root        23  0.0  0.0      0     0 ?        S<    2010   0:01 [migration/7]
root        24  0.0  0.0      0     0 ?        SN    2010   0:00 [ksoftirqd/7]
root        25  0.0  0.0      0     0 ?        S<    2010   0:00 [watchdog/7]
root        26  0.0  0.0      0     0 ?        S<    2010   0:00 [migration/8]
root        27  0.0  0.0      0     0 ?        SN    2010   0:00 [ksoftirqd/8]
root        28  0.0  0.0      0     0 ?        S<    2010   0:00 [watchdog/8]
root        29  0.0  0.0      0     0 ?        S<    2010   0:00 [migration/9]
root        30  0.0  0.0      0     0 ?        SN    2010   0:00 [ksoftirqd/9]
root        31  0.0  0.0      0     0 ?        S<    2010   0:00 [watchdog/9]
root        32  0.0  0.0      0     0 ?        S<    2010   0:08 [migration/10]
root        33  0.0  0.0      0     0 ?        SN    2010   0:00 [ksoftirqd/10]
root        34  0.0  0.0      0     0 ?        S<    2010   0:00 [watchdog/10]
root        35  0.0  0.0      0     0 ?        S<    2010   0:05 [migration/11]
root        36  0.0  0.0      0     0 ?        SN    2010   0:00 [ksoftirqd/11]
root        37  0.0  0.0      0     0 ?        S<    2010   0:00 [watchdog/11]
root        38  0.0  0.0      0     0 ?        S<    2010   0:02 [migration/12]
root        39  0.0  0.0      0     0 ?        SN    2010   0:00 [ksoftirqd/12]
root        40  0.0  0.0      0     0 ?        S<    2010   0:00 [watchdog/12]
root        41  0.0  0.0      0     0 ?        S<    2010   0:14 [migration/13]
root        42  0.0  0.0      0     0 ?        SN    2010   0:00 [ksoftirqd/13]
root        43  0.0  0.0      0     0 ?        S<    2010   0:00 [watchdog/13]
root        44  0.0  0.0      0     0 ?        S<    2010   0:04 [migration/14]
root        45  0.0  0.0      0     0 ?        SN    2010   0:00 [ksoftirqd/14]
root        46  0.0  0.0      0     0 ?        S<    2010   0:00 [watchdog/14]
root        47  0.0  0.0      0     0 ?        S<    2010   0:01 [migration/15]
root        48  0.0  0.0      0     0 ?        SN    2010   0:00 [ksoftirqd/15]
root        49  0.0  0.0      0     0 ?        S<    2010   0:00 [watchdog/15]
root        50  0.0  0.0      0     0 ?        S<    2010   0:00 [events/0]
root        51  0.0  0.0      0     0 ?        S<    2010   0:00 [events/1]
root        52  0.0  0.0      0     0 ?        S<    2010   0:00 [events/2]
root        53  0.0  0.0      0     0 ?        S<    2010   0:00 [events/3]
root        54  0.0  0.0      0     0 ?        S<    2010   0:00 [events/4]
root        55  0.0  0.0      0     0 ?        S<    2010   0:00 [events/5]
root        56  0.0  0.0      0     0 ?        S<    2010   0:00 [events/6]
root        57  0.0  0.0      0     0 ?        S<    2010   0:00 [events/7]
root        58  0.0  0.0      0     0 ?        S<    2010   0:00 [events/8]
root        59  0.0  0.0      0     0 ?        S<    2010   0:00 [events/9]
root        60  0.0  0.0      0     0 ?        S<    2010   0:00 [events/10]
root        61  0.0  0.0      0     0 ?        S<    2010   0:00 [events/11]
root        62  0.0  0.0      0     0 ?        S<    2010   0:00 [events/12]
root        63  0.0  0.0      0     0 ?        S<    2010   0:00 [events/13]
root        64  0.0  0.0      0     0 ?        S<    2010   0:00 [events/14]
root        65  0.0  0.0      0     0 ?        S<    2010   0:00 [events/15]
root        66  0.0  0.0      0     0 ?        S<    2010   0:00 [khelper]
root       107  0.0  0.0      0     0 ?        S<    2010   0:00 [kthread]
root       126  0.0  0.0      0     0 ?        S<    2010   0:00 [kblockd/0]
root       127  0.0  0.0      0     0 ?        S<    2010   0:03 [kblockd/1]
root       128  0.0  0.0      0     0 ?        S<    2010   0:01 [kblockd/2]
root       129  0.0  0.0      0     0 ?        S<    2010   0:00 [kblockd/3]
root       130  0.0  0.0      0     0 ?        S<    2010   0:05 [kblockd/4]
root       131  0.0  0.0      0     0 ?        S<    2010   0:00 [kblockd/5]
root       132  0.0  0.0      0     0 ?        S<    2010   0:00 [kblockd/6]
root       133  0.0  0.0      0     0 ?        S<    2010   0:00 [kblockd/7]
root       134  0.0  0.0      0     0 ?        S<    2010   0:00 [kblockd/8]
root       135  0.0  0.0      0     0 ?        S<    2010   0:02 [kblockd/9]
root       136  0.0  0.0      0     0 ?        S<    2010   0:00 [kblockd/10]
root       137  0.0  0.0      0     0 ?        S<    2010   0:00 [kblockd/11]
root       138  0.0  0.0      0     0 ?        S<    2010   0:04 [kblockd/12]
root       139  0.0  0.0      0     0 ?        S<    2010   0:00 [kblockd/13]
root       140  0.0  0.0      0     0 ?        S<    2010   0:00 [kblockd/14]
root       141  0.0  0.0      0     0 ?        S<    2010   0:00 [kblockd/15]
root       142  0.0  0.0      0     0 ?        S<    2010   0:00 [kacpid]
root       281  0.0  0.0      0     0 ?        S<    2010   0:00 [cqueue/0]
root       282  0.0  0.0      0     0 ?        S<    2010   0:00 [cqueue/1]
root       283  0.0  0.0      0     0 ?        S<    2010   0:00 [cqueue/2]
root       284  0.0  0.0      0     0 ?        S<    2010   0:00 [cqueue/3]
root       285  0.0  0.0      0     0 ?        S<    2010   0:00 [cqueue/4]
root       286  0.0  0.0      0     0 ?        S<    2010   0:00 [cqueue/5]
root       287  0.0  0.0      0     0 ?        S<    2010   0:00 [cqueue/6]
root       288  0.0  0.0      0     0 ?        S<    2010   0:00 [cqueue/7]
root       289  0.0  0.0      0     0 ?        S<    2010   0:00 [cqueue/8]
root       290  0.0  0.0      0     0 ?        S<    2010   0:00 [cqueue/9]
root       291  0.0  0.0      0     0 ?        S<    2010   0:00 [cqueue/10]
root       292  0.0  0.0      0     0 ?        S<    2010   0:00 [cqueue/11]
root       293  0.0  0.0      0     0 ?        S<    2010   0:00 [cqueue/12]
root       294  0.0  0.0      0     0 ?        S<    2010   0:00 [cqueue/13]
root       295  0.0  0.0      0     0 ?        S<    2010   0:00 [cqueue/14]
root       296  0.0  0.0      0     0 ?        S<    2010   0:00 [cqueue/15]
root       299  0.0  0.0      0     0 ?        S<    2010   0:00 [khubd]
root       301  0.0  0.0      0     0 ?        S<    2010   0:00 [kseriod]
root       490  0.0  0.0      0     0 ?        S     2010   0:00 [khungtaskd]
root       493  0.1  0.0      0     0 ?        S<    2010  94:48 [kswapd1]
root       494  0.0  0.0      0     0 ?        S<    2010   0:00 [aio/0]
root       495  0.0  0.0      0     0 ?        S<    2010   0:00 [aio/1]
root       496  0.0  0.0      0     0 ?        S<    2010   0:00 [aio/2]
root       497  0.0  0.0      0     0 ?        S<    2010   0:00 [aio/3]
root       498  0.0  0.0      0     0 ?        S<    2010   0:00 [aio/4]
root       499  0.0  0.0      0     0 ?        S<    2010   0:00 [aio/5]
root       500  0.0  0.0      0     0 ?        S<    2010   0:00 [aio/6]
root       501  0.0  0.0      0     0 ?        S<    2010   0:00 [aio/7]
root       502  0.0  0.0      0     0 ?        S<    2010   0:00 [aio/8]
root       503  0.0  0.0      0     0 ?        S<    2010   0:00 [aio/9]
root       504  0.0  0.0      0     0 ?        S<    2010   0:00 [aio/10]
root       505  0.0  0.0      0     0 ?        S<    2010   0:00 [aio/11]
root       506  0.0  0.0      0     0 ?        S<    2010   0:00 [aio/12]
root       507  0.0  0.0      0     0 ?        S<    2010   0:00 [aio/13]
root       508  0.0  0.0      0     0 ?        S<    2010   0:00 [aio/14]
root       509  0.0  0.0      0     0 ?        S<    2010   0:00 [aio/15]
root       665  0.0  0.0      0     0 ?        S<    2010   0:00 [kpsmoused]
root       808  0.0  0.0      0     0 ?        S<    2010   0:00 [ata/0]
root       809  0.0  0.0      0     0 ?        S<    2010   0:00 [ata/1]
root       810  0.0  0.0      0     0 ?        S<    2010   0:00 [ata/2]
root       811  0.0  0.0      0     0 ?        S<    2010   0:00 [ata/3]
root       812  0.0  0.0      0     0 ?        S<    2010   0:00 [ata/4]
root       813  0.0  0.0      0     0 ?        S<    2010   0:00 [ata/5]
root       814  0.0  0.0      0     0 ?        S<    2010   0:00 [ata/6]
root       815  0.0  0.0      0     0 ?        S<    2010   0:00 [ata/7]
root       816  0.0  0.0      0     0 ?        S<    2010   0:00 [ata/8]
root       817  0.0  0.0      0     0 ?        S<    2010   0:00 [ata/9]
root       818  0.0  0.0      0     0 ?        S<    2010   0:00 [ata/10]
root       819  0.0  0.0      0     0 ?        S<    2010   0:00 [ata/11]
root       820  0.0  0.0      0     0 ?        S<    2010   0:00 [ata/12]
root       821  0.0  0.0      0     0 ?        S<    2010   0:00 [ata/13]
root       822  0.0  0.0      0     0 ?        S<    2010   0:00 [ata/14]
root       823  0.0  0.0      0     0 ?        S<    2010   0:00 [ata/15]
root       824  0.0  0.0      0     0 ?        S<    2010   0:00 [ata_aux]
root       842  0.0  0.0      0     0 ?        S<    2010   0:00 [scsi_eh_0]
root       843  0.0  0.0      0     0 ?        S<    2010   0:00 [scsi_eh_1]
root       844  0.0  0.0      0     0 ?        S<    2010   0:00 [scsi_eh_2]
root       845  0.0  0.0      0     0 ?        S<    2010   0:00 [scsi_eh_3]
root       846  0.0  0.0      0     0 ?        S<    2010   0:00 [scsi_eh_4]
root       847  0.0  0.0      0     0 ?        S<    2010   0:00 [scsi_eh_5]
root       882  0.0  0.0      0     0 ?        S<    2010   0:00 [kstriped]
root       951  0.0  0.0      0     0 ?        S<    2010   4:24 [kjournald]
root       976  0.0  0.0      0     0 ?        S<    2010   0:00 [kauditd]
postfix    990  0.0  0.0  54208  2284 ?        S    21:19   0:00 pickup -l -t fifo -u
root      1013  0.0  0.0  12676     8 ?        S<s   2010   0:00 /sbin/udevd -d
root      1326  0.0  0.0  90900  3400 ?        Ss   14:53   0:00 sshd: root@notty
root      1410  0.0  0.0  53972  2108 ?        Ss   14:53   0:00 /usr/libexec/openssh/sftp-server
root      2690  0.0  0.0      0     0 ?        S<    2010   0:00 [kmpathd/0]
root      2691  0.0  0.0      0     0 ?        S<    2010   0:00 [kmpathd/1]
root      2692  0.0  0.0      0     0 ?        S<    2010   0:00 [kmpathd/2]
root      2693  0.0  0.0      0     0 ?        S<    2010   0:00 [kmpathd/3]
root      2694  0.0  0.0      0     0 ?        S<    2010   0:00 [kmpathd/4]
root      2695  0.0  0.0      0     0 ?        S<    2010   0:00 [kmpathd/5]
root      2696  0.0  0.0      0     0 ?        S<    2010   0:00 [kmpathd/6]
root      2697  0.0  0.0      0     0 ?        S<    2010   0:00 [kmpathd/7]
root      2698  0.0  0.0      0     0 ?        S<    2010   0:00 [kmpathd/8]
root      2699  0.0  0.0      0     0 ?        S<    2010   0:00 [kmpathd/9]
root      2700  0.0  0.0      0     0 ?        S<    2010   0:00 [kmpathd/10]
root      2701  0.0  0.0      0     0 ?        S<    2010   0:00 [kmpathd/11]
root      2702  0.0  0.0      0     0 ?        S<    2010   0:00 [kmpathd/12]
root      2703  0.0  0.0      0     0 ?        S<    2010   0:00 [kmpathd/13]
root      2704  0.0  0.0      0     0 ?        S<    2010   0:00 [kmpathd/14]
root      2705  0.0  0.0      0     0 ?        S<    2010   0:00 [kmpathd/15]
root      2706  0.0  0.0      0     0 ?        S<    2010   0:00 [kmpath_handlerd]
root      2755  0.0  0.0      0     0 ?        S<    2010   4:35 [kjournald]
root      2757  0.0  0.0      0     0 ?        S<    2010   3:38 [kjournald]
root      2759  0.0  0.0      0     0 ?        S<    2010   4:10 [kjournald]
root      2761  0.0  0.0      0     0 ?        S<    2010   4:26 [kjournald]
root      2763  0.0  0.0      0     0 ?        S<    2010   3:15 [kjournald]
root      2765  0.0  0.0      0     0 ?        S<    2010   3:04 [kjournald]
root      2767  0.0  0.0      0     0 ?        S<    2010   3:02 [kjournald]
root      2769  0.0  0.0      0     0 ?        S<    2010   2:58 [kjournald]
root      2771  0.0  0.0      0     0 ?        S<    2010   0:00 [kjournald]
root      3340  0.0  0.0   5908   356 ?        Ss    2010   2:48 syslogd -m 0
root      3343  0.0  0.0   3804   212 ?        Ss    2010   0:03 klogd -x
root      3430  0.0  0.0      0     0 ?        S<    2010   0:50 [kondemand/0]
root      3431  0.0  0.0      0     0 ?        S<    2010   0:54 [kondemand/1]
root      3432  0.0  0.0      0     0 ?        S<    2010   0:00 [kondemand/2]
root      3433  0.0  0.0      0     0 ?        S<    2010   0:00 [kondemand/3]
root      3434  0.0  0.0      0     0 ?        S<    2010   0:00 [kondemand/4]
root      3435  0.0  0.0      0     0 ?        S<    2010   0:00 [kondemand/5]
root      3436  0.0  0.0      0     0 ?        S<    2010   0:00 [kondemand/6]
root      3437  0.0  0.0      0     0 ?        S<    2010   0:00 [kondemand/7]
root      3438  0.0  0.0      0     0 ?        S<    2010   0:00 [kondemand/8]
root      3439  0.0  0.0      0     0 ?        S<    2010   0:00 [kondemand/9]
root      3440  0.0  0.0      0     0 ?        S<    2010   0:00 [kondemand/10]
root      3441  0.0  0.0      0     0 ?        S<    2010   0:00 [kondemand/11]
root      3442  0.0  0.0      0     0 ?        S<    2010   0:00 [kondemand/12]
root      3443  0.0  0.0      0     0 ?        S<    2010   0:00 [kondemand/13]
root      3444  0.0  0.0      0     0 ?        S<    2010   0:00 [kondemand/14]
root      3445  0.0  0.0      0     0 ?        S<    2010   0:00 [kondemand/15]
root      3461  0.0  0.0  10760   284 ?        Ss    2010   3:44 irqbalance
rpc       3481  0.0  0.0   8052     4 ?        Ss    2010   0:00 portmap
root      3526  0.0  0.0      0     0 ?        S<    2010   0:00 [rpciod/0]
root      3527  0.0  0.0      0     0 ?        S<    2010   0:00 [rpciod/1]
root      3528  0.0  0.0      0     0 ?        S<    2010   0:00 [rpciod/2]
root      3529  0.0  0.0      0     0 ?        S<    2010   0:00 [rpciod/3]
root      3530  0.0  0.0      0     0 ?        S<    2010   0:00 [rpciod/4]
root      3531  0.0  0.0      0     0 ?        S<    2010   0:00 [rpciod/5]
root      3532  0.0  0.0      0     0 ?        S<    2010   0:00 [rpciod/6]
root      3533  0.0  0.0      0     0 ?        S<    2010   0:00 [rpciod/7]
root      3534  0.0  0.0      0     0 ?        S<    2010   0:00 [rpciod/8]
root      3535  0.0  0.0      0     0 ?        S<    2010   0:00 [rpciod/9]
root      3536  0.0  0.0      0     0 ?        S<    2010   0:00 [rpciod/10]
root      3537  0.0  0.0      0     0 ?        S<    2010   0:00 [rpciod/11]
root      3538  0.0  0.0      0     0 ?        S<    2010   0:00 [rpciod/12]
root      3539  0.0  0.0      0     0 ?        S<    2010   0:00 [rpciod/13]
root      3540  0.0  0.0      0     0 ?        S<    2010   0:00 [rpciod/14]
root      3541  0.0  0.0      0     0 ?        S<    2010   0:00 [rpciod/15]
root      3563  0.0  0.0  10160     8 ?        Ss    2010   0:00 rpc.statd
root      3595  0.0  0.0  55180     4 ?        Ss    2010   0:00 rpc.idmapd
dbus      3618  0.0  0.0  21256    28 ?        Ss    2010   0:00 dbus-daemon --system
root      3649  0.2  0.4 563084 18796 ?        S<sl  2010 179:03 mfsmount /mnt/mfs -o rw,mfsmaster=web1.ovs.local
root      3702  0.0  0.0   3800     8 ?        Ss    2010   0:00 /usr/sbin/acpid
68        3715  0.0  0.0  31312   816 ?        Ss    2010   3:14 hald
root      3716  0.0  0.0  21692    28 ?        S     2010   0:00 hald-runner
68        3726  0.0  0.0  12324     8 ?        S     2010   0:00 hald-addon-acpi: listening on acpid socket /var/run/acpid.socket
68        3730  0.0  0.0  12324     8 ?        S     2010   0:00 hald-addon-keyboard: listening on /dev/input/event0
root      3773  0.0  0.0  62608   332 ?        Ss    2010   0:00 /usr/sbin/sshd
ganglia   3786  0.0  0.0  24704   988 ?        Ss    2010  14:26 /usr/sbin/gmond
root      3843  0.0  0.0  54144   300 ?        Ss    2010   1:49 /usr/libexec/postfix/master
postfix   3855  0.0  0.0  54860  1060 ?        S     2010   0:22 qmgr -l -t fifo -u
root      3877  0.0  0.0  74828   708 ?        Ss    2010   1:15 crond
root      3891  1.4  1.9 326960 77704 ?        S<l   2010 896:59 mfschunkserver
root      4122  0.0  0.0  18732   176 ?        Ss    2010   0:10 /usr/sbin/atd
root      4193  0.0  0.8 129180 35984 ?        Ssl   2010  11:04 /usr/bin/ruby /usr/sbin/puppetd
root      4223  0.0  0.0  18416   172 ?        S     2010   0:10 /usr/sbin/smartd -q never
root      4227  0.0  0.0   3792     8 tty1     Ss+   2010   0:00 /sbin/mingetty tty1
root      4230  0.0  0.0   3792     8 tty2     Ss+   2010   0:00 /sbin/mingetty tty2
root      4231  0.0  0.0   3792     8 tty3     Ss+   2010   0:00 /sbin/mingetty tty3
root      4233  0.0  0.0   3792     8 tty4     Ss+   2010   0:00 /sbin/mingetty tty4
root      4234  0.0  0.0   3792     8 tty5     Ss+   2010   0:00 /sbin/mingetty tty5
root      4236  0.0  0.0   3792     8 tty6     Ss+   2010   0:00 /sbin/mingetty tty6
root      5596  0.0  0.0  19368    20 ?        Ss    2010   0:00 DarwinStreamingServer
qtss      5597  0.8  0.9 166572 37408 ?        Sl    2010 523:02 DarwinStreamingServer
root      8714  0.0  0.0      0     0 ?        S    Jan31   0:33 [pdflush]
root      9914  0.0  0.0  65612   968 pts/1    R+   21:49   0:00 ps aux
root     10765  0.0  0.0  76792  1080 ?        Ss   Jan24   0:58 SCREEN
root     10766  0.0  0.0  66212   872 pts/3    Ss   Jan24   0:00 /bin/bash
root     11833  0.0  0.0  63852  1060 pts/3    S+   17:17   0:00 /bin/sh ./launch.sh
root     11834  437 42.9 4126884 1733348 pts/3 Sl+  17:17 1190:50 /usr/bin/java -Xms128m -Xmx512m -XX:+UseConcMarkSweepGC -jar /JavaCore/JavaCore.jar
root     13127  4.7  1.1 110564 46876 ?        Ssl  17:18  12:55 /JavaCore/fetcher.bin
root     19392  0.0  0.0  90108  3336 ?        Rs   20:35   0:00 sshd: root@pts/1
root     19401  0.0  0.0  66216  1640 pts/1    Ss   20:35   0:00 -bash
root     20567  0.0  0.0  90108   412 ?        Ss   Jan16   1:58 sshd: root@pts/0
root     20569  0.0  0.0  66084   912 pts/0    Ss   Jan16   0:00 -bash
root     21053  0.0  0.0  63856    28 ?        S    Jan30   0:00 /bin/sh /usr/bin/WowzaMediaServerd /usr/local/WowzaMediaServer/bin/setenv.sh /var/run/WowzaM
root     21054  2.9 10.3 2252652 418468 ?      Sl   Jan30 314:25 java -Xmx1200M -server -Djava.net.preferIPv4Stack=true -Dcom.sun.management.jmxremote=true -
root     21915  0.0  0.0      0     0 ?        S    Feb01   0:00 [pdflush]
root     29996  0.0  0.0  76524  1004 pts/0    S+   14:41   0:00 screen -x

sar -W output:
12:00:01 AM  pswpin/s pswpout/s
12:10:01 AM      0.00      0.00
12:20:01 AM      0.00      0.00
12:30:02 AM      0.00      0.00
12:40:01 AM      0.00      0.00
12:50:01 AM      0.00      0.00
01:00:01 AM      0.00      0.00
01:10:01 AM      0.00      0.00
01:20:01 AM      0.00      0.00
01:30:01 AM      0.00      0.00
01:40:01 AM      0.00      0.00
01:50:01 AM      0.00      0.00
02:00:02 AM      0.00      0.00
02:10:01 AM      0.07      0.00
02:20:01 AM      0.00      0.00
02:30:02 AM      0.00      0.00
02:40:01 AM      0.00      0.00
02:50:01 AM      0.00      0.00
03:00:01 AM      0.00      0.00
03:10:01 AM      0.00      0.00
03:20:01 AM      0.00      0.00
03:30:01 AM      0.00      0.00
03:40:02 AM      0.00      0.00
03:50:01 AM      0.00      0.00
04:00:01 AM      0.00      0.00
04:10:01 AM      0.00      0.00
04:20:02 AM      0.01      0.00
04:30:01 AM      0.00      0.00
04:40:02 AM      0.11      0.00
04:50:01 AM      0.01      0.00
05:00:02 AM      0.03      0.00
05:10:01 AM      0.00      0.00
05:20:02 AM      0.01      0.00
05:30:01 AM      0.04      0.00
05:40:02 AM      0.08      0.00
05:50:01 AM      0.00      0.00
06:00:02 AM      0.11      0.00
06:10:01 AM      0.01      0.00
06:20:01 AM      0.00      0.00
06:30:02 AM      0.00      0.00
06:40:01 AM      0.05      0.00
06:50:02 AM      0.00      0.00
07:00:02 AM      0.01      0.00
07:10:01 AM      0.02      0.00
07:20:02 AM      0.00      0.00
07:30:01 AM      0.00      0.00
07:40:02 AM      0.17      0.00
07:50:01 AM      0.11      0.00
08:00:02 AM      0.00      0.00
08:10:01 AM      0.04      0.00
08:20:02 AM      0.00      0.00
08:30:01 AM      0.00      0.00
08:40:02 AM      0.03      0.00
08:50:01 AM      0.00      0.00
09:00:02 AM      0.08      0.00
09:10:01 AM      0.00      0.00
Average:         0.02      0.00

sar -d 5 0 output
09:18:40 AM       DEV       tps  rd_sec/s  wr_sec/s  avgrq-sz  avgqu-sz     await     svctm     %util
09:18:45 AM    dev8-0     21.96     11.18   2128.54     97.45      0.62     20.33      1.75      3.85
09:18:45 AM    dev8-1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
09:18:45 AM    dev8-2     18.16      0.00    507.78     27.96      0.39     21.42      1.09      1.98
09:18:45 AM    dev8-3      3.79     11.18   1620.76    430.32      0.23     15.11      4.95      1.88
09:18:45 AM    dev8-4      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
09:18:45 AM    dev8-5      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
09:18:45 AM   dev8-16     19.36      0.00    619.56     32.00      0.35     18.22      0.94      1.82
09:18:45 AM   dev8-17     17.96      0.00    594.01     33.07      0.35     19.61      0.99      1.78
09:18:45 AM   dev8-18      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
09:18:45 AM   dev8-19      1.40      0.00     25.55     18.29      0.00      0.29      0.29      0.04
09:18:45 AM   dev8-20      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
09:18:45 AM   dev8-21      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
09:18:45 AM   dev8-32     25.55    742.51    846.31     62.19      0.69     27.04      1.63      4.17
09:18:45 AM   dev8-33     22.55      0.00    844.71     37.45      0.68     30.18      1.41      3.17
09:18:45 AM   dev8-34      2.99    742.51      1.60    248.53      0.01      3.40      3.40      1.02
09:18:45 AM   dev8-35      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
09:18:45 AM   dev8-48     18.16      0.00    645.11     35.52      0.41     22.65      1.09      1.98
09:18:45 AM   dev8-49     18.16      0.00    645.11     35.52      0.41     22.65      1.09      1.98
09:18:45 AM   dev8-50      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
09:18:45 AM   dev8-51      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00

sar -w output:
12:00:01 AM   cswch/s
05:10:01 AM  51556.52
05:20:02 AM  54484.96
05:30:01 AM  57533.58
05:40:02 AM  57956.67
05:50:01 AM  57885.02
06:00:02 AM  46017.63
06:10:01 AM  21778.29
06:20:01 AM  43464.68
06:30:02 AM  51766.88
06:40:01 AM  53879.12
06:50:02 AM  56531.08
07:00:02 AM  57732.89
07:10:01 AM  57658.24
07:20:02 AM  58209.16
07:30:01 AM  58446.37
07:40:02 AM  58537.84
07:50:01 AM  58243.39
08:00:02 AM  58362.02
08:10:01 AM  58291.73
08:20:02 AM  58370.15
08:30:01 AM  58545.73
08:40:02 AM  58448.40
08:50:01 AM  58198.55
09:00:02 AM  58313.22
09:10:01 AM  58122.85
09:20:02 AM  58517.96
09:30:01 AM  58338.94
09:40:02 AM  58317.30
09:50:01 AM  58312.40
10:00:01 AM  58337.53
10:10:02 AM  58167.55
10:20:01 AM  58408.61
10:30:01 AM  58133.29
10:40:01 AM  58165.08
10:50:02 AM  58240.77
11:00:01 AM  58236.16

Average:      cswch/s
Average:     55991.47

sar -I SUM output:
12:00:01 AM      INTR    intr/s
05:10:01 AM       sum   3825.03
05:20:02 AM       sum   3999.32
05:30:01 AM       sum   4038.10
05:40:02 AM       sum   4041.99
05:50:01 AM       sum   4015.39
06:00:02 AM       sum   3450.48
06:10:01 AM       sum   2385.73
06:20:01 AM       sum   3355.96
06:30:02 AM       sum   3641.50
06:40:01 AM       sum   3807.91
06:50:02 AM       sum   3853.99
07:00:02 AM       sum   3951.29
07:10:01 AM       sum   3996.06
07:20:02 AM       sum   4005.63
07:30:01 AM       sum   3939.43
07:40:02 AM       sum   3901.39
07:50:01 AM       sum   3920.22
08:00:02 AM       sum   3950.27
08:10:01 AM       sum   3926.09
08:20:02 AM       sum   4072.29
08:30:01 AM       sum   4058.93
08:40:02 AM       sum   3994.94
08:50:01 AM       sum   3969.04
09:00:02 AM       sum   3976.33
09:10:01 AM       sum   3904.43
09:20:02 AM       sum   4054.35
09:30:01 AM       sum   4006.06
09:40:02 AM       sum   3962.65
09:50:01 AM       sum   4016.83
10:00:01 AM       sum   4064.52
10:10:02 AM       sum   3934.29
10:20:01 AM       sum   4029.60
10:30:01 AM       sum   3939.23
10:40:01 AM       sum   3937.37
10:50:02 AM       sum   3961.87
11:00:01 AM       sum   4014.83

Average:         INTR    intr/s
Average:          sum   3794.24

Any idea what could this be, or where I should look for more diagnostic information?
Thanks.

A: Intuitively, I'd suspect a disk issue as the most direct cause, but that doesn't mean your disks are too slow. Your iowait % from iostat doesn't indicate that any user processes are spending a lot of time waiting for disk I/O. However, your CPU time on kswapd gives me cause for concern:
root       493  0.1  0.0      0     0 ?        S<    2010  94:48 [kswapd1]

The 242MB of swap you're using may not seem like a lot, but to hit that kind of CPU time on a system that's only been up for 42 days you've either got a lot of swap activity happening or it's taking forever to finish once it starts because of other disk contention. Whether this is the source of your problem or not, it's something I would definitely look into.
Can you run sar -W and post the swap statistics for your system?

A: The most common cause of high load is slow drives. Try running the following
sar -d 5 0

and looking at the %util field. If that number is over 70% for any of your drives, that drive will be slow in handling IO requests causing the high load.
Edit: It might run OK at 70%, but thats the point where you'll probably start to see performance degradation. The higher you go, the worse it'll get.

A: Lots of system processes in "S<" state. On my machine they're listed as being just in "S". From man ps: <    high-priority (not nice to other users). Something looks really screwed up. Try updating your kernel if it can be done and reboot.

A: What kind of network connection your server has? I have seen loads sky-rocketing in situations where the connection to switch was supposed to be 100 Mbit/s full duplex, but for some reason was negotiated as 100 Mbit/s half duplex. After I forced the 100M-FD mode with ethtool, loads dropped below 1 and network transfer speeds returned to normal.

A: You wrote you see an OOM kill on your logs. After the OOM killer triggers, you should reboot ASAP.
So reboot and your problems will be gone.
Richard


text:
Q: Uniform error handling of large interfaces Suppose I have a .NET assembly, A, which uses reflection to load assemblies B and C (also .NET). These two assemblies both implement a number of large interfaces (the same for both). When a method is called in A it tries to make B do the work. However, B is unreliable and might throw exceptions. Now A has two modes, one where it propagates the exceptions out to the caller of A and one where it calls matching methods on the more stable (but less performant) C.
Are there better ways (less code) to implement this scenario than wrapping all the methods B exposes in a huge implementation of all B's interfaces, only now surrounding every call with code as shown below? The assemblies B and C don't know anything about the error handling approach chosen, so they can't implemet the logic.
public class BErrorWrapper : I1, I2, I3{
   ...
   public int DoSomeWork(int num){
      if (FailWithExceptions)
      {
         try
         {
            return B.DoSomeWork(num);
         }
         catch(MyLibException e)
         {
            return C.DoSomeWOrk(num);
         }
      }
      else
      {
         return B.DoSomeWork(num);
      }
   }
   ...
}

A: You might do this, it saves some repetition:
public class BErrorWrapper : I1, I2, I3{
   ...
   public int DoSomeWork(int num){
      try
      {
         return B.DoSomeWork(num);
      }
      catch(MyLibException e)
      {
         if (FailWithExceptions) throw;
         return C.DoSomeWOrk(num);
      }
   }
   ...
}

A: Hmmm... to save some code you could wrap most of the common signatures via delegates, like below (note I've only included the core bits to keep it clear - but you can add your FailWithExceptions stuff trivially):
    static void TryWithFallback<T>(Action<T> primary, Action<T> fallback, T arg)
    {
        try
        {
            primary(arg);
        }
        catch // add your other regular code here...
        {
            fallback(arg);
        }
    }

Then you can re-use this for implementations via:
    TryWithFallback(b.DoSomeWork, c.DoSomeWork, num);

Obviously you could add a few signatures for related code, such as:
    static TResult TryWithFallback<T, TResult>(Func<T, TResult> primary, Func<T, TResult> fallback, T arg)
    {
        try
        {
            return primary(arg);
        }
        catch
        {
            return fallback(arg);
        }
    }

A: I suggest that you look at using reflection and System.CodeDom to generate the code. I had a similar problem recently when I was trying to write a wrapper for a COM interop assembly that had a very large interface with lots of methods with signatures that contained parameter types that I did not want to use on the client side but which I could easily convert to the types I did want on the client side. They were also 'ref' parameters which would make the client code more verbose. The methods had varying numbers of parameters with meaningful names that I wanted to expose on the client side.
Write a base class for your wrapper that has members for an instance of A and B. Write a code generation class that generates a derived wrapper class. The code generation should then iterate over the methods for each interface that the wrapper should implement and add a method and method body with appropriate code to call A and B within your required error handling construct. The code you generate to call A and B will be dependant on the signature of the method you are calling but this is not hard to achieve by iterating over that parameters of the method being generated or called.
I could post my code but as I am doing something slightly different I think that you are better going back to MSDN or other public samples. All I can say is that I found this surprisingly straightforward and robust.
I suggest that you check in your code generation code rather than the generated code and run the code generation as part of your build.

redpajama_set_name: RedPajamaStackExchange


text:
Q: How can I scrape a child span class using VBA? I would like to use the below code to scrape the ranking position in one of amazon's sub categories (Candy & Chocolate Bars). Please see attached picture for the html code. Referring to "a-list-item" gives me a lot of results, however, the "#204" is not part of it. Thus, my question is two-fold: (i) is there a way to get all the items labeled "a-list-item" and (ii) is there a way that just gives me back the ranking position without pulling all other items. Option (ii) would be superior for my purposes.
Thanks for your time and efforts.
html code with target value

Public Sub social()

'--------------------------------------------------------------------------

    Dim WSactive As Worksheet
    Dim IE As New InternetExplorer

    Set WBactive = ActiveWorkbook
    Set WSactive = WBactive.Sheets("Tabelle1")

'-----------------------------------------------------------------------------

    On Error Resume Next

'-------------------------------------------------------------------------

    With WSactive
        Dim results(0 To 4) ', counter As Long, i As Long
        With IE
            .Visible = False

                'If TBLurl.DataBodyRange.Cells(i, w).Value <> "" Then
                    url = "https://www.amazon.com/dp/B08X19ZCHS?ref=myi_title_dp"
                    .navigate url

'--------------------------------------------------------------------------

                    While .Busy Or .readyState < 4: DoEvents: Wend
                    Dim aNodeList As Object, ele As Object, t As Date
                    Const MAX_WAIT_SEC As Long = 5
                    t = Timer

                    Do
                        DoEvents
                        On Error Resume Next
                        Set ele = .document.querySelector(".rhpdm")
                        On Error GoTo 0
                        If Timer - t > MAX_WAIT_SEC Then Exit Do
                    Loop While ele Is Nothing

'--------------------------------------------------------------------------

                    Set aNodeList = .document.querySelectorAll(".a-list-item")
                    Dim j As Long
                    For j = 0 To aNodeList.Length - 1
                       Debug.Print aNodeList.Item(j).innerText
                    Next j
                    Set aNodeList = Nothing: Set ele = Nothing
            .Quit 'close IE
        End With

    End With

'-------------------------------------------------------------------------

End Sub

A: There is only 1 Url shown and a css path to that node can be
Debug.Print .document.querySelector('#detailBulletsWrapper_feature_div #detailBullets_feature_div + ul .a-list-item .a-list-item').innerText

The + is an adjacent sibling combinator specifying ul that follows at same level an element with id detailBullets_feature_div. The spaces are descendant combinators, meaning elements on right are children  of elements on left of space. The . are class selectors for the class names of elements.
The html in your image appears to be slightly different from the provided url however. Your mileage with the above solution may vary. I have gone for positional matching on assumption other pages will have similar layout.
Even if you were doing a loop over different pages, pages as per the provided url would have only that one ranking to pick up (if as shown in your image).

You don't need the overhead of the browser. The following shows you how to get both rankings on the page (not just the one you showed) using xhr:
Option Explicit
Public Sub PrintRankings()
    'tools > references > Microsoft HTML Object Library
    Dim html As MSHTML.HTMLDocument, xhr As Object

    Set xhr = CreateObject("MSXML2.XMLHTTP")
    Set html = New MSHTML.HTMLDocument

    With xhr
        .Open "GET", "https://www.amazon.com/dp/B07YG6MTD3?ref=myi_title_dp&th=1", False
        .setRequestHeader "User-Agent", "Mozilla/5.0"
        .send
        html.body.innerHTML = .responseText
    End With

   Debug.Print html.querySelector("#detailBullets_feature_div + ul span > span").NextSibling.NodeValue
   Debug.Print html.querySelector("#detailBulletsWrapper_feature_div #detailBullets_feature_div + ul .a-list-item .a-list-item").innerText

End Sub


text:
Q: React dynamically adding html elements/ I'm new to React.  I currently have a component. This component has a title and a body. The body can have several paragraphs and I want to dynamically add the elements depending on how many paragraphs each has. So right now I have this:
import React from 'react';

class Content extends React.Component{
    render(){
        var props_list = this.props;
        var keys = Object.keys(props_list);
        console.log(props_list["title"]);

        for (var i = 0; i < keys.length; i++){
            console.log(props_list[keys[i]]);
        }

        return (

{props_list["title"]}

        );
    }
}

export default Content;

Now with this code I can get all the props and information that it's added to each component but I have no clue how to add this information dynamically into the div-content.
Thank you in advance!

A: So. If we could know more about the shape of the props passed into this component it would help but this should be enough to get you going.
import React from 'react';

class Content extends React.Component{
   render(){
    var props_list = this.props;
    var keys = Object.keys(props_list);
    console.log(props_list["title"]);
            const paragraphs = [];
    for (var i = 0; i < keys.length; i++){
        console.log(props_list[keys[i]]);
        // This part is to make sure you are not re-rendering your title.
        if(keys[i] !== "title"){
            paragraphs.push(
{props_list[keys[i]]}
);
        }
    }

    return (

{props_list["title"]}

              {paragraphs}

    );
 }
}


text:
Q: Does the CLR perform "lock elision" optimization? If not why not? The JVM performs a neat trick called lock elision to avoid the cost of locking on objects that are only visible to one thread.
There's a good description of the trick here:
http://www.ibm.com/developerworks/java/library/j-jtp10185/
Does the .Net CLR do something similar?  If not then why not?

A: It's neat, but is it useful? I have a hard time coming up with an example where the compiler can prove that a lock is thread local. Almost all classes don't use locking by default, and when you choose one that locks, then in most cases it will be referenced from some kind of static variable foiling the compiler optimization anyways.
Another thing is that the java vm uses escape analysis in its proof. And AFAIK .net hasn't implemented escape analysis. Other uses of escape analysis such as replacing heap allocations with stack allocations sound much more useful and should be implemented first.
IMO it's currently not worth the coding effort. There are many areas in the .net VM which are not optimized very well and have much bigger impact.
SSE vector instructions and delegate inlining are two examples from which my code would profit much more than from this optimization.

A: EDIT: As chibacity points out below, this is talking about making locks really cheap rather than completely eliminating them. I don't believe the JIT has the concept of "thread-local objects" although I could be mistaken... and even if it doesn't now, it might in the future of course.
EDIT: Okay, the below explanation is over-simplified, but has at least some basis in reality :) See Joe Duffy's blog post for some rather more detailed information.

I can't remember where I read this - probably "CLR via C#" or "Concurrent Programming on Windows" - but I believe that the CLR allocates sync blocks to objects lazily, only when required. When an object whose monitor has never been contested is locked, the object header is atomically updated with a compare-exchange operation to say "I'm locked". If a different thread then tries to acquire the lock, the CLR will be able to determine that it's already locked, and basically upgrade that lock to a "full" one, allocating it a sync block.
When an object has a "full" lock, locking operations are more expensive than locking and unlocking an otherwise-uncontested object.
If I'm right about this (and it's a pretty hazy memory) it should be feasible to lock and unlock a monitor on different threads cheaply, so long as the locks never overlap (i.e. there's no contention).
I'll see if I can dig up some evidence for this...

A: In answer to your question: No, the CLR\JIT does not perform "lock elision" optimization i.e. the CLR\JIT does not remove locks from code which is only visible to single threads. This can easily be confirmed with simple single threaded benchmarks on code where lock elision should apply as you would expect in Java.
There are likely to be a number of reasons why it does not do this, but chiefly is the fact that in the .Net framework this is likely to be an uncommonly applied optimization, so is not worth the effort of implementing.
Also in .Net uncontended locks are extremely fast due to the fact they are non-blocking and executed in user space (JVMs appear to have similar optimizations for uncontended locks e.g. IBM). To quote from C# 3.0 In A Nutshell's threading chapter

Locking is fast: you can expect to acquire and release a lock in less
  than 100 nanoseconds on a 3 GHz computer if the lock is uncontended"

A couple of example scenarios where lock elision could be applied, and why it's not worth it:
Using locks within a method in your own code that acts purely on locals
There is not really a good reason to use locking in this scenario in the first place, so unlike optimizations such as hoisting loop invariants or method inling, this is a pretty uncommon case and the result of unnecessary use of locks. The runtime shouldn't be concerned with optimizing out uncommon and extreme bad usage.
Using someone else's type that is declared as a local which uses locks internally
Although this sounds more useful, the .Net framework's general design philosophy is to leave the responsibility for locking to clients, so it's rare that types have any internal lock usage. Indeed, the .Net framework is pathologically unsynchronized when it comes to instance methods on types that are not specifically designed and advertized to be concurrent. On the other hand, Java has common types that do include synchronization e.g. StringBuffer and Vector. As the .Net BCL is largely unsynchronized, lock elision is likely to have little effect.
Summary
I think overall, there are fewer cases in .Net where lock elision would kick in, because there are simply not as many places where there would be thread-local locks. Locks are far more likely to be used in places which are visible to multiple threads and therefore should not be elided. Also, uncontended locking is extremely quick.
I had difficulty finding any real-world evidence that lock elision actually provides that much of a performance benefit in Java (for example...), and the latest docs for at least the Oracle JVM state that elision is not always applied for thread local locks, hinting that it is not an always given optimization anyway.
I suspect that lock elision is something that is made possible through the introduction of escape analysis in the JVM, but is not as important for performance as EA's ability to analyze whether reference types can be allocated on the stack.


text:
Q: How do I correctly print a ciphertext encrypted by BCryptEncrypt? I am trying to use BCryptEncrypt to encrypt some basic plain text and I would like to save it in a Notepad; but I want to actually print and see the encrypted text in the console. What is the correct format for wprintf?
Here's part of my code:
 // BCryptEncrypt

    LPCWSTR textToEncrypt = L"Encrypt me.";
    DWORD numberOfBytes = (DWORD)((wcslen(textToEncrypt)+1) * sizeof(WCHAR));
    ULONG sizeCiphertext;
    PBYTE cipherText = NULL;

// Get the size for cyphertext

    status = BCryptEncrypt(hKey, (PUCHAR)textToEncrypt, numberOfBytes, NULL, NULL, 0, NULL, 0, &sizeCiphertext, BCRYPT_BLOCK_PADDING);

    if (!NT_SUCCESS(status))
    {
        wprintf(L"Error 0x%x returned by function BCryptEncrypt 1.\n", status);

    }

cipherText = (PBYTE)HeapAlloc(GetProcessHeap(), 0, sizeCiphertext);

    if (cipherText == NULL)
    {
        wprintf(L"Memory allocation failed.\n");

    }

    status = BCryptEncrypt(hKey, (PUCHAR)textToEncrypt, numberOfBytes, NULL, NULL, 0, cipherText, sizeCiphertext, &sizeCiphertext, BCRYPT_BLOCK_PADDING);

    if (!NT_SUCCESS(status))
    {
        wprintf(L"Error 0x%x returned by function BCryptEncrypt 2.\n", status);

    }

    wprintf(L"Plain text: %s \n", textToEncrypt);

//No idea if this is OK
wprintf(L"Ciphertext: %hs \n", cipherText);


text:
Q: Bash скрипт как изменить элемент массива Как можно заменить элемент в массиве bash?
Например, если третьим элементом в массиве число 3, нужно заменить его на 2, приравнивая к 3-1, выдает ошибку.

A: #! /bin/bash

$ declare -a arr=(a b c)

$ echo ${arr[*]@A}
declare -a arr=([0]="a" [1]="b" [2]="c")

$ echo ${arr[2]}
c

$ declare -i IDX=3
$ echo ${arr[$(( IDX - 1 ))]}
c

$ arr[$(( IDX - 1 ))]="d"
$ echo ${arr[$(( IDX - 1 ))]}
d
$ echo ${arr[*]@A}
declare -a arr=([0]="a" [1]="b" [2]="d")


text:
Q: Mixed Write for GSON I am using GSON object model access to construct JSON to be used as body of my POST webservice calls in Jmeter.
Now I frequently encounter : GCC Out of memory exception with the error pointing to the code section=> gson.toJson(objectToSerialize).
From the past posts, it was suggested to use gson serialization with the streaming access model.
My current code does this: Create an object of an class by populating its variables and passes this class on to the GSON serializer, gets back the constructed JSON in form of string and I use them.
Could the experts suggest, is there a way that I could integrate streaming access model into my code without having to do much of a rework. Would this be memory efficient?
PS: I took a look into Mixed writes example specified in this link but unable to get around how to construct a JSON by passing one object of the class as we do in the object model:
https://sites.google.com/site/gson/streaming
Thank you!

A: Why don't you just use these variables in "Body Data" mode of the HTTP Request sampler like:

If your JSON payload is large you may have to amend Java HEAP size as default allocation is just 512MB and it may be not enough for more or less large load. If you don't have enough free RAM to fit JSON data size * number of virtual users you may have to consider Distributed Testing
The other option may be you using not very efficient scripting test element. It is recommended to use JSR223 Test Elements and Groovy as a language as other options are not performing that well.
See Beanshell vs JSR223 vs Java JMeter Scripting: The Performance-Off You've Been Waiting For! guide for more information on


text:
Q: Using icons in
* and have separate properties? I want to make a navigation using li with little icons next to the text. I managed to get it working but how can i edit the properties of
 like color, padding etc.
If i change the padding of .homeicon it moves the little icon about. Is there a way to have all the main properties under li then just the icon under .homeicon?
JSFiddle: http://jsfiddle.net/PFQke/45/
HTML

Home

CSS
#navigation {
    margin:14px;
    height:80px;
}
#navigation li {
    list-style:none;
    margin:10px;
    padding:10px;
    display:inline;
    margin-left:15px;
    font-size:16px;
    font-weight:bold;
    color:#ffffff;
    text-shadow: 1px 1px #000000;
    -moz-border-radius: 5px;
    border-radius: 5px;
    -webkit-box-shadow: 4px 4px 9px rgba(50, 50, 50, 0.75);
    -moz-box-shadow:    4px 4px 9px rgba(50, 50, 50, 0.75);
    box-shadow:         4px 4px 9px rgba(50, 50, 50, 0.75);
}
#navigation .homeicon {
    background: url("images/home.png") no-repeat top left;
    padding: 3px 0px 4px 25px;
 }

A: You can try to change where the icon actually is to the child of
 like:
#navigation .homeicon a {
  }

And style that element as you styled the old #navigation .homeicon {. Then the changes to
 won't affect directly to the icon itself.
Note: I changed the icon so I could see a visual representation of it

http://jsfiddle.net/franciscop/PFQke/47/


text:
Q: Excel: Change the value of a selected value from a validation list using vba? I have a column with a data validation list in each cell.
Here is my list:
ND - No Delivery
SD - Short Delivery
OD - Over Delivery
Other

What I want to try and achieve here is if the user selects the value from the data validation list, then the cell changes to one of the following:
ND - No Delivery = ND

SD - Short Delivery = SD

OD - Over Delivery = OD

Other = Other

So my cells end up potentially looking something like this:
ND
SD
OD
Other

So if the user selects No Delivery, then the value in the cell is set to 'ND', and so on.
The only exception here would be other, which should still be set to other in the cell.
Here is a sample code to put it in to context:
   If .Range("B1").Value = "ND - No Dleivery" Then
      .Range("B1").Value = "ND"
   End If

My validation for the cell should really only allow either 'ND', 'SD', 'OD' or 'Other' to be entered - but the list should contain:
ND - No Delivery
SD - Short Delivery
OD - Over Delivery
Other

Please can someone show me the best way to accomplish this?
Thanks in advance

A: Are there any visual and explain more, would be great if you can provide some sample?
On the selected cell that you want to reflect the selected option.
=IFERROR(IF(A2="No Delivery";"ND";IF(A2="Short
         Delivery";"SD";IF(A2="Over Delivery";"OD")));"Other")

Tell me if this is the one you need.
Thanks
Sample- is it like this?
Excel Code


text:
Q: Show that $α^k$ is also a primitive element if and only if gcd$(k, q − 1) = 1$. Let $α$ be a primitive element of $F_q$ . Show that $α^k$ is also a primitive
element if and only if gcd$(k, q − 1) = 1$.
$1=ak+b(q-1) \implies α^1=α^{(ak+b(q-1))}=α^{(ak)}α^{(q-1)}a=α^ka=α$  i cant forward the proof and i need someone to confirm me that $F_9,F_{19},F_{25},F_{32}$ has $4,6,8,2$ primitive roots, respectively.
If i were to open up for $F_9,$ $\phi(9-1)=4 \{1,2,4,8\}$
thank you for your help.

A: For the "forward" direction,  suppose that $d\gt 1$ divides both $k$ and $q-1$. Then $(\alpha^{k})^{(q-1)/d}=1$, contradicting the fact that $\alpha$ has order $q-1$.


text:
Q: Ring homomorphism between quotients of rings of polynomials in many variables Let
\begin{equation*}A=\mathbb{Z}[x_{ij}: 1 \leq i < j \leq n]/(x_{ij}x_{kl}=x_{ik}x_{jl}+x_{il}x_{kj} \; \text{for} \; 1\leq i < j < k <l \leq n)
\end{equation*}
and
\begin{equation*}
B=\mathbb{Z}[x_{ij}:1 \leq i < j \leq m]/(x_{ij}x_{kl}=x_{ik}x_{jl}+x_{il}x_{kj} \; \text{for} \; 1\leq i < j < k <l \leq m),
\end{equation*}
with $m < n$, where both $m,n \in \mathbb{N}$. I am trying to think of a ring homomorphism from $A$ to $B$ but I am not sure what should that look like. Intuitively, it should be some sort of projection map, but how would I define one rigorously?

A: We have maps $\pi_A: \mathbb{Z}[x_{ij}: 1 \leq i < j \leq n] \longrightarrow A$ and $\pi_B: \mathbb{Z}[x_{ij}: 1 \leq i < j \leq m] \longrightarrow B$.
Since $m<n$ we get a projection map (by forgetting some variables) $$\varphi: \mathbb{Z}[x_{ij}: 1 \leq i < j \leq n] \longrightarrow \mathbb{Z}[x_{ij}: 1 \leq i < j \leq m]$$
Now if we look at the composition $\pi_B \varphi:\mathbb{Z}[x_{ij}: 1 \leq i < j \leq n] \longrightarrow B$, we can see that $I:=(x_{ij}x_{kl}=x_{ik}x_{jl}+x_{il}x_{kj} \; \text{for} \; 1\leq i < j < k <l \leq n) \subset \ker(\pi_B\varphi)$.
This holds because $m<n$, so if we have the relations for $n$ we have them after projection for $m$.
Therefore we can use the universal property of quotient rings to get a unique morphism $\phi:A \longrightarrow B$, s.t. $\phi \pi_A =\pi_B \varphi$.
In particular this is a ring homomorphism, since all the other maps are ring homomorphisms as well.


text:
Q: True regex for getting content from parentheses in square brackets I love/hate the regex because of usefulness/hardness. (I don't why but I can't construct pattern :( )
I have some records in my database field like this
[(ip1=192.x.?.100)(id1=125485smds65)(date1=11.02.2011-15:00/15.06.2012-17:30)(text1=Some text that can include all brackets and/or parentheses & any chars etc, like < ( text . } , [ any ) ] { etc.**)][(ip2=x.x.20.?)(num2=1235845)(text2=many other words :))]...
Ok, I want to return an array that contain value as;
$result[ip1] = 192.x.?.100;
$result[id1] = 125485smds65;
$result[date1] = 11.02.2011-15:00/15.06.2012-17:30;
$result[text1] = Some text that can include all brackets and/or parentheses & any chars etc, like < ( text . } , [ any ) ] { etc.**;
$result[ip2] = 192.x.?.100;
$result[num2] = 1235845;
$result[text2] = many other words :)

You can see that, number of data in the brackets and brackets number can vary
So, what is the true pattern for preg_match_all regex to collect above data?

A: Try something like this:
$s = '(ip1=192.x.?.100)(id1=125485smds65)(date1=11.02.2011-15:00/15.06.2012-17:30)
(text1=Some text that can include all brackets and/or paranthesis & any chars etc,
like < ( text . } , [ any ) ] { etc.**)][(ip2=x.x.20.?)(num2=1235845)
(text2=many other words :))';

preg_match_all('/\((?:[^()]|(?R))*\)/', $s, $matches);

print_r($matches);

which will print:
Array
(
    [0] => Array
        (
            [0] => (ip1=192.x.?.100)
            [1] => (id1=125485smds65)
            [2] => (date1=11.02.2011-15:00/15.06.2012-17:30)
            [3] => (text1=Some text that can include all brackets and/or paranthesis & any chars etc,
like < ( text . } , [ any ) ] { etc.**)
            [4] => (ip2=x.x.20.?)
            [5] => (num2=1235845)
            [6] => (text2=many other words :)
        )

)

The (?R) in the regex pattern /\((?:[^()]|(?R))*\)/ is the recursive call to the entire pattern iteself.
As is clear from the comments beneath your question: it is not recommended to use such regex-voodoo in production code. My suggestion is you not store your data like the way you do in your database. Solve the issue at the root, please!

A: You could do:
/(\(([^)=]*)=([^)]*)\))*/

However this is impossible "Some text that can include all brackets and/or paranthesis"  - how in the world would you distinguish the text from a closing parenthesis?
And in case this is a very poor data structure. First of all it's a database - it has columns, use them! Second, why are you rolling your own datastructure? You can use json, or php's serialize().
A regex is the wrong tool for this job.


text:
Q: Use images instead of radio buttons in React.js I am doing a project using Laravel and react.js.
I need to select only one image out of this list of images :

The code of above picture,

         Echeveria-colorata
       Echeveria-imbricata
       Ghost Plant
       Ladyfinger cactus

       Ghost Plant
       Bunny-Ears
       Echeveria-colorata
       Echeveria-imbricata

Thank you for your Help!


text:
Q: How can I apply delogo for a duration of video in ffmpeg or apply delogo in mutiple areas? I just learned the way to delogo in ffmpeg:
ffmpeg -i input.mp4 -vf delogo=x=1539:y=23:w=353:h=93 output.mp4

I would like to know if it is possible to apply delogo filter only for a clip?
And can I apply delogo to two squares?

A: Use the enable option
The delogo filter supports the enable option (timeline support). You can see if a filter supports this option with ffmpeg -filters.
Apply delogo filter between 5-10 seconds
ffmpeg -i input.mp4 -vf "delogo=x=1539:y=23:w=353:h=93:enable='between(t,5,10)'" -c:a copy output.mp4

Apply delogo to multiple areas
ffmpeg -i input.mp4 -vf "delogo=x=1539:y=23:w=353:h=93,delogo=x=100:y=24:w=100:h=72" -c:a copy output.mp4

Apply delogo to two squares between 5-10 seconds
ffmpeg -i input.mp4 -vf "delogo=x=1539:y=23:w=353:h=93:enable='between(t,5,10)',delogo=x=100:y=24:w=100:h=72:enable='between(t,5,10)'" -c:a copy output.mp4


text:
Q: When has the layout finished loading For my app I need to get the height and width of an image. However, the image has no params when I try to get them in the onCreate/ onStart/ onResume method.
At which point can I get the values of the image/ has the image been loaded?
Thanks in advance! :)

A: You need to use ViewTreeObserver with ViewTreeObserver.OnPreDrawListener.
For more details, check this answer: How to get the width and height of an android.widget.ImageView?


text:
Q: Schema validation errors while parsing:Invalid xsi:type qname we have one java application which running currently on weblogic 10.
we need to deploy this application to weblogic 12.2.1.2.
So I have created one weblogic domain in weblogic 12.2.1.2 and I made change in config.xml file according to config.xml which we already have for weblogic 10.
server and java combination we are using:

*

*weblogic 10 + jrockit_160_05(java)

*weblogic 12.2.1 + java 8

When we start server I getting many error.see the below log.
<24-May-2017, 10:52:39,491 AM IST> <Info> <Security> <BSOLDHN-020> <> <main> <> <> <> <1495603359491> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-090905> <Disabling the CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true.>
<24-May-2017, 10:52:39,571 AM IST> <Info> <Security> <BSOLDHN-020> <> <main> <> <> <> <1495603359571> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG128 to HMACDRBG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true.>
<24-May-2017, 10:52:39,915 AM IST> <Info> <WebLogicServer> <BSOLDHN-020> <> <Thread-5> <> <> <> <1495603359915> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 25.131-b11 from Oracle Corporation.>
<24-May-2017, 10:52:40,29 AM IST> <Info> <RCM> <BSOLDHN-020> <> <Thread-9> <> <> <> <1495603360029> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-2165021> <"ResourceManagement" is not enabled in this JVM. Enable "ResourceManagement" to use the WebLogic Server "Resource Consumption Management" feature. To enable "ResourceManagement", you must specify the following JVM options in the WebLogic Server instance in which the JVM runs: -XX:+UnlockCommercialFeatures -XX:+ResourceManagement.>
<24-May-2017, 10:52:40,257 AM IST> <Info> <Management> <BSOLDHN-020> <> <Thread-5> <> <> <> <1495603360257> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-141107> <Version: WebLogic Server 12.2.1.2.0 Mon Oct  3 04:35:36 PDT 2016 1827450>
<24-May-2017, 10:52:40,264 AM IST> <Warning> <Management> <BSOLDHN-020> <> <Thread-5> <> <> <> <1495603360264> <[severity-value: 16] [partition-id: 0] [partition-name: DOMAIN] > <BEA-141274> <Production mode has been specified at the command line using the the weblogic.ProductionModeEnabled system property. This system property overrides the development mode setting contained in the config.xml file. However, the Administration Console and WLST show the attribute values and defaults that correspond to the development mode specified in the config.xml file.>
<24-May-2017, 10:52:41,788 AM IST> <Warning> <JMSExceptions> <BSOLDHN-020> <> <Thread-5> <> <> <> <1495603361788> <[severity-value: 16] [partition-id: 0] [partition-name: DOMAIN] > <BEA-045142> <WebLogic Server has detected a deprecated JMS Interop Module in your configuration. This feature will be removed in a future release. Oracle recommends that you take appropriate measures to remove dependencies on JMS Interop Modules.>
<24-May-2017, 10:52:41,940 AM IST> <Error> <Management> <BSOLDHN-020> <> <Thread-5> <> <> <> <1495603361940> <[severity-value: 8] [partition-id: 0] [partition-name: DOMAIN] > <BEA-141244> <Schema validation errors while parsing C:\Oracle\Middleware\Oracle_Home\user_projects\domains\OSLChOpsDomain\config\config.xml<8:7> - Invalid xsi:type qname: 'wls:realm-adapter-authenticatorType' in element realm@http://xmlns.oracle.com/weblogic/domain.>
<24-May-2017, 10:52:41,940 AM IST> <Error> <Management> <BSOLDHN-020> <> <Thread-5> <> <> <> <1495603361940> <[severity-value: 8] [partition-id: 0] [partition-name: DOMAIN] > <BEA-141244> <Schema validation errors while parsing C:\Oracle\Middleware\Oracle_Home\user_projects\domains\OSLChOpsDomain\config\config.xml - C:\Oracle\Middleware\Oracle_Home\user_projects\domains\OSLChOpsDomain\<unknown>:8:7: error: failed to load java type corresponding to t=realm-adapter-authenticatorType@http://xmlns.oracle.com/weblogic/security/wls.>
<24-May-2017, 10:52:41,942 AM IST> <Error> <Management> <BSOLDHN-020> <> <Thread-5> <> <> <> <1495603361942> <[severity-value: 8] [partition-id: 0] [partition-name: DOMAIN] > <BEA-141244> <Schema validation errors while parsing C:\Oracle\Middleware\Oracle_Home\user_projects\domains\OSLChOpsDomain\config\config.xml<12:7> - Invalid xsi:type qname: 'wls:realm-adapter-authorizerType' in element realm@http://xmlns.oracle.com/weblogic/domain.>
<24-May-2017, 10:52:41,942 AM IST> <Error> <Management> <BSOLDHN-020> <> <Thread-5> <> <> <> <1495603361942> <[severity-value: 8] [partition-id: 0] [partition-name: DOMAIN] > <BEA-141244> <Schema validation errors while parsing C:\Oracle\Middleware\Oracle_Home\user_projects\domains\OSLChOpsDomain\config\config.xml - C:\Oracle\Middleware\Oracle_Home\user_projects\domains\OSLChOpsDomain\<unknown>:12:7: error: failed to load java type corresponding to t=realm-adapter-authorizerType@http://xmlns.oracle.com/weblogic/security/wls.>
<24-May-2017, 10:52:41,942 AM IST> <Error> <Management> <BSOLDHN-020> <> <Thread-5> <> <> <> <1495603361942> <[severity-value: 8] [partition-id: 0] [partition-name: DOMAIN] > <BEA-141244> <Schema validation errors while parsing C:\Oracle\Middleware\Oracle_Home\user_projects\domains\OSLChOpsDomain\config\config.xml<14:7> - Invalid xsi:type qname: 'wls:realm-adapter-adjudicatorType' in element realm@http://xmlns.oracle.com/weblogic/domain.>
<24-May-2017, 10:52:41,943 AM IST> <Error> <Management> <BSOLDHN-020> <> <Thread-5> <> <> <> <1495603361943> <[severity-value: 8] [partition-id: 0] [partition-name: DOMAIN] > <BEA-141244> <Schema validation errors while parsing C:\Oracle\Middleware\Oracle_Home\user_projects\domains\OSLChOpsDomain\config\config.xml - C:\Oracle\Middleware\Oracle_Home\user_projects\domains\OSLChOpsDomain\<unknown>:14:7: error: failed to load java type corresponding to t=realm-adapter-adjudicatorType@http://xmlns.oracle.com/weblogic/security/wls.>
<24-May-2017, 10:52:41,943 AM IST> <Error> <Management> <BSOLDHN-020> <> <Thread-5> <> <> <> <1495603361943> <[severity-value: 8] [partition-id: 0] [partition-name: DOMAIN] > <BEA-141244> <Schema validation errors while parsing C:\Oracle\Middleware\Oracle_Home\user_projects\domains\OSLChOpsDomain\config\config.xml<18:7> - Expected elements 'user-lockout-manager@http://xmlns.oracle.com/weblogic/security deploy-role-ignored@http://xmlns.oracle.com/weblogic/security deploy-policy-ignored@http://xmlns.oracle.com/weblogic/security deploy-credential-mapping-ignored@http://xmlns.oracle.com/weblogic/security fully-delegate-authorization@http://xmlns.oracle.com/weblogic/security validate-dd-security-data@http://xmlns.oracle.com/weblogic/security security-dd-model@http://xmlns.oracle.com/weblogic/security combined-role-mapping-enabled@http://xmlns.oracle.com/weblogic/security enable-web-logic-principal-validator-cache@http://xmlns.oracle.com/weblogic/security max-web-logic-principals-in-cache@http://xmlns.oracle.com/weblogic/security name@http://xmlns.oracle.com/weblogic/security delegate-m-bean-authorization@http://xmlns.oracle.com/weblogic/security auth-methods@http://xmlns.oracle.com/weblogic/security compatibility-object-name@http://xmlns.oracle.com/weblogic/security rdbms-security-store@http://xmlns.oracle.com/weblogic/security password-validator@http://xmlns.oracle.com/weblogic/security deployable-provider-synchronization-enabled@http://xmlns.oracle.com/weblogic/security deployable-provider-synchronization-timeout@http://xmlns.oracle.com/weblogic/security auto-restart-on-non-dynamic-changes@http://xmlns.oracle.com/weblogic/security retire-timeout-seconds@http://xmlns.oracle.com/weblogic/security management-identity-domain@http://xmlns.oracle.com/weblogic/security' instead of 'key-store@http://xmlns.oracle.com/weblogic/security' here in element realm@http://xmlns.oracle.com/weblogic/domain.>
<24-May-2017, 10:52:41,943 AM IST> <Error> <Management> <BSOLDHN-020> <> <Thread-5> <> <> <> <1495603361943> <[severity-value: 8] [partition-id: 0] [partition-name: DOMAIN] > <BEA-141244> <Schema validation errors while parsing C:\Oracle\Middleware\Oracle_Home\user_projects\domains\OSLChOpsDomain\config\config.xml<43:7> - Expected elements 'user-lockout-manager@http://xmlns.oracle.com/weblogic/security deploy-role-ignored@http://xmlns.oracle.com/weblogic/security deploy-policy-ignored@http://xmlns.oracle.com/weblogic/security deploy-credential-mapping-ignored@http://xmlns.oracle.com/weblogic/security fully-delegate-authorization@http://xmlns.oracle.com/weblogic/security validate-dd-security-data@http://xmlns.oracle.com/weblogic/security security-dd-model@http://xmlns.oracle.com/weblogic/security combined-role-mapping-enabled@http://xmlns.oracle.com/weblogic/security enable-web-logic-principal-validator-cache@http://xmlns.oracle.com/weblogic/security max-web-logic-principals-in-cache@http://xmlns.oracle.com/weblogic/security name@http://xmlns.oracle.com/weblogic/security delegate-m-bean-authorization@http://xmlns.oracle.com/weblogic/security auth-methods@http://xmlns.oracle.com/weblogic/security compatibility-object-name@http://xmlns.oracle.com/weblogic/security rdbms-security-store@http://xmlns.oracle.com/weblogic/security password-validator@http://xmlns.oracle.com/weblogic/security deployable-provider-synchronization-enabled@http://xmlns.oracle.com/weblogic/security deployable-provider-synchronization-timeout@http://xmlns.oracle.com/weblogic/security auto-restart-on-non-dynamic-changes@http://xmlns.oracle.com/weblogic/security retire-timeout-seconds@http://xmlns.oracle.com/weblogic/security management-identity-domain@http://xmlns.oracle.com/weblogic/security' instead of 'key-store@http://xmlns.oracle.com/weblogic/security' here in element realm@http://xmlns.oracle.com/weblogic/domain.>
<24-May-2017, 10:52:41,944 AM IST> <Error> <Management> <BSOLDHN-020> <> <Thread-5> <> <> <> <1495603361944> <[severity-value: 8] [partition-id: 0] [partition-name: DOMAIN] > <BEA-141244> <Schema validation errors while parsing C:\Oracle\Middleware\Oracle_Home\user_projects\domains\OSLChOpsDomain\config\config.xml<58:3> - Expected elements 'jta@http://xmlns.oracle.com/weblogic/domain jpa@http://xmlns.oracle.com/weblogic/domain deployment-configuration@http://xmlns.oracle.com/weblogic/domain wtc-server@http://xmlns.oracle.com/weblogic/domain log@http://xmlns.oracle.com/weblogic/domain snmp-agent@http://xmlns.oracle.com/weblogic/domain snmp-agent-deployment@http://xmlns.oracle.com/weblogic/domain root-directory@http://xmlns.oracle.com/weblogic/domain console-enabled@http://xmlns.oracle.com/weblogic/domain java-service-console-enabled@http://xmlns.oracle.com/weblogic/domain console-context-path@http://xmlns.oracle.com/weblogic/domain console-extension-directory@http://xmlns.oracle.com/weblogic/domain server@http://xmlns.oracle.com/weblogic/domain server-template@http://xmlns.oracle.com/weblogic/domain coherence-server@http://xmlns.oracle.com/weblogic/domain cluster@http://xmlns.oracle.com/weblogic/domain file-t3@http://xmlns.oracle.com/weblogic/domain messaging-bridge@http://xmlns.oracle.com/weblogic/domain production-mode-enabled@http://xmlns.oracle.com/weblogic/domain embedded-ldap@http://xmlns.oracle.com/weblogic/domain administration-port-enabled@http://xmlns.oracle.com/weblogic/domain administration-port@http://xmlns.oracle.com/weblogic/domain exalogic-optimizations-enabled@http://xmlns.oracle.com/weblogic/domain java-service-enabled@http://xmlns.oracle.com/weblogic/domain archive-configuration-count@http://xmlns.oracle.com/weblogic/domain config-backup-enabled@http://xmlns.oracle.com/weblogic/domain configuration-version@http://xmlns.oracle.com/weblogic/domain administration-m-bean-auditing-enabled@http://xmlns.oracle.com/weblogic/domain configuration-audit-type@http://xmlns.oracle.com/weblogic/domain cluster-constraints-enabled@http://xmlns.oracle.com/weblogic/domain app-deployment@http://xmlns.oracle.com/weblogic/domain library@http://xmlns.oracle.com/weblogic/domain domain-library@http://xmlns.oracle.com/weblogic/domain ws-reliable-delivery-policy@http://xmlns.oracle.com/weblogic/domain machine@http://xmlns.oracle.com/weblogic/domain xml-entity-cache@http://xmlns.oracle.com/weblogic/domain xml-registry@http://xmlns.oracle.com/weblogic/domain jms-server@http://xmlns.oracle.com/weblogic/domain virtual-host@http://xmlns.oracle.com/weblogic/domain virtual-target@http://xmlns.oracle.com/weblogic/domain migratable-target@http://xmlns.oracle.com/weblogic/domain ejb-container@http://xmlns.oracle.com/weblogic/domain web-app-container@http://xmlns.oracle.com/weblogic/domain cdi-container@http://xmlns.oracle.com/weblogic/domain jmx@http://xmlns.oracle.com/weblogic/domain self-tuning@http://xmlns.oracle.com/weblogic/domain resource-management@http://xmlns.oracle.com/weblogic/domain path-service@http://xmlns.oracle.com/weblogic/domain jms-bridge-destination@http://xmlns.oracle.com/weblogic/domain bridge-destination@http://xmlns.oracle.com/weblogic/domain shutdown-class@http://xmlns.oracle.com/weblogic/domain startup-class@http://xmlns.oracle.com/weblogic/domain singleton-service@http://xmlns.oracle.com/weblogic/domain mail-session@http://xmlns.oracle.com/weblogic/domain jolt-connection-pool@http://xmlns.oracle.com/weblogic/domain log-filter@http://xmlns.oracle.com/weblogic/domain file-store@http://xmlns.oracle.com/weblogic/domain replicated-store@http://xmlns.oracle.com/weblogic/domain jdbc-store@http://xmlns.oracle.com/weblogic/domain jms-interop-module@http://xmlns.oracle.com/weblogic/domain jms-system-resource@http://xmlns.oracle.com/weblogic/domain custom-resource@http://xmlns.oracle.com/weblogic/domain foreign-jndi-provider@http://xmlns.oracle.com/weblogic/domain admin-server-name@http://xmlns.oracle.com/weblogic/domain administration-protocol@http://xmlns.oracle.com/weblogic/domain wldf-system-resource@http://xmlns.oracle.com/weblogic/domain jdbc-system-resource@http://xmlns.oracle.com/weblogic/domain saf-agent@http://xmlns.oracle.com/weblogic/domain migratable-rmi-service@http://xmlns.oracle.com/weblogic/domain webservice-security@http://xmlns.oracle.com/weblogic/domain jms-connection-consumer@http://xmlns.oracle.com/weblogic/domain auto-deploy-for-submodules-enabled@http://xmlns.oracle.com/weblogic/domain admin-console@http://xmlns.oracle.com/weblogic/domain internal-apps-deploy-on-demand-enabled@http://xmlns.oracle.com/weblogic/domain guardian-enabled@http://xmlns.oracle.com/weblogic/domain ocm-enabled@http://xmlns.oracle.com/weblogic/domain msg-id-prefix-compatibility-enabled@http://xmlns.oracle.com/weblogic/domain log-format-compatibility-enabled@http://xmlns.oracle.com/weblogic/domain coherence-cluster-system-resource@http://xmlns.oracle.com/weblogic/domain restful-management-services@http://xmlns.oracle.com/weblogic/domain system-component@http://xmlns.oracle.com/weblogic/domain system-component-configuration@http://xmlns.oracle.com/weblogic/domain osgi-framework@http://xmlns.oracle.com/weblogic/domain webservice-testpage@http://xmlns.oracle.com/weblogic/domain server-migration-history-size@http://xmlns.oracle.com/weblogic/domain service-migration-history-size@http://xmlns.oracle.com/weblogic/domain coherence-management-cluster@http://xmlns.oracle.com/weblogic/domain partition@http://xmlns.oracle.com/weblogic/domain partition-uri-space@http://xmlns.oracle.com/weblogic/domain resource-group@http://xmlns.oracle.com/weblogic/domain resource-group-template@http://xmlns.oracle.com/weblogic/domain max-concurrent-new-threads@http://xmlns.oracle.com/weblogic/domain max-concurrent-long-running-requests@http://xmlns.oracle.com/weblogic/domain parallel-deploy-applications@http://xmlns.oracle.com/weblogic/domain parallel-deploy-application-modules@http://xmlns.oracle.com/weblogic/domain managed-executor-service-template@http://xmlns.oracle.com/weblogic/domain managed-scheduled-executor-service-template@http://xmlns.oracle.com/weblogic/domain managed-thread-factory-template@http://xmlns.oracle.com/weblogic/domain managed-executor-service@http://xmlns.oracle.com/weblogic/domain managed-scheduled-executor-service@http://xmlns.oracle.com/weblogic/domain managed-thread-factory@

A: To fix this issue I have inserted one below line of code in startWeblogic.cmd file.
set JAVA_OPTIONS=%JAVA_OPTIONS% -Dweblogic.configuration.schemaValidationEnabled=false


text:
Q: Ensuring that the a circuit breaker in a secondary elec. distribution board will go off before a circuit breaker in the main board I want to create a small portable single-phase secondary electrical distribution board to safely power up some lights in my back yard.
The board will be powered from a wall socket, and will contain 3 circuit breakers (perhaps a main breaker too) and three output sockets (to connect chains of lights).
Is there a way to ensure that if I get a "short circuit" (between Live and Neutral) or "leakage" (between Live and ground), the circuit breaker that will trip will always be the one in the secondary board?
I basically would like to avoid tripping breakers in the main board (which would shut down PC, refrigerator etc.).
The circuit breaker of the wall socket is 16Amps, and I was planning to install 10Amp circuit breakers in the secondary board (perhaps, if you think it wise, I'll add a "main" circuit breaker of 16 amps in the 2nd board, too). But will this suffice? If not, is there another way to go about doing this?
The "path" would look like:
main board (c.b. 16A) ->
wall socket ->
schuko plug ->
secondary board ->
main c.b. 16A (optional) ->
3x c.b 10A ->
3x output female schuko plugs

Note that the secondary box will be located inside the house (and not outside which would render it a hazard on its own!)

A: If everything downstream is rated for lower breaking capacity compared to upstream then you've done the best you can to achieve your aims. Regards the tripping of a breaker due to leakage to earth use  a "residual current breaker" like this: -

See wiki page for details

A: Perhaps you are looking for something like this?

The above is a portable socket-outlet assembly intended for use in the construction industry. This particular model is made by Clipsal for the Australian market. It includes its own 30mA-sensitivity residual current device (ELCB for you folks in the US.)
As a nice extra feature, if you have an electrician terminate matching screw-on plugs to your lights, the assembly will be weatherproof to IP66 when the plugs are in the sockets.

Regarding how you want the sub-distribution board to trip off before the main circuit breaker does - this is hard to do.
For overload faults (putting a little bit too much load on one circuit), you should be able to obtain acceptable discrimination by installing a dedicated circuit breaker for this circuit, with a rating half that of the main circuit breaker.
E.g. if your main circuit breaker is 32A, a 16A breaker should provide acceptable discrimination for overload faults.
For full-bore, short circuit faults - these happen so fast that the circuit breakers all race with each other. Typical tripping times for a miniature circuit breaker, under short-circuit fault conditions, are 10ms or less (see below.) You will not be able to obtain discrimination between miniature circuit breakers for a short circuit fault.

From Clipsal 4-series MCB catalogue.

Regarding topology, if you were going to go with the 'custom built' approach, rather than buying a portable socket-outlet assembly off the shelf, it should look something like this. Note the sub board should be on a dedicated circuit.
In this drawing I have shown the connection between the main board and the sub board via a socket-outlet, like you specified, but I would highly recommend hardwiring this instead.

A: If you're simply going to plug your panel into a receptacle in your house I would install a 15amp gfi in the receptacles placed. A gfi device is going to trip first versus a breaker nearly everytime. While its not required by the NEC, I always like to put residential outdoor lighting, especially landscape lighting on gfi protection.


text:
Q: C# MongoDb serialization of Dictionary I have a collection in my database where I log events. Each type of event has a different set of data. I've defined this with the following class:
[CollectionName("LogEvent")]
public class LogEvent
{
    public LogEvent(string eventType)
    {
        EventType = eventType;
        EventData = new Dictionary<string, object>();
    }

    public string EventType { get; private set; }
    [BsonExtraElements]
    public IDictionary<string, object> EventData { get; private set; }
}

Now - this works pretty good to some extent. As long as the elements of the EventData dictionary are simple types...
var event = new LogEvent("JobQueues"){
    EventData = new Dictionary<string, object>(){
        { "JobId": "job-123" },
        { "QueueName": "FastLane" }
    }
}

_mongoCollection.InsertOne(event);

...I get mongo documents like
{
  _id: ObjectId(...),
  EventType: "JobQueued",
  JobId: "job-123",
  QueueName: "FastLane"
}

But as soon as I try to add a custom type to the dictionary, things stops working.
var event = new LogEvent("JobQueues"){
    EventData = new Dictionary<string, object>(){
        { "JobId": "job-123" },
        { "QueueName": "FastLane" },
        { "JobParams" : new[]{"param-1", "param-2"}},
        { "User" : new User(){ Name = "username", Age = 10} }
    }
}

This gives me errors like ".NET type ... cannot be mapped to BsonType."
If I remove the [BsonExtraElements] tag, and [BsonDictionaryOptions(DictionaryRepresentation.Document)] It will start serialize stuff without errors, but it will give me a complete different document which I don't like..
{
  _id: ObjectId(...),
  EventType: "JobQueued",
  EventData: {
      JobId: "job-123",
      QueueName: "FastLane",
      User: {
       _t: "User",
       Name: "username",
       Age: 10
      },
      JobParams : {
       _t: "System.String[]",
       _v: ["param-1", "param-2"]
      }
   }
}

What I want, is the following result:
{
  _id: ObjectId(...),
  EventType: "JobQueued",
  JobId: "job-123",
  QueueName: "FastLane",
  User: {
    Name: "username",
    Age: 10
  },
  JobParams : ["param-1", "param-2"]
}

Does anyone know how to achieve that?
(I'm using the C# mongodriver v2.3)

A: So works MongoDriver, because it needs information of the type to deserilize it back.
What you could do, is to write and register your own CustomMapper for User class:
public class CustomUserMapper : ICustomBsonTypeMapper
{
    public bool TryMapToBsonValue(object value, out BsonValue bsonValue)
    {
        bsonValue = ((User)value).ToBsonDocument();
        return true;
    }
}

Somewhere on starting program:
BsonTypeMapper.RegisterCustomTypeMapper(typeof(User), new CustomUserMapper());

That will work, and i have managed to serialize your data exact as you want.
But:  As you want to deserialize it back, you wil get your User class as Dictionary, because driver will have no information about hiow to deserialize it:


text:
Q: Restricting Azure Pipeline decorators I wanted to restrict azure pipeline decorator from injecting into all the pipelines. As we know once the decorators are installed it will be applied to all the projects in the organization. how can I restrict it to certain projects?
I used Projects API and got my project id and then i added the project id to my json template as a targettask and targetid.
  "properties": {
                "template": "custom-postjob-decorator.yml",
                "targetid": "9146bcde-ef7b-492d-8289-b3dce5f750b0"
            }

it didn't work, do we need to provide a condition in the decorator.yaml for restricting it to certain projects in the organization?

I have a few more questions.
now i don't want to run my decorator on Project B and i define like the below
steps:
- ${{ if in(variables['System.TeamProject'], 'ProjectB')) }}:
  - task: ADOSecurityScanner@1 --> injected decorator

I ran this and it is still injecting the decorator to ProjectB.

as you said i have created two scenarios.

*

*to skip if the task already exists, it works like a charm, but it did not show any messages about the skipping part. how can we tell the decorator is skipped in the pipeline?

steps:
-  ${{ if eq(variables['Build.task'], 'ADOSecurityScanner@1') }}:
  - task: CmdLine@2
    displayName: 'Skipping the injector'
    inputs:
      script: |
        echo "##vso[task.logissue type=error]This Step '$(Build.task)' is not injected. You dont need this in pipeline"
        exit 1

*i have used the condition from the microsoft documentation and also similar to the one above you mentioned above.

it did not skip the injector with just the conditional command and when i added the task(powershell) in the decorator and pipeline.yaml then it is skipped the decorator matching the tasks on both yaml files.
does it show or log any info if the decorator is skipped in the pipeline.
i observed it does display differently when the decorator is skipped showing me the false statement.
do we need to define anything on the pipeline.yaml file as well?

I ran with the conditions you had provided above and somehow the decorator is still getting injected into projectB. can you let me know where i am doing wrong.
here is my basic azure-pipeline.yaml file pasted below.
trigger:
- main

pool:
  vmImage: ubuntu-latest

steps:
- script: echo Hello, world!
  displayName: 'Run a one-line script'

- script: |
    echo Add other tasks to build, test, and deploy your project.
    echo See https://aka.ms/yaml
  displayName: 'Run a multi-line script'

A: Be sure to read these docs:

*

*Expressions

*Specify Conditions
Simplest solution is to add a condition to the pipeline decorator:
steps:
- ${{ if not(eq(variables['azure-pipelines-tfvc-fixparallel-decorator.skip'], 'true')) }}:
  - task: tf-vc-fixparallel-log@2

The decorator can use the pre-defined variables, including System.TeamProject or System.TeamProjectId:

System.TeamProject    The name of the project that contains this build.
System.TeamProjectId  The ID of the project that this build belongs to.

For example:
steps:
- ${{ if in(variables['System.TeamProject'], 'ProjectA', 'ProjectB', 'ProjectC')) }}:
  - task: tf-vc-fixparallel-log@2

You will need to include the steps: if you aren't already. For some reason returning an empty steps[] is fine, but returning nothing will result in a failing decorator.

When you want to exclude a list of projects, simply inverse the condition. So to exclude 'ProjectB':
steps:
- ${{ if not(in(variables['System.TeamProject'], 'ProjectB')) }}:
  - task: ADOSecurityScanner@1 --> injected decorator

Your statement above explicitly inserts into ProjectB, nowhere else.

With regards to skipping the injector. The above -${{ if ... }}: completely removed the steps indented below it when the don't need to run. They will not appear at all.
You can also put a condition on the task itself, in that case it will show up in the timeline, but as skipped:
steps:
- task: ADOSecurityScanner@1 --> injected decorator
  condition: not(in(variables['System.TeamProject'], 'ProjectB'))

You can combine the condition with a variable, add it to the expression:
steps:
- ${{ if not(or(in(variables['System.TeamProject'], 'ProjectB'),
         eq(variables['skipInjector'], 'true')) }}:
  - task: ADOSecurityScanner@1 --> injected decorator

As you can see you can and(..., ...) and or(..., ...) these things together to form expressions as complex as you need.
You can see the evaluation of your decorator in the top level log panel of your pipeline job. You need to expand the Job preparation parameters section. And make sure you queue the pipeline with diagnostics turned on.

When you used a condition on the task within the decorator, expand the log for the task to see the condition evaluation:

Looking at she screenshot you posted, two versions of the decorator are included, one with conditions and one without it. Make sure you uninstall/disable that other version.


text:
Q: jq inner array value as new key outside the array Input:
{
"data": {
    "assets": [{
            "organizationId": "1056bda9-2598-4fdf-bd99-db3924464a75",
            "createdAt": "2018-03-14T14:41:41.154Z",
            "tags": [{
                    "value": "raml",
                    "key": null,
                    "mutable": false
                },
                {
                    "value": "rest",
                    "key": null,
                    "mutable": false
                },
                {
                    "value": "api",
                    "key": null,
                    "mutable": false
                },
                {
                    "value": "v1",
                    "key": "product-api-version",
                    "mutable": false
                },
                {
                    "value": "has-mule4-connector",
                    "key": null,
                    "mutable": false
                },
                {
                    "value": "has-mule3-connector",
                    "key": null,
                    "mutable": false
                },
                {
                    "value": "system",
                    "key": null,
                    "mutable": true
                },
                {
                    "value": "sourcing",
                    "key": null,
                    "mutable": true
                }
            ],
            "type": "rest-api"
        },
        {
            "organizationId": "SASAAs",
            "createdAt": "2018-03-14T14:41:41.154Z",
            "tags": [{
                    "value": "raml",
                    "key": null,
                    "mutable": false
                },
                {
                    "value": "rest",
                    "key": null,
                    "mutable": false
                },
                {
                    "value": "api",
                    "key": null,
                    "mutable": false
                },
                {
                    "value": "v1",
                    "key": "product-api-version",
                    "mutable": false
                },
                {
                    "value": "has-mule4-connector",
                    "key": null,
                    "mutable": false
                },
                {
                    "value": "has-mule3-connector",
                    "key": null,
                    "mutable": false
                },
                {
                    "value": "system",
                    "key": null,
                    "mutable": true
                },
                {
                    "value": "supply-chain",
                    "key": null,
                    "mutable": true
                }
            ],
            "type": "rest-api"
        }
    ]
}

}
Expected output:
{
"data": {
    "assets": [{
            "organizationId": "1056bda9-2598-4fdf-bd99-db3924464a75",
            "createdAt": "2018-03-14T14:41:41.154Z",
            "tags": [{
                    "value": "raml",
                    "key": null,
                    "mutable": false
                },
                {
                    "value": "rest",
                    "key": null,
                    "mutable": false
                },
                {
                    "value": "api",
                    "key": null,
                    "mutable": false
                },
                {
                    "value": "v1",
                    "key": "product-api-version",
                    "mutable": false
                },
                {
                    "value": "has-mule4-connector",
                    "key": null,
                    "mutable": false
                },
                {
                    "value": "has-mule3-connector",
                    "key": null,
                    "mutable": false
                },
                {
                    "value": "system",
                    "key": null,
                    "mutable": true
                },
                {
                    "value": "sourcing",
                    "key": null,
                    "mutable": true
                }
            ],
            "type": "rest-api",
            "domain": "sourcing"
        },
        {
            "organizationId": "SASAAs",
            "createdAt": "2018-03-14T14:41:41.154Z",
            "tags": [{
                    "value": "raml",
                    "key": null,
                    "mutable": false
                },
                {
                    "value": "rest",
                    "key": null,
                    "mutable": false
                },
                {
                    "value": "api",
                    "key": null,
                    "mutable": false
                },
                {
                    "value": "v1",
                    "key": "product-api-version",
                    "mutable": false
                },
                {
                    "value": "has-mule4-connector",
                    "key": null,
                    "mutable": false
                },
                {
                    "value": "has-mule3-connector",
                    "key": null,
                    "mutable": false
                },
                {
                    "value": "system",
                    "key": null,
                    "mutable": true
                },
                {
                    "value": "supply-chain",
                    "key": null,
                    "mutable": true
                }
            ],
            "type": "rest-api",
            "domain": "supply-chain"
        }
    ]
}

}
SO far, I tried this which worked partially for me.
.data.assets[] | select (.tags[].value=="sourcing") | . += {"domain":"sourcing"}
The problem is that I want this condition to apply for every object inside the array but I'm not able to do that. It is getting applied to the first object only.
Where am i doing wrong? Any suggestions please?

A: The following seems to meet the descriptive requirements:
.data.assets |=
  map( if any(.tags[].value; . == "sourcing")
       then . + {"domain":"sourcing"}
       else .
       end )

This produces the desired output except for the key-value pair "domain": "supply-chain" that is inconsistent with the descriptive requirements.
The following, by contrast, takes its cue from (that is, produces) the given output:
.data.assets |=
  map( if any(.tags[].value; . == "sourcing") then . + {"domain":"sourcing"}
       elif any(.tags[].value; . == "supply-chain") then . + {"domain":"supply-chain"}
       else . end )

Setting "domain" to all the tag values
.data.assets |= map( .domain += [.tags[].value] )