问:
Unable to assign counter signal to output (FSM)
I'm working on an FSM for a quadrature encoder counter, to be used on the Arty A7 35 --- this is my first VHDL project, so I apologize if I am missing something very basic. I have an internal count signal that I decrement or increment in the FSM, but when I try to assign that signal via COUNT_OUT <= count, COUNT_OUT stays at zero, even though I have been able to observe the state changing. I do this assignment at the very end of the FSM process.

simulation outputs

Further, I am not able to observe "state", "next state", or "count" in simulation --- I would appreciate help on this as well as would be very useful. These signals do not show up in the "objects" window beside the scope either

My entity declaration is as follows:

```<code>entity GPIO_demo is
    Port ( BTN          : in  STD_LOGIC;
           z            : in  STD_LOGIC;
           A            : in  STD_LOGIC;
           B            : in  STD_LOGIC;
           LED          : out STD_LOGIC;
           CLK          : in  STD_LOGIC;
           UART_TXD     : out  STD_LOGIC;
           COUNT_OUT    : out unsigned(11 downto 0)
              );
end GPIO_demo;
</code>```

I define these relevant signals in architecture:

```<code>type state_type is (S00, S01, S10, S11);
signal state, next_state: state_type;
signal count: unsigned(11 downto 0) := (others=>'0');
</code>```

My FSM is as follows:

```<code>SYNC_PROC: process(CLK)
begin
    if rising_edge(CLK) then
        if ( z='1' ) then
            state <= S00;
            count <= "000000000000";
        else
            state <= next_state;
        end if;
    end if;
end process;

NEXT_STATE_DECODE: process(state, A, B)
begin
    case state is
        when S00 =>
            if(A = '0' and B = '1') then
                count <= "000000000000";
                next_state <= S01;
            elsif(A = '1' and B = '0') then
                count <= "000000000000";
                next_state <= S10;
            end if;
         when S01 =>
            if(A = '1' and B = '1') then
                count <= "100000000000";
                next_state <= S11;
            elsif(A = '0' and B = '0') then
                count <= "100000000000";
                next_state <= S00;
            end if;
         when S11 =>
            if(A = '1' and B = '0') then
                count <= count - 1;
                next_state <= S10;
            elsif(A = '0' and B = '1') then
                count <= count + 1;
                next_state <= S01;
            end if;
         when S10 =>
            if(A = '0' and B = '0') then
                count <= count - 1;
                next_state <= S00;
            elsif(A = '1' and B = '1') then
                count <= count + 1;
                next_state <= S11;
            end if;
    end case;
    COUNT_OUT <= count;
end process;
</code>```

Any idea on why this output does not update?

Body:
I'm working on an FSM for a quadrature encoder counter, to be used on the Arty A7 35 --- this is my first VHDL project, so I apologize if I am missing something very basic. I have an internal count signal that I decrement or increment in the FSM, but when I try to assign that signal via COUNT_OUT <= count, COUNT_OUT stays at zero, even though I have been able to observe the state changing. I do this assignment at the very end of the FSM process.

simulation outputs

Further, I am not able to observe "state", "next state", or "count" in simulation --- I would appreciate help on this as well as would be very useful. These signals do not show up in the "objects" window beside the scope either

My entity declaration is as follows:

entity GPIO_demo is
    Port ( BTN          : in  STD_LOGIC;
           z            : in  STD_LOGIC;
           A            : in  STD_LOGIC;
           B            : in  STD_LOGIC;
           LED          : out STD_LOGIC;
           CLK          : in  STD_LOGIC;
           UART_TXD     : out  STD_LOGIC;
           COUNT_OUT    : out unsigned(11 downto 0)
              );
end GPIO_demo;

I define these relevant signals in architecture:

type state_type is (S00, S01, S10, S11);
signal state, next_state: state_type;
signal count: unsigned(11 downto 0) := (others=>'0');

My FSM is as follows:

SYNC_PROC: process(CLK)
begin
    if rising_edge(CLK) then
        if ( z='1' ) then
            state <= S00;
            count <= "000000000000";
        else
            state <= next_state;
        end if;
    end if;
end process;

NEXT_STATE_DECODE: process(state, A, B)
begin
    case state is
        when S00 =>
            if(A = '0' and B = '1') then
                count <= "000000000000";
                next_state <= S01;
            elsif(A = '1' and B = '0') then
                count <= "000000000000";
                next_state <= S10;
            end if;
         when S01 =>
            if(A = '1' and B = '1') then
                count <= "100000000000";
                next_state <= S11;
            elsif(A = '0' and B = '0') then
                count <= "100000000000";
                next_state <= S00;
            end if;
         when S11 =>
            if(A = '1' and B = '0') then
                count <= count - 1;
                next_state <= S10;
            elsif(A = '0' and B = '1') then
                count <= count + 1;
                next_state <= S01;
            end if;
         when S10 =>
            if(A = '0' and B = '0') then
                count <= count - 1;
                next_state <= S00;
            elsif(A = '1' and B = '1') then
                count <= count + 1;
                next_state <= S11;
            end if;
    end case;
    COUNT_OUT <= count;
end process;

Any idea on why this output does not update?


来源: stackexchange

问:
Can "Redeem Code" be directly launched from code?
Per google's documentation (https://developer.android.com/google/play/billing/promo#redeem), the user has to go through the purchase flow and choose "redeem code".

Is there a way to directly launch the code redemption flow that I'm not finding?

Thank you all in advance!

ContentLicense: CC BY-SA 4.0


问:
How to dynamically execute a program file from within a web server? (why is this closed???)
fictively running on a VM

Supposed flow:

I am receiving a request on one of my server endpoints

I'll do some processing and place my "to_do.js" in the local file system

Now I'd like to execute that program but how would I go about that? How can I tell my VM to do that and receive some response from where I am in my code? Am I missing a point or overseeing a technical limitation? I'd be more than happy to any redirections to APIs or opinions - thanks in advance!

PS:
I tried to formulate the question as simple and understandable as possible to make my intent clear. Also I have researched for some time now but there was no thread with a related question.


问:
How to use Input Type Color with Javascript to style css selector?
I have the following CSS for a button:

```<code>    .btn {
background-color:#0d0d0d;
color: #00b0f0;
border: .74px solid currentcolor;
font-size: 16px;
padding: 16px 32px;
cursor: pointer;
}

.btn:hover {
  background-color: #00b0f0;
  color: #0d0d0d;
}

.btn:active {
background-color: #00b0f0;
box-shadow: 0 5px #666;
transform: translateY(4px);
}
</code>```

I also have this color input eyedropper tool in my HTML:

```<code><input type="color" id="s0r4c52" value="#00b0f0" style="border:none;">
</code>```

Finally, I have this function I found on the internet that allows me to style CSS selectors with any color input that I choose.

```<code>    let picker1;
const defaultColor = "#00b0f0";

window.addEventListener("load", startup, false);

function startup() {
  picker1 = document.querySelector("#s0r4c52");
  picker1.value = defaultColor;
  picker1.addEventListener("input", updateFirst, false);
  picker1.addEventListener("change", updateAll, false);

  picker1.select();
}

function updateFirst(event) {
  const p = document.querySelector("td,input,select,.ce31,.slider,.nav li,.nav,.nav li a,.btn");
  if (p) {
    p.style.color = event.target.value;
  }
}

function updateAll(event) {
  document.querySelectorAll("td,input,select,.ce31,.slider,.nav li,.nav,.nav li a,.btn").forEach((p) => {
    p.style.color = event.target.value;
  });
}
</code>```

My question is how do I style the :hover and :active background of the button with the color picker. I want the button to have black (#0d0d0d) text when hovered and clicked, but have the button background change color to whatever I choose with the color picker.

I have found all these codes on the internet and through many hours of trial have gotten it to work for styling at least some CSS selectors. Is there a more efficient way to do all of this??

Body:
I have the following CSS for a button:

    .btn {
background-color:#0d0d0d;
color: #00b0f0;
border: .74px solid currentcolor;
font-size: 16px;
padding: 16px 32px;
cursor: pointer;
}

.btn:hover {
  background-color: #00b0f0;
  color: #0d0d0d;
}

.btn:active {
background-color: #00b0f0;
box-shadow: 0 5px #666;
transform: translateY(4px);
}

I also have this color input eyedropper tool in my HTML:

<input type="color" id="s0r4c52" value="#00b0f0" style="border:none;">

Finally, I have this function I found on the internet that allows me to style CSS selectors with any color input that I choose.

    let picker1;
const defaultColor = "#00b0f0";

window.addEventListener("load", startup, false);

function startup() {
  picker1 = document.querySelector("#s0r4c52");
  picker1.value = defaultColor;
  picker1.addEventListener("input", updateFirst, false);
  picker1.addEventListener("change", updateAll, false);

  picker1.select();
}

function updateFirst(event) {
  const p = document.querySelector("td,input,select,.ce31,.slider,.nav li,.nav,.nav li a,.btn");
  if (p) {
    p.style.color = event.target.value;
  }
}

function updateAll(event) {
  document.querySelectorAll("td,input,select,.ce31,.slider,.nav li,.nav,.nav li a,.btn").forEach((p) => {
    p.style.color = event.target.value;
  });
}

My question is how do I style the :hover and :active background of the button with the color picker. I want the button to have black (#0d0d0d) text when hovered and clicked, but have the button background change color to whatever I choose with the color picker.

I have found all these codes on the internet and through many hours of trial have gotten it to work for styling at least some CSS selectors. Is there a more efficient way to do all of this??


问:
MSys2 64bit gdb gives python error and doesn't work
Recently installed mingw, gdb and gcc using MSys2 as supposed to but the debugger doesn't work under VisualStudio Code nor from cmd/powershell. I tried to delete PYTHONPATH enviromental variable as it solved it for some but not for me.

Everything other works fine, python too.

It gives me a strange error if i want to do gdb --version :

```<code>C:\Users\cseh_>gdb --version
Python path configuration:
  PYTHONHOME = 'C:\Users\cseh_\AppData\Local\Programs\Python\Python310'
  PYTHONPATH = 'C:\Users\cseh_\AppData\Local\Programs\Python\Python310'
  program name = 'c:\msys64\mingw64/bin/python'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = 'c:\\msys64\\mingw64/bin/python.exe'
  sys.base_prefix = 'C:\\Users\\cseh_\\AppData\\Local\\Programs\\Python\\Python310'
  sys.base_exec_prefix = 'C:\\Users\\cseh_\\AppData\\Local\\Programs\\Python\\Python310'
  sys.platlibdir = 'lib'
  sys.executable = 'c:\\msys64\\mingw64/bin/python.exe'
  sys.prefix = 'C:\\Users\\cseh_\\AppData\\Local\\Programs\\Python\\Python310'
  sys.exec_prefix = 'C:\\Users\\cseh_\\AppData\\Local\\Programs\\Python\\Python310'
  sys.path = [
    'C:\\Users\\cseh_\\AppData\\Local\\Programs\\Python\\Python310',
    'C:\\Users\\cseh_\\AppData\\Local\\Programs\\Python\\Python310\\lib\\python310.zip',
    'C:\\Users\\cseh_\\AppData\\Local\\Programs\\Python\\Python310\\lib\\python3.10',
    'C:\\Users\\cseh_\\AppData\\Local\\Programs\\Python\\Python310\\lib\\python3.10\\lib-dynload',
    '',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00002a90 (most recent call first):
  <no Python frame>
</code>```

Update: I tried to unset the 'Other Python' from the variables inside the MSys2 Shell, got to somewhere but still no luck.

```<code>cseh_@Develop08 MSYS ~
$ printenv
ProgramFiles(x86)=C:\Program Files (x86)
!::=::\
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
SHELL=/usr/bin/bash
NUMBER_OF_PROCESSORS=8
PROCESSOR_LEVEL=6
TERM_PROGRAM_VERSION=3.6.2
PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig
USERDOMAIN_ROAMINGPROFILE=DEVELOP08
HOSTNAME=Develop08
PROGRAMFILES=C:\Program Files
MSYSTEM=MSYS
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
ORIGINAL_TEMP=/c/Users/cseh_/AppData/Local/Temp
OS=Windows_NT
HOMEDRIVE=C:
MSYSTEM_CARCH=x86_64
USERDOMAIN=DEVELOP08
PWD=/home/cseh_
USERPROFILE=C:\Users\cseh_
MANPATH=/usr/local/man:/usr/share/man:/usr/man:/share/man
PRINTER=Xerox B210 (XRX9C934EAD9213)
TZ=Europe/Budapest
tmp=C:\Users\cseh_\AppData\Local\Temp
ALLUSERSPROFILE=C:\ProgramData
ORIGINAL_PATH=/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/
CommonProgramW6432=C:\Program Files\Common Files
HOME=/home/cseh_
USERNAME=cseh_
VBOX_MSI_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\
OneDrive=C:\Users\cseh_\OneDrive
COMSPEC=C:\WINDOWS\system32\cmd.exe
APPDATA=C:\Users\cseh_\AppData\Roaming
SYSTEMROOT=C:\WINDOWS
LOCALAPPDATA=C:\Users\cseh_\AppData\Local
COMPUTERNAME=DEVELOP08
INFOPATH=/usr/local/info:/usr/share/info:/usr/info:/share/info
PYTHONPATH=C:\Users\cseh_\AppData\Local\Programs\Python\Python310
TERM=xterm
LOGONSERVER=\\DEVELOP08
ZES_ENABLE_SYSMAN=1
PYTHONHOME=C:\Users\cseh_\AppData\Local\Programs\Python\Python310
USER=cseh_
PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
TEMP=/tmp
temp=C:\Users\cseh_\AppData\Local\Temp
MSYSTEM_CHOST=x86_64-pc-msys
ORIGINAL_TMP=/c/Users/cseh_/AppData/Local/Temp
SHLVL=1
PROCESSOR_REVISION=8c01
DriverData=C:\Windows\System32\Drivers\DriverData
COMMONPROGRAMFILES=C:\Program Files\Common Files
LC_CTYPE=en_US.UTF-8
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 140 Stepping 1, GenuineIntel
SESSIONNAME=Console
PS1=\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[35m\]$MSYSTEM\[\e[0m\] \[\e[33m\]\w\[\e[0m\]\n\$
HOMEPATH=\Users\cseh_
MSYSCON=mintty.exe
TMP=/tmp
CONFIG_SITE=/etc/config.site
PATH=/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
ProgramW6432=C:\Program Files
MSYSTEM_PREFIX=/usr
WINDIR=C:\WINDOWS
PROCESSOR_ARCHITECTURE=AMD64
PUBLIC=C:\Users\Public
SYSTEMDRIVE=C:
OLDPWD=/
GOPATH=C:\Users\cseh_\go
TERM_PROGRAM=mintty
ProgramData=C:\ProgramData
_=/usr/bin/printenv

cseh_@Develop08 MSYS ~
$ unset PYTHONHOME

cseh_@Develop08 MSYS ~
$ unset PYTHONPATH

cseh_@Develop08 MSYS ~
$ printenv
ProgramFiles(x86)=C:\Program Files (x86)
!::=::\
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
SHELL=/usr/bin/bash
NUMBER_OF_PROCESSORS=8
PROCESSOR_LEVEL=6
TERM_PROGRAM_VERSION=3.6.2
PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig
USERDOMAIN_ROAMINGPROFILE=DEVELOP08
HOSTNAME=Develop08
PROGRAMFILES=C:\Program Files
MSYSTEM=MSYS
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
ORIGINAL_TEMP=/c/Users/cseh_/AppData/Local/Temp
OS=Windows_NT
HOMEDRIVE=C:
MSYSTEM_CARCH=x86_64
USERDOMAIN=DEVELOP08
PWD=/home/cseh_
USERPROFILE=C:\Users\cseh_
MANPATH=/usr/local/man:/usr/share/man:/usr/man:/share/man
PRINTER=Xerox B210 (XRX9C934EAD9213)
TZ=Europe/Budapest
tmp=C:\Users\cseh_\AppData\Local\Temp
ALLUSERSPROFILE=C:\ProgramData
ORIGINAL_PATH=/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/
CommonProgramW6432=C:\Program Files\Common Files
HOME=/home/cseh_
USERNAME=cseh_
VBOX_MSI_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\
OneDrive=C:\Users\cseh_\OneDrive
COMSPEC=C:\WINDOWS\system32\cmd.exe
APPDATA=C:\Users\cseh_\AppData\Roaming
SYSTEMROOT=C:\WINDOWS
LOCALAPPDATA=C:\Users\cseh_\AppData\Local
COMPUTERNAME=DEVELOP08
INFOPATH=/usr/local/info:/usr/share/info:/usr/info:/share/info
TERM=xterm
LOGONSERVER=\\DEVELOP08
ZES_ENABLE_SYSMAN=1
USER=cseh_
PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
TEMP=/tmp
temp=C:\Users\cseh_\AppData\Local\Temp
MSYSTEM_CHOST=x86_64-pc-msys
ORIGINAL_TMP=/c/Users/cseh_/AppData/Local/Temp
SHLVL=1
PROCESSOR_REVISION=8c01
DriverData=C:\Windows\System32\Drivers\DriverData
COMMONPROGRAMFILES=C:\Program Files\Common Files
LC_CTYPE=en_US.UTF-8
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 140 Stepping 1, GenuineIntel
SESSIONNAME=Console
PS1=\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[35m\]$MSYSTEM\[\e[0m\] \[\e[33m\]\w\[\e[0m\]\n\$
HOMEPATH=\Users\cseh_
MSYSCON=mintty.exe
TMP=/tmp
CONFIG_SITE=/etc/config.site
PATH=/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
ProgramW6432=C:\Program Files
MSYSTEM_PREFIX=/usr
WINDIR=C:\WINDOWS
PROCESSOR_ARCHITECTURE=AMD64
PUBLIC=C:\Users\Public
SYSTEMDRIVE=C:
OLDPWD=/
GOPATH=C:\Users\cseh_\go
TERM_PROGRAM=mintty
ProgramData=C:\ProgramData
_=/usr/bin/printenv

</code>```

Body:
Recently installed mingw, gdb and gcc using MSys2 as supposed to but the debugger doesn't work under VisualStudio Code nor from cmd/powershell. I tried to delete PYTHONPATH enviromental variable as it solved it for some but not for me.

Everything other works fine, python too.

It gives me a strange error if i want to do gdb --version :

C:\Users\cseh_>gdb --version
Python path configuration:
  PYTHONHOME = 'C:\Users\cseh_\AppData\Local\Programs\Python\Python310'
  PYTHONPATH = 'C:\Users\cseh_\AppData\Local\Programs\Python\Python310'
  program name = 'c:\msys64\mingw64/bin/python'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = 'c:\\msys64\\mingw64/bin/python.exe'
  sys.base_prefix = 'C:\\Users\\cseh_\\AppData\\Local\\Programs\\Python\\Python310'
  sys.base_exec_prefix = 'C:\\Users\\cseh_\\AppData\\Local\\Programs\\Python\\Python310'
  sys.platlibdir = 'lib'
  sys.executable = 'c:\\msys64\\mingw64/bin/python.exe'
  sys.prefix = 'C:\\Users\\cseh_\\AppData\\Local\\Programs\\Python\\Python310'
  sys.exec_prefix = 'C:\\Users\\cseh_\\AppData\\Local\\Programs\\Python\\Python310'
  sys.path = [
    'C:\\Users\\cseh_\\AppData\\Local\\Programs\\Python\\Python310',
    'C:\\Users\\cseh_\\AppData\\Local\\Programs\\Python\\Python310\\lib\\python310.zip',
    'C:\\Users\\cseh_\\AppData\\Local\\Programs\\Python\\Python310\\lib\\python3.10',
    'C:\\Users\\cseh_\\AppData\\Local\\Programs\\Python\\Python310\\lib\\python3.10\\lib-dynload',
    '',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00002a90 (most recent call first):
  <no Python frame>

Update: I tried to unset the 'Other Python' from the variables inside the MSys2 Shell, got to somewhere but still no luck.

cseh_@Develop08 MSYS ~
$ printenv
ProgramFiles(x86)=C:\Program Files (x86)
!::=::\
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
SHELL=/usr/bin/bash
NUMBER_OF_PROCESSORS=8
PROCESSOR_LEVEL=6
TERM_PROGRAM_VERSION=3.6.2
PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig
USERDOMAIN_ROAMINGPROFILE=DEVELOP08
HOSTNAME=Develop08
PROGRAMFILES=C:\Program Files
MSYSTEM=MSYS
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
ORIGINAL_TEMP=/c/Users/cseh_/AppData/Local/Temp
OS=Windows_NT
HOMEDRIVE=C:
MSYSTEM_CARCH=x86_64
USERDOMAIN=DEVELOP08
PWD=/home/cseh_
USERPROFILE=C:\Users\cseh_
MANPATH=/usr/local/man:/usr/share/man:/usr/man:/share/man
PRINTER=Xerox B210 (XRX9C934EAD9213)
TZ=Europe/Budapest
tmp=C:\Users\cseh_\AppData\Local\Temp
ALLUSERSPROFILE=C:\ProgramData
ORIGINAL_PATH=/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/
CommonProgramW6432=C:\Program Files\Common Files
HOME=/home/cseh_
USERNAME=cseh_
VBOX_MSI_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\
OneDrive=C:\Users\cseh_\OneDrive
COMSPEC=C:\WINDOWS\system32\cmd.exe
APPDATA=C:\Users\cseh_\AppData\Roaming
SYSTEMROOT=C:\WINDOWS
LOCALAPPDATA=C:\Users\cseh_\AppData\Local
COMPUTERNAME=DEVELOP08
INFOPATH=/usr/local/info:/usr/share/info:/usr/info:/share/info
PYTHONPATH=C:\Users\cseh_\AppData\Local\Programs\Python\Python310
TERM=xterm
LOGONSERVER=\\DEVELOP08
ZES_ENABLE_SYSMAN=1
PYTHONHOME=C:\Users\cseh_\AppData\Local\Programs\Python\Python310
USER=cseh_
PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
TEMP=/tmp
temp=C:\Users\cseh_\AppData\Local\Temp
MSYSTEM_CHOST=x86_64-pc-msys
ORIGINAL_TMP=/c/Users/cseh_/AppData/Local/Temp
SHLVL=1
PROCESSOR_REVISION=8c01
DriverData=C:\Windows\System32\Drivers\DriverData
COMMONPROGRAMFILES=C:\Program Files\Common Files
LC_CTYPE=en_US.UTF-8
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 140 Stepping 1, GenuineIntel
SESSIONNAME=Console
PS1=\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[35m\]$MSYSTEM\[\e[0m\] \[\e[33m\]\w\[\e[0m\]\n\$
HOMEPATH=\Users\cseh_
MSYSCON=mintty.exe
TMP=/tmp
CONFIG_SITE=/etc/config.site
PATH=/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
ProgramW6432=C:\Program Files
MSYSTEM_PREFIX=/usr
WINDIR=C:\WINDOWS
PROCESSOR_ARCHITECTURE=AMD64
PUBLIC=C:\Users\Public
SYSTEMDRIVE=C:
OLDPWD=/
GOPATH=C:\Users\cseh_\go
TERM_PROGRAM=mintty
ProgramData=C:\ProgramData
_=/usr/bin/printenv

cseh_@Develop08 MSYS ~
$ unset PYTHONHOME

cseh_@Develop08 MSYS ~
$ unset PYTHONPATH

cseh_@Develop08 MSYS ~
$ printenv
ProgramFiles(x86)=C:\Program Files (x86)
!::=::\
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
SHELL=/usr/bin/bash
NUMBER_OF_PROCESSORS=8
PROCESSOR_LEVEL=6
TERM_PROGRAM_VERSION=3.6.2
PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig
USERDOMAIN_ROAMINGPROFILE=DEVELOP08
HOSTNAME=Develop08
PROGRAMFILES=C:\Program Files
MSYSTEM=MSYS
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
ORIGINAL_TEMP=/c/Users/cseh_/AppData/Local/Temp
OS=Windows_NT
HOMEDRIVE=C:
MSYSTEM_CARCH=x86_64
USERDOMAIN=DEVELOP08
PWD=/home/cseh_
USERPROFILE=C:\Users\cseh_
MANPATH=/usr/local/man:/usr/share/man:/usr/man:/share/man
PRINTER=Xerox B210 (XRX9C934EAD9213)
TZ=Europe/Budapest
tmp=C:\Users\cseh_\AppData\Local\Temp
ALLUSERSPROFILE=C:\ProgramData
ORIGINAL_PATH=/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/
CommonProgramW6432=C:\Program Files\Common Files
HOME=/home/cseh_
USERNAME=cseh_
VBOX_MSI_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\
OneDrive=C:\Users\cseh_\OneDrive
COMSPEC=C:\WINDOWS\system32\cmd.exe
APPDATA=C:\Users\cseh_\AppData\Roaming
SYSTEMROOT=C:\WINDOWS
LOCALAPPDATA=C:\Users\cseh_\AppData\Local
COMPUTERNAME=DEVELOP08
INFOPATH=/usr/local/info:/usr/share/info:/usr/info:/share/info
TERM=xterm
LOGONSERVER=\\DEVELOP08
ZES_ENABLE_SYSMAN=1
USER=cseh_
PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
TEMP=/tmp
temp=C:\Users\cseh_\AppData\Local\Temp
MSYSTEM_CHOST=x86_64-pc-msys
ORIGINAL_TMP=/c/Users/cseh_/AppData/Local/Temp
SHLVL=1
PROCESSOR_REVISION=8c01
DriverData=C:\Windows\System32\Drivers\DriverData
COMMONPROGRAMFILES=C:\Program Files\Common Files
LC_CTYPE=en_US.UTF-8
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 140 Stepping 1, GenuineIntel
SESSIONNAME=Console
PS1=\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[35m\]$MSYSTEM\[\e[0m\] \[\e[33m\]\w\[\e[0m\]\n\$
HOMEPATH=\Users\cseh_
MSYSCON=mintty.exe
TMP=/tmp
CONFIG_SITE=/etc/config.site
PATH=/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
ProgramW6432=C:\Program Files
MSYSTEM_PREFIX=/usr
WINDIR=C:\WINDOWS
PROCESSOR_ARCHITECTURE=AMD64
PUBLIC=C:\Users\Public
SYSTEMDRIVE=C:
OLDPWD=/
GOPATH=C:\Users\cseh_\go
TERM_PROGRAM=mintty
ProgramData=C:\ProgramData
_=/usr/bin/printenv


问:
ActiveDocument.Save NoPrompt:=True generates "Wrong number of arguments ..."
I want to print a letter and its envelope to two different printers:

Sub PrintEnvelopeAndLetter()
'
' PrintEnvelopeAndLetter Macro
'
'
    Dim sCurrentPrinter As String
    Dim pageCount As Integer
    Dim currentPosition As Range
    Set currentPosition = Selection.Range 'Save the current cursor position
    pageCount = ActiveDocument.ActiveWindow.Panes(1).Pages.Count

    ' Prompt the user to ask if they are sure they are ready to print
    Result = MsgBox("Are you sure you are ready to print?" & vbCr & vbCr & "Read through your letter one last time.", _
        vbYesNo + vbDefaultButton2 + vbApplicationModal + vbExclamation)
    If Result = vbNo Then
        Exit Sub
    End If

    ' Display a message box asking if the user has entered the correct date
    ' at the top of their letter.
    Result = MsgBox("Did you enter the correct date at the top of your letter?", _
        vbYesNo + vbDefaultButton2 + vbApplicationModal + vbExclamation)
    If Result = vbNo Then
        Exit Sub
    End If

    ' Launch the Spelling and Grammar Check
    ActiveDocument.CheckSpelling
    ActiveDocument.CheckGrammar

    ' Save the document to the disk and do not prompt the user
    ' to save it if the user has made changes
    If ActiveDocument.Saved = False Then
        ActiveDocument.Save True
    End If

    ' Get the total number of pages in the document. NOTE: The
    ' envelope counts as a page
    sCurrentPrinter = ActivePrinter 'Save the current printer

    ActivePrinter = "HP ENVY Photo 7800 series"
    Selection.HomeKey Unit:=wdStory ' move to the top of the document (envelope)
    Application.PrintOut FileName:="", Range:=wdPrintCurrentPage, Item:= _
        wdPrintDocumentWithMarkup, Copies:=1, Pages:="", PageType:= _
        wdPrintAllPages, Collate:=True, Background:=True, PrintToFile:=False, _
        PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
        PrintZoomPaperHeight:=0
    ActivePrinter = "HP OfficeJet Pro 8030 series"
    For J = pageCount To 2 Step -1
        Selection.GoTo wdGoToPage, wdGoToAbsolute, J
        Application.PrintOut FileName:="", Range:=wdPrintCurrentPage, Item:= _
            wdPrintDocumentWithMarkup, Copies:=1, Pages:="", PageType:= _
            wdPrintAllPages, Collate:=True, Background:=True, PrintToFile:=False, _
            PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
            PrintZoomPaperHeight:=0
    Next
    ActivePrinter = sCurrentPrinter 'Restore the original printer

    ' Scroll the insertion point to the very beginning of the document
    Selection.HomeKey Unit:=wdStory

    ' Save the document to the disk and do not prompt the user
    ' to save it if the user has made changes
    If ActiveDocument.Saved = False Then
        ActiveDocument.Save NoPrompt:=True
    End If
End Sub
```
<p>It seems to be indicating that the invalid line is:</p>
```ActiveDocument.Save NoPrompt:=True
```
<p>I think it is correct – see the following link:
https://learn.microsoft.com/en-us/office/vba/api/word.document.save</p>
<p>I am using Microsoft® Word for Microsoft 365 MSO (Version 2210 Build 16.0.15726.20188) 64-bit on Windows 10. The macro worked the day before yesterday.</p>
<p>I checked my printers, and both listed in the macro are installed:</p>
<p><img src="https://i.stack.imgur.com/RJ2zw.png" alt="A screenshot of my installed Printers and Scanners" />
<strong>Figure 1.</strong> A screenshot of my installed Printers and Scanners.</p>
<p>I commented out both occurrences of</p>
<pre class="lang-vb prettyprint-override"><code>' Save the document to the disk and do not prompt the user
' to save it if the user has made changes
If ActiveDocument.Saved = False Then
    ActiveDocument.Save NoPrompt:=True
End If
</code>```

And the macro works, so I know this is the code that it is complaining about. It would seem that the compiler is complaining about a syntax error somewhere, or a function parameter that is not valid. However, every source I've consulted seems to point to this as being valid code.

Body:
I want to print a letter and its envelope to two different printers:

Sub PrintEnvelopeAndLetter()
'
' PrintEnvelopeAndLetter Macro
'
'
    Dim sCurrentPrinter As String
    Dim pageCount As Integer
    Dim currentPosition As Range
    Set currentPosition = Selection.Range 'Save the current cursor position
    pageCount = ActiveDocument.ActiveWindow.Panes(1).Pages.Count

    ' Prompt the user to ask if they are sure they are ready to print
    Result = MsgBox("Are you sure you are ready to print?" & vbCr & vbCr & "Read through your letter one last time.", _
        vbYesNo + vbDefaultButton2 + vbApplicationModal + vbExclamation)
    If Result = vbNo Then
        Exit Sub
    End If

    ' Display a message box asking if the user has entered the correct date
    ' at the top of their letter.
    Result = MsgBox("Did you enter the correct date at the top of your letter?", _
        vbYesNo + vbDefaultButton2 + vbApplicationModal + vbExclamation)
    If Result = vbNo Then
        Exit Sub
    End If

    ' Launch the Spelling and Grammar Check
    ActiveDocument.CheckSpelling
    ActiveDocument.CheckGrammar

    ' Save the document to the disk and do not prompt the user
    ' to save it if the user has made changes
    If ActiveDocument.Saved = False Then
        ActiveDocument.Save True
    End If

    ' Get the total number of pages in the document. NOTE: The
    ' envelope counts as a page
    sCurrentPrinter = ActivePrinter 'Save the current printer

    ActivePrinter = "HP ENVY Photo 7800 series"
    Selection.HomeKey Unit:=wdStory ' move to the top of the document (envelope)
    Application.PrintOut FileName:="", Range:=wdPrintCurrentPage, Item:= _
        wdPrintDocumentWithMarkup, Copies:=1, Pages:="", PageType:= _
        wdPrintAllPages, Collate:=True, Background:=True, PrintToFile:=False, _
        PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
        PrintZoomPaperHeight:=0
    ActivePrinter = "HP OfficeJet Pro 8030 series"
    For J = pageCount To 2 Step -1
        Selection.GoTo wdGoToPage, wdGoToAbsolute, J
        Application.PrintOut FileName:="", Range:=wdPrintCurrentPage, Item:= _
            wdPrintDocumentWithMarkup, Copies:=1, Pages:="", PageType:= _
            wdPrintAllPages, Collate:=True, Background:=True, PrintToFile:=False, _
            PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
            PrintZoomPaperHeight:=0
    Next
    ActivePrinter = sCurrentPrinter 'Restore the original printer

    ' Scroll the insertion point to the very beginning of the document
    Selection.HomeKey Unit:=wdStory

    ' Save the document to the disk and do not prompt the user
    ' to save it if the user has made changes
    If ActiveDocument.Saved = False Then
        ActiveDocument.Save NoPrompt:=True
    End If
End Sub

It seems to be indicating that the invalid line is:

ActiveDocument.Save NoPrompt:=True

I think it is correct – see the following link:
https://learn.microsoft.com/en-us/office/vba/api/word.document.save

I am using Microsoft® Word for Microsoft 365 MSO (Version 2210 Build 16.0.15726.20188) 64-bit on Windows 10. The macro worked the day before yesterday.

I checked my printers, and both listed in the macro are installed:

Figure 1. A screenshot of my installed Printers and Scanners.

I commented out both occurrences of

' Save the document to the disk and do not prompt the user
' to save it if the user has made changes
If ActiveDocument.Saved = False Then
    ActiveDocument.Save NoPrompt:=True
End If

And the macro works, so I know this is the code that it is complaining about. It would seem that the compiler is complaining about a syntax error somewhere, or a function parameter that is not valid. However, every source I've consulted seems to point to this as being valid code.


问:
Typescript compiler emitting empty .js/.js.map files outside rootDir
I have an Azure Functions API folder accompanied by an API client folder structured like this:

```<code>/api
  /GetCustomer
    function.json
    index.ts
  ...
  /dist
  tsconfig.json
/api-client
  /models
    Customer.model.ts
    ...
</code>```

I am trying to compile the API inside /api, but because /GetCustomer/index.ts imports Customer.model.ts, the latter is compiled to .js/.js.map files as well - even though it only contains data models/types.

I am expecting only this file:

```<code>/api
  /dist
    /GetCustomer
      index.js  <---
      function.json
    ...
</code>```

But i also get these files:

```<code>/api-client
  /models
    Customer.model.ts
    Customer.model.js <--- X
    Customer.model.js.map <--- X
</code>```

This is my /api/tsconfig.json:

```<code>{
  "compilerOptions": {
    "module": "ES6",
    "target": "ES6",
    "outDir": "dist",
    "rootDir": ".",
    "sourceMap": true,
    "strict": true,
    "skipLibCheck": true,
    "resolveJsonModule": true,
    "moduleResolution": "Node",
    "allowSyntheticDefaultImports": true
  }
}
</code>```

Am i taking a wrong approach? How would you fix this?

Body:
I have an Azure Functions API folder accompanied by an API client folder structured like this:

/api
  /GetCustomer
    function.json
    index.ts
  ...
  /dist
  tsconfig.json
/api-client
  /models
    Customer.model.ts
    ...

I am trying to compile the API inside /api, but because /GetCustomer/index.ts imports Customer.model.ts, the latter is compiled to .js/.js.map files as well - even though it only contains data models/types.

I am expecting only this file:

/api
  /dist
    /GetCustomer
      index.js  <---
      function.json
    ...

But i also get these files:

/api-client
  /models
    Customer.model.ts
    Customer.model.js <--- X
    Customer.model.js.map <--- X

This is my /api/tsconfig.json:

{
  "compilerOptions": {
    "module": "ES6",
    "target": "ES6",
    "outDir": "dist",
    "rootDir": ".",
    "sourceMap": true,
    "strict": true,
    "skipLibCheck": true,
    "resolveJsonModule": true,
    "moduleResolution": "Node",
    "allowSyntheticDefaultImports": true
  }
}

Am i taking a wrong approach? How would you fix this?


问:
Periodic Volume Profile Hour Range
I am wondering if there is a way to add "HOUR" range to the Periodic Volume Profile in tradingview. The issue is if you set 60 bars on the 1 min chart for instance, it will not match the 1 hour bar.

I think tradingview volume profile very stable and usefull however I'm missing this range.

Reference volume profile from ctrader: https://www.algodeveloper.com/product/volume-profile/

The issue with this one is the platform gets unstable with this third party indicator but the way it shifts the VAH, VAL and POC is very usegull por daytrading.

Thanks in advance.

Could not find this option in tradingview and was wondering if someone have already had this issue and how did you overcome it.

Title: Periodic Volume Profile Hour Range


问:
Automate VTK components generation at CMakeFiles.txt
I see there is a struggle with including a VTK to the C++ project and I wonder, if it can be done more elegant way. Routine work should be automated, right?
All examples I've found consist of two stages:

Include necessary vtk header files in the code.

Link them as libraries in CMakeFiles.txt by find_package( VTK ..."many things" )

You can get the idea how it looks like from here (CylinderExample).

In the same post there is a suggestion to use a FindNeededModules.py to create a module list - and to be honest I have not figured out how to use it.

Anyway, is there a reasonable way to run this script on the code and automatically generate the VTK COMPONENTS list during CMake Configure stage?


问:
Azure SQL Database - Transient Fault Handling doesn't work
I tried to use SQL Azure Transient fault handling, but it doesn't seem to work. My Web Service still throws a transient error. Here is my code:

```<code>public int ExecuteSqlCmd(string sql, object[] parameters)
{
    return (new RetryPolicy<SqlDatabaseTransientErrorDetectionStrategy>(10, TimeSpan.FromSeconds(0.5), TimeSpan.FromSeconds(0.5))).ExecuteAction<int>(() =>
    {
        return this.Database.ExecuteSqlCommand(sql, sqlParams);
    });
}
</code>```

Every now and then, it still throws this error:

```<code>System.Data.Entity.Core.EntityException: An exception has been raised that is likely due to a transient failure. If you are connecting to a SQL Azure database consider using SqlAzureExecutionStrategy. ---> System.Data.SqlClient.SqlException: Transaction (Process ID 84) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
   at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.NonQuery(DbCommand command, DbCommandInterceptionContext interceptionContext)
   at System.Data.Entity.Core.Objects.ObjectContext.ExecuteStoreCommandInternal(String commandText, Object[] parameters)
   at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
   at System.Data.Entity.Core.Objects.ObjectContext.<>c__DisplayClass174_0.<ExecuteStoreCommand>b__0()
   at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
   --- End of inner exception stack trace ---
   at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
   ...
   ...
   ...
</code>```

Any idea why? I have spent days trying to figure out the solution to this problem.

Thanks

Body:
I tried to use SQL Azure Transient fault handling, but it doesn't seem to work. My Web Service still throws a transient error. Here is my code:

public int ExecuteSqlCmd(string sql, object[] parameters)
{
    return (new RetryPolicy<SqlDatabaseTransientErrorDetectionStrategy>(10, TimeSpan.FromSeconds(0.5), TimeSpan.FromSeconds(0.5))).ExecuteAction<int>(() =>
    {
        return this.Database.ExecuteSqlCommand(sql, sqlParams);
    });
}

Every now and then, it still throws this error:

System.Data.Entity.Core.EntityException: An exception has been raised that is likely due to a transient failure. If you are connecting to a SQL Azure database consider using SqlAzureExecutionStrategy. ---> System.Data.SqlClient.SqlException: Transaction (Process ID 84) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
   at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.NonQuery(DbCommand command, DbCommandInterceptionContext interceptionContext)
   at System.Data.Entity.Core.Objects.ObjectContext.ExecuteStoreCommandInternal(String commandText, Object[] parameters)
   at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
   at System.Data.Entity.Core.Objects.ObjectContext.<>c__DisplayClass174_0.<ExecuteStoreCommand>b__0()
   at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
   --- End of inner exception stack trace ---
   at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
   ...
   ...
   ...

Any idea why? I have spent days trying to figure out the solution to this problem.

Thanks


问:
SDL2 eventloop unresponsive
I'm running SDL2 with a c++ application over VcXsrv. I'm trying to take mouse input however the eventloop seems totaly unresponsive. My eventloop looks as following but whithout the mouse logic.

    bool quit = false;
    while (!quit){
        SDL_Event event;
        while (SDL_PollEvent(&event)){
            std::cout << "Event: " << event.type << std::endl;
            if (event.type == SDL_QUIT){
                quit = true;
            }
        }
        SDL_RenderClear(renderer);
        SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255);
        SDL_RenderPresent(renderer);
    }
```
<p>When running the program it outputs:</p>
```Event: 512
Event: 512
Event: 512
Event: 512
Event: 512
Event: 512
```

After that it is completely unresponsive. I cannot exit the window or even get it to poll any more events. To me the code seems completely fine and I don't see the problem.

I've tried to look old working examples that I've built and copy them but they are basically exactly the same.

EDIT: I tried running it on my Ubuntu laptop which worked fine. Maybe it's a windows specific problem?

Title: SDL2 eventloop unresponsive

Body:
I'm running SDL2 with a c++ application over VcXsrv. I'm trying to take mouse input however the eventloop seems totaly unresponsive. My eventloop looks as following but whithout the mouse logic.

    bool quit = false;
    while (!quit){
        SDL_Event event;
        while (SDL_PollEvent(&event)){
            std::cout << "Event: " << event.type << std::endl;
            if (event.type == SDL_QUIT){
                quit = true;
            }
        }
        SDL_RenderClear(renderer);
        SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255);
        SDL_RenderPresent(renderer);
    }

When running the program it outputs:

Event: 512
Event: 512
Event: 512
Event: 512
Event: 512
Event: 512

After that it is completely unresponsive. I cannot exit the window or even get it to poll any more events. To me the code seems completely fine and I don't see the problem.

I've tried to look old working examples that I've built and copy them but they are basically exactly the same.

EDIT: I tried running it on my Ubuntu laptop which worked fine. Maybe it's a windows specific problem?


问:
Discord.js v14 DiscordAPIError[40060]: Interaction has already been acknowledged
My discord command does not work due to the error DiscordAPIError[40060]

I've tried seeing what caused it but couldn't heres my code:

```<code>    if (!interaction.isChatInputCommand()) return;
    if (interaction.commandName === 'help') {
    await interaction.deferReply();
    await wait(800);
   await interaction.editReply({ embeds: [helpEmbed] });
    }
});

client.on(Events.InteractionCreate, async interaction => {
    if (!interaction.isChatInputCommand()) return;
    if (interaction.commandName === 'wombat') {
    await interaction.deferReply();
    await wait(800);
   await interaction.editReply({ embeds: [embed] });
    }
});````
```

Body:
My discord command does not work due to the error DiscordAPIError[40060]

I've tried seeing what caused it but couldn't heres my code:

    if (!interaction.isChatInputCommand()) return;
    if (interaction.commandName === 'help') {
    await interaction.deferReply();
    await wait(800);
   await interaction.editReply({ embeds: [helpEmbed] });
    }
});

client.on(Events.InteractionCreate, async interaction => {
    if (!interaction.isChatInputCommand()) return;
    if (interaction.commandName === 'wombat') {
    await interaction.deferReply();
    await wait(800);
   await interaction.editReply({ embeds: [embed] });
    }
});````


问:
Possible to do incremental training with AWS comprehend?
I am looking at AWS Comprehend for a text classification task which will involve an active learning component. I am trying to understand if it's possible to incrementally train a custom comprehend model using batches of newly annotated data, or if it only supports training from scratch. In this blog post it sounds like they are stitching the annotated data back together with the original training data (i.e. retraining from screatch each time), but I don't see the mentioned cloudformation template (part 1 has the template for training/deployment, but part 2 seems to be talking about another template).

Is it possible to do incremental training with Comprehend? Or would I need to use a custom text classification model through SageMaker and then do incremental training that way? I am attempting to do the following

Get a pretrained model

Fine tune on own classification data

Incrementally train on annotated low confidence preditions

1 and 2 can be done with AWS Comprehend, but not sure about 3. Thanks


问:
dplython: remove duplicates
Is there a way to remove duplicate rows for two specified columns using dplython?

This is an example of what I want to accomplish:

import pandas as pd
from dplython import *

data = {'store': [1, 1, 2, 2, 4, 4],
        'Type': ['A', 'A', 'A', 'B', 'B', 'B'],
        'weekly_sales': [100, 200, 300, 400, 500, 200]}

df = pd.DataFrame(data)
df.drop_duplicates(subset=["store", "Type"])
```
<p><img src="https://i.stack.imgur.com/TLtzd.png" alt="enter image description here" /></p>
<p>This is my dplython attempt:</p>
<pre class="lang-py prettyprint-override"><code>df_R = DplyFrame(df)
df_R >> sift(drop_duplicates(subset=[X.store,X.Type]))
</code>```

Thanks!

Title: dplython: remove duplicates

Body:
Is there a way to remove duplicate rows for two specified columns using dplython?

This is an example of what I want to accomplish:

import pandas as pd
from dplython import *

data = {'store': [1, 1, 2, 2, 4, 4],
        'Type': ['A', 'A', 'A', 'B', 'B', 'B'],
        'weekly_sales': [100, 200, 300, 400, 500, 200]}

df = pd.DataFrame(data)
df.drop_duplicates(subset=["store", "Type"])

This is my dplython attempt:

df_R = DplyFrame(df)
df_R >> sift(drop_duplicates(subset=[X.store,X.Type]))

Thanks!


问:
import SVG file in vanilla javascript
using import statement to import svg files like the following

```<code>import flag from '../assets/icons/flag.svg';
</code>```

and running the file in the browser giving the following error

```<code>Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "image/svg+xml". Strict MIME type checking is enforced for module scripts per HTML spec.
</code>```

and tried to add assertion like the following

```<code>import flag from '../assets/icons/flag.svg' assert {type: 'image/svg+xml'} ;
</code>```

and gave me that

```<code>Uncaught TypeError: "image/svg+xml" is not a valid module type.
</code>```

Title: import SVG file in vanilla javascript

Body:
using import statement to import svg files like the following

import flag from '../assets/icons/flag.svg';

and running the file in the browser giving the following error

Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "image/svg+xml". Strict MIME type checking is enforced for module scripts per HTML spec.

and tried to add assertion like the following

import flag from '../assets/icons/flag.svg' assert {type: 'image/svg+xml'} ;

and gave me that

Uncaught TypeError: "image/svg+xml" is not a valid module type.


问:
how to make select query for Infinite level of tree, using a recusive method
I want to make an SQL query that can select all the children trees that belongs to the chosen parent for example:
the foolowing picture will explain.
if I choose parent hot i must get{tea,green tea, lemon tea,reg tea,cofee,espresso,cappuchino,late}
if I choose "juice" i get also all children belongs for it {mango,orange,lemonade}
I think it should be a recusive select method that can call it self untill all levels of sub childrens are called.
(https://i.stack.imgur.com/h5FGc.png)

DRINK-hot-tea-green,reg,lemontea
|      |_Coffe-Cappuchino,espresso,late
|
|____cold-shake-coktail,strawbery,banann
|__Juice-mango,orange,...
|__water-still,sparkling,flavoured,..

it should be a recursive select method that can call itself until all levels ofsub-childrenn are called.
the table can be
id   name   ref
1    drink   0
2    cold    1
3    hot     1
4    tea     3
5    coffe   3
6    shake   2
7    juice   2
8    water   2
9    espreso 5
10  capucino 5
11  late     5
12  mango    7
13 coktail   6
14 still     8
15 sparkling 8
table


问:
Is it possible to override an Excel window's message pump when formula bar is high lighted by a user?
I have an application using the .NET Excel API to control an instance of Excel; when interacting with the instance of Excel, if the user has the formula bar highlighted to type in a new formula, I am not able to interact with the instance:

Calls to the API or even messages posted to the window fail with an "RPC_E_CALL_REJECTED" (HRESULT: 0x80010001) exception.

As users may happened to have started typing the formula bar then parked the application in the background, this condition is persistent and a retry loop won't work.

I have even tried to use the Win32 API's "PostMessage" method with the window's handle to inject an escape key press to take the user out of the formula bar but this fails with the same exception.

I have also tried to make the instance of Excel non-interactive, however users may open separate workbooks from the Windows shell, and it may open in this non-interactive instance of Excel which is not acceptable. Forcing a new instance of Excel on opening workbooks is not acceptable to users as it prevents certain clipboard interactions when working across instances. "IgnoreRemoteRequests" also hasn't worked since Excel 2013.

Handling the Excel "Open" event to close the workbook and reopen it in a new instance seems heavy handed...

Is there any graceful way to get around this?


问:
Client Cannot find "AuthenticaionService.init"
When I run my application, the browser console throws three, identical errors stating Could not find 'AuthenticationService.init' ('AuthenticationService' was undefined). and Microsoft.JSInterop.JSException: Could not find 'AuthenticationService.init' ('AuthenticationService' was undefined).

However, I cannot find any reference to AuthenticationService.init, only AuthenticationService.js, nor can I find any documentation of it anywhere, so I'm wondering if this might mean that I have swapped ".js" with ".init", but I can't find a single file in my entire solution (even looking on file explorer) that ends with ".init".

I have checked index.html and it specifically refers to

```<code>    <script src="_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js" />
</code>```

as usual.

I see no reference to AuthenticationService.init anywhere and can't find JSInterop.JSException.

Any help is appreciated, thanks.


问:
I encounter this error when training with yolov7 RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)

I want to train with yolov7 and get a .pt file, but I am getting such a problem while doing the training, what could be the reason?


问:
Migrate tf.contrib.lookup.index_table_from_tensor() from TF1.x to TF2.x
I want to migrate a TF1.x implementation towards TF2.x and it used the method:

tf.contrib.lookup.index_table_from_tensor(tensor, dtype=tf.int32),

which is not existing in TF2.x. in tf.lookup.

Is there known way to migrate the function tf.contrib.lookup.index_table_from_tensor(tensor, dtype=tf.int32)?

I tried to change:

tf.contrib.lookup.index_table_from_tensor(tensor, dtype=tf.int32) towards

tf.lookup.index_table_from_tensor(tensor, dtype=tf.int32)

But the method doesn't exist in TF2.x.

I can imagine that tf.lookup.StaticHashTable could help, but there is also no method llike index_table_from_tensor()


问:
How to make a transition as the list moves down HTML
I have a dropdown list that pushed other elements within the container out of the way when a certain list is toggled. I want to get a smooth transition or animation downward when the dropdown list is clicked and I am not entirely sure how. I know there is a way to do it in CSS and I have tried some other examples that have been posted in the past with no luck.

CSS

```<code>a {
color: white;
text-decoration: none;/* Change this to the desired color */
transition: background-color 0.2s;
}

.dropdown-container {
  position: relative; /* create a positioning context for the list items */
  background-color: #333;
    color: white;
    text-decoration: none;
width: 150px;
text-align: center;
    transition: background-color 0.2s;
}

.dropdown-list {
  position: relative; /* position the list items absolutely */
 display: none; /* hide the list by default */
  top: 100px; /* hide the list by default */
  list-style-type: none; /* remove the bullet points for the list items */
  padding: 0; /* remove the padding for the list */
  left: 0; /* position the list items at the left edge of the list */
  transition: border 0.2s; /* add a transition effect for the border */
  background-color: #b0b0b0;
  color: black;
  text-decoration: none;
width: 150px;
    text-align: center;
    transition: background-color 0.2s;
}

.dropdown-list li:hover {
  background-color: #04AA6D;
    transition: background-color 0.2s;}/* change the background color of the list items
to green when they are hovered over */
}
.dropdown-list li {
  color: black; /* set the color of the list items to black */
    text-align: center;
    transition: background-color 0.2s;
}
</code>```

HTML

```<code><div class="dropdown-container">
  <p><a href="#" onclick="toggleVisibility(this)">Global Models</a></p>
  <ul class="dropdown-list">
    <li><a href="#">GFS</a></li>
    <li><a href="#">CMC</a></li>
    <li><a href="#">ECMWF</a></li>
  </ul>
</div>
<div class="dropdown-container">
  <p><a href="#" onclick="toggleVisibility(this)">Mesoscale Models</a></p>
  <ul class="dropdown-list">
      <li><a href="#">NAM 12km</a></li>
    <li><a href="#">NAM 3km</a></li>
    <li><a href="#">HRRR</a></li>
  </ul>
</div>
<div class="dropdown-container">
  <p><a href="#" onclick="toggleVisibility(this)">Ensembles</a></p>
  <ul class="dropdown-list">
      <li><a href="#">GEFS</a></li>
    <li><a href="#">GEPS</a></li>
    <li><a href="#">Super Ensemble</a></li>
  </ul>
</div>
</code>```

JS

```<code>    function toggleVisibility(link) {
  // get the corresponding list
  var list = link.parentElement.nextElementSibling;

  // toggle the visibility of the list
  if (list.style.display === "none") {
    // hide all other lists
    var otherLists = document.querySelectorAll(".dropdown-list");
    for (var i = 0; i < otherLists.length; i++) {
      otherLists[i].style.display = "none";
    }

    // position the selected list below the previous list
    list.style.top = (link.parentElement.offsetTop + link.parentElement.offsetHeight) +
"px";

    // show the selected list
    list.style.display = "block";
  } else {
    list.style.display = "none";
  }
}
</code>```

Thanks

Body:
I have a dropdown list that pushed other elements within the container out of the way when a certain list is toggled. I want to get a smooth transition or animation downward when the dropdown list is clicked and I am not entirely sure how. I know there is a way to do it in CSS and I have tried some other examples that have been posted in the past with no luck.

CSS

a {
color: white;
text-decoration: none;/* Change this to the desired color */
transition: background-color 0.2s;
}

.dropdown-container {
  position: relative; /* create a positioning context for the list items */
  background-color: #333;
    color: white;
    text-decoration: none;
width: 150px;
text-align: center;
    transition: background-color 0.2s;
}

.dropdown-list {
  position: relative; /* position the list items absolutely */
 display: none; /* hide the list by default */
  top: 100px; /* hide the list by default */
  list-style-type: none; /* remove the bullet points for the list items */
  padding: 0; /* remove the padding for the list */
  left: 0; /* position the list items at the left edge of the list */
  transition: border 0.2s; /* add a transition effect for the border */
  background-color: #b0b0b0;
  color: black;
  text-decoration: none;
width: 150px;
    text-align: center;
    transition: background-color 0.2s;
}

.dropdown-list li:hover {
  background-color: #04AA6D;
    transition: background-color 0.2s;}/* change the background color of the list items
to green when they are hovered over */
}
.dropdown-list li {
  color: black; /* set the color of the list items to black */
    text-align: center;
    transition: background-color 0.2s;
}

HTML

Global Models

GFS

CMC

ECMWF

Mesoscale Models

NAM 12km

NAM 3km

HRRR

Ensembles

GEFS

GEPS

Super Ensemble

JS

    function toggleVisibility(link) {
  // get the corresponding list
  var list = link.parentElement.nextElementSibling;

  // toggle the visibility of the list
  if (list.style.display === "none") {
    // hide all other lists
    var otherLists = document.querySelectorAll(".dropdown-list");
    for (var i = 0; i < otherLists.length; i++) {
      otherLists[i].style.display = "none";
    }

    // position the selected list below the previous list
    list.style.top = (link.parentElement.offsetTop + link.parentElement.offsetHeight) +
"px";

    // show the selected list
    list.style.display = "block";
  } else {
    list.style.display = "none";
  }
}

Thanks


问:
Material UI DatePicker onChange not working when clicking on a day, only when changed on the input
I'm trying to configure a StaticDatePicker, it all works as expected, but when I try to style the days with renderDay, it no longer allows me to change the date by clicking on the day itself, and can only change the date when I click on the edit button and change the date on the input itself.

If I comment out the renderDay={(day, date, isInCurrentMonth... line, it all works normally, but the styling for each day back to the default.

Am I missing something? I tried looking into the docs, but I didn't find anything in there.

// What is being passed down as props to the component is the useState for the current selected date, and the setShow which shows/hides the calendar when a string with the date is clicked.

```<code>import React from 'react'
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'
import { StaticDatePicker } from '@mui/x-date-pickers'
import { LocalizationProvider } from '@mui/x-date-pickers'
import { Grid, Paper, TextField } from '@mui/material'
import { makeStyles } from '@mui/styles'
import dayjs from 'dayjs'

const styles = makeStyles(() => ({
  pendingCloseDay: {
    backgroundColor: 'red',
    width: '35px',
    height: '35px',
    padding: '1px',
  },
  closedDay: {
    backgroundColor: 'green',
    width: '35px',
    height: '35px',
    padding: '1px',
  },
  noMovementsDay: {
    backgroundColor: 'white',
    width: '35px',
    height: '35px',
    padding: '1px'
  },
  currentDay: {
    backgroundColor: 'blue',
    width: '35px',
    height: '35px',
    padding: '1px'
  },
  futureDays: {
    backgroundColor: 'gray',
    width: '35px',
    height: '35px',
    padding: '1px'
  },
  selectedDay: {
    backgroundColor: 'pink',
    width: '35px',
    height: '35px',
    padding: '1px'
  }
}))

const Calendar = ({date, setDate, setShow}) => {
  const classes = styles()
  const today = dayjs()

  const handleChange = (e) => {
    setDate(e)
    setShow(prev => !prev)
  }

  const mockDataForDays = (day, date, isInCurrentMonth, dayComponent) => {
    let randomValueForDay = Math.random()
    const isSelected = day.$d.getDate() === date[0].$d.getDate() && day.$d.getMonth() === date[0].$d.getMonth()
    const isToday = day.$d.getDate() === today.$d.getDate() && day.$d.getMonth() === today.$d.getMonth()
    let dateTile

    if(isInCurrentMonth) {
      if(isInCurrentMonth.disabled) {
        dateTile = (
          <div key={day} className={isSelected ? classes.selectedDay : isToday ? classes.currentDay : classes.futureDays} >
            <Grid item>{day.$d.getDate()}</Grid>
          </div>
        )
      } else if(randomValueForDay >= 0.66) {
        dateTile = (
          <div key={day} className={isSelected ? classes.selectedDay : isToday ? classes.currentDay : classes.noMovementsDay} >
            <Grid item>{day.$d.getDate()}</Grid>
          </div>
        )
      } else if (randomValueForDay >= 0.33) {
        dateTile = (
          <div key={day} className={isSelected ? classes.selectedDay : isToday ? classes.currentDay : classes.closedDay} >
            <Grid item>{day.$d.getDate()}</Grid>
          </div>
        )
      } else {
        dateTile = (
          <div key={day} className={isSelected ? classes.selectedDay : isToday ? classes.currentDay : classes.pendingCloseDay} >
            <Grid item>{day.$d.getDate()}</Grid>
          </div>
        )

      }
    }
    return dateTile
  }

  return (
    <LocalizationProvider dateAdapter={AdapterDayjs}>
      <StaticDatePicker
      sx={{'.MuiDayPicker-header': {gap: '0.5rem'}}}
      // showDaysOutsideCurrentMonth
      disableFuture={true}
      // closeOnSelect={true}
      openTo='day'
      value={date}
      toolbarTitle=''
      onChange={handleChange}
      renderInput={params => <TextField  {...params} />}
      componentsProps={{
        actionBar: {
          actions: []
        }
      }}
      renderDay={(day, date, isInCurrentMonth, dayComponent) => mockDataForDays(day, date, isInCurrentMonth, dayComponent)}
      />
    </LocalizationProvider>
  )
}

export default Calendar
</code>```

I'm trying to style each day, while still being able to select the date by clicking on a specific date, if someone can help me or guide me on the correct direction to solve the issue, it would be greatly appreciated :)

Body:
I'm trying to configure a StaticDatePicker, it all works as expected, but when I try to style the days with renderDay, it no longer allows me to change the date by clicking on the day itself, and can only change the date when I click on the edit button and change the date on the input itself.

If I comment out the renderDay={(day, date, isInCurrentMonth... line, it all works normally, but the styling for each day back to the default.

Am I missing something? I tried looking into the docs, but I didn't find anything in there.

// What is being passed down as props to the component is the useState for the current selected date, and the setShow which shows/hides the calendar when a string with the date is clicked.

import React from 'react'
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'
import { StaticDatePicker } from '@mui/x-date-pickers'
import { LocalizationProvider } from '@mui/x-date-pickers'
import { Grid, Paper, TextField } from '@mui/material'
import { makeStyles } from '@mui/styles'
import dayjs from 'dayjs'

const styles = makeStyles(() => ({
  pendingCloseDay: {
    backgroundColor: 'red',
    width: '35px',
    height: '35px',
    padding: '1px',
  },
  closedDay: {
    backgroundColor: 'green',
    width: '35px',
    height: '35px',
    padding: '1px',
  },
  noMovementsDay: {
    backgroundColor: 'white',
    width: '35px',
    height: '35px',
    padding: '1px'
  },
  currentDay: {
    backgroundColor: 'blue',
    width: '35px',
    height: '35px',
    padding: '1px'
  },
  futureDays: {
    backgroundColor: 'gray',
    width: '35px',
    height: '35px',
    padding: '1px'
  },
  selectedDay: {
    backgroundColor: 'pink',
    width: '35px',
    height: '35px',
    padding: '1px'
  }
}))

const Calendar = ({date, setDate, setShow}) => {
  const classes = styles()
  const today = dayjs()

  const handleChange = (e) => {
    setDate(e)
    setShow(prev => !prev)
  }

  const mockDataForDays = (day, date, isInCurrentMonth, dayComponent) => {
    let randomValueForDay = Math.random()
    const isSelected = day.$d.getDate() === date[0].$d.getDate() && day.$d.getMonth() === date[0].$d.getMonth()
    const isToday = day.$d.getDate() === today.$d.getDate() && day.$d.getMonth() === today.$d.getMonth()
    let dateTile

    if(isInCurrentMonth) {
      if(isInCurrentMonth.disabled) {
        dateTile = (

            <Grid item>{day.$d.getDate()}</Grid>

        )
      } else if(randomValueForDay >= 0.66) {
        dateTile = (

            <Grid item>{day.$d.getDate()}</Grid>

        )
      } else if (randomValueForDay >= 0.33) {
        dateTile = (

            <Grid item>{day.$d.getDate()}</Grid>

        )
      } else {
        dateTile = (

            <Grid item>{day.$d.getDate()}</Grid>

        )

      }
    }
    return dateTile
  }

  return (
    <LocalizationProvider dateAdapter={AdapterDayjs}>
      <StaticDatePicker
      sx={{'.MuiDayPicker-header': {gap: '0.5rem'}}}
      // showDaysOutsideCurrentMonth
      disableFuture={true}
      // closeOnSelect={true}
      openTo='day'
      value={date}
      toolbarTitle=''
      onChange={handleChange}
      renderInput={params => <TextField  {...params} />}
      componentsProps={{
        actionBar: {
          actions: []
        }
      }}
      renderDay={(day, date, isInCurrentMonth, dayComponent) => mockDataForDays(day, date, isInCurrentMonth, dayComponent)}
      />
    </LocalizationProvider>
  )
}

export default Calendar

I'm trying to style each day, while still being able to select the date by clicking on a specific date, if someone can help me or guide me on the correct direction to solve the issue, it would be greatly appreciated :)


问:
Can I run NoteTab clips from the command line?
I'm writing HTML documentation and sometimes need to update the "master" CSS and then run a batch file in Windows to copy the updated CSS files to the various doc projects. Then I use clips in NoteTab Light to tweak the CSS for this doc or that in specific places. I'm looking for a way to execute a clip in NoteTab from the command line to go something like:

open NoteTab > open doc1.css > execute Clip1 > save doc1.css

after I run the batch file. Ideas?


问:
Android signing configs how to remove
I got an Android project with a bunch of flavors and when trying to build it I get the error SigningConfig "xyzDebugKey" is missing required property "storeFile". When I go to Project Structure/Modules/Signing Configs I see 3 keys: debug, xyzDebugKey and releaseKey, where do these come from? I cannot find any signing block in any gradle file, I would like to know where does the UI loads this info from? I suppose it must be some config file somewhere? I'm also not able to remove this key, if I press the "-" button to remove it and I press apply this key appears again after few seconds.

Title: Android signing configs how to remove


问:
React - how can I make the return of JSX wait until my useEffect() ended
I am new to react - but I feel I miss some crucial skill to make my simple usecase work.

Usecase :

I have a topcomponent (app.js) inject an empty state object 'ownFantasyTeam' and its respective set-function 'setOwnFantasyTeam' to a subcomponent (team.js). The first thing that I want this subcomponent to do is to load the data (from a backend-api) through its useEffect() and have this set through the prop set-method.

Further down, in the subcomponent return(), I was hoping that the recently loaded and set state data object 'ownFantasyTeam' could be used within the JSX.

Problem/Question

JSX should show the name of the team, but it does not do that (instead showing hardcoded ERR). Can someone explain what I am doing wrong and how I can fix this? Is it because I am using a parent/child component structure?

Code

'app.js'

```<code>import React, { Fragment, useState } from "react";
import { Route, Routes } from "react-router-dom";

import { Team } from "./pages/Team";

function App() {

  const [ownFantasyTeam, setOwnFantasyTeam] = useState();

  return (
    <>
      <Routes>
        <Route path="/team" element={
          <Team
            ownFantasyTeam={ownFantasyTeam}
            setOwnFantasyTeam={setOwnFantasyTeam}
          />
        } />
      </Routes>
    </>
  );
}

export default App;
</code>```

'team.js'

```<code>import React, { Fragment, useEffect } from "react";

import {
    readFantasyTeamByFantasyManagerId,
} from '../utils';

export function Team(props) {

    useEffect(() => {
        if (!props.ownFantasyTeam) {
            getFantasyTeamData();
        }
    }, []);

    const getFantasyTeamData = async () => {
        const testFantasyManagerId = 1;     // for testing purpose
        const fantasyTeamData = await readFantasyTeamByFantasyManagerId(testFantasyManagerId);
        if (fantasyTeamData.length > 0) {
            props.changeOwnFantasyTeam(fantasyTeamData);
        }
        return fantasyTeamData;
    }

    return (
        <Fragment>
            <div className="text-center my-5">
                <h3>Your Team {props.ownFantasyTeam ? props.ownFantasyTeam.name : 'ERR'} </h3>
            </div>
        </Fragment>
    )
}
</code>```

Body:
I am new to react - but I feel I miss some crucial skill to make my simple usecase work.

Usecase :

I have a topcomponent (app.js) inject an empty state object 'ownFantasyTeam' and its respective set-function 'setOwnFantasyTeam' to a subcomponent (team.js). The first thing that I want this subcomponent to do is to load the data (from a backend-api) through its useEffect() and have this set through the prop set-method.

Further down, in the subcomponent return(), I was hoping that the recently loaded and set state data object 'ownFantasyTeam' could be used within the JSX.

Problem/Question

JSX should show the name of the team, but it does not do that (instead showing hardcoded ERR). Can someone explain what I am doing wrong and how I can fix this? Is it because I am using a parent/child component structure?

Code

'app.js'

import React, { Fragment, useState } from "react";
import { Route, Routes } from "react-router-dom";

import { Team } from "./pages/Team";

function App() {

  const [ownFantasyTeam, setOwnFantasyTeam] = useState();

  return (
    <>
      <Routes>
        <Route path="/team" element={
          <Team
            ownFantasyTeam={ownFantasyTeam}
            setOwnFantasyTeam={setOwnFantasyTeam}
          />
        } />
      </Routes>
    </>
  );
}

export default App;

'team.js'

import React, { Fragment, useEffect } from "react";

import {
    readFantasyTeamByFantasyManagerId,
} from '../utils';

export function Team(props) {

    useEffect(() => {
        if (!props.ownFantasyTeam) {
            getFantasyTeamData();
        }
    }, []);

    const getFantasyTeamData = async () => {
        const testFantasyManagerId = 1;     // for testing purpose
        const fantasyTeamData = await readFantasyTeamByFantasyManagerId(testFantasyManagerId);
        if (fantasyTeamData.length > 0) {
            props.changeOwnFantasyTeam(fantasyTeamData);
        }
        return fantasyTeamData;
    }

    return (
        <Fragment>

Your Team {props.ownFantasyTeam ? props.ownFantasyTeam.name : 'ERR'}

        </Fragment>
    )
}


问:
VS Mac cannot drag/drop from toolbox onto Android layout
Versions:

MacOS: Ventura 13.0.1

VS Mac: 17.4.1 (build 28)

Android extensions: 17.4.x

My layout xml looks like this:

    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        tools:showIn="@layout/activity_main"
        android:minWidth="25px"
        android:minHeight="25px"
        android:id="@+id/main_layout">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/main_prompt"
            android:id="@+id/main_prompt" />

    </LinearLayout>
```

When I drag anything (say Button) from the toolbox into the layout xml or onto the design view, it just disappears (it actually flies back to the toolbox). No other indicators whatsoever. I want to add controls after the above TextView control.

I was expecting the new control to show up in the layout xml and the design view. I cannot understand why there is no visual feedback. It just does not work.

Body:
Versions:

MacOS: Ventura 13.0.1

VS Mac: 17.4.1 (build 28)

Android extensions: 17.4.x

My layout xml looks like this:

    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        tools:showIn="@layout/activity_main"
        android:minWidth="25px"
        android:minHeight="25px"
        android:id="@+id/main_layout">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/main_prompt"
            android:id="@+id/main_prompt" />

    </LinearLayout>

When I drag anything (say Button) from the toolbox into the layout xml or onto the design view, it just disappears (it actually flies back to the toolbox). No other indicators whatsoever. I want to add controls after the above TextView control.

I was expecting the new control to show up in the layout xml and the design view. I cannot understand why there is no visual feedback. It just does not work.


问:
Wordpress - wp admin table row actions
I'm making custom plugin to display new table in wp-admin from database. The point of this table is that database has two tables - a table and b table. They are both connected by id. In main table I want to display a table information - Order_id, User_id, Customer, Name surname... This part I manage to do, but I want to add row action view, which would be directed to single view, where it would display information from table B which is with same order_id

Table - basically when I would press view it would redirect to another page and would get data from table B with order_id 14.

```<code> public function register()
    {
        add_action( 'admin_menu', array( $this, 'my_admin_menu') );

    }

    public function customerview_admin_page(){
    ?>
    <div class="wrap">
        <h2>Customer Details</h2>
        <?php
        global $wpdb;
        $orders = $wpdb->get_results("SELECT * FROM wpel_dalisima_orders ORDER BY order_id DESC;");
        echo "<table class='widefat fixed'>";
        echo "<th>Order_id</th>";
        echo "<th>User_id</th>";
        echo "<th>Customer</th>";
        echo "<th>Name Surname</th>";
        echo "<th>Company name</th>";
        echo "<th>Address</th>";
        echo "<th>Phone number</th>";
        echo "<th>Email</th>";
        echo "<th>Delivery_address</th>";
        foreach($orders as $order){
            echo "<tr>";
            echo "<td>".$order->order_id."</td>";
            echo "<td>".$order->user_id."</td>";
            echo "<td>".$order->customer."</td>";
            echo "<td>".$order->name_surname."</td>";
            echo "<td>".$order->company_name."</td>";
            echo "<td>".$order->address."</td>";
            echo "<td>".$order->phone_number."</td>";
            echo "<td>".$order->email."</td>";
            echo "<td>".$order->delivery_address."</td>";
            echo "</tr>";
        }
        echo "</table>";
        ?>
    </div>
    <?php
    }

    public function my_admin_menu() {
    add_menu_page('My Page Title', 'My Menu Title', 'manage_options', 'my-menu', 'my_menu_output' );
    add_submenu_page('my-menu', 'Submenu Page Title', 'Whatever You Want', 'manage_options', 'my-menu' );
    add_submenu_page('my-menu', 'Submenu Page Title2', 'Whatever You Want2', 'manage_options', 'my-menu2', array($this, 'customerview_admin_page'));

    }
</code>```

This is current code. How can I exactly add this view action button and redirect it to another page? Couldn't find any information that would help..

Title: Wordpress - wp admin table row actions

Body:
I'm making custom plugin to display new table in wp-admin from database. The point of this table is that database has two tables - a table and b table. They are both connected by id. In main table I want to display a table information - Order_id, User_id, Customer, Name surname... This part I manage to do, but I want to add row action view, which would be directed to single view, where it would display information from table B which is with same order_id

Table - basically when I would press view it would redirect to another page and would get data from table B with order_id 14.

 public function register()
    {
        add_action( 'admin_menu', array( $this, 'my_admin_menu') );

    }

    public function customerview_admin_page(){
    ?>

Customer Details

        <?php
        global $wpdb;
        $orders = $wpdb->get_results("SELECT * FROM wpel_dalisima_orders ORDER BY order_id DESC;");
        echo "
";
        echo "Order_id	";
        echo "User_id	";
        echo "Customer	";
        echo "Name Surname	";
        echo "Company name	";
        echo "Address	";
        echo "Phone number	";
        echo "Email	";
        echo "Delivery_address	";
        foreach($orders as $order){
            echo "
";
            echo "".$order->order_id."	";
            echo "".$order->user_id."	";
            echo "".$order->customer."	";
            echo "".$order->name_surname."	";
            echo "".$order->company_name."	";
            echo "".$order->address."	";
            echo "".$order->phone_number."	";
            echo "".$order->email."	";
            echo "".$order->delivery_address."	";
            echo "
";
        }
        echo "
";
        ?>

    <?php
    }

    public function my_admin_menu() {
    add_menu_page('My Page Title', 'My Menu Title', 'manage_options', 'my-menu', 'my_menu_output' );
    add_submenu_page('my-menu', 'Submenu Page Title', 'Whatever You Want', 'manage_options', 'my-menu' );
    add_submenu_page('my-menu', 'Submenu Page Title2', 'Whatever You Want2', 'manage_options', 'my-menu2', array($this, 'customerview_admin_page'));

    }

This is current code. How can I exactly add this view action button and redirect it to another page? Couldn't find any information that would help..


问:
JDBC EZConnect URL: Invalid number format for port number when specifying Protocol
When specifying a JDBC EZConnect URL to include the Protocol, for example:

jdbc:oracle:thin:@tcps://example1.com:1522/my_service_name
jdbc:oracle:thin:@tcp://example1.com:1522/my_service_name

I am getting the error "Status : Failure - Test Failed: IO Error: Invalid number format for port number"

I am following the example page XXX of the Oracle 19c JDBC Developers Guide (http://ora-srv.wlv.ac.uk/oracle19c_doc/jjdbc/jdbc-developers-guide.pdf)

Does anyone have any input into why this error is occurring ?

Thanks
Andrew


问:
Is there a simple way to shutdown (or delete) a compute instance once its job is done?
I am creating spot compute instances with gcloud compute instances create-with-container and I want to delete them once containers are done.

I found two solutions so far and they are not satisfactory:

Give them a startup-script with auto shutdown at the end. I thought the point of create-with-container was I can just launch the container without setting things up. I move to create from create-with-container to deal with fewer setups.

Call shutdown inside a container at the end of its job. The problem is when the container encounters an error it fails to call shutdown.

Are there better and more robust ways of shutting down an instance when it finishes its job?


问:
[Leaflet ]How to allow user to input name of polygon when drawing/editing polygons in Leaflet
I'm currently using leaflet and leaflet.draw to create a website where the user can freehand polygons on a map. I'd like to design a text field that pops up when the user is creating/editing the polygon so they can name it, and this name would then be associated with the polygon. Is there anyway to do that?

This is the code snippet I have so far for drawing and editing:

```<code>    //leaflet draw
    var drawnShapes = new L.FeatureGroup();
    map.addLayer(drawnShapes);

    var drawControl = new L.Control.Draw({
        draw: {
            circle: false,
            circlemarker: false,
            polyline: false,
            marker: false
        },
        edit: {
            featureGroup: drawnShapes,
            remove: true
        }
    });
    map.addControl(drawControl);
</code>```

Thanks!

-- I haven't been able to find any kind of text field documentation that would work along with Leaflet so wanted to ask here.

Body:
I'm currently using leaflet and leaflet.draw to create a website where the user can freehand polygons on a map. I'd like to design a text field that pops up when the user is creating/editing the polygon so they can name it, and this name would then be associated with the polygon. Is there anyway to do that?

This is the code snippet I have so far for drawing and editing:

    //leaflet draw
    var drawnShapes = new L.FeatureGroup();
    map.addLayer(drawnShapes);

    var drawControl = new L.Control.Draw({
        draw: {
            circle: false,
            circlemarker: false,
            polyline: false,
            marker: false
        },
        edit: {
            featureGroup: drawnShapes,
            remove: true
        }
    });
    map.addControl(drawControl);

Thanks!

-- I haven't been able to find any kind of text field documentation that would work along with Leaflet so wanted to ask here.


问:
when i share my website through WhatsApp a visual composer code appears below the site name
When I share my website through WhatsApp visual composer code shows below the site name. I have updated metadata in Yoast SEO but no joy. is there any way to solve this?
somebody, please help

Please see the picture

Created a new row in visual composer, updated metadata tags in Yoast Seo, cleared the cache, tried with different WhatsApp accounts. nothing happened.


问:
GNNExplainer.explain_graph() throws TypeError: MyGNN.forward() takes 3 positional arguments but 4 were given
I have a class implementing a bi-modal network (I deleted something below, just to show the general structure).

class MyGNN(torch.nn.Module):
  def __init__(self):
    super(MyGNN, self).__init__()

    self.gnn_emb = Sequential('x, edge_index, batch',
      [
        (GATConv(in_channels=2, out_channels=128), 'x, edge_index -> x1'),
        nn.ReLU(inplace=True),
        (global_max_pool, 'x1, batch -> x2'),
        nn.Linear(128, 64),
        nn.ReLU()
      ]
    )

    self.ffnn_emb = nn.Sequential(
      nn.Linear(128, 64),
      nn.BatchNorm1d(64),
      nn.ReLU()
    )

    self.fcn = nn.Sequential(
      nn.Linear(2*64, 64),
      nn.BatchNorm1d(64),
      nn.ELU(),
      nn.Dropout(p=0.1),
      nn.Linear(64, 1)
    )

    def forward(self, left, right):
        gnn_emb = self.gnn_emb(left.x.float(), left.edge_index, left.batch)
        ffnn_emb = self.ffnn_emb(right)
        # etc.
```
<p>The <code>gnn_emb</code> part of the bi-modal model is using a GNN. The <code>ffnn_emb</code> part is using a feed forward network.</p>
<p>I have now build the model and would like to run torch-geometric's GNNExplainer on it. Specifically the method <code>explain_graph</code>.</p>
<p>I initialized the GNNExplainer via</p>
```explainer = GNNExplainer(
    model=my_gnn_model,
    epochs=2,
    return_type='regression',
    nhops=2
)
```
<p>And now for one sample I am getting the below.</p>
```idx = 0
left_right_combi = my_gnn_model.val_loader.dataset[idx]
G = left_right_combi[0]       # left: Graph at index idx
drug = left_right_combi[1]    # right: list at index idx
```
<p>Now I am trying to run the <code>explain_graph</code> method in the following way:</p>
```node_feat_mask, edge_mask = explainer.explain_graph(
    G.x,
    G.edge_index
)
```
<p>However, this returns</p>
```---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Input In [146], in <cell line: 1>()
----> 1 node_feat_mask, edge_mask = explainer.explain_graph(
      2     G.x,
      3     G.edge_index,
      4 )

File ~/PATH/lib/python3.10/site-packages/torch_geometric/nn/models/gnn_explainer.py:146, in GNNExplainer.explain_graph(self, x, edge_index, **kwargs)
    143 batch = torch.zeros(x.shape[0], dtype=int, device=x.device)
    145 # Get the initial prediction.
--> 146 prediction = self.get_initial_prediction(x, edge_index, batch=batch,
    147                                          **kwargs)
    149 self._initialize_masks(x, edge_index)
    150 self.to(x.device)

File ~/PATH/lib/python3.10/site-packages/torch/autograd/grad_mode.py:27, in _DecoratorContextManager.__call__.<locals>.decorate_context(*args, **kwargs)
     24 @functools.wraps(func)
     25 def decorate_context(*args, **kwargs):
     26     with self.clone():
---> 27         return func(*args, **kwargs)

File ~/PATH/lib/python3.10/site-packages/torch_geometric/nn/models/explainer.py:235, in Explainer.get_initial_prediction(self, x, edge_index, batch, **kwargs)
    231 @torch.no_grad()
    232 def get_initial_prediction(self, x: Tensor, edge_index: Tensor,
    233                            batch: Optional[Tensor] = None, **kwargs):
    234     if batch is not None:
--> 235         out = self.model(x, edge_index, batch, **kwargs)
    236     else:
    237         out = self.model(x, edge_index, **kwargs)

File ~/PATH/lib/python3.10/site-packages/torch/nn/modules/module.py:1190, in Module._call_impl(self, *input, **kwargs)
   1186 # If we don't have any hooks, we want to skip the rest of the logic in
   1187 # this function, and just call forward.
   1188 if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
   1189         or _global_forward_hooks or _global_forward_pre_hooks):
-> 1190     return forward_call(*input, **kwargs)
   1191 # Do not call functions when jit is used
   1192 full_backward_hooks, non_full_backward_hooks = [], []

TypeError: MyGNN.forward() takes 3 positional arguments but 4 were given
```
<p>So I guess the issue is that I need to provide the arguments in the <code>forward</code> method as well right? Meaning <code>left</code> and <code>right</code>?</p>
<hr />
<p>I tried that via</p>
```node_feat_mask, edge_mask = explainer.explain_graph(
    G.x,
    G.edge_index,
    left=G,
    right=right  # this is just a list of ints
)
```
<p>However, this throws also an error, namely</p>
```...
TypeError: MyGNN.forward() got multiple values for argument 'left'
```

I really don't understand why it says that it got multiple values?

Can anyone help me?

Body:
I have a class implementing a bi-modal network (I deleted something below, just to show the general structure).

class MyGNN(torch.nn.Module):
  def __init__(self):
    super(MyGNN, self).__init__()

    self.gnn_emb = Sequential('x, edge_index, batch',
      [
        (GATConv(in_channels=2, out_channels=128), 'x, edge_index -> x1'),
        nn.ReLU(inplace=True),
        (global_max_pool, 'x1, batch -> x2'),
        nn.Linear(128, 64),
        nn.ReLU()
      ]
    )

    self.ffnn_emb = nn.Sequential(
      nn.Linear(128, 64),
      nn.BatchNorm1d(64),
      nn.ReLU()
    )

    self.fcn = nn.Sequential(
      nn.Linear(2*64, 64),
      nn.BatchNorm1d(64),
      nn.ELU(),
      nn.Dropout(p=0.1),
      nn.Linear(64, 1)
    )

    def forward(self, left, right):
        gnn_emb = self.gnn_emb(left.x.float(), left.edge_index, left.batch)
        ffnn_emb = self.ffnn_emb(right)
        # etc.

The gnn_emb part of the bi-modal model is using a GNN. The ffnn_emb part is using a feed forward network.

I have now build the model and would like to run torch-geometric's GNNExplainer on it. Specifically the method explain_graph.

I initialized the GNNExplainer via

explainer = GNNExplainer(
    model=my_gnn_model,
    epochs=2,
    return_type='regression',
    nhops=2
)

And now for one sample I am getting the below.

idx = 0
left_right_combi = my_gnn_model.val_loader.dataset[idx]
G = left_right_combi[0]       # left: Graph at index idx
drug = left_right_combi[1]    # right: list at index idx

Now I am trying to run the explain_graph method in the following way:

node_feat_mask, edge_mask = explainer.explain_graph(
    G.x,
    G.edge_index
)

However, this returns

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Input In [146], in <cell line: 1>()
----> 1 node_feat_mask, edge_mask = explainer.explain_graph(
      2     G.x,
      3     G.edge_index,
      4 )

File ~/PATH/lib/python3.10/site-packages/torch_geometric/nn/models/gnn_explainer.py:146, in GNNExplainer.explain_graph(self, x, edge_index, **kwargs)
    143 batch = torch.zeros(x.shape[0], dtype=int, device=x.device)
    145 # Get the initial prediction.
--> 146 prediction = self.get_initial_prediction(x, edge_index, batch=batch,
    147                                          **kwargs)
    149 self._initialize_masks(x, edge_index)
    150 self.to(x.device)

File ~/PATH/lib/python3.10/site-packages/torch/autograd/grad_mode.py:27, in _DecoratorContextManager.__call__.<locals>.decorate_context(*args, **kwargs)
     24 @functools.wraps(func)
     25 def decorate_context(*args, **kwargs):
     26     with self.clone():
---> 27         return func(*args, **kwargs)

File ~/PATH/lib/python3.10/site-packages/torch_geometric/nn/models/explainer.py:235, in Explainer.get_initial_prediction(self, x, edge_index, batch, **kwargs)
    231 @torch.no_grad()
    232 def get_initial_prediction(self, x: Tensor, edge_index: Tensor,
    233                            batch: Optional[Tensor] = None, **kwargs):
    234     if batch is not None:
--> 235         out = self.model(x, edge_index, batch, **kwargs)
    236     else:
    237         out = self.model(x, edge_index, **kwargs)

File ~/PATH/lib/python3.10/site-packages/torch/nn/modules/module.py:1190, in Module._call_impl(self, *input, **kwargs)
   1186 # If we don't have any hooks, we want to skip the rest of the logic in
   1187 # this function, and just call forward.
   1188 if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
   1189         or _global_forward_hooks or _global_forward_pre_hooks):
-> 1190     return forward_call(*input, **kwargs)
   1191 # Do not call functions when jit is used
   1192 full_backward_hooks, non_full_backward_hooks = [], []

TypeError: MyGNN.forward() takes 3 positional arguments but 4 were given

So I guess the issue is that I need to provide the arguments in the forward method as well right? Meaning left and right?

I tried that via

node_feat_mask, edge_mask = explainer.explain_graph(
    G.x,
    G.edge_index,
    left=G,
    right=right  # this is just a list of ints
)

However, this throws also an error, namely

...
TypeError: MyGNN.forward() got multiple values for argument 'left'

I really don't understand why it says that it got multiple values?

Can anyone help me?


问:
How to stop my mount from being denied in docker?
I ran the following command:
sudo docker run -d -p 127.0.0.1:9200:9200 -v /PATH/TO/geoname_index/data/:/usr/share/elasticsearch/data elasticsearch:5.1.2
Which yielded the following response:

```<code>(base) myname@myname-MacBook-Pro es-geonames % sudo docker run -d -p 127.0.0.1:9200:9200 -v /PATH/TO/geoname_index/data/:/usr/share/elasticsearch/data elasticsearch:5.1.2

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
4a706e62e91acfbae714cc6a33e270aedfaf84069c4bb5668187958d78cb8472
docker: Error response from daemon: Mounts denied:
The path /PATH/TO/geoname_index/data is not shared from the host and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.
See https://docs.docker.com/desktop/mac for more info.
</code>```

I have tried adding the path to geoname_index to Docker's File Sharing settings, but when I hit Apply & Restart, the path disappears from the settings window.

I've read the following articles:
https://medium.com/@lynzt/learning-docker-error-mounts-denied-mac-73307b49f545

Mounts denied. The paths ... are not shared from OS X and are not known to Docker

Please let me know if there's any information I can provide to help answer this question

Body:
I ran the following command:
sudo docker run -d -p 127.0.0.1:9200:9200 -v /PATH/TO/geoname_index/data/:/usr/share/elasticsearch/data elasticsearch:5.1.2
Which yielded the following response:

(base) myname@myname-MacBook-Pro es-geonames % sudo docker run -d -p 127.0.0.1:9200:9200 -v /PATH/TO/geoname_index/data/:/usr/share/elasticsearch/data elasticsearch:5.1.2

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
4a706e62e91acfbae714cc6a33e270aedfaf84069c4bb5668187958d78cb8472
docker: Error response from daemon: Mounts denied:
The path /PATH/TO/geoname_index/data is not shared from the host and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.
See https://docs.docker.com/desktop/mac for more info.

I have tried adding the path to geoname_index to Docker's File Sharing settings, but when I hit Apply & Restart, the path disappears from the settings window.

I've read the following articles:
https://medium.com/@lynzt/learning-docker-error-mounts-denied-mac-73307b49f545

Mounts denied. The paths ... are not shared from OS X and are not known to Docker

Please let me know if there's any information I can provide to help answer this question


问:
Cannot bind on top of a volume in portainer
I added an NFS4 volume which works fine. Now in one of my containers, I want to access a sub directory in the volume.

Is it possible to add a bind on top of the volume in the config for example:

(volume) container: /ext volume: external_drive

(bind) container: /config volume: /ext/config

I tried it and doesn't seem to work. Do I have to create a volume for each sub directory?

Binding a sub directory from a volume without having to create a volume for each sub directory.