问:
My Excel Formula is not able to understand Dollar ("$") Sign?
I created an Excel File few months ago, See below.

Today wanted a slight adjustment in the formula.

But today if I go into the cell and just press enter it is giving an error at the first dollar sign? (marked in bold below)

If I remove all the dollar signs, the formula works again, but I don't want to as I have to copy paste the formula over a large range.

```<code>=LET(s,IF(TRIM(LOWER([@[FTC Conversion]]))="yes",[@[FTC Conversion Date]],[@[Start Date]]),t,IF(ISBLANK([@[Termination Date]]),DATE(2100,12,31),[@[Termination Date]]),
IF(TRIM(LOWER([@[Employee Type]]))<>"permanent","NA",
    IF(TRIM(LOWER([@[Corporate Functions]]))="yes","NA",
        IF(s>T$2,"NA",
            IF(AND(s>=T$1,s<=T$2),IF(t>T$2,T$3&" New Joiner", "NA"),
                IF(t<T$1,"NA",IF(AND(t>=T$1,t<=T$2),T$3&" Exit",T$3&" HC"))
)))))
</code>```

I have already tried closing all excel sheets and re-starting excel, even re-started the PC as well.

Anyone has seen this before?

Body:
I created an Excel File few months ago, See below.

Today wanted a slight adjustment in the formula.

But today if I go into the cell and just press enter it is giving an error at the first dollar sign? (marked in bold below)

If I remove all the dollar signs, the formula works again, but I don't want to as I have to copy paste the formula over a large range.

=LET(s,IF(TRIM(LOWER([@[FTC Conversion]]))="yes",[@[FTC Conversion Date]],[@[Start Date]]),t,IF(ISBLANK([@[Termination Date]]),DATE(2100,12,31),[@[Termination Date]]),
IF(TRIM(LOWER([@[Employee Type]]))<>"permanent","NA",
    IF(TRIM(LOWER([@[Corporate Functions]]))="yes","NA",
        IF(s>T$2,"NA",
            IF(AND(s>=T$1,s<=T$2),IF(t>T$2,T$3&" New Joiner", "NA"),
                IF(t<T$1,"NA",IF(AND(t>=T$1,t<=T$2),T$3&" Exit",T$3&" HC"))
)))))

I have already tried closing all excel sheets and re-starting excel, even re-started the PC as well.

Anyone has seen this before?


来源: stackexchange

问:
Vuetify v-menu navigate using Keyboard issue
When Try to navigate the menu using Keyboard and Hit enter it opens the submenu but when I hit enter again it closes the submenu. It should not open because there's another menu under the submenu.

Codepen: Code Pen Link

<v-menu :close-on-content-click="false" :offset-x='isOffsetX' :offset-y='isOffsetY' :open-on-hover='isOpenOnHover' :transition='transition' :value="openMenu">
  <template v-slot:activator="{ on }">
      <v-btn v-if='icon' :color='color' v-on="on">
          <v-icon>{{ icon }}</v-icon>
      </v-btn>
      <v-list-item v-else-if='isSubMenu' class='d-flex justify-space-between' v-on="on">
          {{ name }}

<v-icon>mdi-chevron-right</v-icon>
      </v-list-item>
      <v-btn v-else :color='color' v-on="on"  @click="openMenu = true"  text >{{ name }}</v-btn>
  </template>
  <v-list>
      <template v-for="(item, index) in menuItems">
              <v-divider v-if='item.isDivider' :key='index' />
              <dan-menu v-else-if='item.menu' :key='index' :name='item.name' :menu-items='item.menu' @dan-menu-click='emitClickEvent' :is-open-on-hover=false :is-offset-x=true :is-offset-y=false :is-sub-menu=true />
              <v-list-item v-else :key='index' @click='emitClickEvent(item)'>
                  <v-list-item-title>{{ item.name }}</v-list-item-title>
              </v-list-item>
      </template>
  </v-list>
</v-menu>
```

ContentLicense: CC BY-SA 4.0


问:
nix attribute `stdenv` missing on a reflex-stone haskell project
I was able to run nix-shell in my codebase about two years back on another macbook.

I got a new freshly installed nix setup

```<code>❯ nix-env --version
nix-env (Nix) 2.12.0
❯ uname
Darwin
❯ sw_vers
ProductName:    macOS
ProductVersion: 12.0.1
BuildVersion:   21A559
</code>```

And I'm getting this error

```<code>❯ nix-shell
error: attribute 'stdenv' missing

       at /nix/store/p3x4ha4dwj9agifi05wq0vf3m93p3vsx-source/pkgs/build-support/cc-wrapper/default.nix:62:8:

           61|   expand-response-params =
           62|     if buildPackages.stdenv.hasCC && buildPackages.stdenv.cc != "/dev/null"
             |        ^
           63|     then import ../expand-response-params { inherit (buildPackages) stdenv; }
(use '--show-trace' to show detailed location information)
</code>```

my repo is a fork of reflex-stone, i tried to run it as well and it gives the same error.

I suspect its some version error.

Body:
I was able to run nix-shell in my codebase about two years back on another macbook.

I got a new freshly installed nix setup

❯ nix-env --version
nix-env (Nix) 2.12.0
❯ uname
Darwin
❯ sw_vers
ProductName:    macOS
ProductVersion: 12.0.1
BuildVersion:   21A559

And I'm getting this error

❯ nix-shell
error: attribute 'stdenv' missing

       at /nix/store/p3x4ha4dwj9agifi05wq0vf3m93p3vsx-source/pkgs/build-support/cc-wrapper/default.nix:62:8:

           61|   expand-response-params =
           62|     if buildPackages.stdenv.hasCC && buildPackages.stdenv.cc != "/dev/null"
             |        ^
           63|     then import ../expand-response-params { inherit (buildPackages) stdenv; }
(use '--show-trace' to show detailed location information)

my repo is a fork of reflex-stone, i tried to run it as well and it gives the same error.

I suspect its some version error.


问:
in "find -exec cmd", how to capture output and stderr of cmd?
When I use a bash script line like

```<code>find path -exec cmd1 \{\} \; -exec cmd2 \{\} \; -exec echo "a" \;
</code>```

then I would like to insert after cmd1 redirections like

```<code>1>file1 2>file2
</code>```

in order to carch the outputs of cmd1.

In all location I have tried to insert these redirections, always  a l l   output is written to the files, even error messages of find.

And braces {...} as I usually use as delimiters give errors.

What is the right way.

Regards

Body:
When I use a bash script line like

find path -exec cmd1 \{\} \; -exec cmd2 \{\} \; -exec echo "a" \;

then I would like to insert after cmd1 redirections like

1>file1 2>file2

in order to carch the outputs of cmd1.

In all location I have tried to insert these redirections, always  a l l   output is written to the files, even error messages of find.

And braces {...} as I usually use as delimiters give errors.

What is the right way.

Regards


问:
RabbitMQ consumers are not adding up
RabbitMQ consumers are not adding up

I get the exact same issue, I've a RabittMQ listener defined with the following annotation and using Spring AMQP.

@RabbitListener(queues = "#{documentCreationQueue.name}", concurrency = "10-20")

It creates correctly the 10 consumers, but then it never increase to more that 10 even if I sent 20 requests and the 10 first one are in progress.

Did you find a solution to your problem couple of years ago ?

@GaryRussell any suggestions ?

I try to define a SimpleRabbitListenerContainerFactory with the annotation containerFactory and try multiple settings (prefectchCount, consecutiveActiveTrigger, taskExecutor with a thread pool....) without any success.

Title: RabbitMQ consumers are not adding up


问:
Hypergeometric function 1F2 in scipy
How can I write the Hypergeometric function 1F2 in scipy/numpy?

There was an implementation in scipy, but now it is deprecated:

https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.special.hyp1f2.html

Thanks!

Title: Hypergeometric function 1F2 in scipy


问:
Screenshot and handles with user32.dll - GetWindowRect
I'm still quite new to how handles works and need some help to understand this a bit more.

I have this method in my class, "cbxWebsite" is a combobox.

```<code>public IntPtr GetCurrentHandle()
{
    foreach (Process process in Process.GetProcesses())
    {
        if (process.ProcessName.Contains("chrome")
            && process.MainWindowTitle.Contains(cbxWebsite.SelectedValue.ToString()))
        {
            return process.MainWindowHandle;
        }
    }
    return IntPtr.Zero;
}
</code>```

And I'm trying to implement this: Capture screen of Window by handle

My question is about these lines:

```<code>    IntPtr hwnd = GetCurrentHandle();
    User32.GetWindowRect(new HandleRef(null, hwnd), ref rc);
</code>```

When I call GetWindowRect, the HandleRef() complains about "Cannot convert from HandleRef to IntPtr".

MS docs says this about process.MainWindowHandle: The system-generated window handle of the main window of the associated process.

So I guess I don't understand from here. I thought I was returning the handle of the current window I want to work with from GetCurrentHandle().
But is it returning the handle of the process of that window and not the actual window-handle itself?

Can someone please clarify.

Body:
I'm still quite new to how handles works and need some help to understand this a bit more.

I have this method in my class, "cbxWebsite" is a combobox.

public IntPtr GetCurrentHandle()
{
    foreach (Process process in Process.GetProcesses())
    {
        if (process.ProcessName.Contains("chrome")
            && process.MainWindowTitle.Contains(cbxWebsite.SelectedValue.ToString()))
        {
            return process.MainWindowHandle;
        }
    }
    return IntPtr.Zero;
}

And I'm trying to implement this: Capture screen of Window by handle

My question is about these lines:

    IntPtr hwnd = GetCurrentHandle();
    User32.GetWindowRect(new HandleRef(null, hwnd), ref rc);

When I call GetWindowRect, the HandleRef() complains about "Cannot convert from HandleRef to IntPtr".

MS docs says this about process.MainWindowHandle: The system-generated window handle of the main window of the associated process.

So I guess I don't understand from here. I thought I was returning the handle of the current window I want to work with from GetCurrentHandle().
But is it returning the handle of the process of that window and not the actual window-handle itself?

Can someone please clarify.


问:
updating a leaderboard for noughts and crosses game
I have a an issue in updating my dictionary from txt file. when ever a new player score is saved, the file creates a new dictionary.
here is my code

```<code>def save_score(score):
    filename = 'leaderboard.txt'
    player = input('what is your name')
    if os.path.exists(filename):
        with open(filename, "r+") as leaderboard:
            dictionary = json.load(leaderboard)
            dictionary[player]=score
            json.dump(dictionary,leaderboard)
        print("score"+ " " + str(score)+ " "+ "for" + " " +str(player)+ " "+"saved.")
    return
</code>```

this is what I get when code is run.

```<code>{"Bob": 50,"Jane": 2,"Sarah": 5, "Amelia": 20}
</code>```

then if a new player score get saved , it creates another separate dictionary.

```<code>{"Bob": 50,"Jane": 2,"Sarah": 5, "Amelia": 20} {"Bob": 50,"Jane": 2,"Sarah": 5, "Amelia": 20, "bobby": 20}
</code>```

I would want the file to have just 1 dictionary and update the player name and score and also add new player in 1 dictionary instead of 2.
thanks in advance.

Body:
I have a an issue in updating my dictionary from txt file. when ever a new player score is saved, the file creates a new dictionary.
here is my code

def save_score(score):
    filename = 'leaderboard.txt'
    player = input('what is your name')
    if os.path.exists(filename):
        with open(filename, "r+") as leaderboard:
            dictionary = json.load(leaderboard)
            dictionary[player]=score
            json.dump(dictionary,leaderboard)
        print("score"+ " " + str(score)+ " "+ "for" + " " +str(player)+ " "+"saved.")
    return

this is what I get when code is run.

{"Bob": 50,"Jane": 2,"Sarah": 5, "Amelia": 20}

then if a new player score get saved , it creates another separate dictionary.

{"Bob": 50,"Jane": 2,"Sarah": 5, "Amelia": 20} {"Bob": 50,"Jane": 2,"Sarah": 5, "Amelia": 20, "bobby": 20}

I would want the file to have just 1 dictionary and update the player name and score and also add new player in 1 dictionary instead of 2.
thanks in advance.


问:
ggplot legend values rescale
I would like to rescale the values on the legend of a plot coming from conditional_effects.

By doing something like this

plot(conditional_effects(brm_c_5, effects  = "t:w_c_ratio",cond =  conditions5),  rug = T, points = T)

I'm getting the following

For time being I'm doing
p_col_1 <- ggplot_build(p_col_1)
and then I'm chainging the ranges in here p_col_1$plot$scales$scales[[3]]$range$range and here p_col_1$plot$scales$scales[[4]]$range$range but I'm not trusting this solution.

EXAMPLE:

As example please see this code. The defaults values for kidney$age is from 10 to 69 but let's say that I want to rescale it from -1 to 1. Then I could use the solution via ggplot_build but I'm looking for a smarter and more elegant solution.

```<code>library(brms)
fit1 <- brm(time | cens(censored) ~ age + sex + disease,
data = kidney, family = weibull, init = "0")

fit1
p_tr <- (plot(conditional_effects(fit1, effects  = "disease:age"),  rug = T, points = T)[[1]])

p_tr <- ggplot_build(p_tr)

p_tr$plot$scales$scales[[3]]$range$range <- c(1,0, -1) %>% as.character()
p_tr$plot$scales$scales[[4]]$range$range <- c(1, 0 ,-1)%>% as.character()
plot(p_tr %>% ggplot_gtable)
</code>```

`

How could I rescale the values of w_c_ratio from -0.9:+0.9 in the original scale (which is going from 2 to 10)?

Title: ggplot legend values rescale

Body:
I would like to rescale the values on the legend of a plot coming from conditional_effects.

By doing something like this

plot(conditional_effects(brm_c_5, effects  = "t:w_c_ratio",cond =  conditions5),  rug = T, points = T)

I'm getting the following

For time being I'm doing
p_col_1 <- ggplot_build(p_col_1)
and then I'm chainging the ranges in here p_col_1$plot$scales$scales[[3]]$range$range and here p_col_1$plot$scales$scales[[4]]$range$range but I'm not trusting this solution.

EXAMPLE:

As example please see this code. The defaults values for kidney$age is from 10 to 69 but let's say that I want to rescale it from -1 to 1. Then I could use the solution via ggplot_build but I'm looking for a smarter and more elegant solution.

library(brms)
fit1 <- brm(time | cens(censored) ~ age + sex + disease,
data = kidney, family = weibull, init = "0")

fit1
p_tr <- (plot(conditional_effects(fit1, effects  = "disease:age"),  rug = T, points = T)[[1]])

p_tr <- ggplot_build(p_tr)

p_tr$plot$scales$scales[[3]]$range$range <- c(1,0, -1) %>% as.character()
p_tr$plot$scales$scales[[4]]$range$range <- c(1, 0 ,-1)%>% as.character()
plot(p_tr %>% ggplot_gtable)

`

How could I rescale the values of w_c_ratio from -0.9:+0.9 in the original scale (which is going from 2 to 10)?


问:
How import _pjsua in python
I tried to build the python module pjsua-2.9 by using pjproject-2.9 and then running setup.py build and setup.py install. I have the
packages pjsua-2.9-2.el8.x86_64.rpm, pjproject-2.9-2.el8.x86_64.rpm, pjproject-devel-2.9-2.el8.x86_64.rpm, installed and OS CentOS 8.

After a few false starts, the module appears to compile correctly:

[root@test:~/pjproject-2.9/pjsip-apps/src/python]# python2 ./setup.py build
helper.mak:1: ../../../build.mak: No such file or directory
make: *** No rule to make target '../../../build.mak'.  Stop.
helper.mak:1: ../../../build.mak: No such file or directory
make: *** No rule to make target '../../../build.mak'.  Stop.
helper.mak:1: ../../../build.mak: No such file or directory
make: *** No rule to make target '../../../build.mak'.  Stop.
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying pjsua.py -> build/lib.linux-x86_64-2.7
running build_ext
building '_pjsua' extension
creating build/temp.linux-x86_64-2.7
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPJ_AUTOCONF=1 -I/usr/include/python2.7 -c _pjsua.c -o build/temp.linux-x86_64-2.7/_pjsua.o
gcc -pthread -shared -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld build/temp.linux-x86_64-2.7/_pjsua.o -L/usr/lib64 -lpython2.7 -o build/lib.linux-x86_64-2.7/_pjsua.so

[root@test:~/pjproject-2.9/pjsip-apps/src/python]# python2 ./setup.py install
helper.mak:1: ../../../build.mak: No such file or directory
make: *** No rule to make target '../../../build.mak'.  Stop.
helper.mak:1: ../../../build.mak: No such file or directory
make: *** No rule to make target '../../../build.mak'.  Stop.
helper.mak:1: ../../../build.mak: No such file or directory
make: *** No rule to make target '../../../build.mak'.  Stop.
running install
running build
running build_py
running build_ext
running install_lib
copying build/lib.linux-x86_64-2.7/pjsua.py -> /usr/lib64/python2.7/site-packages
copying build/lib.linux-x86_64-2.7/_pjsua.so -> /usr/lib64/python2.7/site-packages
byte-compiling /usr/lib64/python2.7/site-packages/pjsua.py to pjsua.pyc
running install_egg_info
Writing /usr/lib64/python2.7/site-packages/pjsua-2.9-py2.7.egg-info
```
```[root@test:~/pjproject-2.9/pjsip-apps/src/python]# python2
Python 2.7.18 (default, Feb 14 2022, 16:17:42)
[GCC 8.5.0 20210514 (Red Hat 8.5.0-10)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pjsua
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pjsua.py", line 59, in <module>
    import _pjsua
ImportError: /usr/lib64/python2.7/site-packages/_pjsua.so: undefined symbol: pjsua_start
>>> pjsua_start
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'pjsua_start' is not defined
>>> import _pjsua
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /usr/lib64/python2.7/site-packages/_pjsua.so: undefined symbol: pjsua_start
```

Can anyone help me how to solve the problem?

Title: How import _pjsua in python

Body:
I tried to build the python module pjsua-2.9 by using pjproject-2.9 and then running setup.py build and setup.py install. I have the
packages pjsua-2.9-2.el8.x86_64.rpm, pjproject-2.9-2.el8.x86_64.rpm, pjproject-devel-2.9-2.el8.x86_64.rpm, installed and OS CentOS 8.

After a few false starts, the module appears to compile correctly:

[root@test:~/pjproject-2.9/pjsip-apps/src/python]# python2 ./setup.py build
helper.mak:1: ../../../build.mak: No such file or directory
make: *** No rule to make target '../../../build.mak'.  Stop.
helper.mak:1: ../../../build.mak: No such file or directory
make: *** No rule to make target '../../../build.mak'.  Stop.
helper.mak:1: ../../../build.mak: No such file or directory
make: *** No rule to make target '../../../build.mak'.  Stop.
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying pjsua.py -> build/lib.linux-x86_64-2.7
running build_ext
building '_pjsua' extension
creating build/temp.linux-x86_64-2.7
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPJ_AUTOCONF=1 -I/usr/include/python2.7 -c _pjsua.c -o build/temp.linux-x86_64-2.7/_pjsua.o
gcc -pthread -shared -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld build/temp.linux-x86_64-2.7/_pjsua.o -L/usr/lib64 -lpython2.7 -o build/lib.linux-x86_64-2.7/_pjsua.so

[root@test:~/pjproject-2.9/pjsip-apps/src/python]# python2 ./setup.py install
helper.mak:1: ../../../build.mak: No such file or directory
make: *** No rule to make target '../../../build.mak'.  Stop.
helper.mak:1: ../../../build.mak: No such file or directory
make: *** No rule to make target '../../../build.mak'.  Stop.
helper.mak:1: ../../../build.mak: No such file or directory
make: *** No rule to make target '../../../build.mak'.  Stop.
running install
running build
running build_py
running build_ext
running install_lib
copying build/lib.linux-x86_64-2.7/pjsua.py -> /usr/lib64/python2.7/site-packages
copying build/lib.linux-x86_64-2.7/_pjsua.so -> /usr/lib64/python2.7/site-packages
byte-compiling /usr/lib64/python2.7/site-packages/pjsua.py to pjsua.pyc
running install_egg_info
Writing /usr/lib64/python2.7/site-packages/pjsua-2.9-py2.7.egg-info

[root@test:~/pjproject-2.9/pjsip-apps/src/python]# python2
Python 2.7.18 (default, Feb 14 2022, 16:17:42)
[GCC 8.5.0 20210514 (Red Hat 8.5.0-10)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pjsua
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pjsua.py", line 59, in <module>
    import _pjsua
ImportError: /usr/lib64/python2.7/site-packages/_pjsua.so: undefined symbol: pjsua_start
>>> pjsua_start
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'pjsua_start' is not defined
>>> import _pjsua
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /usr/lib64/python2.7/site-packages/_pjsua.so: undefined symbol: pjsua_start

Can anyone help me how to solve the problem?


问:
Connect my python app within a docker container in wsl to a local MySQL database in windows
I have deployed a local python applications in my windows machine that connects to a MySQL database by:

```<code>DB_HOST = "127.0.0.1"
DB_PORT = "3306"
</code>```

This works fine. But now I have deployed the python application on Docker in WSL. So I changed the configuration to:

```<code>DB_HOST = "192.168.8.105" #the ipv4 of my windows wifi connection
DB_PORT = "3306"
</code>```

But this does not work. So when I try from my WSL (UBUNTU) a ping to the ip it works:

```<code>ping 192.168.8.105
</code>```

But when I add the MYSQL port to the ping it does not:

```<code>ping 192.168.8.105 3306
</code>```

Any ideas why?

Thanks

Body:
I have deployed a local python applications in my windows machine that connects to a MySQL database by:

DB_HOST = "127.0.0.1"
DB_PORT = "3306"

This works fine. But now I have deployed the python application on Docker in WSL. So I changed the configuration to:

DB_HOST = "192.168.8.105" #the ipv4 of my windows wifi connection
DB_PORT = "3306"

But this does not work. So when I try from my WSL (UBUNTU) a ping to the ip it works:

ping 192.168.8.105

But when I add the MYSQL port to the ping it does not:

ping 192.168.8.105 3306

Any ideas why?

Thanks


问:
ReactFlow Graph doesn't re-render when updated
I put a ReactFlow component to my Angular project, that shows the graph perfectly when initializing the component.
Whenever I update the graph e.g. by changing the direction or updating the nodes, the "onLayout" method is called, however the graph won't update.
It will continuously show the first graph.

```<code>export const CustomReactComponent: React.FunctionComponent<AppProps> = ({propNodes,propEdges }: AppProps) => {

  const { nodes: layoutedNodes, edges: layoutedEdges } = getLayoutedElements(
    propNodes,
    propEdges,
    'LR'
  );

  const [nodes, setNodes, onNodesChange] = useNodesState(layoutedNodes);
  const [edges, setEdges, onEdgesChange] = useEdgesState(layoutedEdges);

  const onLayout = useCallback(
    (direction) => {
      const { nodes: layoutedNodes, edges: layoutedEdges } = getLayoutedElements(
        propNodes,
        propEdges,
        direction
      );

      setNodes([...layoutedNodes]);
      setEdges([...layoutedEdges]);
    },
    [nodes, edges]
  );

  return (
    <>
      <div className="layoutflow">
        <ReactFlow
          nodes={layoutedNodes}
          edges={layoutedEdges}
          nodeTypes={nodeTypes}
          onNodesChange={onNodesChange}
          onEdgesChange={onEdgesChange}
          onConnect={onConnect}
          connectionLineType={ConnectionLineType.SmoothStep}
          style={{ height: 500 }}
          nodesDraggable={true}
          fitView
        />
        <div className="controls">
          <button className="w3-button w3-green w3-left-align commonFont" onClick={() => onLayout('TB')}>vertical layout</button>
          <button className="w3-button w3-green w3-left-align commonFont" onClick={() => onLayout('LR')}>horizontal layout</button>
        </div>
      </div>
    </>

  );
};
</code>```

I took most of the code from the React Website.
Does anyone see the problem?

Here is the rest of the code that initializes the graph, which I didn't change:

The component is called in Angular from a Wrapper, by the following function:

```<code>private render() {
            if(this.graph === undefined){
                console.log("Graph still undefined");
            }else{
                ReactDOM.render(
                    <React.StrictMode>
                        <div>
                            <CustomReactComponent propNodes={this.graph.nodes} propEdges={this.graph.edges}/>
                        </div>
                    </React.StrictMode>
                    , this.containerRef.nativeElement);
            }
    }

</code>```

Body:
I put a ReactFlow component to my Angular project, that shows the graph perfectly when initializing the component.
Whenever I update the graph e.g. by changing the direction or updating the nodes, the "onLayout" method is called, however the graph won't update.
It will continuously show the first graph.

export const CustomReactComponent: React.FunctionComponent<AppProps> = ({propNodes,propEdges }: AppProps) => {

  const { nodes: layoutedNodes, edges: layoutedEdges } = getLayoutedElements(
    propNodes,
    propEdges,
    'LR'
  );

  const [nodes, setNodes, onNodesChange] = useNodesState(layoutedNodes);
  const [edges, setEdges, onEdgesChange] = useEdgesState(layoutedEdges);

  const onLayout = useCallback(
    (direction) => {
      const { nodes: layoutedNodes, edges: layoutedEdges } = getLayoutedElements(
        propNodes,
        propEdges,
        direction
      );

      setNodes([...layoutedNodes]);
      setEdges([...layoutedEdges]);
    },
    [nodes, edges]
  );

  return (
    <>

        <ReactFlow
          nodes={layoutedNodes}
          edges={layoutedEdges}
          nodeTypes={nodeTypes}
          onNodesChange={onNodesChange}
          onEdgesChange={onEdgesChange}
          onConnect={onConnect}
          connectionLineType={ConnectionLineType.SmoothStep}
          style={{ height: 500 }}
          nodesDraggable={true}
          fitView
        />

          <button className="w3-button w3-green w3-left-align commonFont" onClick={() => onLayout('TB')}>vertical layout</button>
          <button className="w3-button w3-green w3-left-align commonFont" onClick={() => onLayout('LR')}>horizontal layout</button>

    </>

  );
};

I took most of the code from the React Website.
Does anyone see the problem?

Here is the rest of the code that initializes the graph, which I didn't change:

The component is called in Angular from a Wrapper, by the following function:

private render() {
            if(this.graph === undefined){
                console.log("Graph still undefined");
            }else{
                ReactDOM.render(
                    <React.StrictMode>

                            <CustomReactComponent propNodes={this.graph.nodes} propEdges={this.graph.edges}/>

                    </React.StrictMode>
                    , this.containerRef.nativeElement);
            }
    }


问:
Disable "live log setup" and "live log teardown" in pytest
Is there an option (or combination of options) in pytest to view only "live log call" ?

I have to establish a handful of sessions in setup and close them in teardown, so a lot of noise from those logs, (changing them to debug is not going to help me as these logs are printed from another library)

```<code>------- live log setup ---------
noisy logs
---------- live log call ------------
needed logs
--------- live log teardown ------------
noisy logs
</code>```

Body:
Is there an option (or combination of options) in pytest to view only "live log call" ?

I have to establish a handful of sessions in setup and close them in teardown, so a lot of noise from those logs, (changing them to debug is not going to help me as these logs are printed from another library)

------- live log setup ---------
noisy logs
---------- live log call ------------
needed logs
--------- live log teardown ------------
noisy logs


问:
Flutter Algolia Filtering by price range
Am trying to filter using price range but can't seem to get Algolia's built in parameters to handle such cases. I've gone through their shallow documentation but couldn't get any. I've tried to find from other languages(Android Kotlin and ruby) and still it was not possible</p>
```<code>SliderTheme(
  data: SliderTheme.of(context).copyWith(
    showValueIndicator: ShowValueIndicator.always,
    thumbShape: const RoundSliderThumbShape(enabledThumbRadius: 15),
  ),
  child: RangeSlider(
    min: 0.0,
    max: double.parse(facets.last.item.value),
    activeColor: AppColors.secondaryThemeColor,
    inactiveColor: AppColors.fontHeaderColor,
    // divisions: facets.length,
    labels: RangeLabels(
      'Ksh ${start.toStringAsFixed(0)}'.replaceAllMapped(reg, mathFunc),
      'Ksh ${end.toStringAsFixed(0)}'.replaceAllMapped(reg, mathFunc),
    ),
    values:  RangeValues(start, end),
    onChanged: (value) {
      //innerState((){});
      setter(() {
        start = value.start;
        end = value.end;
        _currentRangeValues = value;
        // facetPriceList.toggle(end.round().toString());
      });
      _productsSearcher.applyState((state) => state.copyWith());
    },
  ),
),
</code>```

Body:
Am trying to filter using price range but can't seem to get Algolia's built in parameters to handle such cases. I've gone through their shallow documentation but couldn't get any. I've tried to find from other languages(Android Kotlin and ruby) and still it was not possible

SliderTheme(
  data: SliderTheme.of(context).copyWith(
    showValueIndicator: ShowValueIndicator.always,
    thumbShape: const RoundSliderThumbShape(enabledThumbRadius: 15),
  ),
  child: RangeSlider(
    min: 0.0,
    max: double.parse(facets.last.item.value),
    activeColor: AppColors.secondaryThemeColor,
    inactiveColor: AppColors.fontHeaderColor,
    // divisions: facets.length,
    labels: RangeLabels(
      'Ksh ${start.toStringAsFixed(0)}'.replaceAllMapped(reg, mathFunc),
      'Ksh ${end.toStringAsFixed(0)}'.replaceAllMapped(reg, mathFunc),
    ),
    values:  RangeValues(start, end),
    onChanged: (value) {
      //innerState((){});
      setter(() {
        start = value.start;
        end = value.end;
        _currentRangeValues = value;
        // facetPriceList.toggle(end.round().toString());
      });
      _productsSearcher.applyState((state) => state.copyWith());
    },
  ),
),


问:
Error while running custom models on Google Coral EdgeTPU, "list index out of range"
I tried running a custom model on the Google Coral EdgeTPU, but it is causing the following error:

```<code>  File "detect.py", line 102, in <module>
    main()
  File "detect.py", line 74, in main
    objs = get_objects(interpreter, args.threshold)[:args.top_k]
  File "/usr/lib/python3/dist-packages/pycoral/adapters/detect.py", line 214, in get_objects
    elif common.output_tensor(interpreter, 3).size == 1:
  File "/usr/lib/python3/dist-packages/pycoral/adapters/common.py", line 29, in output_tensor
    return interpreter.tensor(interpreter.get_output_details()[i]['index'])()
IndexError: list index out of range

</code>```

The default model
mobilenet_ssd_v2_coco_quant_postprocess_edgetpu.tflite
works perfectly

I tried a running a simple 2 layer CNN model and a transfer learning based mobilenet model, but both showed the above errors.
The thread about running YOLOv5 didn't help much.
Any help would be great. Thanks a lot

Body:
I tried running a custom model on the Google Coral EdgeTPU, but it is causing the following error:

  File "detect.py", line 102, in <module>
    main()
  File "detect.py", line 74, in main
    objs = get_objects(interpreter, args.threshold)[:args.top_k]
  File "/usr/lib/python3/dist-packages/pycoral/adapters/detect.py", line 214, in get_objects
    elif common.output_tensor(interpreter, 3).size == 1:
  File "/usr/lib/python3/dist-packages/pycoral/adapters/common.py", line 29, in output_tensor
    return interpreter.tensor(interpreter.get_output_details()[i]['index'])()
IndexError: list index out of range

The default model
mobilenet_ssd_v2_coco_quant_postprocess_edgetpu.tflite
works perfectly

I tried a running a simple 2 layer CNN model and a transfer learning based mobilenet model, but both showed the above errors.
The thread about running YOLOv5 didn't help much.
Any help would be great. Thanks a lot


问:
Record message in Pcap recording with Inet
In the veins_inet sample application there exists a sample message that is sent to nodes upon a node getting into an accident. The sample message contains one piece of information which is the RodeID. I have implemented Pcap recorders onto each node to record the broadcasts between nodes for analysis later, but I notice that the RoadID isn't in the Pcap files. How do I make sure the content of the messages sent is also visible in the Pcap recording files?</p>


问:
Need to know the format which supports Chinese and Thai language in mpdf using Codeigniter
While generating the PDF in the codeigniter php for multiple languages such as chinese and Thai language it doesn't support the language format in the final pdf. The generated output is displayed as ▯▯▯▯▯.

```<code>    $pdf=new \mPDF('+aCJK','A4','','',15,10,16,10,10,10);

        $pdf->useOnlyCoreFonts = true;    // false is default
        $pdf->SetProtection(array('print'));
        //$pdf->autoScriptToLang();
        $pdf->SetWatermarkText("Rentokil Initial");
        $pdf->showWatermarkText = true;
        $pdf->watermark_font = 'dejavusanscondensed';
        $pdf->watermarkTextAlpha = 0.03;
        $pdf->shrink_tables_to_fit=0;

        $pdf->autoScriptToLang = true;
        $pdf->baseScript = 1;
        $pdf->SetFont('cid0cs','',16);
        $pdf->CSSselectMedia = 'pdf';
        $pdf->charset_in = 'UTF-8';

        $pdf->WriteHTML($html);
        $pdf->Output($pdfFilePath,"F");
</code>```

Above is my current scenario for generating pdf, but this doesn't support Chinese and Thai language format. The expected output is not in the correct format "▯▯▯▯▯". Please let me know how to fix this below format issue or help me to share the format which supports Chinese and Thai language.

My current PDF Output

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

Body:
While generating the PDF in the codeigniter php for multiple languages such as chinese and Thai language it doesn't support the language format in the final pdf. The generated output is displayed as ▯▯▯▯▯.

    $pdf=new \mPDF('+aCJK','A4','','',15,10,16,10,10,10);

        $pdf->useOnlyCoreFonts = true;    // false is default
        $pdf->SetProtection(array('print'));
        //$pdf->autoScriptToLang();
        $pdf->SetWatermarkText("Rentokil Initial");
        $pdf->showWatermarkText = true;
        $pdf->watermark_font = 'dejavusanscondensed';
        $pdf->watermarkTextAlpha = 0.03;
        $pdf->shrink_tables_to_fit=0;

        $pdf->autoScriptToLang = true;
        $pdf->baseScript = 1;
        $pdf->SetFont('cid0cs','',16);
        $pdf->CSSselectMedia = 'pdf';
        $pdf->charset_in = 'UTF-8';

        $pdf->WriteHTML($html);
        $pdf->Output($pdfFilePath,"F");

Above is my current scenario for generating pdf, but this doesn't support Chinese and Thai language format. The expected output is not in the correct format "▯▯▯▯▯". Please let me know how to fix this below format issue or help me to share the format which supports Chinese and Thai language.

My current PDF Output


问:
How to use Flutter_Reactive_ble package in RaspberryPi 4
Can anyone explain how to interact the raspberryPi with flutter_reactive_ble?
Is any project is available, please help me ..!

Iam trying to search/references to install the flutter code using flutter_reactive_ble in raspberry pi 4.


问:
Xamarin forms android app black screen issue
My Xamarin app is runs in background, A black screen is appearing before opening the app when we are trying to click and open the deep links to the app. If the app is not opened in background the deep links are working properly.

How to overcome this issue? I need a solution for this problem.

Thanks in advance.


问:
Openseajs getOrders function returns empty
Whenever I use seaport.api.getOrders({...}) it returns [] however using the v1 api endpoint it returns valid orders

This is what I used to try fetch through opensejs sdk

```<code>async function main() {
    // create fresh wallet
    let [privKey, pubKey] = createNewWallet()
    const provider = new WalletProvider({
        privateKeys : [privKey],
        providerOrUrl: infuraUrl,
        addressIndex: 0
    })

    // initialise seaport with our hdwallet
    const seaport = new opensea.OpenSeaPort(provider, {
        networkName: opensea.Network.Main,
        apiKey: "redacted"
    })
    //
    const {orders, count} = await seaport.api.getOrders({
        assetContractAddress: "0x231d3559aa848bf10366fb9868590f01d34bf240",
        tokenIds: ["1743"],
        side: "bid",
    })
    console.log(orders, count)

</code>```

This returns :  [] undefined

However using this python code to fetch the v1 endpoint:

```<code>import requests
from pprint import pprint
import json
url = "https://api.opensea.io/api/v1/asset/0x231d3559aa848bf10366fb9868590f01d34bf240/1743/offers"

headers = {
    "accept": "application/json",
    "X-API-KEY": "redacted"
}

response = requests.get(url, headers=headers)
with open("offers.json", "w") as f:
    json.dump(response.json(), f, indent=4)
print(([int(i["protocol_data"]["parameters"]["offer"][0]["endAmount"]) / 10 ** 18 for i in response.json()["seaport_offers"]]))

</code>```

I get the expected response:  [0.7019, 0.80001, 0.52, 0.657, 0.8, 0.625, 0.0778, 0.07777, 0.7952, 0.61, 0.6, 0.75, 0.79, 0.1, 0.646, 0.69, 0.7171, 0.795, 0.75, 0.699, 0.4655875, 0.688358, 0.04, 0.7366, 0.01]

Please note I have tried this with many assets and it is the exact same response, using the website to replicate the openseajs function i get the same empty response

Body:
Whenever I use seaport.api.getOrders({...}) it returns [] however using the v1 api endpoint it returns valid orders

This is what I used to try fetch through opensejs sdk

async function main() {
    // create fresh wallet
    let [privKey, pubKey] = createNewWallet()
    const provider = new WalletProvider({
        privateKeys : [privKey],
        providerOrUrl: infuraUrl,
        addressIndex: 0
    })

    // initialise seaport with our hdwallet
    const seaport = new opensea.OpenSeaPort(provider, {
        networkName: opensea.Network.Main,
        apiKey: "redacted"
    })
    //
    const {orders, count} = await seaport.api.getOrders({
        assetContractAddress: "0x231d3559aa848bf10366fb9868590f01d34bf240",
        tokenIds: ["1743"],
        side: "bid",
    })
    console.log(orders, count)

This returns :  [] undefined

However using this python code to fetch the v1 endpoint:

import requests
from pprint import pprint
import json
url = "https://api.opensea.io/api/v1/asset/0x231d3559aa848bf10366fb9868590f01d34bf240/1743/offers"

headers = {
    "accept": "application/json",
    "X-API-KEY": "redacted"
}

response = requests.get(url, headers=headers)
with open("offers.json", "w") as f:
    json.dump(response.json(), f, indent=4)
print(([int(i["protocol_data"]["parameters"]["offer"][0]["endAmount"]) / 10 ** 18 for i in response.json()["seaport_offers"]]))

I get the expected response:  [0.7019, 0.80001, 0.52, 0.657, 0.8, 0.625, 0.0778, 0.07777, 0.7952, 0.61, 0.6, 0.75, 0.79, 0.1, 0.646, 0.69, 0.7171, 0.795, 0.75, 0.699, 0.4655875, 0.688358, 0.04, 0.7366, 0.01]

Please note I have tried this with many assets and it is the exact same response, using the website to replicate the openseajs function i get the same empty response


问:
Rails 7.0.4 ActiveSupport::MessageEncryptor::InvalidMessage
I've started a new ruby 3.1.2 + Rails 7.0.4 app and I'm deploying from Ubuntu 22.04 to Debian 11. I'm using capistrano, nginx, passenger, rbenv as part of my stack.

The error I'm getting when deploying is;

```<code>00:04 deploy:assets:precompile
  01 $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile
  01 rake aborted!
  01 ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage
  01 /var/www/profile/shared/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/message_encryptor.rb:209:in `rescue in _decrypt'
  01 /var/www/profile/shared/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/message_encryptor.rb:186:in `_decrypt'
  01 /var/www/profile/shared/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/message_encryptor.rb:160:in `decrypt_and_verify'
  01 /var/www/profile/shared/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/messages/rotator.rb:22:in `decrypt_and_verify'
  01 /var/www/profile/shared/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/encrypted_file.rb:104:in `decrypt'
  01 /var/www/profile/shared/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/encrypted_file.rb:66:in `read'
  01 /var/www/profile/shared/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/encrypted_configuration.rb:21:in `read'
  01 /var/www/profile/shared/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/encrypted_configuration.rb:33:in `config'
  01 /var/www/profile/shared/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/encrypted_configuration.rb:48:in `options'
</code>```

I've tried the following to fix it so far;

Created credentials using bin/rails credentials:edit
(commit, and deploy)

Created a production key and copied it over to production and configured capistrano to link that in

Configure production to use master key instead of production.key. I first removed the production.key I created in the last step, copied over my master.key to production shared area and added to linked_files to copy that in. This also failed.

Tried changing key generator hash from SHA256 to SHA1 (also didn't work) with the following

config.active_support.key_generator_hash_digest_class = OpenSSL::Digest::SHA1

Recreating credentials.yml.enc and master.key again from scratch and copying over the master.key to production and redeploying, also fails.

Update #1: Tried using production.key instead

I've tried creating a production key and I still get the same error on deploying.

Steps taken on my development box were;

```<code>$ rails secret
$ EDITOR=mg rails credentials:edit
$ rails credentials:edit --environment production
$ RAILS_ENV=production rails c
$ scp config/credentials/production.key 10.1.1.6:/var/www/profile/shared/config/credentials/
$ git add .
$ git ca -m 'Add production encrypted file'
</code>```

Added the following to my deploy.rb

```<code>append :linked_files, 'config/credentials/production.key'
</code>```

Then deployed

```<code>$ cap production deploy
</code>```

I checked the release after deploy on the server and the production key file was properly linked from my shared config credentials area.

Update #2: Create production.yml.enc on production server

Just to test I logged into the production server and did the following commands;

Created production.yml.enc

```<code>$ cd /var/www/profile/releases/20221221021047
$ rm config/credentials/production.*
$ EDITOR=mg rails credentials:edit -e production
</code>```

Test with rails console which wasn't working before, this now worked

```<code>$ RAILS_ENV=production rails c
</code>```

Back on development box, I copied the new key from production, commited and deployed.

```<code>$ scp 10.1.1.6:/var/www/profile/releases/20221221021047/config/credentials/production.yml.enc ~/code/profile/config/credentials
$ git commit -am 'Updated production encrypted yaml with server generated one'
$ cap production deploy
</code>```

Now I don't get the error on deploy (I still get it through nginx even after restarting nginx).  It doesn't feel like this is the correct way to do this.

Update #3: remove .rbenv-vars file

I noticed that the documentation I was following got me to create a .rbenv-vars file on the production system. This was creating issues on my deploy. I remove the file and then I could create the production file and copy the production.key over and it now works, even in nginx.

```<code>  - [X] DEV: Create production.yml.enc on dev and commit
    : $ rm config/credentials/production.yml.enc
    : $ scp config/credentials/production.key 10.1.1.6:/var/www/profile/shared/config/credentials/
    : $ rake secret
    : $ rails credentials:edit --environment production
    Enter in 'secret_key_base: <secret numbers from rake secret command>'
    : $ g ca -m 'updated production encrypted file with secret again'
    : $ cap production deploy
</code>```

Body:
I've started a new ruby 3.1.2 + Rails 7.0.4 app and I'm deploying from Ubuntu 22.04 to Debian 11. I'm using capistrano, nginx, passenger, rbenv as part of my stack.

The error I'm getting when deploying is;

00:04 deploy:assets:precompile
  01 $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile
  01 rake aborted!
  01 ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage
  01 /var/www/profile/shared/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/message_encryptor.rb:209:in `rescue in _decrypt'
  01 /var/www/profile/shared/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/message_encryptor.rb:186:in `_decrypt'
  01 /var/www/profile/shared/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/message_encryptor.rb:160:in `decrypt_and_verify'
  01 /var/www/profile/shared/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/messages/rotator.rb:22:in `decrypt_and_verify'
  01 /var/www/profile/shared/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/encrypted_file.rb:104:in `decrypt'
  01 /var/www/profile/shared/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/encrypted_file.rb:66:in `read'
  01 /var/www/profile/shared/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/encrypted_configuration.rb:21:in `read'
  01 /var/www/profile/shared/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/encrypted_configuration.rb:33:in `config'
  01 /var/www/profile/shared/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/encrypted_configuration.rb:48:in `options'

I've tried the following to fix it so far;

Created credentials using bin/rails credentials:edit
(commit, and deploy)

Created a production key and copied it over to production and configured capistrano to link that in

Configure production to use master key instead of production.key. I first removed the production.key I created in the last step, copied over my master.key to production shared area and added to linked_files to copy that in. This also failed.

Tried changing key generator hash from SHA256 to SHA1 (also didn't work) with the following

config.active_support.key_generator_hash_digest_class = OpenSSL::Digest::SHA1

Recreating credentials.yml.enc and master.key again from scratch and copying over the master.key to production and redeploying, also fails.

Update #1: Tried using production.key instead

I've tried creating a production key and I still get the same error on deploying.

Steps taken on my development box were;

$ rails secret
$ EDITOR=mg rails credentials:edit
$ rails credentials:edit --environment production
$ RAILS_ENV=production rails c
$ scp config/credentials/production.key 10.1.1.6:/var/www/profile/shared/config/credentials/
$ git add .
$ git ca -m 'Add production encrypted file'

Added the following to my deploy.rb

append :linked_files, 'config/credentials/production.key'

Then deployed

$ cap production deploy

I checked the release after deploy on the server and the production key file was properly linked from my shared config credentials area.

Update #2: Create production.yml.enc on production server

Just to test I logged into the production server and did the following commands;

Created production.yml.enc

$ cd /var/www/profile/releases/20221221021047
$ rm config/credentials/production.*
$ EDITOR=mg rails credentials:edit -e production

Test with rails console which wasn't working before, this now worked

$ RAILS_ENV=production rails c

Back on development box, I copied the new key from production, commited and deployed.

$ scp 10.1.1.6:/var/www/profile/releases/20221221021047/config/credentials/production.yml.enc ~/code/profile/config/credentials
$ git commit -am 'Updated production encrypted yaml with server generated one'
$ cap production deploy

Now I don't get the error on deploy (I still get it through nginx even after restarting nginx).  It doesn't feel like this is the correct way to do this.

Update #3: remove .rbenv-vars file

I noticed that the documentation I was following got me to create a .rbenv-vars file on the production system. This was creating issues on my deploy. I remove the file and then I could create the production file and copy the production.key over and it now works, even in nginx.

  - [X] DEV: Create production.yml.enc on dev and commit
    : $ rm config/credentials/production.yml.enc
    : $ scp config/credentials/production.key 10.1.1.6:/var/www/profile/shared/config/credentials/
    : $ rake secret
    : $ rails credentials:edit --environment production
    Enter in 'secret_key_base: <secret numbers from rake secret command>'
    : $ g ca -m 'updated production encrypted file with secret again'
    : $ cap production deploy


问:
vscode laguage server extension script stucked in production
on production, it takes almost ten minute to get the log scaning file done done. And there is no problem when I debug this vscode extension. I wonder why it get stucked. Thanks.

the origin project is here:
https://github.com/mrmlnc/vscode-less

```<code>    stream.on('file', (stat) => {
        const entry = makeEntryFile(stat.path, stat.ctime);
        // Return Cache if it exists and not outdated
        const cached = cache.get(entry.filepath);
        if (cached && cached.ctime.getTime() >= entry.ctime.getTime()) {
            listOfPromises.push(cached);
            return;
        }
        listOfPromises.push(makeSymbolsForDocument(cache, entry, settings));
    });
    stream.on('error', (err) => {
        if (settings.showErrors) {
            reject(err);
        }
    });
    stream.on('end', () => __awaiter(this, void 0, void 0, function* () {
        let projectSymbols = [];
        let importedSymbols = [];
        try {
            projectSymbols = yield Promise.all(listOfPromises);
            // on production, it takes almost ten minute to get the log done.
            (0, server_1.getConnection)().console.log('scaning file done')

            if (settings.scanImportedFiles) {
                importedSymbols = yield scannerImportedFiles(cache, projectSymbols, settings);
            }
        }
        catch (err) {
            if (settings.showErrors) {
                reject(err);
            }
        }
        resolve(projectSymbols.concat(importedSymbols));
    }));

function makeSymbolsForDocument(cache, entry, settings) {
  return (0, fs_1.readFile)(entry.filepath).then((data) => {
    if (cache.keys().length % 50 == 0) {
        (0, server_1.getConnection)().console.log('scaning file ' + entry.filepath)
    }

    const doc = vscode_languageserver_1.TextDocument.create(entry.filepath, 'less', 1, data);
    const { symbols } = (0, parser_1.parseDocument)(doc, null, settings);
    symbols.ctime = entry.ctime;
    cache.set(entry.filepath, symbols);
    return symbols;
  });
}
</code>```

the log in console:

```<code>scaning file businessapplication/invoice/splitInvoiceModal.less

scaning file platform/flow/workflowdrawing/ruletabs/designatedPosts.less

scaning file platform/expenseclaim/editor/component/expenseRecord/compositeAmount.less

scaning file done
</code>```

vscode discussion link(you could get the extension vsix file here):
https://github.com/microsoft/vscode-discussions/discussions/325

Body:
on production, it takes almost ten minute to get the log scaning file done done. And there is no problem when I debug this vscode extension. I wonder why it get stucked. Thanks.

the origin project is here:
https://github.com/mrmlnc/vscode-less

    stream.on('file', (stat) => {
        const entry = makeEntryFile(stat.path, stat.ctime);
        // Return Cache if it exists and not outdated
        const cached = cache.get(entry.filepath);
        if (cached && cached.ctime.getTime() >= entry.ctime.getTime()) {
            listOfPromises.push(cached);
            return;
        }
        listOfPromises.push(makeSymbolsForDocument(cache, entry, settings));
    });
    stream.on('error', (err) => {
        if (settings.showErrors) {
            reject(err);
        }
    });
    stream.on('end', () => __awaiter(this, void 0, void 0, function* () {
        let projectSymbols = [];
        let importedSymbols = [];
        try {
            projectSymbols = yield Promise.all(listOfPromises);
            // on production, it takes almost ten minute to get the log done.
            (0, server_1.getConnection)().console.log('scaning file done')

            if (settings.scanImportedFiles) {
                importedSymbols = yield scannerImportedFiles(cache, projectSymbols, settings);
            }
        }
        catch (err) {
            if (settings.showErrors) {
                reject(err);
            }
        }
        resolve(projectSymbols.concat(importedSymbols));
    }));

function makeSymbolsForDocument(cache, entry, settings) {
  return (0, fs_1.readFile)(entry.filepath).then((data) => {
    if (cache.keys().length % 50 == 0) {
        (0, server_1.getConnection)().console.log('scaning file ' + entry.filepath)
    }

    const doc = vscode_languageserver_1.TextDocument.create(entry.filepath, 'less', 1, data);
    const { symbols } = (0, parser_1.parseDocument)(doc, null, settings);
    symbols.ctime = entry.ctime;
    cache.set(entry.filepath, symbols);
    return symbols;
  });
}

the log in console:

scaning file businessapplication/invoice/splitInvoiceModal.less

scaning file platform/flow/workflowdrawing/ruletabs/designatedPosts.less

scaning file platform/expenseclaim/editor/component/expenseRecord/compositeAmount.less

scaning file done

vscode discussion link(you could get the extension vsix file here):
https://github.com/microsoft/vscode-discussions/discussions/325


问:
How to use cloud functions with realtime database in the new version?
I'm trying to use the new version of firebase sdk with import and modules, but I can't get it right, whenever I try I get this error TypeError: Cannot read property 'SDK_VERSION' of undefined this is my code

```<code>import * as functions from "firebase-functions";
import { initializeApp } from "firebase-admin";
const app = initializeApp();
export const pizzaz = functions.database
  .ref("messages/{id}")
  .onCreate(async (snapshot, contexto) => {
    app.database().ref(contexto.params.id).update({ emoji: "" });
  });

</code>```

I know it's releated to the app and initializeApp()

Body:
I'm trying to use the new version of firebase sdk with import and modules, but I can't get it right, whenever I try I get this error TypeError: Cannot read property 'SDK_VERSION' of undefined this is my code

import * as functions from "firebase-functions";
import { initializeApp } from "firebase-admin";
const app = initializeApp();
export const pizzaz = functions.database
  .ref("messages/{id}")
  .onCreate(async (snapshot, contexto) => {
    app.database().ref(contexto.params.id).update({ emoji: "" });
  });

I know it's releated to the app and initializeApp()


问:
run datadog agent by adding as JAVA_OPS on fluxCD
I have a terraform infra structure project built with FluxCD, that has amongst other things, a spring boot service loaded by a docker image.

What I wanna do is to monitor the JVM of this service with datadog on it's service catalog.
No need to create custom metrics etc.

The last layers of this docker image install the DATADOG agent with this:

```<code>ARG DATADOG_JAVA_AGENT_VERSION=0.75.0

RUN |1 DATADOG_JAVA_AGENT_VERSION=0.75.0 /bin/sh -c wget --quiet --retry-connrefused --waitretry=1 --read-timeout=10 --timeout=10 --output-document /app/dd-java-agent.jar     https://repository.sonatype.org/service/local/repositories/central-proxy/content/com/datadoghq/dd-java-agent/${DATADOG_JAVA_AGENT_VERSION}/dd-java-agent-${DATADOG_JAVA_AGENT_VERSION}.jar &&     chmod +x /app/dd-java-agent.jar # buildkit

ENTRYPOINT ["java" "-jar" "/app/my-service.jar"]
</code>```

According to DD documentation:

Download dd-java-agent.jar that contains the latest Agent class files:

```<code>wget -O dd-java-agent.jar https://dtdg.co/latest-java-tracer

</code>```

Add the Java Tracer to the JVM

If you’re adding the -javaagent argument to your java -jar command, it needs to be added before the -jar argument, as a JVM option, not as an application argument. For example:

java -javaagent:/path/to/dd-java-agent.jar -jar my_app.jar

Inside my TF project, I edited this with the following:

```<code>-Project
   -infrastructre
      -fluxcd
         -services
             -base
                 - myservice
                     - myService.yaml

</code>```
```<code>apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
spec:
   values:
      deployment:
        env:
          - name: JAVA_OPTS
            value: "${JAVA_OPTS} -javaagent:/app/dd-java-agent.jar -Ddd.logs.injection=true -Ddd.service=myservice -Ddd.env=dev"

</code>```

And after all this and restarting my service, it still doesn't show up on Datadog's service catalog.

Am I injecting JAVA_OPTS wrong?

Should I add those under, like this?

```<code>deployment:
   args:

</code>```

What am I missing?

Body:
I have a terraform infra structure project built with FluxCD, that has amongst other things, a spring boot service loaded by a docker image.

What I wanna do is to monitor the JVM of this service with datadog on it's service catalog.
No need to create custom metrics etc.

The last layers of this docker image install the DATADOG agent with this:

ARG DATADOG_JAVA_AGENT_VERSION=0.75.0

RUN |1 DATADOG_JAVA_AGENT_VERSION=0.75.0 /bin/sh -c wget --quiet --retry-connrefused --waitretry=1 --read-timeout=10 --timeout=10 --output-document /app/dd-java-agent.jar     https://repository.sonatype.org/service/local/repositories/central-proxy/content/com/datadoghq/dd-java-agent/${DATADOG_JAVA_AGENT_VERSION}/dd-java-agent-${DATADOG_JAVA_AGENT_VERSION}.jar &&     chmod +x /app/dd-java-agent.jar # buildkit

ENTRYPOINT ["java" "-jar" "/app/my-service.jar"]

According to DD documentation:

Download dd-java-agent.jar that contains the latest Agent class files:

wget -O dd-java-agent.jar https://dtdg.co/latest-java-tracer

Add the Java Tracer to the JVM

If you’re adding the -javaagent argument to your java -jar command, it needs to be added before the -jar argument, as a JVM option, not as an application argument. For example:

java -javaagent:/path/to/dd-java-agent.jar -jar my_app.jar

Inside my TF project, I edited this with the following:

-Project
   -infrastructre
      -fluxcd
         -services
             -base
                 - myservice
                     - myService.yaml

apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
spec:
   values:
      deployment:
        env:
          - name: JAVA_OPTS
            value: "${JAVA_OPTS} -javaagent:/app/dd-java-agent.jar -Ddd.logs.injection=true -Ddd.service=myservice -Ddd.env=dev"

And after all this and restarting my service, it still doesn't show up on Datadog's service catalog.

Am I injecting JAVA_OPTS wrong?

Should I add those under, like this?

deployment:
   args:

What am I missing?


问:
Autoencoder hits invisble wall
I have a problem. I am currently trying to train an autoencoder using Stock data. The data has been MinMax scaled.

The model seems to have an issue tranforming values lower than 0.15 and higher than 0.8. It looks like there is an invisible barrier. Not sure how to call this. How would you call it?

This is the models output vs original: Output vs Original

My model uses the tanh activation function and consists of Linear Layers. The laten_dim is the same as the  input layer. I planned to reduce it later down the line:

```<code>class SparseEncoder(nn.Module):

    def __init__(self, input_shape: int, latent_dims, dtype=torch.float64):
        super().__init__()
        self.linear1 = nn.Linear(input_shape, 512, dtype=dtype)
        self.linear2 = nn.Linear(512, 256, dtype=dtype)
        self.linear3 = nn.Linear(256, 128, dtype=dtype)
        self.linear4 = nn.Linear(128, 64, dtype=dtype)
        self.linear5 = nn.Linear(64, 32, dtype=dtype)
        self.linear6 = nn.Linear(32, 16, dtype=dtype)
        self.linear7 = nn.Linear(16, 8, dtype=dtype)
        self.linear8 = nn.Linear(8, latent_dims, dtype=dtype)

    def forward(self, x):
        # y = torch.flatten(x, start_dim=1)
        z = torch.tanh(self.linear1(x))
        z = torch.tanh(self.linear2(z))
        z = torch.tanh(self.linear3(z))
        z = torch.tanh(self.linear4(z))
        z = torch.tanh(self.linear5(z))
        z = torch.tanh(self.linear6(z))
        z = torch.tanh(self.linear7(z))
        z = torch.tanh(self.linear8(z))
        return z
</code>```
```<code>
class SparseDecoder(nn.Module):

    def __init__(self, input_shape: int, latent_dims, dtype=torch.float64):
        super().__init__()
        self.linear1 = nn.Linear(latent_dims, 8, dtype=dtype)
        self.linear2 = nn.Linear(8, 16, dtype=dtype)
        self.linear3 = nn.Linear(16, 32, dtype=dtype)
        self.linear4 = nn.Linear(32, 64, dtype=dtype)
        self.linear5 = nn.Linear(64, 128, dtype=dtype)
        self.linear6 = nn.Linear(128, 256, dtype=dtype)
        self.linear7 = nn.Linear(256, 512, dtype=dtype)
        self.linear8 = nn.Linear(512, input_shape, dtype=dtype)

    def forward(self, x):
        # y = torch.flatten(x, start_dim=1)
        z = torch.tanh(self.linear1(x))
        z = torch.tanh(self.linear2(z))
        z = torch.tanh(self.linear3(z))
        z = torch.tanh(self.linear4(z))
        z = torch.tanh(self.linear5(z))
        z = torch.tanh(self.linear6(z))
        z = torch.tanh(self.linear7(z))
        z = torch.tanh(self.linear8(z))
        return z
</code>```

Do you have any hints that could help me?

I tried to autoencode Stock market data and expected to see a 1:1 to the output since the latent space is still the same.

Title: Autoencoder hits invisble wall

Body:
I have a problem. I am currently trying to train an autoencoder using Stock data. The data has been MinMax scaled.

The model seems to have an issue tranforming values lower than 0.15 and higher than 0.8. It looks like there is an invisible barrier. Not sure how to call this. How would you call it?

This is the models output vs original: Output vs Original

My model uses the tanh activation function and consists of Linear Layers. The laten_dim is the same as the  input layer. I planned to reduce it later down the line:

class SparseEncoder(nn.Module):

    def __init__(self, input_shape: int, latent_dims, dtype=torch.float64):
        super().__init__()
        self.linear1 = nn.Linear(input_shape, 512, dtype=dtype)
        self.linear2 = nn.Linear(512, 256, dtype=dtype)
        self.linear3 = nn.Linear(256, 128, dtype=dtype)
        self.linear4 = nn.Linear(128, 64, dtype=dtype)
        self.linear5 = nn.Linear(64, 32, dtype=dtype)
        self.linear6 = nn.Linear(32, 16, dtype=dtype)
        self.linear7 = nn.Linear(16, 8, dtype=dtype)
        self.linear8 = nn.Linear(8, latent_dims, dtype=dtype)

    def forward(self, x):
        # y = torch.flatten(x, start_dim=1)
        z = torch.tanh(self.linear1(x))
        z = torch.tanh(self.linear2(z))
        z = torch.tanh(self.linear3(z))
        z = torch.tanh(self.linear4(z))
        z = torch.tanh(self.linear5(z))
        z = torch.tanh(self.linear6(z))
        z = torch.tanh(self.linear7(z))
        z = torch.tanh(self.linear8(z))
        return z

class SparseDecoder(nn.Module):

    def __init__(self, input_shape: int, latent_dims, dtype=torch.float64):
        super().__init__()
        self.linear1 = nn.Linear(latent_dims, 8, dtype=dtype)
        self.linear2 = nn.Linear(8, 16, dtype=dtype)
        self.linear3 = nn.Linear(16, 32, dtype=dtype)
        self.linear4 = nn.Linear(32, 64, dtype=dtype)
        self.linear5 = nn.Linear(64, 128, dtype=dtype)
        self.linear6 = nn.Linear(128, 256, dtype=dtype)
        self.linear7 = nn.Linear(256, 512, dtype=dtype)
        self.linear8 = nn.Linear(512, input_shape, dtype=dtype)

    def forward(self, x):
        # y = torch.flatten(x, start_dim=1)
        z = torch.tanh(self.linear1(x))
        z = torch.tanh(self.linear2(z))
        z = torch.tanh(self.linear3(z))
        z = torch.tanh(self.linear4(z))
        z = torch.tanh(self.linear5(z))
        z = torch.tanh(self.linear6(z))
        z = torch.tanh(self.linear7(z))
        z = torch.tanh(self.linear8(z))
        return z

Do you have any hints that could help me?

I tried to autoencode Stock market data and expected to see a 1:1 to the output since the latent space is still the same.


问:
SVG styles behaving unexpectedly, not respecting parent containers' height?
I'm trying to create a TextField component that takes an optional left adornment component, which renders a container with an SVG icon within it, where the SVG icon is centered within the parent.

The problem here is that the parent of the SVG element is, for some reason, setting an (arbitrary?) height for itself. Not sure why this is happening, maybe it's got something to do with the SVG props themselves.

If I set the Container height to 3rem, for example, then the adornments' parent containers height does change, but the SVG itself keeps extending outside of the bounds.

Here's how it looks like now:

And here is how I'd like it to look like:

Here's the code:

```<code>// TextField
import * as React from "react";
import clsx from "clsx";
import styled from "@emotion/styled";

const Container = styled.div`
  --input-color: #99a3ba;
  --input-border: #cdd9ed;
  --input-border-error: #a30000;
  --input-background: #fff;
  --input-placeholder: #cbd1dc;

  --input-border-focus: #275efe;

  --group-color: var(--input-color);
  --group-border: var(--input-border);
  --group-background: #eef4ff;

  --group-color-focus: #fff;
  --group-border-focus: var(--input-border-focus);
  --group-background-focus: #678efe;

  position: relative;
  display: flex;
  width: 100%;
  & > .adornment_container,
  .form-field {
    white-space: nowrap;
    display: block;
    &:not(:first-child):not(:last-child) {
      border-radius: 0;
    }
    &:first-child {
      border-radius: 0.5rem 0 0 0.5rem;
    }
    &:last-child {
      border-radius: 0 0.5rem 0.5rem 0;
    }
    &:not(:first-child) {
      margin-left: 1px;
    }
  }
  .form-field {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    width: 1%;
    margin-top: 0;
    margin-bottom: 0;
  }
  & > .adornment_container {
    width: 5rem;
    height: 100%;
    text-align: center;
    color: var(--group-color);
    background: var(--group-background);
    border: 1px solid var(--group-border);
    transition: background 0.3s ease, border 0.3s ease, color 0.3s ease;
  }
  &:focus-within {
    & > .adornment_container {
      color: var(--group-color-focus);
      background: var(--group-background-focus);
      border-color: var(--group-border-focus);

      path {
        fill: #ffffff;
      }
    }
  }
`;

const Input = styled.input`
  display: block;
  width: 100%;
  height: 100%;
  padding: 0.5rem 1rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: 6px;
  -webkit-appearance: none;
  color: var(--input-color);
  border: 1px solid var(--input-border);
  background: var(--input-background);
  transition: border 0.3s ease;
  &::placeholder {
    color: var(--input-placeholder);
  }
  &:focus {
    outline: none;
    border-color: var(--input-border-focus);
  }
`;

const AdornmentContent = styled.div`
  height: 100%;
  width: 100%;
`;

type TextFieldProps = {
  adornmentContent?: React.ReactNode;
  value: string;
  disabled?: boolean;
} & Omit<React.HTMLAttributes<HTMLInputElement>, "name">;
const TextField = React.memo(
  ({
    className,
    adornmentContent = null,
    disabled,
    ...props
  }: TextFieldProps) => {
    const adornment = adornmentContent ? (
      <AdornmentContent className="adornment_container">
        {adornmentContent}
      </AdornmentContent>
    ) : null;

    return (
      <Container>
        {adornment}
        <Input className={clsx("form-field", className)} {...props} />
      </Container>
    );
  }
);

export default TextField;
</code>```
```<code>// EmailIcon
import * as React from "react";

const EmailIcon = React.memo(() => {
  return (
    <svg
      aria-hidden="true"
      viewBox="0 0 100% 100%"
      preserveAspectRatio="xMidYMid meet"
      style={{
        width: "100%",
        height: "100%"
      }}
    >
      <path
        d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10h5v-2h-5c-4.34 0-8-3.66-8-8s3.66-8 8-8 8 3.66 8 8v1.43c0 .79-.71 1.57-1.5 1.57s-1.5-.78-1.5-1.57V12c0-2.76-2.24-5-5-5s-5 2.24-5 5 2.24 5 5 5c1.38 0 2.64-.56 3.54-1.47.65.89 1.77 1.47 2.96 1.47 1.97 0 3.5-1.6 3.5-3.57V12c0-5.52-4.48-10-10-10zm0 13c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3z"
        fill={"#232323"}
      />
    </svg>
  );
});

export default EmailIcon;
</code>```

What am I doing wrong here? Here is how I would like it to look like:

Body:
I'm trying to create a TextField component that takes an optional left adornment component, which renders a container with an SVG icon within it, where the SVG icon is centered within the parent.

The problem here is that the parent of the SVG element is, for some reason, setting an (arbitrary?) height for itself. Not sure why this is happening, maybe it's got something to do with the SVG props themselves.

If I set the Container height to 3rem, for example, then the adornments' parent containers height does change, but the SVG itself keeps extending outside of the bounds.

Here's how it looks like now:

And here is how I'd like it to look like:

Here's the code:

// TextField
import * as React from "react";
import clsx from "clsx";
import styled from "@emotion/styled";

const Container = styled.div`
  --input-color: #99a3ba;
  --input-border: #cdd9ed;
  --input-border-error: #a30000;
  --input-background: #fff;
  --input-placeholder: #cbd1dc;

  --input-border-focus: #275efe;

  --group-color: var(--input-color);
  --group-border: var(--input-border);
  --group-background: #eef4ff;

  --group-color-focus: #fff;
  --group-border-focus: var(--input-border-focus);
  --group-background-focus: #678efe;

  position: relative;
  display: flex;
  width: 100%;
  & > .adornment_container,
  .form-field {
    white-space: nowrap;
    display: block;
    &:not(:first-child):not(:last-child) {
      border-radius: 0;
    }
    &:first-child {
      border-radius: 0.5rem 0 0 0.5rem;
    }
    &:last-child {
      border-radius: 0 0.5rem 0.5rem 0;
    }
    &:not(:first-child) {
      margin-left: 1px;
    }
  }
  .form-field {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    width: 1%;
    margin-top: 0;
    margin-bottom: 0;
  }
  & > .adornment_container {
    width: 5rem;
    height: 100%;
    text-align: center;
    color: var(--group-color);
    background: var(--group-background);
    border: 1px solid var(--group-border);
    transition: background 0.3s ease, border 0.3s ease, color 0.3s ease;
  }
  &:focus-within {
    & > .adornment_container {
      color: var(--group-color-focus);
      background: var(--group-background-focus);
      border-color: var(--group-border-focus);

      path {
        fill: #ffffff;
      }
    }
  }
`;

const Input = styled.input`
  display: block;
  width: 100%;
  height: 100%;
  padding: 0.5rem 1rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: 6px;
  -webkit-appearance: none;
  color: var(--input-color);
  border: 1px solid var(--input-border);
  background: var(--input-background);
  transition: border 0.3s ease;
  &::placeholder {
    color: var(--input-placeholder);
  }
  &:focus {
    outline: none;
    border-color: var(--input-border-focus);
  }
`;

const AdornmentContent = styled.div`
  height: 100%;
  width: 100%;
`;

type TextFieldProps = {
  adornmentContent?: React.ReactNode;
  value: string;
  disabled?: boolean;
} & Omit<React.HTMLAttributes<HTMLInputElement>, "name">;
const TextField = React.memo(
  ({
    className,
    adornmentContent = null,
    disabled,
    ...props
  }: TextFieldProps) => {
    const adornment = adornmentContent ? (
      <AdornmentContent className="adornment_container">
        {adornmentContent}
      </AdornmentContent>
    ) : null;

    return (
      <Container>
        {adornment}
        <Input className={clsx("form-field", className)} {...props} />
      </Container>
    );
  }
);

export default TextField;

// EmailIcon
import * as React from "react";

const EmailIcon = React.memo(() => {
  return (
    <svg
      aria-hidden="true"
      viewBox="0 0 100% 100%"
      preserveAspectRatio="xMidYMid meet"
      style={{
        width: "100%",
        height: "100%"
      }}
    >
      <path
        d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10h5v-2h-5c-4.34 0-8-3.66-8-8s3.66-8 8-8 8 3.66 8 8v1.43c0 .79-.71 1.57-1.5 1.57s-1.5-.78-1.5-1.57V12c0-2.76-2.24-5-5-5s-5 2.24-5 5 2.24 5 5 5c1.38 0 2.64-.56 3.54-1.47.65.89 1.77 1.47 2.96 1.47 1.97 0 3.5-1.6 3.5-3.57V12c0-5.52-4.48-10-10-10zm0 13c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3z"
        fill={"#232323"}
      />
    </svg>
  );
});

export default EmailIcon;

What am I doing wrong here? Here is how I would like it to look like:


问:
I send a request to a servlet and get a strange error: ((Head)((Head)..........((Head)s).sourceStage)..............sourceStage).sourceStage
I'm making a POST request to a servlet and trying to get data from the request

```<code>public class mainServlet extends HttpServlet {

@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    if(!resp.containsHeader("Access-Control-Allow-Origin"))resp.addHeader("Access-Control-Allow-Origin","*");
    else resp.setHeader("Access-Control-Allow-Origin","*");
    Map<String, String> i=req.getParameterMap();
    resp.getWriter().write("555");
   }
}
</code>```

I have a breakpoint on the last line. In it I catch a strange error
enter image description here
And also the variable i is empty, although it should contain the request body.

Here is the request

```<code>const req = new XMLHttpRequest()
  req.open("POST", "http://localhost:8081/backEnd-1.0-SNAPSHOT/")
  let data= JSON.stringify({name: 1});
  req.send(data)
  req.onload = () => {
    alert(req.response)
  }
  req.onerror=()=>{
  }
</code>```

Body:
I'm making a POST request to a servlet and trying to get data from the request

public class mainServlet extends HttpServlet {

@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    if(!resp.containsHeader("Access-Control-Allow-Origin"))resp.addHeader("Access-Control-Allow-Origin","*");
    else resp.setHeader("Access-Control-Allow-Origin","*");
    Map<String, String> i=req.getParameterMap();
    resp.getWriter().write("555");
   }
}

I have a breakpoint on the last line. In it I catch a strange error
enter image description here
And also the variable i is empty, although it should contain the request body.

Here is the request

const req = new XMLHttpRequest()
  req.open("POST", "http://localhost:8081/backEnd-1.0-SNAPSHOT/")
  let data= JSON.stringify({name: 1});
  req.send(data)
  req.onload = () => {
    alert(req.response)
  }
  req.onerror=()=>{
  }


问:
Text-Reader class
For java a program, there will be a 2D array entry in the text file, but the size of the array will not be determined. How can I create a reading class without library, so that the program runs stably at all given values?

I tried to make a dynamic array but I couldn't get it to work.

Title: Text-Reader class


问:
How to pass array(or vec) between Go and Rust?
I want to build a local service mainly based on Golang, and I'm using Rust to reshape part of my code to make it run faster and cost less memory. Everything went well until I tried to pass an array between them.
I've defined the same data structure in both Rust and Go, and they work well separately, but I don't know how to pass an array.

Here are my structure definitions:

// go part
type ContractItems []ContractItem // Here `ContractItem` is another plain struct with simple k-v structure.
```
<pre class="lang-rust prettyprint-override"><code>// rust part
type ContractItems Vec<ContractItem>
</code>```

// c header file

#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

typedef struct Vec_ContractItemPrice Vec_ContractItemPrice;

typedef struct Vec_ContractItemPrice ContractItemPrices;

struct ContractItemsPriceHandler contract_items_price_handler_from(ContractItemPrices c, int64_t contract_id);
```
<p>I haven't use Clang for actually a long time, so the C header file was generated automatically by <code>cbindgen</code>.</p>
<p>And I received this panic report:</p>
<pre class="lang-none prettyprint-override"><code># command-line-arguments
cgo-gcc-prolog: In function '_cgo_fbbb6cfe6006_Cfunc_contract_items_price_handler_from':
cgo-gcc-prolog:46:22: error: field 'p0' has incomplete type
cgo-gcc-prolog:53:45: error: type of formal parameter 1 is incomplete
</code>```

I expect to pass an array or array-like which can be transferred into both alloc::vec or just array in Rust and slice or array in Go. Anyway, I'm not quite good at Clang. So the possible solutions in Rust or Go part are more appreciated since I'm not sure about my ability to debug additional C code.

Body:
I want to build a local service mainly based on Golang, and I'm using Rust to reshape part of my code to make it run faster and cost less memory. Everything went well until I tried to pass an array between them.
I've defined the same data structure in both Rust and Go, and they work well separately, but I don't know how to pass an array.

Here are my structure definitions:

// go part
type ContractItems []ContractItem // Here `ContractItem` is another plain struct with simple k-v structure.

// rust part
type ContractItems Vec<ContractItem>

// c header file

#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

typedef struct Vec_ContractItemPrice Vec_ContractItemPrice;

typedef struct Vec_ContractItemPrice ContractItemPrices;

struct ContractItemsPriceHandler contract_items_price_handler_from(ContractItemPrices c, int64_t contract_id);

I haven't use Clang for actually a long time, so the C header file was generated automatically by cbindgen.

And I received this panic report:

# command-line-arguments
cgo-gcc-prolog: In function '_cgo_fbbb6cfe6006_Cfunc_contract_items_price_handler_from':
cgo-gcc-prolog:46:22: error: field 'p0' has incomplete type
cgo-gcc-prolog:53:45: error: type of formal parameter 1 is incomplete

I expect to pass an array or array-like which can be transferred into both alloc::vec or just array in Rust and slice or array in Go. Anyway, I'm not quite good at Clang. So the possible solutions in Rust or Go part are more appreciated since I'm not sure about my ability to debug additional C code.


问:
How do I setup and retrieve the authorization code?
So I am using seatgeek api. The grant type is an authorisation code. Therefore you are provided with an authorization url. This authorization url will then redirect user back to the redirect url you created.This time with the code appended to it. Next you will use this code to retrieve the access token.

The authorization url is

https://seatgeek.com/oauth2?scope=offline_access,&client_id=xxxxxxxxxxxxxxxxxx

the redirect url look something like this.

https://name/oauth/fin?code=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2NzEzNTMzNjUsImV4cCI6MTY3MTM1Mzk2NSwiY2xpZW50X2lkIjo5NjU2LCJ1c2VyX2lkIjozMDQ4NDIzNCwiY29kZV9jaGFsbGVuZ2UiOm51bGwsImNvZGVfY2hhbGxlbmdlX21ldGhvZCI6bnVsbH0.eVly0CYTi4DWyRQE3MerAz911LxBj6MdXcw3pAXT1Wk

looking at the above urls, the authorization url will redirect the user to https://name/oauth/fin? however the code needed is appended this time. this is the code you will need to request an access token.

I did this in my browser.However I wan to know how to set it up using retrofit and refresh it whenever it expires. Any help will be greatly appreciated.

here is the seatgeek documentation
https://partners.seatgeek.com/enterprise-client-integration/oauth if you need more info


问:
Can Azure Container Instance reach a local windows share folder?
Still learning on how works Azure container Instance (ACI) and i met problem about reaching a Windows file share.

I have a Linux ACI which is connected to my on-premises network with VNET

In this ACI I have a Azure Devops Agent installed and I do confirm it can be registered with my on-premises azure devops instance and run build for instance

In my workflow, i need this ACI to copy file to a windows share folder.

Unfortunately it failed with 'permission denied'. According documentation and blog I could use --privileged parameter but ACI does not support it.
I could also used 'add capabilities' but again ACI does not support it.

Note that when i run this container on Linux VM instead of ACI then mapping to windows share file works (i think it is normal because i am full admin and this can use --privileged and add capabilities).

So i wonder if ACI can connect to Windows share ?
My command looks like:
mount -t cifs -o credentials=/xxx/smbcreds,vers=3.0 //myshare/myfoldertoshare /mylocalcontainer/myshare

Any help is welcome.


问:
Switch Sony aplha 7 mark iii from charging mode to Usb mode
I need to use my sony alpha 7 camera with a dummy battery. If the power button on the camera is set to ON and I switch off and on the dummy battery, the pc recongnized the camera in charging mode and I can't control it. Only by re-plugged the usb-c cable the usb connection is restored. I try to reset the usb bus using some cli like usb-reset, but it didn't work. I see in some forum that one way is to use a powered usb hub and do a power cycle of it.

I just set the camera usb option to:
usb mode: PC Remote control
Usb power: off
Usb Lun: single

I'm using the rapsberry pi4 as Pc.

But I was wondering if there is possible to restore the connection mode of the camera without a usb hub.


问:
Not able to access image from intent after close and open the application again (android)
I've been trying to build an app that is able to recover a photo from the gallery and use it in a recycler view with some content information previously registered.
I'm able to recover this photo normally, set it into the recycler view but when I close the app and open again, I receive the message saying that I don't have permission to access this content.

java.lang.SecurityException: Permission Denial: opening provider com.android.providers.media.MediaDocumentsProvider from ProcessRecord{d5d38d1 7118:com.tods.docreminder/u0a169} (pid=7118, uid=10169) requires that you obtain access using ACTION_OPEN_DOCUMENT or related APIs

This is the way that I'm recovering the image from the gallery:

```<code>private fun configExternalStorageIntent(pathGallery: Int) {
    val intent = Intent()
    intent.type = "image/*"
    intent.action = Intent.ACTION_OPEN_DOCUMENT
    startActivityForResult(Intent.createChooser(intent, "Select: "), pathGallery)
}
</code>```
```<code>override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
    super.onActivityResult(requestCode, resultCode, data)
    if(resultCode == RESULT_OK) {
        val selectedImage = data.data
        try {
            when (requestCode) {
                content...
            }
            imageList.add(selectedImage.toString())
        } catch (e: Exception){
            e.printStackTrace()
        }
    }
}
</code>```

And that is my manifest permissions:

```<code><uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />

<uses-feature android:name="android.hardware.camera"/>

<queries>
    <intent>
        <action android:name="android.intent.action.VIEW"/>
    </intent>
    <intent>
        <action android:name="android.media.action.IMAGE_CAPTURE"/>
    </intent>
</queries>

</code>```

I'm saving the uri from the selected image and displaying it on another fragment. I register it on Fragment 2 and displays it on Fragment 1. I'm able to display it normally in the first time, but it crashes when I open the app again. This list is saved in room database. Any suggestions?

Thanks in advance. If is there any information missing just tell me and I update it.

Body:
I've been trying to build an app that is able to recover a photo from the gallery and use it in a recycler view with some content information previously registered.
I'm able to recover this photo normally, set it into the recycler view but when I close the app and open again, I receive the message saying that I don't have permission to access this content.

java.lang.SecurityException: Permission Denial: opening provider com.android.providers.media.MediaDocumentsProvider from ProcessRecord{d5d38d1 7118:com.tods.docreminder/u0a169} (pid=7118, uid=10169) requires that you obtain access using ACTION_OPEN_DOCUMENT or related APIs

This is the way that I'm recovering the image from the gallery:

private fun configExternalStorageIntent(pathGallery: Int) {
    val intent = Intent()
    intent.type = "image/*"
    intent.action = Intent.ACTION_OPEN_DOCUMENT
    startActivityForResult(Intent.createChooser(intent, "Select: "), pathGallery)
}

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
    super.onActivityResult(requestCode, resultCode, data)
    if(resultCode == RESULT_OK) {
        val selectedImage = data.data
        try {
            when (requestCode) {
                content...
            }
            imageList.add(selectedImage.toString())
        } catch (e: Exception){
            e.printStackTrace()
        }
    }
}

And that is my manifest permissions:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />

<uses-feature android:name="android.hardware.camera"/>

<queries>
    <intent>
        <action android:name="android.intent.action.VIEW"/>
    </intent>
    <intent>
        <action android:name="android.media.action.IMAGE_CAPTURE"/>
    </intent>
</queries>

I'm saving the uri from the selected image and displaying it on another fragment. I register it on Fragment 2 and displays it on Fragment 1. I'm able to display it normally in the first time, but it crashes when I open the app again. This list is saved in room database. Any suggestions?

Thanks in advance. If is there any information missing just tell me and I update it.


问:
vue2 xlsx not working for statement doesn't work
npm i xlsx

```<code> methods: {
          async excelDown1() {
              const xlsx = require("xlsx");

              const book = xlsx.utils.book_new();

              const dataByAoa = await this.getFruitDataByAoa1();

              const worksheetByAoa = xlsx.utils.aoa_to_sheet(dataByAoa);

              xlsx.utils.book_append_sheet(book, worksheetByAoa, "DailyInspection");

              xlsx.writeFile(book, "DailyInspection.xlsx");
            },
            getFruitDataByAoa1() {
              let arr = [];
              arr.push([
                "Equipmentcode",
                 "InspectionDay",
                 "checklist",
                 "Checkcontent",
                 "Checkresults",
                 "Checker",
                 "note",
              ]);
              for (let index = 0; index < this.daydatas.length + 1; index++) {
                arr.push([
                  this.daydatas[index].Machinecd,
                  this.daydatas[index].Checkdt,
                  this.daydatas[index].CheckItem,
                  this.daydatas[index].CheckPart,
                  this.daydatas[index].CheckResult,
                  this.daydatas[index].CheckUser,
                  this.daydatas[index].Remark,
                ]);
                console.log("go");
              }
              console.log("gogo");

              return arr;
            },
    }
</code>```

The for statement does not return. Only 'gogo' is printed. Is it wrong to add an excel table like this? xlsx was used.

If you put 0 instead of 'index', one line will be printed.
Any code will not work if you put it inside a for statement. Why is the for statement not working?

Body:
npm i xlsx

 methods: {
          async excelDown1() {
              const xlsx = require("xlsx");

              const book = xlsx.utils.book_new();

              const dataByAoa = await this.getFruitDataByAoa1();

              const worksheetByAoa = xlsx.utils.aoa_to_sheet(dataByAoa);

              xlsx.utils.book_append_sheet(book, worksheetByAoa, "DailyInspection");

              xlsx.writeFile(book, "DailyInspection.xlsx");
            },
            getFruitDataByAoa1() {
              let arr = [];
              arr.push([
                "Equipmentcode",
                 "InspectionDay",
                 "checklist",
                 "Checkcontent",
                 "Checkresults",
                 "Checker",
                 "note",
              ]);
              for (let index = 0; index < this.daydatas.length + 1; index++) {
                arr.push([
                  this.daydatas[index].Machinecd,
                  this.daydatas[index].Checkdt,
                  this.daydatas[index].CheckItem,
                  this.daydatas[index].CheckPart,
                  this.daydatas[index].CheckResult,
                  this.daydatas[index].CheckUser,
                  this.daydatas[index].Remark,
                ]);
                console.log("go");
              }
              console.log("gogo");

              return arr;
            },
    }

The for statement does not return. Only 'gogo' is printed. Is it wrong to add an excel table like this? xlsx was used.

If you put 0 instead of 'index', one line will be printed.
Any code will not work if you put it inside a for statement. Why is the for statement not working?


问:
2 subdomain doesn't support HSTS
My website is hosted on Magento and I am using SEMRush to track any server and programming issues.

My SEMRush found this error when I run it. This is the website: www.permagard.co.uk

Could someone help me on this please? I really don't know how to proceed!

Thank you!

To be honest, I think is due to a "no-www" to "www" redirection and "http" to "https" redirection but I am not sure at all on how to sort the issues out.

Title: 2 subdomain doesn't support HSTS


问:
Flutter : build apk failed : si_signo=Segmentation error
Facing this below error when I try to build apk in release mode using flutter build apk --release.

Error I am facing

Output of flutter doctor -v is as below:
Flutter Doctor command output

I tried following things:

Updated mc os to latest (Ventura - 13.1)

Upgraded flutter Sdk to the latest (3.3.10)

All pub packages updated to latest possible as per env.

Tried with new keystore (just in case something went wrong in previous one).

Tried with switching flutter channel (stable -> master -> stable) but no luck.


问:
Spring Batch JdbcPagingItemReader not fetching all records from DB
Spring Batch  JdbcPagingItemReader not fetching all records from DB.

As in Our database we dont have primary key. so it not fetching all records. Without primary we are losing data. So we are trying to sort  column with combination of 3 columns to make it primary..

```<code>   // Here X, Y, Z are column name for reference.

   JdbcPagingItemReader<Student> jdbcPagingItemReader=new JdbcPagingItemReader<>();
    jdbcPagingItemReader.setDataSource(dataSource);
    Map<String, Order> map = new HashMap<>();
    map.put("x", Order.ASCENDING);
    map.put("y", Order.ASCENDING);
    map.put("z", Order.ASCENDING);
    final SqlPagingQueryProviderFactoryBean queryProvider = new SqlPagingQueryProviderFactoryBean();
    queryProvider.setDataSource(dataSource);
    queryProvider.setSelectClause("SELECT * ");
    queryProvider.setFromClause("FROM Student");
</code>```

By that way its taking time to run that query. and inserting records as well.

Suggest if we have any alternate for same.

Body:
Spring Batch  JdbcPagingItemReader not fetching all records from DB.

As in Our database we dont have primary key. so it not fetching all records. Without primary we are losing data. So we are trying to sort  column with combination of 3 columns to make it primary..

   // Here X, Y, Z are column name for reference.

   JdbcPagingItemReader<Student> jdbcPagingItemReader=new JdbcPagingItemReader<>();
    jdbcPagingItemReader.setDataSource(dataSource);
    Map<String, Order> map = new HashMap<>();
    map.put("x", Order.ASCENDING);
    map.put("y", Order.ASCENDING);
    map.put("z", Order.ASCENDING);
    final SqlPagingQueryProviderFactoryBean queryProvider = new SqlPagingQueryProviderFactoryBean();
    queryProvider.setDataSource(dataSource);
    queryProvider.setSelectClause("SELECT * ");
    queryProvider.setFromClause("FROM Student");

By that way its taking time to run that query. and inserting records as well.

Suggest if we have any alternate for same.


问:
NgxPubSubModule for angular 14 typescript
I have implemented NgxPubSubModule in my project but it was not accepted by NgModule imports.

I am getting this error while I import NgxPubSubModule.

'NgxPubSubModule' does not appear to be an NgModule class.(-996002)

ngx-pub-sub.module.d.ts(1, 22): This likely means that the library (@pscoped/ngx-pub-sub) which declares NgxPubSubModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also, consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

What is the solution to this problem


问:
Prevent multiple booking for same staff in microsoft booking for same time slot
i want to Prevent multiple booking for same staff in microsoft booking .like right now multiple booking are getting created for same time slot

I tried following

in the service section - assign buffer to 1 hour before and after

in availability option -general availability -  set bookable when staff are free

also its suggested to add 365 group and ad staff in it . but right now I don't have access to it .