text:
Q: Orion goes down randomly when send entities I have installed Orion in a new machine, from the yum package and installing mongodb following the instructions from the Administration guide.
Also, I have deployed an orion-instance from wirecloud, and also I updated my old Orion instance from 0.21 to 0.22.
In all cases Orion goes down randomly and I have no idea why. Version 0.21 worked perfectly, but now it's very unstable.
I installed a cron task that checks if Orion has PID dead, and start it again, but the problem is that sometimes I get my Orion instance down for 1 minute.
I send requests like this:
    (curl http://my.orion.instance.es:1026/v1/updateContext -s -S --header 'Content-Type: application/json' --header 'Accept: application/json' -d @- | python -mjson.tool) <<EOF
{
    "contextElements": [
        {
            "type": "Alert",
            "isPattern": "false",
            "id": "myemail@dot.com",
            "attributes": [
            {
                "name": "alert-type",
                "type": "text",
                "value": "10020"
            },{
                "name": "message",
                "type": "text",
                "value": "Flooding"
            },{
                "name": "status",
                "type": "text",
                "value": "100"
            },{
                "name": "gateway",
                "type": "text",
                "value": "5"
            }
            ]
        }
    ],
    "updateAction": "APPEND"
}
EOF

And the response is:
    {
    "contextResponses": [
        {
            "contextElement": {
                "attributes": [
                    {
                        "name": "alert-type",
                        "type": "text",
                        "value": ""
                    },
                    {
                        "name": "message",
                        "type": "text",
                        "value": ""
                    },
                    {
                        "name": "status",
                        "type": "text",
                        "value": ""
                    },
                    {
                        "name": "gateway",
                        "type": "text",
                        "value": ""
                    }
                ],
                "id": "myemail@dot.com",
                "isPattern": "false",
                "type": "Alert"
            },
            "statusCode": {
                "code": "200",
                "reasonPhrase": "OK"
            }
        }
    ]
}

And in this moment, Orion goes down (also happens if I send an UPDATE or DELETE).
I have ngsi2cosmos running, and show these messages (maybe the problem is here):
INFO in requests_wrappers [/root/ngsi2cosmos/requests_wrappers.py:58]:
   --> PUT http://cosmos.lab.fi-ware.org:14000/webhdfs/v1/user/yyyyy/xxx/myemail@dot.com-Alert-status-text.txt?op=create&user.name=yyyyy&data=true
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
INFO in requests_wrappers [/root/ngsi2cosmos/requests_wrappers.py:62]:
   <-- 500
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
DEBUG in requests_wrappers [/root/ngsi2cosmos/requests_wrappers.py:64]:
  <-- {"RemoteException":{"message":"org.apache.hadoop.hdfs.server.namenode.SafeModeException: Cannot create file\/user\/yyyy\/xxx\/myemail@dot.com-Alert-status-text.txt. Name node is in safe mode.","exception":"RemoteException","javaClassName":"org.apache.hadoop.ipc.RemoteException"}}

How can I solve this issue?
EDIT:
echo 'db.csubs.count()' | mongo orion --quiet
> 176

echo 'db.registrations.count()' | mongo orion --quiet
> 0

Running contextBroker in foreground:
[root@orion-figlass ~]# service contextBroker stop
Stopping...
contextBroker (pid  5043) is running...
Stopping contextBroker...                                  [  OK  ]
[root@orion-figlass ~]#
[root@orion-figlass ~]# contextBroker -fg
INFO@19:47:48  contextBroker.cpp[1411]: Orion Context Broker is running
INFO@19:47:48  mongoConnectionPool.cpp[184]: Successful connection to database
INFO@19:47:48  mongoConnectionPool.cpp[184]: Successful connection to database
INFO@19:47:48  mongoConnectionPool.cpp[184]: Successful connection to database
INFO@19:47:48  mongoConnectionPool.cpp[184]: Successful connection to database
INFO@19:47:48  mongoConnectionPool.cpp[184]: Successful connection to database
INFO@19:47:48  mongoConnectionPool.cpp[184]: Successful connection to database
INFO@19:47:48  mongoConnectionPool.cpp[184]: Successful connection to database
INFO@19:47:48  mongoConnectionPool.cpp[184]: Successful connection to database
INFO@19:47:48  mongoConnectionPool.cpp[184]: Successful connection to database
INFO@19:47:48  mongoConnectionPool.cpp[184]: Successful connection to database
INFO@19:47:48  contextBroker.cpp[1191]: Connected to mongo at localhost:orion
INFO@19:47:48  MongoGlobal.cpp[480]: Database Operation Successful ({ conditions.type: "ONTIMEINTERVAL" })
INFO@19:47:48  contextBroker.cpp[1499]: Startup completed
INFO@19:48:28  rest.cpp[781]: Starting transaction from 66.249.81.169:60928/version
INFO@19:48:28  rest.cpp[384]: Transaction ended
INFO@19:48:28  rest.cpp[781]: Starting transaction from 66.249.93.161:48199/version
INFO@19:48:28  rest.cpp[384]: Transaction ended
INFO@19:48:28  rest.cpp[781]: Starting transaction from 66.249.93.161:48199/favicon.ico
WARNING@19:48:28  rest.cpp[347]: Bad Input (no valid 'Accept-format' found)
WARNING@19:48:28  rest.cpp[347]: Bad Input (no valid 'Accept-format' found)
WARNING@19:48:28  rest.cpp[827]: Bad Input (invalid mime-type in Accept http-header)
WARNING@19:48:28  rest.cpp[836]: Bad Input (error in URI parameters)
INFO@19:48:28  rest.cpp[384]: Transaction ended
INFO@19:48:28  rest.cpp[781]: Starting transaction from 66.249.81.161:37559/favicon.ico
WARNING@19:48:28  rest.cpp[347]: Bad Input (no valid 'Accept-format' found)
WARNING@19:48:28  rest.cpp[347]: Bad Input (no valid 'Accept-format' found)
WARNING@19:48:28  rest.cpp[827]: Bad Input (invalid mime-type in Accept http-header)
WARNING@19:48:28  rest.cpp[836]: Bad Input (error in URI parameters)
INFO@19:48:28  rest.cpp[384]: Transaction ended
INFO@19:48:31  rest.cpp[781]: Starting transaction from 188.76.231.187:18019/version
INFO@19:48:31  rest.cpp[384]: Transaction ended
INFO@19:48:31  rest.cpp[781]: Starting transaction from 188.76.231.187:18019/favicon.ico
WARNING@19:48:31  badRequest.cpp[52]: Bad Input (service '/favicon.ico' not found)
INFO@19:48:31  rest.cpp[384]: Transaction ended
INFO@19:48:34  rest.cpp[781]: Starting transaction from 188.76.231.187:18019/version
INFO@19:48:34  rest.cpp[384]: Transaction ended
INFO@19:48:34  rest.cpp[781]: Starting transaction from 188.76.231.187:18019/favicon.ico
WARNING@19:48:34  badRequest.cpp[52]: Bad Input (service '/favicon.ico' not found)
INFO@19:48:34  rest.cpp[384]: Transaction ended
INFO@19:49:11  rest.cpp[781]: Starting transaction from 188.76.231.187:18019/favicon.ico
WARNING@19:49:11  badRequest.cpp[52]: Bad Input (service '/favicon.ico' not found)
INFO@19:49:11  rest.cpp[384]: Transaction ended
INFO@19:49:12  rest.cpp[781]: Starting transaction from 188.76.231.187:18019/version
INFO@19:49:12  rest.cpp[384]: Transaction ended
INFO@19:49:12  rest.cpp[781]: Starting transaction from 188.76.231.187:18019/favicon.ico
WARNING@19:49:12  badRequest.cpp[52]: Bad Input (service '/favicon.ico' not found)
INFO@19:49:12  rest.cpp[384]: Transaction ended
INFO@19:49:53  rest.cpp[781]: Starting transaction from 130.206.84.11:36938/ngsi10/subscribeContext
INFO@19:49:53  MongoGlobal.cpp[1095]: Database Operation Successful ({ query: { $or: [ { _id.id: /.*/, _id.type: "Alert" } ], _id.servicePath: { $in: [ null, /^$/, /^/.*/ ] } }, orderby: { creDate: 1 } })
INFO@19:49:53  MongoGlobal.cpp[1095]: Database Operation Successful ({ query: { $or: [ { _id.id: /.*/, _id.type: "Alert" } ], _id.servicePath: { $in: [ null, /^$/, /^/.*/ ] } }, orderby: { creDate: 1 } })
INFO@19:49:53  mongoSubscribeContext.cpp[147]: Database Operation Successful (insert { _id: ObjectId('559c2d6142b637df6db61746'), expiration: 1436309393, reference: "http://wirecloud.ld.testbed.fi-ware.eu:3000/callbacks/22:51:00-1:22:51:01-1", servicePath: "/#", entities: [ { id: ".*", type: "Alert", isPattern: "true" } ], attrs: [], conditions: [ { type: "ONCHANGE", value: [ "alert-type", "status" ] } ], lastNotification: 1436298593, count: 1, format: "XML" })
INFO@19:49:53  httpRequestSend.cpp[191]: Starting transaction to wirecloud.ld.testbed.fi-ware.eu:3000/callbacks/22:51:00-1:22:51:01-1
INFO@19:49:53  rest.cpp[384]: Transaction ended
INFO@19:49:53  httpRequestSend.cpp[424]: Notification Successfully Sent to wirecloud.ld.testbed.fi-ware.eu:3000/callbacks/22:51:00-1:22:51:01-1
INFO@19:49:53  httpRequestSend.cpp[435]: Transaction ended
INFO@19:50:08  rest.cpp[781]: Starting transaction from 188.76.231.187:18019/version
INFO@19:50:08  rest.cpp[384]: Transaction ended
INFO@19:50:08  rest.cpp[781]: Starting transaction from 188.76.231.187:18019/favicon.ico
WARNING@19:50:08  badRequest.cpp[52]: Bad Input (service '/favicon.ico' not found)
INFO@19:50:08  rest.cpp[384]: Transaction ended
INFO@19:50:26  rest.cpp[781]: Starting transaction from 130.206.84.11:36957/ngsi10/subscribeContext
INFO@19:50:26  MongoGlobal.cpp[1095]: Database Operation Successful ({ query: { $or: [ { _id.id: /.*/, _id.type: "Alert" } ], _id.servicePath: { $in: [ null, /^$/, /^/.*/ ] } }, orderby: { creDate: 1 } })
INFO@19:50:26  MongoGlobal.cpp[1095]: Database Operation Successful ({ query: { $or: [ { _id.id: /.*/, _id.type: "Alert" } ], _id.servicePath: { $in: [ null, /^$/, /^/.*/ ] } }, orderby: { creDate: 1 } })
INFO@19:50:26  httpRequestSend.cpp[191]: Starting transaction to wirecloud.ld.testbed.fi-ware.eu:3000/callbacks/22:51:34-1:22:51:34-1
INFO@19:50:26  mongoSubscribeContext.cpp[147]: Database Operation Successful (insert { _id: ObjectId('559c2d8242b637df6db61747'), expiration: 1436309426, reference: "http://wirecloud.ld.testbed.fi-ware.eu:3000/callbacks/22:51:34-1:22:51:34-1", servicePath: "/#", entities: [ { id: ".*", type: "Alert", isPattern: "true" } ], attrs: [], conditions: [ { type: "ONCHANGE", value: [ "alert-type", "status" ] } ], lastNotification: 1436298626, count: 1, format: "XML" })
INFO@19:50:26  rest.cpp[384]: Transaction ended
INFO@19:50:27  httpRequestSend.cpp[424]: Notification Successfully Sent to wirecloud.ld.testbed.fi-ware.eu:3000/callbacks/22:51:34-1:22:51:34-1
INFO@19:50:27  httpRequestSend.cpp[435]: Transaction ended

At this moment, orion goes down:
INFO@19:48:28  rest.cpp[781]: Starting transaction from 66.249.93.161:48199/favicon.ico
WARNING@19:48:28  rest.cpp[347]: Bad Input (no valid 'Accept-format' found)
WARNING@19:48:28  rest.cpp[347]: Bad Input (no valid 'Accept-format' found)
WARNING@19:48:28  rest.cpp[827]: Bad Input (invalid mime-type in Accept http-header)
WARNING@19:48:28  rest.cpp[836]: Bad Input (error in URI parameters)
INFO@19:48:28  rest.cpp[384]: Transaction ended
INFO@19:48:28  rest.cpp[781]: Starting transaction from 66.249.81.161:37559/favicon.ico
WARNING@19:48:28  rest.cpp[347]: Bad Input (no valid 'Accept-format' found)
WARNING@19:48:28  rest.cpp[347]: Bad Input (no valid 'Accept-format' found)
WARNING@19:48:28  rest.cpp[827]: Bad Input (invalid mime-type in Accept http-header)
WARNING@19:48:28  rest.cpp[836]: Bad Input (error in URI parameters)
INFO@19:48:28  rest.cpp[384]: Transaction ended
INFO@19:48:31  rest.cpp[781]: Starting transaction from 188.76.231.187:18019/version
INFO@19:48:31  rest.cpp[384]: Transaction ended

Screenshot of /version where displays the uptime (before that, uptime was 5 days, but when I start using the mashup, something goes wrong and Orion goes down).

EDIT 2:
Installed gdb, executed ulimit -c unlimited
running contextBroker -fg
Now the shell shows more detailed errors:
INFO@20:21:06  httpRequestSend.cpp[191]: Starting transaction to wirecloud.ld.testbed.fi-ware.eu:3000/callbacks/23:22:00-1:23:22:01-1
INFO@20:21:06  rest.cpp[384]: Transaction ended
INFO@20:21:06  httpRequestSend.cpp[424]: Notification Successfully Sent to wirecloud.ld.testbed.fi-ware.eu:3000/callbacks/22:51:34-1:22:51:34-1
INFO@20:21:06  httpRequestSend.cpp[435]: Transaction ended
INFO@20:21:06  httpRequestSend.cpp[424]: Notification Successfully Sent to wirecloud.ld.testbed.fi-ware.eu:3000/callbacks/23:22:00-1:23:22:01-1
INFO@20:21:06  httpRequestSend.cpp[435]: Transaction ended
INFO@20:21:06  httpRequestSend.cpp[424]: Notification Successfully Sent to api.wiim.es:80/api/v1/alert
INFO@20:21:06  httpRequestSend.cpp[435]: Transaction ended
*** longjmp causes uninitialized stack frame ***: contextBroker terminated
======= Backtrace: =========
/lib64/libc.so.6(__fortify_fail+0x37)[0x3c5ab02527]
/lib64/libc.so.6[0x3c5ab024b9]
/lib64/libc.so.6(__longjmp_chk+0x33)[0x3c5ab02423]
/usr/lib64/libcurl.so.4[0x3c5e20eb25]
/lib64/libc.so.6[0x3c5aa326a0]
/lib64/libc.so.6(nanosleep+0x2d)[0x3c5aaaca3d]
/lib64/libc.so.6(sleep+0xe0)[0x3c5aaac8b0]
contextBroker(main+0x90a)[0x49e5da]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x3c5aa1ed5d]
contextBroker[0x483219]
======= Memory map: ========
00400000-00737000 r-xp 00000000 fc:01 26350                              /usr/bin/contextBroker
00937000-00941000 rw-p 00337000 fc:01 26350                              /usr/bin/contextBroker
00941000-00989000 rw-p 00000000 00:00 0
0120e000-01271000 rw-p 00000000 00:00 0                                  [heap]
34e4a00000-34e4a12000 r-xp 00000000 fc:01 53961                          /usr/lib64/libmicrohttpd.so.10.16.1
34e4a12000-34e4c12000 ---p 00012000 fc:01 53961                          /usr/lib64/libmicrohttpd.so.10.16.1
34e4c12000-34e4c13000 rw-p 00012000 fc:01 53961                          /usr/lib64/libmicrohttpd.so.10.16.1
3899200000-3899203000 r-xp 00000000 fc:01 55423                          /usr/lib64/libboost_system-mt.so.5
3899203000-3899402000 ---p 00003000 fc:01 55423                          /usr/lib64/libboost_system-mt.so.5
3899402000-3899403000 rw-p 00002000 fc:01 55423                          /usr/lib64/libboost_system-mt.so.5
389aa00000-389aa14000 r-xp 00000000 fc:01 55424                          /usr/lib64/libboost_filesystem-mt.so.5
389aa14000-389ac14000 ---p 00014000 fc:01 55424                          /usr/lib64/libboost_filesystem-mt.so.5
389ac14000-389ac15000 rw-p 00014000 fc:01 55424                          /usr/lib64/libboost_filesystem-mt.so.5
3c5a600000-3c5a620000 r-xp 00000000 fc:01 11913                          /lib64/ld-2.12.so
3c5a81f000-3c5a820000 r--p 0001f000 fc:01 11913                          /lib64/ld-2.12.so
3c5a820000-3c5a821000 rw-p 00020000 fc:01 11913                          /lib64/ld-2.12.so
3c5a821000-3c5a822000 rw-p 00000000 00:00 0
3c5aa00000-3c5ab8a000 r-xp 00000000 fc:01 32217                          /lib64/libc-2.12.so
3c5ab8a000-3c5ad8a000 ---p 0018a000 fc:01 32217                          /lib64/libc-2.12.so
3c5ad8a000-3c5ad8e000 r--p 0018a000 fc:01 32217                          /lib64/libc-2.12.so
3c5ad8e000-3c5ad8f000 rw-p 0018e000 fc:01 32217                          /lib64/libc-2.12.so
3c5ad8f000-3c5ad94000 rw-p 00000000 00:00 0
3c5ae00000-3c5ae17000 r-xp 00000000 fc:01 32221                          /lib64/libpthread-2.12.so
3c5ae17000-3c5b017000 ---p 00017000 fc:01 32221                          /lib64/libpthread-2.12.so
3c5b017000-3c5b018000 r--p 00017000 fc:01 32221                          /lib64/libpthread-2.12.so
3c5b018000-3c5b019000 rw-p 00018000 fc:01 32221                          /lib64/libpthread-2.12.so
3c5b019000-3c5b01d000 rw-p 00000000 00:00 0
3c5b200000-3c5b202000 r-xp 00000000 fc:01 60370                          /lib64/libdl-2.12.so
3c5b202000-3c5b402000 ---p 00002000 fc:01 60370                          /lib64/libdl-2.12.so
3c5b402000-3c5b403000 r--p 00002000 fc:01 60370                          /lib64/libdl-2.12.so
3c5b403000-3c5b404000 rw-p 00003000 fc:01 60370                          /lib64/libdl-2.12.so
3c5b600000-3c5b683000 r-xp 00000000 fc:01 9690                           /lib64/libm-2.12.so
3c5b683000-3c5b882000 ---p 00083000 fc:01 9690                           /lib64/libm-2.12.so
3c5b882000-3c5b883000 r--p 00082000 fc:01 9690                           /lib64/libm-2.12.so
3c5b883000-3c5b884000 rw-p 00083000 fc:01 9690                           /lib64/libm-2.12.so
3c5ba00000-3c5ba07000 r-xp 00000000 fc:01 32222                          /lib64/librt-2.12.so
3c5ba07000-3c5bc06000 ---p 00007000 fc:01 32222                          /lib64/librt-2.12.so
3c5bc06000-3c5bc07000 r--p 00006000 fc:01 32222                          /lib64/librt-2.12.so
3c5bc07000-3c5bc08000 rw-p 00007000 fc:01 32222                          /lib64/librt-2.12.so
3c5be00000-3c5be15000 r-xp 00000000 fc:01 34600                          /lib64/libz.so.1.2.3
3c5be15000-3c5c014000 ---p 00015000 fc:01 34600                          /lib64/libz.so.1.2.3
3c5c014000-3c5c015000 r--p 00014000 fc:01 34600                          /lib64/libz.so.1.2.3
3c5c015000-3c5c016000 rw-p 00015000 fc:01 34600                          /lib64/libz.so.1.2.3
3c5c200000-3c5c213000 r-xp 00000000 fc:01 9703                           /usr/lib64/libboost_thread-mt.so.5
3c5c213000-3c5c413000 ---p 00013000 fc:01 9703                           /usr/lib64/libboost_thread-mt.so.5
3c5c413000-3c5c415000 rw-p 00013000 fc:01 9703                           /usr/lib64/libboost_thread-mt.so.5
3c5c600000-3c5c61d000 r-xp 00000000 fc:01 61643                          /lib64/libselinux.so.1
3c5c61d000-3c5c81c000 ---p 0001d000 fc:01 61643                          /lib64/libselinux.so.1
3c5c81c000-3c5c81d000 r--p 0001c000 fc:01 61643                          /lib64/libselinux.so.1
3c5c81d000-3c5c81e000 rw-p 0001d000 fc:01 61643                          /lib64/libselinux.so.1
3c5c81e000-3c5c81f000 rw-p 00000000 00:00 0
3c5ca00000-3c5ca49000 r-xp 00000000 fc:01 61732                          /lib64/libldap-2.4.so.2.5.6
3c5ca49000-3c5cc48000 ---p 00049000 fc:01 61732                          /lib64/libldap-2.4.so.2.5.6
3c5cc48000-3c5cc49000 r--p 00048000 fc:01 61732                          /lib64/libldap-2.4.so.2.5.6
3c5cc49000-3c5cc4b000 rw-p 00049000 fc:01 61732                          /lib64/libldap-2.4.so.2.5.6
3c5ce00000-3c5ce16000 r-xp 00000000 fc:01 61642                          /lib64/libresolv-2.12.so
3c5ce16000-3c5d016000 ---p 00016000 fc:01 61642                          /lib64/libresolv-2.12.so
3c5d016000-3c5d017000 r--p 00016000 fc:01 61642                          /lib64/libresolv-2.12.so
3c5d017000-3c5d018000 rw-p 00017000 fc:01 61642                          /lib64/libresolv-2.12.so
3c5d018000-3c5d01a000 rw-p 00000000 00:00 0
3c5d200000-3c5d232000 r-xp 00000000 fc:01 32266                          /lib64/libidn.so.11.6.1
3c5d232000-3c5d431000 ---p 00032000 fc:01 32266                          /lib64/libidn.so.11.6.1
3c5d431000-3c5d432000 rw-p 00031000 fc:01 32266                          /lib64/libidn.so.11.6.1Aborted (core dumped)

Second trace error (Orion has goes down twice in this period):
INFO@20:21:06  httpRequestSend.cpp[424]: Notification Successfully Sent to api.wiim.es:80/api/v1/alert
INFO@20:21:06  httpRequestSend.cpp[435]: Transaction ended
*** longjmp causes uninitialized stack frame ***: contextBroker terminated
======= Backtrace: =========
/lib64/libc.so.6(__fortify_fail+0x37)[0x3c5ab02527]
/lib64/libc.so.6[0x3c5ab024b9]
/lib64/libc.so.6(__longjmp_chk+0x33)[0x3c5ab02423]
/usr/lib64/libcurl.so.4[0x3c5e20eb25]
/lib64/libc.so.6[0x3c5aa326a0]
/lib64/libc.so.6(nanosleep+0x2d)[0x3c5aaaca3d]
/lib64/libc.so.6(sleep+0xe0)[0x3c5aaac8b0]
contextBroker(main+0x90a)[0x49e5da]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x3c5aa1ed5d]
contextBroker[0x483219]
======= Memory map: ========
00400000-00737000 r-xp 00000000 fc:01 26350                              /usr/bin/contextBroker
00937000-00941000 rw-p 00337000 fc:01 26350                              /usr/bin/contextBroker
00941000-00989000 rw-p 00000000 00:00 0
0120e000-01271000 rw-p 00000000 00:00 0                                  [heap]
34e4a00000-34e4a12000 r-xp 00000000 fc:01 53961                          /usr/lib64/libmicrohttpd.so.10.16.1
34e4a12000-34e4c12000 ---p 00012000 fc:01 53961                          /usr/lib64/libmicrohttpd.so.10.16.1
34e4c12000-34e4c13000 rw-p 00012000 fc:01 53961                          /usr/lib64/libmicrohttpd.so.10.16.1
3899200000-3899203000 r-xp 00000000 fc:01 55423                          /usr/lib64/libboost_system-mt.so.5
3899203000-3899402000 ---p 00003000 fc:01 55423                          /usr/lib64/libboost_system-mt.so.5
3899402000-3899403000 rw-p 00002000 fc:01 55423                          /usr/lib64/libboost_system-mt.so.5
389aa00000-389aa14000 r-xp 00000000 fc:01 55424                          /usr/lib64/libboost_filesystem-mt.so.5
389aa14000-389ac14000 ---p 00014000 fc:01 55424                          /usr/lib64/libboost_filesystem-mt.so.5
389ac14000-389ac15000 rw-p 00014000 fc:01 55424                          /usr/lib64/libboost_filesystem-mt.so.5
3c5a600000-3c5a620000 r-xp 00000000 fc:01 11913                          /lib64/ld-2.12.so
3c5a81f000-3c5a820000 r--p 0001f000 fc:01 11913                          /lib64/ld-2.12.so
3c5a820000-3c5a821000 rw-p 00020000 fc:01 11913                          /lib64/ld-2.12.so
3c5a821000-3c5a822000 rw-p 00000000 00:00 0
3c5aa00000-3c5ab8a000 r-xp 00000000 fc:01 32217                          /lib64/libc-2.12.so
3c5ab8a000-3c5ad8a000 ---p 0018a000 fc:01 32217                          /lib64/libc-2.12.so
3c5ad8a000-3c5ad8e000 r--p 0018a000 fc:01 32217                          /lib64/libc-2.12.so
3c5ad8e000-3c5ad8f000 rw-p 0018e000 fc:01 32217                          /lib64/libc-2.12.so
3c5ad8f000-3c5ad94000 rw-p 00000000 00:00 0
3c5ae00000-3c5ae17000 r-xp 00000000 fc:01 32221                          /lib64/libpthread-2.12.so
3c5ae17000-3c5b017000 ---p 00017000 fc:01 32221                          /lib64/libpthread-2.12.so
3c5b017000-3c5b018000 r--p 00017000 fc:01 32221                          /lib64/libpthread-2.12.so
3c5b018000-3c5b019000 rw-p 00018000 fc:01 32221                          /lib64/libpthread-2.12.so
3c5b019000-3c5b01d000 rw-p 00000000 00:00 0
3c5b200000-3c5b202000 r-xp 00000000 fc:01 60370                          /lib64/libdl-2.12.so
3c5b202000-3c5b402000 ---p 00002000 fc:01 60370                          /lib64/libdl-2.12.so
3c5b402000-3c5b403000 r--p 00002000 fc:01 60370                          /lib64/libdl-2.12.so
3c5b403000-3c5b404000 rw-p 00003000 fc:01 60370                          /lib64/libdl-2.12.so
3c5b600000-3c5b683000 r-xp 00000000 fc:01 9690                           /lib64/libm-2.12.so
3c5b683000-3c5b882000 ---p 00083000 fc:01 9690                           /lib64/libm-2.12.so
3c5b882000-3c5b883000 r--p 00082000 fc:01 9690                           /lib64/libm-2.12.so
3c5b883000-3c5b884000 rw-p 00083000 fc:01 9690                           /lib64/libm-2.12.so
3c5ba00000-3c5ba07000 r-xp 00000000 fc:01 32222                          /lib64/librt-2.12.so
3c5ba07000-3c5bc06000 ---p 00007000 fc:01 32222                          /lib64/librt-2.12.so
3c5bc06000-3c5bc07000 r--p 00006000 fc:01 32222                          /lib64/librt-2.12.so
3c5bc07000-3c5bc08000 rw-p 00007000 fc:01 32222                          /lib64/librt-2.12.so
3c5be00000-3c5be15000 r-xp 00000000 fc:01 34600                          /lib64/libz.so.1.2.3
3c5be15000-3c5c014000 ---p 00015000 fc:01 34600                          /lib64/libz.so.1.2.3
3c5c014000-3c5c015000 r--p 00014000 fc:01 34600                          /lib64/libz.so.1.2.3
3c5c015000-3c5c016000 rw-p 00015000 fc:01 34600                          /lib64/libz.so.1.2.3
3c5c200000-3c5c213000 r-xp 00000000 fc:01 9703                           /usr/lib64/libboost_thread-mt.so.5
3c5c213000-3c5c413000 ---p 00013000 fc:01 9703                           /usr/lib64/libboost_thread-mt.so.5
3c5c413000-3c5c415000 rw-p 00013000 fc:01 9703                           /usr/lib64/libboost_thread-mt.so.5
3c5c600000-3c5c61d000 r-xp 00000000 fc:01 61643                          /lib64/libselinux.so.1
3c5c61d000-3c5c81c000 ---p 0001d000 fc:01 61643                          /lib64/libselinux.so.1
3c5c81c000-3c5c81d000 r--p 0001c000 fc:01 61643                          /lib64/libselinux.so.1
3c5c81d000-3c5c81e000 rw-p 0001d000 fc:01 61643                          /lib64/libselinux.so.1
3c5c81e000-3c5c81f000 rw-p 00000000 00:00 0
3c5ca00000-3c5ca49000 r-xp 00000000 fc:01 61732                          /lib64/libldap-2.4.so.2.5.6
3c5ca49000-3c5cc48000 ---p 00049000 fc:01 61732                          /lib64/libldap-2.4.so.2.5.6
3c5cc48000-3c5cc49000 r--p 00048000 fc:01 61732                          /lib64/libldap-2.4.so.2.5.6
3c5cc49000-3c5cc4b000 rw-p 00049000 fc:01 61732                          /lib64/libldap-2.4.so.2.5.6
3c5ce00000-3c5ce16000 r-xp 00000000 fc:01 61642                          /lib64/libresolv-2.12.so
3c5ce16000-3c5d016000 ---p 00016000 fc:01 61642                          /lib64/libresolv-2.12.so
3c5d016000-3c5d017000 r--p 00016000 fc:01 61642                          /lib64/libresolv-2.12.so
3c5d017000-3c5d018000 rw-p 00017000 fc:01 61642                          /lib64/libresolv-2.12.so
3c5d018000-3c5d01a000 rw-p 00000000 00:00 0
3c5d200000-3c5d232000 r-xp 00000000 fc:01 32266                          /lib64/libidn.so.11.6.1
3c5d232000-3c5d431000 ---p 00032000 fc:01 32266                          /lib64/libidn.so.11.6.1
3c5d431000-3c5d432000 rw-p 00031000 fc:01 32266                          /lib64/libidn.so.11.6.1Aborted (core dumped)

A: The cause of this problem is this issue that has been already solved in the developed branch, also related with this Q&A. The fix will come with Orion 0.23.0 version.
As temporal workaround, you can use IPs instead of hostnames in reference field in subscriptions.


text:
Q: variable in constructor not declared in this scope c++ Forgive me for I'm still a beginner in c++
The following code gives an error that the variable is not in scope,
error: 'vec' was not declared in this scope
         vec[key] = value;

without changing how object is declared in the main function, how can I resolve this issue?
// Program to illustrate the working of
// objects and class in C++ Programming

#include <iostream>
#include <vector>
using namespace std;

// create a class
class MyHashMap {
public:
    /** Initialize your data structure here. */
    // vector<int> vec;
    MyHashMap() {
        vector<int> vec(1000000, -1);
    }

    /** value will always be non-negative. */
    void put(int key, int value) {
        vec[key] = value;
    }

    /** Returns the value to which the specified key is mapped, or -1 if this map contains no mapping for the key */
    int get(int key) {
        return vec[key];
    }

    /** Removes the mapping of the specified value key if this map contains a mapping for the key */
    void remove(int key) {
        vec[key] = -1;
    }
};

int main() {
   int key,value;
   cin>>key>>value;
   MyHashMap* obj = new MyHashMap();
   obj->put(key,value);
   int param_2 = obj->get(key);
   obj->remove(key);
   return 0;
}

A: /** Initialize your data structure here. */
std::vector<int> vec;
MyHashMap():vec(1000000, -1)
{}

redpajama_set_name: RedPajamaStackExchange


text:
Q: Sometimes xcode playground does not work I am learning the Array of swift language now but sometimes without any error in the statements, the playground of xcode does not show the result.

A: I've experienced that the playground is still a bit buggy. This happens to me also sometimes. What I will do then is using the println method to output or example the values of an array.


text:
Q: Kernel of selfadjoint compact operator is trivial Let $H$ be separable Hilbert space and $K(H)$ the space of all compact operators acting in $H$. If $x\in K(H)$ and $x=x^*$ then is it true that $\ker(x)\neq \{0\}$?. Where $\ker(x)$ is the kernel of $x$. Thanks for any help.

A: The answer is no.   An example of a self-adjoint compact with a trivial kernel is as follows: define $x:\ell^2 \to \ell^2$ by
$$
x\left[(\xi_k)_{k = 1}^\infty\right]
 = (\xi_k/k)_{k=1}^\infty
$$


text:
Q: Possible to return to the 3 vertical Mail.app columns? I tried this option, and now sit with the folders on the left in Apple Mail on my Mac, then vertical preview pane (fine), and my full view message pane disappeared.  No amount of 'handle pulling' from
 the right has restored the view.
I have checked preferences in Mail, and changed between the classic & other layouts to no avail.  HELP.
I really want to return to the 3 vertical columns (folders, preview, and full view), in that order.  Thanks.

A: Hoshts is correct—I've made a recording showing what it will look like when you "resize" the invisible column:

A: I ran into this problem in Mail 10.2 (3259) on macOS 10.12.2 Sierra.  The <-| resize handle was not always present, but toggling to Classic view and back again may have affected that.  More importantly, when dragging that handle to the left from the extreme right side of the window, there is no visible effect until moving it a certain distance.  For me it was about half the width of the window.  When reaching that point, the pane appears at that width and follows the drag to the left, but disappears if moved back to the right past that same point.

A: Go to Preferences and open the Viewing tab. There you will see a checkbox that says 'Use classic layout'. Uncheck that box. You will now have to drag the message preview pane resize bar from the extreme right as you need.


text:
Q: Isn't flake8 meant to validate find import errors (E0401)? Standard installation of flake8. Version 3.5.0.
Running with:
flake8 /<module directory>

It lists unused imports but not incorrect imports (an import that doesn't exist). I couldn't find anything in the documentation whether that is intended or not. Can someone clarify?
pylint finds incorrect imports and reports them as E0401.

A: the default set of flake8 plugins perform static checks -- that is they analyze your source code in isolation.  they do not run your code, they do not follow imports, they do not see much beyond the source, tokenization, and ast of your program
other things such as pylint, mypy, etc. perform dynamic analysis, that is they analyze your codebase as a whole.  they're going to need to do a lot more work to perform that analysis and as such they're going to be slower

disclaimer: I'm the current flake8 maintainer, I also maintain the default plugins pycodestyle, pyflakes, and mccabe


text:
Q: Best parameters of an Optuna multi-objective optimization When performing a single-objective optimization with Optuna, the best parameters of the study are accessible using:
import optuna
def objective(trial):
    x = trial.suggest_uniform('x', -10, 10)
    return (x - 2) ** 2

study = optuna.create_study(direction='minimize')
study.optimize(objective, n_trials=100)

study.best_params  # E.g. {'x': 2.002108042}

If I want to perform a multi-objective optimization, this would be become for example :
import optuna
def multi_objective(trial):
    x = trial.suggest_uniform('x', -10, 10)
    f1 = (x - 2) ** 2
    f2 = -f1
    return f1, f2

study = optuna.create_study(directions=['minimize', 'maximize'])
study.optimize(multi_objective, n_trials=100)

This works, but the command study.best_params fails with RuntimeError: The best trial of a 'study' is only supported for single-objective optimization.
How can I get the best parameters for a multi-objective optimization ?

A: In multi-objective optimization, you often end up with more than one best trial, but rather a set of trials. This set if often referred to as the Pareto front. You can get this Pareto front, or the list of trials, via study.best_trials, then look at the parameters from each individual trial i.e. study.best_trials[some_index].params.
For instance, given your directions of minimizing f1 and maximizing f2, you might end up with a trial that has a small value for f1 (good) but at the same time small value for f2 (bad) while another trial might have a large value for both f1 (bad) and f2 (good). Both of these trials could be returned from study.best_trials.


text:
Q: Having trouble associating two users when adding a friend Thanks for visiting
Whenever I click on Add a friend I get "friend added" but upon checking my console it says Friendship id: 10, user_id: 2, friend_id: 0, created_at: "2015-09-11 05:05:27", updated_at: "2015-09-11 05:05:27"> meaning it's adding but not associating with a friend_id. Can someone help me figure out why it's not saving friend_id whenever I click add a friend. Thank you for all your help.
Schema.rb
create_table "friendships", force: true do |t|
    t.integer  "user_id"
    t.integer  "friend_id"
    t.datetime "created_at"
    t.datetime "updated_at"
end

Routes.rb
root "users#index"

  resources :friendships, only: [:create, :destroy]
  resources :sessions, only: [:new, :create, :destroy]
  resources :users

Users/show
<% @users.each do |user| %>
 <% if user.user_name != current_user.user_name %>
  <% if @friendshiplink.nil? %>
   <%= user.user_name %>
   <%= link_to "Add Friend", friendships_path(friend_id: user), method: :post %>
  <% else %>
   <%= link_to(
       ("Unfollow"),
      "/friendships/#{ @friendshiplink.id }",
      method: :delete) %>
  <% end %>
 <% end %>
<% end %>

User Model
has_many :friendships
has_many :friends, through: :friendships
has_many :inverse_friendships, class_name: "Friendship", foreign_key:  "friend_id"
has_many :inverse_friends, through: :inverse_friendships, source: :user

Friendship Model
belongs_to :user
belongs_to :friend, class_name: "User"

User Controller
def show
 @users = User.all
 @user = User.friendly.find(params[:id])
 current_user
 if @current_user
    @followerlink = Follower.where(leader_id: @user.id,
                             follower_id: @current_user.id).first
    @friendshiplink = Friendship.where(user_id: @user.id,
                                friend_id: @current_user.id).first
 end
end

Friendship Controller
def create
 @friendship = current_user.friendships.build(friend_id: params[:friend_id])
 if @friendship.save
  flash[:notice] = "Added friend."
  redirect_to root_url
 else
  flash[:error] = "Unable to add friend."
  redirect_to root_url
 end
end

def destroy
 @friendship = current_user.friendships.find(params[:id])
 @friendship.destroy
 flash[:notice] = "Removed friendship."
 redirect_to current_user
end

def friendship_params
 params.require(:friendship).permit(:friend_id, :user_id)
end

Thanks again for all the help. If there are any question or I'm missing a part of my code which may be needed, Please ask.

A: This may not be the issue but give it a try:
<%= link_to "Add Friend", friendships_path(friend_id: user.id), method: :post %>

OR
<%= link_to "Add Friend", { action: :create, controller: 'friendship',:friend_id => user.id }, method:"post" %>

Also to make sure of error please add your params from your console
UPDATE: do it in simplest way
def create
  @friendship = current_user.friendships.build
  @friendship.friend_id = params[:friend_id]
  @friendship.user_id = current_user.id
  if @friendship.save


text:
Q: Selenium doesn't always grab correct dynamically generated link My current environment is Firefox 3.6.28 using Selenium RC (with the Selinium server 2). Eventually things will be migrated to Selenium 2.0 with the WebDriver stuff, but I have some tests I need to get working in Selenium RC at the moment.
I have a dynamically generated table which has an "a href" link inside each row. I want to click on the link on a certain row. However, the problem is sometimes Selenium correctly picks it out (test passes), and sometimes I get an error saying that the element doesn't exist (test fails):
[testng] com.thoughtworks.selenium.SeleniumException: ERROR: Element xpath=(//table[@class='results'])/tbody/tr[position()=5]/td/a not found
There does not seem to be any pattern for detecting/failing to see the element.
To see if the browser actually sees the element when I get the error, I have something like this:

    ...
    try{
        wrapWaitForPageToLoad("10000");
        wrapWaitForPageToLoad("10000");
        clickAndWait(xpath);
    }catch(Exception e) { //loop indefinitely here }

And it turns out that the browser sees the element. I test out the xpath in the Selenium IDE. The xpath is clearly correct since I could execute the click command with that xpath in the Selenium IDE.
In case some elements didn't fully load, I had added in some wrapWaitForPageToLoad() with value 10000. However, this does not seem to have an effect on the problem. And in any case, the elements all seem to be fully loaded as the above tests would suggest... Also increasing the time doesn't help.
The partial html that firebug gives me on the table:
(Note, position()=5 to get listdata4 because the first row is the table's title)

    ...

        Cake Pictures

What could be causing this odd error?

A: You need to modify xpath from
//table[@class='results'])/tbody/tr[position()=5]/td/a

to
//table[@class='results']/tbody/tr[5]/td[2]/a


text:
Q: get() methods in Java enum type I have an enum type (say for arguments sake CarModel), used throughout an application (numerous classes).
public enum CarModel {
    DIABLO,
    P911,
    DB7;
}

I have various methods that use this CarModel enum type in different ways, and each has a switch statement to set some String variable depending on the enum type, before going on to do other stuff.  (e.g. set the Manufacturer of some model, or set the country of origin etc.  These results are static at runtime)
The issue is, if I want to add a new model to the enum, I'd need to go to each method, and extend/modify the switch statement to handle its existence.  This could easily lead to human error, and/or code duplication (if various methods use the same switch statements).
Rather than using switch statements all-over, I would like to have static methods, that could be edited in a single location, and would allow for behaviour similar to the following:
String country = CarModel.DIABLO.getCountry() // returns Italy
String manufacturer = CarModel.P911.getManufacturer() // returns  Porsche

Is this possible with an enum, (and is an enum even the 'correct' way to do this?

A: Yes, absolutely. Enums can have their own methods, and those methods can be value-specific. It looks like this:
enum CarModel {
    P911 {
        public String getManufacturer() { return "Porsche"; }
    },
    DB7 {
        public String getManufacturer() { return "Aston Martin"; }
    },
    ...
    public abstract String getManufacturer();
}

You can add more methods, of course.

A: If you're going to use enums, I would suggest an abstract method declared in the enum, and then a provided implementation for each enum instance.
That way you don't have switch statements everywhere (from which you can easily omit cases) and you have a more reliable and OO-styled polymorphic approach.
abstract public int getEngineSize();

DIABLO {
   public int getEngineSize() {
      return 6.3; // whatever it really is...
   }
}

See here for more examples/discussions etc.

A: You can do something like this.
public enum CarModel {
    DIABLO("Lamborghini", "Italy"),
    P911("Porsche", "Germany");

    private String manufacturer;
    private String country;

    private CarModel(String manufacturer, String country) {
        this.manufacturer = manufacturer;
        this.country = country;
    }

    public String getManufacturer() {
        return manufacturer;
    }

    public String getCountry() {
        return country;
    }
}

A: I would suggest adding this information directly into your enum.
Like this:
public enum CarModel {

    DIABLO("Lambo"),
    P911 ("Porsche");

    private String manufacturer;

    private CarModel(String manufacturer) {
        this.manufacturer = manufacturer;
    }

    public String getManufacturer() {
        return manufacturer;
    }
}

and in the class you'd only have to use the getManufacturer method

A: Moreover enums can implement an interface. You can add some get() methods like getMaxSpeed() or getWeight().
Interface can look like
interface car{
public int getMaxSpeed();
public int getWeight();
}

A: Yes, this is quite easy to do:
public enum CarModel {
    DIABLO("rod"),
    P911("jane"),
    DB7("freddy");

    private String name;
    CarModel(String name){
        this.name = name;
    }

    public String getName() {
        return name;
    }
}

A: Haha, I recommend you to use "Factory" Design Pattern.
you can make a CarFactory(), to produce new model car.
http://en.wikipedia.org/wiki/Factory_method_pattern


text:
Q: jQuery .now() not unique I have a jsfiddle.
obj = {};
obj[0] = 'hej';
obj[1] = 'hopp';

$.each( obj, function( key, value ) {
    console.log($.now());
});

$.now() is the same number in the console.
How can I generate a unique number?

A: You could have a counter which increments for each object. You could then add this counter to $.now() to make sure it's unique:
obj = {};
obj[0] = 'hej';
obj[1] = 'hopp';
counter=1;

$.each( obj, function( key, value ) {
    console.log($.now() + counter);
    counter+=1;
});

A: jQuery.now() isn't supposed to give you a unique number, just a " a number representing the current time" (http://api.jquery.com/jQuery.now/). More specifically "the number of milliseconds since 1 January 1970 00:00:00 UTC" (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime).
The simplest way to generate a unique identifier depends on the scope the identifier has to be unique in.
1: If the identifier just has to be unique within the scope of the function, a counter as suggested by SteveP would probably do the job best.
2: If the identifier needs to be unique within the scope of your application - and you do not have the possibility to keep track of the assigned identifiers (as in 1) - your job is more difficult.
In real-live applications such a scenario could be tackled by combining the timestamp with a random number, along the lines of
var identifier = $.now() + "_" + Math.round(Math.random() * 1e10)

This approach doesn't guarantee for true uniqueness of identifier though since Math.round(Math.random() * 1e10) could return the same value twice in one millisecond. Depending on how often you generate a string like this, it will be still pretty unlikely you end up with the same string twice.
3: If you however aim for "uniqueness across space and time", you could get inspiration from http://www.ietf.org/rfc/rfc4122.txt
It should be noted that pure Javascript implementations like Create GUID / UUID in JavaScript? only work with random numbers as well and will thus not generate truly unique identifiers. For a truly unique identifier across space and time a truly unique element such as a mac-address has to be used as part of the identifier.

A: Quote from jquery api:

The $.now() method is a shorthand for the number returned by the
  expression (new  Date).getTime().

So you basically use new Date().getTime(). However getTime() isn't accurate... Interresting quote from this article:

Effectively these browsers are only updating their internal getTime
  representations every 15 milliseconds. This means that if you attempt
  to query for an updated time it'll always be rounded down to the last
  time the timer was updated (which, on average, will have been about
  7.5 milliseconds ago).

In short: getTime() isn't that accurate (in some browsers).
When you need a random number (as you do), use:
var randomVal = Math.random(); // e.g. 0.6137274974025786
var randomValI = Math.round(Math.random()*100000000000000000)  // e.g. 6137274974025786

When you need a more formal 'guid', use something like this:
function createGUID() {
    function S4() {
        return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
    }

    // then to call it, plus stitch in '4' in the third group
    return (S4() + S4() + "-" + S4() + "-4" + S4().substr(0,3) + "-" + S4() + "-" + S4() + S4() + S4()).toLowerCase();
}
var guid = createGUID();

A: Of course $.now just display the current timestamp. to have a random number use Math.random()


text:
Q: Disable USB monitor when windows start I need a method to disable USB monitor (secondary monitor) from displaying especially during the part when it hit login page.
I have already implemented codes to off the display using something like changeDisplaySettingEX which is already working fine.
It works in the way that when my application starts, then only the USB monitor will be on, when the application close, the USB monitor off too. (Under the monitors driver program it is shown as off if I switch it off)
So my problem is I happen to notice that when I shutdown my computer, this display auto power on again. Hence I'm guessing that when I start up my computer tomorrow, chances is this USB monitor will power on too, thereby showning the login page, which I do not want.
Anyone have any idea to counter this?
Was thinking of window service, but not sure will the service get activated 1st or the monitor get powered on first.

A: Well, solved as I notice that the USB monitor have a service running.
So I only need to set the service start up to manual.
Start the service when program launch, shutdown service when program ends


text:
Q: maximum ratio of a min subset and a max subset of size k in a collection of n value pairs So, say you have a collection of value pairs on the form {x, y}, say {1, 2}, {1, 3} & {2, 5}.
Then you have to find a subset of k pairs (in this case, say k = 2), such that the ratio of the sum of all x in the subset divided by all the y in the subset is as high as possible.
Could you point me in the direction for relevant theory or algorithms?
It's kind of like maximum subset sum, but since the pairs are "bound" to each other it introduces a restriction that changes it from problems known to me.

A: Initially I thought that a simple greedy approach could work here, but commentators pointed out some counter examples.
Instead I think a bisection approach should work.
Suppose we want to know whether it is possible to achieve a ratio of g.
We need to add a selection of k vectors to end up above a line of gradient g.
If we project each vector perpendicular to this line to get values p1,p2,p3, then the final vector will be above the line if and only if the sum of the p values is positive.
Now, with the projected values it does seem right that the optimal solution is to choose the largest k.
We can then use bisection to find the highest ratio that is achievable.
Mathematical justification
Suppose we want to have the ratio above g, i.e.
(x1+x2+x3)/(y1+y2+y3) >= g

=> (x1+x2+x3) >= g(y1+y2+y3)

=> (x1-g.y1) + (x2-g.y2) + (x3-g.y3) >= 0

=> p1 + p2 + p3 >= 0

where pi is defined to be xi-g.yi.


text:
Q: unity shader concatenation texture I'm trying to concatenate/add a texture into a bigger one but I fail to keep the result of the bigger texture.
I have a shader that takes some variables like a position for the smaller texture within the bigger one, the smaller texture itself and of course the bigger one.
Basically, my shader works correctly ( I think ), in the result I see the smaller texture in the bigger one at the right position. However my bigger texture is never saved, so all the precedent pass is ignored.
How can I save the result to send it again into the shader to concatenate all the small textures into it?
I try this : Graphics.Blit(_RTConcat, _RTConcat, _concat);
RTConcat is my bigger texture, it's a RenderTexture, I've tried to create it both in editor or in script but the result is the same and _concat is the material using the shader.
PS : I'm using unity 4.5.3 and can't upgrade, it's a pro version.
Edit / Update :
I "success" to made something that look like what I want, but I don't understand why it work.
In my main script I init a resulting renderTexture and set it to a mat which apply it on a plane
_radarVision = new RenderTexture(_radarTextureWidth, _renderHeight, 24);
 _renderHeight, 24);
 _radarScreen.SetTexture("_MainTex", _radarVision);
_radarVisionand _radarScreen are never edit again in my scripts.
The Graphics.Blit is now in a new script attach on a camera create only to run a single script :
`void OnRenderImage(RenderTexture source, RenderTexture destination)
 {
Graphics.Blit(save, save, _concat);

rttmp = RenderTexture.GetTemporary(camera.targetTexture.width,  camera.targetTexture.height);

save = rttmp;

camera.targetTexture = save;
RenderTexture.ReleaseTemporary(rttmp);

}`

There is nothing else and it made my stuff working but I'm still bemused because it shouldn't be working... no?

A: And the best solution I've found is :
Graphics.Blit(save, save1, _concat);
 Graphics.Blit(save1, save, _concat);
I don't understand why a single Graphics.Blit don't work but a double work "perfectly", it only bother me because it require to call twice a same shader (who work with really big texture like 16384*4092) but whereas my last solution, I can apply a last shader to my texture without ruin everything.
The use of GetTemporary cause a problem when apply a second shader to texture `save, I'm guessing a story with buffer.
I'm always open to suggestions for a better way, but for now my solution solve totally my problem eventhough it gave me a cancer

A: Using RenderTexture, Blit and Material combo is not the best solution. Too much overhead here. You must call Blit twice because you can not read and render to the same render texture at once I guess. I believe the direct and best solution is:
subTex = ... ;// Initialize the sub tex
subTex.Apply();  // Upload elementTex to the Gpu
Graphics.CopyTexture(subTex, offset, size, globalTex, offset, size); // the subTex will be copied to globalTex in both GPU, and CPU. This is a GPU->GPU and a CPU ->CPU copy so it's very quick without any additional drawcall at all.


text:
Q: Set Android ListView row height to biggest row I have a ListView displaying some text on my android activity. The problem I am facing is that some text is bigger than the other so the ListView rows don't have the same size.
I would like to have all the rows the size of the biggest. That way all the text will be display and they will all have the same size.
Here is my xml :
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="horizontal" android:layout_width="fill_parent"
        android:layout_height="fill_parent">

        <CheckBox
            android:id="@+id/favorite_checkbox"
            android:layout_width="0dp"
            android:layout_height="fill_parent"
            style="?android:attr/starStyle"
            android:layout_weight="1"
            />
    <TextView
        android:id="@+id/IdText"
        android:layout_width="0dp"
        android:layout_height="fill_parent"
        android:layout_weight="2"
        />

    <TextView
        android:id="@+id/StationNameText"
        android:layout_width="0dp"
        android:layout_height="fill_parent"
        android:layout_weight="2"
        />

    </LinearLayout>

</LinearLayout>

Thanks for your time.

A: You can get the height of the 'tallest' view programmatically - How to get an Android widget's size after layout is calculated?, and then set that height to your other layouts.
I would do something like this:
    DisplayMetrics displaymetrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
    int height = displaymetrics.heightPixels;
    int width = displaymetrics.widthPixels;

int HeightOfTallestView = //method you choose from link above

IdText.setLayoutParams(new LinearLayout.LayoutParams(width, HeightOfTallestView ));

Please let me know if this works for you.


text:
Q: programming logic problem I need a function that can give me all possible combinations of a array back.
Example:
$source = array('a', 'b', 'c');
$target = thisiswhatisearch($source);

Now the $target should look like:
array('a','b','c','ab','ac','cb','abc')

I dont need the aa, bb, cc.
I also dont need the the ba, ca, acb.. because the order isn't important to me.
Thanks for any help.

A: The Wikipedia entry for Combination has a link to C code that does this.

A: Tried to be language agnostic but i guess its C like:
function combinations(array arr)
{
  combos = array();
  for (int i=1; i<2**arr.size(); i++)
  {
    int x = i;
    int c = 0;
    str = "";
    while(x>0)
      {
        int rem = x % 2;
        if(rem == 1)
          str += arr[c];
        x = x / 2;
        c++;
      }
    combos.add(str);

   }
return combos;
}

A: That's an out of the mind solution. It is probably not the fastest and cleanest one, but it kind of works. It's in Java, because I had it open:
public class Combination {

public static void main(String[] args) {
    String[] source = {"a","b","c"};
    List<String> result = combineMe(new ArrayList<String>(Arrays.asList(source)));
    for (String string : result) {
        System.out.println(string);
    }
}

public static List<String> combineMe(List<String> source) {
    List<String> result = new ArrayList<String>();
    if (source.size()==0) {
        result.add("");
        return result;
    }else{
        String tmp = source.remove(0);
        source = combineMe(source);
        for (String string : source) {
            result.add(("" + string).trim());
            result.add(tmp + string);
        }
    }
    return result;
}
}

The first entry in the resulting list is a fake one, and needs to be removed at the end


text:
Q: Creating a GPRS Connection using Windows Mobile 6.5 I am writing an application in which I need to make a GPRS connection.
Can someone please help me how I can setup this connection using C#.
thanks
EDIT
I will need to connect a GPRS connection because I need to call a webservice.

A: To make a GPRS connect using a dial up connection subsystem from .NET CF on PocketPC, you can use Connection Manager functions such as ConnMgrEnumDestinations, ConnMgrEstablishConnection and ConnMgrReleaseConnection. Check out http://msdn.microsoft.com/library/default.asp?url=/library/en-us/APISP/html/sp_cnmn_connection_manager.asp for details. There are no classes available for this in .NET CF, but it can be done quite easily using P/Invoke if you have some experience with this.
The following blog post covers this in detail and also contains some C# code: http://blogs.msdn.com/anthonywong/archive/2006/03/13/550686.aspx.
Another solution is using the Smart Device Framework by OpenNETCF.org that contains a wrapper class for the Connection Manager:
http://www.opennetcf.org/downloads/bin/SmartDeviceFramework14.zip
It is free for any commercial or noncommercial purpose up to the version 1.4. It also includes the source code, so you might either use it as is or as a reference for your own implementation if you prefer.
(solution taken from our website at http://forum.rebex.net/questions/503/how-to-establish-a-gprs-connection-for-ftp-use-on-net-cf)

A: This page might help...
http://msdn.microsoft.com/en-us/library/bb840031.aspx

A: Is it really important to explicitly create that connection? If you initiate any outgoing (eg. not localhost) connection (like a HttpWebRequest), the OS will automatically connect to the Internet using the preferred connection, which can be GPRS.


text:
Q: What is the best and safest way to store user email addresses in the database? From security reasons, is it worth encrypting user emails before putting them into the database?
I know we hash and salt passwords but that's another story as we do not really need password originals. With emails it is different.
Knowing that the decryption key will anyway be somewhere close to the database, does it make sense to encrypt emails? I suppose if someone gets into the system, they will find the key as well, if not immediately then eventually.
What are the best-practices? Are there any other options available if I run my own servers and not on a shared/virtual hosting?
EDIT: I intend to use SQL Server. And no, it is no corporate software with security requirements, just some entertainment site I have in mind.

A:
One of the most often-cited truisms in computer security is that the
  only truly secure computer is one buried in concrete, with the power
  turned off and the network cable cut.

With that in mind the best way to securely store email addresses? Dont store them at all!
tl;dr Do you need their email address, or a way of sending them emails? Either trust someone who will do a better job than you or don't use the email address at all.
Why do you need to keep a record of a customer's email address? The only reasons I have run into are:

*

*Account confirmation & authentication

*Transaction & Marketing emails

Confirmation & Authentication
The core of what we want is two step authentication: Something they know and something they  have. Something they know is a password, and is easy to prove since they will be the only one who knows it. Something they have is harder to prove and traditionally we use an email address since it is easy to verify. These days though there are other things we can use:

*

*Mobile phone

*An account with a trusted website (Facebook, Google, Twitter)

Mobile phone verification is simple. Send them a sms using a service like twilio.com and ask them to text back a confirmation code. We now know that the mobile belongs to the customer who wanted to register. With OpenID you can verify existing accounts with other trusted sites, and the confirmation process is handled by them.
For the customer to authenticate then all they provide is either their mobile number and password, or an OpenID authentication token. Neither require a email address (well the OpenID provider might but thats not your responsibility).
If these are not an option then you can still confirm an email address and then use it for authentication. Confirmation only requires a unique token to be stored and a link to be sent to the email address. Store a salted hash of the email address, and use that to match the account in the same way we do passwords.
Transaction & Marketing Emails
The real reason why we want to store the email address! So we can send them offers of stuff we think they need so they can delete it without reading it. Seriously though is email the best medium for this? If we have an OpenID account then why not use that for notifications? Send a Facebook message or write on their wall, @mention them on Twitter, send a text message to their mobile, build an app and push notifications at them. There are so many channels much more effective than email.
If you want to use email then use a email platform like Mandrill and MailChimp. When they register create a subscriber in a mailing list on MailChimp. Store the subscriber id with the account. For transaction emails ( reset password, account updates ) fetch the subscriber and pass the stored email to Mandrill to send the email. For mass marketing just send to the mailing list in MailChimp.
The only thing stored in the database is the subscriber id. It also gives all the benefits of using a email platform, unsubscribes, open and click through rates, e-commerce tracking etc. Email platforms will do a better job of delivering emails that you. They will also do a better job at protecting the privacy of their data than you. Let them do the hard work of database security so you can focus on getting more customers.

A: If you're going to need the email address in the future, then you'll have to store them in plain text.
You could encrypt them, of course, however, this is effectively security through obscurity in this case.  Basically, if your application's perimeter is secure, your data within it can be plain text.  Encrypting here adds complexity to you working with the data, but doesn't really stop an attacker from getting your raw data.
As you say, if he gets through your perimeter defenses, he's likely to easily get your decryption key to decrypt the email data.  Encryption may slow down the determined attacker slightly, but will not add any real security to your data.
The best scenario is to hash the email address (with salt!) and store that.  This allows you to check the email address against an input value (for example) and verify that the email address input is the same as what you have stored, of course, the major downside for this is that you can't know what the email address is without that additional value, so if you're wanting to (for example) regularly email your users, you'll be out of luck.
I suspect you're storing the email address because it's useful data, and you will want to do something with it (like send an email :) in which case, encrypting just adds overhead to working with that data, whilst gaining very little in return.
In this case, I would focus on securing access the database itself (i.e. your "perimeter" defenses) and ensure they are as strong as can be, whilst leaving the data in the database in plain text.

A: I think that when people can come in your database you are anyway screwed :)
It doesn't make a lot of sense to just encrypt your email addresses. Beside that there will be a lot of other information in your database that you would not like to be gathered, the decryption key will be indeed within reach at the same time your database is open.
I would like to suggest to find your layer of security and data integrity on a higher level. So the prevention of people entering your database.
And why would email addresses be so important? Most people will anyway get spam or their email addresses will otherwise be available somewhere on the web.

A: Hopefully this answer will answer your question as well.
Is it worth encrypting email addresses in the database?
In short, no, it is not worth encrypting user email addresses.  You're right in thinking that a database compromise will likely result in somebody also gaining access to the keys required to break your encryption.

A: In general I agree with others saying it's not worth the effort. However, I disagree that anyone who can access your database can probably also get your keys. That's certainly not true for SQL Injection, and may not be true for backup copies that are somehow lost or forgotten about. And I feel an email address is a personal detail, so I wouldn't care about spam but about the personal consequences when the addresses are revealed.
Of course, when you're afraid of SQL Injection then you should make sure such injection is prohibited. And backup copies should be encrypted themselves.
Still, for some online communities the members might definitely not want others to know that they are a member (like related to mental healthcare, financial help, medical and sexual advice, adult entertainment, politics, ...). In those cases, storing as few personal details as possible and encrypting those that are required (note that database-level encryption does not prevent the details from showing using SQL Injection), might not be such a bad idea. Again: treat an email address as such personal detail.
For your entertainment site this is probably not the case, and you should focus on prohibiting SELECT * FROM through SQL Injection, and making sure visitors cannot somehow get to someone else's personal profile or order information by changing the URL.

A: Depends on how often you access the addresses. If you read them once in a while, it might make sense, but this would be one of the last security issues I would spend time on.

A: I do not encrypt user e-mails. The point is to protect the database; the keys are accessible anyway if you actually want to use the e-mails once they are stored.
Do check the address for validity and possible SQL injection, though.

A: If the application server and database are on separate servers, it would generally increase security to have all or parts of the database encrypted.
Even if they are on the same machine, a hacker may not figure out where your password is stored (although I wouldn't rely on that).
I generally wouldn't encrypt the emails at the application level, instead relying on database-wide encryption offered by most enterprise databases.
Of course if you're using something like MySQL, then you have no choice but to do it at the application level.
I normally tell my clients it isn't worth the trouble encrypting a database, however if you have stricter privacy requirements it may make sense to do so.

A: Encrypting database content is always a tricky consideration. Clearly the content is useless unless it can be unencrypted, and if that has to happen without human intervention, then you're storing both the cyphertext AND the key somewhere. If that somewhere is on the same machine, then one might wonder why you even bothered.
Well, there's a few reasons why you might want to do this. One is because you're required to do so because of some company policy. Another is that perhaps your database is housed in a more hostile environment than that machine that accesses it.
In general, encrypting database content isn't going to win you any awards, but if you can justify it, then you clearly have at least some motivation to do so.

A: yeah could be helpful for the user if you hash it with salt. I had a code before which i used that I use salt and hash then I can decrypt it. Flow is that once user will register you then hash and salt (encryption process) it. Then if you need to fetch the encrypted data there will be decryption.


text:
Q: How to wrap text of a javafx chart legend Can anyone please help me with wrapping the text in a legend of a javafx chart. I have pie charts and bar charts. All the legends are placed at bottom.  I tried the following but couldn't get it working.
    for (Node node : pie.lookupAll(".chart-legend")) {
                if (node instanceof Text) {
                    System.out.println("Text instance");
                    ((Text) node).setWrappingWidth(380);
                    ((Text) node).setManaged(true);
                }
                if (node instanceof Label) {
                    System.out.println("Label instance");
                    ((Label) node).setWrapText(true);
                    ((Label) node).setManaged(true);
                    ((Label) node).setPrefWidth(380);
                }
  }

EDIT:
See the highlighted part. Still some text is not visible.

A: I finally got it. Trying to wrap text in css didn't work as label width cannot be controlled there. So the following code can be used to wrap the text programmatically.
for (Node node : pie.lookupAll(".chart-legend-item")) {
                if (node instanceof Label) {
                    System.out.println("Label instance");
                    ((Label) node).setWrapText(true);
                    ((Label) node).setManaged(true);
                    ((Label) node).setPrefWidth(380);
                }
  }

A: Did you have a look at the CSS documentation?
This link is refering to the chart legend section:
JavaFX CSS Reference
As mentioned, it's of the type Label, so we can have a look here as well.
-fx-wrap-text possibly does the trick. Of course you would need to write and attach your own CSS file to your program...
For a more detailed example, please refer to your JDKs jfxrt.jar, unzip it and look for the modena.css, which is the default CSS file.
Regards.
Daniel
Edit: I got the following snipped to actually have an impact on or  application after all:
.chart-legend {
   -fx-background-color:  transparent;
   -fx-padding: 20px;
}

.chart-legend-item-symbol {
   -fx-background-radius: 0;
}

.chart-legend-item {
    -fx-text-fill: #191970;
}

But it is important, where you place it in your CSS. In my first attempt, I placed it above the CSS rule, which set the default label text color.
When I noticed this, I put it at the end of my CSS file: et vóila - it worked.
So please have a second look, that your placed accordingly in your own CSS.


text:
Q: How to prove that after scaling by a factor bigger than 1, the new set contains the original set up to translation? This is a very simple question.
Suppose $E$ is a bounded set in $\mathbb{R}^n$. Let $\lambda>1$, and define $$E_{\lambda}:=\lambda E=\{\lambda  x: x\in E \}.$$
We call $E \mapsto \lambda E$ the homothetic transformation by scaling factor $\lambda$.
Clearly from the standard picture, for example https://en.wikipedia.org/wiki/Homothetic_transformation, we can observe after a homothetic transformation by $\lambda>1$, the new set is just an enlargement of the original one. Although the new set doesn't necessarily contain the original set, after a translation we can really expect so. More precisely, the following claim should be true
Claim: Fix a bounded set $E \subset \mathbb{R}^n$, for any $\lambda>1$, there must exist a vector $ \overrightarrow{b} \in \mathbb{R}^n$ such that $E \subset \subset \lambda E+\overrightarrow{b}$.
I've no idea how to "mathematically" prove this claim. I strongly believe this is true. Can anyone write a rigorous proof? Thanks in advance!
As @coffeemath pointed out, the claim fails to be true if $E$ is a disconnected set. Let's suppose if $E$ is connected, is this claim true?

A: What if $E$ is two points at distance $1$ and $\lambda$ is quite large, so that $\lambda(E)$ is two other points which are very far apart? It would seem $E$ couldn't be contained in any translate of $\lambda E$ since such translates consist of two points at large distance from each other.


text:
Q: GetType of Values in DataTable I've been working on a project which has a Function of reading Data from a DataTable and returning it as a list. I made specific statements over some rows to get the data I want.
Little problem is, my entity "Number" is declared As an Integer and in the DataTable I do have some String values which leads the function to crash. Do any of you guys has an Idea about how I can check which Data Type the row "Number" has and if it's not an Integer to just leave it out?
My function looks like this:
 Public Function LiefereAlleRechte(ByVal dt As DataTable) As ICollection(Of Recht) Implements IBenutzerInfoServiceUtil.LiefereAlleRechte
    If dt Is Nothing Then
        Throw New ArgumentNullException("DataTable can't be empty", "dt")
    End If

    Dim query = From dr As DataRow In dt.DefaultView.ToTable(True, "Name", "Number")

    Dim coll As ICollection(Of Recht) = New List(Of Recht)
    For Each row In query
        Dim recht As Recht = New Recht()

            With recht
            .Name = row.Item("Name")
            .Nummer = row.Item("Number")
                coll.Add(recht)
        End With

    Next

    Return coll
End Function

Thanks for any help!


text:
Q: Open, closed, bounded, unbounded and sequentially compact. Is the set $A$ open, closed or neither, bounded or unbounded, sequentially compact or not sequentially compact.
$A=\{(x,y) \in\mathbb{R}^2 : 1 < xy < 2\}$.
Can someone please explain why.

A: It is an open set because it is the inverse image of an open set by a continuous map. Precisely let us consider $\phi:\mathbb{R}^2\rightarrow \mathbb{R}$ such that $\phi(x,y)=xy$. It is continuous and $\phi^{-1}((1,2))=A$
It is not closed because $\mathbb{R}^2$ is connected and $A$ is a proper subset.
It is therefore not compact nor sequentially compact
It is not bounded because $\forall n, (3n,\frac{1}{2n})\in A$ and when $n \rightarrow \infty$ the distance between this point and say $(3/2,1)$ goes to infinity.


text:
Q: Simple wordpress is_single get the category id We want to be able to display scrollers on post pages.
The code below was indented for category pages; it removes scroller base taxonomy and replaces it with category taxonomy.
We tried replacing the is_category with is_single, and it doesn't work for post pages.
function metaslider_restrict_to_current_category( $args, $slide, $slider_settings, $slide_settings ) {

    // check slide ID so we only apply this functionality where it's needed

    // replace "123" with the slide ID to target.

    if ( $slide->ID == 123 && is_category() ) {

        // remove any existing restrictions
        if ( isset ( $args['tax_query'] ) ) {
            unset( $args['tax_query'] );
        }

        // restrict to posts tagged to the current category
            $args['tax_query'][] = array(
                'taxonomy' => 'category',
                'field' => 'id',
                'terms' => get_query_var( 'cat' )
            );

    }

    return $args;
}
add_filter( 'metaslider_post_feed_args', 'metaslider_restrict_to_current_category', 10, 4);


text:
Q: PosgtreSQL Optimize Query with st_transform, st_makepoint, and st_contains I have the following query:
UPDATE  DestinTable
SET  destin = geomVal
FROM GeomTable
WHERE st_contains(st_transform(geom, 4326), st_setsrid(
      st_makepoint(d_lon::double precision, d_lat::double precision), 4326));

This query works, but it is very slow. I have to run an update on a very large table, and it is taking a 8+ hours to complete (I run this on 5 different columns). I wanted to know if there was a way to optimize this query to make it run faster. I am unaware of the behind the scenes work associated with an st_contains() method, so there may be some obvious solutions that I am missing.

A: The easiest way is to create an index on ST_TRANSFORM
CREATE INDEX idx_geom_4326_geomtable
  ON GeomTable
  USING gist
  (ST_Transform(geom, 26986))
  WHERE geom IS NOT NULL;

If you have all the fields in one SRID in the table it will be even easier to create a normal GIST index on that table and transform the point you're supplying to the local SRID


text:
Q: I need to auto-count UNIQUE values within a range of formula output which may or may not be blank I need a formula which will automate the following logic:
Columns J16:z200 holds values to populate based on an IF Statement.  All of them have formulas, some of them have output of a zipcode, and some of them are blank.
The intended goal is to capture the number of unique zip codes within a county that is providing sales leads for a sales team...typical counting formulae don't filter for duplicates so I ended up with:
=SUMPRODUCT(((J16:J199<>"")/COUNTIF(J16:J199, J16:J199 &"")))
...which seemed to work until I went to validate the data, which is where it gets weird.  In the image (it's a really large spreadsheet so I'm just giving you a snapshot of the relevant fields)
1-the gray line is the tally of the number of leads in a county
2-the pink line is the tally (supposedly) of unique zipcodes within that county
Line2 should always be equal or less than line 1... no exceptions...but, if you look down at the county count outputs, you can see that the tally output is not accurate.  And worse than that, it's right in some places, and wrong in others/off by 1, which makes ZERO sense.
page snippet
Each of the white fields has a formula similar to this =IF(AND($B$16="County",J3="County"),$E$16,"")
Each column with a different county name plugged into where it says "County"
I'm thoroughly confused.
Snippet 2 - using frequency

A: Presume in the white cells you will either have a numerical value (zip code) or blank returned by a formula,
Try
=SUMPRODUCT(IF(FREQUENCY(I3:I12,I3:I12)>0,1))

A useful link for you: Count unique values among duplicates


text:
Q: How to animate on entrance SVG images gradually with reactjs? I'm quite new to React,
I have imported an SVG and would like to animate few clones of it, eventually they will end up in the same row, should i be using use flexbox?
I have done it statically using flexbox, but i would like to animate each svg component so they will appear on the screen gradually (one after the other). Any suggestions how to accomplish it?
Thank you all

A: you can use GSAP (GreenSock) library to achieve that, just trigger the animation after componentDidLoad() in your React component.
You can learn about GSAP staggering here:
https://greensock.com/stagger
Hope it helps!

A: you can use CSSTransitionGroup for react
here are doct from react to do it
 https://reactjs.org/docs/animation.html#high-level-api-reactcsstransitiongroup
https://reactcommunity.org/react-transition-group/
this animations works on enter and leave from dom of element
<CSSTransitionGroup
transitionName="example"
transitionEnterTimeout={300}
transitionLeaveTimeout={300}
 />
<CSSTransitionGroup>


text:
Q: Make a program automatically take higher priority? I'm using my Ubuntu OS to play Minecraft. I can get the game to run a little faster by closing my other programs and giving the Minecraft java process a higher priority via the System Monitor. The process is simply named "java" in the list.

How can I make Minecraft automatically take a higher priority when it starts?

A: TL;DR You need nice for this:
sudo nice -n -20 <your_command>

Start minecraft with this command:
sudo nice -n -20 su -c java -jar minecraft.jar $USER

If you have a desktop file for minecraft then change the property Exec and install the package gksu, we need gksudo:
sudo apt-get install gksu

Example (Replace <your_username> with your username, the output of echo $USER. $USER doesn't works in a desktop file):
[Desktop Entry]
Type=Application
Name=Minecraft
GenericName=Game
Comment=Break and place blocks to build imaginative things
Exec=gksudo "nice -n -20 su -c 'java -jar /usr/share/minecraft/minecraft.jar' <your_username>"
Icon=minecraft
Categories=Game
StartupNotify=true
StartupWMClass=net-minecraft-bootstrap-Bootstrap

The Linux niceness scale goes from -20 to 19. The lower the number the
  more priority that task gets. If the niceness value is high number
  like 19 the task will be set to the lowest priority and the CPU will
  process it whenever it gets a chance. The default nice value is zero.

Source
from man nice:
-n, --adjustment=N
              add integer N to the niceness (default 10)


text:
Q: How to run HDFS Copy commands using Airflow? May I know how to execute HDFS copy commands on DataProc cluster using airflow.
After the cluster is created using airflow, I have to copy few jar files from Google storage to the HDFS master node folder.

A: You can execute hdfs commands on dataproc cluster using something like this
gcloud dataproc jobs submit hdfs 'ls /hdfs/path/' --cluster=my-cluster --
region=europe-west1

The easiest way is [1] via
gcloud dataproc jobs submit pig --execute 'fs -ls /'

or otherwise [2] as a catch-all for other shell commands.
For a single small file
You can copy a single file from Google Cloud Storage (GCS) to HDFS using the hdfs copy command. Note that you need to run this from a node within the cluster:
hdfs dfs -cp gs://<bucket>/<object> <hdfs path>

This works because
hdfs://<master node>

is the default filesystem. You can explicitly specify the scheme and NameNode if desired:
hdfs dfs -cp gs://<bucket>/<object> hdfs://<master node>/<hdfs path>

For a large file or large directory of files
When you use hdfs dfs, data is piped through your local machine. If you have a large dataset to copy, you will likely want to do this in parallel on the cluster using DistCp:
hadoop distcp  gs://<bucket>/<directory> <HDFS target directory>

Consider [3] for details.
[1] https://pig.apache.org/docs/latest/cmds.html#fs
[2] https://pig.apache.org/docs/latest/cmds.html#sh
[3] https://hadoop.apache.org/docs/current/hadoop-distcp/DistCp.html

A: I am not sure about your use case to do this via airflow because if its onetime setup then i think we can run commands directly on dataproc cluster. But found some links which might be of some help. As i understand we can use BashOperator and can run commands.
https://big-data-demystified.ninja/2019/11/04/how-to-ssh-to-a-remote-gcp-machine-and-run-a-command-via-airflow/
Airflow Dataproc operator to run shell scripts


text:
Q: How to do as guide "Re-run Spring Boot Configuration Annotation Processor to update generated metadata"? For example, I have file DataSourceConfig.java
package com.apress.demo;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "jdbc")
public class DataSourceConfig {
    private String driver;
    private String url;
    private String username;
    private String password;

    @Override
    public String toString() {
        return "DataSourceConfig [driver=" + driver + ", url=" + url + ", username=" + username + "]";
    }

    public String getDriver() {
        return driver;
    }

    public void setDriver(String driver) {
        this.driver = driver;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

}

How to do this notice?

A: It is just a reminder that configuration properties will not be available until you Make changes and annotation processor is re-run
You can enable annotation processors in IntelliJ via the following:

*

*Click on File

*Click on Settings

*In the little search box in the upper-left hand corner, search for "Annotation Processors"

*Check "Enable annotation processing"

*Click OK

or
add dependency in pom.xml
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-configuration-processor</artifactId>
    <optional>true</optional>
</dependency>

Configuring the Annotation Processor
and add anatation @Configuration


text:
Q: Stop chrome from refreshing not responding page I am currently trying to debug an SAP Fiori Application.
I am launching it via SAP-WEB-IDE and I 've set some external breakpoints in my ABAP BackendSystem.
Now for better debugging I've set the ClientReadTimeout to a max. of 300000ms for my Backend-Destination in the Cloud Platform Cockpit.
Now when I hit my breakpoint, I can debug just fine, until Chrome tells me "This site is not responding".
I hit "Wait", but after some amount of time my debugger is suspended and the breakpoint gets hit again.
I guess Chrome did a refresh by itself....
How can I prevent that ?

A: I do not think chrome refreshed it.
In ABAP there is a timeout set for the debugger (work process in particular), which is stopping your debugger from continuing beyond a set time. You can set this with system parameter rdisp/max_wprun_time.
You may also look into parameter rdisp/max_debug_lazy_time


text:
Q: Finding Maximum and Minimum values and Justifying if they exist Find the maximum and minimum of each of the following subsets of R, if they exist justify the answer.
1) A = (0,3]
2) B = {x is a member of Z (integers): x < 1/2}
3) C = Q (Rationals) intersecting [-1, pi]
1) for the first question i would say that 3 is the maximum for the set since it is part of the set and therefore it is the supremum value and the notation says that the set is closed at this point, while at 0 this is left open and therefore a minimum does not exist.
2) For the second set since x is a member of integers and x < 1/2 the first element which satisfies this condition from the set of integers is 0 and hence 0 is a maximum value for the set based on the condition and the maximum exists, the minimum however doesnt exist and undefined as the minimum can take on any value be it -2,-3,-4..... etc.
3) the last question -1/1 can be expressed as a rational and hence since its a closed set -1 is a minimum value but in the case of a maximum value there exists an infinite amount of numbers that be as close to pi but the value itself and hence the maximum is not defined or rather undefined.
I was wondering based on my thinking if i have analysed the these problems correctly and i am hoping someone can just agree or deny my answers.


text:
Q: Purpose of Android Account Manager? What is the purpose of the android.accounts.AccountManager class?
The class docs say it

provides access to a centralized registry of the user's online accounts.

And why is that useful?  The docs again say

The user enters credentials (username and password) once per account, granting applications access to online resources with "one-click" approval.

*

*So it's only about user convenience?  It saves you from always having to type in an id & password.

*But the cost is that the ids and passwds for all your accounts are stored on the device, and thus vulnerable to being stolen.

*And each server for which you have an id/passwd, has to participate too, correct?  So this is not used like the "field completion" of a browser form.  This requires the server,  on successful login, to give you a token which can be used (for a limited period) to reconnect to the server.
Could anyone comment on points 1, 2, and 3, and tell me if I am missing anything of significance?

A: 1) So it's only about user convenience? It saves you from always having to type in an id &       password.
answer- ya as far as i m concerned about the account manager , o would say yes it is only for
user convenience.
2)But the cost is that the ids and passwds for all your accounts are stored on the device, and thus vulnerable to being stolen.
answer- ya u r right thts why we should avoid using account manager as possible.see this link below
http://security-n-tech.blogspot.com/2011/01/security-issue-exposed-by-android.html
question number 3) i have not much ideal about that


text:
Q: If I create an application on Facebook does it also need a front end on my home website? If I create an application on Facebook that populates the canvas / iframe on Facebook, do I have to have anything on the home domain that also works?  For example, if I have myapp.com do I need an interface on that page that operates independent of facebook for any reason or can I just use my home domain to serve the php files for the iframe in facebook?  Also, is there any reason I can't have a separate set of webpages not in facebook that introduce the app, about, contact us, etc.?
Thanks.

A: Your app will run from your webserver but doesn't have any requirements for showing anything directly from your website.  In other words you could create a directory on your webserver and isolate your app.
I'm not aware of any limitations discussing your app in your website but a quick glance over the FB terms of service might highlight anything specific you're trying to do.