问:
Database disappears in emulator
MainActivity Code

```<code>package kz.talipovsn.database;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.TypedValue;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    private final int LARGE_FONT = 16; // Размер шрифта для режима крупного шрифта
    private final int SMALL_FONT = 12; // Размер шрифта для режима обычного шрифта
    private int fontSize = SMALL_FONT; // Выбранный размер шрифта

    MySQLite db = new MySQLite(this); // Класс работы с нашей базой данных

    EditText editText; // Компонент для задания строки поиска
    TextView textView; // Компонент для вывода ответа
    CheckBox checkBox1;
    CheckBox checkBox2;
    CheckBox checkBox3;
    CheckBox checkBox4;
    CheckBox checkBox5;
    CheckBox checkBox6;

    static final String FILTER = "FILTER"; // Имя параметра для сохранения при переворачивании экрана
    String filter = ""; // Фильтр поиска

    SharedPreferences sPref; // Класс для работы с настройками программы
    static final String CONFIG_FILE_NAME = "Config"; // Имя файла настроек приложения
    static final String FONT_SIZE = "FontSize"; // Имя параметра для сохранения размера шрифта в настройках приложения

    @Override
    public void onSaveInstanceState(Bundle savedInstanceState) {
        // Сохранение данных при перевороте экрана
        savedInstanceState.putString(FILTER, filter);
        super.onSaveInstanceState(savedInstanceState);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);

        // Активация меню
        Toolbar toolbar = findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        // Доступ к компонентам
        editText = findViewById(R.id.editText);
        textView = findViewById(R.id.textView);
        checkBox1 = findViewById(R.id.checkBox1);
        checkBox2 = findViewById(R.id.checkBox2);
        checkBox3 = findViewById(R.id.checkBox3);
        checkBox4 = findViewById(R.id.checkBox4);
        checkBox5 = findViewById(R.id.checkBox5);
        checkBox6 = findViewById(R.id.checkBox6);

        textView.setKeyListener(null); // Запрет на изменение данных с клавиатуры

        // Чтение сохраненной настройки размера шрифта из параметров приложения
        sPref = getSharedPreferences(CONFIG_FILE_NAME, MODE_PRIVATE);
        fontSize = sPref.getInt(FONT_SIZE, SMALL_FONT);

        textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, fontSize); // Установка начально размера шрифта
        textView.requestFocus(); // Передача фокуса на комонент чтобы закрылось окно ввода у "editText"

        // Восстановление фильтра после переворота экрана
        if (savedInstanceState != null) {
            editText.setText(savedInstanceState.getString(FILTER));
        }

        textView.setText(R.string.Загрузка_данных);

        // Обработчик изменения текста в компоненте "editText"
        editText.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {
            }

            @Override
            public void afterTextChanged(Editable s) {

                // Сделаем поиск данных в другом потоке
                new Thread(new Runnable() {
                    public void run() {
                        filter = editText.getText().toString().trim();
                        final String data = db.getData(filter, checkBox1.isChecked(), checkBox2.isChecked(), checkBox3.isChecked(), checkBox4.isChecked(), checkBox5.isChecked(), checkBox6.isChecked());
                        // Сделаем вывод результата синхронно с основным потоком
                        textView.post(new Runnable() {
                            public void run() {
                                textView.setText(data);
                            }
                        });
                    }
                }).start();

            }

        });

        // Инициализация начального поиска (показать все записи)
        editText.post(new Runnable() {
            public void run() {
                editText.setText(filter);
            }
        });
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_main, menu);
        // Установка правильного отображения пункта выбора крупного шрифта
        menu.findItem(R.id.large_font).setChecked(fontSize == LARGE_FONT);
        return true;
    }

    // Обработчик выбора пунктов меню
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int id = item.getItemId();
        // Написать автору
        if (id == R.id.email) {
            Intent i = new Intent(Intent.ACTION_SEND);
            i.setType("message/rfc822");
            i.putExtra(Intent.EXTRA_EMAIL, new String[]{getString(R.string.myemail)});
            i.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.Добавьте_еще_номер));
            i.putExtra(Intent.EXTRA_TEXT, getString(R.string.Предлагаю_такой_номер));
            try {
                startActivity(Intent.createChooser(i, getString(R.string.Посылка_письма)));
            } catch (android.content.ActivityNotFoundException ex) {
                Toast.makeText(MainActivity.this, R.string.Нет_установленного_почтового_клиента, Toast.LENGTH_SHORT).show();
            }
            return true;
        }
        // Установка/снятие крупного шрифта
        if (id == R.id.large_font) {
            item.setChecked(!item.isChecked());
            int size = item.isChecked() ? LARGE_FONT : SMALL_FONT;
            textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, size);
            fontSize = size;
            return true;
        }
        // Выход
        if (id == R.id.exit) {
            finish();
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

    // Метод при закрытии окна
    @Override
    protected void onStop() {
        super.onStop();
        // Сохранение размера шрифта в настройках программы
        SharedPreferences.Editor ed = sPref.edit();
        ed.putInt(FONT_SIZE, fontSize);
        ed.apply();
    }
}
</code>```

..................................................
Here is the MySQLite code, for working with the database, it does not show errors in the code. Possible errors with the emulator version. With one filter PRICE worked...................................

MySQLite Code

```<code>    package kz.talipovsn.database;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class MySQLite extends SQLiteOpenHelper {
    private static final int DATABASE_VERSION = 3; // НОМЕР ВЕРСИИ БАЗЫ ДАННЫХ И ТАБЛИЦ !

    static final String DATABASE_NAME = "phones"; // Имя базы данных

    static final String TABLE_NAME = "emergency_service";
    static final String ID = "id";
    static final String NAME = "name";
    static final String PRICE = "price";
    static final String TYPE = "type";
    static final String POWER = "power";
    static final String WEIGHT = "weight";
    static final String COUNTRY = "country";

    static final String ASSETS_FILE_NAME = "telephone.txt"; // Имя файла из ресурсов с данными для БД
    static final String DATA_SEPARATOR = "|"; // Разделитель данных в файле ресурсов с телефонами

    private Context context; // Контекст приложения

    public MySQLite(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
        this.context = context;
    }

    // Метод создания базы данных и таблиц в ней
    @Override
    public void onCreate(SQLiteDatabase db) {
        String CREATE_CONTACTS_TABLE = "CREATE TABLE " + TABLE_NAME + "("
                + ID + " INTEGER PRIMARY KEY,"
                + NAME + " TEXT,"
                + PRICE + " INTEGER,"
                + TYPE + " TEXT,"
                + POWER + " INTEGER,"
                + WEIGHT + " INTEGER,"
                + COUNTRY + " TEXT" + ")";
        db.execSQL(CREATE_CONTACTS_TABLE);
        System.out.println(CREATE_CONTACTS_TABLE);
        loadDataFromAsset(context, ASSETS_FILE_NAME,  db);
    }

    // Метод при обновлении структуры базы данных и/или таблиц в ней
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
        System.out.println("DROP TABLE IF EXISTS " + TABLE_NAME);
        onCreate(db);
    }

    // Добавление нового контакта в БД
    public void addData(SQLiteDatabase db, String name, int price, String type, int power, int weight, String country) {
        ContentValues values = new ContentValues();
        values.put(NAME, name);
        values.put(PRICE, price);
        values.put(TYPE, type);
        values.put(POWER, power);
        values.put(WEIGHT, weight);
        values.put(COUNTRY, country);
        db.insert(TABLE_NAME, null, values);
    }

    // Добавление записей в базу данных из файла ресурсов
    public void loadDataFromAsset(Context context, String fileName, SQLiteDatabase db) {
        BufferedReader in = null;

        try {
            // Открываем поток для работы с файлом с исходными данными
            InputStream is = context.getAssets().open(fileName);
            // Открываем буфер обмена для потока работы с файлом с исходными данными
            in = new BufferedReader(new InputStreamReader(is));

            String str;
            while ((str = in.readLine()) != null) { // Читаем строку из файла
                String strTrim = str.trim(); // Убираем у строки пробелы с концов
                if (!strTrim.equals("")) { // Если строка не пустая, то
                    StringTokenizer st = new StringTokenizer(strTrim, DATA_SEPARATOR); // Нарезаем ее на части
                    String name = st.nextToken().trim(); // Извлекаем из строки название организации без пробелов на концах
                    int price = Integer.parseInt(st.nextToken().trim());
                    String type = st.nextToken().trim();
                    int power = Integer.parseInt(st.nextToken().trim());
                    int weight = Integer.parseInt(st.nextToken().trim());
                    String country = st.nextToken().trim();
                    addData(db, name, price, type, power, weight, country);
                }
            }

        // Обработчики ошибок
        } catch (IOException ignored) {
        } finally {
            if (in != null) {
                try {
                    in.close();
                } catch (IOException ignored) {
                }
            }
        }

    }

    public String getData(String filter, boolean isName, boolean isCountry, boolean isPrice, boolean isWeight, boolean isPower, boolean isType) {

        String selectQuery; // Переменная для SQL-запроса

        if (filter.equals("")) {
            selectQuery = "SELECT  * FROM " + TABLE_NAME + " ORDER BY " + NAME;
        } else {
            if (isName) {
                selectQuery = "SELECT  * FROM " + TABLE_NAME + " WHERE (" + NAME + filter + ") ORDER BY " + NAME;
            } else if (isCountry) {
                selectQuery = "SELECT  * FROM " + TABLE_NAME + " WHERE (" + COUNTRY + filter + ") ORDER BY " + COUNTRY;
            } else if (isPrice) {
                selectQuery = "SELECT  * FROM " + TABLE_NAME + " WHERE (" + PRICE + " >= " + filter + ") ORDER BY " + PRICE;
            } else if (isWeight) {
                selectQuery = "SELECT  * FROM " + TABLE_NAME + " WHERE (" + WEIGHT + filter + ") ORDER BY " + WEIGHT;
            } else if (isPower) {
                selectQuery = "SELECT  * FROM " + TABLE_NAME + " WHERE (" + POWER + filter + ") ORDER BY " + POWER;
            } else if (isType) {
                selectQuery = "SELECT  * FROM " + TABLE_NAME + " WHERE (" + TYPE + filter + ") ORDER BY " + TYPE;
            } else {
                selectQuery = "SELECT  * FROM " + TABLE_NAME + " WHERE (" + TYPE + " LIKE '%" + filter + "%'" + " OR " + POWER + " LIKE '%" + filter + "%'"
                        + " OR " + WEIGHT + " LIKE '%" + filter + "%'" + " OR " + COUNTRY +
                        " LIKE '%" + filter + "%'" + " OR " + NAME + " LIKE '%" + filter + "%'" + ") ORDER BY " + NAME;
            }
        }

        SQLiteDatabase db = this.getReadableDatabase(); // Доступ к БД
        try {
        Cursor cursor = db.rawQuery(selectQuery, null); // Выполнение SQL-запроса

        StringBuilder data = new StringBuilder(); // Переменная для формирования данных из запроса

        int num = 0;
        if (cursor.moveToFirst()) { // Если есть хоть одна запись, то
            do { // Цикл по всем записям результата запроса
                int n = cursor.getColumnIndex(NAME);
                int t = cursor.getColumnIndex(PRICE);
                int k = cursor.getColumnIndex(TYPE);
                int s = cursor.getColumnIndex(POWER);
                int a = cursor.getColumnIndex(WEIGHT);
                int d = cursor.getColumnIndex(COUNTRY);
                String name = cursor.getString(n); // Чтение названия организации
                int price = cursor.getInt(t); // Чтение телефонного номера
                String type = cursor.getString(k);
                String power = cursor.getString(s);
                String weight = cursor.getString(a);
                String country = cursor.getString(d);
                data.append(String.valueOf(++num) + ") " + name + ": " + price + ": " + type + ": " + power + ": " + weight + ": " + country + ": " + "\n");
            } while (cursor.moveToNext()); // Цикл пока есть следующая запись
        }

        return data.toString(); // Возвращение результата
    }
    catch (Exception e)
    {
        return "";
    }
}

}
</code>```
```<code>    The errors themselves
12/08 20:52:48: Launching 'TSN_DEMO_06_Database' on Pixel 2 API 22.
Install successfully finished in 7 s 497 ms.
$ adb shell am start -n "kz.talipovsn.database/kz.talipovsn.database.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 3903 on device 'Pixel_2_API_22 [emulator-5554]'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/art: Late-enabling -Xcheck:jni
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
W/art: Suspending all threads took: 5.066ms
I/art: Background sticky concurrent mark sweep GC freed 1193(84KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 3MB/3MB, paused 5.853ms total 64.414ms
I/WebViewFactory: Loading com.android.webview version 39 (6695563-x86_64) (code 300008)
I/LibraryLoader: Time to load native libraries: 0 ms (timestamps 7557-7557)
I/LibraryLoader: Expected native library version number "",actual native library version number ""
V/WebViewChromiumFactoryProvider: Binding Chromium to main looper Looper (main, tid 1) {15b25306}
I/LibraryLoader: Expected native library version number "",actual native library version number ""
I/chromium: [INFO:library_loader_hooks.cc(104)] Chromium logging enabled: level = 0, default verbosity = 0
I/BrowserStartupController: Initializing chromium process, singleProcess=true
W/art: Attempt to remove local handle scope entry from IRT, ignoring
W/chromium: [WARNING:resource_bundle.cc(304)] locale_file_path.empty()
I/chromium: [INFO:aw_browser_main_parts.cc(65)] Load from apk succesful, fd=31 off=46184 len=3037
I/chromium: [INFO:aw_browser_main_parts.cc(78)] Loading webviewchromium.pak from, fd:32 off:229484 len:1089587
W/AudioManagerAndroid: Requires BLUETOOTH permission
D/: HostConnection::get() New Host Connection established 0x7fb17cd03c50, tid 3903
D/EGL_emulation: eglCreateContext: 0x7fb17ccf88e0: maj 2 min 0 rcv 2
D/EGL_emulation: eglMakeCurrent: 0x7fb17ccf88e0: ver 2 0 (tinfo 0x7fb17cd07e80)
D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
D/Atlas: Validating map...
I/OpenGLRenderer: Initialized EGL, version 1.4
D/: HostConnection::get() New Host Connection established 0x7fb1863fb550, tid 3946
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/EGL_emulation: eglCreateContext: 0x7fb17cd4cca0: maj 2 min 0 rcv 2
D/EGL_emulation: eglMakeCurrent: 0x7fb17cd4cca0: ver 2 0 (tinfo 0x7fb17cdd5600)
D/OpenGLRenderer: Enabling debug mode 0
D/EGL_emulation: eglMakeCurrent: 0x7fb17cd4cca0: ver 2 0 (tinfo 0x7fb17cdd5600)
I/System.out: DROP TABLE IF EXISTS emergency_service
I/System.out: CREATE TABLE emergency_service(id INTEGER PRIMARY KEY,name TEXT,price INTEGER,type TEXT,power INTEGER,weight INTEGER,country TEXT)
</code>```

Tried to completely reinstall the database

Title: Database disappears in emulator

Body:
MainActivity Code

package kz.talipovsn.database;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.TypedValue;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    private final int LARGE_FONT = 16; // Размер шрифта для режима крупного шрифта
    private final int SMALL_FONT = 12; // Размер шрифта для режима обычного шрифта
    private int fontSize = SMALL_FONT; // Выбранный размер шрифта

    MySQLite db = new MySQLite(this); // Класс работы с нашей базой данных

    EditText editText; // Компонент для задания строки поиска
    TextView textView; // Компонент для вывода ответа
    CheckBox checkBox1;
    CheckBox checkBox2;
    CheckBox checkBox3;
    CheckBox checkBox4;
    CheckBox checkBox5;
    CheckBox checkBox6;

    static final String FILTER = "FILTER"; // Имя параметра для сохранения при переворачивании экрана
    String filter = ""; // Фильтр поиска

    SharedPreferences sPref; // Класс для работы с настройками программы
    static final String CONFIG_FILE_NAME = "Config"; // Имя файла настроек приложения
    static final String FONT_SIZE = "FontSize"; // Имя параметра для сохранения размера шрифта в настройках приложения

    @Override
    public void onSaveInstanceState(Bundle savedInstanceState) {
        // Сохранение данных при перевороте экрана
        savedInstanceState.putString(FILTER, filter);
        super.onSaveInstanceState(savedInstanceState);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);

        // Активация меню
        Toolbar toolbar = findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        // Доступ к компонентам
        editText = findViewById(R.id.editText);
        textView = findViewById(R.id.textView);
        checkBox1 = findViewById(R.id.checkBox1);
        checkBox2 = findViewById(R.id.checkBox2);
        checkBox3 = findViewById(R.id.checkBox3);
        checkBox4 = findViewById(R.id.checkBox4);
        checkBox5 = findViewById(R.id.checkBox5);
        checkBox6 = findViewById(R.id.checkBox6);

        textView.setKeyListener(null); // Запрет на изменение данных с клавиатуры

        // Чтение сохраненной настройки размера шрифта из параметров приложения
        sPref = getSharedPreferences(CONFIG_FILE_NAME, MODE_PRIVATE);
        fontSize = sPref.getInt(FONT_SIZE, SMALL_FONT);

        textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, fontSize); // Установка начально размера шрифта
        textView.requestFocus(); // Передача фокуса на комонент чтобы закрылось окно ввода у "editText"

        // Восстановление фильтра после переворота экрана
        if (savedInstanceState != null) {
            editText.setText(savedInstanceState.getString(FILTER));
        }

        textView.setText(R.string.Загрузка_данных);

        // Обработчик изменения текста в компоненте "editText"
        editText.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {
            }

            @Override
            public void afterTextChanged(Editable s) {

                // Сделаем поиск данных в другом потоке
                new Thread(new Runnable() {
                    public void run() {
                        filter = editText.getText().toString().trim();
                        final String data = db.getData(filter, checkBox1.isChecked(), checkBox2.isChecked(), checkBox3.isChecked(), checkBox4.isChecked(), checkBox5.isChecked(), checkBox6.isChecked());
                        // Сделаем вывод результата синхронно с основным потоком
                        textView.post(new Runnable() {
                            public void run() {
                                textView.setText(data);
                            }
                        });
                    }
                }).start();

            }

        });

        // Инициализация начального поиска (показать все записи)
        editText.post(new Runnable() {
            public void run() {
                editText.setText(filter);
            }
        });
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_main, menu);
        // Установка правильного отображения пункта выбора крупного шрифта
        menu.findItem(R.id.large_font).setChecked(fontSize == LARGE_FONT);
        return true;
    }

    // Обработчик выбора пунктов меню
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int id = item.getItemId();
        // Написать автору
        if (id == R.id.email) {
            Intent i = new Intent(Intent.ACTION_SEND);
            i.setType("message/rfc822");
            i.putExtra(Intent.EXTRA_EMAIL, new String[]{getString(R.string.myemail)});
            i.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.Добавьте_еще_номер));
            i.putExtra(Intent.EXTRA_TEXT, getString(R.string.Предлагаю_такой_номер));
            try {
                startActivity(Intent.createChooser(i, getString(R.string.Посылка_письма)));
            } catch (android.content.ActivityNotFoundException ex) {
                Toast.makeText(MainActivity.this, R.string.Нет_установленного_почтового_клиента, Toast.LENGTH_SHORT).show();
            }
            return true;
        }
        // Установка/снятие крупного шрифта
        if (id == R.id.large_font) {
            item.setChecked(!item.isChecked());
            int size = item.isChecked() ? LARGE_FONT : SMALL_FONT;
            textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, size);
            fontSize = size;
            return true;
        }
        // Выход
        if (id == R.id.exit) {
            finish();
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

    // Метод при закрытии окна
    @Override
    protected void onStop() {
        super.onStop();
        // Сохранение размера шрифта в настройках программы
        SharedPreferences.Editor ed = sPref.edit();
        ed.putInt(FONT_SIZE, fontSize);
        ed.apply();
    }
}

..................................................
Here is the MySQLite code, for working with the database, it does not show errors in the code. Possible errors with the emulator version. With one filter PRICE worked...................................

MySQLite Code

    package kz.talipovsn.database;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class MySQLite extends SQLiteOpenHelper {
    private static final int DATABASE_VERSION = 3; // НОМЕР ВЕРСИИ БАЗЫ ДАННЫХ И ТАБЛИЦ !

    static final String DATABASE_NAME = "phones"; // Имя базы данных

    static final String TABLE_NAME = "emergency_service";
    static final String ID = "id";
    static final String NAME = "name";
    static final String PRICE = "price";
    static final String TYPE = "type";
    static final String POWER = "power";
    static final String WEIGHT = "weight";
    static final String COUNTRY = "country";

    static final String ASSETS_FILE_NAME = "telephone.txt"; // Имя файла из ресурсов с данными для БД
    static final String DATA_SEPARATOR = "|"; // Разделитель данных в файле ресурсов с телефонами

    private Context context; // Контекст приложения

    public MySQLite(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
        this.context = context;
    }

    // Метод создания базы данных и таблиц в ней
    @Override
    public void onCreate(SQLiteDatabase db) {
        String CREATE_CONTACTS_TABLE = "CREATE TABLE " + TABLE_NAME + "("
                + ID + " INTEGER PRIMARY KEY,"
                + NAME + " TEXT,"
                + PRICE + " INTEGER,"
                + TYPE + " TEXT,"
                + POWER + " INTEGER,"
                + WEIGHT + " INTEGER,"
                + COUNTRY + " TEXT" + ")";
        db.execSQL(CREATE_CONTACTS_TABLE);
        System.out.println(CREATE_CONTACTS_TABLE);
        loadDataFromAsset(context, ASSETS_FILE_NAME,  db);
    }

    // Метод при обновлении структуры базы данных и/или таблиц в ней
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
        System.out.println("DROP TABLE IF EXISTS " + TABLE_NAME);
        onCreate(db);
    }

    // Добавление нового контакта в БД
    public void addData(SQLiteDatabase db, String name, int price, String type, int power, int weight, String country) {
        ContentValues values = new ContentValues();
        values.put(NAME, name);
        values.put(PRICE, price);
        values.put(TYPE, type);
        values.put(POWER, power);
        values.put(WEIGHT, weight);
        values.put(COUNTRY, country);
        db.insert(TABLE_NAME, null, values);
    }

    // Добавление записей в базу данных из файла ресурсов
    public void loadDataFromAsset(Context context, String fileName, SQLiteDatabase db) {
        BufferedReader in = null;

        try {
            // Открываем поток для работы с файлом с исходными данными
            InputStream is = context.getAssets().open(fileName);
            // Открываем буфер обмена для потока работы с файлом с исходными данными
            in = new BufferedReader(new InputStreamReader(is));

            String str;
            while ((str = in.readLine()) != null) { // Читаем строку из файла
                String strTrim = str.trim(); // Убираем у строки пробелы с концов
                if (!strTrim.equals("")) { // Если строка не пустая, то
                    StringTokenizer st = new StringTokenizer(strTrim, DATA_SEPARATOR); // Нарезаем ее на части
                    String name = st.nextToken().trim(); // Извлекаем из строки название организации без пробелов на концах
                    int price = Integer.parseInt(st.nextToken().trim());
                    String type = st.nextToken().trim();
                    int power = Integer.parseInt(st.nextToken().trim());
                    int weight = Integer.parseInt(st.nextToken().trim());
                    String country = st.nextToken().trim();
                    addData(db, name, price, type, power, weight, country);
                }
            }

        // Обработчики ошибок
        } catch (IOException ignored) {
        } finally {
            if (in != null) {
                try {
                    in.close();
                } catch (IOException ignored) {
                }
            }
        }

    }

    public String getData(String filter, boolean isName, boolean isCountry, boolean isPrice, boolean isWeight, boolean isPower, boolean isType) {

        String selectQuery; // Переменная для SQL-запроса

        if (filter.equals("")) {
            selectQuery = "SELECT  * FROM " + TABLE_NAME + " ORDER BY " + NAME;
        } else {
            if (isName) {
                selectQuery = "SELECT  * FROM " + TABLE_NAME + " WHERE (" + NAME + filter + ") ORDER BY " + NAME;
            } else if (isCountry) {
                selectQuery = "SELECT  * FROM " + TABLE_NAME + " WHERE (" + COUNTRY + filter + ") ORDER BY " + COUNTRY;
            } else if (isPrice) {
                selectQuery = "SELECT  * FROM " + TABLE_NAME + " WHERE (" + PRICE + " >= " + filter + ") ORDER BY " + PRICE;
            } else if (isWeight) {
                selectQuery = "SELECT  * FROM " + TABLE_NAME + " WHERE (" + WEIGHT + filter + ") ORDER BY " + WEIGHT;
            } else if (isPower) {
                selectQuery = "SELECT  * FROM " + TABLE_NAME + " WHERE (" + POWER + filter + ") ORDER BY " + POWER;
            } else if (isType) {
                selectQuery = "SELECT  * FROM " + TABLE_NAME + " WHERE (" + TYPE + filter + ") ORDER BY " + TYPE;
            } else {
                selectQuery = "SELECT  * FROM " + TABLE_NAME + " WHERE (" + TYPE + " LIKE '%" + filter + "%'" + " OR " + POWER + " LIKE '%" + filter + "%'"
                        + " OR " + WEIGHT + " LIKE '%" + filter + "%'" + " OR " + COUNTRY +
                        " LIKE '%" + filter + "%'" + " OR " + NAME + " LIKE '%" + filter + "%'" + ") ORDER BY " + NAME;
            }
        }

        SQLiteDatabase db = this.getReadableDatabase(); // Доступ к БД
        try {
        Cursor cursor = db.rawQuery(selectQuery, null); // Выполнение SQL-запроса

        StringBuilder data = new StringBuilder(); // Переменная для формирования данных из запроса

        int num = 0;
        if (cursor.moveToFirst()) { // Если есть хоть одна запись, то
            do { // Цикл по всем записям результата запроса
                int n = cursor.getColumnIndex(NAME);
                int t = cursor.getColumnIndex(PRICE);
                int k = cursor.getColumnIndex(TYPE);
                int s = cursor.getColumnIndex(POWER);
                int a = cursor.getColumnIndex(WEIGHT);
                int d = cursor.getColumnIndex(COUNTRY);
                String name = cursor.getString(n); // Чтение названия организации
                int price = cursor.getInt(t); // Чтение телефонного номера
                String type = cursor.getString(k);
                String power = cursor.getString(s);
                String weight = cursor.getString(a);
                String country = cursor.getString(d);
                data.append(String.valueOf(++num) + ") " + name + ": " + price + ": " + type + ": " + power + ": " + weight + ": " + country + ": " + "\n");
            } while (cursor.moveToNext()); // Цикл пока есть следующая запись
        }

        return data.toString(); // Возвращение результата
    }
    catch (Exception e)
    {
        return "";
    }
}

}

    The errors themselves
12/08 20:52:48: Launching 'TSN_DEMO_06_Database' on Pixel 2 API 22.
Install successfully finished in 7 s 497 ms.
$ adb shell am start -n "kz.talipovsn.database/kz.talipovsn.database.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 3903 on device 'Pixel_2_API_22 [emulator-5554]'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/art: Late-enabling -Xcheck:jni
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
W/art: Suspending all threads took: 5.066ms
I/art: Background sticky concurrent mark sweep GC freed 1193(84KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 3MB/3MB, paused 5.853ms total 64.414ms
I/WebViewFactory: Loading com.android.webview version 39 (6695563-x86_64) (code 300008)
I/LibraryLoader: Time to load native libraries: 0 ms (timestamps 7557-7557)
I/LibraryLoader: Expected native library version number "",actual native library version number ""
V/WebViewChromiumFactoryProvider: Binding Chromium to main looper Looper (main, tid 1) {15b25306}
I/LibraryLoader: Expected native library version number "",actual native library version number ""
I/chromium: [INFO:library_loader_hooks.cc(104)] Chromium logging enabled: level = 0, default verbosity = 0
I/BrowserStartupController: Initializing chromium process, singleProcess=true
W/art: Attempt to remove local handle scope entry from IRT, ignoring
W/chromium: [WARNING:resource_bundle.cc(304)] locale_file_path.empty()
I/chromium: [INFO:aw_browser_main_parts.cc(65)] Load from apk succesful, fd=31 off=46184 len=3037
I/chromium: [INFO:aw_browser_main_parts.cc(78)] Loading webviewchromium.pak from, fd:32 off:229484 len:1089587
W/AudioManagerAndroid: Requires BLUETOOTH permission
D/: HostConnection::get() New Host Connection established 0x7fb17cd03c50, tid 3903
D/EGL_emulation: eglCreateContext: 0x7fb17ccf88e0: maj 2 min 0 rcv 2
D/EGL_emulation: eglMakeCurrent: 0x7fb17ccf88e0: ver 2 0 (tinfo 0x7fb17cd07e80)
D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
D/Atlas: Validating map...
I/OpenGLRenderer: Initialized EGL, version 1.4
D/: HostConnection::get() New Host Connection established 0x7fb1863fb550, tid 3946
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/EGL_emulation: eglCreateContext: 0x7fb17cd4cca0: maj 2 min 0 rcv 2
D/EGL_emulation: eglMakeCurrent: 0x7fb17cd4cca0: ver 2 0 (tinfo 0x7fb17cdd5600)
D/OpenGLRenderer: Enabling debug mode 0
D/EGL_emulation: eglMakeCurrent: 0x7fb17cd4cca0: ver 2 0 (tinfo 0x7fb17cdd5600)
I/System.out: DROP TABLE IF EXISTS emergency_service
I/System.out: CREATE TABLE emergency_service(id INTEGER PRIMARY KEY,name TEXT,price INTEGER,type TEXT,power INTEGER,weight INTEGER,country TEXT)

Tried to completely reinstall the database


来源: stackexchange

问:
How to cancel pagination move after clicking page button in DataTables.js?
I want to manage whether pagination moving will be run or not when the page button is clicked.

DataTables plugin has following event listeners that might help to satisfy my needs.

page-dt: Page change event - triggered when the table's paging is updated.

preDraw: Pre-draw event - triggered before the table is about to be redrawn.

The following is the simplified code.

```<code>$('#example').DataTable({
    displayLength: 3
})
    .on('page.dt', function() {
        console.log('page button clicked.');

        // set a flag for detecting whether [page] button is clicked
        // when 'preDraw' event is triggered
        $('body').data('paging', true);
    })
    .on('preDraw', function() {
        console.log('preDraw event occurred.');

        // if the 'preDraw' event is caused by clicking the [page] button
        if ($('body').data('paging')) {
            $('body').data('paging', false);

            if (!confirm('Are you sure to move?')) {
                return false;
            }
        }
    });
</code>```

jsFiddle Demo page

This code seems to work fine just after clicking Yes or No on the confirm box.

However, if No is clicked on the confirm box, the clicked page button will no longer work.

After some investigation, the following fact was found.

When returning false in the reDraw event listener, dataTable will not be drawn as designed in the DataTables plugin.

But, the internal selected flag (or something) moves to the clicked page button.

For example, let's consider the case of clicking the button '2' when the button '1' is selected.

The confirm box will be shown, and then No will be clicked.

The dataTable remains showing the first page and the button '1' is still selected as expected.

However, contrary to appearances, button '2' does not work in this situation, button '1' is clickable (showing a confirm box when clicked) instead.

I have been struggling with this inflexible behavior of DataTables pagination for a long time.

It would be really appreciated if other solutions could be provided.

ContentLicense: CC BY-SA 4.0

Body:
I want to manage whether pagination moving will be run or not when the page button is clicked.

DataTables plugin has following event listeners that might help to satisfy my needs.

page-dt: Page change event - triggered when the table's paging is updated.

preDraw: Pre-draw event - triggered before the table is about to be redrawn.

The following is the simplified code.

$('#example').DataTable({
    displayLength: 3
})
    .on('page.dt', function() {
        console.log('page button clicked.');

        // set a flag for detecting whether [page] button is clicked
        // when 'preDraw' event is triggered
        $('body').data('paging', true);
    })
    .on('preDraw', function() {
        console.log('preDraw event occurred.');

        // if the 'preDraw' event is caused by clicking the [page] button
        if ($('body').data('paging')) {
            $('body').data('paging', false);

            if (!confirm('Are you sure to move?')) {
                return false;
            }
        }
    });

jsFiddle Demo page

This code seems to work fine just after clicking Yes or No on the confirm box.

However, if No is clicked on the confirm box, the clicked page button will no longer work.

After some investigation, the following fact was found.

When returning false in the reDraw event listener, dataTable will not be drawn as designed in the DataTables plugin.

But, the internal selected flag (or something) moves to the clicked page button.

For example, let's consider the case of clicking the button '2' when the button '1' is selected.

The confirm box will be shown, and then No will be clicked.

The dataTable remains showing the first page and the button '1' is still selected as expected.

However, contrary to appearances, button '2' does not work in this situation, button '1' is clickable (showing a confirm box when clicked) instead.

I have been struggling with this inflexible behavior of DataTables pagination for a long time.

It would be really appreciated if other solutions could be provided.


问:
symfony - form in multiples modal
I have 2 form fields rendered in 2 modal.
When submitting I want to retrieve in GET the values of the 2 fields.
I can only get the 2nd one.
How can I get the value of the 1st modal?
Thank you for your help

    <form action="{{ path('cart_valid') }}" method="POST" id="address_form">
        <input type="hidden" name="_token" value="{{ csrf_token('cart-' ~ app.user.id) }}"/>

Sélectionnez l'adresse de livraison

                    <select name="address" id="address" class="form-control">
                        {% for address in app.user.addresses %}
                            <option value="{{ address.id }}">{{ address.address }} {{ address.zipCode }} {{ address.city }}</option>
                        {% endfor %}
                    </select>

                    <button type="submit" class="btn bg-blue-grohe text-white">Je valide</button>

    </form>

    <form action="{{ path('cart_valid') }}" method="POST">
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
        <input type="hidden" name="_token" value="{{ csrf_token('cart-' ~ app.user.id) }}"/>

Souhaitez-vous laissez un message à cotre commercial GROHE avant de finaliser votre commande ?

#}
                        <textarea class="form-control" name="comment" placeholder="Ecrivez votre message ici" id="floatingTextarea2" style="height: 200px"></textarea>
                        Ecrivez votre message ici

                <button type="submit" class="btn bg-blue-grohe text-white w-100" >Je valide</button>

    </form>

<button class="btn btn-grohe text-white" data-bs-toggle="modal" data-bs-target="#modal-cart">Valider mon panier </butto
```

Title: symfony - form in multiples modal


问:
Show Additional Content in an edit-form in Symfony EasyAdmin
I use easyadmin 4 with symfony 6.1 and php 8.1.
I'm trying to display additional content on the edit-page of an crud controller. The Content is read-only and cannot be requested through a getter in the entity.

I need to run some php-code from a service and display a table on below the edit-form.

I first thought of using a custom fields, but those require a form type.

Any ideas?

Thanks for your help!

/Matthias


问:
add text to url with form and get method and auto submit
I want add ?orderby=popularity to url in address bar and auto submit onclick,
I write this code and work correctly.
Do you know better way?

```<code><form method="get">
  <label for="price">Price</label>
  <input name='orderby' id="price" value="price" type="radio" onclick='this.form.submit();' style="display: none;">
  <br>
  <label for="date">Date</label>
  <input name='orderby' id="date" value="date" type="radio" onclick='this.form.submit();' style="display: none;">
  <br>
  <label for="popularity">Popularity</label>
  <input name='orderby' id="popularity" value="popularity" type="radio" onclick='this.form.submit();' style="display: none;">
  <br>
</form>
</code>```

Body:
I want add ?orderby=popularity to url in address bar and auto submit onclick,
I write this code and work correctly.
Do you know better way?

<form method="get">
  Price
  <input name='orderby' id="price" value="price" type="radio" onclick='this.form.submit();' style="display: none;">

  Date
  <input name='orderby' id="date" value="date" type="radio" onclick='this.form.submit();' style="display: none;">

  Popularity
  <input name='orderby' id="popularity" value="popularity" type="radio" onclick='this.form.submit();' style="display: none;">

</form>


问:
Why does using lmer result in including quadratic fixed terms?
Running lmer results in additional quadratic fixed terms.

I don't think this is correct and I don't have a reason to include quadratic terms in the formula.

I was expecting only linear main effects and all interaction terms.

```<code>library(lmerTest)
library(sjPlot)

D <- read.csv(file = "data.csv")

D$Participant <- factor(D$Participant,order=FALSE)
D$Treatment   <- factor(D$Treatment,order=TRUE,levels = c("L0","L2","L4"))
D$Timepoint   <- as.numeric(D$Timepoint)

str(D)

'data.frame':   666 obs. of  6 variables:
Participant: Factor w/ 37 levels "O1","O10","O12",..: 19 21 30 4 7 13 21 21 36 36 ...
Treatment  : Ord.factor w/ 3 levels "L0"<"L2"<"L4": 2 1 2 1 3 2 2 3 1 3 ...
Timepoint  : num  1 1 1 1 1 1 1 1 1 1 ...
Rating     : num  6 4 3 NaN 4 4 NaN 2 NaN 4 ...
Wellbeing  : int  8 6 6 7 6 5 5 7 10 8 ...

mdl <- lmer(Rating ~ Treatment * Timepoint * Wellbeing + (Wellbeing | Participant), data = d,REML=F)

summary(mdl)

</code>```

Here's the output of summary(mdl):

```<code>Linear mixed model fit by maximum likelihood . t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: Rating ~ Treatment * Timepoint * Wellbeing + (Wellbeing | Participant)
   Data: d

     AIC      BIC   logLik deviance df.resid
  1723.3   1793.5   -845.6   1691.3      580

Scaled residuals:
    Min      1Q  Median      3Q     Max
-3.6038 -0.6125 -0.0316  0.6088  3.6012

Random effects:
 Groups      Name        Variance Std.Dev. Corr
 Participant (Intercept) 1.30174  1.1409
             Wellbeing   0.05398  0.2323   -0.83
 Residual                0.82435  0.9079
Number of obs: 596, groups:  Participant, 37

Fixed effects:
                                  Estimate Std. Error         df t value Pr(>|t|)
(Intercept)                      5.424e-01  3.118e-01  6.055e+01   1.739  0.08706 .
Treatment.L                      4.784e-02  3.705e-01  5.490e+02   0.129  0.89729
Treatment.Q                     -2.209e-01  3.702e-01  5.617e+02  -0.597  0.55097
Timepoint                        4.683e-02  5.515e-02  5.156e+02   0.849  0.39627
Wellbeing                        2.214e-01  6.669e-02  5.828e+01   3.320  0.00156 **
Treatment.L:Timepoint           -4.926e-02  9.418e-02  5.085e+02  -0.523  0.60118
Treatment.Q:Timepoint           -2.663e-02  9.500e-02  5.190e+02  -0.280  0.77932
Treatment.L:Wellbeing            4.982e-02  7.670e-02  5.509e+02   0.650  0.51623
Treatment.Q:Wellbeing           -1.197e-03  8.360e-02  5.684e+02  -0.014  0.98858
Timepoint:Wellbeing              9.874e-02  1.262e-02  5.273e+02   7.827 2.75e-14 ***
Treatment.L:Timepoint:Wellbeing -1.319e-02  2.019e-02  5.139e+02  -0.653  0.51390
Treatment.Q:Timepoint:Wellbeing  5.632e-04  2.256e-02  5.331e+02   0.025  0.98009
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Correlation of Fixed Effects:
            (Intr) Trtm.L Trtm.Q Timpnt Wllbng Tr.L:T Tr.Q:T Tr.L:W Tr.Q:W Tmpn:W T.L:T:
Treatment.L -0.118
Treatment.Q  0.012 -0.098
Timepoint   -0.600  0.139 -0.007
Wellbeing   -0.889  0.078  0.022  0.570
Trtmnt.L:Tm  0.091 -0.873  0.095 -0.152 -0.053
Trtmnt.Q:Tm -0.006  0.092 -0.865 -0.010 -0.030 -0.110
Trtmnt.L:Wl  0.049 -0.908  0.048 -0.079 -0.004  0.804 -0.053
Trtmnt.Q:Wl  0.024  0.047 -0.908 -0.046 -0.061 -0.052  0.803  0.003
Tmpnt:Wllbn  0.532 -0.077 -0.044 -0.905 -0.615  0.082  0.070  0.016  0.106
Trtmn.L:T:W -0.046  0.775 -0.056  0.085  0.006 -0.906  0.065 -0.869  0.015 -0.014
Trtmn.Q:T:W -0.025 -0.045  0.764  0.069  0.067  0.059 -0.906  0.008 -0.864 -0.141 -0.018
</code>```

The Treatment.L and Treatment.Q terms are Linear and Quadratic.  Why is Quadratic added here?

Thank you.

Body:
Running lmer results in additional quadratic fixed terms.

I don't think this is correct and I don't have a reason to include quadratic terms in the formula.

I was expecting only linear main effects and all interaction terms.

library(lmerTest)
library(sjPlot)

D <- read.csv(file = "data.csv")

D$Participant <- factor(D$Participant,order=FALSE)
D$Treatment   <- factor(D$Treatment,order=TRUE,levels = c("L0","L2","L4"))
D$Timepoint   <- as.numeric(D$Timepoint)

str(D)

'data.frame':   666 obs. of  6 variables:
Participant: Factor w/ 37 levels "O1","O10","O12",..: 19 21 30 4 7 13 21 21 36 36 ...
Treatment  : Ord.factor w/ 3 levels "L0"<"L2"<"L4": 2 1 2 1 3 2 2 3 1 3 ...
Timepoint  : num  1 1 1 1 1 1 1 1 1 1 ...
Rating     : num  6 4 3 NaN 4 4 NaN 2 NaN 4 ...
Wellbeing  : int  8 6 6 7 6 5 5 7 10 8 ...

mdl <- lmer(Rating ~ Treatment * Timepoint * Wellbeing + (Wellbeing | Participant), data = d,REML=F)

summary(mdl)

Here's the output of summary(mdl):

Linear mixed model fit by maximum likelihood . t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: Rating ~ Treatment * Timepoint * Wellbeing + (Wellbeing | Participant)
   Data: d

     AIC      BIC   logLik deviance df.resid
  1723.3   1793.5   -845.6   1691.3      580

Scaled residuals:
    Min      1Q  Median      3Q     Max
-3.6038 -0.6125 -0.0316  0.6088  3.6012

Random effects:
 Groups      Name        Variance Std.Dev. Corr
 Participant (Intercept) 1.30174  1.1409
             Wellbeing   0.05398  0.2323   -0.83
 Residual                0.82435  0.9079
Number of obs: 596, groups:  Participant, 37

Fixed effects:
                                  Estimate Std. Error         df t value Pr(>|t|)
(Intercept)                      5.424e-01  3.118e-01  6.055e+01   1.739  0.08706 .
Treatment.L                      4.784e-02  3.705e-01  5.490e+02   0.129  0.89729
Treatment.Q                     -2.209e-01  3.702e-01  5.617e+02  -0.597  0.55097
Timepoint                        4.683e-02  5.515e-02  5.156e+02   0.849  0.39627
Wellbeing                        2.214e-01  6.669e-02  5.828e+01   3.320  0.00156 **
Treatment.L:Timepoint           -4.926e-02  9.418e-02  5.085e+02  -0.523  0.60118
Treatment.Q:Timepoint           -2.663e-02  9.500e-02  5.190e+02  -0.280  0.77932
Treatment.L:Wellbeing            4.982e-02  7.670e-02  5.509e+02   0.650  0.51623
Treatment.Q:Wellbeing           -1.197e-03  8.360e-02  5.684e+02  -0.014  0.98858
Timepoint:Wellbeing              9.874e-02  1.262e-02  5.273e+02   7.827 2.75e-14 ***
Treatment.L:Timepoint:Wellbeing -1.319e-02  2.019e-02  5.139e+02  -0.653  0.51390
Treatment.Q:Timepoint:Wellbeing  5.632e-04  2.256e-02  5.331e+02   0.025  0.98009
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Correlation of Fixed Effects:
            (Intr) Trtm.L Trtm.Q Timpnt Wllbng Tr.L:T Tr.Q:T Tr.L:W Tr.Q:W Tmpn:W T.L:T:
Treatment.L -0.118
Treatment.Q  0.012 -0.098
Timepoint   -0.600  0.139 -0.007
Wellbeing   -0.889  0.078  0.022  0.570
Trtmnt.L:Tm  0.091 -0.873  0.095 -0.152 -0.053
Trtmnt.Q:Tm -0.006  0.092 -0.865 -0.010 -0.030 -0.110
Trtmnt.L:Wl  0.049 -0.908  0.048 -0.079 -0.004  0.804 -0.053
Trtmnt.Q:Wl  0.024  0.047 -0.908 -0.046 -0.061 -0.052  0.803  0.003
Tmpnt:Wllbn  0.532 -0.077 -0.044 -0.905 -0.615  0.082  0.070  0.016  0.106
Trtmn.L:T:W -0.046  0.775 -0.056  0.085  0.006 -0.906  0.065 -0.869  0.015 -0.014
Trtmn.Q:T:W -0.025 -0.045  0.764  0.069  0.067  0.059 -0.906  0.008 -0.864 -0.141 -0.018

The Treatment.L and Treatment.Q terms are Linear and Quadratic.  Why is Quadratic added here?

Thank you.


问:
where is the git config credential.helper value coming from?
I have multiple git repositories

On some repositories git config credential.helper returns manager while on others it returns helper-selector.

Where are these different values configured?
It does not exist in the .git/config file.


问:
How to Create a dynamic date filter tables in spring boot?
My model

```<code>
public class GoldLedger {
    @jakarta.persistence.Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    @DateTimeFormat(iso = ISO.DATE)
    private LocalDate pledgeddate;
    @Column(unique = true)
    private String billnum;
    private Long billamount;

    private String name;

    @DateTimeFormat(iso = ISO.DATE)
    private LocalDate returndate;

</code>```

my controller

```<code>@Controller
public class GoldLedgerController {

    @Autowired
    private GoldLedgerService goldLedgerService;

    @GetMapping("/goldledger")
    public String getAllGoldLedgerEntry(Model model,@Param("keyword") String keyword) {

        model.addAttribute("goldledgerall", goldLedgerService.getAllGoldLed(keyword));
        model.addAttribute("keyword",keyword);
        return "goldledger";

    }

    @RequestMapping(value = "/goldledger/findGoldDataById/", method = RequestMethod.GET)
    @ResponseBody
    public Optional<GoldLedger> findGoldDataById(Long id) {
        return goldLedgerService.findGoldData(id);
    }

    @RequestMapping(value = "/goldLedger/addToGoldLedger", method = { RequestMethod.PUT, RequestMethod.GET })
    public String addToLedger(GoldLedger goldLedger) {
        goldLedgerService.addToLedger(goldLedger);
        return "redirect:/newgoldbill";
    }

}
</code>```

my service

```<code>@Service
public class GoldLedgerService {
@Autowired
private GoldLedgerRepository goldLedgerRepository;

public List<GoldLedger> getAllGoldLed(String keyword) {
    if(keyword != null) {
        return goldLedgerRepository.search(keyword);
    }
    else {
        return goldLedgerRepository.findAll();
    }

}

public void addToLedger(GoldLedger goldLedger) {

    goldLedgerRepository.save(goldLedger);

}

public Optional<GoldLedger> findGoldData(Long id) {
return goldLedgerRepository.findById(id);
}

}
</code>```

my repository

```<code>public interface GoldLedgerRepository extends JpaRepository<GoldLedger, Long> {

    @Query("SELECT c FROM GoldLedger c WHERE CONCAT(c.billnum, ' ') LIKE %?1%")
    public List<GoldLedger> search(String Keyword);
}

</code>```

my html

```<code>                                <table
                                    class="table table-bordered border-dark table-striped table-hover my-3" id="table">

                                    <thead>
                                        <tr style="text-align: center;">

                                            <th scope="col">Bill Number</th>
                                            <th scope="col">Pledged Date</th>
                                            <th scope="col">Bill Amount</th>

                                            <th scope="col">Customer Name</th>

                                            <th scope="col">Return Date</th>

                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr th:each="goldledger:${goldledgerall}"
                                            th:style="${goldledger.onepercent}!= null? 'background-color:red'">

                                            <th scope="row" th:text="${goldledger.billnum}"
                                                style="text-align: center;"></th>
                                            <td th:text="${goldledger.pledgeddate}" nowrap></td>
                                            <td th:text="${goldledger.billamount}"></td>

                                            <td th:text="${goldledger.name}"></td>

                                            <td th:text="${goldledger.itemdescription}"></td>
                                            <td th:text="${goldledger.itemweight}"></td>
                                            <td th:text="${goldledger.returndate}" nowrap></td>

                                            <td>

</code>```

I want to filter and show my table data based on user selection like this

or by using to date pickers.but i am stuck here .i  researched through a lot but i cant find any possible solution.i am a beginner and took a real time scenario of my father's business to develop an spring app,this is my last stage in the whole app.someone help me with this.

Body:
My model

public class GoldLedger {
    @jakarta.persistence.Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    @DateTimeFormat(iso = ISO.DATE)
    private LocalDate pledgeddate;
    @Column(unique = true)
    private String billnum;
    private Long billamount;

    private String name;

    @DateTimeFormat(iso = ISO.DATE)
    private LocalDate returndate;

my controller

@Controller
public class GoldLedgerController {

    @Autowired
    private GoldLedgerService goldLedgerService;

    @GetMapping("/goldledger")
    public String getAllGoldLedgerEntry(Model model,@Param("keyword") String keyword) {

        model.addAttribute("goldledgerall", goldLedgerService.getAllGoldLed(keyword));
        model.addAttribute("keyword",keyword);
        return "goldledger";

    }

    @RequestMapping(value = "/goldledger/findGoldDataById/", method = RequestMethod.GET)
    @ResponseBody
    public Optional<GoldLedger> findGoldDataById(Long id) {
        return goldLedgerService.findGoldData(id);
    }

    @RequestMapping(value = "/goldLedger/addToGoldLedger", method = { RequestMethod.PUT, RequestMethod.GET })
    public String addToLedger(GoldLedger goldLedger) {
        goldLedgerService.addToLedger(goldLedger);
        return "redirect:/newgoldbill";
    }

}

my service

@Service
public class GoldLedgerService {
@Autowired
private GoldLedgerRepository goldLedgerRepository;

public List<GoldLedger> getAllGoldLed(String keyword) {
    if(keyword != null) {
        return goldLedgerRepository.search(keyword);
    }
    else {
        return goldLedgerRepository.findAll();
    }

}

public void addToLedger(GoldLedger goldLedger) {

    goldLedgerRepository.save(goldLedger);

}

public Optional<GoldLedger> findGoldData(Long id) {
return goldLedgerRepository.findById(id);
}

}

my repository

public interface GoldLedgerRepository extends JpaRepository<GoldLedger, Long> {

    @Query("SELECT c FROM GoldLedger c WHERE CONCAT(c.billnum, ' ') LIKE %?1%")
    public List<GoldLedger> search(String Keyword);
}

my html

                                            Bill Number
                                            Pledged Date
                                            Bill Amount

                                            Customer Name

                                            Return Date

I want to filter and show my table data based on user selection like this

or by using to date pickers.but i am stuck here .i  researched through a lot but i cant find any possible solution.i am a beginner and took a real time scenario of my father's business to develop an spring app,this is my last stage in the whole app.someone help me with this.


问:
DB2 increasing number of bufferpools for better performing?
we have two environments(ENV1, ENV2), which is configured almost equal.
So what I recognized is that some queries are running sigificantly longer on ENV2.
I started an analysis and find out that it will be made a lot of I/O.
The first thing what I suspected is to take a look at the buffer pools and find out that ENV2 has fewer buffer pools size. But would it be the reason for the longer queries? In both environments, I use only one tablespace for data which is per default referenced to IBMDEFAULTBP. The next is the amount of memory pools, in my performance monitoring tool, there will be shown a difference, ENV1 has more memory pools.
How I can affect the size of memory pools?

Here is a snippet from the result:

ENV1:

```<code>Num Bufferpools 13
Num Memorypools 15
</code>```

We have here further buffer pools like BP4CONSOLE, IBMIOCMBUFFPOOL8K, HEALTHBUFFPOOL, ...

ENV2

```<code>Num Bufferpools 5
Num Memorypools 10

</code>```

Body:
we have two environments(ENV1, ENV2), which is configured almost equal.
So what I recognized is that some queries are running sigificantly longer on ENV2.
I started an analysis and find out that it will be made a lot of I/O.
The first thing what I suspected is to take a look at the buffer pools and find out that ENV2 has fewer buffer pools size. But would it be the reason for the longer queries? In both environments, I use only one tablespace for data which is per default referenced to IBMDEFAULTBP. The next is the amount of memory pools, in my performance monitoring tool, there will be shown a difference, ENV1 has more memory pools.
How I can affect the size of memory pools?

Here is a snippet from the result:

ENV1:

Num Bufferpools 13
Num Memorypools 15

We have here further buffer pools like BP4CONSOLE, IBMIOCMBUFFPOOL8K, HEALTHBUFFPOOL, ...

ENV2

Num Bufferpools 5
Num Memorypools 10


问:
Get displays system names from d3shot python
I'm making a program to catch an image from one display and analyze it. I'm using d3dshot. I want to show the beginning names of connected displays.

```<code>import d3dshot
import time

d = d3dshot.create()
d.display = d.displays[2]
for i, x in enumerate(d.displays):
    print(i, ". ",x)

</code>```

The problem is that I get only this:

0 .  <Display name=Generic PnP Monitor adapter=NVIDIA GeForce GTX 1060 6GB resolution=1920x1080 rotation=0 scale_factor=1.0 primary=True> 1 .  <Display name=Generic PnP Monitor adapter=NVIDIA GeForce GTX 1060 6GB resolution=1824x1026 rotation=0 scale_factor=1.0 primary=False> 2 .  <Display name=Generic PnP Monitor adapter=NVIDIA GeForce GTX 1060 6GB resolution=1920x1080 rotation=0 scale_factor=1.0 primary=False>

Is there a way to get system names of monitors?

I was trying to use screeninfo but the results also weren't useful:

Monitor(x=1920, y=0, width=1824, height=1026, width_mm=820, height_mm=460, name='\\\\.\\DISPLAY1', is_primary=False) Monitor(x=-1920, y=0, width=1920, height=1080, width_mm=531, height_mm=299, name='\\\\.\\DISPLAY2', is_primary=False) Monitor(x=0, y=0, width=1920, height=1080, width_mm=521, height_mm=293, name='\\\\.\\DISPLAY3', is_primary=True)

Body:
I'm making a program to catch an image from one display and analyze it. I'm using d3dshot. I want to show the beginning names of connected displays.

import d3dshot
import time

d = d3dshot.create()
d.display = d.displays[2]
for i, x in enumerate(d.displays):
    print(i, ". ",x)

The problem is that I get only this:

0 .  <Display name=Generic PnP Monitor adapter=NVIDIA GeForce GTX 1060 6GB resolution=1920x1080 rotation=0 scale_factor=1.0 primary=True> 1 .  <Display name=Generic PnP Monitor adapter=NVIDIA GeForce GTX 1060 6GB resolution=1824x1026 rotation=0 scale_factor=1.0 primary=False> 2 .  <Display name=Generic PnP Monitor adapter=NVIDIA GeForce GTX 1060 6GB resolution=1920x1080 rotation=0 scale_factor=1.0 primary=False>

Is there a way to get system names of monitors?

I was trying to use screeninfo but the results also weren't useful:

Monitor(x=1920, y=0, width=1824, height=1026, width_mm=820, height_mm=460, name='\\\\.\\DISPLAY1', is_primary=False) Monitor(x=-1920, y=0, width=1920, height=1080, width_mm=531, height_mm=299, name='\\\\.\\DISPLAY2', is_primary=False) Monitor(x=0, y=0, width=1920, height=1080, width_mm=521, height_mm=293, name='\\\\.\\DISPLAY3', is_primary=True)


问:
Don´t run Editor CloudShell
enter image description here
Sorry, hepd me. How I can run the Editor Cloud Shell on GoogleCloudShell
I need to solve this problem
When I open the console dont run. CloudShell not conect whit the server or i don´t have all permmises</p>

Title: Don´t run Editor CloudShell


问:
How to make copied SVGs as clear as they are displayed?
I'm displaying SVGs in  tags. With viewBox these images could be scaled without losing clarity. However, when I copy these images (and paste them into PowerPoint, etc.), they won't be as clear as they are displayed.

How could I make copied images clear? And could this be done without using a canvas?

Example SVG markup:

<svg id="mol-638318-0540814976"
    xmlns="http://www.w3.org/2000/svg" width="84" height="40" viewBox="0 0 84 40">

    <text x="26" y="20">C</text>
    <text x="58" y="20">C</text>
    <line x1="32" y1="20" x2="52" y2="20"></line>
</svg>
```

Thanks!

Body:
I'm displaying SVGs in  tags. With viewBox these images could be scaled without losing clarity. However, when I copy these images (and paste them into PowerPoint, etc.), they won't be as clear as they are displayed.

How could I make copied images clear? And could this be done without using a canvas?

Example SVG markup:

<svg id="mol-638318-0540814976"
    xmlns="http://www.w3.org/2000/svg" width="84" height="40" viewBox="0 0 84 40">

    <text x="26" y="20">C</text>
    <text x="58" y="20">C</text>
    <line x1="32" y1="20" x2="52" y2="20"></line>
</svg>

Thanks!


问:
Android Alarm Manager doesn't fire alarm when application is closed
guys, am currently building an application with compose, and i need to fire a notification at a given time to users, so whenever users click on a button on my list item, i want to get the time of that item and set an alarm pending intent for it, and fire it when the times reaches,
So am  working with android alarm manager, but whenever i close my application the alarm doesn't broadcast my notification, but if i leave it open, it fires the alarm notification successfully, i dont know what i am doing wrong cause from what i know my application isnt responsible for firing the alarm, cause the android system does this for us,

so here is my code that i have tried with Alarm Manager

Funtion to Schedule Notification

`

```<code>    @RequiresApi(api = Build.VERSION_CODES.M)
    fun scheduleNotification(calendar: Calendar, context: Context, taskInfo:FixtureAlarm) {

    val alarmManager = context.getSystemService(ALARM_SERVICE) as AlarmManager

    // adding intent and pending intent to go to AlarmReceiver Class in future
    val intent = Intent(context, FixtureNotificationReceiver::class.java)
    intent.putExtra("fixture", taskInfo)
    val pendingIntent = PendingIntent.getBroadcast(context, taskInfo.id, intent,
        PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)

    // when using setAlarmClock() it displays a notification until alarm rings and when pressed it       takes us to mainActivity
    val mainActivityIntent = Intent(context, MainActivity::class.java)
    val basicPendingIntent = PendingIntent.getActivity(context, taskInfo.id, mainActivityIntent,     PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)
    // creating clockInfo instance
    val clockInfo = AlarmManager.AlarmClockInfo(Calendar.getInstance().also { it.add(Calendar.SECOND,10) }.timeInMillis, basicPendingIntent)
    // setting the alarm
    alarmManager.setExact(AlarmManager.RTC_WAKEUP,Calendar.getInstance().also { it.add(Calendar.SECOND,10) }.timeInMillis, pendingIntent)
    Toast.makeText(context, "Scheduled ", Toast.LENGTH_LONG).show()
    }
</code>```

`

My BroadCast Receiver

```<code>    class FixtureNotificationReceiver() : BroadcastReceiver() {

    private var notificationManager: NotificationManagerCompat? = null

    override fun onReceive(p0: Context?, p1: Intent?) {

        val taskInfo = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
            p1?.getParcelableExtra("fixture",FixtureAlarm::class.java)
        } else {
            p1?.getParcelableExtra("fixture") as? FixtureAlarm
        }
        Log.d("SVTRECIEVED","ALARTM RECIEVED ${taskInfo?.homeTeam.toString()}")
        // tapResultIntent gets executed when user taps the notification
        if(taskInfo!=null) {
            val tapResultIntent = Intent(p0, MainActivity::class.java)
            tapResultIntent.putExtra("fixture", taskInfo)
            tapResultIntent.flags = Intent.FLAG_ACTIVITY_SINGLE_TOP
            val pendingIntent: PendingIntent =
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                    getActivity(p0, 0, tapResultIntent, FLAG_UPDATE_CURRENT or FLAG_IMMUTABLE)
                } else {
                    getActivity(p0, 0, tapResultIntent, PendingIntent.FLAG_UPDATE_CURRENT)
                }

            val notification = p0?.let {
                NotificationCompat.Builder(it, FIXTURESCHANNEL_ID)
                    .setContentTitle("Fixture Reminder")
                    .setContentText("${taskInfo?.awayTeam} VS ${taskInfo.homeTeam} is about to start, open SportVectru and get live updates ")
                    .setSmallIcon(R.mipmap.ic_launcher)
                    .setAutoCancel(true)
                    .setPriority(NotificationCompat.PRIORITY_HIGH)
                    .setContentIntent(pendingIntent)
                    .setDefaults(NotificationCompat.DEFAULT_ALL)
                    .setDefaults(NotificationCompat.DEFAULT_SOUND)
                    .setDefaults(NotificationCompat.DEFAULT_VIBRATE)
                    .setPriority(NotificationCompat.PRIORITY_HIGH).build()}
                val notificationtone = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM)
                val r = RingtoneManager.getRingtone(p0, notificationtone)
                r.play()

            notificationManager = p0?.let { NotificationManagerCompat.from(it) }

            notification?.let { taskInfo.let { it1 -> if (ActivityCompat.checkSelfPermission(
                    p0,
                    Manifest.permission.POST_NOTIFICATIONS
                ) != PackageManager.PERMISSION_GRANTED
            ) {
                Toast.makeText(p0, "Permission for showing notification is disabled", Toast.LENGTH_SHORT).show()
                return
            }

                notificationManager?.notify(it1.id, it)

                }
            }
        }
    }
    }
</code>```

Added it to my Manifest
`

```<code>    <receiver android:name=".dormain.notifications.pendingNotification.FixtureNotificationReceiver"
        android:enabled="true"
     />
</code>```

`

I even granted Permission

```<code>    <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
    <uses-permission android:name="android.permission.USE_EXACT_ALARM"/>
    <uses-permission android:name="android.permission.BROADCAST_STICKY"/>
    <uses-permission android:name="com.android.alarm.permission.SET_ALARM"/>
    <uses-permission android:name="android.permission.WAKE_LOCK"/>
</code>```

But it still doesnt work, notification is never shown when application is closed.

I have also disabled battery Optimization for my application, doesnt work.

Body:
guys, am currently building an application with compose, and i need to fire a notification at a given time to users, so whenever users click on a button on my list item, i want to get the time of that item and set an alarm pending intent for it, and fire it when the times reaches,
So am  working with android alarm manager, but whenever i close my application the alarm doesn't broadcast my notification, but if i leave it open, it fires the alarm notification successfully, i dont know what i am doing wrong cause from what i know my application isnt responsible for firing the alarm, cause the android system does this for us,

so here is my code that i have tried with Alarm Manager

Funtion to Schedule Notification

`

    @RequiresApi(api = Build.VERSION_CODES.M)
    fun scheduleNotification(calendar: Calendar, context: Context, taskInfo:FixtureAlarm) {

    val alarmManager = context.getSystemService(ALARM_SERVICE) as AlarmManager

    // adding intent and pending intent to go to AlarmReceiver Class in future
    val intent = Intent(context, FixtureNotificationReceiver::class.java)
    intent.putExtra("fixture", taskInfo)
    val pendingIntent = PendingIntent.getBroadcast(context, taskInfo.id, intent,
        PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)

    // when using setAlarmClock() it displays a notification until alarm rings and when pressed it       takes us to mainActivity
    val mainActivityIntent = Intent(context, MainActivity::class.java)
    val basicPendingIntent = PendingIntent.getActivity(context, taskInfo.id, mainActivityIntent,     PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE)
    // creating clockInfo instance
    val clockInfo = AlarmManager.AlarmClockInfo(Calendar.getInstance().also { it.add(Calendar.SECOND,10) }.timeInMillis, basicPendingIntent)
    // setting the alarm
    alarmManager.setExact(AlarmManager.RTC_WAKEUP,Calendar.getInstance().also { it.add(Calendar.SECOND,10) }.timeInMillis, pendingIntent)
    Toast.makeText(context, "Scheduled ", Toast.LENGTH_LONG).show()
    }

`

My BroadCast Receiver

    class FixtureNotificationReceiver() : BroadcastReceiver() {

    private var notificationManager: NotificationManagerCompat? = null

    override fun onReceive(p0: Context?, p1: Intent?) {

        val taskInfo = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
            p1?.getParcelableExtra("fixture",FixtureAlarm::class.java)
        } else {
            p1?.getParcelableExtra("fixture") as? FixtureAlarm
        }
        Log.d("SVTRECIEVED","ALARTM RECIEVED ${taskInfo?.homeTeam.toString()}")
        // tapResultIntent gets executed when user taps the notification
        if(taskInfo!=null) {
            val tapResultIntent = Intent(p0, MainActivity::class.java)
            tapResultIntent.putExtra("fixture", taskInfo)
            tapResultIntent.flags = Intent.FLAG_ACTIVITY_SINGLE_TOP
            val pendingIntent: PendingIntent =
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                    getActivity(p0, 0, tapResultIntent, FLAG_UPDATE_CURRENT or FLAG_IMMUTABLE)
                } else {
                    getActivity(p0, 0, tapResultIntent, PendingIntent.FLAG_UPDATE_CURRENT)
                }

            val notification = p0?.let {
                NotificationCompat.Builder(it, FIXTURESCHANNEL_ID)
                    .setContentTitle("Fixture Reminder")
                    .setContentText("${taskInfo?.awayTeam} VS ${taskInfo.homeTeam} is about to start, open SportVectru and get live updates ")
                    .setSmallIcon(R.mipmap.ic_launcher)
                    .setAutoCancel(true)
                    .setPriority(NotificationCompat.PRIORITY_HIGH)
                    .setContentIntent(pendingIntent)
                    .setDefaults(NotificationCompat.DEFAULT_ALL)
                    .setDefaults(NotificationCompat.DEFAULT_SOUND)
                    .setDefaults(NotificationCompat.DEFAULT_VIBRATE)
                    .setPriority(NotificationCompat.PRIORITY_HIGH).build()}
                val notificationtone = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM)
                val r = RingtoneManager.getRingtone(p0, notificationtone)
                r.play()

            notificationManager = p0?.let { NotificationManagerCompat.from(it) }

            notification?.let { taskInfo.let { it1 -> if (ActivityCompat.checkSelfPermission(
                    p0,
                    Manifest.permission.POST_NOTIFICATIONS
                ) != PackageManager.PERMISSION_GRANTED
            ) {
                Toast.makeText(p0, "Permission for showing notification is disabled", Toast.LENGTH_SHORT).show()
                return
            }

                notificationManager?.notify(it1.id, it)

                }
            }
        }
    }
    }

Added it to my Manifest
`

    <receiver android:name=".dormain.notifications.pendingNotification.FixtureNotificationReceiver"
        android:enabled="true"
     />

`

I even granted Permission

    <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
    <uses-permission android:name="android.permission.USE_EXACT_ALARM"/>
    <uses-permission android:name="android.permission.BROADCAST_STICKY"/>
    <uses-permission android:name="com.android.alarm.permission.SET_ALARM"/>
    <uses-permission android:name="android.permission.WAKE_LOCK"/>

But it still doesnt work, notification is never shown when application is closed.

I have also disabled battery Optimization for my application, doesnt work.


问:
wasm-pack-plugin: Can't import the named export (imported as 'wasm') from default-exporting module (only default export is available)
I'm using the @wasm-tool/wasm-pack-plugin package and getting the following error:

```<code>ERROR in ./src/wasm-lib/pkg/index_bg.js 15:14-29

wasm-pack-plugin: Can't import the named export (imported as 'wasm') from default-exporting module (only default export is available)
</code>```

Config:

```<code>  crateDirectory: path.resolve(__dirname, "wasm-lib"),
  outDir: path.resolve(__dirname, "src/wasm-lib/pkg"),
})
</code>```

The ./src/wasm-lib/pkg/index_bg.js file is auto-generated and looks like this:

```<code>import * as wasm from './index_bg.wasm';

function _assertNum(n) {
    if (typeof(n) !== 'number') throw new Error('expected a number argument');
}
/**
* @param {number} left
* @param {number} right
* @returns {number}
*/
export function sort_array(left, right) {
    _assertNum(left);
    _assertNum(right);
    const ret = wasm.sort_array(left, right);
    return ret >>> 0;
}
</code>```

Body:
I'm using the @wasm-tool/wasm-pack-plugin package and getting the following error:

ERROR in ./src/wasm-lib/pkg/index_bg.js 15:14-29

wasm-pack-plugin: Can't import the named export (imported as 'wasm') from default-exporting module (only default export is available)

Config:

  crateDirectory: path.resolve(__dirname, "wasm-lib"),
  outDir: path.resolve(__dirname, "src/wasm-lib/pkg"),
})

The ./src/wasm-lib/pkg/index_bg.js file is auto-generated and looks like this:

import * as wasm from './index_bg.wasm';

function _assertNum(n) {
    if (typeof(n) !== 'number') throw new Error('expected a number argument');
}
/**
* @param {number} left
* @param {number} right
* @returns {number}
*/
export function sort_array(left, right) {
    _assertNum(left);
    _assertNum(right);
    const ret = wasm.sort_array(left, right);
    return ret >>> 0;
}


问:
Pls Advice for Multi select dependent dropdown to display in Select box
The multiselect dependent dropdown code below works perfectly. The issue is that I need this to be displayed in a "Select Option Box," similar to a Pillbox, and when the user clicks on it, it should show a value option in a dropdown from which the user can choose a value from Country and State ..

Need this to be displayed and work like a "Select Option Box," similar to this Example - ( Multiselect → Basic example) Link → https://mdbootstrap.com/docs/standard/extended/multiselect/#example2

```<code><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<form class="form-signin" method="post" id="serchform" action="search-profile-result.php?page_id=1">
  <label for="country">Country</label>
  <select class="form-control" id="country" name="country[]" required="required" multiple>
    <option value="USA" label="USA">USA</option>
    <option value="UK" label="UK">UK</option>
    <option value="Canada" label="Canada">Canada</option>
  </select>
  <label for="state">State</label>
  <select id="state" name="state[]" class="form-control" required="required" multiple>
    <option disabled>Select Country First</option>
  </select>
</form>

<script>
$(function() {
  //Populate an Object: { Country: [ States... ] }
  var states = {};
  states['USA'] = new Array('Alabama', 'Alaska', 'Arizona', 'Other');
  states['UK'] = new Array('Aberdeenshire', 'Angus', 'Antrim', 'Other');
  states['Canada'] = new Array('Alberta', 'British-Columbia', 'Manitoba', 'Other');

  $("#country").change(function() {
    // Array Variable to contain all selected
    var selected = [];
    // Iterate all selected items
    $.each($(this).val(), function(i, country) {
      selected = selected.concat(states[country]);
    });
    // Remove previous options
    $("#state > option").remove();
    if (selected.length === 0) {
      // Add placeholder and Stop
      $("#state").append("<option disabled>Select Country First</option>");
      return false;
    }
    selected.sort();
    // Populate Options
    $.each(selected, function(i, state) {
      $("<option>").html(state).appendTo("#state");
    });
  });
});
</script>
</code>```

Body:
The multiselect dependent dropdown code below works perfectly. The issue is that I need this to be displayed in a "Select Option Box," similar to a Pillbox, and when the user clicks on it, it should show a value option in a dropdown from which the user can choose a value from Country and State ..

Need this to be displayed and work like a "Select Option Box," similar to this Example - ( Multiselect → Basic example) Link → https://mdbootstrap.com/docs/standard/extended/multiselect/#example2

<form class="form-signin" method="post" id="serchform" action="search-profile-result.php?page_id=1">
  Country
  <select class="form-control" id="country" name="country[]" required="required" multiple>
    <option value="USA" label="USA">USA</option>
    <option value="UK" label="UK">UK</option>
    <option value="Canada" label="Canada">Canada</option>
  </select>
  State
  <select id="state" name="state[]" class="form-control" required="required" multiple>
    <option disabled>Select Country First</option>
  </select>
</form>


问:
Nested list in python doesn't behave as expected
in python let's write

a=[[0]*2]*2
a[0][0] = 55
print(a)
```

I would expected the following output:
[[55, 0], [0,0]]

Body:
in python let's write

a=[[0]*2]*2
a[0][0] = 55
print(a)

I would expected the following output:
[[55, 0], [0,0]]


问:
PyBind11 generate Docstrings without Module name
I am using PyBind11 to wrap C++ code for Python. Specifically, I have a package named "MyPackage" and a Module in there named "core". I now have exposed a class names "MyClass" with a function "MyFun". When I expose this and add a docstring "test" to it, the generated docstring is

def MyFun(self: MyPackage.core.MyClass) -> None

The "MyPackage.core." in the docstring makes this function signature long and difficult to read. Is there a way to generate the docstrings without this prefix? Or, at least, remove the ".core." because the user doesn't know what this even means.

Thank you!


问:
TypeError: this constructor takes no arguments. __init__() takes 1 positional argument but 4 were given
TypeError: this constructor takes no arguments

```<code>class CustomScaler(BaseEstimator,TransformerMixin):

    # init or what information we need to declare a CustomScaler object
    # and what is calculated/declared as we do

    def __init__(self,columns,copy=True,with_mean=True,with_std=True):

        # scaler is nothing but a Standard Scaler object
        self.scaler = StandardScaler(copy,with_mean,with_std)
        # with some columns 'twist'
        self.columns = columns
        self.mean_ = None
        self.var_ = None
</code>```
```<code> # the fit method, which, again based on StandardScale

    def fit(self, X, y=None):
        self.scaler.fit(X[self.columns], y)
        self.mean_ = np.mean(X[self.columns])
        self.var_ = np.var(X[self.columns])
        return self

    # the transform method which does the actual scaling

    def transform(self, X, y=None, copy=None):

        # record the initial order of the columns
        init_col_order = X.columns

        # scale all features that you chose when creating the instance of the class
        X_scaled = pd.DataFrame(self.scaler.transform(X[self.columns]), columns=self.columns)

        # declare a variable containing all information that was not scaled
        X_not_scaled = X.loc[:,~X.columns.isin(self.columns)]

        # return a data frame which contains all scaled features and all 'not scaled' features
        # use the original order (that you recorded in the beginning)
        return pd.concat([X_not_scaled, X_scaled], axis=1)[init_col_order]
</code>```
```<code>unscaled_inputs.columns.values
</code>```
```<code>olumns_to_omit = ['Reason_1', 'Reason_2', 'Reason_3', 'Reason_4', 'Education']
</code>```
```<code>columns_to_scale = [x for x in unscaled_inputs.columns.values if x not in columns_to_omit]
</code>```
```<code>absenteeism_scaler = CustomScaler(columns_to_scale)
</code>```

when i run the last line of code i get " init() takes 1 positional argument but 4 were given"

This may be a dumb question, but I am having a difficult time figuring out the error. I created a class called CustomScaler but when I try running it, it's giving me a typerror. tried to change init with multiple underscores but nothing works. changed the class, the function, ..etc. keep getting TypeError: this constructor takes no arguments.

```<code># import the libraries needed to create the Custom Scaler
# note that all of them are a part of the sklearn package
# moreover, one of them is actually the StandardScaler module,
# so you can imagine that the Custom Scaler is build on it

from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.preprocessing import StandardScaler

# create the Custom Scaler class

class CustomScaler(BaseEstimator,TransformerMixin):

    # init or what information we need to declare a CustomScaler object
    # and what is calculated/declared as we do

    def __init__(self,columns,copy=True,with_mean=True,with_std=True):

        # scaler is nothing but a Standard Scaler object
        self.scaler = StandardScaler(copy,with_mean,with_std)
        # with some columns 'twist'
        self.columns = columns
        self.mean_ = None
        self.var_ = None

    # the fit method, which, again based on StandardScale

    def fit(self, X, y=None):
        self.scaler.fit(X[self.columns], y)
        self.mean_ = np.mean(X[self.columns])
        self.var_ = np.var(X[self.columns])
        return self

    # the transform method which does the actual scaling

    def transform(self, X, y=None, copy=None):

        # record the initial order of the columns
        init_col_order = X.columns

        # scale all features that you chose when creating the instance of the class
        X_scaled = pd.DataFrame(self.scaler.transform(X[self.columns]), columns=self.columns)

        # declare a variable containing all information that was not scaled
        X_not_scaled = X.loc[:,~X.columns.isin(self.columns)]

        # return a data frame which contains all scaled features and all 'not scaled' features
        # use the original order (that you recorded in the beginning)
        return pd.concat([X_not_scaled, X_scaled], axis=1)[init_col_order]
</code>```

Body:
TypeError: this constructor takes no arguments

class CustomScaler(BaseEstimator,TransformerMixin):

    # init or what information we need to declare a CustomScaler object
    # and what is calculated/declared as we do

    def __init__(self,columns,copy=True,with_mean=True,with_std=True):

        # scaler is nothing but a Standard Scaler object
        self.scaler = StandardScaler(copy,with_mean,with_std)
        # with some columns 'twist'
        self.columns = columns
        self.mean_ = None
        self.var_ = None

 # the fit method, which, again based on StandardScale

    def fit(self, X, y=None):
        self.scaler.fit(X[self.columns], y)
        self.mean_ = np.mean(X[self.columns])
        self.var_ = np.var(X[self.columns])
        return self

    # the transform method which does the actual scaling

    def transform(self, X, y=None, copy=None):

        # record the initial order of the columns
        init_col_order = X.columns

        # scale all features that you chose when creating the instance of the class
        X_scaled = pd.DataFrame(self.scaler.transform(X[self.columns]), columns=self.columns)

        # declare a variable containing all information that was not scaled
        X_not_scaled = X.loc[:,~X.columns.isin(self.columns)]

        # return a data frame which contains all scaled features and all 'not scaled' features
        # use the original order (that you recorded in the beginning)
        return pd.concat([X_not_scaled, X_scaled], axis=1)[init_col_order]

unscaled_inputs.columns.values

olumns_to_omit = ['Reason_1', 'Reason_2', 'Reason_3', 'Reason_4', 'Education']

columns_to_scale = [x for x in unscaled_inputs.columns.values if x not in columns_to_omit]

absenteeism_scaler = CustomScaler(columns_to_scale)

when i run the last line of code i get " init() takes 1 positional argument but 4 were given"

This may be a dumb question, but I am having a difficult time figuring out the error. I created a class called CustomScaler but when I try running it, it's giving me a typerror. tried to change init with multiple underscores but nothing works. changed the class, the function, ..etc. keep getting TypeError: this constructor takes no arguments.

# import the libraries needed to create the Custom Scaler
# note that all of them are a part of the sklearn package
# moreover, one of them is actually the StandardScaler module,
# so you can imagine that the Custom Scaler is build on it

from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.preprocessing import StandardScaler

# create the Custom Scaler class

class CustomScaler(BaseEstimator,TransformerMixin):

    # init or what information we need to declare a CustomScaler object
    # and what is calculated/declared as we do

    def __init__(self,columns,copy=True,with_mean=True,with_std=True):

        # scaler is nothing but a Standard Scaler object
        self.scaler = StandardScaler(copy,with_mean,with_std)
        # with some columns 'twist'
        self.columns = columns
        self.mean_ = None
        self.var_ = None

    # the fit method, which, again based on StandardScale

    def fit(self, X, y=None):
        self.scaler.fit(X[self.columns], y)
        self.mean_ = np.mean(X[self.columns])
        self.var_ = np.var(X[self.columns])
        return self

    # the transform method which does the actual scaling

    def transform(self, X, y=None, copy=None):

        # record the initial order of the columns
        init_col_order = X.columns

        # scale all features that you chose when creating the instance of the class
        X_scaled = pd.DataFrame(self.scaler.transform(X[self.columns]), columns=self.columns)

        # declare a variable containing all information that was not scaled
        X_not_scaled = X.loc[:,~X.columns.isin(self.columns)]

        # return a data frame which contains all scaled features and all 'not scaled' features
        # use the original order (that you recorded in the beginning)
        return pd.concat([X_not_scaled, X_scaled], axis=1)[init_col_order]


问:
Get all hyperlinks in modern SPO page
because we are rebranding and renaming our intranet (Sharepoint Online), I need to make an index of all sites, pages and links between them to make sure none off the links will be broken afterwards.

Using PNP Powershell I can list all pages from a site but I'm strugling on how to crawl for any hyperlinks on the page. So far I came up with this

```<code>#Connect to PnP
Connect-PnPOnline -Url $SiteURL -Interactive

#Get All Site Pages
$SitePages = Get-PnPListItem -List "Site Pages"

$PagesDataColl = @()
#Collect Site Pages data - Title, URL and other properties...
ForEach($Page in $SitePages)
{
    $ClientPage = Get-PnPClientSidePage -Identity $Page.FieldValues.FileLeafRef
    ###$PageComp = Get-PnPPageComponent -Page $Page.FieldValues.FileLeafRef
    $Controls = $ClientPage.Controls

    ForEach($Control in $Controls)
    {
        $HasLink = $Control.PropertiesJson | Select-String -Pattern 'href' -Quiet -SimpleMatch

        $Data = New-Object PSObject -Property ([Ordered] @{
            Title  = $Page.FieldValues.Title
            PageName = $Page.FieldValues.FileLeafRef
            RelativeURL = $Page.FieldValues.FileRef
            CreatedOn = $Page.FieldValues.Created_x0020_Date
            ModifiedOn = $Page.FieldValues.Last_x0020_Modified
            Editor =  $Page.FieldValues.Editor.Email
            ID = $Page.ID
            HasLink = $HasLink
        })
        $PagesDataColl += $Data
    }
}

$PagesDataColl
</code>```

In a perfect world I would list all hyperlinks per page but at this moment I would by glad if I could determine if a page has one or more links at all.

Thanks!

Title: Get all hyperlinks in modern SPO page

Body:
because we are rebranding and renaming our intranet (Sharepoint Online), I need to make an index of all sites, pages and links between them to make sure none off the links will be broken afterwards.

Using PNP Powershell I can list all pages from a site but I'm strugling on how to crawl for any hyperlinks on the page. So far I came up with this

#Connect to PnP
Connect-PnPOnline -Url $SiteURL -Interactive

#Get All Site Pages
$SitePages = Get-PnPListItem -List "Site Pages"

$PagesDataColl = @()
#Collect Site Pages data - Title, URL and other properties...
ForEach($Page in $SitePages)
{
    $ClientPage = Get-PnPClientSidePage -Identity $Page.FieldValues.FileLeafRef
    ###$PageComp = Get-PnPPageComponent -Page $Page.FieldValues.FileLeafRef
    $Controls = $ClientPage.Controls

    ForEach($Control in $Controls)
    {
        $HasLink = $Control.PropertiesJson | Select-String -Pattern 'href' -Quiet -SimpleMatch

        $Data = New-Object PSObject -Property ([Ordered] @{
            Title  = $Page.FieldValues.Title
            PageName = $Page.FieldValues.FileLeafRef
            RelativeURL = $Page.FieldValues.FileRef
            CreatedOn = $Page.FieldValues.Created_x0020_Date
            ModifiedOn = $Page.FieldValues.Last_x0020_Modified
            Editor =  $Page.FieldValues.Editor.Email
            ID = $Page.ID
            HasLink = $HasLink
        })
        $PagesDataColl += $Data
    }
}

$PagesDataColl

In a perfect world I would list all hyperlinks per page but at this moment I would by glad if I could determine if a page has one or more links at all.

Thanks!


问:
Create a stacked bar chart from data frame
got this data frame which i want to make into a stacked bar chart with the columns on the x axis

enter image description here

tried using barplot but just recive error 'height' must be a vector or a matrix
tried using ggplot(dataframe) and just returns grey rectangle


问:
WooCommerce Subscriptions: how to KEEP the "Browse products" button on my account page
I have a simulare question as the one on this page: WooCommerce Subscriptions: Remove "Browse products" button on my account page

But mine is the opposite!

What if I want the "Browse Products" button to be shown on the subscription page of My account area at all time? Also when a purchase of a subscription are made?

I have search the web for a solution. But with no luck. All info I find is how to remove the button. I want it shown also after a phurcase have been made as it are automatically removed.


问:
Facebook fail to publish when not supporting SSO and external safari (inline dialog)
Follow those steps:

1) On "Facebook.m" set the call to "authorizeWithFBAppAuth" at authorize to
  [self authorizeWithFBAppAuth:NO safariAuth:NO];

2) Start the app, login to Facebook, try to publish a stream via the FBDialog (its working).

3) Exit the app (Stop execution).

4) Open the app (FBSession STILL valid), try to publish another stream and you will get an error message.

* I can still publish with the graph API, but my client persist on publishing via the official Facebook dialog.

* I noticed that some cookies were missing from the first fbDidLogin call to the next time i opened the app. Therefore i guess that the FBDialog miss some vital cookies.

* I don't think its a 'good' workaround to persist the cookies (as Facebook can change their calls and we will be ducked :)

Of course when i tried the normal SSO it worked.

Please help!

ContentLicense: CC BY-SA 3.0