sharepoint online – Javascript REST results processing

I’m using JavaScript to pull data from a SharePoint 2013 list. The REST request works fine and I can see the data in the debug windows of Chrome. I am struggling to determine how to access specific pieces of the data.

When I open the Chrome tools I can see the object and it looks like this {d:{…}}. I can expand it and look at the data.

What I have not been able to do is access specific elements say for example the Title column information for element 0. I’ve tried data.results(0).Title and other ways but nothing.

I can write the code to grab what I need just need to understand how to access the data in the code first.

Thanks for the help.

The REST call I’m using is as follows:

    var srcListName="MyList";
    var oDataUrl="https://somesharepoint.com/_api/web/lista/getbytitle('"+srcListName+"')/items?$;
            $.ajax({
        url:oDataUrl,
        type:"GET",
        dataType: "json",
        headers:{"accept":"application/json;odata=verbose"},
        success:mySuccHandler,
        error: myErrHandleer});

function mySuccHandler(data){
console.log(data);
}
function myErrorHandler(data,errMessage){

}

7 – Remove duplicated results – Apache Solr

English is not my native language so please be patient.

Good afternoon, my Drupal 7 site is currently holding several articles, help topics, and document guides that are versioned, i.e search the “chocolate” word :

Product Cake:

  • title: Old aunt’s Chocolate Cake. Version: 1.0
  • title: Old aunt’s Chocolate Cake. Version: 1.2
  • title: Colombian Cake, Coffee, and Chocolate. Version: 1.0

Product Candy:

  • title: Chocolate candy for fitness. version: 1.0
  • title: Gretel’s Chocolate recipe. version: 2.2
  • title: Gretel’s Chocolate recipe. version: 3.0
  • title: Gretel’s Chocolate recipe. version: 1.0

Product Beverage:

  • title: Milk & Chocolate. version: 1.0
  • title: Milkshake for the boys in the yard: Vanilla, Chocolate, and More. version: 1.0
  • title: Milkshake for the boys in the yard: Vanilla, Chocolate, and More. version: 2.1
  • title: Hot Chocolate for Cold Winters. version: 1.0

Currently, the site is using Apache Solr Search and related modules. I haven’t been able to set a hook that would allow removing the duplicate results for versions with the same title but different versions, ideally I would like to have results for the latest version only.

The Apache Solr Sort module supposedly would do the trick, sadly I’m still getting the same results sorted by most recent creation, but due to those articles having (almost) the same score none of the duplicated versions are removed.

To handle the sort by most recent creation date I have modified the score using the creation date.

Also, is possible to achieve the sort using the Apache Solr search module.
admin/config/search/apachesolr/settings/solr/bias?destination=admin/config/search/apachesolr/settings

But to remove duplicate results, still haven’t found a solution. The documentation says that my necessity would be solved implementing Grouping, but no result comes from Apache Solr using the following hook_apachesolr_query_prepare which is based in the Sort module, Is this the correct way to implement Grouping? Is there another option to remove the duplicate versions?

/**
 * Implements hook_apachesolr_query_prepare().
 */
function custom_search_apachesolr_query_prepare($query) {

  $env_id = $query->solr('getId');
  $process_callback = apachesolr_environment_variable_get($env_id, 'process_response_callback', 'apachesolr_search_process_response');
  $group_field = apachesolr_environment_variable_get($env_id, 'group_field', 'title');
  $group_limit = apachesolr_environment_variable_get($env_id, 'group_limit', '10');

  if ($process_callback == "apachesolr_sort_process_response") {
    $query->addParams(
      array(
        'group' => 'true',
        'group.field' => $group_field,
        'group.limit' => $group_limit,
        'group.ngroups' => 'true',
        'group.sort' => 'ds_created desc',
        'group.facet' => 'true',
      )
    );
    // start params are different. You should move similar to the group.limit amount
    if (isset($query->page)) {
      $query->removeParam('start');
    }
    if (isset($query->page)) {
      $query->addParam('group.offset', $query->page * $group_limit);
    }
  }
}

Thanks in advance for your time.

SharePoint search API not bringing results from Subsites

I am trying to use Search Api in SharePoint online to search against a RefinableString that is mapped to to a column

https://tenant.sharepoint.com/sites/SiteName/_api/search/query?querytext='RefinableString00:SomeQueryText'&rowlimit=500&selectproperties='Title,RefinableString00'

When I query this, it brings the documents from the root site collection only. When I include the path:"http://pathToSubsite" in querytext, it brings the document from that subsite only. So if want to bring results from all the subsites, do I need to include all of them in the path?

Not sure what I am missing in the query. Also I noticed that it the result is containing only one result even when we have more than 1 matching results in the site.

DOCKER: every command results in a fatal error: runtime: out of memory

To add context, I have a small server with 1GB memory on which I am trying to deploy a lot of shiny apps by dockerizing ShinyProxy using docker-compose.

I am adding app after app on ShinyProxy and testing it step by step. It used to work for the 4-5 first apps but now when I build my container using docker-compose up –build -d, I ended up with the following error from which I cannot get out…

fatal error: runtime: out of memory

runtime stack:<br />
runtime.throw(0x55e484ea7241, 0x16)<br />
    /usr/local/go/src/runtime/panic.go:617 +0x74 fp=0x7fff0428e880 sp=0x7fff0428e850 pc=0x55e4838d6084<br />
runtime.sysMap(0xc000000000, 0x4000000, 0x55e486e41e98)
    /usr/local/go/src/runtime/mem_linux.go:170 +0xc9 fp=0x7fff0428e8c0 sp=0x7fff0428e880 pc=0x55e4838c1399<br />
runtime.(*mheap).sysAlloc(0x55e486e28980, 0x2000, 0x55e486e28990, 0x1)
    /usr/local/go/src/runtime/malloc.go:633 +0x1cf fp=0x7fff0428e968 sp=0x7fff0428e8c0 pc=0x55e4838b41af <br />
runtime.(*mheap).grow(0x55e486e28980, 0x1, 0x0)
    /usr/local/go/src/runtime/mheap.go:1222 +0x44 fp=0x7fff0428e9c0 sp=0x7fff0428e968 pc=0x55e4838ce7a4 <br />
runtime.(*mheap).allocSpanLocked(0x55e486e28980, 0x1, 0x55e486e41ea8, 0x0)
    /usr/local/go/src/runtime/mheap.go:1150 +0x381 fp=0x7fff0428e9f8 sp=0x7fff0428e9c0 pc=0x55e4838ce691 <br />
runtime.(*mheap).alloc_m(0x55e486e28980, 0x1, 0x2a, 0x6e43a318)
    /usr/local/go/src/runtime/mheap.go:977 +0xc6 fp=0x7fff0428ea48 sp=0x7fff0428e9f8 pc=0x55e4838cdce6 <br />
runtime.(*mheap).alloc.func1()
    /usr/local/go/src/runtime/mheap.go:1048 +0x4e fp=0x7fff0428ea80 sp=0x7fff0428ea48 pc=0x55e4838fee0e <br />
runtime.(*mheap).alloc(0x55e486e28980, 0x1, 0x55e48301002a, 0x7fff0428eb20)
    /usr/local/go/src/runtime/mheap.go:1047 +0x8c fp=0x7fff0428ead0 sp=0x7fff0428ea80 pc=0x55e4838cdfbc <br />
runtime.(*mcentral).grow(0x55e486e29780, 0x0)
    /usr/local/go/src/runtime/mcentral.go:256 +0x97 fp=0x7fff0428eb18 sp=0x7fff0428ead0 pc=0x55e4838c0e17 <br />
runtime.(*mcentral).cacheSpan(0x55e486e29780, 0x7fbfd6083000)
    /usr/local/go/src/runtime/mcentral.go:106 +0x301 fp=0x7fff0428eb78 sp=0x7fff0428eb18  pc=0x55e4838c0921 <br />
runtime.(*mcache).refill(0x7fbfd6083008, 0x2a)
    /usr/local/go/src/runtime/mcache.go:135 +0x88 fp=0x7fff0428eb98 sp=0x7fff0428eb78 pc=0x55e4838c03b8 <br />
runtime.(*mcache).nextFree(0x7fbfd6083008, 0x55e486e1e82a, 0x7fbfd6083008, 0x7fbfd6083000, 0x8)
    /usr/local/go/src/runtime/malloc.go:786 +0x8a fp=0x7fff0428ebd0 sp=0x7fff0428eb98 pc=0x55e4838b49ea <br />
runtime.mallocgc(0x180, 0x55e485b93c00, 0x1, 0x55e486e41f00)
    /usr/local/go/src/runtime/malloc.go:939 +0x780 fp=0x7fff0428ec70 sp=0x7fff0428ebd0 pc=0x55e4838b5320 <br />
runtime.newobject(0x55e485b93c00, 0x4000)
    /usr/local/go/src/runtime/malloc.go:1068 +0x3a fp=0x7fff0428eca0 sp=0x7fff0428ec70 pc=0x55e4838b572a <br />
runtime.malg(0x3cba6700008000, 0x55e486e2aff0)
    /usr/local/go/src/runtime/proc.go:3220 +0x33 fp=0x7fff0428ece0 sp=0x7fff0428eca0 pc=0x55e4838df533 <br />
runtime.mpreinit(...)
    /usr/local/go/src/runtime/os_linux.go:311 <br />
runtime.mcommoninit(0x55e486e22c40)
    /usr/local/go/src/runtime/proc.go:618 +0xc6 fp=0x7fff0428ed18 sp=0x7fff0428ece0 pc=0x55e4838d8ea6 <br />
runtime.schedinit()
    /usr/local/go/src/runtime/proc.go:540 +0x78 fp=0x7fff0428ed70 sp=0x7fff0428ed18 pc=0x55e4838d8b38 <br />
runtime.rt0_go(0x7fff0428ee78, 0x2, 0x7fff0428ee78, 0x0, 0x7fbfd56b4b97, 0x2, 0x7fff0428ee78, 0x200008000, 0x55e483900e80, 0x0, ...)
    /usr/local/go/src/runtime/asm_amd64.s:195 +0x11e fp=0x7fff0428ed78 sp=0x7fff0428ed70 pc=0x55e483900fae

The problem is that every time I connect through ssh to my server, every docker command results in this error. I am literally stuck with it and don’t know how to get out.

I hope some docker pros can help me with this issue.

Thanks & Regards,

Maxime

equation solving – LinearSolve and LeastSquares giving different results on system with a solution

So I’m working on a program for my PhD which is supposed to do the following: Take a function f, build a matrix A with Table(Coefficient(f(n*x + k + i - 1), x^j), {i, n}, {j, Deg}) (Deg is the degree of f, n is arbitrary positive integer), then take a function g of the same degree as f and construct a vector B with Table(Coefficient(g(x + m), x^j), {j, Deg}), then solve A.x = B for x in terms of k,m and then find at least one integer value of k,m so that each entry of x is nonnegative. If n = Deg then it’s a square matrix and it’s possible to show that A will always be invertible, and max rank if it’s nonsquare.

But for some reason (for a specific case of f = x^3, g = (2x+1)^3) when A is 3×2, using LeastSquares(Transpose(A),B) gives me the correct solution whereas LinearSolve(Transpose(A),B) tells me there is no solution, and when A is 3×4 (now for the case f = x^3, g = (4x+1)^3), the exact opposite happens. (Due to the nature of the problem, given any n I can choose f,g so that I know there is a solution for that n, and I know what one of the solutions is.) I’m really confused because I looked at the documentation which explicitly says that if there is a solution, I should get the same result from both. And I wouldn’t even be that bothered if one of them gave more or less correct solutions, since I only need one value of (k,m) for what I’m doing, but if I’m getting incorrect results in different cases then it’s a bit of a problem.

plotting – Understanding how to forward results, computations & functions to inbuilt functions

I may be missing something obvious about the Mathematica language, but I am having trouble understanding something; so much so that I am not sure if the title of the question is appropriate (not specific enough?). I found these related questions but that does not seem to be the problem here.

My question is suppose I write a function:

Op(sys_, ip_) := OutputResponse(TransferFunctionModel(sys, s), ip, t);

I can make it do useful computation as follows:

Op((s + 1)/(s^2 + 2 s + 1), Sin(t)) // InputForm

returning:

{-(-1 + E^t*Cos(t) - E^t*Sin(t)) / (2*E^t)}

What I want to do next is:

Plot(Op((s + 1)/(s^2 + 2 s + 1), Sin(t)), {t, 0, 10})

but for some reason, this fails and I don’t understand why. I discovered that if I store the stuff returned by the call to Op in an intermediate value, then the plotting command works.

fluff = Op((s + 1)/(s^2 + 2 s + 1), Sin(t));
Plot(fluff, {t, 0, 10})

I don’t understand why this works and the other doesn’t. How would I go about fixing the first case without using an intermediate value?

apache2 – php shell_exec returns different results compared to terminal

I try to run shell_exec("ls -l /dev"); to list all entries in /dev and I get this list:

total 0
drwxr-xr-x 2 root root  180 Oct 10 11:19 char
lrwxrwxrwx 1 root root   11 Oct 10 11:19 core -> /proc/kcore
lrwxrwxrwx 1 root root   13 Oct 10 11:19 fd -> /proc/self/fd
crw-rw-rw- 1 root root 1, 7 Oct 10 11:19 full
drwxr-xr-x 2 root root    0 Oct  8 14:21 hugepages
lrwxrwxrwx 1 root root   28 Oct 10 11:19 log -> /run/systemd/journal/dev-log
drwxrwxrwt 2 root root   40 Oct  8 14:21 mqueue
crw-rw-rw- 1 root root 1, 3 Oct 10 11:19 null
crw-rw-rw- 1 root root 5, 2 Oct 10 11:19 ptmx
drwxr-xr-x 2 root root    0 Oct  8 14:21 pts
crw-rw-rw- 1 root root 1, 8 Oct 10 11:19 random
drwxrwxrwt 2 root root   40 Oct 10 11:38 shm
lrwxrwxrwx 1 root root   15 Oct 10 11:19 stderr -> /proc/self/fd/2
lrwxrwxrwx 1 root root   15 Oct 10 11:19 stdin -> /proc/self/fd/0
lrwxrwxrwx 1 root root   15 Oct 10 11:19 stdout -> /proc/self/fd/1
crw-rw-rw- 1 root root 5, 0 Oct 10 11:19 tty
crw-rw-rw- 1 root root 1, 9 Oct 10 11:19 urandom
crw-rw-rw- 1 root root 1, 5 Oct 10 11:19 zero

if I run ls -l /dev in terminal I get this:

total 0
crw-r--r-- 1 root root       10, 235 Oct  8 14:21 autofs
drwxr-xr-x 2 root root           200 Oct  8 14:21 block
drwxr-xr-x 2 root root            80 Oct  8 14:21 bsg
crw------- 1 root root       10, 234 Oct  8 14:21 btrfs-control
drwxr-xr-x 3 root root            60 Oct  8 14:21 bus
drwxr-xr-x 2 root root          3660 Oct  9 01:59 char
crw------- 1 root root        5,   1 Oct  8 14:21 console
lrwxrwxrwx 1 root root            11 Oct  8 14:21 core -> /proc/kcore
drwxr-xr-x 2 root root            60 Oct  8 14:21 cpu
crw------- 1 root root       10,  60 Oct  8 14:21 cpu_dma_latency
crw------- 1 root root       10, 203 Oct  8 14:21 cuse
drwxr-xr-x 8 root root           160 Oct  8 14:21 disk
drwxr-xr-x 2 root root            60 Oct  8 14:21 dma_heap
drwxr-xr-x 3 root root           100 Oct  8 14:21 dri
crw-rw---- 1 root video      29,   0 Oct  8 14:21 fb0
lrwxrwxrwx 1 root root            13 Oct  8 14:21 fd -> /proc/self/fd
crw-rw-rw- 1 root root        1,   7 Oct  8 14:21 full
crw-rw-rw- 1 root root       10, 229 Oct  8 14:21 fuse
crw------- 1 root root      239,   0 Oct  8 14:21 hidraw0
crw------- 1 root root      239,   1 Oct  8 14:21 hidraw1
crw------- 1 root root      239,   2 Oct  8 14:21 hidraw2
crw------- 1 root root      239,   3 Oct  8 14:21 hidraw3
crw------- 1 root root       10, 228 Oct  8 14:21 hpet
drwxr-xr-x 2 root root             0 Oct  8 14:21 hugepages
crw------- 1 root root       10, 183 Oct  8 14:21 hwrng
drwxr-xr-x 4 root root           480 Oct  8 14:21 input
crw-r--r-- 1 root root        1,  11 Oct  8 14:21 kmsg
crw-rw-rw- 1 root kvm        10, 232 Oct  8 14:21 kvm
drwxr-xr-x 2 root root            60 Oct  8 14:21 lightnvm
lrwxrwxrwx 1 root root            28 Oct  8 14:21 log -> /run/systemd/journal/dev-log
crw-rw---- 1 root disk       10, 237 Oct  8 14:21 loop-control
drwxr-xr-x 2 root root            60 Oct  8 14:21 mapper
crw-r----- 1 root kmem        1,   1 Oct  8 14:21 mem
drwxrwxrwt 2 root root            40 Oct  8 14:21 mqueue
drwxr-xr-x 2 root root            60 Oct  8 14:21 net
crw-rw-rw- 1 root root        1,   3 Oct  8 14:21 null
crw-rw-rw- 1 root root      195,   0 Oct  8 14:21 nvidia0
crw-rw-rw- 1 root root      195, 255 Oct  8 14:21 nvidiactl
crw-rw-rw- 1 root root      195, 254 Oct  8 14:21 nvidia-modeset
crw------- 1 root root       10, 144 Oct  8 14:21 nvram
crw-r----- 1 root kmem        1,   4 Oct  8 14:21 port
crw------- 1 root root      108,   0 Oct  8 14:21 ppp
crw------- 1 root root       10,   1 Oct  8 14:21 psaux
crw-rw-rw- 1 root tty         5,   2 Oct 10 11:39 ptmx
drwxr-xr-x 2 root root             0 Oct  8 14:21 pts
crw-rw-rw- 1 root root        1,   8 Oct  8 14:21 random
crw------- 1 root root       10, 242 Oct  8 14:21 rfkill
lrwxrwxrwx 1 root root             4 Oct  8 14:21 rtc -> rtc0
crw------- 1 root root      249,   0 Oct  8 14:21 rtc0
brw-rw---- 1 root disk        8,   0 Oct  8 14:21 sda
brw-rw---- 1 root disk        8,   1 Oct  8 14:21 sda1
brw-rw---- 1 root disk        8,   2 Oct  8 14:21 sda2
brw-rw---- 1 root disk        8,   3 Oct  8 14:21 sda3
brw-rw---- 1 root disk        8,   4 Oct  8 14:21 sda4
brw-rw---- 1 root disk        8,  16 Oct  8 14:21 sdb
brw-rw---- 1 root disk        8,  17 Oct  8 14:21 sdb1
brw-rw---- 1 root disk        8,  18 Oct  8 14:21 sdb2
drwxrwxrwt 2 root root            40 Oct 10 11:39 shm
crw------- 1 root root       10, 231 Oct  8 14:21 snapshot
drwxr-xr-x 3 root root           400 Oct  8 14:21 snd
lrwxrwxrwx 1 root root            15 Oct  8 14:21 stderr -> /proc/self/fd/2
lrwxrwxrwx 1 root root            15 Oct  8 14:21 stdin -> /proc/self/fd/0
lrwxrwxrwx 1 root root            15 Oct  8 14:21 stdout -> /proc/self/fd/1
crw-rw-rw- 1 root tty         5,   0 Oct 10 11:15 tty
crw--w---- 1 root tty         4,   0 Oct  8 14:21 tty0
crw--w---- 1 root tty         4,   1 Oct  8 14:21 tty1
crw--w---- 1 root tty         4,  10 Oct  8 14:21 tty10
crw--w---- 1 root tty         4,  11 Oct  8 14:21 tty11
crw--w---- 1 root tty         4,  12 Oct  8 14:21 tty12
crw--w---- 1 root tty         4,  13 Oct  8 14:21 tty13
crw--w---- 1 root tty         4,  14 Oct  8 14:21 tty14
crw--w---- 1 root tty         4,  15 Oct  8 14:21 tty15
crw--w---- 1 root tty         4,  16 Oct  8 14:21 tty16
crw--w---- 1 root tty         4,  17 Oct  8 14:21 tty17
crw--w---- 1 root tty         4,  18 Oct  8 14:21 tty18
crw--w---- 1 root tty         4,  19 Oct  8 14:21 tty19
crw--w---- 1 root tty         4,   2 Oct  8 14:21 tty2
crw--w---- 1 root tty         4,  20 Oct  8 14:21 tty20
crw--w---- 1 root tty         4,  21 Oct  8 14:21 tty21
crw--w---- 1 root tty         4,  22 Oct  8 14:21 tty22
crw--w---- 1 root tty         4,  23 Oct  8 14:21 tty23
crw--w---- 1 root tty         4,  24 Oct  8 14:21 tty24
crw--w---- 1 root tty         4,  25 Oct  8 14:21 tty25
crw--w---- 1 root tty         4,  26 Oct  8 14:21 tty26
crw--w---- 1 root tty         4,  27 Oct  8 14:21 tty27
crw--w---- 1 root tty         4,  28 Oct  8 14:21 tty28
crw--w---- 1 root tty         4,  29 Oct  8 14:21 tty29
crw--w---- 1 root tty         4,   3 Oct  8 14:21 tty3
crw--w---- 1 root tty         4,  30 Oct  8 14:21 tty30
crw--w---- 1 root tty         4,  31 Oct  8 14:21 tty31
crw--w---- 1 root tty         4,  32 Oct  8 14:21 tty32
crw--w---- 1 root tty         4,  33 Oct  8 14:21 tty33
crw--w---- 1 root tty         4,  34 Oct  8 14:21 tty34
crw--w---- 1 root tty         4,  35 Oct  8 14:21 tty35
crw--w---- 1 root tty         4,  36 Oct  8 14:21 tty36
crw--w---- 1 root tty         4,  37 Oct  8 14:21 tty37
crw--w---- 1 root tty         4,  38 Oct  8 14:21 tty38
crw--w---- 1 root tty         4,  39 Oct  8 14:21 tty39
crw--w---- 1 root tty         4,   4 Oct  8 14:21 tty4
crw--w---- 1 root tty         4,  40 Oct  8 14:21 tty40
crw--w---- 1 root tty         4,  41 Oct  8 14:21 tty41
crw--w---- 1 root tty         4,  42 Oct  8 14:21 tty42
crw--w---- 1 root tty         4,  43 Oct  8 14:21 tty43
crw--w---- 1 root tty         4,  44 Oct  8 14:21 tty44
crw--w---- 1 root tty         4,  45 Oct  8 14:21 tty45
crw--w---- 1 root tty         4,  46 Oct  8 14:21 tty46
crw--w---- 1 root tty         4,  47 Oct  8 14:21 tty47
crw--w---- 1 root tty         4,  48 Oct  8 14:21 tty48
crw--w---- 1 root tty         4,  49 Oct  8 14:21 tty49
crw--w---- 1 root tty         4,   5 Oct  8 14:21 tty5
crw--w---- 1 root tty         4,  50 Oct  8 14:21 tty50
crw--w---- 1 root tty         4,  51 Oct  8 14:21 tty51
crw--w---- 1 root tty         4,  52 Oct  8 14:21 tty52
crw--w---- 1 root tty         4,  53 Oct  8 14:21 tty53
crw--w---- 1 root tty         4,  54 Oct  8 14:21 tty54
crw--w---- 1 root tty         4,  55 Oct  8 14:21 tty55
crw--w---- 1 root tty         4,  56 Oct  8 14:21 tty56
crw--w---- 1 root tty         4,  57 Oct  8 14:21 tty57
crw--w---- 1 root tty         4,  58 Oct  8 14:21 tty58
crw--w---- 1 root tty         4,  59 Oct  8 14:21 tty59
crw--w---- 1 root tty         4,   6 Oct  8 14:21 tty6
crw--w---- 1 root tty         4,  60 Oct  8 14:21 tty60
crw--w---- 1 root tty         4,  61 Oct  8 14:21 tty61
crw--w---- 1 root tty         4,  62 Oct  8 14:21 tty62
crw--w---- 1 root tty         4,  63 Oct  8 14:21 tty63
crw--w---- 1 root tty         4,   7 Oct  8 14:21 tty7
crw--w---- 1 root tty         4,   8 Oct  8 14:21 tty8
crw--w---- 1 root tty         4,   9 Oct  8 14:21 tty9
crw-rw---- 1 root uucp        4,  64 Oct  8 14:21 ttyS0
crw-rw---- 1 root uucp        4,  65 Oct  8 14:21 ttyS1
crw-rw---- 1 root uucp        4,  66 Oct  8 14:21 ttyS2
crw-rw---- 1 root uucp        4,  67 Oct  8 14:21 ttyS3
crw-rw---- 1 root kvm        10,  61 Oct  8 14:21 udmabuf
crw------- 1 root root       10, 239 Oct  8 14:21 uhid
crw------- 1 root root       10, 223 Oct  8 14:21 uinput
crw-rw-rw- 1 root root        1,   9 Oct  8 14:21 urandom
drwxr-xr-x 2 root root            60 Oct  8 14:21 usb
crw------- 1 root root       10, 240 Oct  8 14:21 userio
crw------- 1 root root       10,  59 Oct  8 14:21 vboxdrv
crw-rw-rw- 1 root root       10,  58 Oct  8 14:21 vboxdrvu
crw------- 1 root root       10,  57 Oct  8 14:21 vboxnetctl
drwxr-x--- 4 root vboxusers       80 Oct  8 14:21 vboxusb
crw-rw---- 1 root tty         7,   0 Oct  8 14:21 vcs
crw-rw---- 1 root tty         7,   1 Oct  8 14:21 vcs1
crw-rw---- 1 root tty         7,   2 Oct  8 14:21 vcs2
crw-rw---- 1 root tty         7,   3 Oct  8 14:21 vcs3
crw-rw---- 1 root tty         7,   4 Oct  8 14:21 vcs4
crw-rw---- 1 root tty         7,   5 Oct  8 14:21 vcs5
crw-rw---- 1 root tty         7,   6 Oct  8 14:21 vcs6
crw-rw---- 1 root tty         7,  63 Oct  9 01:59 vcs63
crw-rw---- 1 root tty         7, 128 Oct  8 14:21 vcsa
crw-rw---- 1 root tty         7, 129 Oct  8 14:21 vcsa1
crw-rw---- 1 root tty         7, 130 Oct  8 14:21 vcsa2
crw-rw---- 1 root tty         7, 131 Oct  8 14:21 vcsa3
crw-rw---- 1 root tty         7, 132 Oct  8 14:21 vcsa4
crw-rw---- 1 root tty         7, 133 Oct  8 14:21 vcsa5
crw-rw---- 1 root tty         7, 134 Oct  8 14:21 vcsa6
crw-rw---- 1 root tty         7, 191 Oct  9 01:59 vcsa63
crw-rw---- 1 root tty         7,  64 Oct  8 14:21 vcsu
crw-rw---- 1 root tty         7,  65 Oct  8 14:21 vcsu1
crw-rw---- 1 root tty         7,  66 Oct  8 14:21 vcsu2
crw-rw---- 1 root tty         7,  67 Oct  8 14:21 vcsu3
crw-rw---- 1 root tty         7,  68 Oct  8 14:21 vcsu4
crw-rw---- 1 root tty         7,  69 Oct  8 14:21 vcsu5
crw-rw---- 1 root tty         7,  70 Oct  8 14:21 vcsu6
crw-rw---- 1 root tty         7, 127 Oct  9 01:59 vcsu63
drwxr-xr-x 2 root root            60 Oct  8 14:21 vfio
crw------- 1 root root       10,  63 Oct  8 14:21 vga_arbiter
crw------- 1 root root       10, 137 Oct  8 14:21 vhci
crw------- 1 root root       10, 238 Oct  8 14:21 vhost-net
crw------- 1 root root       10, 241 Oct  8 14:21 vhost-vsock
crw------- 1 root root       10, 130 Oct  8 14:21 watchdog
crw------- 1 root root      246,   0 Oct  8 14:21 watchdog0
crw-rw-rw- 1 root root        1,   5 Oct  8 14:21 zero

PHP runs same user as terminal user:
echo shell_exec("id"); returns:

uid=1000(alien) gid=998(wheel) groups=998(wheel),108(vboxusers),150(wireshark)

Running id in terminal returns:

uid=1000(alien) gid=998(wheel) groups=998(wheel),108(vboxusers),150(wireshark)

Please help, why I don’t see all entries in /dev and how to solve that?

p.s Apache is also running as same user

Maybe it is about environment?
if I run echo shell_exec("/bin/printenv"); it returns:

PWD=/home/alien/http/localhost
HOME=/home/alien
USER=alien
SHLVL=0
_=/bin/printenv

running printenv in terminal returns:

SHELL=/bin/bash
SESSION_MANAGER=local/black:@/tmp/.ICE-unix/748,unix/black:/tmp/.ICE-unix/748
WINDOWID=71303175
QT_SCREEN_SCALE_FACTORS=DVI-I-0=1;VGA-0=1;DVI-I-1=1;HDMI-0=1;
COLORTERM=truecolor
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1
HISTCONTROL=ignoredups
LANGUAGE=
SHELL_SESSION_ID=2cf1621fe1f04785b31888421768dd02
DESKTOP_SESSION=/usr/share/xsessions/plasma
GTK_RC_FILES=/etc/gtk/gtkrc:/home/alien/.gtkrc:/home/alien/.config/gtkrc
XCURSOR_SIZE=24
GTK_MODULES=canberra-gtk-module
XDG_SEAT=seat0
PWD=/home/alien
XDG_SESSION_DESKTOP=KDE
LOGNAME=alien
XDG_SESSION_TYPE=x11
XAUTHORITY=/home/alien/.Xauthority
MOTD_SHOWN=pam
GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/alien/.gtkrc-2.0:/home/alien/.config/gtkrc-2.0
HOME=/home/alien
LANG=en_US.UTF-8
XDG_CURRENT_DESKTOP=KDE
KONSOLE_DBUS_SERVICE=:1.689
KONSOLE_DBUS_SESSION=/Sessions/2
PROFILEHOME=
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
KONSOLE_VERSION=200801
KDE_SESSION_UID=1000
XDG_SESSION_CLASS=user
TERM=xterm-256color
USER=alien
COLORFGBG=15;0
KDE_SESSION_VERSION=5
PAM_KWALLET5_LOGIN=/run/user/1000/kwallet5.socket
DISPLAY=:0
SHLVL=1
XDG_VTNR=1
XDG_SESSION_ID=2
XDG_RUNTIME_DIR=/run/user/1000
QT_AUTO_SCREEN_SCALE_FACTOR=0
XCURSOR_THEME=breeze_cursors
KDE_FULL_SESSION=true
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
KDE_APPLICATIONS_AS_SCOPE=1
MAIL=/var/spool/mail/alien
KONSOLE_DBUS_WINDOW=/Windows/1
_=/usr/bin/printenv

I also get different result in php if I run:

echo shell_exec("sudo -u alien /bin/printenv");


MAIL=/var/mail/alien
LOGNAME=alien
USER=alien
HOME=/home/alien
SHELL=/bin/bash
TERM=unknown
PATH=/usr/bin:/bin:/usr/sbin:/sbin
SUDO_COMMAND=/bin/printenv
SUDO_USER=alien
SUDO_UID=1000
SUDO_GID=998

probability or statistics – Intepreting the results of DistributionFitTest, and other alternatives in Mathematica 12.1

I have been playing with DistributionFitTest as a means of testing how normal some data sets I have. I’ve been working with some simulated data sets so I can try and understand what’s going on. From the documentation it seems DistributionFitTest returns a $p$-value by default, which according to the documentation

A small $p$-value suggests that it is unlikely that the data came from dist.

Firstly, how is “small” defined?

From my limited understanding of $p$-values, it seems that if the resultant $p$-value is $< 0.05$ then one can say it is unlikely that the data belongs to the proposed distribution. Again, from my understanding this $0.05$ threshold should be considered as a hard line, so $p = 0.04999$ should be rejected while $p = 0.05000$ is accepted.

As for my “simulations” I did a simple test to find out how $p$-values are distributed for multiple data sets which are generated from the dame distribution. I use the "KolmogorovSmirnov" option as the K-S test seems to be the standard approach used.

ManypValue = 
Table[
        NormalData = RandomVariate[NormalDistribution[0, 1], 1000];
        pValue = DistributionFitTest[NormalData, NormalDistribution[[Mu], [Sigma]], "KolmogorovSmirnov"],
        {i, 1, 512}
    ];
    
Histogram[ManypValue, "FreedmanDiaconis", "PDF",Frame->True, FrameLabel->{"p-Value","PDF"}]

The result is a uniform or box distribution which goes between $0$ and $1$, so I understand this to mean that there is a $5%$ chance of a dataset which is normal being identified as non-normal — on the basis of this $p>0.05$ threshold:
enter image description here

Finally, are there any other methods in Mathematica as a means of testing whether data belongs to a distribution?