text:
Q: Pyinstaller on MacOS BigSur cannot build basic PyQt5 app I'm trying to build a very basic app that uses PyQt5 on Big Sur.
Using the latest dev version of pyinstaller I build the app without errors but, when I launch it, it crashes immediately after starting.
Launching the exec, I get segmentation fault right after app = QApplication(sys.argv).
Here's my configuration:
37 INFO: PyInstaller: 5.0.dev0
37 INFO: Python: 3.9.4
46 INFO: Platform: macOS-11.2.3-x86_64-i386-64bit

My code, launched with python main.py works. It's also not a problem of external files used by the app because it crashes way before using them.
import os
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow

DEBUG = True

if __name__ == "__main__":
    if DEBUG:
        if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'):
            print("Running in a Pyinstaller bundle.")
        else:
            print("Running in a normal Python process.")

        for a in sys.argv:
            print("sys.argv[]: {}".format(a))
        print(sys.executable)
        print(os.getcwd())

    if DEBUG:
        print("THIS RUNS")
    app = QApplication([])
    if DEBUG:
        print("THIS DOESN'T")
    win = QMainWindow()
    win.setGeometry(200, 200, 300, 450)
    win.setFixedSize(300, 450)

    win.show()
    sys.exit(app.exec_())

The pyinstaller command I use is:
pyinstaller --noconfirm --log-level=ERROR \
    --clean \
    --onefile \
    --windowed \
    --name Blabla \
    --debug all \
    --paths ~/PycharmProjects/FotoPDF/venv2/lib/python3.9/site-packages/ \
    --paths ~/PycharmProjects/FotoPDF/venv2/ \
    --paths ~/PycharmProjects/FotoPDF/venv2/lib/python3.9/site-packages/PyQt5/ \
    --hidden-import PyQt5 \
    --hidden-import PyQt5.sip \
    --hidden-import PyQt5.QtWidgets \
    --hidden-import PyQt5.QtGui \
    --hidden-import PyQt5.QtCore \
    main.py

Ideas?
Here's what I get in the terminal when I launch the executable:
(venv2) ste@ste FotoPDF % ./FotoPDF
import _frozen_importlib # frozen
import _imp # builtin
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import '_warnings' # <class '_frozen_importlib.BuiltinImporter'>
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
import '_frozen_importlib_external' # <class '_frozen_importlib.FrozenImporter'>
import 'posix' # <class '_frozen_importlib.BuiltinImporter'>
import '_io' # <class '_frozen_importlib.BuiltinImporter'>
import 'marshal' # <class '_frozen_importlib.BuiltinImporter'>
# installing zipimport hook
import 'time' # <class '_frozen_importlib.BuiltinImporter'>
import 'zipimport' # <class '_frozen_importlib.FrozenImporter'>
# installed zipimport hook
# zipimport: found 147 names in '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip'
import '_codecs' # <class '_frozen_importlib.BuiltinImporter'>
import codecs # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/codecs.pyc
import encodings.aliases # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/encodings/aliases.pyc
import encodings # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/encodings/__init__.pyc
import encodings.utf_8 # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/encodings/utf_8.pyc
import encodings.ascii # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/encodings/ascii.pyc
import '_signal' # <class '_frozen_importlib.BuiltinImporter'>
import encodings.latin_1 # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/encodings/latin_1.pyc
import '_abc' # <class '_frozen_importlib.BuiltinImporter'>
import abc # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/abc.pyc
import io # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/io.pyc
# extension module '_struct' loaded from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/lib-dynload/_struct.cpython-39-darwin.so'
# extension module '_struct' executed from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/lib-dynload/_struct.cpython-39-darwin.so'
import '_struct' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7fc30892c670>
# extension module 'zlib' loaded from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/lib-dynload/zlib.cpython-39-darwin.so'
# extension module 'zlib' executed from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/lib-dynload/zlib.cpython-39-darwin.so'
import 'zlib' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7fc3089c7100>
# PyInstaller: FrozenImporter(/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/FotoPDF?60397)
import os # PyInstaller PYZ
import stat # PyInstaller PYZ
import '_stat' # <class '_frozen_importlib.BuiltinImporter'>
import 'stat' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
# _collections_abc not found in PYZ
import _collections_abc # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/_collections_abc.pyc
import posixpath # PyInstaller PYZ
import genericpath # PyInstaller PYZ
import 'genericpath' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import 'posixpath' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import 'os' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import ctypes # PyInstaller PYZ
# types not found in PYZ
import types # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/types.pyc
# _ctypes not found in PYZ
# extension module '_ctypes' loaded from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/lib-dynload/_ctypes.cpython-39-darwin.so'
# extension module '_ctypes' executed from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/lib-dynload/_ctypes.cpython-39-darwin.so'
import '_ctypes' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7fc308b37d60>
import ctypes._endian # PyInstaller PYZ
import 'ctypes._endian' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import 'ctypes' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
# ctypes.macholib not found in PYZ
# re not found in PYZ
# enum not found in PYZ
import enum # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/enum.pyc
# sre_compile not found in PYZ
import '_sre' # <class '_frozen_importlib.BuiltinImporter'>
# sre_parse not found in PYZ
# sre_constants not found in PYZ
import sre_constants # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/sre_constants.pyc
import sre_parse # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/sre_parse.pyc
import sre_compile # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/sre_compile.pyc
# functools not found in PYZ
# collections not found in PYZ
# heapq not found in PYZ
# _heapq not found in PYZ
# extension module '_heapq' loaded from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/lib-dynload/_heapq.cpython-39-darwin.so'
# extension module '_heapq' executed from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/lib-dynload/_heapq.cpython-39-darwin.so'
import '_heapq' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7fc308bbefa0>
import heapq # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/heapq.pyc
import 'itertools' # <class '_frozen_importlib.BuiltinImporter'>
# keyword not found in PYZ
import keyword # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/keyword.pyc
# operator not found in PYZ
import '_operator' # <class '_frozen_importlib.BuiltinImporter'>
import operator # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/operator.pyc
# reprlib not found in PYZ
import reprlib # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/reprlib.pyc
import '_collections' # <class '_frozen_importlib.BuiltinImporter'>
import collections # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/collections/__init__.pyc
import '_functools' # <class '_frozen_importlib.BuiltinImporter'>
import functools # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/functools.pyc
import '_locale' # <class '_frozen_importlib.BuiltinImporter'>
# copyreg not found in PYZ
import copyreg # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/copyreg.pyc
import re # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/re.pyc
import multiprocessing # PyInstaller PYZ
import multiprocessing.context # PyInstaller PYZ
import threading # PyInstaller PYZ
# _weakrefset not found in PYZ
import _weakrefset # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/_weakrefset.pyc
import 'threading' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import multiprocessing.process # PyInstaller PYZ
import signal # PyInstaller PYZ
import 'signal' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import 'multiprocessing.process' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import multiprocessing.reduction # PyInstaller PYZ
import pickle # PyInstaller PYZ
import _compat_pickle # PyInstaller PYZ
import '_compat_pickle' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
# _pickle not found in PYZ
# extension module '_pickle' loaded from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/lib-dynload/_pickle.cpython-39-darwin.so'
# extension module '_pickle' executed from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/lib-dynload/_pickle.cpython-39-darwin.so'
import '_pickle' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7fc308c985b0>
# org not found in PYZ
import 'pickle' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import socket # PyInstaller PYZ
# _socket not found in PYZ
# extension module '_socket' loaded from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/lib-dynload/_socket.cpython-39-darwin.so'
# extension module '_socket' executed from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/lib-dynload/_socket.cpython-39-darwin.so'
import '_socket' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7fc308cbb2e0>
import selectors # PyInstaller PYZ
# collections.abc not found in PYZ
import collections.abc # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/collections/abc.pyc
# math not found in PYZ
# extension module 'math' loaded from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/lib-dynload/math.cpython-39-darwin.so'
# extension module 'math' executed from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/lib-dynload/math.cpython-39-darwin.so'
import 'math' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7fc308cc6940>
# select not found in PYZ
# extension module 'select' loaded from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/lib-dynload/select.cpython-39-darwin.so'
# extension module 'select' executed from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/lib-dynload/select.cpython-39-darwin.so'
import 'select' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7fc308cc69d0>
import 'selectors' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import 'errno' # <class '_frozen_importlib.BuiltinImporter'>
# array not found in PYZ
# extension module 'array' loaded from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/lib-dynload/array.cpython-39-darwin.so'
# extension module 'array' executed from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/lib-dynload/array.cpython-39-darwin.so'
import 'array' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7fc308cd3640>
import 'socket' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import 'multiprocessing.reduction' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import 'multiprocessing.context' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import 'multiprocessing' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import multiprocessing.spawn # PyInstaller PYZ
import runpy # PyInstaller PYZ
import importlib # PyInstaller PYZ
# warnings not found in PYZ
import warnings # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/warnings.pyc
import 'importlib' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import importlib.machinery # PyInstaller PYZ
import 'importlib.machinery' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import importlib.util # PyInstaller PYZ
import importlib.abc # PyInstaller PYZ
import typing # PyInstaller PYZ
import contextlib # PyInstaller PYZ
import 'contextlib' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import 'typing' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import 'importlib.abc' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import 'importlib.util' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import pkgutil # PyInstaller PYZ
# weakref not found in PYZ
import weakref # loaded from Zip /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/base_library.zip/weakref.pyc
import 'pkgutil' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import 'runpy' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import multiprocessing.util # PyInstaller PYZ
import 'atexit' # <class '_frozen_importlib.BuiltinImporter'>
import subprocess # PyInstaller PYZ
import 'pwd' # <class '_frozen_importlib.BuiltinImporter'>
# grp not found in PYZ
# extension module 'grp' loaded from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/lib-dynload/grp.cpython-39-darwin.so'
# extension module 'grp' executed from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/lib-dynload/grp.cpython-39-darwin.so'
import 'grp' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7fc308ea4940>
# msvcrt not found in PYZ
# _posixsubprocess not found in PYZ
# extension module '_posixsubprocess' loaded from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/lib-dynload/_posixsubprocess.cpython-39-darwin.so'
# extension module '_posixsubprocess' executed from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/lib-dynload/_posixsubprocess.cpython-39-darwin.so'
import '_posixsubprocess' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7fc308ea4a30>
import 'subprocess' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import 'multiprocessing.util' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import 'multiprocessing.spawn' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import multiprocessing.popen_fork # PyInstaller PYZ
import 'multiprocessing.popen_fork' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import multiprocessing.popen_spawn_posix # PyInstaller PYZ
import 'multiprocessing.popen_spawn_posix' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
import PyQt5 # PyInstaller PYZ
# possible namespace for /Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/PyQt5
import 'PyQt5' # <pyimod03_importers.FrozenImporter object at 0x7fc3089c7a30>
# PyQt5.QtWidgets not found in PYZ
# PyQt5.sip not found in PYZ
# extension module 'PyQt5.sip' loaded from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/PyQt5/sip.cpython-39-darwin.so'
# extension module 'PyQt5.sip' executed from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/PyQt5/sip.cpython-39-darwin.so'
import 'PyQt5.sip' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7fc308ea4eb0>
# PyQt5.QtCore not found in PYZ
# extension module 'PyQt5.QtCore' loaded from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/PyQt5/QtCore.abi3.so'
# extension module 'PyQt5.QtCore' executed from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/PyQt5/QtCore.abi3.so'
import 'PyQt5.QtCore' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7fc308ebb100>
# PyQt5.QtGui not found in PYZ
# extension module 'PyQt5.QtGui' loaded from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/PyQt5/QtGui.abi3.so'
# extension module 'PyQt5.QtGui' executed from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/PyQt5/QtGui.abi3.so'
import 'PyQt5.QtGui' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7fc30a8236a0>
# extension module 'PyQt5.QtWidgets' loaded from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/PyQt5/QtWidgets.abi3.so'
# extension module 'PyQt5.QtWidgets' executed from '/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/PyQt5/QtWidgets.abi3.so'
import 'PyQt5.QtWidgets' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7fc308ea4c40>
Running in a Pyinstaller bundle.
sys.argv[]: ./FotoPDF
/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF/FotoPDF
/Users/ste/PycharmProjects/FotoPDF/dist/FotoPDF
THIS RUNS
zsh: segmentation fault  ./FotoPDF

A: For a second assuming it's not Pyinstaller's fault.
In this post matplotlib refused to work after the BigSur update until reinstalled.
And PyQt5 didn't show any GUI in this post after the BigSur update.
The if it's a problem with PyQt then the fix should be uninstalling and reinstalling PyQt5==5.15.2 with
pip uninstall PyQt5
pip install PyQt5== 5.15.2

and then setting
os.environ['QT_MAC_WANTS_LAYER'] = '1'

a user also said rolling back to PyQt5==5.12.0 solved his issue so maybe try that.
If the issue is with PyQt5 you can also switch to PySide2 which is another binding for Qt5
Incase the issue lies with PyInstaller you can look at the alternatives.
Python 3.5+ comes with zip support via zipapp, more about that here and here, which lets you archive your python program into a single .pyz using the command
python -m zipapp myapp -m "myapp:main"

This command runs the main function from the module myapp when the archive is launched. Which can be simply run by-
python myapp.pyz

There's also py2app which is like pyinstaller but specific to macOS.


text:
Q: What is it? "So live with it you will" So live with it you will

I wonder how this structure called, when "will" or "shall" are put at the end of the sentence. Is it just re-arrangement of parts or has any special name? Is it only recommended for spoken english?
I've heard this in one of Letterman's episodes (TV show)

redpajama_set_name: RedPajamaStackExchange


text:
Q: strftime function in SQLite does not work Hi, I am using the following query but it does not work,
SELECT strftime('%m',Since) AS Month FROM Dates

Type of Since column is DATETIME, but the result is shown an empty Month column without any error.

A: strftime isn't broken, it just doesn't understand the format of the datestamps in your database.
SQLite version 3.7.9 2011-11-01 00:52:41
sqlite> create table dates (id int, d datetime);
sqlite> insert into dates (id,d) values (1, date('now'));
sqlite> insert into dates (id,d) values (2, 'bad date');
sqlite> insert into dates (id,d) values (3, NULL);
sqlite> insert into dates (id,d) values (4, datetime('now'));
sqlite> select * from dates;
1|2012-09-23
2|bad date
3|
4|2012-09-23 04:31:36
sqlite> select id, strftime('%m', d) from dates;
1|09
2|
3|
4|09


text:
Q: Is it possible that there is a color our human eye can't see? Is it possible that there's a color that our eye couldn't see? Like all of us are color blind to it.
If there is, is it possible to detect/identify it?

A: The eye is sensitive to light with a wavelength in the range from about 700nm to 400nm, and for the non-colour blind all wavelengths in this range are detected by one or more of the cone cell types. So there are no hidden colours in this range.
Light outside the 700-400nm range can't be seen, so I suppose you could claim these are hidden colours, but then we tend to define the word "light" to mean what we can see, and we'd say the wavelengths larger than 700nm are infrared and those smaller than 400nm are ultraviolet.
Actually, it's alleged that if you have the lens of the eye removed (it can happen due to eye problems) then you can see further into the UV. This is because the lens absorbs UV light and when it's removed that light can reach the retina and be perceived. Maybe this counts as a hidden colour. I feel disinclined to try the experiment :-)

A: Color is basically formed in the brain not the eyes. Also the human eye can handle electromagnetic waves from 4000 to 7000 Angstrom, roughly, so called visible light. Above this range, the infrared region is found. It is not red in color or something, it is a name convention. Our eye can not handle it and so the brain dose not recognize it.
It is complicated if you are thinking it for the first time and can be extremely messy.
So color dose not exist its different from species to species.

A: There are different types of color blindness.
In color vision tests (patches of color when you can see digits or not) there are some tests where people with normal vision can't see the figure, but people with a specific color blindness can see it. That means people with normal vision are color blind to some specific color differences.
It doesn't mean this color will appear gray to you. It means two patches will seems the same color to you (if you have normal color vision) and can be distinguished one from another by someone else (who is supposed to have a bad color vision)
If you use a spectrograph, even in only the visible wavelength range, you have much more data (the proportion of each wavelength) than you can have with a normal human eye, that summarize it to only three values.

A: There's been found some women who are quadrachromatic however they're very rare but in comparison to them we all are colourblind as they can see hue's that we can't see.

A: I'll add this to the awesome answer from Chris White:
People with synesthesia may experience color when stimulated by other sensations, like sounds or letters for example. And some such people have reported seeing "alien colors" that only exist in their visual field when they look at certain graphemes, like punctuation.
It is certainly possible that such "alien colors" may indeed be perceived, and yet be impossible to reproduce in the physical world (by combining visible frequencies) precisely because they are the result of direct/internal neural stimulation, and are not constrained by the same rules which hold true for the neural signals generated by the color receptors in human eyes.
If this is true, then it is also possible that we will someday be able to detect, record, and reproduce such "alien colors" when we learn enough about how human visual processing works to be able to build high quality artificial eyes.

A: It really depends on what you mean by colour.
If by colour you mean "the human brain's response to a given combination of wavelengths", then by definition there can be no invisible colours; wavelengths combinations that do not stimulate any cones in the eye are just equivalent to black.
If by colour you mean "a given combination of wavelengths", then we are actually totally blind to almost all of them because light is a multidimensional signal, and our eyes can only grasp three to four dimensions out of these. For instance, we are unable to tell the difference between a pure 550nm (what we see as "green") wave and a combination of 520nm and 580nm waves; certainly they are different signals, yet our visual system makes us believe they're equivalent.
If by colour you mean "a single, unique wavelength", then we can actually see colours that do not exist; for instance, there is a single wavelength for orange (around 620nm), but there is none for purple (which is invention of our brain to describe combinations or red and blue).

A: Quickly, try this: Imagine blindingly bright red light! Now blue! Now yellow!
You could see stark differences as you shifted from color to color, couldn't you?
Yet if you think about what just went on inside of your head, it didn't involve any color photons going into your eyes, did it? So, what you just did must be separate from the light frequencies picked up by your eyes. The fact that you could easily distinguish between each of those in-your-head-only phenomena shows they are physically meaningful phenomena. The fact that they are complicated, low-energy, poorly understood phenomena that only operate within your brain doesn't make them any less real, just a lot harder to access and analyze.
The more philosophical term for these in-your-head-only phenomena is qualia (Kwal ee ah). We tend to assume that all humans share the same qualia for light, because we have uniform labels for the bands of light that evoke them.
However, the strong form of that assumption is almost certainly incorrect. There is for example a wonderfully odd condition some people have called synesthesia, in which sensory inputs get mixed up and mapped into multiple qualia. Mostly it involves color being added to letters and numbers, but in some of the more radical forms touching a certain spot on someone's leg can evoke a color or a smell.
Even for those of us who don't have synesthesia (I'm extremely jealous of those who do), qualia can get remapped. I once lost my sense of smell for a while, and when it came back, the first two smells I encountered (only) would up remapped into entirely new qualia. Consequently, second-hand cigarette smoke and gasoline now both smell like edible foods to me (yuck!). That was emphatically not the case before my brain decided to "remap" the signals they evoke chemically in my nose.
So, putting all of that together, the answer to your question is twofold:

*

*Are there light spectra that some creatures can see but humans can't see? Definitely yes, since for example there are birds that have receptors for four light bands instead of just three. Their extra receptor is in what we would call ultraviolet. (Their other color receptors are also not quite the same as ours.)

*Are there qualia that some creatures can see, "in their heads only," that humans cannot imagine? This question is trickier than it looks, because at present there is no technology that can be used to detect the apparently subtle differences between qualia in a functioning brain. My best guess is that it's quite likely that birds that can see in the ultraviolet also have a unique quale ("Kwal ay", the singular of qualia) that helps them interpret their larger range of sensory inputs. So, probably they see something different.
We don't know that for sure, however. For example, it could be that such birds simply stretch the same qualia we use when imagining a rainbow to cover a broader range of light spectra. In that case, ultraviolet to a bird would just look the same as what we call violet.
So why do I think such birds have a unique quale to represent ultraviolet light?
Well, mostly because of this: Assuming you are not color blind (my apologies about this one if you are): Imagine red! Imagine green! Did those two qualia look very similar to you? So much so that you have trouble recalling which is which? No? Not at all? In fact, some of you are likely right now screaming in your heads, "You nincompoop, red and green qualia don't look anything alike! How could you ever even think that?"
Well, very easily if I was red-green color blind. You see, what most people don't realize is that red-green colorblindness is the norm for all mammals except primates.
Primates picked up an extra light-sensing protein mainly because they eat a lot of fruit. Fruits, however, have a curious property called "ripeness" that on average they tend to advertise by undergoing some kind of color change. The most common such change is to go from green (not ripe) to red (ripe). Unfortunately, mammals in general can't see this particular color change, which places a dog for example at a distinct disadvantage if it is hungry and trying to find ripe fruit as a fallback food source.
So to handle fruits better, primates have this extra sensory protein for green light, one that is structurally derived from and still remarkably similar to the red-sensing protein that all mammals have.
But here's the critical point: We did not just get another color sensor, we also got a new, starkly different quale (imagine green!) to go with it. People without red-green color blindness would tend to agree that this new "it's not a ripe fruit" quale is quite distinct from the older red quale (imagine red!) that previously included that same turf.
That strong distinction between two qualia helps us transform spectra differences that our eyes see into a real survival advantage, specifically by making it trivial and fast to look over a tree and notice red fruits standing out like sore thumbs. Some mushy slight difference, like that between some shades of blue, would not be nearly as effective for this quick sorting-out process.
So: If a bird adds in ultraviolet protein receptors, wouldn't it make sense that they would also have a new quale specifically to make that extra sensory input stand out? That's why my bet is that birds whose eyes have receptors for ultraviolet light also see ultraviolet as a new color quale, that is, as a completely new color sensation that we humans quite literally cannot imagine.
So, to wrap it up: What are qualia?
No one has the foggiest idea! Sorry.
But my hope is that someday through methods like fMRI, we will actually begin to understand what is going on in the brain well enough to detect when different qualia are in action. Then and only then we may gain the ability to know for sure whether my in-my-head-only definition of "red" really does match the one inside of your head.
And even further down the pike, who knows? Simple electrodes can certainly evoke powerful sensations -- qualia -- within the human brain. Perhaps someday someone will figure out some clever ways to convey the birds-only quale for "ultraviolet" into the brain of a human volunteer. That lucky person would then get to see, for the first time in human history, a color that no one has ever seen before, one to which the entire human race has been quite literally colorblind for its entire prior existence.
Now wouldn't that be a wonderful thing to behold?

A: As mentioned in a number of other answers, there are three different color receptors in a typical person's eye. They respond to different wavelengths of light, as can be seen in the below diagram from wikimedia.

The $x$-axis is wavelength in nanometers, and the three curves represent the three receptors' response at those wavelengths. Any incoming light will affect each of these to a certain degree. Thus the range of theoretically perceivable colors is basically the set of all different triplets of response values for these receptors. (Think "blue is at 25%, red is at 97.3%, green is at 12%.") When all three are firing near full strength, the result is something like white. If the blue receptor is firing and red and green are basically off, well then you see blue.
There are two important points to make, though. First, one often sees reference to a connection between wavelength and color. Indeed, you cannot see any wavelengths outside approximately 400 to 700 nanometers. [Note that other animals have different ranges: Bees can see into the ultraviolet (below 400 nanometers), while some snakes can "see" into the infrared (above 700 nanometers).]
Be careful not to take this connection too far, however. In particular, there is more to color than a single wavelength. For instance, light could be hitting your eye with two overlaid wavelengths - one of which resonates with the green receptor very well, and the other of which resonates particularly well with the blue. The resulting perception is likely to be a teal that simply cannot be reproduced with a single wavelength. This is exactly analogous to sound, where a monochromatic "pure" pitch will never, at any frequency, sound like a trumpet or a viola - those instruments' timbres are defined by the varying strengths of the overtones. In other words, "all the colors of the rainbow" does not encompass all colors.
The other point is that there are valid combinations of receptor stimulation levels that cannot be achieved by any combination of wavelengths. This is partly due to how your receptors' ranges are not separate. Note for instance how the "red" (L) and "green" (M) receptors are actually quite close. It is hard to stimulate one without the other. You can never, for example, get "100% green, 0% red and blue" as a signal from your eye to your brain. Such theoretical colors that cannot be reproduced with any source of light are called imaginary colors. Supposedly, you can actually see some imaginary colors by first saturating one or more receptors (say by looking at nothing but lots of pure green for a few minutes), thus wearing them out, and then looking at another source of light. The response you get won't be quite the same as you normally would with that light source, since some of your receptors are not up to full capacity. (I have not had too much luck with this experiment myself, but perhaps you may fare better.)
Finally, regarding detection: When it comes to light, all it is scientifically is different wavelengths of electromagnetic radiation. We have spectrometers for pretty much every wavelength out there, well beyond visible. Thus you can always tell the exact composition of some light ("12% in the 550-553 nanometer range, 80% evenly distributed between 600 and 700 nanometers, 8% focused at 350 nanometers," for instance). We don't need to rely on our eyes' physiology.

A: We have color perception because we are trichromats. In our genes there is code for three slightly different light-sensitive molecules. The light-sensitive cells in the retina are called cones, and neighbouring cones each produce one of the different versions of the light-senstive molecule. So each of the three cone-types responds slightly differently to the incoming light, and then neuron cells compare these responses.
The pixels of our computer monitors and our television sets come in three colors. Just three colors. Those three colors are sufficient for satisfactory color reproduction. The reason three colors are sufficient is that our eyes have just three types of cones.
In evolutionary history trichromacy is a relatively recent development. Primates are trichromats; many mammals are dichromats. If we humans would all be dichromats then our computer monitors and television sets would need just two colors for satisfactory reproduction of all the colors we can see. (EDIT - Sam Hocevar has pointed out in a comment that the statement about color reproduction is oversimplified.)
So it's a matter of how many different light-sensitive molecules are available, and how well the neurons do in comparing the responses from differently sensitive cones.
We trichromats have access to a bigger color world than dichromats have. There are colors that to a trichromat look different that are identical to a dichromat.
Conversely, a species that is tetrachromatic (and with neuron wiring to compare all different responses) would have access to a yet bigger color world.
Compared to a fully functioning tetrachromat we trichromats are partially color blind.

A: I haven't provoked this in original answer because it would have been extremely messy, but now i have to.
 Your brain receives signal for 520 nm(5200 Angstrom), now you have told bye your teacher or parents that this particular type of signal is green colour hence you see a leave of tree as green, what if since birth you have been in other world and you have been told 520 nm as Red and instead of green and vice versa, you would have always thought as yo have been said. then for you Leaves would have been Red and Strawberry Green. It doesn't matter. is it? All that matter we can identify 520 nm and 660 nm as different wavelength, its up to us what to name it.

A: This is an old question, but I'm very surprised no one has mentioned this:
You CAN'T see red-green.
According to multiple websites, some studies showed that the human eye cannot see both red and green simultaneously, as the red cone and the green cone send out signals that cancel each other out.
Similarly, blue-yellow is equally impossible to perceive.
There you have it. Two "colors" that is a mix of the colors of the rainbow, yet are impossible to detect. They are known as the FORBIDDEN COLORS.

A: Of course it's possible, e.g. the colors seen by bees are invisible for us.


text:
Q: Pointer doesn't point to the correct location, after parsing it as an argument internal unsafe struct Array<T>
{
    public int Length;

    internal nuint* ptr;

    public Array(int capacity)
    {
        ptr = (nuint*)Marshal.AllocHGlobal(capacity * sizeof(nuint)); // allocates memory on heap
        Length = capacity;
    }

    public T this[int index]
    {
        get
        {
            if (index > Length || index < 0)
                throw new ArgumentOutOfRangeException(nameof(index));
            nuint PointerToT = ptr[index]; // gets pointer to type
            byte TFirstByte = *(byte*)PointerToT; // gets the first byte of the type
            return Unsafe.As<byte, T>(ref TFirstByte); // converts byte to type

        }
        set
        {
            if (index > Length || index < 0)
                throw new ArgumentOutOfRangeException(nameof(index));
            void* valueAsPtr = Unsafe.AsPointer(ref value); // gets pointer, but gets the wrong address
            ptr[index] = (nuint)valueAsPtr; // sets pointer at index
        }
    }
}

what I'm trying to do is make my own sort of array, but when I try to get the pointer to the memory address of the value that I'm setting, I get the pointer location of the parameter: 'value' but not the actual value. Is there a way to get the memory address of the value before it has been parsed as an argument.
Array<int> myArray = new(1);
int v = 21;
myArray[0] = v;

int* ptr = &v;

this is how I'm trying to use it but the address that the 'ptr' variable gets is not the same as the address that it has in the setter. I have used other data types like strings, but those have the same issue.
Console.WriteLine(myArray[0])

and once i try to get the value, it tries to read the memory of the 'value' parameter which was in the setter, but this is not available anymore.


text:
Q: How to run linux in efi mode after installing in legacy mode? I installed Ubuntu in windows by making separate partition.
My both OS are installed in legacy mode but I want to switch to UEFI. When I switch to UEFI MODE a black screen comes up instead of grub and it asks me to press ESC.
Is it possible to switch to UEFI ?
Do I need to make any partition for EFI ?
Thanks in advance...

A: Switching Linux to boot in EFI mode is relatively easy; you just need to install the EFI-mode boot loader of your choice, although this will require that you create an EFI System Partition (ESP), and some EFIs also require you to convert the disk from MBR to GPT.
Switching Windows to boot in EFI mode is harder. The same steps are required, but Windows makes it a bit harder to perform those steps. If you're interested, I recommend you read this page, which describes the process in detail.
Overall, I'd say it's not worth the hassle unless you've got some compelling reason, such as if you're replacing a sub-2TiB disk with one that's larger than 2TiB (and that therefore requires GPT, and hence an EFI-mode boot of Windows).

A: The only way is to actually install Ubuntu in the UEFI boot mode.  However, you can keep what ever windows install there.  In windows, run fdisk, there create a second partition, split the drive in half(considering you have the space to pull off.).  At which point, you will then use the USB install point of Ubuntu.
However, since you now have a legacy install and a UEFI install, you will have to pick which boot you want every time.  So you would have to press F12 if you wanted to boot in Windows, which will require a reboot.  Also, please note that GRUB2 might not see Windows because the boot partition will not see legacy.
This Q&A should answer anything else you want done.


text:
Q: Extracting a value from all string records in a column Kusto? I have the following sample:
let data = datatable(ProducutName:string)
            [
                "Amigo Patchi 50 KG",
                "Amigo Patchi 50 KG",
                "Amigo Patchi 50 KG",
                "Chocolate Bar 25Kg",
                "Chocolate Bar 25Kg",
                "Chocolate Bar 25Kg",
                "Brownies CupCakes 100Kg",
                "Brownies CupCakes 100Kg",
                "Brownies CupCakes 100Kg"
            ];

In this sample, there are 3 different product lines:

*

*Amigo Patchi

*Chocolate Bar

*Brownies Cupcakes

Each of those product lines has in it its name and value. But as you can see, each product has the value and its unit written in a different way. What I am trying to achieve here is to extract this value from each of those records and display it in a new column. So the expected result would be two columns, first column: ProductName; second Column: Value
Here is what I am trying to achieve:

Is there a way to achieve this in Kusto ?
Please take into consideration that the value for each line could change. It is not always the same. So the code that will be written should simply search for this value(searching for an integer) in the string and display it in a new column as shown in the screen shot.

A: Option 1
parse operator
let data = datatable(ProductName:string)
            [
                "Amigo Patchi 50 KG",
                "Amigo Patchi 50 KG",
                "Amigo Patchi 50 KG",
                "Chocolate Bar 25Kg",
                "Chocolate Bar 25Kg",
                "Chocolate Bar 25Kg",
                "Brownies CupCakes 100Kg",
                "Brownies CupCakes 100Kg",
                "Brownies CupCakes 100Kg"
            ];
data
| parse kind=regex ProductName with ProductName @"\s+" Value:int @"\s*" Units

ProductName
Value
Units

Amigo Patchi
50
KG

Amigo Patchi
50
KG

Amigo Patchi
50
KG

Chocolate Bar
25
Kg

Chocolate Bar
25
Kg

Chocolate Bar
25
Kg

Brownies CupCakes
100
Kg

Brownies CupCakes
100
Kg

Brownies CupCakes
100
Kg

Fiddle
Option 2
extract_all()
let data = datatable(ProductName:string)
            [
                "Amigo Patchi 50 KG",
                "Amigo Patchi 50 KG",
                "Amigo Patchi 50 KG",
                "Chocolate Bar 25Kg",
                "Chocolate Bar 25Kg",
                "Chocolate Bar 25Kg",
                "Brownies CupCakes 100Kg",
                "Brownies CupCakes 100Kg",
                "Brownies CupCakes 100Kg"
            ];
data
| project info = extract_all(@"(.*)\s+(\d+)\s*(.*)", ProductName)[0]
| project ProductName = info[0], Value = toint(info[1]), Units = toupper(info[2])

ProductName
Value
Units

Amigo Patchi
50
KG

Amigo Patchi
50
KG

Amigo Patchi
50
KG

Chocolate Bar
25
KG

Chocolate Bar
25
KG

Chocolate Bar
25
KG

Brownies CupCakes
100
KG

Brownies CupCakes
100
KG

Brownies CupCakes
100
KG

Fiddle


text:
Q: fail to marshal nested xml elements Im Trying to create an XML from java class with nested element.
I don't get where is my mistake and what should I change
thanks!
my main class:
String MY_XML = "my path...";  //hier is the path...

JAXBContext context = JAXBContext.newInstance(MasterDataRM.class);
Marshaller m = context.createMarshaller();
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);

 Master temp = new Master();
 temp.setTransactionStatus("AlmostOk");
 m.marshal(temp, new File(MY_XML));
 m.marshal(temp, System.out);

my Class to be marshalled:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement
public class Master {

    @XmlElement
    protected Date ResponseDatetime = new Date();

    @XmlElement
    protected Transaction transaction;

    public void setResponseDatetime(Date date){
        this.ResponseDatetime = date;
    }

    public Date getDate(){
        return ResponseDatetime;
    }

    public static class Transaction{
        @XmlElement
        String status = "OK";
    }

    public void setStatus(String status){
        transaction.status = status; //  This throws the NullPointerException !!!
    }

    public String getStatus(){
        return transaction.status;
    }

A: transaction.status = status; // This throws the NullPointerException !!!

Because you are not initializing inner static class, remember all ways initialize instance variable before user it , that's why you are getting NLP
create Transcation object first and set it using outer class object as
temp.setTransaction(new Master.Transaction());

Update your class as like
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class Master {

    public Master() {
    }

    @XmlElement
    protected Date ResponseDatetime = new Date();

    @XmlElement
    protected Transaction transaction;

    public void setResponseDatetime(Date date) {
        this.ResponseDatetime = date;
    }

    public Date getDate() {
        return ResponseDatetime;
    }

    public static class Transaction {
        @XmlElement
        String status = "OK";
    }

    public void setStatus(String status) {
        transaction.status = status; // This throws the NullPointerException !!!
    }

    public String getStatus() {
        return transaction.status;
    }

    public Transaction getTransaction() {
        return transaction;
    }

    public void setTransaction(Transaction transaction) {
        this.transaction = transaction;
    }

}

Marsh it
JAXBContext jaxbContext = JAXBContext.newInstance(Master.class);
        Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
        jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);

        Master temp = new Master();
        temp.setTransaction(new Master.Transaction());
        temp.setStatus("AlmostOk");
        jaxbMarshaller.marshal(temp, new File(MY_XML));
        jaxbMarshaller.marshal(temp, System.out);


text:
Q: CRM 2011 - View leads once a field has changed Any ideas or help would be appreciated on this issue.
I have a lead form that users fill out. A manager want to know every time 2 fields are changed or updated. For example we have 2 fields that telesales must fillout to qualify as a KPI.
I need to create a view that shows all leads a user has edited a particular field. Without creating workflows to populate a field when this particular field is edited does anyone have any idea how i can do this.
End result is a daily view that shows leads with these fields edited that day, not just lead forms edited.
thanks

A: With a view you can show leads that have been modified that day AND leads where some combination of the two fields have a range of values but you can't reliably combine the two i.e. leads where either/or those 2 fields have been modified today.
Options I can think of:
Create a hidden field that gets set with current date by custom JS OR plugin if the 2 field change condition is met. Then view can use the hidden field.
As Guido says, create a workflow that fires off an email to the manager when the 2 field condition is met, explain why this is an improvement because (s)he gets notified in real time (wow!) and quietly forget about the view.
Update: another option might be to intercept the retrievemultiple of the fetch with a plugin and do the necessary logic there, but...you still don't know for sure when the field(s) changed, just the entire record. There is a field audit capability built in to crm which I have never used but conceivably that could give you the necessary info on when the field(s) changed.

A: I wanted to avoid adding workflows as i'm already using quite a few for the lead entity.
Looks like the workflow option is the only way.
Thanks for everyones feedback. I wanted to check i wasn't missing some obvious answer and creating workflows for the sake of it.
cheers


text:
Q: Alternative to ? Based on this article and most of the other threads I've seen, is it safe to say that  is essentially dead? Is there an alternative to bringing an outside app into Salesforce that doesn't have a package?
Most of the solutions I've seen say to use a custom link or button to jump off SFDC and open the app in a new window.

A: Have you looked into salesforce Canvas application .Canvas offers a secure way of bringing a third party web application into the platform .Its secure since you go through a Signed Request Verification or use oauth 2.0 to securely access salesforce REST API .If you do not need to access salesforce at all then you can simply decode the Signed Request to render the app inside salesforce


text:
Q: How to display the most popular posts of all the blogs in a mu setup? When you visit wordpress.com, they have a list of the most popular posts right on the front page. I was wondering if there was a way to do the same thing on my multisite installation. Is it possible, and if it is, how would I go about doing it (plugin? theme?)?

A: You can use the WP Multisite Popular Posts plugin in order to show most commented posts across the network. This plugin allows you to use a shortcode or a widget in order to display the most commented posts accross the network. You can also choose the number of posts to display in the list and the concerned time period.


text:
Q: What are the configure options for Qt that enable dead keys usage? I use a bare Ubuntu LTS 16.04 vm to create an AppImage for one of my projects. I create a minimalistic static Qt for this, so that the AppImage's size is as small as possible. I recently managed to build a static Qt 5.14.2 with the following configure options:
../configure -prefix ~/Qt/5.14.2_static -opensource -confirm-license -release -static -optimize-size -no-opengl -no-gif -no-ico -no-libjpeg -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtremoteobjects -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebglplugin -skip qtwebsockets -skip qtwebview -skip qtwinextras -skip qtxmlpatterns -nomake examples -nomake tests -nomake tools -qt-zlib -sql-sqlite -qt-sqlite -qt-libpng -qt-pcre -qt-xcb

Building my program and an AppImage works, I noticed however, that dead keys don't work. I use a German locale here, and pressing accent keys does nothing. E. g. when I input an ´ and an e into a QLineEdit, I simply get an e instead of é.
I first thought this was due to something missing in the vm, but when I do the same Qt build on my Gentoo host (where dead keys always have been working in Qt programs), I get the same result: the dead keys don't work. So most probably, this is due to wrong configuration.
I experimented with the -libinput, -xkb, -xkbcommon and -qt-harfbuzz configure switches, but I can't get dead keys to work.
Which configure options have to be set when building Qt so that dead keys work?
Edit: When I build Qt with this exact configure statement, but the shared version instead of the static one, the dead keys work. What does cause this?

A: This happened due to a missing QTPLUGIN parameter. Imho this is almost impossible to figure out, but easy to solve:
Adding QTPLUGIN += composeplatforminputcontextplugin to the .pro file does the trick. Q_IMPORT_PLUGIN(QComposePlatformInputContextPlugin) appears automatically in project_plugin_import.cpp.
Doing so, the dead keys work as expected with a static build.


text:
Q: Cannot connect to port 3306 I'm running CentOS on my VPS and are trying to get remote access to my MySQL database. So I added a line to my iptables using this command:
/sbin/iptables -A INPUT -i eth0 -p tcp --destination-port 3306 -j ACCEPT

But I can't get access to my mysql database. When I do a port scan with nmap This is the result:
>nmap -p 3306 x.x.x.x
>3306/tcp filtered mysql

So stat is not OPEN. This are all the input rules on the VPS. There is one line (already in there) that holds REJECT. Is that blocking the traffic to port 3306?
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     icmp --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ftp
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:smtp
ACCEPT     udp  --  anywhere             anywhere            state NEW udp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:http
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:pop3
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:imap
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:https
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:submission
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:imaps
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:pop3s
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:EtherNet/IP-1
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpts:35000:35999
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:mysql
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:mysql

Thanks in advance!
my.cnf file:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
bind-address=x.x.x.x

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

A: EDIT: I looked at your iptables output more thoroughly and notice that you have some issues there.
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:mysql
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:mysql

You are rejecting all traffic before your rule explicitly allowing traffic to MySQL has a chance to be matched. You need to reorder those rules.

Old Answer:
It is likely that your MySQL server isn't actively listening for remote connections.
The command 'ss -ln | grep 3306' probably won't return any results.
Check your MySQL configuration file for the keywords skip-networking and bind-address. If skip-networking is present in the configuration, comment it out or remove it. Ensure bind-address is set to either 0.0.0.0 ('wildcard') or a system IP address. Restart MySQL to apply the configuration changes.
You will want to ensure you do not have any accounts that are accessible to the world with empty or trivial passwords. Restricting remote access to the MySQL port is strongly recommended in addition to MySQL user and database ACLs.

A: This should be a comment not an anwer, i don't have enough rep.
Since the

3306/tcp filtered mysql

You have probably something wrong with your firewall. If mysql isn't accepting connections to 3306 due not binding to the network it should be closed
tcpdump is your friend to debug the issue, try to check if packets are actually arriving
Just to point that filtered state is often associated with firewall issues, and closed with the actual service not binding

A: The rules in a netfilter firewall are checked sequentially until the first match.
The -A switch to iptables adds new rules  at the end of your existing configuration.
Your existing configuration opens a number of ports and ends with a rule that matches and REJECTs everything that wasn't opened up previously. Then you added  the MySQL port after that.
That rule will never be reached and the MySQL port remains closed.
You should have used the -I switch to iptables to insert the new rule at the beginning of your firewall config.


text:
Q: Error with phpmyadmin importing into my localhost database When I impost database in my localhost xampp server database it's saying:
    Error
SQL offer:

INSERT INTO `wp_fv_DigiWidgetsTemplates` (`templateID`, `templateTitle`, `canvasWidth`, `canvasHeight`) VALUES
(1, 'Small Horizontal', 300, 200),
(2, 'Small Vertical', 200, 300),
(3, 'Large Horizontal', 600, 400),
(4, 'Large Vertical', 400, 600)
MySQL answer: "Документация" (that is my bulgarian localhost)`

 #1062 - Duplicate entry '1' for key 'id'

Any help will be much appricated!

A: first browse your databse table ensure thatthere exists, already, id in 1 as:
SELECT * FROM `wp_fv_DigiWidgetsTemplates`;

To remove this conflict either you edit your preexisting data or importing package one.
Furthermore, you can set templateID as auto-increasing and insert it as NULL as:
INSERT INTO `wp_fv_DigiWidgetsTemplates` (`templateID`, `templateTitle`, `canvasWidth`, `canvasHeight`) VALUES
(NULL, 'Small Horizontal', 300, 200),
(NULL, 'Small Vertical', 200, 300),
(NULL, 'Large Horizontal', 600, 400),
(NULL, 'Large Vertical', 400, 600);

A: your table have already value 1 in 'templateID', Here 'templateID' is primary key and auto-increment so no need to declare here.
you can use this code -

INSERT INTO wp_fv_DigiWidgetsTemplates (templateTitle,
  canvasWidth, canvasHeight) VALUES ('Small Horizontal', 300, 200),
  ('Small Vertical', 200, 300), ('Large Horizontal', 600, 400), ('Large
  Vertical', 400, 600);


text:
Q: adding element of a list to a column of dataframe I have defined such a dataframe:
from pyspark.sql.types import StructType, StructField, IntegerType, StringType
schema = StructType([
    StructField("date", StringType(), True), StructField("amount", StringType(), False), StructField("fontred", StringType(), False)
])

and I have such a list:
Elements=['01.07.', '01.07.', '02.07.', '02.07.', '02.07.', '02.07.']

How can I add elements of this list to first column of dataframe?
date      amount  fontred
----------------------------
01.07.
01.07.
02.07.
02.07.
02.07.
02.07.

A: I think you've confused the nullable parameter... I've changed it for you. See if the code below is what you want:
from pyspark.sql.types import StructType, StructField, IntegerType, StringType

schema = StructType([
    StructField("date", StringType(), False),
    StructField("amount", StringType(), True),
    StructField("fontred", StringType(), True)
])

Elements = ['01.07.', '01.07.', '02.07.', '02.07.', '02.07.', '02.07.']

df = spark.createDataFrame([[i,None,None] for i in Elements], schema=schema)

df.show()
+------+------+-------+
|  date|amount|fontred|
+------+------+-------+
|01.07.|  null|   null|
|01.07.|  null|   null|
|02.07.|  null|   null|
|02.07.|  null|   null|
|02.07.|  null|   null|
|02.07.|  null|   null|
+------+------+-------+

A: You can use a pandas dataframe:
import pandas as pd
import numpy as np

Elements = ['01.07.', '01.07.', '02.07.', '02.07.', '02.07.', '02.07.']
df = pd.DataFrame({'date': Elements})
df['amount'] = df['fontred'] = np.nan
print(df)

Output:
     date  amount  fontred
0  01.07.     NaN      NaN
1  01.07.     NaN      NaN
2  02.07.     NaN      NaN
3  02.07.     NaN      NaN
4  02.07.     NaN      NaN
5  02.07.     NaN      NaN


text:
Q: Stuck in bootloop during windows update Backstory: I am running a dual boot Ubuntu/windows 10 computer, and last night I left my windows on. When I woke up however, it had shut down for some update. When I turned it back on it said that it was upgrading windows, and when it got to the next step my computer rebooted. However, windows had done something with to my bootloader as I got a grub-rescue console ("unknown file system"). I booted into a windows install disk and when nothing I tried worked, booted into a live Ubuntu disk and reinstalled grub to make the bootloader work. Now I could boot to my Ubuntu and Windows again using the grub bootloader.
When I tried to boot windows it continued doing its update, and got to 75% (the moment where it starts to , and shut down again. But after rebooting into windows, the update still was at 75%, and does not continue and windows shuts down again immediately after the update screen, without any progress made. So now I am stuck here...
How can I get windows to either continue and finish its update or roll back the update? If you need more information, please ask, thanks!

A: Please try following steps:

*

*Power down computer. Wait 10 minutes. Start computer. Setup will
automatically restore your previous Windows 10 build or previous
version of Windows.

*Launch command prompt with administrator privileges.
Press Windows key + X Click Command Prompt (Admin) Type
the following command:
rundll32.exe pnpclean.dll,RunDLL_PnpClean /DRIVERS /MAXCLEAN
Hit Enter on your keyboard Exit command prompt and Restart
Then, try to use the ISO file to do the upgrade:
How to: upgrade from previous versions of Windows using Windows 10 ISO file
http://answers.microsoft.com/en-us/insider/wiki/insider_wintp-insider_install/how-to-upgrade-from-previous-versions-of-windows/31722b30-1da9-42bb-b331-0edc4649bf43


text:
Q: nothrow or exception? I am a student and I have small knowledge on C++, which I try to expand. This is more of a philosophical question.. I am not trying to implement something.
Since
#include <new>
//...
T * t = new (std::nothrow) T();
if(t)
{
    //...
}
//...

Will hide the Exception, and since dealing with Exceptions is heavier compared to a simple if(t), why isn't the normal new T() not considered less good practice, considering we will have to use try-catch() to check if a simple allocation succeeded (and if we don't, just watch the program die)??
What are the benefits (if any) of the normal new allocation compared to using a nothrow new? Exception's overhead in that case is insignificant ?
Also, Assume that an allocation fails (eg. no memory exists in the system). Is there anything the program can do in that situation, or just fail gracefully. There is no way to find free memory on the heap, when all is reserved, is there?
Incase an allocation fails, and an std::bad_alloc is thrown, how can we assume that since there is not enough memory to allocate an object (Eg. a new int), there will be enough memory to store an exception ??
Thanks for your time. I hope the question is in line with the rules.

A: Nothrow was added to C++ primarily to support embedded systems developers that want to write exception free code. It is also useful if you actually want to handle memory errors locally as a better solution than malloc() followed by a placement new. And finally it is essential for those who wished to continue to use (what were then current) C++ programming styles based on checking for NULL. [I proposed this solution myself, one of the few things I proposed that didn't get downvoted :]
FYI: throwing an exception on out of memory is very design sensitive and hard to implement because if you, for example, were to throw a string, you might double fault because the string does heap allocation. Indeed, if you're out of memory because your heap crashed into the stack, you mightn't even be able to create a temporary! This particular case explains why the standard exceptions are fairly restricted. Also, if you're catching such an exception fairly locally, why you should catch by reference rather than by value (to avoid a possible copy causing a double fault).
Because of all this, nothrow provide a safer solution for critical applications.

A: I think that the rationale behind why you'd use the regular new instead of the nothrow new is connected to the reason why exceptions are usually preferred to explicitly checking the return value of each function.  Not every function that needs to allocate memory necessarily knows what to do if no memory can be found.  For example, a deeply-nested function that allocates memory as a subroutine to some algorithm probably has no idea how what the proper course of action to take is if memory can't be found.  Using a version of new that throws an exception allows the code that calls the subroutine, not the subroutine itself, to take a more appropriate course of action.  This could be as simple as doing nothing and watching the program die (which is perfectly fine if you're writing a small toy program), or signalling some higher-level program construct to start throwing away memory.
In regards to the latter half of your question, there actually could be things you could do if your program ran out of memory that would make memory more available.  For example, you might have a part of your program that caches old data, and could tell the cache to evict everything as soon as resources became tight.  You could potentially page some less-critical data out to disk, which probably has more space than your memory.  There are a whole bunch of tricks like this, and by using exceptions it's possible to put all the emergency logic at the top of the program, and then just have every part of the program that does an allocation not catch the bad_alloc and instead let it propagate up to the top.
Finally, it usually is possible to throw an exception even if memory is scarce.  Many C++ implementations reserve some space in the stack (or some other non-heap memory segment) for exceptions, so even if the heap runs out of space it can be possible to find memory for exceptions.
Hope this helps!

A: Going around exceptions because they're "too expensive" is premature optimisation. There is practically no overhead of a try/catch if an exception is not thrown.

Is there anything the program can do
  in that situation

Not usually. If there's no memory in the system, you probably can't even write anything to a log, or print to stdout, or anything. If you're out of memory, you're pretty much screwed.

A: Running out of memory is expected to be a rare event, so the overhead of throwing an exception when it happens isn't a problem.  Implementations can "pre-allocate" any memory that's needed for throwing a std::bad_alloc, to ensure that it's available even when the program has otherwise run out of memory.
The reason for throwing an exception by default, instead of returning null, is that it avoids the need for null checks after every allocation.  Many programmers wouldn't bother doing that, and if the program were to continue with a null pointer after a failed allocation, it would probably just crash later with something like a segmentation fault, which doesn't indicate the real cause of the problem.  The use of an exception means that if the OOM condition isn't handled, the program will immediately terminate with an error that actually indicates what went wrong, which makes debugging much easier.
It's also easier to write handling code for out-of-memory situations if they throw exceptions: instead of having to individually check the result of every allocation, you can put a catch block somewhere high in the call stack to catch OOM conditions from many places throughout the program.

A:
Since
  dealing with Exceptions is heavier
  compared to a simple if(t), why isn't
  the normal new T() not considered less
  good practice, considering we will
  have to use try-catch() to check if a
  simple allocation succeeded (and if we
  don't, just watch the program die)??
  What are the benefits (if any) of the
  normal new allocation compared to
  using a nothrow new? Exception's
  overhead in that case is insignificant
  ?

The penalty for using exceptions is indeed very heavy, but (in a decently tuned implementation) the penalty is only paid when an exception is thrown - so the mainline case stays very fast, and there is unlikely to be any measurable performance between the two in your example.
The advantage of exceptions is that your code is simpler: if allocating several objects you don't have to do "allocate A; if (A) { allocate B; if (B) etc...". The cleanup and termination - in both the exception and mainline case - is best handled automatically by RAII (whereas if you're checking manually you will also have to free manually, which makes it all too easy to leak memory).

Also, Assume that an allocation fails
  (eg. no memory exists in the system).
  Is there anything the program can do
  in that situation, or just fail
  gracefully. There is no way to find
  free memory on the heap, when all is
  reserved, is there?

There are many things that it can do, and the best thing to do will depend on the program being written. Failing and exiting (gracefully or otherwise) is certainly one option. Another is to reserve sufficient memory in advance, so that the program can carry on with its functions (perhaps with reduced functionality or performance). It may be able to free up some of its own memory (e.g. if it maintains caches that can be rebuilt when needed). Or (in the case of a server process), the server may refuse to process the current request (or refuse to accept new connections), but stay running so that clients don't drop their connections, and things can start working again once memory returns. Or in the case of an interactive/GUI application, it might display an error to the user and carry on (allowing them to fix the memory problem and try again - or at least save their work!).

Incase an allocation fails, and an
  std::bad_alloc is thrown, how can we
  assume that since there is not enough
  memory to allocate an object (Eg. a
  new int), there will be enough memory
  to store an exception ??

No, usually the standard libraries will ensure, usually by allocating a small amount of memory in advance, that there will be enough memory for an exception to be raised in the event that memory is exhausted.

A: In Symbian C++ it works the other way around. If you want an exception thrown when OOM you have to do
T* t = new(ELeave) T();

And you're right about the logic of throwing a new exception when OOM being strange. A scenario that is manageable suddenly becomes a program termination.


text:
Q: Transaction support in Queues (MSMQ) I'm trying to understand the concept of transaction messaging on MSMQ as well as transaction support in wcf.
For Queues with transaction support, does it mean the following set of operations will be automatic?

*

*Client A on Machine 1 writes a row in its application database that message sent to queue.

*Creates/Sends a Order Create message to a queue (say MSMQ).

*The MSMQ message gets picked up by Client B on Machine 2.

*Client B creates an Order Row in its own application Database?

If I do all the above step in a distributed transaction, does it mean all 4 steps will either fail or succeed atomically?
Or transaction will only apply from step 1 - 2?
Similarly, if say WCF was involved above instead of the MSMQ, will all steps be atomic i.e within a transaction?

A: Short answer: 1+2 is a transaction, then 3+4 is a second transaction.
The only way that 3 might conceivably be in the same transaction as 2 would be for the receiver to be in the same transaction context as the sender (i.e., the same logical thread of execution). Otherwise, as the first transaction has not been committed, the message would not yet be visible for receiving. To propagate the transaction context from the sender to the receiver, there would have to be a second communication channel from the sender to the receiver (i.e., a remote invocation), which would render the message queue redundant. But this doesn't really make sense, as receiving might even get a different message from the queue...
In fact, the point of transactional MQs is precisely to decouple the sender and the receiver in two different transactions, such that the sender is not impacted by the availability and performance of the receiver, at the expense of isolation. The MQ thus provides store and forward atomicity+durability without having two different applications (1 and 4) within the same transactional context. You'll have 1+2 atomically, and eventually 3+4 atomically.
With WCF you can have 1 and 4 in the same transaction, by using WS-AtomicTransactions instead of MQ. In comparison to the MQ solution, this also gives you isolation, as you never observe the effects of 1 without the effects of 4.


text:
Q: Is there WebGL support in Flutter WebView? EDIT 5/28/2020: Not sure when exactly this was fixed, but as of Flutter 1.17.0, I no longer have this problem.
I've been trying to implement an iframe in Flutter WebView that requires WebGL (it displays a 3d model).
However, I get a warning saying WebGL in my browser is supported but not enabled. Here's a snippet for getting to https://get.webgl.org:
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

class ModelView extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Model View'),
      ),
      body: Container(
        child: WebView(
          initialUrl: 'https://get.webgl.org',
          javascriptMode: JavascriptMode.unrestricted,
        ),
      ),
    );
  }
}

Which displays:

Is there a way to enable WebGL for WebView? Or is it impossible right now?

A: webview_flutter on Android uses Platform Views to embed Android WebView while WKWebView is used on iOS. Both have WebGL support so displaying https://get.webgl.org/ should work fine.


text:
Q: Sublime 3; How to accurately count characters when both CR and LF are present in line termination When editing a text file, the default character-counting function in Sublime 3 counts a newline as one character, irrespective of whether the line ends in LF or CR,LF. I cannot find a setting to give me the correct count for a text file with CR,LF line endings.
I've tried installing the WordCount package, but it has the same issue. Setting the preference
char_ignore_whitespace : true

does not change the behaviour.
One could argue that Sublime's behaviour is incorrect since (for the files I am working with) the newline constitutes two characters, not one.
The reason I would like the count to include the CR in the character count (i.e. a newline is 2 characters) is so that I can use Sublime to help debug some code that is using ftell/fseek. As it stands, I have to keep adding the line count to the character count to get the correct byte position in the file (when selecting all text from the beginning of the file to the point of interest).
Is there a setting I am missing? Is there a different package that can be used?
EDIT: I noticed that Notepad++ correctly reports the character count for such files, but I prefer to use Sublime :)
EDIT2: I found some code here (Is it possible to show the exact position in Sublime Text 2?) that works in Sublime 3, but also counts two-character newlines incorrectly.

A: I modified the code in the link above to crudely compensate the the missing end-of-line counts. The code below simply adds the number of lines (zero-based) to the character position and displays this as an alternative position (in case a unix-style file is open, in which case the compensation is not required).
This is admittedly crude, and not intelligent enough to determine what type of line ending the file has. Maybe someone else has a better idea?
import sublime, sublime_plugin

class PositionListener(sublime_plugin.EventListener):
  def on_selection_modified(self,view):
    text = "Position: "
    sels = view.sel()
    for s in sels:
        if s.empty():
            row, col = view.rowcol(s.begin())
            text += str(s.begin())
            text += " [" + str(s.begin() + row) + "]"
        else:
            text += str(s.begin()) + "-" + str(s.end())
            row, col = view.rowcol(s.begin())
            text += " [" + str(s.begin() + row) + "-"
            row, col = view.rowcol(s.end())
            text += str(s.end() + row) + "]"
    view.set_status('exact_pos', text)


text:
Q: Tracking coding tools along with source code The project I work on has a giant repository (think SVN), with our source code, DLL dependencies, build tools (from Qmake to custom GUI builders), and user scripts all stuffed into a tree of directories. When a developer wants to set up a computer for developing, they would install Visual Studio and Eclipse, and then pull all the necessary development tools from the repository. If it's not needed, it isn't pulled.
We're moving to Git for our source code. It works quite well, and we've been happy with the tests we've done. My problem is that we can't move away from our giant repository until we figure out how to handle all our tools. Git currently only contains the source code and scripts relevant to each project. We've broken up the project into smaller Git repositories to make it sensible for a developer to clone only the necessary projects, but we still have the problem of these tools.
So my question is this: how do users of Git manage their tools? If an older version of your build scripts require Qmake v1.0, while the current version requires Qmake 2.0, how do you deal with that? Is it reasonable to add smaller binary tools to the repository, knowing that the cloning operation will download every old version? It worries me that a new developer can't check out an older version of the source code and compile; they'll have to also know how which dev tools are required. As we're in the process of upgrading dev tools, this is an important consideration.
The tools don't change very often, but they do sometimes change. They aren't so big, but I hate the idea of them being in Git. The project is quite old, so we have a lot of "helper programs" which are used for maintenance of the data or sub-tasks a client might want to do.
Possible Solutions

*

*Maven - I have no experience with this, but I like the idea of defining a project "dependency configuration" file that Maven uses to pull relevant binaries from a server.

*Shared drive on the server, filled with all relevant tools. Use them directly on the server - the downside is that if the server goes off-line, all work stops. Maybe the developer has to manually copy the tools he uses? This would be annoying.

*SVN for our tools, Git for our source code. But then we may as well just use SVN for everything, to reduce complexity. A developer can use Git as an SVN client, if desired.

Any ideas? How do you do it?

A: There is another class of software which is designed to help such administrative tasks such as puppet, chef, vagrant. The tools allow to describe environments by special kind of scripts (recipes) and then to set up all software automatically.


text:
Q: Why inject dependencies? Assuming I'm using an IoC container, why exactly must my types have their dependencies injected?  Why can't every type just assume that the container exists and just retrieve the dependencies it needs for itself?  What are the disadvantages to this latter approach?
I'm aware of property injection but I don't want that suggested as an answer even though it does save on having long parameter list constructors in more complex types.  And this doesn't save on the code you ultimately need to type/maintain.  Oh, and I'd prefer to have the dependencies readonly/final (personal preference).
So here's a typical example of constructor injection in C#:
public class Calculator
{
    private readonly IAdder _adder;
    private readonly ISubtractor _subtractor;
    private readonly IMultiplier _multiplier;
    private readonly IDivider _divider;

    public Calculator(IAdder adder, ISubtractor subtractor,
                      IMultiplier multiplier, IDivider divider)
    {
        _adder = adder;
        _subtractor = subtractor;
        _multiplier = multiplier;
        _divider = divider;
    }
}

And here's what I'd rather do:
public class Calculator
{
    private readonly IAdder _adder;
    private readonly ISubtractor _subtractor;
    private readonly IMultiplier _multiplier;
    private readonly IDivider _divider;

    public Calculator()
    {
        _adder = Container.Get<IAdder>();
        _subtractor = Container.Get<ISubtractor>();
        _multiplier = Container.Get<IMultiplier>();
        _divider = Container.Get<IDivider>();
    }
}

I'd like to maintain a list of pros and cons as the answers come in:
PROS

*

*Clean constructors as types need not "pollute" their constructors with dependencies.  It's not a big problem here because Calculator doesn't have anything in its constructor other than dependencies but imagine it did.  E.g. public Calculator(Mode mode, bool UseDigitGrouping).

*Client code doesn't break when a dependency's dependencies change.

*Less code to maintain.

CONS:

*

*Harder to change IoC container in the future.

*It's not immediately clear what a type's dependencies are.

A:
Assuming I'm using an IoC container, why exactly must my types have
  all their dependencies injected? Why can't every type just assume that
  the container exists and just retrieve the dependencies it needs for
  itself? What are the disadvantages to this?

A couple of reasons I can think of, of which you mention one:

*

*It's no longer apparent what dependencies your class has, if any

*The class will assume a hidden dependency on the container, of the worst kind no less (assuming it either exists as a global or is accessible statically)

Your concern regarding how easy it is to adapt the code when a dependency's dependencies change is valid; that's a very strong argument for IoC (let the container do it for you automatically; as long as it's possible to satisfy all dependencies nothing will break).


text:
Q: Why does a valid Texture not reach the Shader? (Direct3D9) Hello everyone I'm currently trying to create a deferred renderer for my graphics engine using c# and SlimDX. As a resource I use this tutorial which is very helpful eventhough it's intended for XNA.
But right now I'm stuck...
I have my renderer set up to draw all geometry's color, normals and depth to seperate render target textures. This works. I can draw the resulting textures to the restored backbuffer as sprites and I can see that they contain just what they are supposed to. But when I try to pass those Textures to another shader, in this case to create a light map, weirds things happen. Here's how I draw one frame:
public bool RenderFrame(FrameInfo fInfo){
    if(!BeginRender()) //checks Device, resizes buffers, calls BeginScene(), etc.
         return false;
    foreach(RenderQueue queue in fInfo.GetRenderQueues()){
        RenderQueue(queue);
    }
    EndRender(); //currently only calls EndScene, used to do more
    ResolveGBuffer();
    DrawDirectionalLight(
        new Vector3(1f, -1f, 0),
        new Color4(1f,1f,1f,1f),
        fi.CameraPosition,
        SlimMath.Matrix.Invert(fi.ViewProjectionMatrix));
}

private void ResolveGBuffer() {
    if(DeviceContext9 == null || DeviceContext9.Device == null)
        return;
    DeviceContext9.Device.SetRenderTarget(0, _backbuffer);
    DeviceContext9.Device.SetRenderTarget(1, null);
    DeviceContext9.Device.SetRenderTarget(2, null);
}

private void DrawDirectionalLight(Vector3 lightDirection, Color4 color, SlimMath.Vector3 cameraPosition, SlimMath.Matrix invertedViewProjection) {
    if(DeviceContext9 == null || DeviceContext9.Device == null)
        return;
        DeviceContext9.Device.BeginScene();
       _directionalLightShader.Shader.SetTexture(
           _directionalLightShader.Parameters["ColorMap"],
           _colorTexture);
       _directionalLightShader.Shader.SetTexture(
           _directionalLightShader.Parameters["NormalMap"],
           _normalTexture);
       _directionalLightShader.Shader.SetTexture(
           _directionalLightShader.Parameters["DepthMap"],
           _depthTexture);
       _directionalLightShader.Shader.SetValue<Vector3>(
           _directionalLightShader.Parameters["lightDirection"],
           lightDirection);
       _directionalLightShader.Shader.SetValue<Color4>(
           _directionalLightShader.Parameters["Color"],
           color);
       _directionalLightShader.Shader.SetValue<SlimMath.Vector3>(
           _directionalLightShader.Parameters["cameraPosition"],
           cameraPosition);
       _directionalLightShader.Shader.SetValue<SlimMath.Matrix>(
           _directionalLightShader.Parameters["InvertViewProjection"],
           invertedViewProjection);
       _directionalLightShader.Shader.SetValue<Vector2>(
           _directionalLightShader.Parameters["halfPixel"],
           _halfPixel);

       _directionalLightShader.Shader.Technique =
           _directionalLightShader.Technique("Technique0");

       _directionalLightShader.Shader.Begin();
       _directionalLightShader.Shader.BeginPass(0);
       RenderQuad(SlimMath.Vector2.One * -1, SlimMath.Vector2.One);
       _directionalLightShader.Shader.EndPass();
       _directionalLightShader.Shader.End();
       DeviceContext9.Device.EndScene();
}

Now when I replace the call to DrawDirectionalLight with some code to draw _colorTexture, _normalTexture and _depthTexture to the screen everything looks ok, but when I use the DrawDirectionalLight function instead I see wild flickering. From the output of PIX it looks like my textures do not get passed to the shader correctly:

Following the tutorial the texture parameters and samplers are defined as follows:
float3 lightDirection;
float3 Color;
float3 cameraPosition;
float4x4 InvertViewProjection;
texture ColorMap;
texture NormalMap;
texture DepthMap;

sampler colorSampler = sampler_state{
Texture  = ColorMap;
AddressU = CLAMP;
AddressV = CLAMP;
MagFilter= LINEAR;
MinFilter= LINEAR;
MipFilter= LINEAR;
};

sampler depthSampler = sampler_state{
Texture  = DepthMap;
AddressU = CLAMP;
AddressV = CLAMP;
MagFilter= POINT;
MinFilter= POINT;
MipFilter= POINT;
};

sampler normalSampler = sampler_state{
Texture  = NormalMap;
AddressU = CLAMP;
AddressV = CLAMP;
MagFilter= POINT;
MinFilter= POINT;
MipFilter= POINT;
};

Now my big question is WHY? There are no error messages printed to debug output.
EDIT:
the rendertargets/textures are created like this:
_colorTexture = new Texture(DeviceContext9.Device,
            DeviceContext9.PresentParameters.BackBufferWidth,
            DeviceContext9.PresentParameters.BackBufferHeight,
            1,
            Usage.RenderTarget,
            Format.A8R8G8B8,
            Pool.Default);

        _colorSurface = _colorTexture.GetSurfaceLevel(0);

        _normalTexture = new Texture(DeviceContext9.Device,
            DeviceContext9.PresentParameters.BackBufferWidth,
            DeviceContext9.PresentParameters.BackBufferHeight,
            1,
            Usage.RenderTarget,
            Format.A8R8G8B8,
            Pool.Default);

        _normalSurface = _normalTexture.GetSurfaceLevel(0);

        _depthTexture = new Texture(DeviceContext9.Device,
            DeviceContext9.PresentParameters.BackBufferWidth,
            DeviceContext9.PresentParameters.BackBufferHeight,
            1,
            Usage.RenderTarget,
            Format.A8R8G8B8,
            Pool.Default);

        _depthSurface = _depthTexture.GetSurfaceLevel(0);

EDIT 2:
The problems seems to lie in the directionalLightShader itselft since passing other regular textures doesn't work either.

A: The answer to my problem is as simple as the problem was stupid. The strange behaviour was caused by 2 different errors:

*

*I was just looking at the wrong events in PIX. The textures we passed correctly to the shader but I didn't see it because it was 'hidden' in the BeginPass-event (behind the '+').

*The pixel shader which I was trying to execute never got called because vertices of the fullscreen quad I used to render were drawn in clockwise order... my CullMode was also set to clockwise...

Thanks to everyone who read this question!


text:
Q: Push object in array create another array I have this array:
var arr = this.products.find(x => x.id == 3);

I'm trying to push an object in this array like:
arr.push({ id: "5", name: "foo3" });

the problem is that I get an array which includes two arrays.
NB: this.products is defined in the prototype of the class and contains an array of objects
console.log(arr):

[Array(4)]
0: Array(4)
0: {id: "1", name: "test"}
1: {id: "2", name: "foo"}
2: {id: "3", name: "foo2"}
length: 3
__proto__: Array(0)
length: 1
__proto__: Array(0)

A:

let arr = [
   { id: "1", option: { bound_id: "2" }},
   { id: "2", option: { bound_id: "12" }},
   { id: "12", option: { bound_id: "2" }}
]

arr.push({ id: "5", option: { bound_id: "4" }})

console.log(arr)

Please make sure thats exactly how your code is written. If so it is correct.

A: first of all, find will return the first element found that satisfies the function that you pass as the documentation says.
second, there is no push function for an object.
as you can see in the snippet below, your code doesnt work, but we may have an idea of what you were trying.

this.products = [{
    id: "1",
    option: {
      bound_id: "5"
    }
  },
  {
    id: "2",
    option: {
      bound_id: "8"
    }
  },
  {
    id: "3",
    option: {
      bound_id: "1"
    }
  },
  {
    id: "4",
    option: {
      bound_id: "1"
    }
  }
]
var arr = this.products.find(x => x.id == 3);

console.log("this IS NOT AN ARRAY", arr)

//this isnt a function, it doesnt even work.
arr.push({
  id: "5",
  name: "foo3"
});

now lets try to see what you were trying to do:
1) complete new array containing both, previous array and the new option at the end.
2) array filterinr the ones with ID === 3

let arr = [{
    id: "1",
    option: {
      bound_id: "5"
    }
  },
  {
    id: "2",
    option: {
      bound_id: "8"
    }
  },
  {
    id: "3",
    option: {
      bound_id: "1"
    }
  },
  {
    id: "4",
    option: {
      bound_id: "1"
    }
  }
]

const otherObj = {
  id: "5",
  option: {
    bound_id: "4"
  }
}

//complete new array containing both, previous array and the new option at the end.
const newArray = [...arr, otherObj]

//array filterinr the ones with ID === 3
const newArrayFiltered = [...arr.filter(i => i.id !== "3"), otherObj]

console.log(newArray)
console.log(newArrayFiltered)


text:
Q: Cropping large DEM data file and save as separate file using ArcGIS for Desktop? How do I crop a section of the US map I am working on from the larger DEM data and save as a separate file on ArcMap 10.2?

A: Create a Polygon Boundary of your area of study then use the polygon as your clipping boundary in the Raster Processing Clip Tool.
In ArcToolbox:
Select
Data Management Tools>Raster>Raster Processing>Clip

populate the Clip Tool with your desired settings.

BE SURE TO ADD YOUR EXTENSION in the Output Raster Dataset field

GIS Geography provides a good article on How to Clip Rasters to Polygon Boundaries in ArcGIS

A: I find that simple is best...
Using the drawing tool draw a graphic box around the area you want to clip.
Right mouse on Image and select "Data" then "Export Data"
Pick you image type and select OK.

A: You want to use the Clip tool for this. There are several ways, the least RAM intensive way for a large file:

*

*In the image analysis window, use the clip area tool for a general space around the region of interest you have. This will create a temporary layer file.

*Create a new polygon for the study area you're looking at, which will be a polygon shapefile. Do this within the arc catalog window within Arcmap [right click on an empty folder/geodatabase; select 'create shapefile]

*Open the edit feature toolbar, and select your newly created shapefile to be edited, draw a polygon and save the edit: this is your new study area

*run the 'clip' tool, with the new study area as the polygon to clip your temporary image layer to ---> this will be your final DEM image clipped to the area you need.


text:
Q: R - Get joint probabilities from 2D Kernel Density Estimate I have two vectors S and V, and using the function kde2d, I get the following plot of their joint density:

Using this data, is it possible to obtain an empirical estimate of the joint probability, in the form P(S[i],V[j]) ?
In the question How to find/estimate probability density function from density function in R it is suggested we use approxfun to get the height of a value in a 1D KDE plot. Is there a way to extend this idea to 2 dimensions?

A: One approach would be to use bilinear interpolation of the grid returned by kde2d:
library(fields)
points <- data.frame(x=0:2, y=c(0, 5, 5))
interp.surface(k, points)
# [1] 0.066104795 0.040191482 0.001943069

Data:
library(MASS)
set.seed(144)
x <- rnorm(1000)
y <- 5*x + rnorm(1000)
k <- kde2d(x, y)


text:
Q: SQL INSERT INTO I have the below query:-
CREATE TABLE #FCO3
(TYPE_CODE varchar (100),
 SKU varchar (100),
 QtyOnHand int);

INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005060','1);
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005066','8);
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005067','1);

It is throwing out an error of:

Msg 102, Level 15, State 1, Line 109
  Incorrect syntax near 'FC03'.

Can anyone help on what is causing this as I must be missing something obvious
Thanks.

A: you have unmatched quotes around the quantity
try:
CREATE TABLE #FCO3
(TYPE_CODE varchar (100),
 SKU varchar (100),
 QtyOnHand int);

INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005060',1);
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005066',8);
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005067',1);

A: try this:-
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005060',1);
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005066',8);
INSERT INTO #FCO3 (TYPE_CODE, SKU, FREQUENCY) VALUES ('FC03','1005067',1)


text:
Q: "Couldn't upload. Try again." error on Google Play Console When I try to upload my Android App Bundle to the Google Play Console, I get this generic error message saying "Couldn't upload. Try again.".
I've already tried:

*

*making sure my versionName and versionCode are unique among all uploaded artifacts

*making sure that the .aab/.apk is signed with the proper key

*re-uploading the .AAB file

*re-uploading the .APK file

*checking status of google services to make sure that there isn't a mass outage

*asking my senior Android dev what's up

How do I resolve this error and upload my .AAB or .APK?

A: Google Chrome
Use a new Incognito window to upload the .aab or .apk (as mentioned in the comments).
Alternatively, clear the website data:

*

*going to: developer console (F12) > Application > Storage > Clear site data

*

*Screenshot

*press F5 to refresh the page

*uploading the .apk/.aab again

Safari
Open Preferences >
Privacy > Manage Website Data > Remove All > Done

A: This problem comes out due to multiple gmail logins on same browser, if the developer account is not the default logged in account. You can solve this by signing out all gmail accounts and login in the specific gmail account.

A: For my case clearing data, using Incognito or changing browser did not work. So, finally I uploaded an APK file (all previous versions were AAB files) and surprisingly Google Play console accepted it!
Give a chance to APK file if the above answers are not helping you.

A: Here's what worked for me:
After getting the error on play console. Now use 'Add from Library' option instead of 'Upload', and you will find your appbundle that failed to upload there, select it and proceed with further steps.

A: Do you have gmail with another account, opened in other tab? If so, sign out from both accounts, then sign in to Google Play console again.

A: I could simply solve the problem by usinng Firefox instead of Chrome. Nothing else helped. With Chrome the problem remained even after applying all the suggestions above. Chrome 56, OS Ubuntu 16.04

A: If your zip align is not successful or verification failed at the end of the zip align process, this error is likely to occur. Please analyze whether zip align was successful. Also, you can try uploading both in .apk and .aab format. You are more likely to get a more detailed error hinting a possible cause.

A: If you're using Unity
I was trying to upload a Unity project. Clearing browser cache, loging out of accounts, trying different browsers, zip align etc. didn't help for me. What did, was to either:
a. Upload an .apk instead of an app bundle.
For some reason, this works completely fine, but app bundles fail every time.
Sadly, apks be unavailable for new apps starting from August 2021 :(
b. Upgrade to a newer version of Unity
Versions that did not work:

*

*2019.4.20

Versions that worked:

*

*2020.3.3

Play Console's error message is not especially helpful, so it's difficult to say exactly what the problem was or what fixed it, but hopefully this will help someone else using Unity.
I haven't tested any Unity versions except those listed above. If you have and also have the necessary stackoverflow rights, feel free to update my list with your own findings.

A: On Safari:
Preferences -> Privacy -> Manage Website Data -> Google (remove that) did it for me! ;-)

A: After that error happened to me, I click "Add From Library" and my uploaded app bundle showed up there, and am able to select it.
No need to logout/login or clear the cache/cookies.

A: After All of trying above, I have just Change the browser from Chrome To "Opera" - and its uploaded very fast. It seems that opera is very fast than chrome.


text:
Q: How to see the changes that were pulled on a `git pull`? After (or before) doing a git pull, is there an easy way to see what the updates are that have been pushed by others to the branch I am working on?

A: I think you'd first do a
git fetch

to pull the new commits, but not merge them yet. Then you could log the changes between your current repository and the remote origin:
git log HEAD..origin

Finally, merge the changes:
git merge origin

For example:
$ git fetch

[...]
From github.com:blah
   00f82fa..38e4017  master     -> origin/master

and:
$ git log HEAD..origin
commit 38e4017bc89a6eb41252465cbde68f7d897377cb
Author: Werner Robitza
Date:   Tue Jul 12 10:56:49 2011 -0700

    Edited Gemfile via GitHub

A: Rather than pulling the other branch into yours, you can first inspect the commits that will be pulled in with git log MINE..THEIRS.  If it is a remote branch, you can fetch their latest changes for the comparison with git remote update.