text:
Q: Is «ado» used often? The following expression seems to be quite common:

without further ado

Despite "ado" is a word with its own meaning I do not hear native speakers use it much separately. Is it the word that is mostly used   only as a part of the phrase?

A: The word "ado" is an example of an archaic word surviving as part of familiar idioms. "Without further ado" is a fairly common expression, as is "much ado about nothing", which is the title of a Shakespeare play, and most native speakers are familiar with these expressions. Beyond these idioms, the word "ado" in isolation isn't used much at all. Some comments to this answer have suggested that the word might be used in some regional British dialects, but in other English speaking countries, it is not used at all. As a native British English speaker myself, I haven't heard it used outside of the two idioms but evidently, in some remoter regions, it might be.
A similar word "to-do" (meaning more worry/work than ought to be necessary) is used a little more in British English, and you will find a few more modern examples using it. This ngram compares the use of "a to-do" and "an ado" in literature.


text:
Q: How to dispose an array of IDisposables returned by a task? I use the rule of thumb to always put inside a using statement everything that implements IDisposable. But I'm starting to work with Tasks and I can't add a using statement like this:
var getResultTasks = new List<Task<HttpResponseMessage>>();

getResultTasks.Add(_client.GetAsync(requestUri));
getResultTasks.Add(_client.GetAsync(requestUri));

using var httpGetResponseMessages = await Task.WhenAll(getResultTasks);

It says:

'HttpResponseMessage[]': type used in a using statement must be
implicitly convertible to 'System.IDisposable'.

I can apply it without problems to a single instance though:
using var testing = await _client.GetAsync("");

A: Since .net core 3, calling Dispose on a http HttpResponseMessage may not always be needed.
In short, In the majority of cases the body of the response from the underlying connection Socket is fully received, and the byte data representing the content will be buffered into a MemoryStream automatically. This occurs when using most overloads of the HttpClient APIs (GetAsync, PostAsync and SendAsync).
Calling dispose will only dispose the underlying MemoryStream which is not needed. However, there are cases where this is not true, so if you do not completely understand what is going on, call Dispose on a HttpResponseMessage. In your case you have a list of HttpResponseMessage, then just loop through the list manually
var responses = await Task.WhenAll(getResultTasks);

foreach(var response in response)
{
   // do something with the result maybe

   response?.Dispose();

   // job done
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: Дерево хаффмана Добрый день. Пытаюсь реализовать алгоритм Хаффмана. Дерево строится правильно, однако выводит на несколько байт больше, чем должно. Не могу найти ошибку. Подскажите, пожалуйста.
    #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct Tree_t {//дерево
    char data;
    int weight;
    char str[256];
    struct Tree_t *left;
    struct Tree_t *right;
}tree;

typedef struct code_t { //структура для вывода дерева.
    unsigned long long code;
    int len;
}code_s;

unsigned char codes[256]; //для составления кода, во время обхода
int all_len;//не используется
unsigned char last_code; //сам код
int len_last_code; //длина последнего кода (для write_bit)
FILE *fout = fopen("out.txt", "wb");
int global;//для отладки

typedef struct queue_t { //Эта структура для слияния
    tree *tree;
    struct queue_t *next;
}queue;

tree *merge(tree *l, tree *r) { //слияние деревьев
    tree *new_tr = (tree*)calloc(1, sizeof(tree));
    new_tr->weight = l->weight + r->weight;
    new_tr->left = l;
    new_tr->right = r;
    return new_tr;
}

queue *enqueue(queue *head, tree *tree_t) { //добавление элемента в очередь с приоритетом
    queue *first, *second;
    queue *new_el = (queue*)calloc(1, sizeof(queue));
    new_el->tree = tree_t;
    new_el->next = NULL;

    if (head == NULL)
        return new_el;
    first = head;
    second = head->next;

    if (new_el->tree->weight <= first->tree->weight) {
        new_el->next = first;
        return new_el;
    }
    else {
        while (second) {
            if (new_el->tree->weight <= second->tree->weight)
                break;
            first = second;
            second = first->next;
        }
        first->next = new_el;
        new_el->next = second;
        return head;
    }
}

queue *build_haff_tree(queue *head) { //Строим дерево Хаффмана. Голову возвращаем, т.к. она может меняться в процессе
    queue *first = NULL, *second = NULL, *new_head = NULL;
    queue *tmp = head;
    tree *buf;

    first = tmp;
    second = tmp->next;
    new_head = second->next;

    buf = merge(first->tree, second->tree);
    head = enqueue(new_head, buf);
    free(first); free(second); //Удаляем элементы, которые уже вхоядт в новое дерево
    return head;
}

queue *create_start_tree(int *ascii, queue *head) { //создаем начальное дерево
    int i = 0;
    for (i = 0; i <= 255; i++) {
        if (ascii[i] != 0) {
                tree *new_tr = (tree*)calloc(1, sizeof(tree));
                new_tr->data = i;
                new_tr->weight = ascii[i];
                head = enqueue(head, new_tr);
        }
    }
    return head;
}

void clear_tree(tree *tree) {//удаление дерева
    if (tree == NULL) { return; }

    clear_tree(tree->left);
    clear_tree(tree->right);
    free(tree);
}

void input_ascii(FILE *fin, int *ascii) { //заполняем таблицу частоты
    while (!feof(fin)) {
        ascii[fgetc(fin)]++;
    }
}
void input_code_len(char **ascii, char *ascii_len) { //заполняем таблицу длины кодов
    for (int i = 0; i < 256; i++) {
        if (ascii[i] != NULL)
            ascii_len[i] = strlen(ascii[i]);
    }
}

void write_bit(code_s code, unsigned char sumbol) {//записываем дерево
    int i = 0;
    unsigned char out_bit = 0;
    unsigned char out_sumbol = 0;
    if (len_last_code != 0)
        i = len_last_code;
    out_bit = (128 >> (code.len + len_last_code));
    while (i <= code.len + len_last_code) {
        i++;
        if (i == 8) {
            out_sumbol = out_bit | last_code;
            fprintf(fout, "%c", out_sumbol);
            code.len = code.len - (8 - len_last_code);
            len_last_code = 0;
            i = 0;
            out_bit = 0;
            out_bit = (128 >> (code.len + len_last_code));
            global++;
        }
    }

    out_sumbol = out_bit | (sumbol >> i);
    fprintf(fout, "%c", out_sumbol);
    last_code = (sumbol << (8 - i));
    len_last_code = i;
    global++;
    return;
}

void write_tree_haffman(tree *tree, FILE *tree_out, char **ascii, code_s code) { //Составляем таблицу и записываем дерево в файл
    if ((tree->left == NULL) && (tree->right == NULL)) {
        tree->weight = strlen(tree->str);
        codes[tree->data] = code.code;
        if (codes[tree->data] != codes[0])
            write_bit(code, tree->data);
        return;
    }
    else {
        code_s c = code;
        c.code = (1 << c.len);
        c.len++;
        all_len++;
        strcpy(tree->left->str, tree->str);
        ascii[tree->left->data] = tree->left->str;
        tree->weight = strlen(tree->str);
        tree->left->str[tree->weight] = '0';
        write_tree_haffman(tree->left, tree_out, ascii, c);
        strcpy(tree->right->str, tree->str);
        ascii[tree->right->data] = tree->right->str;
        tree->right->str[tree->weight] = '1';
        write_tree_haffman(tree->right, tree_out, ascii, c);
    }
}

void print_text(FILE *fin, FILE *fout, char **ascii, char *ascii_len) { //переводим текст в код хаффмана
    char c;
    int last_len = 0;
    unsigned char out = 0;
    char *tmp;
    while (fscanf(fin, "%c", &c) != -1) {
        tmp = ascii[c];
        for (int j = 0; j < ascii_len[c]; j++) {
            last_len++;
            if (tmp[j] == '1')
                out = out | (1 << (8 - last_len));
            if (last_len == 8) {
                fprintf(fout, "%c", out);
                out = 0;
                last_len = 0;
            }
        }
    }
}

int main() {
    int ascii[260] = { 0 };
    char *ascii_code[260] = { NULL };
    char len_code[260] = { 0 };
    char c = 0;
    queue *head = NULL;
    queue *tmp_head = NULL;
    tree *tree_h = NULL;
    code_s code;
    code.code = 0;
    code.len = 0;
    global = 0;

    FILE *fin = fopen("in.txt", "rb");
    fscanf(fin, "%c", &c);

    input_ascii(fin, ascii); //заполняем массив частоты элементов
    head = create_start_tree(ascii, head); //создаем первые узлы и кидаем их в очередь с их приоритетом
    tmp_head = head;

    while (head->next != NULL)
        head = build_haff_tree(head); //создаем дерево Хаффмана

    tree_h = head->tree;
    tree_h->str[0] = 0;
    fseek(fin, 2, SEEK_SET);
    write_tree_haffman(tree_h, fout, ascii_code, code);
    if (len_last_code != 0)
        fprintf(fout, "%c", last_code);
    input_code_len(ascii_code, len_code);
    //print_text(fin, fout, ascii_code, len_code);
    fclose(fin); fclose(fout);
    return 0;
}


text:
Q: Windows authentication for react api calls I am new to this thus I want to know how to use automatic Windows login details as the credentials for React app API calls.
My backend API uses my windows credentials for successful API calls and rendering in the react app. I have hard-coded it currently for all the API calls.
I want to push my react app to production and it needs to get the user details from windows login automatically and make the API calls for the specific user.
How do I do it?
I have checked other questions but could not understand what fits my requirement.


text:
Q: git ignore folder changes but still sync I am working on an Android project that I sync with git. I imported Google and Facebook Sdks. I want the push to push the sdks so that they are shared, but not to track all the changes in the cache and such. Is there any way to do this?
Thanks

A: You need a .gitignore. You can add any number of rules to this file specifying files that git should ignore completely.
https://help.github.com/articles/ignoring-files


text:
Q: Running docker Error response from daemon: failed to create shim: OCI runtime create failed: Sysinfo:
Linux kali 5.10.0-kali7-amd64 #1 SMP Debian 5.10.28-1kali1 (2021-04-12) x86_64 GNU/Linux
Kali GNU/Linux Rolling \n \l
Docker version 20.10.5+dfsg1, build 55c4c88
pip 20.3.4 from /usr/lib/python3/dist-packages/pip (python 3.9)

Original Issue: https://github.com/mikaelkall/massrecon/issues/8
Goal: build a docker container for a python script for OSCP
Script: https://github.com/mikaelkall/massrecon
Docker file I created:
# syntax=docker/dockerfile:1
FROM python:3.6
WORKDIR /home/OS_85841/Documents/Docker/Massrecon/WorkingDirectory/
FROM kalilinux/kali-bleeding-edge:latest
RUN apt-get update
RUN apt-get install sudo git -y
RUN sudo apt install python3 -y
RUN sudo apt install python3-pip -y
RUN python3 -m pip install --user pipx
RUN python3 -m pipx ensurepath
RUN python3 -m pip install git+https://github.com/mikaelkall/massrecon.git
COPY requirements.txt ./
RUN sudo pip install -r requirements.txt
RUN echo "Defaults  secure_path="secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin"" >> /etc/sudoers
RUN apt-get -y autoremove && apt-get -y autoclean
ENTRYPOINT [" python3 ./massrecon.py"]

Current Directory I want everything to live in:
~/Documents/Docker/Massrecon/WorkingDirectory
Files that live in that directory:
1.) requriements.txt
2.) Dockerfile
Content of Requirements.txt:
halo==0.0.28
Paver==1.3.4
configparser==3.5.0
pyOpenSSL==18.0.0
nose==1.3.7
rednose==1.3.0
unittest2==1.1.0
requests==2.20.0
python-docx==0.8.10

Command I used to build Docker container:  sudo docker build -t massrecon .
Sending build context to Docker daemon   5.12kB
Step 1/15 : FROM python:3.6
 ---> 2a09b9410ba8
Step 2/15 : WORKDIR /home/OS_85841/Documents/Docker/Massrecon/WorkingDirectory/
 ---> Running in e4f72f83a82e
Removing intermediate container e4f72f83a82e
 ---> 4d3e8a9971fe
Step 3/15 : FROM kalilinux/kali-bleeding-edge:latest
 ---> 9fe128f7cb87
Step 4/15 : RUN apt-get update
 ---> Using cache
 ---> cc5ab43b0f42
Step 5/15 : RUN apt-get install sudo git -y
 ---> Using cache
 ---> ee0e8a6876b3
Step 6/15 : RUN sudo apt install python3 -y
 ---> Using cache
 ---> cde935480a5d
Step 7/15 : RUN sudo apt install python3-pip -y
 ---> Using cache
 ---> ed1056603545
Step 8/15 : RUN python3 -m pip install --user pipx
 ---> Using cache
 ---> dc562ca617b6
Step 9/15 : RUN python3 -m pipx ensurepath
 ---> Using cache
 ---> f7f5475a0310
Step 10/15 : RUN python3 -m pip install git+https://github.com/mikaelkall/massrecon.git
 ---> Running in fc9c4b4bc962
Collecting git+https://github.com/mikaelkall/massrecon.git
  Cloning https://github.com/mikaelkall/massrecon.git to /tmp/pip-req-build-9fzzjoyg
  Running command git clone -q https://github.com/mikaelkall/massrecon.git /tmp/pip-req-build-9fzzjoyg
Collecting Paver==1.3.4
  Using cached Paver-1.3.4-py2.py3-none-any.whl (428 kB)
Collecting configparser==3.5.0
  Using cached configparser-3.5.0-py3-none-any.whl
Collecting halo==0.0.28
  Using cached halo-0.0.28-py3-none-any.whl (10 kB)
Collecting nose==1.3.7
  Using cached nose-1.3.7-py3-none-any.whl (154 kB)
Collecting pyOpenSSL==18.0.0
  Using cached pyOpenSSL-18.0.0-py2.py3-none-any.whl (53 kB)
Collecting python-docx==0.8.10
  Using cached python_docx-0.8.10-py3-none-any.whl
Collecting rednose==1.3.0
  Using cached rednose-1.3.0-py3-none-any.whl
Collecting requests==2.20.0
  Using cached requests-2.20.0-py2.py3-none-any.whl (60 kB)
Collecting unittest2==1.1.0
  Using cached unittest2-1.1.0-py2.py3-none-any.whl (96 kB)
Collecting six>=1.12.0
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting cursor>=1.2.0
  Using cached cursor-1.3.4-py3-none-any.whl
Collecting colorama>=0.3.9
  Using cached colorama-0.4.4-py2.py3-none-any.whl (16 kB)
Collecting log-symbols>=0.0.13
  Using cached log_symbols-0.0.14-py3-none-any.whl (3.1 kB)
Collecting termcolor>=1.1.0
  Using cached termcolor-1.1.0-py3-none-any.whl
Collecting spinners>=0.0.23
  Using cached spinners-0.0.24-py3-none-any.whl (5.5 kB)
Collecting cryptography>=2.2.1
  Using cached cryptography-3.4.8-cp36-abi3-manylinux_2_24_x86_64.whl (3.0 MB)
Collecting lxml>=2.3.2
  Using cached lxml-4.6.3-cp39-cp39-manylinux2014_x86_64.whl (6.9 MB)
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from rednose==1.3.0->massrecon==1.0.3) (52.0.0)
Collecting termstyle>=0.1.7
  Using cached termstyle-0.1.11-py3-none-any.whl
Collecting certifi>=2017.4.17
  Using cached certifi-2021.5.30-py2.py3-none-any.whl (145 kB)
Collecting chardet<3.1.0,>=3.0.2
  Using cached chardet-3.0.4-py2.py3-none-any.whl (133 kB)
Collecting urllib3<1.25,>=1.21.1
  Using cached urllib3-1.24.3-py2.py3-none-any.whl (118 kB)
Collecting idna<2.8,>=2.5
  Using cached idna-2.7-py2.py3-none-any.whl (58 kB)
Collecting traceback2
  Using cached traceback2-1.4.0-py2.py3-none-any.whl (16 kB)
Collecting argparse
  Using cached argparse-1.4.0-py2.py3-none-any.whl (23 kB)
Collecting cffi>=1.12
  Using cached cffi-1.14.6-cp39-cp39-manylinux1_x86_64.whl (405 kB)
Collecting pycparser
  Using cached pycparser-2.20-py2.py3-none-any.whl (112 kB)
Collecting linecache2
  Using cached linecache2-1.0.0-py2.py3-none-any.whl (12 kB)
Building wheels for collected packages: massrecon
  Building wheel for massrecon (setup.py): started
  Building wheel for massrecon (setup.py): finished with status 'done'
  Created wheel for massrecon: filename=massrecon-1.0.3-py3-none-any.whl size=20135 sha256=b516977f30f3367cb0b2f52e74d715c3c1d28e903eb9e381b17feed6bba6b54f
  Stored in directory: /tmp/pip-ephem-wheel-cache-dne9snhi/wheels/26/a8/5b/60ce79b41d0a0f80e52e165cbe9b5efbf09e32bf70cf96f173
Successfully built massrecon
Installing collected packages: pycparser, linecache2, colorama, cffi, urllib3, traceback2, termstyle, termcolor, spinners, six, lxml, log-symbols, idna, cursor, cryptography, chardet, certifi, argparse, unittest2, requests, rednose, python-docx, pyOpenSSL, Paver, nose, halo, configparser, massrecon
Successfully installed Paver-1.3.4 argparse-1.4.0 certifi-2021.5.30 cffi-1.14.6 chardet-3.0.4 colorama-0.4.4 configparser-3.5.0 cryptography-3.4.8 cursor-1.3.4 halo-0.0.28 idna-2.7 linecache2-1.0.0 log-symbols-0.0.14 lxml-4.6.3 massrecon-1.0.3 nose-1.3.7 pyOpenSSL-18.0.0 pycparser-2.20 python-docx-0.8.10 rednose-1.3.0 requests-2.20.0 six-1.16.0 spinners-0.0.24 termcolor-1.1.0 termstyle-0.1.11 traceback2-1.4.0 unittest2-1.1.0 urllib3-1.24.3
Removing intermediate container fc9c4b4bc962
 ---> 7eb12bac1208
Step 11/15 : COPY requirements.txt ./
 ---> addff8c7c79c
Step 12/15 : RUN sudo pip install -r requirements.txt
 ---> Running in eaec3c0f6c60
Requirement already satisfied: halo==0.0.28 in /usr/local/lib/python3.9/dist-packages (from -r requirements.txt (line 1)) (0.0.28)
Requirement already satisfied: Paver==1.3.4 in /usr/local/lib/python3.9/dist-packages (from -r requirements.txt (line 2)) (1.3.4)
Requirement already satisfied: configparser==3.5.0 in /usr/local/lib/python3.9/dist-packages (from -r requirements.txt (line 3)) (3.5.0)
Requirement already satisfied: pyOpenSSL==18.0.0 in /usr/local/lib/python3.9/dist-packages (from -r requirements.txt (line 4)) (18.0.0)
Requirement already satisfied: nose==1.3.7 in /usr/local/lib/python3.9/dist-packages (from -r requirements.txt (line 5)) (1.3.7)
Requirement already satisfied: rednose==1.3.0 in /usr/local/lib/python3.9/dist-packages (from -r requirements.txt (line 6)) (1.3.0)
Requirement already satisfied: unittest2==1.1.0 in /usr/local/lib/python3.9/dist-packages (from -r requirements.txt (line 7)) (1.1.0)
Requirement already satisfied: requests==2.20.0 in /usr/local/lib/python3.9/dist-packages (from -r requirements.txt (line 8)) (2.20.0)
Requirement already satisfied: python-docx==0.8.10 in /usr/local/lib/python3.9/dist-packages (from -r requirements.txt (line 9)) (0.8.10)
Requirement already satisfied: log-symbols>=0.0.13 in /usr/local/lib/python3.9/dist-packages (from halo==0.0.28->-r requirements.txt (line 1)) (0.0.14)
Requirement already satisfied: colorama>=0.3.9 in /usr/local/lib/python3.9/dist-packages (from halo==0.0.28->-r requirements.txt (line 1)) (0.4.4)
Requirement already satisfied: six>=1.12.0 in /usr/local/lib/python3.9/dist-packages (from halo==0.0.28->-r requirements.txt (line 1)) (1.16.0)
Requirement already satisfied: spinners>=0.0.23 in /usr/local/lib/python3.9/dist-packages (from halo==0.0.28->-r requirements.txt (line 1)) (0.0.24)
Requirement already satisfied: cursor>=1.2.0 in /usr/local/lib/python3.9/dist-packages (from halo==0.0.28->-r requirements.txt (line 1)) (1.3.4)
Requirement already satisfied: termcolor>=1.1.0 in /usr/local/lib/python3.9/dist-packages (from halo==0.0.28->-r requirements.txt (line 1)) (1.1.0)
Requirement already satisfied: cryptography>=2.2.1 in /usr/local/lib/python3.9/dist-packages (from pyOpenSSL==18.0.0->-r requirements.txt (line 4)) (3.4.8)
Requirement already satisfied: lxml>=2.3.2 in /usr/local/lib/python3.9/dist-packages (from python-docx==0.8.10->-r requirements.txt (line 9)) (4.6.3)
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from rednose==1.3.0->-r requirements.txt (line 6)) (52.0.0)
Requirement already satisfied: termstyle>=0.1.7 in /usr/local/lib/python3.9/dist-packages (from rednose==1.3.0->-r requirements.txt (line 6)) (0.1.11)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.9/dist-packages (from requests==2.20.0->-r requirements.txt (line 8)) (3.0.4)
Requirement already satisfied: urllib3<1.25,>=1.21.1 in /usr/local/lib/python3.9/dist-packages (from requests==2.20.0->-r requirements.txt (line 8)) (1.24.3)
Requirement already satisfied: idna<2.8,>=2.5 in /usr/local/lib/python3.9/dist-packages (from requests==2.20.0->-r requirements.txt (line 8)) (2.7)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/dist-packages (from requests==2.20.0->-r requirements.txt (line 8)) (2021.5.30)
Requirement already satisfied: traceback2 in /usr/local/lib/python3.9/dist-packages (from unittest2==1.1.0->-r requirements.txt (line 7)) (1.4.0)
Collecting argparse
  Using cached argparse-1.4.0-py2.py3-none-any.whl (23 kB)
Requirement already satisfied: cffi>=1.12 in /usr/local/lib/python3.9/dist-packages (from cryptography>=2.2.1->pyOpenSSL==18.0.0->-r requirements.txt (line 4)) (1.14.6)
Requirement already satisfied: pycparser in /usr/local/lib/python3.9/dist-packages (from cffi>=1.12->cryptography>=2.2.1->pyOpenSSL==18.0.0->-r requirements.txt (line 4)) (2.20)
Requirement already satisfied: linecache2 in /usr/local/lib/python3.9/dist-packages (from traceback2->unittest2==1.1.0->-r requirements.txt (line 7)) (1.0.0)
Installing collected packages: argparse
Successfully installed argparse-1.4.0
Removing intermediate container eaec3c0f6c60
 ---> b56953b24882
Step 13/15 : RUN echo "Defaults secure_path="secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin"" >> /etc/sudoers
 ---> Running in 8a7d20914f71
Removing intermediate container 8a7d20914f71
 ---> 6559ac49b7d4
Step 14/15 : RUN apt-get -y autoremove && apt-get -y autoclean
 ---> Running in d6ade106f0d1
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 22 not upgraded.
Reading package lists...
Building dependency tree...
Reading state information...
Removing intermediate container d6ade106f0d1
 ---> c71f26801d05
Step 15/15 : ENTRYPOINT [" python3 ./massrecon.py"]
 ---> Running in d0e9cb3eb573
Removing intermediate container d0e9cb3eb573
 ---> cf5be7ae27be
Successfully built cf5be7ae27be
Successfully tagged massrecon:latest

Command Used to verify docker container:  sudo docker images
REPOSITORY                     TAG       IMAGE ID       CREATED         SIZE
massrecon                      latest    cf5be7ae27be   5 minutes ago   647MB
<none>                         <none>    4d3e8a9971fe   6 minutes ago   902MB
tib3rius/autorecon             latest    9d6f0dd1ce7e   11 hours ago    3.22GB
python                         3.6       2a09b9410ba8   5 days ago      902MB
kalilinux/kali-bleeding-edge   latest    9fe128f7cb87   2 weeks ago     125MB

Command used to run docker container: sudo docker run -it  massrecon
docker: Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: " python3 ./massrecon.py": stat  python3 ./massrecon.py: no such file or directory: unknown.

I been working on this for a few days, my last option is to try out the knowledge base of all IT knowledge stack overflow, All I want to do is create a docker container consisting of the massrecon.py and all the files and dependcies it needs to work fully, any help would be apricated and thanks for taking the time to look


text:
Q: Custom ToString Extension not working - VB.NET I have the following code
Module StringExtensions

<Extension()>
Public Function ToString(ByVal e As Elements) As String
    Return e(0).ToString()
End Function

<Extension()>
Public Function ToString(ByVal e As List(Of Element)) As String
    e.ToString("|")
End Function

<Extension()>
Public Function ToString(ByVal e As List(Of Element), ByVal delim As String = "|") As String
    Dim s As String = ""
    For Each e1 As Element In e
        s = String.Join(delim, s, IIf(e1.Terminal, "!", "") & e1.Name)
    Next e1
    Return s.TrimStart(delim).TrimEnd(delim)
End Function

End Module

Class Elements
Inherits List(Of Element)
'...Various properties and methods
End Class
Class Element
'...Various Properties and methods
End Class

My Question:
For some reason only the ToString extension with the delim variable can be called.
VS2010 wont even show that there are any other ones.
I have tried having only one of the two ToString's with no variable inputs
Why is this?
I am using a similar setup with a different class and this works fine.
As far as I know I haven't done anything wrong syntax wise.

A: Every class in .NET inherits ToString() from the root base class object. Extension methods that have the exact same signature as member methods aren't shown and can't be called using the extension methods syntax.


text:
Q: Splitting and adding the numbers All the natural numbers from $1$ to $100$ are written adjacent to each other in a single row. Now, this is considered as a single number, $N$ with $192$ digits.
$N$ is then broken into two parts each part being considered to be a new number, by placing a single partition between any two consecutive digits of $N$ and the two numbers so obtained are added to form a new number $N1$.
Now, $N1$ is broken into two parts in a manner similar to that followed above for $N$ and the two numbers thus arrived at are again added to form another new number $N2$. This process is continued to arrive at $N3$, $N4$.... and so on till we finally get a single digit number $Nm$.
What is the value of $Nm$?

A: First of all, as suggested by the comment of астон вілла тереса лисбон, the problem would probably not have been posed if there was not a unique answer.
Hint: if you apply the rule of "casting out 9's", what will the final digit be, modulo 9?  If you can prove that it must be 0 mod 9, is that conclusive?
Addendum
It just occurred to me; suppose that casting out 9's indicates that the final digit is not congruent to 0 modulo 9.  For example, suppose that the final digit must be congruent to 5 modulo 9.  Would you then (still) be able to determine a unique answer?


text:
Q: How do I perform a Search Query to pull out results as Verified Twitter Accounts?
I want to use the Twitter API on my website to provide links to
  Verified Individual/Organization Twitter Profile on entering a search
  query on my website.

Suppose, I enter "Rihanna",
then how do I pull and display the verified profile link of Rihanna as a result?
P.S.: A similar question with entirely different context was asked, and inadequately answered. Please do not mark as duplicate of that question.


text:
Q: Calculating sums of squares for mixed-model ANOVA I'm trying to get an understanding of how to calculate the sums of squares values in a mixed-model ANOVA (mathematically, not just the syntax for R or SPSS!). I've been trying to figure this out for a long time, but can never seem to find a suitably straightforward explanation of it.
To make things concrete, let's say we have the following (completely fabricated) dataset that I want to run a mixed-model ANOVA on:

before and after are measures of some dependent variable before and after a treatment, and condition is a between-subjects variable specifying the nature of that treatment. How would I go about calculating the sums of squares values for this data? Furthermore, how would I go about calculating F statistics for each factor in the analysis?
Bonus points if you can explain to me how this all relates to linear mixed-effects models or multilevel modelling. I've tried to understand ANOVA in terms of regression, but have become quite lost in doing so.

A: Essentially how it works is that you have the treatment effects, and to get those you take the factor level mean and subtract the sum of the effects of all outside factors
Treatment = factor level mean - sum(effects of outside factors)
For example if you were doing a BF1 and wanted to see the treatment effect of the first variable you would take the grand mean and subtract it from the mean one of the levels of the variable.
To solve for the Sum of Squares, you simply take that treatment effect for all observations (the treatment effect should be equal across all observations for that specific treatment), and you sum the squares. In other words it would be
sum((treatment effect)^2)
To solve for F-statistic you first need to solve for the mean of the squares which is the SS/df or the sum of squares divided by the degrees of freedom, to which you can then solve for the F-statistic which is in most cases the mean of squares of the variable you are testing/mean of squares of the residuals
MS(Variable)/MS(Residuals) = F-Stat
There are a few cases where that is not true, but I do not believe this to be one of these cases.
I would rearrange your data to be in long format and you can easily do the manual but not so manual calculations in excel.
Something like this


text:
Q: PayPal response to PDT POST-back I have been studying the PayPal documentation on Payment Data Transfer (PDT). I am confused on one point in particular:
After I send back the POST containing the transaction ID and PDT token, the documentation says PayPal send back a response and the first line of this response id either SUCCESS or FAIL. What is confusing me is
a) what URL is that response sent to (I assume it is the same URL the original GET response is sent to) and
b) in what form is this response sent to me? Is it GET or POST or something else?
Also, is there someplace I can find example code in PHP for this sequence of transactions?
For reference, the PayPal document I'm looking at is:
https://developer.paypal.com/webapps/developer/docs/classic/paypal-payments-standard/integration-guide/paymentdatatransfer/
Thanks for your help,
Ken

A: You probably already figured this one out by now, but it might help others.
a) Your assumption is correct. Usually, you would build your POST request to Paypal using Curl, and analyse the response in the same script.
b) It's POST, in my opinion, you will just get in in the Curl response.

Also, is there someplace I can find example code in PHP for this sequence of transactions?

Yes, PDT code samples here: https://github.com/paypal/pdt-code-samples
IPN code samples here: https://github.com/paypal/ipn-code-samples


text:
Q: Knockout js registerEvent handler I'm having a great time playing around with knockout js and have just started to get to grips with adding custom bindingHandlers.
I'm struggling a bit with the update function of a 3rd party jqWidget gauge - I can only get it to animate the first time I update the variable. On each update after that it just sets the value directly.
I don't fully understand ko.utils.registerEventHandler() and what it does although I've seen it in a bunch of other examples. Is this what is causing the animation to break? How do I know which events to register from the 3rd party widget?
For some reason this works fine if I add a jquery ui slider that is also bound to the observable.
You can test this here: set the value a few times to see that it animates the first time and not after that.
http://jsfiddle.net/LkqTU/4531/

A: When you update the input field, your observable will end up being a string.  It looks like the gauge does not like to be updated with a string value, at least after the first time.
So, if you ensure that you are updating it with a number (parseInt, parseFloat, or just + depending on the situation), then it appears to update fine.
Something like:
update: function(element, valueAccessor) {
    var gaugeval = parseInt(ko.utils.unwrapObservable(valueAccessor()), 10);
    $(element).jqxGauge('value', gaugeval || 0);
}

http://jsfiddle.net/rniemeyer/LkqTU/4532/
You would generally only register event handlers in a scenario like this to react to changes made by a user where you would want to update your view model data.  For example, if there was a way for a user to click on the gauge to change the value, then you would want to handle that event and update your view model value accordingly.

A: I'm answering the

I don't fully understand ko.utils.registerEventHandler() and what it does

part of your question.
registerEventHandler will register your event handler function in a cross-browser compatible way. If you are using jQuery, Knockout will use jQuery's bind function to register the event handler. Otherwise, will use the browser Web API with a consistent behavior across browsers.
You can check it out on the source code.


text:
Q: Ruby scan anonymous function explanation I new to Ruby and struggling to understand what is going on in this bit of code I wrote.  Why do I have to declare two variables |x,y| to get the output I am expecting?  I am only using x and y always appears to be nil.  But when I change to |x|, my word count is always 0 (see code and output below).  Thanks for any insight you may be able to provide.
def count_words(string)
  string.downcase!

  wordhash = Hash.new

  # what is going on here?
  # Why do I have to have two
  # variables in the scan block?
  string.scan(/(\b\w+\b)/){|x,y|
    wordhash.store(x,string.scan(/\b#{x}\b/).length)}

  return wordhash
end

puts count_words("Hello there.  This is bob bob bob")

# Correct Output with |x,y|:
# {"hello"=>1, "there"=>1, "this"=>1, "is"=>1, "bob"=>3}

# Incorrect Output with |x|:
# {["hello"]=>0, ["there"]=>0, ["this"]=>0, ["is"]=>0, ["bob"]=>0}

A: From the String#scan documentation:

If the pattern contains groups, each individual result is itself an
  array containing one entry per group.

Since your pattern contains a group, the first block argument is an array. If you use |x, y| you destructure the array and assign its first element to x.
By the way, for getting a hash of word counts, you can just do this:
s = "this is a test string it is"
Hash[s.split.group_by{ |e| e }.map { |k,v| [k, v.size] }]
#=> {"this"=>1, "is"=>2, "a"=>1, "test"=>1, "string"=>1, "it"=>1}

A: The other answer correctly explains why this doesn't work as expected. Let me try to point out some more problems with your code:

*

*string.downcase! modifies the argument given to the function, which is extremely bad style

*/(\b\w+\b)/ you don't need an additional match group here, simply use /\b\w+\b/. This will allow you to just use scan(...) do |x|, where x will be the matched word

*wordhash.store(x,y) can simply be written as wordhash[x] = y

*string.scan(/\b#{x}\b/).length you scan the string a second time, although that is not necessary. Instead, you can just increment a counter for every match of a given word.

Example:
def count_words(string)
  # set up a hash that accumulates the number of occurrences per word
  wordcount = Hash.new(0)
  string.downcase.scan(/\b\w+\b/) { |word| wordcount[word] += 1 }
  # no need to use return here, the function already evaluates to the last
  # value
  wordcount
end

p count_words("Hello there.  This is bob bob bob")
# => {"hello"=>1, "there"=>1, "this"=>1, "is"=>1, "bob"=>3}

This is just to demonstrate how your approach could be made working, in Ruby you'd probably solve this in a more functional way, preferrably using group_by, as Michael already demonstrated or using inject:
string.downcase.split.inject(Hash.new(0)) { |h,word| h[word] += 1; h }


text:
Q: EXCEL: Extract text in string NOT between 2 characters I need to extract JUST THE PERSONS NAME from the string below.  What function would I use in Excel?
Example:
Jane Doe <email@email.com>

Any help would be greatly appreciated!

A: Based on what you had for sample data before, the LEFT function combined with the FIND function will do what you need. Something like
=LEFT(A1, FIND("<",A1,1)-2)

Breaking down what this does from the inside out:
FIND("<",A1,1)-2)

This tells it to find the first instance of the "<" character in the specified cell (A1), starting from and including the first character. It will return the position of that character. So with the text it's looking in being Jane Doe <email@email.com> it would return 10, substracting 2 to say we don't want that actual character and we don't want the space before it.
So with that in mind our formula looks like:
=LEFT(A1, 8)

Which means get 8 characters, starting from the leftmost character, from the specified cell (A1). Resulting in Jane Doe
Hope this helps :)

A: Try this instead:
=LEFT(F3,FIND(" <",F3))

=FIND(" <",F3)

This will find the first instance of the character " <" in the text.
After that our formula will look like this:

=LEFT(F3.9)

which means we'll get 9 characters left and this will return:
Jane Doe


text:
Q: blueimp jQuery file upload new files order i'm trying to find place inside blueimp file upload scripts to change the behavior of new files position in the table. How to force them to by added at the top of the table insted of the end of files list?

A: Just add the property prependFiles:true
Example:
$('.fileupload').fileupload({
    url: 'your_url',
    dataType: 'json',
    prependFiles:true
});

A: I did it by overwriting the event listener for fileuploaddone and adding prepend instead of append.
It look like this
$('.fileupload').fileupload({
        url: 'phpUpload/index.php?customDir='+saveFolder,
        dataType: 'json',
        dropZone: $(this),
        autoUpload: true,
        acceptFileTypes: /(\.|\/)(gif|jpe?g|png|pdf|mp3|mp4|wav|doc|docx|ppt)$/i,
        maxFileSize: 150000000, // 150 MB
        // Enable image resizing, except for Android and Opera,
        // which actually support image resizing, but fail to
        // send Blob objects via XHR requests:
        disableImageResize: /Android(?!.*Chrome)|Opera/
            .test(window.navigator.userAgent),
        previewMaxWidth: 100,
        previewMaxHeight: 100,
        previewCrop: true
    }).on('fileuploadadd', function (e, data) {
        // you can leave this out if you want the default design
        data.context = $('<div/>').addClass('existingMediaFile');
        $.each(data.files, function (index, file) {
            var node = $('<a/>').append($('<span/>').text(file.name));
            node.appendTo(data.context);
        });

    }).on('fileuploaddone', function (e, data) {
        $.each(data.result.files, function (index, file) {
            $(data.context.children()[index]).prepend(file.name+' '+file.thumbnailUrl);
        });
    })


text:
Q: Magento 2.4 Track this shipment link error on open Popup I was trying to implement a custom shipping label programmatically but I'm getting error below:
Error: Call to undefined method Magento\Framework\Phrase::getTracking()....

I am using \Magento\Sales\Api\Data\ShipmentTrackInterfaceFactory to create tracking and my custom carrier is extending AbstractCarrier.
Everything seems to work fine except for the links that open the pop up. Links are:

Track this shipment and
Track order

both under Shipping & Handling Information and Shipping and Tracking Information.
Update: I found this on github upon googling but I don't think the solution will work for me as this is a custom module.

A: In your custom module's Carrier Model you need to add a function getTrackingInfo
location of the file would be something like this:
app/code/Vendor/Module/Model/Carrier/YourFile.php

In this file add a the function
public function getTrackingInfo($trackings)
{
    $result = $this->_trackFactory->create();
    $tracking = $this->_trackStatusFactory->create();

    $tracking->setCarrier($this->_code);
    $tracking->setCarrierTitle("Carreir Title");
    $tracking->setTracking($trackings);
    $tracking->setUrl('http://www.example.com/?cn=' . $trackings); //This is tracking URL

    $result->append($tracking);

    return $tracking;
}

where $this->_trackFactory is the instance of \Magento\Shipping\Model\Tracking\ResultFactory
and $this->_trackStatusFactory is the instance of \Magento\Shipping\Model\Tracking\Result\StatusFactory
This should resolve the error that you are facing


text:
Q: Time-efficient methods for computing a Hessian by hand I am preparing for exam and one of the past exam questions requires showing that the Hessian of $g(\lambda)$, given that
$$\begin{align}
\nabla g(\lambda) &= b - A^T x \\
x_i &= p_i \exp(e_i^T A \lambda - 1)
\end{align}$$
is $$\nabla^2 g(\lambda) = -A^T X A$$
where $X_{ii} = x_i$ and its nondiagonal elements are $0$, and $e_i$ has $1$ for the $i$th element and $0$s elsewhere. Considering the time constraints, I need to be able to do this in about 5 or 10 minutes.
Doing the computation accurately requires paying very close attention to the indices, taking cases for the diagonal and nondiagonal elements of the Hessian, and showing that the Hessian can be factored as indicated. I can do this, but it took me about half an hour the first time, and I am curious if there is a test-taking strategy I can use to get faster at solving these sorts of problems.
If memorizing the derivation is not an option, what is the most time-efficient way to compute a complicated Hessian by hand?
Please note that my question is not about the particulars of this exam question. I want to know general strategies for organizing my thinking on paper. In fact, I would really appreciate seeing handwritten examples of solving this sort of problem rather than Mathjax.


text:
Q: How to add Custom Template in Telerik MVC combobox? Is there a way to add custom template inside Telerik MVC Combobox.?
I have a need to add checkboxes and images for each options inside combobox.
Telerik have this feature for Rad control for combobox.
How to do it in MVC control?
Thanks in advance.

A: I think this is not possible now with Telerik MVC extensions but it is with KendoUI. Since the next release of KendoUI will include MVC extensions you may want to check it that works for you


text:
Q: Jenkins node property 'usage' and how to update with python I have looked many places for how to set the usage property in jenkins using python. I looked at the create_node but there is no parameter for the usage or that I have found. I also looked at reconfig_node but looking at the current xml I didn't see a usage field in the xml to be updated for usage. So not sure how to update or create nodes where I can set the usage property.
I know how to set this manually but I currently have a python script to create the node but the usage is always set to 'Use this node as much as possible'.
So I'm looking for a way to set the usage for a node when creating a node or just update after it is created.

A: In the config.xml, the usage is stored using the <mode></mode> tags. The two usage modes are:

*

*NORMAL - "Use this node as much as possible"

*EXCLUSIVE - "Only build jobs with label expressions matching this node"

For the Jenkins python API create_node method, I think you need to look at the exclusive parameter:

*

*exclusive=False - NORMAL - "Use this node as much as possible"

*exclusive=True - EXCLUSIVE - "Only build jobs with label expressions matching this node"


text:
Q: I cannot use HTTP/net on my dev machine Here is the code I am running in my rails console
http = Net::HTTP.new("http://google.fr",80)
req = Net::HTTP::Post.new("/stupid/url/")
res = http.request(req)

It makes the following error :
SocketError: Failed to open TCP connection to http://google.fr:80
(getaddrinfo: Name or service not known)

I have the same kind of error in my rails app when I try to query an API. From the same computer I can browse google. Why is it not working ?
EDIT : Same error in IRB with a require "net/http"

A: Docs says that the address should be hostname or IP address. You are adding protocol. Or you can use URI class.
Working example (returning 404):
http = Net::HTTP.new("google.fr",80)
req = Net::HTTP::Post.new("/stupid/url/")
res = http.request(req)

Or you can try:
http = Net::HTTP.new(URI("http://google.fr").host)
req = Net::HTTP::Post.new("/stupid/url/")
res = http.request(req)


text:
Q: Java (Spring Boot) - IllegalStateException: Unable to load cache item We have a rather complex Spring Boot project and it works fine on Windows during development. However when we run the project on Ubuntu we get a bizzare exception
LOGBACK: No context given for c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@310623126
  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.8.RELEASE)
2020-07-08 12:56:42.860  INFO 6 --- [           main] redacted.Application            : Starting Application v0.0.1-SNAPSHOT on c72273bf4d02 with PID 6 (/home/plugin/app.jar started by root in /home/plugin)
2020-07-08 12:56:42.867  INFO 6 --- [           main] redacted.Application            : The following profiles are active: default
2020-07-08 12:56:44.745  INFO 6 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2020-07-08 12:56:45.119  INFO 6 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 345ms. Found 13 JPA repository interfaces.
2020-07-08 12:56:46.089 ERROR 6 --- [           main] o.s.boot.SpringApplication               : Application run failed
java.lang.IllegalStateException: Unable to load cache item
        at org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:79) ~[spring-core-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
        at org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:34) ~[spring-core-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
        at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:134) ~[spring-core-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
        at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:319) ~[spring-core-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
        at org.springframework.cglib.proxy.Enhancer.createHelper(Enhancer.java:572) ~[spring-core-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
        at org.springframework.cglib.proxy.Enhancer.createClass(Enhancer.java:419) ~[spring-core-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
        at org.springframework.context.annotation.ConfigurationClassEnhancer.createClass(ConfigurationClassEnhancer.java:137) ~[spring-context-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
        at org.springframework.context.annotation.ConfigurationClassEnhancer.enhance(ConfigurationClassEnhancer.java:109) ~[spring-context-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
        at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:423) ~[spring-context-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
        at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:257) ~[spring-context-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
        at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:291) ~[spring-context-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
        at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:131) ~[spring-context-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:706) ~[spring-context-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) ~[spring-context-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.0.RELEASE.jar!/:2.3.0.RELEASE]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) [spring-boot-2.3.0.RELEASE.jar!/:2.3.0.RELEASE]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) [spring-boot-2.3.0.RELEASE.jar!/:2.3.0.RELEASE]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.3.0.RELEASE.jar!/:2.3.0.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.3.0.RELEASE.jar!/:2.3.0.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) [spring-boot-2.3.0.RELEASE.jar!/:2.3.0.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.3.0.RELEASE.jar!/:2.3.0.RELEASE]
        at redacted.Application.main(Application.java:61) [classes!/:0.0.1-SNAPSHOT]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_111]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_111]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_111]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_111]
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) [redacted-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:109) [redacted-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) [redacted-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) [redacted-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
Caused by: java.lang.ExceptionInInitializerError: null
        at java.lang.Class.forName0(Native Method) ~[na:1.8.0_111]
        at java.lang.Class.forName(Class.java:348) ~[na:1.8.0_111]
        at org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:571) ~[spring-core-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
        at org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:363) ~[spring-core-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
        at org.springframework.cglib.proxy.Enhancer.generate(Enhancer.java:585) ~[spring-core-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
        at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:110) ~[spring-core-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
        at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:108) ~[spring-core-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
        at org.springframework.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54) ~[spring-core-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_111]
        at org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61) ~[spring-core-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
        ... 29 common frames omitted
Caused by: java.lang.IllegalArgumentException: null
        at java.util.concurrent.ThreadPoolExecutor.<init>(ThreadPoolExecutor.java:1307) ~[na:1.8.0_111]
        at java.util.concurrent.ThreadPoolExecutor.<init>(ThreadPoolExecutor.java:1195) ~[na:1.8.0_111]
        at java.util.concurrent.Executors.newFixedThreadPool(Executors.java:89) ~[na:1.8.0_111]
        at redacted.Config.<clinit>(Config.java:43) ~[classes!/:0.0.1-SNAPSHOT]
        ... 39 common frames omitted

On Ubuntu we are using OpenJDK 11. It works on Windows with the same JDK, but it doesn't on Ubuntu. We also tried to run the project in a new Windows Sandbox instance and it worked flawlessly.

A: Am not sure, but i think the problem caused by spring-core dependency. Can you try to remove spring-core dependency from pom.xml file and try to run it again.

A: The issue was caused by trying to create a thread pool with 0 threads. We have a development VPS with 1 thread and we had a line of code like this:
public static final Executor EXECUTOR = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() - 1);

This caused the exception. In hindsight the exception stack trace gave us an obvious clue at the bottom
at redacted.Config.<clinit>(Config.java:43)

It literally pointed to the exact line that faulted.
Another thing you should definitely do is update the apt-cache with sudo apt-get update command install the latest OpenJDK verison.

A: Check the Java version, I had the same error when I tried to run a project developed in Java 11 with Java 17.


text:
Q: Php execute page every X days/hours/minutes/seconds Basically what I need to do is to update a database every X days/hours/minutes/seconds (to be set). How can I let a PHP page execute regularly?

A: Use a CRON job.
If you are using a hosting service with cpanel there is an option to set and it can be quite straightforward.
Otherwise there are plenty of CRON tutorials on the interwebs.
Be sure that the permissions on your script are set correctly for it to be executed.

A: This feature is not provided by php, but by another program depending on your operating system (crontab in unix, scheduled tasks in windows).

A: your choices are cron (as everyone is mentioned) in unix, task scheduler in windows,
or a header in your php to check a file to see if whatever you need to happen has been processed in the last X minutes / hours / days
but the php-option is a terrible idea if cron/task scheduler is at all possible.

A: You can have for instance an HTML page reloaded every 15 seconds like this:
<META HTTP-EQUIV="refresh" CONTENT="15">

but is certainly wise to do this via cron or corresponding system tools to schedule repeated a programs.


text:
Q: content.script access file resource always error with net::ERR_BLOCKED_BY_CLIENT, disabled Adblock I'm migrating V2 to V3, but encountered some strange problems.
When extension has loaded, i fetching the resource, it will has a error: net::ERR_BLOCKED_BY_CLIENT. but it's no problem when i do it without loaded extension.
like this:
without loaded extension
with loaded extension
Extension launch up with a error:
GET chrome-extension://hbdmkhahfinoeomfcllpnpkcblpaofeh/css/style.css net::ERR_BLOCKED_BY_CLIENT

'web_accessible_resources' in content.js
var css1 = doc.createElement("link");
css1.href = chrome.runtime.getURL("css/style.css");
css1.type = "text/css";
css1.rel = "stylesheet";
doc.head.appendChild(css1);

code in manifest.json
 "web_accessible_resources" : [{
   "resources": [ "css/*", "content/*" ],
   "matches": ["<all_urls>"]
 }],

Converting the txt file to html is the main responsibility of this extension.
I have disabled Adblock Plus, and try to fix this problem pass a whole day, I really don't know what happened in this condition and how to fix it.


text:
Q: Abaqus composite ply strain extraction I'm trying to extract ply strains from a composite shell model in Abaqus. I would like to be able to export (to a .dat (preferably) or any sort of text file) every ply strain in every element.
So far I have managed to find a method to extract the ply with the max strain in each element to the .rpt file, but I would like to export all plies of every element to the .dat.
I'm doing this as a part of parametric study and need to post process later in Matlab. Any knowledge on the keywords/options to include in the .inp file would be greatly appreciated. Thanks in advance!


text:
Q: populate listview via json parsing and asynctask i want to parse from here. but i have following exception:
no values for earthquakes.

UpdateFromSite:
 public class UpdateFromSite extends Activity {
    ListView list;
    TextView name;
    TextView description;
    TextView price;
        Button Btngetdata;
        ArrayList<HashMap<String, String>> newItemlist = new ArrayList<HashMap<String, String>>();
        //URL to get JSON Array
       private static String url = "http://api.geonames.org/earthquakesJSON?north=44.1&south=-9.9&east=-22.4&west=55.2&username=demo";
        //JSON Node Names
      private static final String TAG_ITEM = "earthquakes";
    private static final String TAG_NAME = "eqid";
    private static final String TAG_DESCRIPTION = "src";
        private static final String TAG_PRICE = "magnitude";
    JSONArray earthquakes = null;

        @Override
        protected void onCreate(Bundle bundle) {
            super.onCreate(bundle);
            setContentView(R.layout.updateapp);
            newItemlist = new ArrayList<HashMap<String, String>>();
            Btngetdata = (Button)findViewById(R.id.getdata);
            Btngetdata.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    //check internet connection
                    Boolean isInternetPresent = false;
                    ConnectionDetector cd;
                    cd = new ConnectionDetector(getApplicationContext());
                    isInternetPresent = cd.isConnectingToInternet();

                    if (isInternetPresent) {
                        new JSONParse().execute();  }

                    else {
                        Toast.makeText(getApplicationContext(),"You don't have internet connection.",Toast.LENGTH_SHORT).show();
                                         }
                         }
            });
        }

        private class JSONParse extends AsyncTask<String, String, JSONObject> {

            private ProgressDialog pDialog;

            @Override
            protected void onPreExecute() {
                super.onPreExecute();

                name = (TextView)findViewById(R.id.nameNewItem);
                description = (TextView)findViewById(R.id.descriptionNewItem);
                price = (TextView)findViewById(R.id.priceNewItem);
                pDialog = new ProgressDialog(UpdateFromSite.this);
                pDialog.setMessage("Getting Data ...");
                pDialog.setIndeterminate(false);
                pDialog.setCancelable(true);
                pDialog.show();
            }
            @Override
            protected JSONObject doInBackground(String... args) {
                try {
                    JSONParser jParser = new JSONParser();
                    // Getting JSON from URL
                    JSONObject json = jParser.getJSONFromUrl(url);
                    return json;
                }   catch (Exception ex){
                    Toast.makeText(getApplicationContext(),"error",Toast.LENGTH_SHORT).show();
                    return null;
                }

            }
            @Override
            protected void onPostExecute(JSONObject json) {
                pDialog.dismiss();
                try {
                    // Getting JSON Array from URL
                    earthquakes = json.getJSONArray(TAG_ITEM);
                    for(int i = 0; i < earthquakes.length(); i++){
                        JSONObject c = earthquakes.getJSONObject(i);

                        // Storing  JSON item in a Variable
                        String name = c.getString(TAG_NAME);
                        String description = c.getString(TAG_DESCRIPTION);
                       Double price = c.getDouble(TAG_PRICE);

                        // Adding value HashMap key => value
                        HashMap<String, String> map = new HashMap<String, String>();
                        map.put(TAG_NAME, name);
                        map.put(TAG_DESCRIPTION, description);
                        map.put(TAG_PRICE, Double.toString(price));
                        newItemlist.add(map);
                        list=(ListView)findViewById(R.id.listupdate);
                        ListAdapter adapter = new SimpleAdapter(UpdateFromSite.this, newItemlist,
                                R.layout.updateapprow,
                                new String[] { TAG_NAME,TAG_DESCRIPTION, TAG_PRICE }, new int[] {
                                R.id.nameNewItem,R.id.descriptionNewItem, R.id.priceNewItem});
                        list.setAdapter(adapter);

                    }
                }

                catch (Exception e) {
                    Toast.makeText(getApplicationContext(),e.getMessage(),Toast.LENGTH_SHORT).show();
                }
            }
        }

        }

JSONParser:
 public class JSONParser {
        static InputStream is = null;
        static JSONObject jObj = null;
        static String json = "";
        // constructor
        public JSONParser() {
        }
        public JSONObject getJSONFromUrl(String url) {
            // Making HTTP request
            try {
                // defaultHttpClient
                DefaultHttpClient httpClient = new DefaultHttpClient();
                HttpPost httpPost = new HttpPost(url);
                HttpResponse httpResponse = httpClient.execute(httpPost);
                HttpEntity httpEntity = httpResponse.getEntity();
                is = httpEntity.getContent();
            } catch (UnsupportedEncodingException e) {
                e.printStackTrace();
            } catch (ClientProtocolException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            }
            try {
                BufferedReader reader = new BufferedReader(new InputStreamReader(
                        is, "iso-8859-1"), 8);
                StringBuilder sb = new StringBuilder();
                String line = null;
                while ((line = reader.readLine()) != null) {
                    sb.append(line + "\n");

                }
                is.close();
                json = sb.toString();
            } catch (Exception e) {
                Log.e("Buffer Error", "Error converting result " + e.toString());
            }
            // try parse the string to a JSON object
            try {
                jObj = new JSONObject(json);
            } catch (JSONException e) {
                Log.e("JSON Parser", "Error parsing data " + e.toString());
            }
            // return JSON String
            return jObj;
        }

    }

i think my problem is in hashmap. please help me.

A: JSON parsing part:
ArrayList<HashMap<String,String>> alist=new ArrayList<HashMap<String,String>>();
     try {
                JSONObject job = new JSONObject(jobj);
    JSONArray jArray = job.getJSONArray("earthquakes");
                JSONObject json_data = null;
                for (int i = 0; i < jArray.length(); i++) {
                    json_data = jArray.getJSONObject(i);
                    String eqid = json_data.getString("eqid");
                    String magn=json_data.getString("magnitude");
                    HashMap<String, String>map=new HashMap<String, String>();
                    map.put("eqid",eqid);
                    map.put("magnitude", magn);
                    alist.add(map);
                }

Now for populating to listview using simpleadapter be sure to create an xml layout with two textviews for the listview row:
ListView list = (ListView) findViewById(R.id.listView1);
            final SimpleAdapter sd;
            sd=new SimpleAdapter(youractivity.this,alist,R.layout.item_list,new String[]{"eqid","magnitude"},new int[]{R.id.eqid,R.id.magnitude});
            list.setAdapter(sd);

declare the arraylist<hashmap<string,string>> your_map as a global variable. do the json downloading part in the doInBackground() method and update your listview in the onPostExecute() method. This should work without any issues!


text:
Q: Amazon DynamoDB how to read populated Database in Golang? I have populated a local DynamoDB instance with some values from this JSON
[
    {
        "Id": 1,
        "Type": "fruit",
        "Name": "bananas",
        "Price": 0.25
    },
    {
        "Id": 2,
        "Type": "fruit",
        "Name": "apples",
        "Price": 0.50
    },
    {
        "Id": 3,
        "Type": "fruit",
        "Name": "avocados",
        "Price": 1.25
    },
    {
        "Id": 4,
        "Type": "vegetable",
        "Name": "carrots",
        "Price": 1.00
    } ]

And want to read, say all the items in this database. I believe Querying the database can do this, but in for my query input code I have
func main() {

    type Product struct {
        Id      int         `json:"Id"`
        Type    string      `json:"Type"`
        Name  string         `json:"Name"`
        Price float64      `json:"Price"`
    }

    config := &aws.Config{
        Region:   aws.String("us-west-2"),
        Endpoint: aws.String("http://localhost:8000"),
    }

    sess := session.Must(session.NewSession(config))

    svc := dynamodb.New(sess)

    input := &dynamodb.QueryInput{
        TableName:              aws.String("Products"),
        KeyConditions: map[string]*dynamodb.Condition{
            "Id": {
                ComparisonOperator: aws.String("EQ"),
                AttributeValueList: []*dynamodb.AttributeValue{
                    {
                        N: aws.String("1"),
                    },
                },

            },
        },

    }

    result, err := svc.Query(input)
    if err != nil {
        fmt.Println(err.Error())
        return
    }

    var products []Product
    err = dynamodbattribute.UnmarshalListOfMaps(result.Items, &products)

    // print the response data
    for _, m := range products {
        fmt.Printf("Product: '%s' (%f)\n", m.Name, m.Price)
    }
}

so far and it only outputs bananas as the since the query is trying to match id = 1 (Id is my hash primary key).
I tried to modify the keycondition to something like this instead
"Id": {
        ComparisonOperator: aws.String("BETWEEN"),
        AttributeValueList: []*dynamodb.AttributeValue{
            {
                N: aws.String("0"),
            },
            {
                N: aws.String("5"),
            },
        },
    },

in an attempt to read every item but it says "ValidationException: Query key condition not supported". Am I doing the query statement incorrectly? Or is there some better way of listing items in dynamoDB? (Like if I wanted to list everything with "Type" == "fruit" for example, then output the first 3 items in the database.


text:
Q: Add table of Content To PDF REAder i developed a app with VFR Reader a open source for pdf reader in github Reader
so i want to add a table of content with chapiter title and number of a specific page
like in this tutorial :
Tutorial
the probleme i see this tutorial and i passed more than 2 days to add this in Reader sample code but i can't do this
so if Samoan have a idea in how do this table of content in this project it's will be this verry nice to share it
thanks


text:
Q: Error when defining python class (threading) class Downloader(threading.Thread):
    def __init__(self, priority_level, output_function):
        self.IDs = self.load_IDs(priority_level)
        self.sleep_interval = self.gen_sleep(priority_level)
        self.output = output_function
        self.name = '[Downloader::%s]'%(str(priority_level))

        self.output('[Downloader] New downloader created (prio: %s)!'%(str(priority_level))

    def load_IDs(self, prio):
        filename = 'id_prio%s.data'%str(prio)
        ID_file = open(filename, 'r')
        ID_data = ID_file.read()
        ID_file.close()

        temp = open(filename, 'w')
        temp.write('\n')
        temp.close()

        IDs = [line.split(':') for line in ID_data.split('\n') if ID != '']

        return IDs

[MORE CODE...]

For some reason, I get the following error:
  File "pastebin_rip_2.py", line 40
    def load_IDs(self, prio):
      ^
SyntaxError: invalid syntax

What am I doing wrong? for a moment I considered the issue might have been the placing of init, because when I moved it to the end of the Downloader class it worked fine (which doesn't make sense?). Well, Downloader did, anyway. Instead I got a message complaining about the class after Downloader.
I really don't see what's wrong. Help?
(Entire code: http://snipt.org/xkky)

A: I think you're missing a closing paren at this line:
self.output('[Downloader] New downloader created (prio: %s)!'%(str(priority_level))


text:
Q: Joining data from 3 mysql tables (syntax) I am trying to get data from 3 tables, joining on 2 different values. I am used to Oracle, and am doing something wrong with regard to aliasing. Can someone help me with this?
SELECT r.idreservation, r.first, r.last, r.StartDay, r.NumberOfDays, g.First, g.Last, l.location
  FROM reservation r, guides g, Locations l
  WHERE r.guide = g.idguides
    AND r.location = l.idlocations
    AND r.StartDay >= dateString

Do I need single quotes around the dateString? r.StartDay is of type DATE.

A: SELECT r.idreservation, r.first,
 r.last,
 r.StartDay,
 r.NumberOfDays,
 g.First,
 g.Last,
 l.location
 FROM reservation r,
 guides g,
 Locations l
 WHERE r.guide = g.idguides AND
 r.location = l.idlocations AND
 r.StartDay >= dateString

OR
SELECT r.idreservation, r.first,
 r.last,
 r.StartDay,
 r.NumberOfDays,
 g.First,
 g.Last,
 l.location
 FROM reservation r
 INNER JOIN  guides g
 ON r.guide = g.idguides
 INNER JOIN  Locations l
 ON r.location = l.idlocations
 WHERE r.StartDay >= dateString;

A: OK, I got it: you probably only have some "quotes" issue:
"SELECT r.idreservation, "r.first, "
                         ^

and
+ "r.StartDay >= "+dateString"
                 ^

As a hint to catch those errors, you should only have even number of quotes on the same "line". Probably you will have to use simple quote to delimiter strings inside your double-quotes strings.
As a final advice, if your host program language allow that, maybe multi-line strings will be more readable that concatenation as you did. In addition that would avoid "missing space" error as you in your example (see the comments).


text:
Q: Why is my Applescript IF Loop and "Equals To" operator not working properly? I have an applescript Progress Bar Simulator and I have the user select a menu item from a list:
set gameMenuOption to choose from list simMenu with prompt "
Slot: " & item slot of gameslots & "

Mulla: $" & gameMulla & "
Assets: " & gameAssets & "
Speed: " & gameLoadSpeed & "Assets Per Second"

The prompt is basically the user's assets, money, etc. So when they select something from the menu, they can also take a look at their stats. So when they select something, it processes the input:
if gameMenuOption = "Shop" then
    set gameShopOption to choose from list simShop with prompt "Shop: "
else if gameMenuOption is equal to "Load Progress Bar" then
    --not finished yet!
else if gameMenuOption is equal to "Sell Assets" then
    set gameMulla to gameMulla + gameAssets
else
    error -128
end if

The if statement doesn't work! I have researched the syntax of an IF loop on applescript and operators and re-read my code over and over again but I don't see any errors! When the user selects an option, it just returns the -128 error that I purposely wrote but It isn't supposed to do that... I even tested it with display dialog:
--> User enters: Sell Assets
display dialog gameMenuOption
--> Returns: Sell Assets

But when I do this:
display dialog gameMenuOption = "Sell Assets"
--> Returns: False

Also, I thought I needed to convert it to a string but that didn't work:

Expected expression but found "to".
Please help me!

A: From the docs:

The choose from list command can optionally let the user choose multiple items by setting the multiple selections allowed parameter to true. For this reason, the result of the command is always a list of selected strings.

So the result will never be "Shop". It might be {"Shop"}.
Example:
set simMenu to {"Shop", "Sell Assets"}
set gameMenuOption to choose from list simMenu with prompt "Blah blah blah"
if gameMenuOption = {"Shop"} then
    display dialog "It worked" // the dialog appears
end if

Or (this is probably more usual) you could say
if item 1 of gameMenuOption = "Shop"


text:
Q: how i can pass checkbox value using href in php? I want to do multiple delete using href link, how can i done ?
This code generate given below error.
Notice: Undefined index: action in
C:\xampp\htdocs\montu\montu\multiple.php on line 32

Warning: implode() [function.implode]: Invalid arguments passed in
C:\xampp\htdocs\montu\montu\multiple.php on line 32

    <form method="post" action="<?php $_PHP_SELF ?>">

                    <input type="checkbox" name="action[]" value="1">1

                    <input type="checkbox" name="action[]" value="2">2

                    Click Me..

    </form>

<?php
    if(isset($_REQUEST['id']))
    {
        $action=implode(',',$_REQUEST['action']);//convert array value to string values
        echo $action;
    }
?>

A: Please try like this..
<?php
    if(isset($_POST['action']))
    {
        //print_r($_REQUEST);
        $action=implode(',',$_REQUEST['action']);//convert array value to string values
        echo $action;
    }
?>

    <form name="frm" id="frm" method="post">

                    <input type="checkbox" name="action[]" value="1">1

                    <input type="checkbox" name="action[]" value="2">2

                    Click Me..

    </form>


text:
Q: EAR classloader doesn't see ApplicationInsights.xml located in jar I have the following problem: I try to deploy the Azure telemetry configuration in jar file that is located in the war file inside main ear. Unfortunately, during server startup some errors occur as ApplicationInsights.xml cannot be found. I debugged it and I found out that it cannot be read by com.microsoft.applicationinsights.internal.config.ConfigurationFileLocator.getConfigurationFile().
There is a structure of my module:
azure
|_ src
   |_ main
         |_ java
         |     |_ mypackage
         |                |_ MicrometerRegistryConfigurationListener.java
         |_ resources
                    |_ ApplicationInsights.xml

There is MicrometerRegistryConfigurationListener.java:
@WebListener
public class MicrometerRegistryConfigurationListener implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent servletContextEvent) {
        MeterRegistry azureMeterRegistry = new AzureMonitorMeterRegistry(new AzureMonitorConfig() {
            @Override
            public String get(String key) {
                return null;
            }

            @Override
            public Duration step() {
                return Duration.ofSeconds(5);
            }
        }, Clock.SYSTEM);

        new JvmThreadMetrics().bindTo(azureMeterRegistry);
        new JvmMemoryMetrics().bindTo(azureMeterRegistry);
        new JvmGcMetrics().bindTo(azureMeterRegistry);

        servletContextEvent.getServletContext().setAttribute("AzureMonitorMeterRegistry", azureMeterRegistry);
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {

    }
}

And there is a structure of ear:
ear
  |_ war
       |_ WEB-INF/lib
                    |_ azure.jar
                               |_ ApplicationInsights.xml

Of course, azure.jar contains also classes, i.a. MicrometerRegistryConfigurationListener.
What is going on? Why ApplicationInsights.xml is not visible?

A: Cause jar is a file, it's not a folder. The loader tries to access a file system path, but it can not access a path in your JAR. So you could use the resource.getInputStream() method to retrieve it as a InputStream. You could get details from this doc:Java: Load file from classpath in Spring Boot.
Example code:
public class EnvResolver {
private ResourceLoader resourceLoader;
public EnvResolver(){
    resourceLoader = new DefaultResourceLoader();
}
public List GetEnvConfig() throws IOException {
    Yaml yaml = new Yaml();
    Resource resource = resourceLoader.getResource("classpath:test-environment.yml");
    System.out.println("FileName: " + resource.getFilename());
    InputStream inputStream = resource.getInputStream();
    Map<String, Map<String, String>> result = yaml.load(inputStream);
    List<TestEnvVo> envList = new ArrayList<>();
    for (String key : result.keySet()) {
        TestEnvVo testEnvVo = new TestEnvVo();
        testEnvVo.setEnvName(result.get(key).get("name"));
        testEnvVo.setDomain(result.get(key).get("domain"));
        envList.add(testEnvVo);
    }
    inputStream.close();
    return envList;
}
}

After searching, I found another way to configure it, in your POM file add the resources configuration. You could have a try.
<resources>
    <resource>
        <directory>src/main/resource</directory>
        <includes>
            <include>**/*.properties</include>
            <include>**/*.xml</include>
            <include>**/*.tld</include>
        </includes>
        <filtering>false</filtering>
    </resource>
</resources>

Hope this could help you.
UPDATE:
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;

public class Hello {

    public static void main(String[] args) throws IOException {
        InputStream resourceInputStream = null;
        URL resourceURL = Hello.class.getClassLoader().getResource("resources/hello.json");
        if(resourceURL == null) {
            System.out.println("Get the InputStream of file in IDE");
            resourceInputStream = new FileInputStream(Hello.class.getClassLoader().getResource("").getPath()+"../../src/main/resources/hello.json");
        } else {
            System.out.println("Get the InputStream of file from runnable jar");
            resourceInputStream = Hello.class.getClassLoader().getResourceAsStream("resources/hello.json");
        }
        System.out.println();
        StringBuilder builder = new StringBuilder();
        BufferedReader br = new BufferedReader(new InputStreamReader(resourceInputStream));
        String line = null;
        while((line = br.readLine()) != null) {
            builder.append(line+"\n");
        }
        br.close();
        System.out.println(builder.toString());
    }
    }


text:
Q: How to remove the '.' after the organization's name as an author? (apacitex) How to remove the '.' after the organization's name as an author, i.e. 'NTIA (2010)' instead of 'NTIA. (2010), but keeping the dot when referencing real people, e.g., Nassri, A. (2015)?
I am using the following two reference entries with apacitex:
@MISC{haradopters:2015,
  author = {Nassri, Ahmad},
  title = {{HAR} Resources: {A} community curated list of resources, tools, projects and applications that support {HTTP Archive (HAR)}.},
  year = {2015},
  howpublished={[Github]},
  url={https://github.com/ahmadnassri/har},
  urldate={28 June 2015}
}

@MISC{ntia:2010,
  author = {{NTIA}},
  title = {Commercial Data Privacy and Innovation in the Internet Economy: {A} Dynamic Policy Framework.},
  howpublished={{IPTF Privacy Green Paper}},
    year = {2010},
  publisher={{National Telecommunications and Information Administration (NTIA)}},
  address={Washington, DC}
}

which give me the following bibliographic entries

Nassri, A. (2015). HAR resources: A community curated list of re-
   sources, tools, projects and applications that support HTTP Archive
   (HAR). [Github]. Retrieved 28 June 2015, from https://
   github.com/ahmadnassri/har
NTIA. (2010). Commercial data privacy and innovation in the internet
   economy: A dynamic policy framework. IPTF Privacy Green Paper.
   Washington, DC: National Telecommunications and Informa-
   tion Administration (NTIA).

However, I would like to see:

Nassri, A. (2015). HAR resources: A community curated list of re-
    sources, tools, projects and applications that support HTTP Archive
    (HAR). [Github]. Retrieved 28 June 2015, from https://
    github.com/ahmadnassri/har
NTIA (2010). Commercial data privacy and innovation in the internet
    economy: A dynamic policy framework. IPTF Privacy Green Paper.
    Washington, DC: National Telecommunications and Informa-
    tion Administration (NTIA).

The MWE is as follows (pre-requisites are (1) apacite and (2) classicthesis, http://mirrors.ctan.org/macros/latex/contrib/classicthesis.zip)
\documentclass{scrreprt}

\PassOptionsToPackage{parts}{classicthesis}
\PassOptionsToPackage{natbibapa,index}{apacite}
\usepackage{apacite}
\usepackage{subfig}
\usepackage{classicthesis}

\begin{document}

\citep{haradopters:2015}
\citep{ntia:2010}

\bibliographystyle{apacitex}
\bibliography{References}

\end{document}

A: update: at bottom, variant to address an issue raised in comments. (for a few minutes the code was completely wrong: next time I will check the output before posting ;-)...)
Can you try this with your big document:
\documentclass{scrreprt}

\PassOptionsToPackage{parts}{classicthesis}
\PassOptionsToPackage{natbibapa,index}{apacite}
\usepackage{apacite}
\usepackage{subfig}
\usepackage{classicthesis}

\makeatletter
\renewcommand{\APACrefauthstyle}{\rvaneijk@refauthstyle}%
\def\rvaneijk@refauthstyle #1.%
    {\rvaneijk@refauthstyle@a #1,,\@@rvaneijk {#1}}%
\def\rvaneijk@refauthstyle@a  #1,#2,#3\@@rvaneijk #4%
    {\if\relax\detokenize{#2}\relax {#4}\else {#4}.\fi}
\makeatother

\begin{document}

\citep{haradopters:2015}
\citep{ntia:2010}

\bibliographystyle{apacitex}
\bibliography{References}

\end{document}

It appears that apacite always puts a dot, but the code above tests if the author name contains a comma. If it doesn't contain a comma, the dot is removed.
Not being familiar with apacite nor with bibtex any better, I can not vouch this is robust.
Here is the result:

This used file References.bib:
@MISC{haradopters:2015,
  author = {Nassri, Ahmad},
  title = {{HAR} Resources: {A} community curated list of resources, tools, projects and applications that support {HTTP Archive (HAR)}.},
  year = {2015},
  howpublished={[Github]},
  url={https://github.com/ahmadnassri/har},
  urldate={28 June 2015}
}

@MISC{ntia:2010,
  author = {{NTIA}},
  title = {Commercial Data Privacy and Innovation in the Internet Economy: {A} Dynamic Policy Framework.},
  howpublished={{IPTF Privacy Green Paper}},
    year = {2010},
  publisher={{National Telecommunications and Information Administration (NTIA)}},
  address={Washington, DC}
}

Due to my unfamiliarity with biblatex I had somewhat foolishly assumed on the basis of the sole two bibliographic datas above that a dot would always be present. But clearly at some point in creation of bbl file, a mechanism makes sure not to add a final dot to the author entry if one is already present. If this dot was between braces it could not be seen by the macro \rvaneijk@refauthstyle above.
Thus, here is an alternative which is supposed to fix that issue. Hopefully it doesn't break something else.
\documentclass{scrreprt}

\PassOptionsToPackage{parts}{classicthesis}
\PassOptionsToPackage{natbibapa,index}{apacite}
\usepackage{apacite}
\usepackage{subfig}
\usepackage{classicthesis}

\makeatletter
\renewcommand{\APACrefauthstyle}{\rvaneijk@refauthstyle}%

\catcode`Z 3
\def\rvaneijk@refauthstyle #1\AX
% first check if a dot is present at the end
% this dot will possibly arise after brace stripping of #1
% I assume here the \AX is always present as in my three examples...
   {\rvaneijk@refauthstyle@aa #1Z.Z.X\@@rvaneijk #1\AX}%
\def\rvaneijk@refauthstyle@aa #1.Z.#2#3\@@rvaneijk
% if a dot is detected (it should always be, either in the original
% record, or inserted by biblatex)
% we then apply our macro which checks if the entry contains a comma.
% if a comma is found, the dot will be left. If no comma is found,
% the dot is gobbled and not reinserted. As I think the dot is
% always found, I am not too worried by the possible brace-stripping
% of #1 above, because braces are added below anyhow in all cases.
   {\ifx Z#2\expandafter\rvaneijk@refauthstyle@a\fi}%
\catcode`Z 11
\def\rvaneijk@refauthstyle@a #1.%
    {\rvaneijk@refauthstyle@b #1,,\@@rvaneijk {#1}}%
\def\rvaneijk@refauthstyle@b  #1,#2,#3\@@rvaneijk #4%
    {\if\relax\detokenize{#2}\relax {#4}\else {#4}.\fi}%
\makeatother

\begin{document}

\citep{haradopters:2015}
\citep{ntia:2010}
\citep{foo:2013}

\bibliographystyle{apacitex}

\bibliography{References}

\end{document}

This was done with extra record
@MISC{foo:2013,
  author = {{Company, Inc.}},
  title = {Foolish company.},
  howpublished={{Homemade}},
    year = {2013},
  publisher={{Myself}},
  address={Nowhereland}
}


text:
Q: Can variable variables be used to dynamically assign class properties, so as to allow class constructors with variable arguments in PHP? I am building a class and initially wanted to overload the constructs but discovered this is not allowed in PHP. My solution was using variable arguments for the one constructor. However, I am having some issues using string literals in a key => value pair and assigning the class properties. This leads me to ask my main question - is it actually possible to use variable variables to assign class properties via the constructor?
See example below:
class funrun{

   protected $run_id;
   protected $fun_id;
   protected $funrun_title;
   protected $date;

   function __construct(){

     if (func_num_args() > 0){
       $args = func_get_args(0);
       foreach($args as $key => $value){
          $this->$key = $value;
       }

     $this->date = date();

     function __get($name){
        return $this->name;
     }

     function __set($name,$value){
         $this->name = $value;
     }

}

This seems to correctly assign the values. But then when I do the following:
$settings = array ('run_id' => 5, 'fun_id' => 3);
$fun_example = new funrun($settings);
echo $fun_example->run_id;

I get an error that the getter method isn't functioning:
Undefined property: funrun::$name

However, when I switch the class code to $this->key, the class property doesn't seem to be assigned at all. When I do $fun_example->$run_id, nothing is returned.
What am I missing here? Is there anyway to use an array with string literals to assign class properties? If not, what is a good way to tackle the variable argument issue with constructors?

A: $this->name is looking for a property named name. Variable properties are written as:
$this->$name

See the paragraph beginning with Class properties may also be accessed using variable property names. in the PHP documentation on variable variables
Your constructor is incorrectly written. It's iterating over the argument list, expecting it to be an associative array. But you're passing the settings as a single argument. So it should be:
function __construct($args) {
    foreach ($args as $key => $value) {
        $this->$key = $value;
    }
    $this->date = time();
}


text:
Q: proof $(\liminf A_n)-(\limsup B_n)=\liminf (A_n-B_n)$ I have to prove that $(\liminf A_n)-(\limsup B_n)=\liminf (A_n-B_n)$

*

*First, I want to see: $w \in (\liminf A_n)-(\limsup B_n) \rightarrow w \in \liminf (A_n-B_n)$

*And then: $w \in \liminf (A_n-B_n) \rightarrow w \in (\liminf A_n)-(\limsup B_n)$
Let's start with 1) :
If $w \in (\liminf A_n)-(\limsup B_n)$ we know that $w \in (\liminf A_n)$ but $w \notin (\liminf B_n)$
From there, $w \in (\liminf A_n) \rightarrow \exists n_1 \geq1 ,   \text{st}. w \in A_n \forall n \geq n_1$
And as $w \notin (\liminf B_n)$ , $w$ is not in infinitely many subsubsets of $B_n$

But now, I don't know how to continue, I would be very grateful if someone proves the equality.


text:
Q: Plotly Dash App in Django throws TypeError on __init__() Positional Arguments I have been following the example here exactly
https://thinkinfi.com/integrate-plotly-dash-in-django/
it works fine if I set the virtual environment up with packages of the exact packages it has specified. However I am trying to follow this method and implement it into an existing Django project, so I would prefer to use the latest versions of the packages. With these versions instead

*

*django-plotly-dash==1.5.0

*dash==1.18.1

*dash-bootstrap-components==0.11.1

*dash-daq==0.5.0

*dpd-static-support==0.0.5

*whitenoise==5.2.0

I got this error
Exception inside application: __init__() takes 1 positional argument but 2 were given
Traceback (most recent call last):
  File "/home/jasontam/Personal/GitProjects/dashboard_django/newEnv/lib/python3.8/site-packages/channels/staticfiles.py", line 44, in __call__
    return await self.application(scope, receive, send)
  File "/home/jasontam/Personal/GitProjects/dashboard_django/newEnv/lib/python3.8/site-packages/channels/routing.py", line 71, in __call__
    return await application(scope, receive, send)
  File "/home/jasontam/Personal/GitProjects/dashboard_django/newEnv/lib/python3.8/site-packages/channels/sessions.py", line 47, in __call__
    return await self.inner(dict(scope, cookies=cookies), receive, send)
  File "/home/jasontam/Personal/GitProjects/dashboard_django/newEnv/lib/python3.8/site-packages/channels/sessions.py", line 254, in __call__
    return await self.inner(wrapper.scope, receive, wrapper.send)
  File "/home/jasontam/Personal/GitProjects/dashboard_django/newEnv/lib/python3.8/site-packages/channels/auth.py", line 181, in __call__
    return await super().__call__(scope, receive, send)
  File "/home/jasontam/Personal/GitProjects/dashboard_django/newEnv/lib/python3.8/site-packages/channels/middleware.py", line 26, in __call__
    return await self.inner(scope, receive, send)
  File "/home/jasontam/Personal/GitProjects/dashboard_django/newEnv/lib/python3.8/site-packages/channels/routing.py", line 150, in __call__
    return await application(
  File "/home/jasontam/Personal/GitProjects/dashboard_django/newEnv/lib/python3.8/site-packages/asgiref/compatibility.py", line 33, in new_application
    instance = application(scope)
TypeError: __init__() takes 1 positional argument but 2 were given

Does anyone have any ideas how to resolve it? I have a similar setup going fine (except that I couldn't get it to use a local css file like here, and when I pre-load it into the html teamplate it conflicts with the one that I am using for nav and side bars, but that's a different problem) that I can compare with, and I have gone through the dash_app_code.py and labelled all of the div children arrays, in case it was where the difference is, unfortunately not though.
Thanks in advance.

A: Read this link, they suggest a workaround...
https://github.com/GibbsConsulting/django-plotly-dash/issues/290
Basically:

*

*pip install channels_redis

*Go to the settings file.

*Comment the 'channels' in the INSTALLED_APPS.

*Add 'channels_redis' to the INSTALLED_APPS.

This worked for me.
PDT.
I tested with 2 different environments, and this error was fixed in both.
Environment 1:
django==4.0
django_plotly_dash==1.6.6
channels==3.0.4
channels_redis==3.3.1
bootstrap4==0.1.0
dpd_static_support==0.0.5
dash==1.20.0
dash_daq==0.5.0
dash_bootstrap_components==0.13.1
pandas==1.3.5
whitenoise==5.3.0

Environment 2
django==3.0.5
django_plotly_dash==1.1.4
channels==3.0.4
channels_redis==3.3.1
bootstrap4==0.1.0
dpd_static_support==0.0.5
dash==1.6.1
dash_daq==0.3.1
dash_bootstrap_components==0.7.2
pandas==1.1.5
whitenoise==5.0.1


text:
Q: Improve identity mapper in Wordcount I have created a map method that reads the map output of the wordcount example [1]. This example is away from using the IdentityMapper.class that MapReduce offers, but this is the only way that I have found to make a working IdentityMapper for the Wordcount. The only problem is that this Mapper is taking much more time than I wanted. I am starting to think that maybe I am doing some redundant stuff. Any help to improve my WordCountIdentityMapper code?
[1] Identity mapper
public class WordCountIdentityMapper extends MyMapper<LongWritable, Text, Text, IntWritable> {
    private Text word = new Text();

    public void map(LongWritable key, Text value, Context context
    ) throws IOException, InterruptedException {
        StringTokenizer itr = new StringTokenizer(value.toString());
        word.set(itr.nextToken());
        Integer val = Integer.valueOf(itr.nextToken());
        context.write(word, new IntWritable(val));
    }

    public void run(Context context) throws IOException, InterruptedException {
        while (context.nextKeyValue()) {
            map(context.getCurrentKey(), context.getCurrentValue(), context);
        }
    }
}

[2] Map class that generated the mapoutput
public static class MyMap extends Mapper<LongWritable, Text, Text, IntWritable> {
    private final static IntWritable one = new IntWritable(1);
    private Text word = new Text();

    public void map(LongWritable key, Text value, Context context
    ) throws IOException, InterruptedException {
        StringTokenizer itr = new StringTokenizer(value.toString());

        while (itr.hasMoreTokens()) {
            word.set(itr.nextToken());
            context.write(word, one);
        }
    }

    public void run(Context context) throws IOException, InterruptedException {
        try {
            while (context.nextKeyValue()) {
                map(context.getCurrentKey(), context.getCurrentValue(), context);
            }
        } finally {
            cleanup(context);
        }
    }
}

Thanks,

A: The solution to this is replace the StringTokenizer by the indexOf() method. It works much better. I get better performance.


text:
Q: C++ code works fine in msdev 6.0 and crashes in Visual Studio 2010 I am no C programming expert, But here is a piece of code which i am working on
static char gszBuf[10] ="1234567890";
#define       LS_MAX_STRING    255
LoadDatatoBuffer(id, gszBuf, LS_MAX_STRING);
// this method will load the data wrt ID to gszBuf

Considering that the above method loads a char string having more than 10 characters, i.e. gszBuf = "abcdefghijklmnopqr";
The above code will run without any issue in msdev 6.0. but the same application created using visual studio 2010 crashes when we try to copy the above data. My question is what made the above code to work in msdev 6.0 and why couldnt it run in visual studio 2010

A: You should be grateful that VS2010 made your code "crash".
When you have buffer overruns, it's better to crash as soon as possible, instead of letting hackers exploit your buffer overflow.
There are several security improvements and buffer overflow checks with VS2010: consider them opportunities to improve the quality of your code and fix buffer overrun related bugs.

A: Undefined behavior can mean that the code will crash, but may mean that the code appears to work, but causes failure.
In this case, if gszBuf is at beginning of a CPU page, and after it, nothing is important, then it won't crash.


text:
Q: 3 menu into a single menu in responsive design Goal:
When it goes to Responsive design, The menu of "Test1"  and "default" should be included in the menu to be expanded.
Problem:
When you go for responsive design I only can see the menu that is "Asdf" only but it does not contain any menulink from Test1 and default.
I tried finding a solution it does go so well.
How to enable to do it in relation to Bootstrap v3
Thank you!
jsbin.com/goqimureva/edit?html,output

A: You are missing the "in" class for bootstrap:

A: I think you are doing this in wrong way. There is no need to add extra ul.
`http://jsbin.com/suqabisiyo/1/edit?html,output`


text:
Q: Why my send and receive Object sometime is different? I trying to send an object by server to receiver or reverse.However, most of time it is true and done completely but sometimes when I send an object, the receiver get the object that I sent before it and object are sent by sender lost.I have used Socket in my project and read and write by ObjectInputStream and ObjectOutputStream.

A: If you're sending the same object with different values you need to call ObjectOutputStream.reset() before the second send if you want the receiver to get the changed object. Or call writeUnshared() instead of writeObject().


text:
Q: mysql function in query with dynamic sql involved How to use a stored function instead of an explicitly written table name.
My query:
select "col_name" from get_table("col_name") where id = 2;

get_table(col_name) is my stored function which returns the table name after having processed column name.
I get error message

Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '("col_name") where id = 2' at line 1

I also tried to do like this:
DECLARE tableName varchar(30);
set tableName = get_table("col_name");
...
select "col_name" from tableName where id = 2;

This time I get error:

no such a table - tableName


text:
Q: Store query element into database table is under loop

<input class="txt form-control"  name="balance[]" type="text" placeholder="Balance" />

,and the balance is added from all the tr
total balance is shown on the debtsum. And it is done by jquery

 <input class="debtsum form-control " id="debt" type="text" name="totaldebt" placeholder="Total Debt" disabled />

Query to store data into database :
    $totaldebt = mysqli_real_escape_string($connect,$_POST['totaldebt']);//to store total debt in the database
    $table_customer_data="insert into
   tbl_customer_data(totaldebt) values ('".$totaldebt."');

Jquery script to add all the data of class txt :

The jquery function is working properly, and sums all the input value of balance. But when i submit form to store all the value into database it stores nothing.
Thanks in advance, any help is appreciated.

A: I think this is issue due to disabled property in your element.

disabled element isn't editable and isn't sent on submit.

I think you can take readonly.

a readonly element is just not editable, but gets sent when the
  according form submits.

for more information please click here


text:
Q: Wordpress, плагин при загрузке делает таблицу Пытаюсь писать плагин.
Он при включении создает таблицу. Ниже функция, отвечающая за это.
У меня есть sql. файл с 2-мя таблицами. Можно ли как-нибудь сделать чтобы плагин не создавал таблицу а брал таблицы из файла, или только одну таблицу из файла?
function activate () {
        global $wpdb;
        require_once(ABSPATH . 'wp-admin/upgrade-functions.php');
        $table = $this->tbl_city_sdek;
        if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') ) {
            if ( ! empty($wpdb->charset) )
                $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
            if ( ! empty($wpdb->collate) )
                $charset_collate .= " COLLATE $wpdb->collate";
        }
        $sql_table_city_sdek = "
CREATE TABLE `".$wpdb->prefix."city_sdek` (
    `ID` INT(10) UNSIGNED NULL AUTO_INCREMENT,
    `country_code` varchar(2) NOT NULL,
    `state_code` varchar(8) NOT NULL DEFAULT '',
    `city_code` varchar(32) NOT NULL DEFAULT '',
    `status` char(1) NOT NULL DEFAULT 'A',
    PRIMARY KEY (`ID`)
)".$charset_collate.";";

        // Проверка на существование таблицы
        if ( $wpdb->get_var("show tables like '".$table."'") != $table ) {
            dbDelta($sql_table_city_sdek);
        }
    }