问:
FileNotFoundError: [Errno 2] No such file or directory: 'hadoop'
I am currently trying to set up a Mlflow tracking server with a HDFS artifact store. However when I try to log a model to the HDFS in Jupyter Notebook, I receive this error:

```<code>File /usr/lib/python3.10/subprocess.py:1845, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, gid, gids, uid, umask, start_new_session)
   1843     if errno_num != 0:
   1844         err_msg = os.strerror(errno_num)
-> 1845     raise child_exception_type(errno_num, err_msg, err_filename)
   1846 raise child_exception_type(err_msg)

FileNotFoundError: [Errno 2] No such file or directory: 'hadoop'
</code>```

I have hadoop installed and configured and I believe my environment variables are set up correctly as well. They are shown here:

```<code>export PATH="/home/auto/miniconda/bin:$PATH"

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

export HADOOP_HOME=/home/auto/hadoop-3.3.4

export HADOOP_INSTALL=$HADOOP_HOME

export HADOOP_MAPRED_HOME=$HADOOP_HOME

export HADOOP_COMMON_HOME=$HADOOP_HOME

export HADOOP_HDFS_HOME=$HADOOP_HOME

export YARN_HOME=$HADOOP_HOME

export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native

export PATH=$PATH:$HADOOP_HOME/sbin:$HADOOP_HOME/bin
</code>```

Any ideas on why this is happening?

Edit: Environment Variables used by Jupyter:

```<code>SHELL=/bin/bash
SESSION_MANAGER=local/auto-virtual-machine:@/tmp/.ICE-unix/1684,unix/auto-virtual-machine:/tmp/.ICE-unix/1684
QT_ACCESSIBILITY=1
COLORTERM=truecolor
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
SSH_AGENT_LAUNCHER=gnome-keyring
XDG_MENU_PREFIX=gnome-
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
GNOME_SHELL_SESSION_MODE=ubuntu
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
XMODIFIERS=@im=ibus
DESKTOP_SESSION=ubuntu
GTK_MODULES=gail:atk-bridge
DBUS_STARTER_BUS_TYPE=session
PWD=/home/auto/test
LOGNAME=auto
XDG_SESSION_DESKTOP=ubuntu
XDG_SESSION_TYPE=wayland
JPY_SESSION_NAME=MLflow Live Demo.ipynb
SYSTEMD_EXEC_PID=1684
_=/usr/bin/env
XAUTHORITY=/run/user/1000/.mutter-Xwaylandauth.6CXZW1
HOME=/home/auto
USERNAME=auto
IM_CONFIG_PHASE=1
LANG=en_US.UTF-8
XDG_CURRENT_DESKTOP=ubuntu:GNOME
VTE_VERSION=6800
WAYLAND_DISPLAY=wayland-0
GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/534f59fb_c9a6_456a_a38d_0f37b80cf726
CLICOLOR=1
GNOME_SETUP_DISPLAY=:1
JPY_PARENT_PID=15426
KMP_DUPLICATE_LIB_OK=True
KMP_INIT_AT_FORK=FALSE
XDG_SESSION_CLASS=user
TERM=xterm-color
USER=auto
GIT_PAGER=cat
GNOME_TERMINAL_SERVICE=:1.188
DISPLAY=:0
SHLVL=0
PAGER=cat
QT_IM_MODULE=ibus
DBUS_STARTER_ADDRESS=unix:path=/run/user/1000/bus,guid=abe24557a2edb707c37a5e24639b3f1d
MPLBACKEND=module://matplotlib_inline.backend_inline
XDG_RUNTIME_DIR=/run/user/1000
XDG_DATA_DIRS=/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
GDMSESSION=ubuntu
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus,guid=abe24557a2edb707c37a5e24639b3f1d

</code>```

Body:
I am currently trying to set up a Mlflow tracking server with a HDFS artifact store. However when I try to log a model to the HDFS in Jupyter Notebook, I receive this error:

File /usr/lib/python3.10/subprocess.py:1845, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, gid, gids, uid, umask, start_new_session)
   1843     if errno_num != 0:
   1844         err_msg = os.strerror(errno_num)
-> 1845     raise child_exception_type(errno_num, err_msg, err_filename)
   1846 raise child_exception_type(err_msg)

FileNotFoundError: [Errno 2] No such file or directory: 'hadoop'

I have hadoop installed and configured and I believe my environment variables are set up correctly as well. They are shown here:

export PATH="/home/auto/miniconda/bin:$PATH"

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

export HADOOP_HOME=/home/auto/hadoop-3.3.4

export HADOOP_INSTALL=$HADOOP_HOME

export HADOOP_MAPRED_HOME=$HADOOP_HOME

export HADOOP_COMMON_HOME=$HADOOP_HOME

export HADOOP_HDFS_HOME=$HADOOP_HOME

export YARN_HOME=$HADOOP_HOME

export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native

export PATH=$PATH:$HADOOP_HOME/sbin:$HADOOP_HOME/bin

Any ideas on why this is happening?

Edit: Environment Variables used by Jupyter:

SHELL=/bin/bash
SESSION_MANAGER=local/auto-virtual-machine:@/tmp/.ICE-unix/1684,unix/auto-virtual-machine:/tmp/.ICE-unix/1684
QT_ACCESSIBILITY=1
COLORTERM=truecolor
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
SSH_AGENT_LAUNCHER=gnome-keyring
XDG_MENU_PREFIX=gnome-
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
GNOME_SHELL_SESSION_MODE=ubuntu
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
XMODIFIERS=@im=ibus
DESKTOP_SESSION=ubuntu
GTK_MODULES=gail:atk-bridge
DBUS_STARTER_BUS_TYPE=session
PWD=/home/auto/test
LOGNAME=auto
XDG_SESSION_DESKTOP=ubuntu
XDG_SESSION_TYPE=wayland
JPY_SESSION_NAME=MLflow Live Demo.ipynb
SYSTEMD_EXEC_PID=1684
_=/usr/bin/env
XAUTHORITY=/run/user/1000/.mutter-Xwaylandauth.6CXZW1
HOME=/home/auto
USERNAME=auto
IM_CONFIG_PHASE=1
LANG=en_US.UTF-8
XDG_CURRENT_DESKTOP=ubuntu:GNOME
VTE_VERSION=6800
WAYLAND_DISPLAY=wayland-0
GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/534f59fb_c9a6_456a_a38d_0f37b80cf726
CLICOLOR=1
GNOME_SETUP_DISPLAY=:1
JPY_PARENT_PID=15426
KMP_DUPLICATE_LIB_OK=True
KMP_INIT_AT_FORK=FALSE
XDG_SESSION_CLASS=user
TERM=xterm-color
USER=auto
GIT_PAGER=cat
GNOME_TERMINAL_SERVICE=:1.188
DISPLAY=:0
SHLVL=0
PAGER=cat
QT_IM_MODULE=ibus
DBUS_STARTER_ADDRESS=unix:path=/run/user/1000/bus,guid=abe24557a2edb707c37a5e24639b3f1d
MPLBACKEND=module://matplotlib_inline.backend_inline
XDG_RUNTIME_DIR=/run/user/1000
XDG_DATA_DIRS=/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
GDMSESSION=ubuntu
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus,guid=abe24557a2edb707c37a5e24639b3f1d


来源: stackexchange

问:
How to Append matrices together in nalgebra Rust?
Suppose I have a matrix [[1,0],[0,1]] and [[2,0],[0,2]] I want to figure out a way to combine these 2 matrices into [[1,0,2,0],[0,1,0,2]]. I cannot find the appropriate constructor in the documentation: https://www.nalgebra.org/docs/user_guide/vectors_and_matrices/#matrix-construction
that will help me solve this problem.

I also tried firstly declaring an empty Dynamic matrix like DMatrix and then appending the rows using insert_row() but it seems that insert_row() can only be used to insert rows which are all just filled with the same constant number.

ContentLicense: CC BY-SA 4.0


问:
How to find the position of every word in a sentence(string) where the same word is used many times in a sentence using functions in python
how to find the position of every word in a sentence(string) where the same word is used more than 1 time using functions and input in python?

I am finding the position of one the word in the string but the position of the second is not appearing


问:
pandas read_csv() on_bad_lines not working with dtype
I notice on_bad_lines="skip" not working if dtype is also specified in read_csv. Is this expected?

```<code>$ cat abc.txt
ticker,qty
AAPL,100
TSLA,na

pd.read_csv("abc.txt", dtype={"qty":"int64"}, on_bad_lines="skip")
</code>```

pandas version: 1.5.1

Body:
I notice on_bad_lines="skip" not working if dtype is also specified in read_csv. Is this expected?

$ cat abc.txt
ticker,qty
AAPL,100
TSLA,na

pd.read_csv("abc.txt", dtype={"qty":"int64"}, on_bad_lines="skip")

pandas version: 1.5.1


问:
R package for survey raking that does automatic cell collapsing
I know there are various R packages for performing raking (i.e. calibration to external estimates, iterative proportional fitting, etc) to construct survey weights. I wanted to find a package that would automatically collapse cells if a cell count fell below a certain value. Is there a package out there with such a feature? Or if not raking exactly, a weighting package for a similar algorithm (e.g. GREG, entropy balancing) that would have such a feature for matchings to targets. Thank you.

Doing initial research, packages like "Ipfp: Multidimensional Iterative Proportional Fitting" didn't seems to have the feature I wanted.


问:
Merging datasets in R results in incomplete string values
I wanted to merge two datasets and the merging resulted in getting incomplete strings in a variable

```<code># Librerias
```{r}
library(dplyr)
library(tidyr)
library(tidyverse)
library(readxl)
library(readr)
library(base)
library(stringr)
library(foreign)
library(forcats)
library(fs)
library(hablar)
library(openxlsx)
```
# Comercio CIIU
```{r}
# Mercancias
Catalogo_comercio_CIIU <- read_excel("Comercio/Catalogo comercio bienes CIIU.xlsx") %>%
  mutate(ACTIV4=CIIU)

CIIU_Exportaciones <- read_excel("Comercio/CIIU Exportaciones.xlsx") %>%
  pivot_longer(cols = -...1, names_to = "Period", values_to = "Valor") %>%
  mutate(Flujo="Exportaciones")

CIIU_Importaciones <- read_excel("Comercio/CIIU Importaciones.xlsx") %>%
  pivot_longer(cols = -...1, names_to = "Period", values_to = "Valor") %>%
  mutate(Flujo="Importaciones")

Length<- CIIU_Exportaciones %>% group_by(...1) %>%
  summarise(Obs=n())
Length<- Length$Obs[[1]] %>%
  as.numeric() %>%
  as.vector()

# Mensual
Comercio_bienes_mensual <- rbind(CIIU_Importaciones, CIIU_Exportaciones) %>%
  rename(Actividad="...1") %>% group_by(Flujo, Actividad) %>%
  mutate(Fecha=seq(from=as.Date("1994-01-01"), by="month", length.out=Length)) %>%
  mutate(Year=str_sub(Fecha, 1L,4L), Mes=str_sub(Fecha, 6L,7L)) %>%
  group_by(Flujo, Actividad, Year) %>%
  mutate(Acumulado=cumsum(Valor)) %>%
  group_by(Flujo, Actividad) %>%
  mutate( C_acumulado= Acumulado-lag(Acumulado, n=12L), TC_acumulado=Acumulado/lag(Acumulado, n=12L)-1 ) %>%
  merge(Catalogo_comercio_CIIU,  by="Actividad") %>%
  select(-Grupo,-Detalle,-Categoria1,-Categoria2)
```
</code>```

This is the catalogue I want to merge

This is how the merging turned out (incomplete string)

I am a beginner so I don't really know what to try

Body:
I wanted to merge two datasets and the merging resulted in getting incomplete strings in a variable

# Librerias
```{r}
library(dplyr)
library(tidyr)
library(tidyverse)
library(readxl)
library(readr)
library(base)
library(stringr)
library(foreign)
library(forcats)
library(fs)
library(hablar)
library(openxlsx)
```
# Comercio CIIU
```{r}
# Mercancias
Catalogo_comercio_CIIU <- read_excel("Comercio/Catalogo comercio bienes CIIU.xlsx") %>%
  mutate(ACTIV4=CIIU)

CIIU_Exportaciones <- read_excel("Comercio/CIIU Exportaciones.xlsx") %>%
  pivot_longer(cols = -...1, names_to = "Period", values_to = "Valor") %>%
  mutate(Flujo="Exportaciones")

CIIU_Importaciones <- read_excel("Comercio/CIIU Importaciones.xlsx") %>%
  pivot_longer(cols = -...1, names_to = "Period", values_to = "Valor") %>%
  mutate(Flujo="Importaciones")

Length<- CIIU_Exportaciones %>% group_by(...1) %>%
  summarise(Obs=n())
Length<- Length$Obs[[1]] %>%
  as.numeric() %>%
  as.vector()

# Mensual
Comercio_bienes_mensual <- rbind(CIIU_Importaciones, CIIU_Exportaciones) %>%
  rename(Actividad="...1") %>% group_by(Flujo, Actividad) %>%
  mutate(Fecha=seq(from=as.Date("1994-01-01"), by="month", length.out=Length)) %>%
  mutate(Year=str_sub(Fecha, 1L,4L), Mes=str_sub(Fecha, 6L,7L)) %>%
  group_by(Flujo, Actividad, Year) %>%
  mutate(Acumulado=cumsum(Valor)) %>%
  group_by(Flujo, Actividad) %>%
  mutate( C_acumulado= Acumulado-lag(Acumulado, n=12L), TC_acumulado=Acumulado/lag(Acumulado, n=12L)-1 ) %>%
  merge(Catalogo_comercio_CIIU,  by="Actividad") %>%
  select(-Grupo,-Detalle,-Categoria1,-Categoria2)
```

This is the catalogue I want to merge

This is how the merging turned out (incomplete string)

I am a beginner so I don't really know what to try


问:
(VBA - HTML) Extracting different tables from a html page which uses slide panel
I was able to use VBA to extract a table from HTML source.
My problem now is that I need the information for the next following two days. (Today(forecast) + Tomorrow + Day after tomorrow).

The data from the table change accordingly the slide panel above the table.
The issue is that I can not find a way with my limited knowledge to change the code for the next days and extract the tables.

```<code>I have noticed that the are few changes in the html code when I use the slide panel such as:<g transform="translate(120,0)" - Today forecast<g transform="translate(180,0)" - Tomorrow<g transform="translate(240,0)" - The day after tomorrow.
</code>```

Also few changes in some div tags and off course Table tag - but still same ID.

However, I have no idea how to link my VBA code with those changes and extract the information needed.
My code so far:

```<code>Dim HTMLDoc As New HTMLDocument
    Dim objTable As Object
    Dim lRow As Long
    Dim lngTable As Long
    Dim lngRow As Long
    Dim lngCol As Long
    Dim ActRw As Long
    Dim objIE As InternetExplorer
    Set objIE = New InternetExplorer
    objIE.navigate "https://fireweather.niwa.co.nz/region/Otago"
    objIE.Visible = True

    Do Until objIE.readyState = 4 And Not objIE.Busy
        DoEvents
    Loop
    Application.Wait (Now + TimeValue("0:00:06")) 'wait for java script to load
    HTMLDoc.body.innerHTML = objIE.document.body.innerHTML
    With HTMLDoc.body
        Set objTable = .getElementsByTagName("table")
        For lngTable = 0 To objTable.Length - 1
            For lngRow = 0 To objTable(lngTable).Rows.Length - 1
                For lngCol = 0 To objTable(lngTable).Rows(lngRow).Cells.Length - 1
                    ThisWorkbook.Sheets("Sheet1").Cells(ActRw + lngRow + 1, lngCol + 1) = objTable(lngTable).Rows(lngRow).Cells(lngCol).innerText
                Next lngCol
            Next lngRow
            ActRw = ActRw + objTable(lngTable).Rows.Length + 1
        Next lngTable
    End With
    Set objIE = New InternetExplorer
    objIE.navigate "https://fireweather.niwa.co.nz/region/Southland"

    Do Until objIE.readyState = 4 And Not objIE.Busy
        DoEvents
    Loop
    Application.Wait (Now + TimeValue("0:00:03")) 'wait for java script to load
    HTMLDoc.body.innerHTML = objIE.document.body.innerHTML
    With HTMLDoc.body
        Set objTable = .getElementsByTagName("table")
        For lngTable = 0 To objTable.Length - 1
            For lngRow = 0 To objTable(lngTable).Rows.Length - 1
                For lngCol = 0 To objTable(lngTable).Rows(lngRow).Cells.Length - 1
                    ThisWorkbook.Sheets("Sheet1").Cells(ActRw + lngRow + 1, lngCol + 1) = objTable(lngTable).Rows(lngRow).Cells(lngCol).innerText
                Next lngCol
            Next lngRow
            ActRw = ActRw + objTable(lngTable).Rows.Length + 1
        Next lngTable
    End With
    objIE.Quit
</code>```

Body:
I was able to use VBA to extract a table from HTML source.
My problem now is that I need the information for the next following two days. (Today(forecast) + Tomorrow + Day after tomorrow).

The data from the table change accordingly the slide panel above the table.
The issue is that I can not find a way with my limited knowledge to change the code for the next days and extract the tables.

I have noticed that the are few changes in the html code when I use the slide panel such as:<g transform="translate(120,0)" - Today forecast<g transform="translate(180,0)" - Tomorrow<g transform="translate(240,0)" - The day after tomorrow.

Also few changes in some div tags and off course Table tag - but still same ID.

However, I have no idea how to link my VBA code with those changes and extract the information needed.
My code so far:

Dim HTMLDoc As New HTMLDocument
    Dim objTable As Object
    Dim lRow As Long
    Dim lngTable As Long
    Dim lngRow As Long
    Dim lngCol As Long
    Dim ActRw As Long
    Dim objIE As InternetExplorer
    Set objIE = New InternetExplorer
    objIE.navigate "https://fireweather.niwa.co.nz/region/Otago"
    objIE.Visible = True

    Do Until objIE.readyState = 4 And Not objIE.Busy
        DoEvents
    Loop
    Application.Wait (Now + TimeValue("0:00:06")) 'wait for java script to load
    HTMLDoc.body.innerHTML = objIE.document.body.innerHTML
    With HTMLDoc.body
        Set objTable = .getElementsByTagName("table")
        For lngTable = 0 To objTable.Length - 1
            For lngRow = 0 To objTable(lngTable).Rows.Length - 1
                For lngCol = 0 To objTable(lngTable).Rows(lngRow).Cells.Length - 1
                    ThisWorkbook.Sheets("Sheet1").Cells(ActRw + lngRow + 1, lngCol + 1) = objTable(lngTable).Rows(lngRow).Cells(lngCol).innerText
                Next lngCol
            Next lngRow
            ActRw = ActRw + objTable(lngTable).Rows.Length + 1
        Next lngTable
    End With
    Set objIE = New InternetExplorer
    objIE.navigate "https://fireweather.niwa.co.nz/region/Southland"

    Do Until objIE.readyState = 4 And Not objIE.Busy
        DoEvents
    Loop
    Application.Wait (Now + TimeValue("0:00:03")) 'wait for java script to load
    HTMLDoc.body.innerHTML = objIE.document.body.innerHTML
    With HTMLDoc.body
        Set objTable = .getElementsByTagName("table")
        For lngTable = 0 To objTable.Length - 1
            For lngRow = 0 To objTable(lngTable).Rows.Length - 1
                For lngCol = 0 To objTable(lngTable).Rows(lngRow).Cells.Length - 1
                    ThisWorkbook.Sheets("Sheet1").Cells(ActRw + lngRow + 1, lngCol + 1) = objTable(lngTable).Rows(lngRow).Cells(lngCol).innerText
                Next lngCol
            Next lngRow
            ActRw = ActRw + objTable(lngTable).Rows.Length + 1
        Next lngTable
    End With
    objIE.Quit


问:
how to get fields from a superinterface of an interface in annotationprocessor
assume the following scenario:

i need to implement an an annotationprocessor in java, that generates a file for each
interface

annotated with @ToBeProcessed

```<code>@Target(ElementType.TYPE)
@Retention(RetentionPolicy.CLASS)
public @interface ToBeProcessed {
}
</code>```

i need to write all fields from the interface annotated with @InterestingField
to the generated file.

(including inherited fields)

```<code>@Target(ElementType.FIELD)
@Retention(RetentionPolicy.CLASS)
@Inherited
public @interface InterestingField {
  String someData()
}
</code>```

if i have the folowing interfaces

```<code>interface DefaultFields {
  @InterestingField(someData = "x")
  final String field1 = "field1 text";
}
</code>```

and

```<code>@ToBeProcessed
interface SomeInterface extends DefaultFields {
  @InterestingField(someData = "y")
  final String ownField = "ownField text";
}
</code>```

my goal is tol produce a file someinterface.txt with the following content:

```<code>ownField - y
field1 - x
</code>```

my problem is the linefield1 - x with the data from DefaultFields.

i get the interface DefaultFieldsfrom ((TypeElement) annotatedElement).getInterfaces(), but i will not get the annotated fields.

i think it would help to get a hint on "how to get get fields from DefaultFields-interface"
or - if it's not possible - a short explanation why?

Edit: that's why it worked with classes:

From JDK 11 Api-Specification of Inherited annotation:
Note that this meta-annotation type has no effect if the annotated type is used to annotate anything other than a class. Note also that this meta-annotation only causes annotations to be inherited from superclasses; annotations on implemented interfaces have no effect.

Body:
assume the following scenario:

i need to implement an an annotationprocessor in java, that generates a file for each
interface

annotated with @ToBeProcessed

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.CLASS)
public @interface ToBeProcessed {
}

i need to write all fields from the interface annotated with @InterestingField
to the generated file.

(including inherited fields)

@Target(ElementType.FIELD)
@Retention(RetentionPolicy.CLASS)
@Inherited
public @interface InterestingField {
  String someData()
}

if i have the folowing interfaces

interface DefaultFields {
  @InterestingField(someData = "x")
  final String field1 = "field1 text";
}

and

@ToBeProcessed
interface SomeInterface extends DefaultFields {
  @InterestingField(someData = "y")
  final String ownField = "ownField text";
}

my goal is tol produce a file someinterface.txt with the following content:

ownField - y
field1 - x

my problem is the linefield1 - x with the data from DefaultFields.

i get the interface DefaultFieldsfrom ((TypeElement) annotatedElement).getInterfaces(), but i will not get the annotated fields.

i think it would help to get a hint on "how to get get fields from DefaultFields-interface"
or - if it's not possible - a short explanation why?

Edit: that's why it worked with classes:

From JDK 11 Api-Specification of Inherited annotation:
Note that this meta-annotation type has no effect if the annotated type is used to annotate anything other than a class. Note also that this meta-annotation only causes annotations to be inherited from superclasses; annotations on implemented interfaces have no effect.


问:
Config changes not being picked up when running test coverage with Jest
I am looking for a way to exclude entire folders/files from my testing coverage with Jest. I have gone through the official Jest documentations several times, but have been unable to get it to work. I've come to the conclusion that maybe my jest.config.js isn't being picked up, because no matter what changes I make to the collectCoverageFrom or testPathIgnorePatterns fields, the test coverage return does not change, and it includes everything, even the things I am trying to exclude. Here is my test coverage script in the package.json:

```<code>"test-coverage": "npm test --config='jest.config.js' --coverage "
</code>```

and here is my jest.config.js:

```<code>module.exports = {
  roots: ['<rootDir>', '<rootDir>/src', '<rootDir>/tests'],
  testEnvironment: 'jsdom',
  testPathIgnorePatterns: ['/node_modules/'],
  collectCoverage: true,
  collectCoverageFrom: ['./src/**/*.{js, jsx}', '!**/node_modules/**', '!**/vendor/**'],
  coverageDirectory: './coverage',
}
</code>```

For the files I am excluding, I am just using this format: !src/folder/file.js as per the official jest
documentation.

Any help appreciated.

Things I did to troubleshoot:

I added the path to the Jest config into the test-coverage command, but that was unsuccessful.

I have set the  collectCoverage field above to true, no success.

I added the jest config to the actual package.json, but even that
did not change anything. Here is the format for it inside my
package.json:

```<code>"jest": {
   "roots": ["<rootDir>", "<rootDir>/src","<rootDir>/tests"],
   "testEnvironment": "jsdom",
   "testPathIgnorePatterns": ["/node_modules/"],
   "collectCoverage": true,
   "collectCoverageFrom": ["./src/**/*.{js,jsx}","!**/node_modules/**","!**/vendor/**"],
   "coverageDirectory": "./coverage"
}
</code>```

Body:
I am looking for a way to exclude entire folders/files from my testing coverage with Jest. I have gone through the official Jest documentations several times, but have been unable to get it to work. I've come to the conclusion that maybe my jest.config.js isn't being picked up, because no matter what changes I make to the collectCoverageFrom or testPathIgnorePatterns fields, the test coverage return does not change, and it includes everything, even the things I am trying to exclude. Here is my test coverage script in the package.json:

"test-coverage": "npm test --config='jest.config.js' --coverage "

and here is my jest.config.js:

module.exports = {
  roots: ['<rootDir>', '<rootDir>/src', '<rootDir>/tests'],
  testEnvironment: 'jsdom',
  testPathIgnorePatterns: ['/node_modules/'],
  collectCoverage: true,
  collectCoverageFrom: ['./src/**/*.{js, jsx}', '!**/node_modules/**', '!**/vendor/**'],
  coverageDirectory: './coverage',
}

For the files I am excluding, I am just using this format: !src/folder/file.js as per the official jest
documentation.

Any help appreciated.

Things I did to troubleshoot:

I added the path to the Jest config into the test-coverage command, but that was unsuccessful.

I have set the  collectCoverage field above to true, no success.

I added the jest config to the actual package.json, but even that
did not change anything. Here is the format for it inside my
package.json:

"jest": {
   "roots": ["<rootDir>", "<rootDir>/src","<rootDir>/tests"],
   "testEnvironment": "jsdom",
   "testPathIgnorePatterns": ["/node_modules/"],
   "collectCoverage": true,
   "collectCoverageFrom": ["./src/**/*.{js,jsx}","!**/node_modules/**","!**/vendor/**"],
   "coverageDirectory": "./coverage"
}


问:
VueJS Problem with DigitalPersona 4500 SDK import
I bought one digital persona 4500 and I want to know if it works with VueJs project ? If yes, can you let me know a tutorial where I can try to do it ?

I have an error on importing the Fingerprint module with VueJs. I am following this tutorial : https://hidglobal.github.io/digitalpersona-devices/tutorial.html . But i have an error with the import of websdk in one es5 bundles (VueJS). Why is that happening ?  This is the error : https://github.com/hidglobal/digitalpersona-devices/issues/4. But it doesnt solve the problem for now.

Here is the error :

Fyi :

I already added this to my index.html file :

I have tried all they say in the issue but nothing work.


问:
Hyperparameter tuning on Google's Vertex Vizier
I’m trying to do hyperparameter tuning on GCP’s Vertex AI Vizier, but I’m receiving some errors.
This is the following code I’m using:

```<code>def get_args():
  parser = argparse.ArgumentParser()
  parser.add_argument(
      "--learning_rate",
      required=True,
      type=float,
      help="learning_rate")
  parser.add_argument(
      "--num_units",
      required=True,
      type=int,
      help="number of units in last hidden layer")
  # args = parser.parse_args()
  args = parser.parse_args("")

  return args

def create_model(num_units, learning_rate):
  all_features = tf.keras.layers.concatenate(encoded_features)
  x = tf.keras.layers.Dense(32, activation="relu")(all_features)
  x = tf.keras.layers.Dense(num_units, activation="relu")(x)
  x = tf.keras.layers.Dropout(0.3)(x)
  output = tf.keras.layers.Dense(1)(x)
  model = tf.keras.Model(all_inputs, output)

  model.compile(optimizer=tf.keras.optimizers.Adam(learning_rate=learning_rate),
                loss=tf.keras.losses.BinaryCrossentropy(from_logits=True),
                metrics=["accuracy"])

  return model

def main():
  args = get_args()
  model = create_model(args.num_units, args.learning_rate)
  # tf.keras.utils.plot_model(model, show_shapes=True, rankdir="LR")
  history = model.fit(train_ds, epochs=NUM_EPOCHS, validation_data=val_ds)

  hp_metric = history.history['val_accuracy'][-1]

  hpt = hypertune.HyperTune()
  hpt.report_hyperparameter_tuning_metric(
      hyperparameter_metric_tag='accuracy',
      metric_value=hp_metric,
      global_step=NUM_EPOCHS)

if __name__ == "__main__":
  main()
</code>```

Dockerfile:

```<code>FROM gcr.io/deeplearning-platform-release/tf2-gpu.2-5
WORKDIR /
RUN pip install cloudml-hypertune pandas
COPY trainer /trainer
ENTRYPOINT ["python", "-m"]
</code>```

The error I’m receiving:
/opt/conda/bin/python: No module named --num_units=128

Do you have any idea how I can resolve this issue? I’m not sure if the error is related to the Dockerfile or due to the code. Thank you!

Body:
I’m trying to do hyperparameter tuning on GCP’s Vertex AI Vizier, but I’m receiving some errors.
This is the following code I’m using:

def get_args():
  parser = argparse.ArgumentParser()
  parser.add_argument(
      "--learning_rate",
      required=True,
      type=float,
      help="learning_rate")
  parser.add_argument(
      "--num_units",
      required=True,
      type=int,
      help="number of units in last hidden layer")
  # args = parser.parse_args()
  args = parser.parse_args("")

  return args

def create_model(num_units, learning_rate):
  all_features = tf.keras.layers.concatenate(encoded_features)
  x = tf.keras.layers.Dense(32, activation="relu")(all_features)
  x = tf.keras.layers.Dense(num_units, activation="relu")(x)
  x = tf.keras.layers.Dropout(0.3)(x)
  output = tf.keras.layers.Dense(1)(x)
  model = tf.keras.Model(all_inputs, output)

  model.compile(optimizer=tf.keras.optimizers.Adam(learning_rate=learning_rate),
                loss=tf.keras.losses.BinaryCrossentropy(from_logits=True),
                metrics=["accuracy"])

  return model

def main():
  args = get_args()
  model = create_model(args.num_units, args.learning_rate)
  # tf.keras.utils.plot_model(model, show_shapes=True, rankdir="LR")
  history = model.fit(train_ds, epochs=NUM_EPOCHS, validation_data=val_ds)

  hp_metric = history.history['val_accuracy'][-1]

  hpt = hypertune.HyperTune()
  hpt.report_hyperparameter_tuning_metric(
      hyperparameter_metric_tag='accuracy',
      metric_value=hp_metric,
      global_step=NUM_EPOCHS)

if __name__ == "__main__":
  main()

Dockerfile:

FROM gcr.io/deeplearning-platform-release/tf2-gpu.2-5
WORKDIR /
RUN pip install cloudml-hypertune pandas
COPY trainer /trainer
ENTRYPOINT ["python", "-m"]

The error I’m receiving:
/opt/conda/bin/python: No module named --num_units=128

Do you have any idea how I can resolve this issue? I’m not sure if the error is related to the Dockerfile or due to the code. Thank you!


问:
CSV file lines Date string changed when running My PowerShell script
i have this csv file.

```<code>"date","time","user","remip","srcip","action","dstip","service","dstintf"
"2022-12-13","04:09:38","was@sil.atlas.pk","10.10.50.182","","tunnel-up","","",""
"2022-12-13","04:09:38","was@sil.atlas.pk","10.10.50.182","","tunnel-up","","",""
"2022-12-13","04:09:38","was@sil.atlas.pk","","10.212.134.200","auth-logon","","",""
"2022-12-13","04:09:57","was@sil.atlas.pk","10.10.50.182","","tunnel-down","","",""
"2022-12-13","04:09:57","was@sil.atlas.pk","10.10.50.182","","tunnel-down","","",""
"2022-12-13","04:09:57","was@sil.atlas.pk","","10.212.134.200","auth-logout","","",""
"2022-12-13","04:09:57","was@sil.atlas.pk","10.10.50.182","","tunnel-down","","",""
</code>```

I want to calculate Time duration from my below mentioned PowerShell script, and the script is doing this task perfectly but as you can see My date entries got changed after calculations, i think this is because of date expression is applying on my entire csv lines, so is there any way to calculate only time duration without changing date entries? Any Help Please.

This is my script

```<code>$original_file = "F:\SIL\SILTempVPN\vpnlogs2.csv"
$destination_file = "F:\SIL\SILTempVPN\vpnlogs2.csv"
(Get-Content $original_file) | Foreach-Object {
    $_ -replace 'date','Date' `
       -replace 'dstintf','CompanyNetwork' `
       -replace 'user', 'VPNUserName' `
       -replace 'time', 'Time' `
       -replace 'srcip', 'VPNIPAssigned'`
       -replace 'tunnel-up', 'ITRC VPN User Connected'`
       -replace 'tunnel-Down', 'ITRC VPN User shutdown'`
       -replace 'action', 'VPNStatus'`
              -replace 'remip', 'RemoteIPofUser'
    } | Set-Content $destination_file

$csvdata = Get-Content -Path "F:\SIL\SILTempVPN\vpnlogs2.csv"                      |
           ConvertFrom-Csv                             |
           select @{Name="Time"; Expression={[DateTime] $_.time}},
                  RemoteIPofUser,
                  VPNIPAssigned,
                  VPNUserName,
                  VPNStatus,
                  CompanyNetwork,
                  dstip,
                  Service,
                  @{Name="TimeSpan"; Expression={""}}
$h = @{}
$csvdata | ForEach-Object {
  $key = $_.RemoteIPofUser + ';' + $_.VPNUserName;
  if ($_.VPNStatus -like '*connected') {
    $h[$key] = $_.time
    return
  }

  if ($h.ContainsKey($key) -and $_.VPNStatus -like '*shutdown') {
    $_.timespan = $_.time - $h[$key]
    $h.remove($key)
  }
}
$csvdata | export-csv -Path "F:\SIL\SILTempVPN\vpnlogs2.csv"

</code>```

Result in csv file with changed date

```<code>"Time","RemoteIPofUser","VPNIPAssigned","VPNUserName","VPNStatus","CompanyNetwork","dstip","service","TimeSpan"
"16-Dec-22 4:09:38 AM","10.10.50.182","","was@sil.atlas.pk","ITRC VPN User Connected","","","",""
"16-Dec-22 4:09:38 AM","","10.212.134.200","was@sil.atlas.pk","auth-logon","","","",""
"16-Dec-22 4:09:57 AM","10.10.50.182","","was@sil.atlas.pk","ITRC VPN User shutdown","","","","00:00:19"
"16-Dec-22 4:09:57 AM","","10.212.134.200","was@sil.atlas.pk","auth-logout","","","",""
"16-Dec-22 4:09:57 AM","10.10.50.182","","was@sil.atlas.pk","ITRC VPN User shutdown","","","",""

</code>```

Desired output is like this

```<code>"Time","RemoteIPofUser","VPNIPAssigned","VPNUserName","VPNStatus","CompanyNetwork","dstip","service","TimeSpan"
"13-Dec-22 4:09:38 AM","10.10.50.182","","was@sil.atlas.pk","ITRC VPN User Connected","","","",""
"13-Dec-22 4:09:38 AM","","10.212.134.200","was@sil.atlas.pk","auth-logon","","","",""
"13-Dec-22 4:09:57 AM","10.10.50.182","","was@sil.atlas.pk","ITRC VPN User shutdown","","","","00:00:19"
"13-Dec-22 4:09:57 AM","","10.212.134.200","was@sil.atlas.pk","auth-logout","","","",""
"13-Dec-22 4:09:57 AM","10.10.50.182","","was@sil.atlas.pk","ITRC VPN User shutdown","","","",""
</code>```

Body:
i have this csv file.

"date","time","user","remip","srcip","action","dstip","service","dstintf"
"2022-12-13","04:09:38","was@sil.atlas.pk","10.10.50.182","","tunnel-up","","",""
"2022-12-13","04:09:38","was@sil.atlas.pk","10.10.50.182","","tunnel-up","","",""
"2022-12-13","04:09:38","was@sil.atlas.pk","","10.212.134.200","auth-logon","","",""
"2022-12-13","04:09:57","was@sil.atlas.pk","10.10.50.182","","tunnel-down","","",""
"2022-12-13","04:09:57","was@sil.atlas.pk","10.10.50.182","","tunnel-down","","",""
"2022-12-13","04:09:57","was@sil.atlas.pk","","10.212.134.200","auth-logout","","",""
"2022-12-13","04:09:57","was@sil.atlas.pk","10.10.50.182","","tunnel-down","","",""

I want to calculate Time duration from my below mentioned PowerShell script, and the script is doing this task perfectly but as you can see My date entries got changed after calculations, i think this is because of date expression is applying on my entire csv lines, so is there any way to calculate only time duration without changing date entries? Any Help Please.

This is my script

$original_file = "F:\SIL\SILTempVPN\vpnlogs2.csv"
$destination_file = "F:\SIL\SILTempVPN\vpnlogs2.csv"
(Get-Content $original_file) | Foreach-Object {
    $_ -replace 'date','Date' `
       -replace 'dstintf','CompanyNetwork' `
       -replace 'user', 'VPNUserName' `
       -replace 'time', 'Time' `
       -replace 'srcip', 'VPNIPAssigned'`
       -replace 'tunnel-up', 'ITRC VPN User Connected'`
       -replace 'tunnel-Down', 'ITRC VPN User shutdown'`
       -replace 'action', 'VPNStatus'`
              -replace 'remip', 'RemoteIPofUser'
    } | Set-Content $destination_file

$csvdata = Get-Content -Path "F:\SIL\SILTempVPN\vpnlogs2.csv"                      |
           ConvertFrom-Csv                             |
           select @{Name="Time"; Expression={[DateTime] $_.time}},
                  RemoteIPofUser,
                  VPNIPAssigned,
                  VPNUserName,
                  VPNStatus,
                  CompanyNetwork,
                  dstip,
                  Service,
                  @{Name="TimeSpan"; Expression={""}}
$h = @{}
$csvdata | ForEach-Object {
  $key = $_.RemoteIPofUser + ';' + $_.VPNUserName;
  if ($_.VPNStatus -like '*connected') {
    $h[$key] = $_.time
    return
  }

  if ($h.ContainsKey($key) -and $_.VPNStatus -like '*shutdown') {
    $_.timespan = $_.time - $h[$key]
    $h.remove($key)
  }
}
$csvdata | export-csv -Path "F:\SIL\SILTempVPN\vpnlogs2.csv"

Result in csv file with changed date

"Time","RemoteIPofUser","VPNIPAssigned","VPNUserName","VPNStatus","CompanyNetwork","dstip","service","TimeSpan"
"16-Dec-22 4:09:38 AM","10.10.50.182","","was@sil.atlas.pk","ITRC VPN User Connected","","","",""
"16-Dec-22 4:09:38 AM","","10.212.134.200","was@sil.atlas.pk","auth-logon","","","",""
"16-Dec-22 4:09:57 AM","10.10.50.182","","was@sil.atlas.pk","ITRC VPN User shutdown","","","","00:00:19"
"16-Dec-22 4:09:57 AM","","10.212.134.200","was@sil.atlas.pk","auth-logout","","","",""
"16-Dec-22 4:09:57 AM","10.10.50.182","","was@sil.atlas.pk","ITRC VPN User shutdown","","","",""

Desired output is like this

"Time","RemoteIPofUser","VPNIPAssigned","VPNUserName","VPNStatus","CompanyNetwork","dstip","service","TimeSpan"
"13-Dec-22 4:09:38 AM","10.10.50.182","","was@sil.atlas.pk","ITRC VPN User Connected","","","",""
"13-Dec-22 4:09:38 AM","","10.212.134.200","was@sil.atlas.pk","auth-logon","","","",""
"13-Dec-22 4:09:57 AM","10.10.50.182","","was@sil.atlas.pk","ITRC VPN User shutdown","","","","00:00:19"
"13-Dec-22 4:09:57 AM","","10.212.134.200","was@sil.atlas.pk","auth-logout","","","",""
"13-Dec-22 4:09:57 AM","10.10.50.182","","was@sil.atlas.pk","ITRC VPN User shutdown","","","",""


问:
Correlation of parameters in a model
I would like to know if the parameters of my model are identifiable. Does a high correlation between parameters, which are shown as a result of fit, a sign of parameters unidentifiability?

```<code>[[Variables]]
    alpha:    3.63101902 +/- 0.42188236 (11.62%) (init = 5)
    beta:     2.79949195 +/- 0.54011517 (19.29%) (init = 4)
    l:        63.3138794 +/- 10.1429942 (16.02%) (init = 90)
    yoffset:  31.7523156 +/- 34.5025649 (108.66%) (init = 0.001902903)
[[Correlations]] (unreported correlations are < 0.100)
    C(beta, l)        = 0.999
    C(alpha, l)       = 0.987
    C(alpha, beta)    = 0.981
    C(beta, yoffset)  = -0.762
    C(l, yoffset)     = -0.735
    C(alpha, yoffset) = -0.625
</code>```

I don't know how to interpret these correlations, I'd be glad for your help!

Title: Correlation of parameters in a model

Body:
I would like to know if the parameters of my model are identifiable. Does a high correlation between parameters, which are shown as a result of fit, a sign of parameters unidentifiability?

[[Variables]]
    alpha:    3.63101902 +/- 0.42188236 (11.62%) (init = 5)
    beta:     2.79949195 +/- 0.54011517 (19.29%) (init = 4)
    l:        63.3138794 +/- 10.1429942 (16.02%) (init = 90)
    yoffset:  31.7523156 +/- 34.5025649 (108.66%) (init = 0.001902903)
[[Correlations]] (unreported correlations are < 0.100)
    C(beta, l)        = 0.999
    C(alpha, l)       = 0.987
    C(alpha, beta)    = 0.981
    C(beta, yoffset)  = -0.762
    C(l, yoffset)     = -0.735
    C(alpha, yoffset) = -0.625

I don't know how to interpret these correlations, I'd be glad for your help!


问:
JS modal did not pop onclick
i want open a JS modal on click of Delete button to ask "are you want to delete this record" then it has two button cancel and delete. when i click the delete button on category page it does not any pop us where as in console it throw an error categories:654 Uncaught TypeError: deleteConfirmation is not a function

Here is my code:

categories.blade.php file

```<code><tbody>
    @php
      $serial_no = ($categories->currentPage()-1)*$categories->perPage();
    @endphp
    @foreach ($categories as $category)
        <tr>
          <td>{{ ++$serial_no }}</td>
          <td>{{ $category->name }}</td>
          <td>{{ $category->slug }}</td>
           <td>
              <a class="text-info" style="margin: 0px 20px; " href="{{ route('admin/category.edit',['category_id'=>$category->id]) }}">Edit</a>
              <a class="text-danger" style="margin-left: 20px;" href="#" onclick="deleteConfirmation({{ $category->id }})">Delete</a>
           </td>
       </tr>
   @endforeach
</tbody>
</code>```

this is the modal code (in same page)

```<code><div class="modal" id="deleteConfirmation">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body pb-30 pt-30">
                <div class="row">
                    <div class="col-md-12 text-center">
                        <h4 class="pb-3">Are you sure want to delete record?</h4>
                        <button type="button" class="btn btn-secondary" data-bs-toggle="modal" data-bs-target="#deleteConfirmation">Cancel</button>
                        <button type="button" class="btn btn-danger">Delete</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</code>```

Js script(in same page)

```<code>@push('scripts')
    <script>
        function deleteConfirmation(id)
        {
            @this.set('category_id',id);
            $('#deleteConfirmation').modal('show');
        }
    </script>
@endpush
</code>```

Title: JS modal did not pop onclick

Body:
i want open a JS modal on click of Delete button to ask "are you want to delete this record" then it has two button cancel and delete. when i click the delete button on category page it does not any pop us where as in console it throw an error categories:654 Uncaught TypeError: deleteConfirmation is not a function

Here is my code:

categories.blade.php file

    @php
      $serial_no = ($categories->currentPage()-1)*$categories->perPage();
    @endphp
    @foreach ($categories as $category)

          {{ ++$serial_no }}
          {{ $category->name }}
          {{ $category->slug }}

              $category->id]) }}">Edit
              id }})">Delete

   @endforeach

this is the modal code (in same page)

Are you sure want to delete record?

                        <button type="button" class="btn btn-secondary" data-bs-toggle="modal" data-bs-target="#deleteConfirmation">Cancel</button>
                        <button type="button" class="btn btn-danger">Delete</button>

Js script(in same page)

@push('scripts')

@endpush


问:
Video not showing up on desktop
I have applied the css to the video but the video won't appear. Any help? I have received a cSpell error, I'm not sure if this affects the video showing up?</p>
```<code>import React from 'react'
import './HeroStyles.css'

import Video from '../../../assets/rnbbackground.mp4'

function Hero() {
    return (
        <div className='hero'>
            <video autoPlay loop muted id='video'>
                <source src={Video} type='video/mp4' />
            </video>
        </div>
    )
}

export default Hero
</code>```
```<code>css:

.hero{
    width: 100%;
    height: 100vh;
    color: #fff;
    position: relative;
}
</code>```

Title: Video not showing up on desktop

Body:
I have applied the css to the video but the video won't appear. Any help? I have received a cSpell error, I'm not sure if this affects the video showing up?

import React from 'react'
import './HeroStyles.css'

import Video from '../../../assets/rnbbackground.mp4'

function Hero() {
    return (

            <video autoPlay loop muted id='video'>
                <source src={Video} type='video/mp4' />
            </video>

    )
}

export default Hero

css:

.hero{
    width: 100%;
    height: 100vh;
    color: #fff;
    position: relative;
}


问:
How to create navigation like this with CSS/React Native?
I would like to create a navigation with CSS/styled components for React Native (so no all styling hacks and attributes will work) that looks simmmiliar to this one that the Google Tasks app uses, see this image.

What I mean is mostly the floating "+" button, the "cut off" section from the "div" bellow it and having shadow that matches correctly.

I'm really not sure how to accomplish this, especially the cut off section in a div. So, if anyone could point me in a direction then I should be fine. :)


问:
MariaDB LOAD XML much slower than MySQL
I am testing MariaDB for a possible replacement of a MySQL data warehouse.  This data warehouse is rebuilt nightly from a legacy database.

The basic process is to generate XML documents/files from the legacy database and then use DROP TABLE, create table from DDL, LOAD XML LOCAL INFILE 'xml file'.  A few of the XML files are 60-100 megabytes (about 300K rows).  On MySQL these tables take a couple minutes.  On MariaDB these tables take significantly longer (e.g. 83 megabyte XML file requires 16 minutes on MariaDB, MySQL less than 1 minute), and the times seem to grow exponentially with file size.

I have read and followed the KB topic How to Quickly Insert Data Into MariaDB and have tried the suggestions there with no real change.  Since the MariaDB tables are dropped and recreated immediately before the LOAD XML LOCAL INFILE, several performance improvements should be triggered.

I have not tried LOCK TABLE yet.

What can I try to improve performance?  Don't want to return to MySQL but this issue is a deal killer.

Environment is RHEL 8, MariaDB 10.5.16

Used DISABLE KEYS/LOAD.../ENABLE KEYS with no apparent benefit.

Increased max_allowed_packet_size with no effect.

Title: MariaDB LOAD XML much slower than MySQL


问:
Automate excel VBA execution in Sharepoint Online document library excel file
I have an excel file uploaded to Sharepoint Online document library.
The excel file has a VBA script to refresh (linked to Microsoft Query, pulling ERP data)
I need to automate the VBA refresh to occur on a daily basis at a set time of day

What's the best way to do this (task scheduler w/ Python, a pre-existing SPO tool, something else, etc)?  I'm a noob so if you can provide somewhat detailed instructions or point me to some that would be greatly appreciated!

I doubt it matters but the reason is b/c the file is published as a data source to Tableau and an answer will prevent someone from having to manually update the file every day

Thanks in advance

Haven't tried a lot.  Search engine results didn't provide an answer I could follow


问:
CKEditor 4 keeps class on toggle
I'm using a custom plugin for CKEDITOR4 that does the following:

    var pluginName = 'flowctrl';
    var style = new CKEDITOR.style({ element: 'pre', attributes: {'class: flow'}});
    editor.addCommand(pluginName , new CKEDITOR.styleCommand(style));

    editor.attachStyleStateChange(style, function (state){
        !editor.readOnly && editor.getCommand(pluginName).setState(state);
    });

    editor.ui.addButton('Flow_Control' {
    label: 'Flow Control',
    command: pluginName,
    toolbar: 'insert'
    });

```
<p>In short, it changes <code><p></code> block that the cursor is on to <code>``` and adds the class "flow"
Much like selecting "bold" for text, the button is pressed in while you're inside this ```</code> block.
When you toggle the button off, it changes the <code>``` back into
, however it retains the class "flow".

I'm fairly new to CKEDITOR, so I'm not sure what I'm missing in this context.

Any help is greatly appreciated.

Title: CKEditor 4 keeps class on toggle

Body:
I'm using a custom plugin for CKEDITOR4 that does the following:

    var pluginName = 'flowctrl';
    var style = new CKEDITOR.style({ element: 'pre', attributes: {'class: flow'}});
    editor.addCommand(pluginName , new CKEDITOR.styleCommand(style));

    editor.attachStyleStateChange(style, function (state){
        !editor.readOnly && editor.getCommand(pluginName).setState(state);
    });

    editor.ui.addButton('Flow_Control' {
    label: 'Flow Control',
    command: pluginName,
    toolbar: 'insert'
    });

In short, it changes
 block that the cursor is on to
 and adds the class "flow"
Much like selecting "bold" for text, the button is pressed in while you're inside this
 block.
When you toggle the button off, it changes the
 back into
, however it retains the class "flow".

I'm fairly new to CKEDITOR, so I'm not sure what I'm missing in this context.

Any help is greatly appreciated.


问:
Hi I'm trying to plot a spectrogram of an audio signal by using plt.imshow() in python
The instructions are to are specifically to chop the signal up into 500- sample long blocks, and compute the Fourier transform for each chunk. Plot a heatmap where the x axis corresponds to the index of the chunk, and the y values corresponds to frequencies, and the value at location x, y corresponds to the magnitude of the yth Fourier coefficient for the xth chunk.

It also says to take the log of each entry if the contrast is too low

I'm mostly unsure on how to obtain the X (the image data) should it just be the audio signal and I'm not certain on how to obtain the x and y arrays needed for imshow().

I attempted to divide the audio into blocks of sample size 500 and get the FFT for each

blocks = np.array_split(signal, len(signal)/500) # sample size of one block is 500 FT_blocks = [fft(block) for block in blocks]# list of FFT for each block f = fftfreq(t.size, t[1])

I also plotted a spectrogram using just using plt.specgram

plt.specgram(signal, Fs = s_r, xextent = (0, t_end))

s_r is the sample rate of the audio

enter image description here this is it here

I also got this message from python when plotting  it

```<code>/usr/lib/python3/dist-packages/matplotlib/axes/_axes.py:7747: RuntimeWarning: divide by zero encountered in log10
  Z = 10. * np.log10(spec)
</code>```

Body:
The instructions are to are specifically to chop the signal up into 500- sample long blocks, and compute the Fourier transform for each chunk. Plot a heatmap where the x axis corresponds to the index of the chunk, and the y values corresponds to frequencies, and the value at location x, y corresponds to the magnitude of the yth Fourier coefficient for the xth chunk.

It also says to take the log of each entry if the contrast is too low

I'm mostly unsure on how to obtain the X (the image data) should it just be the audio signal and I'm not certain on how to obtain the x and y arrays needed for imshow().

I attempted to divide the audio into blocks of sample size 500 and get the FFT for each

blocks = np.array_split(signal, len(signal)/500) # sample size of one block is 500 FT_blocks = [fft(block) for block in blocks]# list of FFT for each block f = fftfreq(t.size, t[1])

I also plotted a spectrogram using just using plt.specgram

plt.specgram(signal, Fs = s_r, xextent = (0, t_end))

s_r is the sample rate of the audio

enter image description here this is it here

I also got this message from python when plotting  it

/usr/lib/python3/dist-packages/matplotlib/axes/_axes.py:7747: RuntimeWarning: divide by zero encountered in log10
  Z = 10. * np.log10(spec)


问:
How to add docker volume for zipkin server
I'm trying to run Zipkin server with docker but how can I store the log files? or how can I store the volume? there is no clear documentation for that.

Docker command :

```<code>docker run -d  -p 9411:9411 openzipkin/zipkin
</code>```

Body:
I'm trying to run Zipkin server with docker but how can I store the log files? or how can I store the volume? there is no clear documentation for that.

Docker command :

docker run -d  -p 9411:9411 openzipkin/zipkin


问:
How can I set a CSS grid item to the height of an automatically wrapped repeating row?
I have a grid with a dynamically determined number of rows. I need one of the row items to act as a color mask and span the entire row, layered with the three other row items (columns). This item will either contain a child element of a specified width or will have its own width set dynamically to indicate progress. This is the goal:

How can I set height to that of the row? I'm specifically referring to .score-col here.

I'm working on top of Bootstrap 5, but I don't think that's terribly relevant to the question.

.grid {
  display: grid;
}

.grid.score-grid {
  grid-template-columns:
    [col-1] min-content
    [col-2] 1fr
    [col-3] min-content
    [col-4];
  column-gap: 0;
  row-gap: 0;
}

.score-grid .score-col {
  grid-column: col-1 / col-4;
  grid-row: 1 / span 1; /* <----------------------- NOT WORKING! */
  background: linear-gradient(
    to right,
    #fff 0%,
    rgba(182, 135, 16, 0.5) 100%
  );
  z-index: -1;
}

.grid-cols-3 {
  --bs-columns: 3;
}

.score-grid .g-col {
  border-top: 2px solid var(--bs-primary);
}

.score-grid .g-col:last-child,
.score-grid .g-col:nth-last-child(2),
.score-grid .g-col:nth-last-child(3) {
  border-bottom: 2px solid var(--bs-primary);
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">

<div class="score-grid grid grid-cols-3 m-4">
  <div class="score-col"></div>

  <div class="g-col display-6 px-3 text-center d-flex flex-column justify-content-center">Bob</div>

  <div class="g-col">
    <div class="pt-2 pb-1 border-bottom"><button type="button" class="ms-0 me-2 btn btn-primary">+1</button></div>
    <div class="pt-1 pb-2 tr-border-bottom"><span class="text-nowrap"><span class="position-relative score-badge fw-normal me-2
 cursor-pointer badge bg-secondary"><span>1</span></span>
      </span>
    </div>
  </div>

  <div class="g-col px-3 text-center d-flex flex-column justify-content-center"><span class="display-5">1</span></div>

  <div class="score-col"></div>

  <div class="g-col display-6 px-3 text-center d-flex flex-column justify-content-center">Bob</div>

  <div class="g-col">
    <div class="pt-2 pb-1 border-bottom"><button type="button" class="ms-0 me-2 btn btn-primary">+1</button></div>
    <div class="pt-1 pb-2 tr-border-bottom"><span class="text-nowrap"><span class="position-relative score-badge fw-normal me-2
 cursor-pointer badge bg-secondary"><span>1</span></span>
      </span>
    </div>
  </div>

  <div class="g-col px-3 text-center d-flex flex-column justify-content-center"><span class="display-5">1</span></div>
</div></code>```

Body:
I have a grid with a dynamically determined number of rows. I need one of the row items to act as a color mask and span the entire row, layered with the three other row items (columns). This item will either contain a child element of a specified width or will have its own width set dynamically to indicate progress. This is the goal:

How can I set height to that of the row? I'm specifically referring to .score-col here.

I'm working on top of Bootstrap 5, but I don't think that's terribly relevant to the question.

.grid {
  display: grid;
}

.grid.score-grid {
  grid-template-columns:
    [col-1] min-content
    [col-2] 1fr
    [col-3] min-content
    [col-4];
  column-gap: 0;
  row-gap: 0;
}

.score-grid .score-col {
  grid-column: col-1 / col-4;
  grid-row: 1 / span 1; /* <----------------------- NOT WORKING! */
  background: linear-gradient(
    to right,
    #fff 0%,
    rgba(182, 135, 16, 0.5) 100%
  );
  z-index: -1;
}

.grid-cols-3 {
  --bs-columns: 3;
}

.score-grid .g-col {
  border-top: 2px solid var(--bs-primary);
}

.score-grid .g-col:last-child,
.score-grid .g-col:nth-last-child(2),
.score-grid .g-col:nth-last-child(3) {
  border-bottom: 2px solid var(--bs-primary);
}

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">

Bob

<button type="button" class="ms-0 me-2 btn btn-primary">+1</button>

1

1

Bob

<button type="button" class="ms-0 me-2 btn btn-primary">+1</button>

1

1


问:
Customized Tailwind css Background Image not displaying upon deployment
I have customized Background Image in tailwind.config file and it displays on the local host as expected, however after I deployed the site on Github pages, the background image doesn't display.

Here is the code in the tailwind.config file.

```<code>   backgroundImage: {
        'heroMobileBg': "url('/public/images/bg-intro-mobile.svg')",
        'heroDesktopBg': "url('/public/images/bg-intro-desktop.svg')",
      },
</code>```

Here is where I used it.

```<code> <div class="bg-heroMobileBg bg-no-repeat bg-center bg-cover lg:bg-heroDesktopBg"></div>
</code>```

I tried using the arbitrary values but still couldn't display on deployment. using the dev tools, I could see the background image stated.

```<code>.bg-heroMobileBg {
    background-image: url(/public/images/bg-intro-mobile.svg);
}
</code>```

I can't seem to figure out what am missing, kindly help me.

Body:
I have customized Background Image in tailwind.config file and it displays on the local host as expected, however after I deployed the site on Github pages, the background image doesn't display.

Here is the code in the tailwind.config file.

   backgroundImage: {
        'heroMobileBg': "url('/public/images/bg-intro-mobile.svg')",
        'heroDesktopBg': "url('/public/images/bg-intro-desktop.svg')",
      },

Here is where I used it.

I tried using the arbitrary values but still couldn't display on deployment. using the dev tools, I could see the background image stated.

.bg-heroMobileBg {
    background-image: url(/public/images/bg-intro-mobile.svg);
}

I can't seem to figure out what am missing, kindly help me.


问:
Download all filters from SAP BOBJ report
We have a few BOBJ reports with a bunch of filters setup. Is there a way to download/export report filters from a SAP BOBJ report using UI or API?</p>


问:
Getting fields in ascending order from aggregation in watcher (Kibana)
I have a watcher for tracking high request time on my website urls, with the following request:

```<code>{
  "trigger": {
    "schedule": {
      "interval": "2m"
    }
  },
  "input": {
    "search": {
      "request": {
        "search_type": "query_then_fetch",
        "indices": [
          "nifi-*"
        ],
        "rest_total_hits_as_int": true,
        "body": {
          "size": 0,
          "query": {
            "bool": {
              "must": [
                {
                  "range": {
                    "@timestamp": {
                      "gte": "now-2m",
                      "lte": "now"
                    }
                  }
                },
                {
                  "query_string": {
                    "analyze_wildcard": true,
                    "fields": [ "hostnames"],
                    "query": "example.com"
                  }
                }
              ]
            }
          },
          "aggregations": {
            "hostnames": {
              "terms": {
                "field": "hostnames",
                "order": {
                  "request_time": "desc"
                }
              },
              "aggregations": {
                "request_time": {
                  "avg": {
                    "field": "request_time"
                  }
                },
                "avg_agg_pipe": {
                  "bucket_selector": {
                    "buckets_path": {
                      "request_time": "request_time"
                    },
                    "script": {
                      "lang": "expression",
                      "source": "request_time > 20"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "condition": {
    "script": {
      "source": "return ctx.payload.aggregations.hostnames.buckets.size() > 0",
      "lang": "painless"
    }
  },
  "actions": {
  ......
"""
{{#ctx.payload.aggregations.hostnames.buckets}}
hostnames: {{key}}
Time: {{request_time.value}} second
{{/ctx.payload.aggregations.hostnames.buckets}}
"""
      }
    }
  },
  "transform": {
    "script": {
      "source": """for (bucket in ctx.payload.aggregations.hostnames.buckets) {bucket.request_time.value = Math.round(bucket.request_time.value);} return ['aggregations': ctx.payload.aggregations]""",
      "lang": "painless"
    }
  }
}
</code>```

this is how it returns the result:

```<code>"result": {
    "execution_time": "2022-11-29T08:10:57.977Z",
    "execution_duration": 71,
    "input": {
      "type": "search",
      "status": "success",
      "payload": {
        "hits": {
          "hits": [],
          "total": 5744,
          "max_score": null
        },
        "took": 58,
        "timed_out": false,
        "aggregations": {
          "hostnames": {
            "doc_count_error_upper_bound": -1,
            "sum_other_doc_count": 5583,
            "buckets": [
              {
                "request_time": {
                  "value": 234
                },
                "doc_count": 4,
                "key": "test100.example.com"
              },
              {
                "request_time": {
                  "value": 15
                },
                "doc_count": 14,
                "key": "test11.example.com"
              },
              {
                "request_time": {
                  "value": 11
                },
                "doc_count": 11,
                "key": "test03.example.com"
              },
              {
                "request_time": {
                  "value": 8
                },
                "doc_count": 13,
                "key": "test21.example.com"
              }
            ]
          }
        }
      }
</code>```

structure of my documents in index

```<code>"_source": {
    "event": {},
    "body-request": "test",
    "type": "nifi",
    "req-uri": "/mydata/service/303dbs",
    "request_time": 34.03
    "hostnames": "test100.example.com"
    ....
"_source": {
    "event": {},
    "body-request": "testtest",
    "type": "nifi",
    "req-uri": "/mydata/test",
    "request_time": 201.34
    "hostnames": "test100.example.com"
    ....
"_source": {
    "event": {},
    "type": "nifi",
    "req-uri": "/topic/forum",
    "request_time": 20.03
    "hostnames" : "test100.example.com"
    ....

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

and I have a question:
how can I get for the "actions" section the top 5 "request_time" and "req-uri" fields that have a maximum response time within the time requested by the watcher

like this:

```<code>hostnames: test100.example.com

URI: /mydata/test
Time: 201.34

URI: /mydata/service/303dbs
Time: 34.03

URI: /topic/forum
Time: 20.03
...
</code>```

Body:
I have a watcher for tracking high request time on my website urls, with the following request:

{
  "trigger": {
    "schedule": {
      "interval": "2m"
    }
  },
  "input": {
    "search": {
      "request": {
        "search_type": "query_then_fetch",
        "indices": [
          "nifi-*"
        ],
        "rest_total_hits_as_int": true,
        "body": {
          "size": 0,
          "query": {
            "bool": {
              "must": [
                {
                  "range": {
                    "@timestamp": {
                      "gte": "now-2m",
                      "lte": "now"
                    }
                  }
                },
                {
                  "query_string": {
                    "analyze_wildcard": true,
                    "fields": [ "hostnames"],
                    "query": "example.com"
                  }
                }
              ]
            }
          },
          "aggregations": {
            "hostnames": {
              "terms": {
                "field": "hostnames",
                "order": {
                  "request_time": "desc"
                }
              },
              "aggregations": {
                "request_time": {
                  "avg": {
                    "field": "request_time"
                  }
                },
                "avg_agg_pipe": {
                  "bucket_selector": {
                    "buckets_path": {
                      "request_time": "request_time"
                    },
                    "script": {
                      "lang": "expression",
                      "source": "request_time > 20"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "condition": {
    "script": {
      "source": "return ctx.payload.aggregations.hostnames.buckets.size() > 0",
      "lang": "painless"
    }
  },
  "actions": {
  ......
"""
{{#ctx.payload.aggregations.hostnames.buckets}}
hostnames: {{key}}
Time: {{request_time.value}} second
{{/ctx.payload.aggregations.hostnames.buckets}}
"""
      }
    }
  },
  "transform": {
    "script": {
      "source": """for (bucket in ctx.payload.aggregations.hostnames.buckets) {bucket.request_time.value = Math.round(bucket.request_time.value);} return ['aggregations': ctx.payload.aggregations]""",
      "lang": "painless"
    }
  }
}

this is how it returns the result:

"result": {
    "execution_time": "2022-11-29T08:10:57.977Z",
    "execution_duration": 71,
    "input": {
      "type": "search",
      "status": "success",
      "payload": {
        "hits": {
          "hits": [],
          "total": 5744,
          "max_score": null
        },
        "took": 58,
        "timed_out": false,
        "aggregations": {
          "hostnames": {
            "doc_count_error_upper_bound": -1,
            "sum_other_doc_count": 5583,
            "buckets": [
              {
                "request_time": {
                  "value": 234
                },
                "doc_count": 4,
                "key": "test100.example.com"
              },
              {
                "request_time": {
                  "value": 15
                },
                "doc_count": 14,
                "key": "test11.example.com"
              },
              {
                "request_time": {
                  "value": 11
                },
                "doc_count": 11,
                "key": "test03.example.com"
              },
              {
                "request_time": {
                  "value": 8
                },
                "doc_count": 13,
                "key": "test21.example.com"
              }
            ]
          }
        }
      }

structure of my documents in index

"_source": {
    "event": {},
    "body-request": "test",
    "type": "nifi",
    "req-uri": "/mydata/service/303dbs",
    "request_time": 34.03
    "hostnames": "test100.example.com"
    ....
"_source": {
    "event": {},
    "body-request": "testtest",
    "type": "nifi",
    "req-uri": "/mydata/test",
    "request_time": 201.34
    "hostnames": "test100.example.com"
    ....
"_source": {
    "event": {},
    "type": "nifi",
    "req-uri": "/topic/forum",
    "request_time": 20.03
    "hostnames" : "test100.example.com"
    ....

.....

and I have a question:
how can I get for the "actions" section the top 5 "request_time" and "req-uri" fields that have a maximum response time within the time requested by the watcher

like this:

hostnames: test100.example.com

URI: /mydata/test
Time: 201.34

URI: /mydata/service/303dbs
Time: 34.03

URI: /topic/forum
Time: 20.03
...


问:
AWS SAM Docker - Set actual memory limit used for function invokation
I'm trying to launch a lambda function for local development inside a docker container using AWS SAM. The gotcha here is I'm running on a Macbook using a M1 chipset and I have a base container which must be executed on x86_64 chips (Oracle thick client requirement).

I was able to get the container to build using colima, and I have a default colima VM running as below:

```<code>PROFILE    STATUS     ARCH      CPUS    MEMORY    DISK     RUNTIME    ADDRESS
default    Running    x86_64    4       12GiB     60GiB    docker
</code>```

This looks good and I can startup and execute other containers as expected.

The problem I"m facing is when running a container through AWS SAM its failing with:

```<code>[ERROR] (rapid) Init failed error=Runtime exited with error: signal: illegal instruction (core dumped) InvokeID=
</code>```

Which looks to be related to not enough memory.

I'm launching this using a simple configure template.yml file of

AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31

Globals:
  Function:
    Timeout: 360
    Tracing: Active

Resources:
  Function:
    Type: AWS::Serverless::Function
    Properties:
      PackageType: Image
      Architectures:
        - x86_64

    Metadata:
      Dockerfile: Dockerfile.local
      DockerContext: .
```

I'm launching this through the Pycharm AWS Toolkit plugin. The question is how do I provide more memory to the container which is running the function?

I should note that this works flawlessly when running on a native x86_64 chip, and only uses about 1GB of memory.

I'm sure I've seen at one point in the AWS Documentation a Metadata.DockerArgs or something similar but I can no longer find reference to it in the documentation.

Body:
I'm trying to launch a lambda function for local development inside a docker container using AWS SAM. The gotcha here is I'm running on a Macbook using a M1 chipset and I have a base container which must be executed on x86_64 chips (Oracle thick client requirement).

I was able to get the container to build using colima, and I have a default colima VM running as below:

PROFILE    STATUS     ARCH      CPUS    MEMORY    DISK     RUNTIME    ADDRESS
default    Running    x86_64    4       12GiB     60GiB    docker

This looks good and I can startup and execute other containers as expected.

The problem I"m facing is when running a container through AWS SAM its failing with:

[ERROR] (rapid) Init failed error=Runtime exited with error: signal: illegal instruction (core dumped) InvokeID=

Which looks to be related to not enough memory.

I'm launching this using a simple configure template.yml file of

AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31

Globals:
  Function:
    Timeout: 360
    Tracing: Active

Resources:
  Function:
    Type: AWS::Serverless::Function
    Properties:
      PackageType: Image
      Architectures:
        - x86_64

    Metadata:
      Dockerfile: Dockerfile.local
      DockerContext: .

I'm launching this through the Pycharm AWS Toolkit plugin. The question is how do I provide more memory to the container which is running the function?

I should note that this works flawlessly when running on a native x86_64 chip, and only uses about 1GB of memory.

I'm sure I've seen at one point in the AWS Documentation a Metadata.DockerArgs or something similar but I can no longer find reference to it in the documentation.


问:
Store data as a reference field in firestore using the addDoc function
I'm currently building an expense-tracker app and I want the transactions collection to have a category field. The category field should be of type "reference" and it should refer to another collection "categories". I tried this, but when I use the addDoc function the field category is stored as a map. And to be honest: It makes sense based on my code, but I don't know how to fix it.

Does anyone know how i can change that code, so the category is stored as a reference field in the firestore database?

```<code>const transaction = { category: {}, description: "", date: "", price: 0, userId: null} as Transaction
</code>```
```<code>await addDoc(collection(db, "transactions"), {
    ...inputValues,
    category: {
        ...selectedOption
    },
    userId: user?.uid,
})
</code>```

Body:
I'm currently building an expense-tracker app and I want the transactions collection to have a category field. The category field should be of type "reference" and it should refer to another collection "categories". I tried this, but when I use the addDoc function the field category is stored as a map. And to be honest: It makes sense based on my code, but I don't know how to fix it.

Does anyone know how i can change that code, so the category is stored as a reference field in the firestore database?

const transaction = { category: {}, description: "", date: "", price: 0, userId: null} as Transaction

await addDoc(collection(db, "transactions"), {
    ...inputValues,
    category: {
        ...selectedOption
    },
    userId: user?.uid,
})


问:
Python Gevent is iterating over characters and not the full url
I'm new to gevent and i have a script which download images and read the urls from a excel file.
I would like to speed up the process and that's where i found gevent

But when i try to run my script it seems to iterate over the characters.
I randomly picked this image from wikimedia

Wikimedia link

Heres the code

```<code>from gevent import monkey; monkey.patch_all()
import requests
import pandas as pd

from gevent.pool import Pool
p = Pool(4)
path = input("drag in excelfor file-path':")
path = path[1:len(path)-1]
df = pd.read_excel(path, header=None, name=['name', 'url']).dropna(thresh=2)

for index, row in df.iterrows():

        url = row['url'].strip()

        r = p.map(requests.head,url)
        print(r)

</code>```

I have tried making the url as a string but no result.

but when i manually wrtoe the link it works, see below.

url = ['link']

Can you see what i am missing?

Body:
I'm new to gevent and i have a script which download images and read the urls from a excel file.
I would like to speed up the process and that's where i found gevent

But when i try to run my script it seems to iterate over the characters.
I randomly picked this image from wikimedia

Wikimedia link

Heres the code

from gevent import monkey; monkey.patch_all()
import requests
import pandas as pd

from gevent.pool import Pool
p = Pool(4)
path = input("drag in excelfor file-path':")
path = path[1:len(path)-1]
df = pd.read_excel(path, header=None, name=['name', 'url']).dropna(thresh=2)

for index, row in df.iterrows():

        url = row['url'].strip()

        r = p.map(requests.head,url)
        print(r)

I have tried making the url as a string but no result.

but when i manually wrtoe the link it works, see below.

url = ['link']

Can you see what i am missing?


问:
I am looking to create a pdf using latex but i couldn't position graphics correctly
I am trying to make a copy of the photo below using LaTeX but I don't know how to wrap images around a text; they always go to the middle

These are the two images:

```<code>\documentclass[9pt]{book}
\usepackage[9pt,article]{extsizes}
\usepackage[russian]{babel}
\usepackage{amssymb,amsmath,amsfonts}
\usepackage{mathtools}
\usepackage{fancyhdr}
\usepackage{textcomp,enumitem}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage[left=4.9cm,right=5.8cm,top=3cm,bottom=2cm,bindingoffset=0cm]{geometry}
\linespread{0.9}
\usepackage{ragged2e}
\usepackage{color}
\usepackage{graphics}
\usepackage{pgfplots}
\pagestyle{fancy}
\thispagestyle{empty}

\usepackage{wrapfig}

\begin{document}

\begin{flushleft}
\small{\bf 72 ]} \scriptsize{\hfill 7. НЕКОТОРЫЕ ГЕОМЕТРИЧЕСКИЕ ПРИЛОЖЕНИЯ \footnotesize\hfill 171}
\end{flushleft}
\   \indent Заметим, что изменение радиуса кривизны совсем не так наглядно, как изменение касательной. Рассмотрим линию, состоящую из отрезка \textit{АВ} пря- мой и дуги\textit{ ВС} окружности, касательной к отрезку в конце в (рис. 79). На участке\textit{ AB }радиус кривизны равен бесконечности, на участке жеn\textit{ВС}
\begin{wrapfigure}{r}{0.5\textwidth}
   \includegraphics[width=2cm]{photo1.PNG} \includegraphics[width=50pt]{Image-015_23_30_45.jpg}
\end{wrapfigure}

 он равен радиусу окружности r и, таким образом, в точке \textit{B} он терпит разрыв непрерывности, хотя при этом направление касательной ме- няется непрерывно. Этим обстоятель- ством объясняются толчки вагонов на поворотах. Допустим, что вели- чина скорости движения вагона остается неизменной. В этом случае, как известно из механики, сила будет направлена по нормали к траектории
и равна  $m \frac {v^2}R$ где м есть масса движущегося тела и R - радиус кривизны R траектории. Отсюда видно, что в точках разрыва непрерывности радиуса кривизны и сила будет претерпевать разрыв непрерывности, что и обуслов- ливает толчок.\\
\vskip\textbf{72. Асимптоти}
Перейдем теперь к изучению бесконечных ветвей кривой, на которых одна из координат х или у или обе вместе беспре\begin{wrapfigure}{l}{0.5\textwidth}
   \includegraphics[width=4cm]{latex firsr graphic.png}
\end{wrapfigure}дельно возрастают. Гипербола и па- рабола дают нам примеры кривых с беско- нечными ветвями.Асимптотой кривой с бесконечною ветвью называемся такая прямая, что расстояние точек кривой до этой пря- мой при беспредельном удалении по беско- нечной ветви стремится к нулю.

Покажем сначала, как находить асимпто- ты кривой, параллельные оси \textit{OY}. Уравне- ние такой асимптоты должно иметь вид:
\\
\vskip
\hspace*{6cm} $x=c,$ \\
  где с - постоянная, и в этом случае при движении по соответствую- щей бесконечной ветви с должно стремиться к с, а у - к бесконеч- ности (рис. 80). Мы получаем, таким образом, следующее правило. Все асимптомы кривой\\
  \hspace*{5cm} $y=f(x)$\\
  параллельные оси OY, можно получить, найдя ме значения x=c, при приближении к которым f(x) стремимся к бесконечности. Для исследования того, как расположена кривая относительно асимп- тоты, надо определить знак f(x) при стремлении х к с слева и справа. Перейдем теперь к нахождению асимптот, непараллельных оси OY. В этом случае уравнение асимптоты должно иметь вид\\
  \hspace*{5cm}
 \displaystyle $\eta =\S a+b $

\end{document}
</code>```

This is what a tried and the result should be like this

Body:
I am trying to make a copy of the photo below using LaTeX but I don't know how to wrap images around a text; they always go to the middle

These are the two images:

\documentclass[9pt]{book}
\usepackage[9pt,article]{extsizes}
\usepackage[russian]{babel}
\usepackage{amssymb,amsmath,amsfonts}
\usepackage{mathtools}
\usepackage{fancyhdr}
\usepackage{textcomp,enumitem}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage[left=4.9cm,right=5.8cm,top=3cm,bottom=2cm,bindingoffset=0cm]{geometry}
\linespread{0.9}
\usepackage{ragged2e}
\usepackage{color}
\usepackage{graphics}
\usepackage{pgfplots}
\pagestyle{fancy}
\thispagestyle{empty}

\usepackage{wrapfig}

\begin{document}

\begin{flushleft}
\small{\bf 72 ]} \scriptsize{\hfill 7. НЕКОТОРЫЕ ГЕОМЕТРИЧЕСКИЕ ПРИЛОЖЕНИЯ \footnotesize\hfill 171}
\end{flushleft}
\   \indent Заметим, что изменение радиуса кривизны совсем не так наглядно, как изменение касательной. Рассмотрим линию, состоящую из отрезка \textit{АВ} пря- мой и дуги\textit{ ВС} окружности, касательной к отрезку в конце в (рис. 79). На участке\textit{ AB }радиус кривизны равен бесконечности, на участке жеn\textit{ВС}
\begin{wrapfigure}{r}{0.5\textwidth}
   \includegraphics[width=2cm]{photo1.PNG} \includegraphics[width=50pt]{Image-015_23_30_45.jpg}
\end{wrapfigure}

 он равен радиусу окружности r и, таким образом, в точке \textit{B} он терпит разрыв непрерывности, хотя при этом направление касательной ме- няется непрерывно. Этим обстоятель- ством объясняются толчки вагонов на поворотах. Допустим, что вели- чина скорости движения вагона остается неизменной. В этом случае, как известно из механики, сила будет направлена по нормали к траектории
и равна  $m \frac {v^2}R$ где м есть масса движущегося тела и R - радиус кривизны R траектории. Отсюда видно, что в точках разрыва непрерывности радиуса кривизны и сила будет претерпевать разрыв непрерывности, что и обуслов- ливает толчок.\\
\vskip\textbf{72. Асимптоти}
Перейдем теперь к изучению бесконечных ветвей кривой, на которых одна из координат х или у или обе вместе беспре\begin{wrapfigure}{l}{0.5\textwidth}
   \includegraphics[width=4cm]{latex firsr graphic.png}
\end{wrapfigure}дельно возрастают. Гипербола и па- рабола дают нам примеры кривых с беско- нечными ветвями.Асимптотой кривой с бесконечною ветвью называемся такая прямая, что расстояние точек кривой до этой пря- мой при беспредельном удалении по беско- нечной ветви стремится к нулю.

Покажем сначала, как находить асимпто- ты кривой, параллельные оси \textit{OY}. Уравне- ние такой асимптоты должно иметь вид:
\\
\vskip
\hspace*{6cm} $x=c,$ \\
  где с - постоянная, и в этом случае при движении по соответствую- щей бесконечной ветви с должно стремиться к с, а у - к бесконеч- ности (рис. 80). Мы получаем, таким образом, следующее правило. Все асимптомы кривой\\
  \hspace*{5cm} $y=f(x)$\\
  параллельные оси OY, можно получить, найдя ме значения x=c, при приближении к которым f(x) стремимся к бесконечности. Для исследования того, как расположена кривая относительно асимп- тоты, надо определить знак f(x) при стремлении х к с слева и справа. Перейдем теперь к нахождению асимптот, непараллельных оси OY. В этом случае уравнение асимптоты должно иметь вид\\
  \hspace*{5cm}
 \displaystyle $\eta =\S a+b $

\end{document}

This is what a tried and the result should be like this


问:
How to Find the Average/Day/employee in MySQL
I've joined two tables.

I need the avg of the max number (or count) from the set_num per day per employee and display their supervisor as well. What i have so far....

```<code>SELECT e.supervisor, COUNT(s.set_num), e.employee
FROM sarav.employees e
JOIN sarav.set_count s
ON e.lis_login = s.login
group by e.employee
order by e.supervisor;
</code>```

This code gave me the supervisor's name, the count of their numbers total for the year, and the employee name. What I would like better is the average of their count per day per employee.

Here is some sample data that i would be working with (wink)

Employee    supervisor  login   date_set    set_num

Sam Smith   John Smith  ssmith  22-01-10    1

Sam Smith   John Smith  ssmith  22-01-10    2

Sam Smith   John Smith  ssmith  22-01-10    3

Sam Smith   John Smith  ssmith  22-01-10    4

Sam Smith   John Smith  ssmith  22-01-10    5

Sam Smith   John Smith  ssmith  22-01-10    6

Sam Smith   John Smith  ssmith  22-01-10    7

Sam Smith   John Smith  ssmith  22-01-10    8

Sam Smith   John Smith  ssmith  22-01-11    1

Sam Smith   John Smith  ssmith  22-01-11    2

Sam Smith   John Smith  ssmith  22-01-11    3

Sam Smith   John Smith  ssmith  22-01-11    4

Jane John   john smith  jjohn   22-05-08    1

Jane John   john smith  jjohn   22-05-08    2

Jane John   john smith  jjohn   22-05-08    3

Jane John   john smith  jjohn   22-05-08    4

Jane John   john smith  jjohn   22-05-08    5

Jane John   john smith  jjohn   22-05-08    6

Jane John   john smith  jjohn   22-05-08    7

Jane John   john smith  jjohn   22-05-09    1

Jane John   john smith  jjohn   22-05-09    2

Jane John   john smith  jjohn   22-05-09    3

Jane John   john smith  jjohn   22-05-09    4

Jane John   john smith  jjohn   22-05-09    5

Amy Joe     Scar Johan  ajoe    22-05-11    1

Amy Joe     Scar Johan  ajoe    22-05-11    2

Amy Joe     Scar Johan  ajoe    22-05-11    3

Amy Joe     Scar Johan  ajoe    22-05-14    1

Amy Joe     Scar Johan  ajoe    22-05-14    2

Amy Joe     Scar Johan  ajoe    22-05-14    3

Amy Joe     Scar Johan  ajoe    22-05-14    4

Result I'm trying to obtain:

Employee  Supervisor Login Avg_Set_Num_Day

Sam Smith John Smith ssmith   8.3

Jane John John Smith jjohn    5.2

Amy Joe   Scar Johan ajoe     6.5

Body:
I've joined two tables.

I need the avg of the max number (or count) from the set_num per day per employee and display their supervisor as well. What i have so far....

SELECT e.supervisor, COUNT(s.set_num), e.employee
FROM sarav.employees e
JOIN sarav.set_count s
ON e.lis_login = s.login
group by e.employee
order by e.supervisor;

This code gave me the supervisor's name, the count of their numbers total for the year, and the employee name. What I would like better is the average of their count per day per employee.

Here is some sample data that i would be working with (wink)

Employee    supervisor  login   date_set    set_num

Sam Smith   John Smith  ssmith  22-01-10    1

Sam Smith   John Smith  ssmith  22-01-10    2

Sam Smith   John Smith  ssmith  22-01-10    3

Sam Smith   John Smith  ssmith  22-01-10    4

Sam Smith   John Smith  ssmith  22-01-10    5

Sam Smith   John Smith  ssmith  22-01-10    6

Sam Smith   John Smith  ssmith  22-01-10    7

Sam Smith   John Smith  ssmith  22-01-10    8

Sam Smith   John Smith  ssmith  22-01-11    1

Sam Smith   John Smith  ssmith  22-01-11    2

Sam Smith   John Smith  ssmith  22-01-11    3

Sam Smith   John Smith  ssmith  22-01-11    4

Jane John   john smith  jjohn   22-05-08    1

Jane John   john smith  jjohn   22-05-08    2

Jane John   john smith  jjohn   22-05-08    3

Jane John   john smith  jjohn   22-05-08    4

Jane John   john smith  jjohn   22-05-08    5

Jane John   john smith  jjohn   22-05-08    6

Jane John   john smith  jjohn   22-05-08    7

Jane John   john smith  jjohn   22-05-09    1

Jane John   john smith  jjohn   22-05-09    2

Jane John   john smith  jjohn   22-05-09    3

Jane John   john smith  jjohn   22-05-09    4

Jane John   john smith  jjohn   22-05-09    5

Amy Joe     Scar Johan  ajoe    22-05-11    1

Amy Joe     Scar Johan  ajoe    22-05-11    2

Amy Joe     Scar Johan  ajoe    22-05-11    3

Amy Joe     Scar Johan  ajoe    22-05-14    1

Amy Joe     Scar Johan  ajoe    22-05-14    2

Amy Joe     Scar Johan  ajoe    22-05-14    3

Amy Joe     Scar Johan  ajoe    22-05-14    4

Result I'm trying to obtain:

Employee  Supervisor Login Avg_Set_Num_Day

Sam Smith John Smith ssmith   8.3

Jane John John Smith jjohn    5.2

Amy Joe   Scar Johan ajoe     6.5


问:
Python ftplib download the latest in date file from a directory
Hello I have this script to download a file from a directory:

```<code># Import Module
import ftplib

# Fill Required Information
HOSTNAME = "xxx"
USERNAME = "xxx"
PASSWORD = "xxx"

# Connect FTP Server
ftp_server = ftplib.FTP(HOSTNAME, USERNAME, PASSWORD)

# force UTF-8 encoding
ftp_server.encoding = "utf-8"

# Enter File Name with Extension
ftp_server.cwd('/Outbound/Inventory/')
filename = "gfg.txt"

# Write file in binary mode
with open(filename, "wb") as file:
    # Command for Downloading the file "RETR filename"
    ftp_server.retrbinary(f"RETR {filename}", file.write)

# Get list of files
ftp_server.dir()

# Display the content of downloaded file
file= open(filename, "r")
print('File Content:', file.read())

# Close the Connection
ftp_server.quit()
</code>```

I want to know how what can be change in code to download the latest file in date from that directory.

Thank you

Until now I just added the line ftp_server.cwd('/Outbound/Inventory/') to be able to download a specific file from a specific directory. Now I want to download the latest in date from that directory. Nothing done yet about that.

Body:
Hello I have this script to download a file from a directory:

# Import Module
import ftplib

# Fill Required Information
HOSTNAME = "xxx"
USERNAME = "xxx"
PASSWORD = "xxx"

# Connect FTP Server
ftp_server = ftplib.FTP(HOSTNAME, USERNAME, PASSWORD)

# force UTF-8 encoding
ftp_server.encoding = "utf-8"

# Enter File Name with Extension
ftp_server.cwd('/Outbound/Inventory/')
filename = "gfg.txt"

# Write file in binary mode
with open(filename, "wb") as file:
    # Command for Downloading the file "RETR filename"
    ftp_server.retrbinary(f"RETR {filename}", file.write)

# Get list of files
ftp_server.dir()

# Display the content of downloaded file
file= open(filename, "r")
print('File Content:', file.read())

# Close the Connection
ftp_server.quit()

I want to know how what can be change in code to download the latest file in date from that directory.

Thank you

Until now I just added the line ftp_server.cwd('/Outbound/Inventory/') to be able to download a specific file from a specific directory. Now I want to download the latest in date from that directory. Nothing done yet about that.


问:
React-Table, disable all checkboxes after checking first 5 checkboxes?
Using Indeterminate Checkboxes.I need to disable all the checkboxes dynamically when the threshold of selected checkboxes reaches to 5(any of the five in table).

```<code>function IndeterminateCheckbox({
  indeterminate,
  className = "",
  setActionsVisible,
  ...rest
}: { indeterminate?: boolean } & HTMLProps<HTMLInputElement>) {
  const ref = React.useRef<HTMLInputElement>(null!);

  React.useEffect(() => {
    if (typeof indeterminate === "boolean") {
      setActionsVisible(indeterminate)
      ref.current.indeterminate = !rest.checked && indeterminate;
    }
  }, [ref, indeterminate]);

  return (
    <input
      type="checkbox"
      ref={ref}
      className={className + " cursor-pointer"}
      {...rest}
    />
  );
}
</code>```

And the code/logic for column cell is,

```<code> cell: ({ row, getValue }) => {
              return (
                <div className="custom-checkbox">
                  <IndeterminateCheckbox
                    disabled={
                      row.getAllCells()[5].getValue() === "Cancelled"
                    }
                    {...{
                      checked:
                        row.getIsSelected() &&
                        row.getAllCells()[5].getValue() !== "Cancelled" &&
                        row.getAllCells()[5].getValue() !== "Completed" &&
                        row.getAllCells()[5].getValue() !== "Failed",
                      indeterminate: row.getIsSomeSelected(),
                      setActionsVisible: setActionsVisible,
                      onChange: row.getToggleSelectedHandler(),
                      className: "custom-control-input",
                    }}
                  />
                </div>
              );
            },
            footer: (props) => props.column.id,
</code>```

Can anybody suggest me where i am going wrong.? Thanks in Advance.

I am able to disable checkboxes on initial condition(eg. disabling all the checkboxes whose status is "Completed"). ButI need to disable all the checkboxes dynamically when the threshold of selected checkboxes reaches to 5.

Body:
Using Indeterminate Checkboxes.I need to disable all the checkboxes dynamically when the threshold of selected checkboxes reaches to 5(any of the five in table).

function IndeterminateCheckbox({
  indeterminate,
  className = "",
  setActionsVisible,
  ...rest
}: { indeterminate?: boolean } & HTMLProps<HTMLInputElement>) {
  const ref = React.useRef<HTMLInputElement>(null!);

  React.useEffect(() => {
    if (typeof indeterminate === "boolean") {
      setActionsVisible(indeterminate)
      ref.current.indeterminate = !rest.checked && indeterminate;
    }
  }, [ref, indeterminate]);

  return (
    <input
      type="checkbox"
      ref={ref}
      className={className + " cursor-pointer"}
      {...rest}
    />
  );
}

And the code/logic for column cell is,

 cell: ({ row, getValue }) => {
              return (

                  <IndeterminateCheckbox
                    disabled={
                      row.getAllCells()[5].getValue() === "Cancelled"
                    }
                    {...{
                      checked:
                        row.getIsSelected() &&
                        row.getAllCells()[5].getValue() !== "Cancelled" &&
                        row.getAllCells()[5].getValue() !== "Completed" &&
                        row.getAllCells()[5].getValue() !== "Failed",
                      indeterminate: row.getIsSomeSelected(),
                      setActionsVisible: setActionsVisible,
                      onChange: row.getToggleSelectedHandler(),
                      className: "custom-control-input",
                    }}
                  />

              );
            },
            footer: (props) => props.column.id,

Can anybody suggest me where i am going wrong.? Thanks in Advance.

I am able to disable checkboxes on initial condition(eg. disabling all the checkboxes whose status is "Completed"). ButI need to disable all the checkboxes dynamically when the threshold of selected checkboxes reaches to 5.


问:
Trying to add Emoji to Option in Discord.py
I'm trying to dynamically create our options menu in discord.py by iterating through a config.json file to create the options.  I have one of the keys as "emoji" : "" but when I try to assign it to a value in my function, I get the following error:

```<code>discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In components.0.components.0.options.0.emoji.name: Invalid emoji
In components.0.components.0.options.1.emoji.name: Invalid emoji
</code>```

Code where this is implemented here:

for i in config['login_info']:
     select.add_option(
         label=i["site"],
         emoji=i["emoji"],
         description=i["site"] + " Login"
     )
```

I expect the orange emoji to populate the emoji variable, but it doesn't

Body:
I'm trying to dynamically create our options menu in discord.py by iterating through a config.json file to create the options.  I have one of the keys as "emoji" : "" but when I try to assign it to a value in my function, I get the following error:

discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In components.0.components.0.options.0.emoji.name: Invalid emoji
In components.0.components.0.options.1.emoji.name: Invalid emoji

Code where this is implemented here:

for i in config['login_info']:
     select.add_option(
         label=i["site"],
         emoji=i["emoji"],
         description=i["site"] + " Login"
     )

I expect the orange emoji to populate the emoji variable, but it doesn't


问:
Redirect many urls ending with
can someone help me with the syntax:
I want to redirect all urls that end with
&filter-sort-order=desc to a single url

the full url is something like this:
https://www.example.com/page/4?post_type=property&s=2022&filter-sort-by=price

I can't find the correct syntax.

Title: Redirect many urls ending with


问:
Regex matching whole string except word
i need matching only this kind of string:

conductor.test.TASK.e44717f5-5194-4a5b-b96b-e23379280e3c

and this which contain word WORKFLOW needs to be skipped:

conductor.test.WORKFLOW.4255f737-d048-4877-9ace-2d1e6ed44912

i'm trying this \b(?:(?!WORKFLOW)\w)+.\b but it didn't match the first example

Title: Regex matching whole string except word


问:
Update help-block of non-modified Yii2 ActiveFields with AJAX validation
There is a case in my Yii2 ActiveForm (validated with AJAX) where the validation result for a field X depends on the value of another field Y.
My intention is to have the validation error help-block appearing only next to X. The problem is that when I modify field Y no update is taking place in regards to the help-block of X. It seems that only the modified field can have its help block updated via AJAX.
Is it possible to force update of all help-blocks in the form after AJAX validation?</p>


问:
Keras timeseriesgenerator deprecated
I'm doing a tutorial onusing keras and in the tutorial there is a funtion called timeseriesgenerator to split temporal data as follows:

enter image description here

But when importing timeseriesgenerator there is a warning that the function timeseriesgenerator will soon be deprecated and that it is advised to use tf.data.dataset instead. Question is how? I.e how do I rewrite the code

```<code>    `for i in TimeseriesGenerator(range(10),range(10),length=3,batch_size=1):
        print(i)``

    `(array([[0, 1, 2]]), array([3]))
    (array([[1, 2, 3]]), array([4]))
    (array([[2, 3, 4]]), array([5]))
    (array([[3, 4, 5]]), array([6]))
    (array([[4, 5, 6]]), array([7]))
    (array([[5, 6, 7]]), array([8]))
    (array([[6, 7, 8]]), array([9]))`

using tf.data.datasets instead?
And why did google choose to make a rather good function obsolete and straight forward complex?
</code>```

I tried this
` ds = Dataset.from_tensor_slices(range(10))

```<code># Apply the desired transformations
ds = ds.window(3, shift=1, drop_remainder=True)
ds = ds.flat_map(lambda x: x.batch(3))
</code>```

`

Iterate over the dataset and print the elements

 for i in ds.batch(1): print(i)

but it produces tf.Tensor([[0 1 2]], shape=(1, 3), dtype=int32)
`tf.Tensor([[1 2 3]], shape=(1, 3), dtype=int32)
tf.Tensor([[2 3 4]], shape=(1, 3), dtype=int32)
tf.Tensor([[3 4 5]], shape=(1, 3), dtype=int32)
tf.Tensor([[4 5 6]], shape=(1, 3), dtype=int32)
tf.Tensor([[5 6 7]], shape=(1, 3), dtype=int32)
tf.Tensor([[6 7 8]], shape=(1, 3), dtype=int32)
tf.Tensor([[7 8 9]], shape=(1, 3), dtype=int32)

```<code>Which is obviously missing the last column.
</code>```

Title: Keras timeseriesgenerator deprecated

Body:
I'm doing a tutorial onusing keras and in the tutorial there is a funtion called timeseriesgenerator to split temporal data as follows:

enter image description here

But when importing timeseriesgenerator there is a warning that the function timeseriesgenerator will soon be deprecated and that it is advised to use tf.data.dataset instead. Question is how? I.e how do I rewrite the code

    `for i in TimeseriesGenerator(range(10),range(10),length=3,batch_size=1):
        print(i)``

    `(array([[0, 1, 2]]), array([3]))
    (array([[1, 2, 3]]), array([4]))
    (array([[2, 3, 4]]), array([5]))
    (array([[3, 4, 5]]), array([6]))
    (array([[4, 5, 6]]), array([7]))
    (array([[5, 6, 7]]), array([8]))
    (array([[6, 7, 8]]), array([9]))`

using tf.data.datasets instead?
And why did google choose to make a rather good function obsolete and straight forward complex?

I tried this
` ds = Dataset.from_tensor_slices(range(10))

# Apply the desired transformations
ds = ds.window(3, shift=1, drop_remainder=True)
ds = ds.flat_map(lambda x: x.batch(3))

`

Iterate over the dataset and print the elements

 for i in ds.batch(1): print(i)

but it produces tf.Tensor([[0 1 2]], shape=(1, 3), dtype=int32)
`tf.Tensor([[1 2 3]], shape=(1, 3), dtype=int32)
tf.Tensor([[2 3 4]], shape=(1, 3), dtype=int32)
tf.Tensor([[3 4 5]], shape=(1, 3), dtype=int32)
tf.Tensor([[4 5 6]], shape=(1, 3), dtype=int32)
tf.Tensor([[5 6 7]], shape=(1, 3), dtype=int32)
tf.Tensor([[6 7 8]], shape=(1, 3), dtype=int32)
tf.Tensor([[7 8 9]], shape=(1, 3), dtype=int32)

Which is obviously missing the last column.