问:
Is it possible to sync secrets between Azure Key Vault and Kafka on HDinsight?
I currently have an application deployed on AKS, which produces to a Kafka topic, with Kafka deployed on HDinsight. I want to implement a SASL/OAUTHBEARER as the security mechanism.
However, I'd also like the secrets to be stored in Azure Key Vault (AKV).
Is it possible to sync the secrets store in AKV with Kafka on HDinsight?

I have not tried it yet as I didn't find any documentation online that would indicate its feasibility, hence looking for guidance on this issue.


来源: stackexchange

问:
Tab Color disorder and single click ripple effect disappears after I add active tabs
Here's my header copmponent where I try to apply active tabs effect, the text completely disappers.
Header.js

```<code>
import {
  AppBar,
  Toolbar,
  useScrollTrigger,
  Typography,
  Tabs,
  Tab,
  Button,
} from "@mui/material";
import DeveloperModeIcon from "@mui/icons-material/DeveloperMode";
import { Box } from "@mui/system";
import { styled } from "@mui/material/styles";
import { Link } from "react-router-dom";

const Header = () => {
  const [value, setValue] = useState(window.location.pathname);

  function ElevationScroll(props) {
    const { children } = props;

    const trigger = useScrollTrigger({
      disableHysteresis: true,
      threshold: 0,
    });

    return React.cloneElement(children, {
      elevation: trigger ? 4 : 0,
    });
  }

  const TabComponent = styled(Tab)(({ theme }) => ({
    fontWeight: 600,
    fontSize: "1rem",
    textTransform: "none",
    // color: theme.palette.common.white,
  }));

  const onTabChangeHandler = (event, newValue) => {
    setValue(newValue);
  };

  return (
    <React.Fragment>
      <ElevationScroll>
        <AppBar position="fixed">
          <Toolbar>
            <DeveloperModeIcon sx={{ fontSize: "3rem" }} />
            <Typography variant="h4">Lopxhan Development</Typography>
            <Tabs
              sx={{ marginLeft: "auto" }}
              value={value}
              onChange={onTabChangeHandler}
              aria-label="secondary tabs example"
            >
              <TabComponent label="Home" component={Link} to="/" value="/" />
              <TabComponent
                label="Services"
                component={Link}
                to="/services"
                value="/services"
                disableRipple
              />
              <TabComponent
                label="Projects"
                component={Link}
                to="/projects"
                value="/projects"
              />
              <TabComponent
                label="About Us"
                component={Link}
                to="/aboutus"
                value="/aboutus"
              />
              <TabComponent
                label="Conatct Us"
                component={Link}
                to="/contactus"
                value="/contactus"
              />
            </Tabs>
            <Button
              variant="contained"
              color="secondary"
              sx={{
                borderRadius: "50px",
                fontWeight: 600,
              }}
            >
              Get a Quote
            </Button>
          </Toolbar>
        </AppBar>
      </ElevationScroll>
      <Box
        sx={[
          (theme) => ({
            marginBottom: {
              ...theme.mixins.toolbar,
            },
          }),
        ]}
      />
    </React.Fragment>
  );
};

export default Header;
</code>```

Theme.js

```<code>
const arcBlue = "#0B72B9";
const arcOrange = "#e67700";
const arcGrey = "#868686";

export const appTheme = createTheme({
  palette: {
    common: {
      blue: arcBlue,
      orange: arcOrange,
      white: "#fff",
    },
    primary: {
      main: arcBlue,
    },
    secondary: {
      main: arcOrange,
    },
  },
});
</code>```

App.js

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

import { ThemeProvider } from "@mui/material/styles";

import Header from "./components/UI/Header";
import { appTheme } from "./components/UI/Theme";
import HomePage from "./components/pages/HomePage";
import ServicesPage from "./components/pages/ServicesPage";
import ProjectsPage from "./components/pages/ProjectsPage";
import GetAQuotePage from "./components/pages/GetAQuotePage";
import AboutUsPage from "./components/pages/AboutUsPage";
import ContactUsPage from "./components/pages/ContactUsPage";

function App() {
  return (
    <ThemeProvider theme={appTheme}>
      <Header />
      <Routes>
        <Route path="/" element={<HomePage />} />
        <Route path="/services" element={<ServicesPage />} />

        <Route path="/projects" element={<ProjectsPage />} />
        <Route path="/aboutus" element={<AboutUsPage />} />
        <Route path="/contactus" element={<ContactUsPage />} />
        <Route path="/getaquote" element={<GetAQuotePage />} />
      </Routes>
    </ThemeProvider>
  );
}

export default App;
</code>```

I tried applying textColor and indicatorColor to Tabs, and its kinda somehow shows the tab text but ripple effect changes to double click.  Also ripple effect on tab changes to double click as soon as I add active tab effect.

ContentLicense: CC BY-SA 4.0

Body:
Here's my header copmponent where I try to apply active tabs effect, the text completely disappers.
Header.js

import {
  AppBar,
  Toolbar,
  useScrollTrigger,
  Typography,
  Tabs,
  Tab,
  Button,
} from "@mui/material";
import DeveloperModeIcon from "@mui/icons-material/DeveloperMode";
import { Box } from "@mui/system";
import { styled } from "@mui/material/styles";
import { Link } from "react-router-dom";

const Header = () => {
  const [value, setValue] = useState(window.location.pathname);

  function ElevationScroll(props) {
    const { children } = props;

    const trigger = useScrollTrigger({
      disableHysteresis: true,
      threshold: 0,
    });

    return React.cloneElement(children, {
      elevation: trigger ? 4 : 0,
    });
  }

  const TabComponent = styled(Tab)(({ theme }) => ({
    fontWeight: 600,
    fontSize: "1rem",
    textTransform: "none",
    // color: theme.palette.common.white,
  }));

  const onTabChangeHandler = (event, newValue) => {
    setValue(newValue);
  };

  return (
    <React.Fragment>
      <ElevationScroll>
        <AppBar position="fixed">
          <Toolbar>
            <DeveloperModeIcon sx={{ fontSize: "3rem" }} />
            <Typography variant="h4">Lopxhan Development</Typography>
            <Tabs
              sx={{ marginLeft: "auto" }}
              value={value}
              onChange={onTabChangeHandler}
              aria-label="secondary tabs example"
            >
              <TabComponent label="Home" component={Link} to="/" value="/" />
              <TabComponent
                label="Services"
                component={Link}
                to="/services"
                value="/services"
                disableRipple
              />
              <TabComponent
                label="Projects"
                component={Link}
                to="/projects"
                value="/projects"
              />
              <TabComponent
                label="About Us"
                component={Link}
                to="/aboutus"
                value="/aboutus"
              />
              <TabComponent
                label="Conatct Us"
                component={Link}
                to="/contactus"
                value="/contactus"
              />
            </Tabs>
            <Button
              variant="contained"
              color="secondary"
              sx={{
                borderRadius: "50px",
                fontWeight: 600,
              }}
            >
              Get a Quote
            </Button>
          </Toolbar>
        </AppBar>
      </ElevationScroll>
      <Box
        sx={[
          (theme) => ({
            marginBottom: {
              ...theme.mixins.toolbar,
            },
          }),
        ]}
      />
    </React.Fragment>
  );
};

export default Header;

Theme.js

const arcBlue = "#0B72B9";
const arcOrange = "#e67700";
const arcGrey = "#868686";

export const appTheme = createTheme({
  palette: {
    common: {
      blue: arcBlue,
      orange: arcOrange,
      white: "#fff",
    },
    primary: {
      main: arcBlue,
    },
    secondary: {
      main: arcOrange,
    },
  },
});

App.js

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

import { ThemeProvider } from "@mui/material/styles";

import Header from "./components/UI/Header";
import { appTheme } from "./components/UI/Theme";
import HomePage from "./components/pages/HomePage";
import ServicesPage from "./components/pages/ServicesPage";
import ProjectsPage from "./components/pages/ProjectsPage";
import GetAQuotePage from "./components/pages/GetAQuotePage";
import AboutUsPage from "./components/pages/AboutUsPage";
import ContactUsPage from "./components/pages/ContactUsPage";

function App() {
  return (
    <ThemeProvider theme={appTheme}>

      <Routes>
        <Route path="/" element={<HomePage />} />
        <Route path="/services" element={<ServicesPage />} />

        <Route path="/projects" element={<ProjectsPage />} />
        <Route path="/aboutus" element={<AboutUsPage />} />
        <Route path="/contactus" element={<ContactUsPage />} />
        <Route path="/getaquote" element={<GetAQuotePage />} />
      </Routes>
    </ThemeProvider>
  );
}

export default App;

I tried applying textColor and indicatorColor to Tabs, and its kinda somehow shows the tab text but ripple effect changes to double click.  Also ripple effect on tab changes to double click as soon as I add active tab effect.


问:
Building breadcrumb using React Router V6.4
After reading docs about new implementation of v6.4, I came across this new useMatches hook.

I attempt to apply this on a project I'm currently working on and ended up with the following structure.

Routes

export const router = createBrowserRouter(
  createRoutesFromElements(
    <Route path="/" element={<RootLayout />}>
      <Route index element={<TopComponent />} />

      <Route
        path="path"
        element={<TopComponent />}
        handle={{
          crumb: () => <Link to="/path">path</Link>,
        }}
      >
        <Route
          path="path"
          element={<ChildComponent />}
          handle={{
            crumb: () => <Link to="path">Path</Link>,
          }}
        >
          <Route path=":ID" element={<DynamicComponent />}/>
        </Route>
        <Route
          path="path"
          element={<ChildComponent />}
          handle={{
            crumb: () => <Link to="path">Path</Link>,
          }}
        />
      </Route>
)
```
<ul>
<li><code>TopComponent</code>: Main single nav item</li>
<li><code>ParentComponent</code>: Nav item with sub-routes</li>
<li><code>ChildComponent</code>: Nested Component</li>
</ul>
<h2>Breadcrumb Component</h2>
<pre class="lang-js prettyprint-override"><code>import { useMatches } from "react-router-dom";

export function Breadcrumbs() {
  let matches = useMatches();
  let crumbs = matches
    // first get rid of any matches that don't have handle and crumb
    .filter((match) => Boolean(match.handle?.crumb))
    .map((match) => match.handle.crumb(match.data));

  const breadcrumbs = crumbs.map((crumb, ind) => {
    const notLast = ind < crumbs.length - 1;
    if (notLast) {
      return (
        <>
          <span className="name">{crumb}</span>
          <span className="arrow">></span>
        </>
      );
    } else {
      return <span className="name">{crumb}</span>;
    }
  });

  return <div>{breadcrumbs}</div>;
}
</code>```

Result

a tags that enables navigating on clicking

```<code>ParentComponent > ChildComponent
</code>```

Questions

Am I doing things right or there is a better way to construct this?

How to make this method work with dynamic routes?

Body:
After reading docs about new implementation of v6.4, I came across this new useMatches hook.

I attempt to apply this on a project I'm currently working on and ended up with the following structure.

Routes

export const router = createBrowserRouter(
  createRoutesFromElements(
    <Route path="/" element={<RootLayout />}>
      <Route index element={<TopComponent />} />

      <Route
        path="path"
        element={<TopComponent />}
        handle={{
          crumb: () => <Link to="/path">path</Link>,
        }}
      >
        <Route
          path="path"
          element={<ChildComponent />}
          handle={{
            crumb: () => <Link to="path">Path</Link>,
          }}
        >
          <Route path=":ID" element={<DynamicComponent />}/>
        </Route>
        <Route
          path="path"
          element={<ChildComponent />}
          handle={{
            crumb: () => <Link to="path">Path</Link>,
          }}
        />
      </Route>
)

TopComponent: Main single nav item

ParentComponent: Nav item with sub-routes

ChildComponent: Nested Component

Breadcrumb Component

import { useMatches } from "react-router-dom";

export function Breadcrumbs() {
  let matches = useMatches();
  let crumbs = matches
    // first get rid of any matches that don't have handle and crumb
    .filter((match) => Boolean(match.handle?.crumb))
    .map((match) => match.handle.crumb(match.data));

  const breadcrumbs = crumbs.map((crumb, ind) => {
    const notLast = ind < crumbs.length - 1;
    if (notLast) {
      return (
        <>
          {crumb}
          >
        </>
      );
    } else {
      return {crumb};
    }
  });

  return
{breadcrumbs}
;
}

Result

a tags that enables navigating on clicking

ParentComponent > ChildComponent

Questions

Am I doing things right or there is a better way to construct this?

How to make this method work with dynamic routes?


问:
When I click on QWebEngine ,Qt Designer crash
Qt Version :5.15.3

Windows Version:Windows 10 professional 64bit(10.0,19044)

GPU :NVDIA GeForce GT 1030

GPU Driver Version:31.0.15.1694

Qeustion:
When I clcick QWebEngineView Qt Desinger crash,
But I don't know how resulve this question.
thx

qt engine crashed


问:
Flutter Error at runningError in new project Error: Couldn't find constructor 'StandardMessageCodec'
I had these errors didn't upgrade to the new version  I even created a new project but I had the same error

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

: Error: Couldn't find constructor 'StandardMessageCodec'.
../…/services/restoration.dart:326

```<code>final ByteData encoded = const StandardMessageCodec().encodeMessage(data)!;
                               ^^^^^^^^^^^^^^^^^^^^
</code>```

: Error: Couldn't find constructor 'StandardMessageCodec'.
../…/services/restoration.dart:1007
const StandardMessageCodec().encodeMessage(object);
^^^^^^^^^^^^^^^^^^^^
: Error: Couldn't find constructor 'StandardMessageCodec'.
../…/rendering/binding.dart:365
args != null ? const StandardMessageCodec().decodeMessage(args) : null,
^^^^^^^^^^^^^^^^^^^^
2

FAILURE: Build failed with an exception.

Where:
Script '/Users/abdjalildanane/development/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1159

What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command '/Users/abdjalildanane/development/flutter/bin/flutter'' finished with non-zero exit value 1

Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

Get more help at https://help.gradle.org

BUILD FAILED in 21s
Exception: Gradle task assembleDebug failed with exit code 1

Body:
I had these errors didn't upgrade to the new version  I even created a new project but I had the same error

                 ^^^^^^^^^^^^^^^^^^^^

: Error: Couldn't find constructor 'StandardMessageCodec'.
../…/services/restoration.dart:326

final ByteData encoded = const StandardMessageCodec().encodeMessage(data)!;
                               ^^^^^^^^^^^^^^^^^^^^

: Error: Couldn't find constructor 'StandardMessageCodec'.
../…/services/restoration.dart:1007
const StandardMessageCodec().encodeMessage(object);
^^^^^^^^^^^^^^^^^^^^
: Error: Couldn't find constructor 'StandardMessageCodec'.
../…/rendering/binding.dart:365
args != null ? const StandardMessageCodec().decodeMessage(args) : null,
^^^^^^^^^^^^^^^^^^^^
2

FAILURE: Build failed with an exception.

Where:
Script '/Users/abdjalildanane/development/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1159

What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command '/Users/abdjalildanane/development/flutter/bin/flutter'' finished with non-zero exit value 1

Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

Get more help at https://help.gradle.org

BUILD FAILED in 21s
Exception: Gradle task assembleDebug failed with exit code 1


问:
How to deploy 2 CodeCommit repositories using CodeDeploy and CodePipeline with the same appspec.yml?
I have 3 CodeCommit repositories:

Repo 1: App A files

Repo 2: App B files

Repo 3: Some config files for apps A and B + appspec.yml

I would like to create 2 CodePipelines deploying my apps on an EC2. The first one taking Repo1 and Repo3 and then the second one taking Repo2 and Repo3. I want to use the same appspec.yml (because Repo 1 and 2 have the same tree structure and I don't want to duplicate appspec.yml and common config files from Repo3)

It seems like it's not possible to have 2 sources in CodePipeline if the next stage is CodeDeploy. So I decided to put Repo 3 as source and use a BeforeInstall script to git clone Repo 1 or Repo2 depending on the deployment group.

So my appspec.yml looks like that:

```<code>version: 0.0
os: linux
files:
  - source: config
    destination: /var/lib/app

hooks:
  BeforeInstall:
    - location: scripts/clone-repository.sh
</code>```

And then clone-repository.sh looks like so

```<code>yum install -y git

if [ "$DEPLOYMENT_GROUP_NAME" == "group1" ]
then
    git clone <Repo 1>
    mv to the right place
    etc
elif [ "$DEPLOYMENT_GROUP_NAME" == "group2" ]
then
    git clone <Repo 2>
    mv to the right place
    etc
</code>```

I was forced to install git otherwise I got an error. I also tried to add these lines

git config --global credential.helper '!aws codecommit credential-helper $@'

git config --global credential.UseHttpPath true

The CodeDeploy role has AWSCodeCommitPowerUser and AWSCodeDeployRole but impossible to git clone. I get the following error -> error: [stderr]: unable to access '': the requested URL returned error: 403

What's missing?

If you have another idea to solve my issue, I'll take it!

Thank you for you help!

Body:
I have 3 CodeCommit repositories:

Repo 1: App A files

Repo 2: App B files

Repo 3: Some config files for apps A and B + appspec.yml

I would like to create 2 CodePipelines deploying my apps on an EC2. The first one taking Repo1 and Repo3 and then the second one taking Repo2 and Repo3. I want to use the same appspec.yml (because Repo 1 and 2 have the same tree structure and I don't want to duplicate appspec.yml and common config files from Repo3)

It seems like it's not possible to have 2 sources in CodePipeline if the next stage is CodeDeploy. So I decided to put Repo 3 as source and use a BeforeInstall script to git clone Repo 1 or Repo2 depending on the deployment group.

So my appspec.yml looks like that:

version: 0.0
os: linux
files:
  - source: config
    destination: /var/lib/app

hooks:
  BeforeInstall:
    - location: scripts/clone-repository.sh

And then clone-repository.sh looks like so

yum install -y git

if [ "$DEPLOYMENT_GROUP_NAME" == "group1" ]
then
    git clone <Repo 1>
    mv to the right place
    etc
elif [ "$DEPLOYMENT_GROUP_NAME" == "group2" ]
then
    git clone <Repo 2>
    mv to the right place
    etc

I was forced to install git otherwise I got an error. I also tried to add these lines

git config --global credential.helper '!aws codecommit credential-helper $@'

git config --global credential.UseHttpPath true

The CodeDeploy role has AWSCodeCommitPowerUser and AWSCodeDeployRole but impossible to git clone. I get the following error -> error: [stderr]: unable to access '': the requested URL returned error: 403

What's missing?

If you have another idea to solve my issue, I'll take it!

Thank you for you help!


问:
MongoDB error when trying to connect to it
trying to get my code to connect to mongodb.

I have start mongo db compass, rund mongosh and mongod in cmd

add a new db to mongodb.
edit a new url to connect.

run npm start and get this and i dont connect to mongodb:

```<code>(node:14420) [MONGODB DRIVER] Warning: Current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version.
To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
    (Use `node --trace-warnings ...` to show where the warning was created)
</code>```

my db.ts

```<code>import { MongoClient } from 'mongodb';
// Connection URL
const url = 'mongodb://127.0.0.1:27017';

// Database Name
const dbName = 'xxxxx';

// Create a new MongoClient
export async function initMongo() {
  try {
    const client = new MongoClient(url,{ useNewUrlParser: true });
    await client.connect();
    const db = client.db(dbName);
</code>```

at the bottom of db

```<code>} catch (e) {
    console.log('Cannot connect to MongoDB. Will retry in 10 seconds ...');
    await new Promise<void>(resolve => {
      setTimeout(() => resolve(), 10000);
    });
    console.log('Retrying...');
    return await initMongo();
  }
</code>```

await client.connect
connect have a line right true.

Body:
trying to get my code to connect to mongodb.

I have start mongo db compass, rund mongosh and mongod in cmd

add a new db to mongodb.
edit a new url to connect.

run npm start and get this and i dont connect to mongodb:

(node:14420) [MONGODB DRIVER] Warning: Current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version.
To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
    (Use `node --trace-warnings ...` to show where the warning was created)

my db.ts

import { MongoClient } from 'mongodb';
// Connection URL
const url = 'mongodb://127.0.0.1:27017';

// Database Name
const dbName = 'xxxxx';

// Create a new MongoClient
export async function initMongo() {
  try {
    const client = new MongoClient(url,{ useNewUrlParser: true });
    await client.connect();
    const db = client.db(dbName);

at the bottom of db

} catch (e) {
    console.log('Cannot connect to MongoDB. Will retry in 10 seconds ...');
    await new Promise<void>(resolve => {
      setTimeout(() => resolve(), 10000);
    });
    console.log('Retrying...');
    return await initMongo();
  }

await client.connect
connect have a line right true.


问:
Use "ReturnType" for class property values of methods assigned in the constructor
Why can't I use ReturnType for class property values of methods assigned in the constructor?

Playground

```<code>export class ElementDefinition {
  static capitalize (string: string) {
    return string[0].toUpperCase() + string.substring(1)
  }

  capitalized: ReturnType<this['getCapitalized']>
  omittedPropsUnion: ReturnType<this['getOmittedPropsUnion']>
  propsType: ReturnType<this['getPropsType']>

  constructor (
    public name: string,
    public omittedProps: string[]
  ) {
    this.capitalized = this.getCapitalized()
    this.omittedPropsUnion = this.getOmittedPropsUnion()
    this.propsType = this.getPropsType()
  }

  getCapitalized () {
    return ElementDefinition.capitalize(this.name)
  }

  getOmittedPropsUnion () {
    return this.omittedProps
      .map(prop => `'${prop}'`)
      .join(' | ')
      .trim()
  }

  getPropsType () {
    return `Omit<JSX.IntrinsicElements["${this.capitalized}"], ${this.omittedPropsUnion}> & HTMXProps`
  }

}
</code>```

Body:
Why can't I use ReturnType for class property values of methods assigned in the constructor?

<a href="https://www.typescriptlang.org/play?#code/KYDwDg9gTgLgBAYwDYEMDOa4FEnALbAB2MAIsAGYCWhlMlEhcA3gFBxxowp0KIpi0USSgC9gcABSco1AOYAuDjBmFZASmZt2cKMBgBXKI2lyA2gAYAugDoYEAKpgwwKAGF0wCRoDUSlbOs0fQAjE1UJAEY1LQBfFi0EfkFhMQATRQAlPUNCABUAT2cAHhgAC0o0UwByWT13AS4U4FSqywA%20LQg8WhhmgAUoCDA0exoGTOyjAuKyiuramAB5bphe1IGhkbHCVo72MEHh6eAJgynC4BLyypq9DaOL3fj2BAZpfQQ7KEktfZDhXiEFAERRhWQAGl%20cDA-0ovC6PX6hzQoOUZksWg0rG0cFmaGsiQaQlEzTgAF5cddrAt6skSakvFC8dYEaskZtRvRGBTmQtloj1sjOQxGTjmQdNsdyZSKtS7sjjqK4HEtDSko16ZIsVDdGdGDh8ERSBRqLQuQT1cSxBJmUCCNF2HF2Kq9Py2YKOdstZocbqcjL8ay1vc0FD2NY8PwJBKwOS2nAAAZVAAkTBjMSqCYdOLg1gAVhBqBIqnAAD5wKrZnG2GR4JUq9gLENSrw%207R%20oyJt1FABSAGUABrWACSxBUaDhBoIxEqACJU8zCXS0jFZ5ZwXAF1Sg%20zhsLCDF4wAyOAACVyAFkByGE7F4jEgA" rel="nofollow noreferrer">Playground

export class ElementDefinition {
  static capitalize (string: string) {
    return string[0].toUpperCase() + string.substring(1)
  }

  capitalized: ReturnType<this['getCapitalized']>
  omittedPropsUnion: ReturnType<this['getOmittedPropsUnion']>
  propsType: ReturnType<this['getPropsType']>

  constructor (
    public name: string,
    public omittedProps: string[]
  ) {
    this.capitalized = this.getCapitalized()
    this.omittedPropsUnion = this.getOmittedPropsUnion()
    this.propsType = this.getPropsType()
  }

  getCapitalized () {
    return ElementDefinition.capitalize(this.name)
  }

  getOmittedPropsUnion () {
    return this.omittedProps
      .map(prop => `'${prop}'`)
      .join(' | ')
      .trim()
  }

  getPropsType () {
    return `Omit<JSX.IntrinsicElements["${this.capitalized}"], ${this.omittedPropsUnion}> & HTMXProps`
  }

}


问:
Can I format multiple ts files with the same code formatter used by VSCode?
It seems VSCode has a builtin code formatter for TypeScript

Is there a standalone command (CLI) of the code formatter used by VSCode?

I want to format all ts files in my folder recursively with this tool.

(Currently it is not so convenient for me to launch the text editor GUI and open each file one by one and format them one by one.)

Is there any way to do that?


问:
Firefox table sticky header row events not firing
I have a simple HTML table with a sticky header row. The header cell has a mouse enter event attached to it. In Firefox, the event stops firing when the user has scrolled down. This occurs ONLY when there are 21 rows (counting header) or more.

I have tested this in Chrome and Safari where this functionality appears to work correctly. I do not understand why this problem is occurring in Firefox.

const stickyRows = document.getElementsByClassName('sticky-row');
Array.from(stickyRows).forEach((stickyRowElement) => {
  stickyRowElement.children[0].onmouseenter = () => console.log('mouse enter cell');
});```
<pre class="snippet-code-css lang-css prettyprint-override"><code>td, th {
  border: 1px solid #dddddd;
  text-align: left;
  padding: 8px;
}

.sticky-row {
  top: 0;
  position: sticky;
  background-color: white;
}</code>```

Sticky header for 20 rows

Row 2

Row 3

Row 4

Row 5

Row 6

Row 7

Row 8

Row 9

Row 10

Row 11

Row 12

Row 13

Row 14

Row 15

Row 16

Row 17

Row 18

Row 19

Row 20

Sticky header for 21 rows

Row 2

Row 3

Row 4

Row 5

Row 6

Row 7

Row 8

Row 9

Row 10

Row 11

Row 12

Row 13

Row 14

Row 15

Row 16

Row 17

Row 18

Row 19

Row 20

Row 21

```

Body:
I have a simple HTML table with a sticky header row. The header cell has a mouse enter event attached to it. In Firefox, the event stops firing when the user has scrolled down. This occurs ONLY when there are 21 rows (counting header) or more.

I have tested this in Chrome and Safari where this functionality appears to work correctly. I do not understand why this problem is occurring in Firefox.

const stickyRows = document.getElementsByClassName('sticky-row');
Array.from(stickyRows).forEach((stickyRowElement) => {
  stickyRowElement.children[0].onmouseenter = () => console.log('mouse enter cell');
});

td, th {
  border: 1px solid #dddddd;
  text-align: left;
  padding: 8px;
}

.sticky-row {
  top: 0;
  position: sticky;
  background-color: white;
}

Sticky header for 20 rows

Row 2

Row 3

Row 4

Row 5

Row 6

Row 7

Row 8

Row 9

Row 10

Row 11

Row 12

Row 13

Row 14

Row 15

Row 16

Row 17

Row 18

Row 19

Row 20

Sticky header for 21 rows

Row 2

Row 3

Row 4

Row 5

Row 6

Row 7

Row 8

Row 9

Row 10

Row 11

Row 12

Row 13

Row 14

Row 15

Row 16

Row 17

Row 18

Row 19

Row 20

Row 21


问:
with nginx, how do i pass setup authentication from a response
a bit confused about the process here:

i have a keycloak container that once i login gives me something like this:

http://10.357.35.22/mainpage/?session_state=604471e5-6ecc-454e-9839-ef57a1b4d767&code=9e59150c-8944-42c5-9590-ac1184af8e68.604471e5-6ecc-454e-9839-ef57a1b4d767.2d2b79fc-8cdc-4ed0-8ca6-1031d256a020
i have no idea what to do with this in the mainpage location:

```<code>location /mainpage/ {
        alias /usr/share/nginx/html;
        index index.html;
}
</code>```

how would i go about check whatever headers against a secret i have.

here is the authentication location:

```<code>  location / {
            proxy_pass http://10.357.35.22:5555/keys/realms/my_realm/protocol/openid-connect/auth?response_type=code&client_id=landing_page&redirect_uri=http://10.357.35.22:5555/mainpage/

            # allow the CROS requests
            add_header 'Access-Control-Allow-Origin' '*';
            add_header 'Access-Control-Allow-Credentials' 'true';
            add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Sinc>
            add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH';
            add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
    }
</code>```

i'm just trying to put up a login screen in front of an app...so i've spent a long time trying to get to here, but i'm honestly stuck.  i could request for a token, but again, not sure how to use it in nginx.

nginx and keycloak are both in docker containers.

Body:
a bit confused about the process here:

i have a keycloak container that once i login gives me something like this:

http://10.357.35.22/mainpage/?session_state=604471e5-6ecc-454e-9839-ef57a1b4d767&code=9e59150c-8944-42c5-9590-ac1184af8e68.604471e5-6ecc-454e-9839-ef57a1b4d767.2d2b79fc-8cdc-4ed0-8ca6-1031d256a020
i have no idea what to do with this in the mainpage location:

location /mainpage/ {
        alias /usr/share/nginx/html;
        index index.html;
}

how would i go about check whatever headers against a secret i have.

here is the authentication location:

  location / {
            proxy_pass http://10.357.35.22:5555/keys/realms/my_realm/protocol/openid-connect/auth?response_type=code&client_id=landing_page&redirect_uri=http://10.357.35.22:5555/mainpage/

            # allow the CROS requests
            add_header 'Access-Control-Allow-Origin' '*';
            add_header 'Access-Control-Allow-Credentials' 'true';
            add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Sinc>
            add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH';
            add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
    }

i'm just trying to put up a login screen in front of an app...so i've spent a long time trying to get to here, but i'm honestly stuck.  i could request for a token, but again, not sure how to use it in nginx.

nginx and keycloak are both in docker containers.


问:
Single Page Website Loading data into a container
I am making a single page site that has containers which act as stops from the navigation links at the top of the screen which you can read that particular containers information. I have a button to Read More and here is the problem.

I am working on a services page that has a overview of services but I am trying to get a button that the user can click to learn more but I would like that services.html file to load into that container without leaving the current location on the page ie the new information would slide in from the right so the user can read and once done they can close the loaded information and still be where they were currently at in the one page site. I hope that makes sense? Thank you for your help!

I have tried calling the page via a
 tag and a href but I get information cant be loaded.

```<code><section class="single-items center-block parallax" id="corporate" style="background-color: cadetblue">
<div class="container">
    <div class="row">
        <div class="col-md-5 col-sm-8 col-xs-11">
            <div class="area-heading text-start wow fadeInLeft">
                <h3 class="area-title text-capitalize alt-font text-white mb-2 font-weight-100">
                    <a data-fancybox="group-three" href="images/single-portfolio3.jpg">Complete <strong>Services</strong></a>
                </h3>
                <p class="text-white">For a full list click below</p>
                <a class="btn btn-transparent-white btn-rounded btn-large mt-4" data-fancybox="group-three" href="images/single-portfolio3.jpg">View More</a>
            </div>
        </div>
        <div class="col-md-7 col-sm-4 col-xs-1"></div>
    </div>
</div>
<div class="hidden">
    <a data-fancybox="group-three" data-thumb="images/gallery-thumb1.jpg" href="images/gallery-thumb1.jpg"></a>
    <a data-fancybox="group-three" data-thumb="images/gallery-thumb2.jpg" href="images/gallery-thumb2.jpg"></a>
    <a data-fancybox="group-three" data-thumb="images/gallery-thumb3.jpg" href="images/gallery-thumb3.jpg"></a>
    <a data-fancybox="group-three" data-thumb="images/gallery-thumb4.jpg" href="images/gallery-thumb4.jpg"></a>
    <a data-fancybox="group-three" data-thumb="images/gallery-thumb5.jpg" href="images/gallery-thumb5.jpg"></a>
</div>
</code>```

Body:
I am making a single page site that has containers which act as stops from the navigation links at the top of the screen which you can read that particular containers information. I have a button to Read More and here is the problem.

I am working on a services page that has a overview of services but I am trying to get a button that the user can click to learn more but I would like that services.html file to load into that container without leaving the current location on the page ie the new information would slide in from the right so the user can read and once done they can close the loaded information and still be where they were currently at in the one page site. I hope that makes sense? Thank you for your help!

I have tried calling the page via a
 tag and a href but I get information cant be loaded.

                    Complete Services

For a full list click below

                View More


问:
Dart - Function Calculate difference of days
i created function in flutter using dart that takes Today date and see if it equal to today or not. and u can use for a week, month..etc

here it is

```<code> bool daysPassed(int timeStamp, int days) {
    if (DateTime.now()
            .difference(DateTime.fromMillisecondsSinceEpoch(timeStamp))
            .inDays >=
        days) {
      return true;
    }
    return false;
  }

</code>```

so i used this function to see if a one day passed or not , if one day passed make all the variables from shared preference to zero, otherwise get the current variables

here is the logic that i made,

```<code> HOME.pref = await SharedPreferences.getInstance();

    int? timeStamp = HOME.pref!.getInt('day_timestamp_values_changed');
    int? timeStamp1Week = HOME.pref!.getInt('week_timestamp');

    setState(() {
      if (timeStamp != null) {
        if (daysPassed(timeStamp, 1)) {
          // 1 means if 1 day is passed
          HOME.pref!.setDouble('currentCircleProgressValue', 0);
          HOME.pref!.setDouble('currentCircleProgressValue2', 0);
          HOME.pref!.setDouble('currentCircleProgressValue3', 0);
          HOME.pref!.setInt('iii', 0);
          if (HOME.Currentday != 0) {
            HOME.Lastday = HOME.pref!.getInt('Currentday')!;
            HOME.pref!.setInt('Currentday', 0);
          }
        } else {
          HOME.currentCircleProgressValue =
              HOME.pref!.getDouble('currentCircleProgressValue')!;
          HOME.currentCircleProgressValue2 =
              HOME.pref!.getDouble('currentCircleProgressValue2')!;
          HOME.currentCircleProgressValue3 =
              HOME.pref!.getDouble('currentCircleProgressValue3')!;
          HOME.iii = HOME.pref!.getInt('iii')!;
          HOME.Currentday = HOME.pref!.getInt('Currentday')!;
          HOME.Lastday = HOME.pref!.getInt('Lastday')!;
        }
      }
</code>```

the problem is when i test this out the variables after still the same. nothing happens the variables not initialize to zero.

Can u please help me out ?

Thank u

Body:
i created function in flutter using dart that takes Today date and see if it equal to today or not. and u can use for a week, month..etc

here it is

 bool daysPassed(int timeStamp, int days) {
    if (DateTime.now()
            .difference(DateTime.fromMillisecondsSinceEpoch(timeStamp))
            .inDays >=
        days) {
      return true;
    }
    return false;
  }

so i used this function to see if a one day passed or not , if one day passed make all the variables from shared preference to zero, otherwise get the current variables

here is the logic that i made,

 HOME.pref = await SharedPreferences.getInstance();

    int? timeStamp = HOME.pref!.getInt('day_timestamp_values_changed');
    int? timeStamp1Week = HOME.pref!.getInt('week_timestamp');

    setState(() {
      if (timeStamp != null) {
        if (daysPassed(timeStamp, 1)) {
          // 1 means if 1 day is passed
          HOME.pref!.setDouble('currentCircleProgressValue', 0);
          HOME.pref!.setDouble('currentCircleProgressValue2', 0);
          HOME.pref!.setDouble('currentCircleProgressValue3', 0);
          HOME.pref!.setInt('iii', 0);
          if (HOME.Currentday != 0) {
            HOME.Lastday = HOME.pref!.getInt('Currentday')!;
            HOME.pref!.setInt('Currentday', 0);
          }
        } else {
          HOME.currentCircleProgressValue =
              HOME.pref!.getDouble('currentCircleProgressValue')!;
          HOME.currentCircleProgressValue2 =
              HOME.pref!.getDouble('currentCircleProgressValue2')!;
          HOME.currentCircleProgressValue3 =
              HOME.pref!.getDouble('currentCircleProgressValue3')!;
          HOME.iii = HOME.pref!.getInt('iii')!;
          HOME.Currentday = HOME.pref!.getInt('Currentday')!;
          HOME.Lastday = HOME.pref!.getInt('Lastday')!;
        }
      }

the problem is when i test this out the variables after still the same. nothing happens the variables not initialize to zero.

Can u please help me out ?

Thank u


问:
Remove the first group of consecutive negative array elements from the array
Delete the first group of consecutive negative
elements in the array.

```<code>void delNegative(int* arr, int& size) {
    if (!check_prop(arr, size, neg)) return;
    int ind_l, ind_f;//
    if (arr[0] < 0) ind_f = 0;
    if (arr[size - 1] < 0) ind_l = size - 1;
    for (int i = 1; i < size; i++){
        if (arr[i - 1] > 0 && arr[i] < 0) ind_f = i;
        if (arr[i - 1] < 0 && arr[i] > 0) ind_l = i - 1;
    }
    if (ind_l < ind_f) ind_l = size - 1;
    int ii = 0;
    for (int i = 0; i < size; i++)
        if (i > ind_l || i < ind_f) {
            arr[ii] = arr[i];
            ii++;
        }

    size -= ind_l - ind_f + 1;
}
</code>```

There is this function, but it removes the last group of negative elements.
It needs to be redone for dynamic arrays

Body:
Delete the first group of consecutive negative
elements in the array.

void delNegative(int* arr, int& size) {
    if (!check_prop(arr, size, neg)) return;
    int ind_l, ind_f;//
    if (arr[0] < 0) ind_f = 0;
    if (arr[size - 1] < 0) ind_l = size - 1;
    for (int i = 1; i < size; i++){
        if (arr[i - 1] > 0 && arr[i] < 0) ind_f = i;
        if (arr[i - 1] < 0 && arr[i] > 0) ind_l = i - 1;
    }
    if (ind_l < ind_f) ind_l = size - 1;
    int ii = 0;
    for (int i = 0; i < size; i++)
        if (i > ind_l || i < ind_f) {
            arr[ii] = arr[i];
            ii++;
        }

    size -= ind_l - ind_f + 1;
}

There is this function, but it removes the last group of negative elements.
It needs to be redone for dynamic arrays


问:
How to Record Current Screen In Android, Not using Camera
I want to implement a function that simply records what is currently being viewed on my phone, rather than using the camera.

But most of the samples use MediaRecorder and camera in parallel, I don't think this is what I need at the moment.

I've seen the MediaProjection API, but it runs in an Activity . I want to implement a screen recording function for a live streaming app I am currently developing. And this should work inside a Service.

Can someone give me some help?


问:
How can I inicialize Apache Server with xampp
I just installed xampp on my laptop with Debian 11 as indicated in the official website (https://www.apachefriends.org/es/faq_linux.html).  Once I try to start it, the following outputs:

```<code>    Starting XAMPP for Linux 8.0.25-0...
XAMPP: Starting Apache.../opt/lampp/share/xampp/xampplib: line 22: netstat: command not found
/opt/lampp/share/xampp/xampplib: line 22: netstat: command not found
fail.
XAMPP:  Starting diagnose...
XAMPP:  Sorry, I've no idea what's going wrong.
XAMPP:  Please contact our forum http://www.apachefriends.org/f/
Last 10 lines of "/opt/lampp/logs/error_log":
tail: cannot open '/opt/lampp/logs/error.log' for reading: No such file or directory
XAMPP: Starting MySQL...already running.
XAMPP: Starting ProFTPD...already running.
</code>```

It seems that Apache is not running, therefore it is impossible to practice PHP.

Could you please tell me what is going on?
PS. I am a beginner. I want to learn PHP.

Thanks in advance.

Body:
I just installed xampp on my laptop with Debian 11 as indicated in the official website (https://www.apachefriends.org/es/faq_linux.html).  Once I try to start it, the following outputs:

    Starting XAMPP for Linux 8.0.25-0...
XAMPP: Starting Apache.../opt/lampp/share/xampp/xampplib: line 22: netstat: command not found
/opt/lampp/share/xampp/xampplib: line 22: netstat: command not found
fail.
XAMPP:  Starting diagnose...
XAMPP:  Sorry, I've no idea what's going wrong.
XAMPP:  Please contact our forum http://www.apachefriends.org/f/
Last 10 lines of "/opt/lampp/logs/error_log":
tail: cannot open '/opt/lampp/logs/error.log' for reading: No such file or directory
XAMPP: Starting MySQL...already running.
XAMPP: Starting ProFTPD...already running.

It seems that Apache is not running, therefore it is impossible to practice PHP.

Could you please tell me what is going on?
PS. I am a beginner. I want to learn PHP.

Thanks in advance.


问:
Image stretched and overflowing from the container
I am trying to add an image to sit within the contact form and be same height as the rest of the contents inside the container but how it is coded now the image is stretched vertically outside of the container  and does not properly fit . I have tried overflow options not working,I have added this plug in on the Tailwindcss configuration page, plugins: [require('@tailwindcss/forms')] nothing I try seems to be fixing this here is my code :

EDIT: the first pic is what it should look like and the second is the actual

```<code><section>
      <div className="h-screen items-center flex justify-center">
        <form

          className="bg-white flex rounded-lg w-1/2 font-burtons"
        >
          <div className="flex-1 text-gray-700  p-20">
            <h1 className="text-3xl pb-2 text-teal-600 font-burtons">
              Let's get started
            </h1>
            <p className="text-lg  text-gray-500">
              Join our E-learning platform today and unlock over 500+ courses
              and digital assets ready to download.
            </p>
            <div className="mt-6 ">
              {/* Name input field */}
              <div className="pb-4">
                <label className='block font-burtons text-sm pb-2'
                  htmlFor="name">

                </label>

                <input
                  className="border-2 border-gray-500 p-2 rounded-md w-1/2 focus:border-teal-500 focus:ring-teal-500 "
                  type="text"
                  name="name"
                  placeholder="Enter your name"

                />
              </div>
              {/* Email input field */}
              <div className="pb-4">
                <label
                  className=" block font-burtons text-sm pb-2"
                  htmlFor='email'>
                </label>

                <p></p>
                <input
                  className="border-2 border-gray-500 p-2 rounded-md w-1/2 focus:border-teal-500 focus:ring-teal-500"
                  type="email"
                  name="email"
                  placeholder="Enter your email address"

                />
              </div>
              {/* Country input field */}
              <div className="pb-4">
                <label

                  className="block font-burtons text-sm pb-2"
                  htmlFor='country'
                >

                </label>
                <select
                  className="border-2 border-gray-500 p-2 rounded-md w-1/2 focus:border-teal-500 focus:ring-teal-500"
                  name="country"

                >
                  <option>United States</option>
                  <option>United Kingdom</option>
                  <option>Germany</option>
                </select>
              </div>
              {/* Terms of service*/}
              <div className="pb-4">
                <label className='block font-burtons text-sm pb-2'
                  htmlFor='terms'>

                </label>

                <div className="flex items-center gap-2">
                  <input
                    type="checkbox"
                    name="terms"
                    value="checked"

                    className="h-5 w-5 text-teal-500 border-2  background-gray-500 focus:border-teal-500 focus:ring-teal-500"
                  />
                  <p className="text-sm font-burtons gray-500">
                    I agree to the Terms and Service
                  </p>
                </div>
              </div>
              <button
                type="submit"
                className="bg-teal-500 font-burtons text-sm text-white py-3 mt-6 rounded-lg w-full"
              >
                Start learning today!
              </button>
            </div>
          </div>
          <div className='flex-1 relative'>
            <Image src={formImage} fill className='object-cover overflow-auto' />

          </div>
        </form>
      </div>
    </section>
 </main>
</code>```

Body:
I am trying to add an image to sit within the contact form and be same height as the rest of the contents inside the container but how it is coded now the image is stretched vertically outside of the container  and does not properly fit . I have tried overflow options not working,I have added this plug in on the Tailwindcss configuration page, plugins: [require('@tailwindcss/forms')] nothing I try seems to be fixing this here is my code :

EDIT: the first pic is what it should look like and the second is the actual

        <form

          className="bg-white flex rounded-lg w-1/2 font-burtons"
        >

              Let's get started

              Join our E-learning platform today and unlock over 500+ courses
              and digital assets ready to download.

              {/* Name input field */}

                <input
                  className="border-2 border-gray-500 p-2 rounded-md w-1/2 focus:border-teal-500 focus:ring-teal-500 "
                  type="text"
                  name="name"
                  placeholder="Enter your name"

                />

              {/* Email input field */}

                <input
                  className="border-2 border-gray-500 p-2 rounded-md w-1/2 focus:border-teal-500 focus:ring-teal-500"
                  type="email"
                  name="email"
                  placeholder="Enter your email address"

                />

              {/* Country input field */}

                <select
                  className="border-2 border-gray-500 p-2 rounded-md w-1/2 focus:border-teal-500 focus:ring-teal-500"
                  name="country"

                >
                  <option>United States</option>
                  <option>United Kingdom</option>
                  <option>Germany</option>
                </select>

              {/* Terms of service*/}

                  <input
                    type="checkbox"
                    name="terms"
                    value="checked"

                    className="h-5 w-5 text-teal-500 border-2  background-gray-500 focus:border-teal-500 focus:ring-teal-500"
                  />

                    I agree to the Terms and Service

              <button
                type="submit"
                className="bg-teal-500 font-burtons text-sm text-white py-3 mt-6 rounded-lg w-full"
              >
                Start learning today!
              </button>

            <Image src={formImage} fill className='object-cover overflow-auto' />

        </form>


问:
Eclipse not making a debug folder/bianary not found error
I'm starting my programming degree at my school and I needed to get an IDE. I chose eclipse and I'm using MinGW-w64 even though I know there are easier IDE's to start with. Doing my basic hello world program, and no matter how many times I clean and build my project it gives me "Info: Nothing to build for firstproject." Then when I try to run the program it always gives "Launch failed. Binary not found." In my work space eclipse doesn't create a debug folder either. Binary error nothing to build

I made sure my eclipse is up to date, made sure to add the MinGW/bin to my PATH. I got my MinGW-w64 from msys2. I've also tried various things in settings; I'm using the PE64 Windows binary parser,MINGW_HOME is in my environment variables, and the guide I used had me add MinGW files to my Paths and Symbols. I've also tried putting "debug/firstprogram" in my launch configurations and that ended up giving me a different error saying the file doesn't exist in the location. debug/fristproject in run configurations file doesn't exist error


问:
OpenCV2 detectandcompute failing unexpectedly
I am deploying an API that relies on computing SIFT features to AWS lambda. I run the API in the following docker image:

```<code>FROM public.ecr.aws/lambda/python:3.8

# Install the function's dependencies using file requirements.txt
# from your project folder.

COPY requirements.txt  .
RUN  pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}"

# Copy function code
COPY logic LambdaFuncs ${LAMBDA_TASK_ROOT}/

RUN yum install -y mesa-libGL
RUN yum install -y wget
RUN yum install -y tar
RUN yum install -y make
RUN yum install -y gcc

RUN wget http://www.zlib.net/fossils/zlib-1.2.9.tar.gz
RUN tar -xvzf zlib-1.2.9.tar.gz
RUN cd zlib-1.2.9 && ./configure && make && make install
RUN cp zlib-1.2.9/libz.so.1 /lib64
RUN cp zlib-1.2.9/libz.so.1.2.9 /lib64
</code>```

(The last few files are to take care of some zlib import issues).

Requirements.txt contains the following packages:

```<code>awscli==1.27.46
boto3==1.26.45
botocore==1.29.46
cffi==1.15.1
colorama==0.4.4
cryptography==3.1.1
docutils==0.16
grpcio==1.47.2
grpcio-tools==1.47.2
jmespath==1.0.1
mmh3==3.0.0
numpy==1.23.5
opencv-python==4.7.0.68
pandas==1.5.2
protobuf==3.20.3
pyasn1==0.4.8
pycparser==2.21
pymilvus==2.2.1
python-dateutil==2.8.2
python-lambda-local==0.1.13
pytz==2022.7
PyYAML==5.4.1
rsa==4.7.2
s3transfer==0.6.0
six==1.16.0
ujson==5.4.0
urllib3==1.26.13
</code>```

Now, whenever I run detectAndCompute on a sift instance created by cv2.SIFT_create(nfeatures=num_features), my API crashes without any error message (but works fine locally on my MacOS). I am assuming my Mac has some packages/C++ libraries that the docker image does not contain. Any ideas on what they may be and how I may install them? Alternatively, any open source sift that I could use that is as optimized as cv2?

Body:
I am deploying an API that relies on computing SIFT features to AWS lambda. I run the API in the following docker image:

FROM public.ecr.aws/lambda/python:3.8

# Install the function's dependencies using file requirements.txt
# from your project folder.

COPY requirements.txt  .
RUN  pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}"

# Copy function code
COPY logic LambdaFuncs ${LAMBDA_TASK_ROOT}/

RUN yum install -y mesa-libGL
RUN yum install -y wget
RUN yum install -y tar
RUN yum install -y make
RUN yum install -y gcc

RUN wget http://www.zlib.net/fossils/zlib-1.2.9.tar.gz
RUN tar -xvzf zlib-1.2.9.tar.gz
RUN cd zlib-1.2.9 && ./configure && make && make install
RUN cp zlib-1.2.9/libz.so.1 /lib64
RUN cp zlib-1.2.9/libz.so.1.2.9 /lib64

(The last few files are to take care of some zlib import issues).

Requirements.txt contains the following packages:

awscli==1.27.46
boto3==1.26.45
botocore==1.29.46
cffi==1.15.1
colorama==0.4.4
cryptography==3.1.1
docutils==0.16
grpcio==1.47.2
grpcio-tools==1.47.2
jmespath==1.0.1
mmh3==3.0.0
numpy==1.23.5
opencv-python==4.7.0.68
pandas==1.5.2
protobuf==3.20.3
pyasn1==0.4.8
pycparser==2.21
pymilvus==2.2.1
python-dateutil==2.8.2
python-lambda-local==0.1.13
pytz==2022.7
PyYAML==5.4.1
rsa==4.7.2
s3transfer==0.6.0
six==1.16.0
ujson==5.4.0
urllib3==1.26.13

Now, whenever I run detectAndCompute on a sift instance created by cv2.SIFT_create(nfeatures=num_features), my API crashes without any error message (but works fine locally on my MacOS). I am assuming my Mac has some packages/C++ libraries that the docker image does not contain. Any ideas on what they may be and how I may install them? Alternatively, any open source sift that I could use that is as optimized as cv2?


问:
How to send email by vercel/nextjs (problem with server)?
My main problem is that I changed hosting and chang email adress. So I had to change in code this part of code responsible by that. I remove all code with domain .eu, instead I have .com and this is working good on localhost:3000, but on vercel server there is some error because there is that I have my last domain and do not send it to recipens as It should.

```<code>Error: Can't send mail - all recipients were rejected: 553 5.7.1 <office@e-m.eu>: Sender address rejected: not owned by user office@e-m.com
    at SMTPConnection._formatError (/var/task/node_modules/nodemailer/lib/smtp-connection/index.js:784:19)
    at SMTPConnection._actionRCPT (/var/task/node_modules/nodemailer/lib/smtp-connection/index.js:1626:28)
    at SMTPConnection.<anonymous> (/var/task/node_modules/nodemailer/lib/smtp-connection/index.js:1579:30)
    at SMTPConnection._processResponse (/var/task/node_modules/nodemailer/lib/smtp-connection/index.js:947:20)
    at SMTPConnection._onData (/var/task/node_modules/nodemailer/lib/smtp-connection/index.js:749:14)
    at TLSSocket.SMTPConnection._onSocketData (/var/task/node_modules/nodemailer/lib/smtp-connection/index.js:189:44)
    at TLSSocket.emit (node:events:527:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at TLSSocket.Readable.push (node:internal/streams/readable:228:10) {
  code: 'EENVELOPE',
  response: '553 5.7.1  <office@e-m.eu>: Sender address rejected: not owned by user 'office@e-m.com',
  responseCode: 553,
  command: 'RCPT TO',
  rejected: [ 'nn@op.pl' ],

</code>```

I thought that this is problem with email provider so I wrote to him, but he responded that if it works on localhost, this must be problem with hosting.
Then I tried to change environment variable, and I did it by installing yarn add global vercel and then I updated variable on local, prod, by vercel env add, I check by vercel env ls if It is  updated, it was, I check vercel and there was updated, but problem still is occurring.

Body:
My main problem is that I changed hosting and chang email adress. So I had to change in code this part of code responsible by that. I remove all code with domain .eu, instead I have .com and this is working good on localhost:3000, but on vercel server there is some error because there is that I have my last domain and do not send it to recipens as It should.

Error: Can't send mail - all recipients were rejected: 553 5.7.1 <office@e-m.eu>: Sender address rejected: not owned by user office@e-m.com
    at SMTPConnection._formatError (/var/task/node_modules/nodemailer/lib/smtp-connection/index.js:784:19)
    at SMTPConnection._actionRCPT (/var/task/node_modules/nodemailer/lib/smtp-connection/index.js:1626:28)
    at SMTPConnection.<anonymous> (/var/task/node_modules/nodemailer/lib/smtp-connection/index.js:1579:30)
    at SMTPConnection._processResponse (/var/task/node_modules/nodemailer/lib/smtp-connection/index.js:947:20)
    at SMTPConnection._onData (/var/task/node_modules/nodemailer/lib/smtp-connection/index.js:749:14)
    at TLSSocket.SMTPConnection._onSocketData (/var/task/node_modules/nodemailer/lib/smtp-connection/index.js:189:44)
    at TLSSocket.emit (node:events:527:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at TLSSocket.Readable.push (node:internal/streams/readable:228:10) {
  code: 'EENVELOPE',
  response: '553 5.7.1  <office@e-m.eu>: Sender address rejected: not owned by user 'office@e-m.com',
  responseCode: 553,
  command: 'RCPT TO',
  rejected: [ 'nn@op.pl' ],

I thought that this is problem with email provider so I wrote to him, but he responded that if it works on localhost, this must be problem with hosting.
Then I tried to change environment variable, and I did it by installing yarn add global vercel and then I updated variable on local, prod, by vercel env add, I check by vercel env ls if It is  updated, it was, I check vercel and there was updated, but problem still is occurring.


问:
How to determine if a PR has all required codeowner approvals using GH REST API?
I would like to use the GH REST API to determine if a particular PR has all required codeowner approvals.  Then, if the answer is yes, I would like to further determine the date and time at which the final approval occurred.

I have tried a bunch of things.

The documentation suggests that if all approvals have been granted, the requested_reviewers and requested_teams array will be empty.  This does not appear to be true though.  As a test, I created a PR that required reviews from 3 different teams.  Then I manually added a couple of additional people.  I reached to people from the 3 different teams and asked them to approve my PR.  After doing this, in the GH html webpage, it shows "Changes Approved" with a green checkmark.  But when I do the GH API request, the requested_reviewers and requested_teams arrays are not empty.

I then tried appending /reviews to the end of the request URL, to get all of the reviews.  They all show up as APPROVED, but nothing in the response indicates whether the review was a required review, or someone who was just passing by and felt like hitting approve.

It feels like the best way is to do the following steps:

Get the pull request object

Examine the requested_teams field (we don't use individual names in our CODEOWNERS)

Walk the list of reviews by querying the /reviews endpoint

For each one, query the user's teams and see if any of them match any of the teams in requested_teams.

This is a lot of work and pretty complicated, but it seems do-able in theory.  Is there a simpler way?


问:
How can install dependencies from a setup.py
I dont know how to install the dependencies from a .py file that i made

I did some basic commands in the terminal but none of them worked


问:
VBA Script Error The Index In The Specified Location Is Out Of Bounds- Can't Figure It Out
I'm new to this and need assistance. I'm working on a Interactive Dashboard and I encounter this error message "VBA Script Error The Index In The Specified Location Is Out Of Bounds"

This Is The Code and The Error Message occurs its the bold Text

```<code>Sub Display_Info_Box_Deliveries()

    With ActiveSheet

# **Call Change_Info_Box_Visibility(.Shapes(“Info_Button_Deliveries_Active”), .Shapes(“Info_Button_Deliveries_Inactive”), .Shapes(“Info_Box_Deliveries”), True)**

    End With
End Sub

Sub Hide_Info_Box_Deliveries()

    With ActiveSheet

# Call Change_Info_Box_Visibility(.Shapes(“Info_Button_Deliveries_Active”), .Shapes(“Info_Button_Deliveries_Inactive”), .Shapes(“Info_Box_Deliveries”), False)

    End With

End Sub
</code>```

I try to fix the code and re-type it but same error

Body:
I'm new to this and need assistance. I'm working on a Interactive Dashboard and I encounter this error message "VBA Script Error The Index In The Specified Location Is Out Of Bounds"

This Is The Code and The Error Message occurs its the bold Text

Sub Display_Info_Box_Deliveries()

    With ActiveSheet

# **Call Change_Info_Box_Visibility(.Shapes(“Info_Button_Deliveries_Active”), .Shapes(“Info_Button_Deliveries_Inactive”), .Shapes(“Info_Box_Deliveries”), True)**

    End With
End Sub

Sub Hide_Info_Box_Deliveries()

    With ActiveSheet

# Call Change_Info_Box_Visibility(.Shapes(“Info_Button_Deliveries_Active”), .Shapes(“Info_Button_Deliveries_Inactive”), .Shapes(“Info_Box_Deliveries”), False)

    End With

End Sub

I try to fix the code and re-type it but same error


问:
PineScript V5 - Extracting various conditions to be true from values
I'll try to explain as best as I can.
I'm using open source scripts and wanted to extract something from it.

Some conditions will need to be true, but not all of them.

Only 3 or 4 shall be true to get a condition "valid"

There are the conditions :

pospressure = PosNegPressure and OSIndicatorsYellowPointingUp

negpressure = PosNegPressure and OBIndicatorsYellowPointingDown

trendmeter1pos = FastMACDHistogram > 0

trendmeter1neg = FastMACDHistogram < 0

trendmeter2pos = RSI13 > 50

trendmeter2neg = RSI13 < 50

trendmeter3pos = RSI5 > 50

trendmeter3neg = RSI5 < 50

trendbar1thinlinegreen = MA1 > MA2

trendbar1thinlinered = MA1 < MA2

trendbar2thinlinegreen = MA3 > MA4

trendbar2thinlinered = MA3 < MA4

If 3 or 4 of them are valid, I want to create a plot/alert.

I've tried this :

bullishmeter1 = pospressure and trendmeter1pos and trendmeter2pos and trendmeter3pos and trendbar1thinlinegreen and trendbar2thinlinegreen

bullishmeter2 = pospressure and trendmeter1pos and trendmeter2pos and trendmeter3pos and trendbar1thinlinegreen

bullishmeter3 = pospressure and trendmeter1pos and trendmeter2pos and trendmeter3pos and trendbar2thinlinegreen

bullishmeter4 = pospressure and trendmeter1pos and trendmeter2pos and trendbar1thinlinegreen and trendbar2thinlinegreen

bullishmeter5 = pospressure and trendmeter1pos and trendmeter3pos and trendbar1thinlinegreen and trendbar2thinlinegreen

bullishmeter6 = pospressure and trendmeter2pos and trendmeter3pos and trendbar1thinlinegreen and trendbar2thinlinegreen

bullishmeter7 = trendmeter1pos and trendmeter2pos and trendmeter3pos and trendbar1thinlinegreen and trendbar2thinlinegreen

bearishmeter1 = negpressure and trendmeter1neg and trendmeter2neg and trendmeter3neg and trendbar1thinlinered and trendbar2thinlinered

bearishmeter2 = negpressure and trendmeter1neg and trendmeter2neg and trendmeter3neg and trendbar1thinlinered

bearishmeter3 = negpressure and trendmeter1neg and trendmeter2neg and trendmeter3neg and trendbar2thinlinered

bearishmeter4 = negpressure and trendmeter1neg and trendmeter2neg and trendbar1thinlinered and trendbar2thinlinered

bearishmeter5 = negpressure and trendmeter1neg and trendmeter3neg and trendbar1thinlinered and trendbar2thinlinered

bearishmeter6 = negpressure and trendmeter2neg and trendmeter3neg and trendbar1thinlinered and trendbar2thinlinered

bearishmeter7 = trendmeter1neg and trendmeter2neg and trendmeter3neg and trendbar1thinlinered and trendbar2thinlinered

bullishhmeterbull = bullishmeter1 or bullishmeter2 or bullishmeter3 or bullishmeter4 or bullishmeter5 or bullishmeter6 or bullishmeter7

bearishmeterbear = bearishmeter1 or bearishmeter2 or bearishmeter3 or bearishmeter4 or bearishmeter5 or bearishmeter6 or bearishmeter7

*But it doesn't work

Any ideas, on how to filter X conditions = true from those ?


问:
github actions error with concurrency syntax
I'm fairly new to GitHub Actions and YAML, so please bear with me if this seems obvious.

With this workflow, I'm attempting to push a deployment to my DigitalOcean Droplet running a Dokku container whenever a commit to the master branch is pushed (similar to DigitalOcean's App Platform workflow).

This is my current deploy.yml file (which follows this guide):

```<code>#yamllint disable-line rule:truthy
name: "deploy"

concurrency:
    group: production
    cancel-in-progress: true

on:
    push:
        branches:
            - main

jobs:
    deploy:
        runs-on: ubuntu-latest
        environment: production
        steps:
            - name: Cloning
                uses: actions/checkout@v2
                with:
                    fetch-depth: 0

            - name: Push to Dokku
                uses: dokku/github-action@master
                with:
                    git_remote_url: "ssh://dokku@example.app:22/example.app"
                    ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
</code>```

However, this throws the error

You have an error in your yaml syntax on line 5

Which is the group: production line.

Where am I going wrong? As far as I'm aware, this is the correct syntax.

Body:
I'm fairly new to GitHub Actions and YAML, so please bear with me if this seems obvious.

With this workflow, I'm attempting to push a deployment to my DigitalOcean Droplet running a Dokku container whenever a commit to the master branch is pushed (similar to DigitalOcean's App Platform workflow).

This is my current deploy.yml file (which follows this guide):

#yamllint disable-line rule:truthy
name: "deploy"

concurrency:
    group: production
    cancel-in-progress: true

on:
    push:
        branches:
            - main

jobs:
    deploy:
        runs-on: ubuntu-latest
        environment: production
        steps:
            - name: Cloning
                uses: actions/checkout@v2
                with:
                    fetch-depth: 0

            - name: Push to Dokku
                uses: dokku/github-action@master
                with:
                    git_remote_url: "ssh://dokku@example.app:22/example.app"
                    ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}

However, this throws the error

You have an error in your yaml syntax on line 5

Which is the group: production line.

Where am I going wrong? As far as I'm aware, this is the correct syntax.


问:
Can I use VBA in MS Access to add a control to a tab control (TabCtl) object?
I want to use VBA in MS Access to dynamically add a subform control to a tab control object on a form. Basically, I have a 99% working solution where users need to generate a custom form. They can select the type and number of drop-downs they want, and it will generate a main form and paste in a subform with all of those controls. If there are too many controls (22" form limit in Access), it splits them into multiple subforms -- hence the tab control. The only thing I can't get it to do is paste the new subforms into the tab control itself.

Here's a simplified version of what I'm trying to do. In my research I did find VBA methods to add controls to TabStrips and TabPages, but those aren't relevant to MS Access. The TabCtl object itself doesn't seem to have any properties related to adding controls within it (yet this is something you can obviously do in the GUI).

```<code>Sub AddControlToTabControl()

    Dim frm As Form
    Dim subForm As Form
    Dim tabCtl As tabControl

    Set frm = Forms!Form1
    Set subForm = Forms!Form1_subForm
    Set tabCtl = frm!tabCtl

    DoCmd.OpenForm frm.Name

    'Here are some things that aren't valid
    tabCtl.Pages(0).Add (subForm)        'Pages collection does not have an Add property
    tabCtl.Controls.Add (subForm)        'Controls collection does not have an Add property
    tabCtl.Add (subForm)                 'tabCtl object does not have an Add property

End Sub
</code>```

I reviewed the Tab Control object Microsoft documentation, including all of the properties I thought would make sense, but there doesn't seem to be anything on how to put a control specifically on the tab control itself.

I also used VBA to paste the subform onto the main form using coordinates that would be on top of the tab control, but it just created overlapping objects.

Body:
I want to use VBA in MS Access to dynamically add a subform control to a tab control object on a form. Basically, I have a 99% working solution where users need to generate a custom form. They can select the type and number of drop-downs they want, and it will generate a main form and paste in a subform with all of those controls. If there are too many controls (22" form limit in Access), it splits them into multiple subforms -- hence the tab control. The only thing I can't get it to do is paste the new subforms into the tab control itself.

Here's a simplified version of what I'm trying to do. In my research I did find VBA methods to add controls to TabStrips and TabPages, but those aren't relevant to MS Access. The TabCtl object itself doesn't seem to have any properties related to adding controls within it (yet this is something you can obviously do in the GUI).

Sub AddControlToTabControl()

    Dim frm As Form
    Dim subForm As Form
    Dim tabCtl As tabControl

    Set frm = Forms!Form1
    Set subForm = Forms!Form1_subForm
    Set tabCtl = frm!tabCtl

    DoCmd.OpenForm frm.Name

    'Here are some things that aren't valid
    tabCtl.Pages(0).Add (subForm)        'Pages collection does not have an Add property
    tabCtl.Controls.Add (subForm)        'Controls collection does not have an Add property
    tabCtl.Add (subForm)                 'tabCtl object does not have an Add property

End Sub

I reviewed the Tab Control object Microsoft documentation, including all of the properties I thought would make sense, but there doesn't seem to be anything on how to put a control specifically on the tab control itself.

I also used VBA to paste the subform onto the main form using coordinates that would be on top of the tab control, but it just created overlapping objects.


问:
Vue3 v-for index is always 0 when I click on child loop
I have array and inside of it have weekdays.
example: mainList:

[
  { id: '1', name: 'st1', weekdays: ['TUE', 'WED', 'MON', 'THU'] },
  { id: '2', name: 'sty5676', weekdays: ['FRI', 'MON', 'TUE', 'THU'] },
  { id: '3', name: 'st2', weekdays: ['TUE', 'THU', 'WED'] }
]
```
<p>I want to display this data like below:
output display</p>
<p>Weekdays will display but only blue color when value exists in weekdays key.</p>
<p>But here problem is when I click on Monday on 2nd row(from the above image), change the color to transparent. But I'm getting index 0 everytime.</p>
<p>How can i achieve this.</p>
<p>I'm new to this community and ofcourse I'm new to this Vue3 Javascript also. Please let me know if I miss any details.</p>
<p>HTML code:</p>
<pre class="lang-html prettyprint-override"><code><div
  v-for="(st, index) in mainList"
  :key="strategy"
  class="flex flex-row justify-between gap-x-2"
>
  <div>{{ st.id }}</div>
  <div>{{ st.name }}</div>
  <div>
    <!-- Week days -->
    <div class="flex items-center">
      <input
        id="mon"
        v-model="st.weekdays"
        type="checkbox"
        :value="st.weekdays.includes('MON') ? 'MON' : false"
        checked="st.weekdays.includes('MON')"
        class="sr_only hidden peer"
        @click="changeWeekdays($event, st.id)"
      />
      <label
        for="mon"
        class="px-2 py-1 w-12 text-sm border text-center rounded-md cursor-pointer focus:outline-none hover:bg-blue-600 peer-checked:bg-blue-900 peer-checked:border-transparent duration-200 ease-in-out"
        >Mon
      </label>
    </div>

    <div class="flex items-center">
      <input
        id="tue"
        v-model="st.weekdays"
        type="checkbox"
        :value="st.weekdays.includes('TUE') ? 'TUE' : false"
        checked="st.weekdays.includes('TUE')"
        class="sr_only hidden peer"
        @click="changeWeekdays($event, st.id)"
      />
      <label
        for="tue"
        class="px-2 py-1 w-12 text-sm border text-center rounded-md cursor-pointer focus:outline-none hover:bg-blue-600 peer-checked:bg-blue-900 peer-checked:border-transparent duration-200 ease-in-out"
        >Tue
      </label>
    </div>
    .
    .
    .

    <div class="flex items-center">
      <input
        id="fri"
        v-model="st.weekdays"
        type="checkbox"
        :value="st.weekdays.includes('FRI') ? 'FRI' : false"
        checked="st.weekdays.includes('FRI')"
        class="sr_only hidden peer"
        @click="changeWeekdays($event, st.id)"
      />
      <label
        for="fri"
        class="px-2 py-1 w-12 text-sm border text-center rounded-md cursor-pointer focus:outline-none hover:bg-blue-600 peer-checked:bg-blue-900 peer-checked:border-transparent duration-200 ease-in-out"
        >Fri
      </label>
    </div>
  </div>
</div>
</code>```

Script block:

methods: {
    changeRundays(e, id) { }
```

In this I'm getting first record's id everytime though I click on 2nd or 3rd row in the list.

Please let me know.

Body:
I have array and inside of it have weekdays.
example: mainList:

[
  { id: '1', name: 'st1', weekdays: ['TUE', 'WED', 'MON', 'THU'] },
  { id: '2', name: 'sty5676', weekdays: ['FRI', 'MON', 'TUE', 'THU'] },
  { id: '3', name: 'st2', weekdays: ['TUE', 'THU', 'WED'] }
]

I want to display this data like below:
output display

Weekdays will display but only blue color when value exists in weekdays key.

But here problem is when I click on Monday on 2nd row(from the above image), change the color to transparent. But I'm getting index 0 everytime.

How can i achieve this.

I'm new to this community and ofcourse I'm new to this Vue3 Javascript also. Please let me know if I miss any details.

HTML code:

{{ st.id }}

{{ st.name }}

      <input
        id="mon"
        v-model="st.weekdays"
        type="checkbox"
        :value="st.weekdays.includes('MON') ? 'MON' : false"
        checked="st.weekdays.includes('MON')"
        class="sr_only hidden peer"
        @click="changeWeekdays($event, st.id)"
      />
      Mon

      <input
        id="tue"
        v-model="st.weekdays"
        type="checkbox"
        :value="st.weekdays.includes('TUE') ? 'TUE' : false"
        checked="st.weekdays.includes('TUE')"
        class="sr_only hidden peer"
        @click="changeWeekdays($event, st.id)"
      />
      Tue

    .
    .
    .

      <input
        id="fri"
        v-model="st.weekdays"
        type="checkbox"
        :value="st.weekdays.includes('FRI') ? 'FRI' : false"
        checked="st.weekdays.includes('FRI')"
        class="sr_only hidden peer"
        @click="changeWeekdays($event, st.id)"
      />
      Fri

Script block:

methods: {
    changeRundays(e, id) { }

In this I'm getting first record's id everytime though I click on 2nd or 3rd row in the list.

Please let me know.


问:
How to write a file to a device paired via the WebUSB API
Is it possible to write a file to a USBDevice object after it has been paired in browser? Specifically when the device is mass storage such as a USB Flash Drive or SD card, and a compatible browser (such as Chrome >=61)?

After running the following lines of JS:

const usbDevice = await navigator.usb.requestDevice();

// After selecting the device, and
// assuming that both of these Promises don't throw errors

await usbDevice.open();
```

Can a transfer (whether isochronous or otherwise) be instantiated to write a new text file to the connected mass storage?

If so, what protocol/s would need to be used in order to do so if the data must be sent raw?

Body:
Is it possible to write a file to a USBDevice object after it has been paired in browser? Specifically when the device is mass storage such as a USB Flash Drive or SD card, and a compatible browser (such as Chrome >=61)?

After running the following lines of JS:

const usbDevice = await navigator.usb.requestDevice();

// After selecting the device, and
// assuming that both of these Promises don't throw errors

await usbDevice.open();

Can a transfer (whether isochronous or otherwise) be instantiated to write a new text file to the connected mass storage?

If so, what protocol/s would need to be used in order to do so if the data must be sent raw?


问:
Python upper() function
What does upper() do here?

```<code>def print_formatted(number):
    max_width = len(bin(number)[2:])
    for i in range(1,number+1):
        print(str(i).rjust(max_width)  + " " +oct(i)[2:].rjust(max_width) + " " +(hex(i)[2:].upper()).rjust(max_width) + " " +bin(i)[2:].rjust(max_width))

if __name__ == '__main__':
    n = int(input())
    print_formatted(n)
</code>```

I understood all code, I just didn't understand what upper() does in this specific code. I'm a beginner

Title: Python upper() function

Body:
What does upper() do here?

def print_formatted(number):
    max_width = len(bin(number)[2:])
    for i in range(1,number+1):
        print(str(i).rjust(max_width)  + " " +oct(i)[2:].rjust(max_width) + " " +(hex(i)[2:].upper()).rjust(max_width) + " " +bin(i)[2:].rjust(max_width))

if __name__ == '__main__':
    n = int(input())
    print_formatted(n)

I understood all code, I just didn't understand what upper() does in this specific code. I'm a beginner


问:
How can I locate the JupyterLab bin folder to add to PATH?
I installed JupyterLab using

```<code>pip install jupyterlab
</code>```

in my user directory. The installation guide says, "You must add the user-level bin directory to your PATH environment variable in order to launch jupyter lab" (and as expected, when I try to launch it with jupyter lab, it says the term is not recognized and doesn't launch anything). However, I cannot seem to locate said bin directory. Is there an easy way to track down its location? I'm using Windows 10.

I found the same question from 3 years ago but it wasn't answered directly, only given an alternative solution for launching Jupyter - however, that alternative solution did not work for me, hence the re-posting of the question.

Thank you for any guidance.

Body:
I installed JupyterLab using

pip install jupyterlab

in my user directory. The installation guide says, "You must add the user-level bin directory to your PATH environment variable in order to launch jupyter lab" (and as expected, when I try to launch it with jupyter lab, it says the term is not recognized and doesn't launch anything). However, I cannot seem to locate said bin directory. Is there an easy way to track down its location? I'm using Windows 10.

I found the same question from 3 years ago but it wasn't answered directly, only given an alternative solution for launching Jupyter - however, that alternative solution did not work for me, hence the re-posting of the question.

Thank you for any guidance.


问:
Android Test Runner can find tests in a class but not in a package
Why would the Android Instrumentation Runner fail to find tests in a package?

This is an old and quite large project, and it used to work but now it does not. I have tried creating a brand new test project, and it works fine. I do not know where to start in trying to pinpoint the problem.

Here is the experience I am having:

I run the following on the command line:

```<code>am instrument -w -r    -e debug false -e class 'com.datmedia.mediaplayertest.ScreenControl.LgTranslatorTests' com.datmedia.mediaplayertest.test/androidx.test.runner.AndroidJUnitRunner
</code>```

It correctly finds the tests in my LgTranslatorTests class and runs them.

```<code>INSTRUMENTATION_CODE: -1
ts' com.datmedia.mediaplayertest.test/androidx.test.runner.AndroidJUnitRunner <
INSTRUMENTATION_STATUS: numtests=3
INSTRUMENTATION_STATUS: stream=
com.datmedia.mediaplayertest.ScreenControl.LgTranslatorTests:
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: test=readPartialMessage
INSTRUMENTATION_STATUS: class=com.datmedia.mediaplayertest.ScreenControl.LgTranslatorTests
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS_CODE: 1
INSTRUMENTATION_STATUS: numtests=3
INSTRUMENTATION_STATUS: stream=.
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: test=readPartialMessage
INSTRUMENTATION_STATUS: class=com.datmedia.mediaplayertest.ScreenControl.LgTranslatorTests
(...)
INSTRUMENTATION_RESULT: stream=

Time: 0.242

OK (3 tests)
</code>```

But if I attempt to run all of the tests in the containing package, the test runner fails to find any.

```<code>am instrument -w -r -e package com.datmedia.mediaplayertest.ScreenControl -e debug false com.datmedia.mediaplayertest.test/androidx.test.runner.AndroidJUnitRunner
</code>```

Spits out the following:

```<code>INSTRUMENTATION_RESULT: stream=

Time: 0

OK (0 tests)

INSTRUMENTATION_CODE: -1

</code>```

I found that the tests could run successfully on an Android 11 device but not on an Android 4.4 device.

On the Android 4.4 device (when it fails to locate tests), I get the following warnings and errors:

```<code>2023-01-23 10:04:22.074  2910-2910  dalvikvm                com.datmedia.mediaplayertest.test    W  VFY: unable to resolve static method 5065: Landroidx/test/internal/util/ReflectionUtil;.reflectivelyInvokeRemoteMethod (Ljava/lang/String;Ljava/lang/String;)V
2023-01-23 10:04:22.084  2910-2910  dalvikvm                com.datmedia.mediaplayertest.test    W  VFY: unable to resolve instance field 7
2023-01-23 10:04:22.084  2910-2910  dalvikvm                com.datmedia.mediaplayertest.test    W  VFY: unable to resolve virtual method 4699: Landroidx/test/internal/runner/hidden/ExposedInstrumentationApi;.execStartActivity (Landroid/content/Context;Landroid/os/IBinder;Landroid/os/IBinder;Landroid/app/Activity;Landroid/content/Intent;I)Landroid/app/Instrumentation$ActivityResult;
2023-01-23 10:04:22.084  2910-2910  dalvikvm                com.datmedia.mediaplayertest.test    W  VFY: unable to resolve virtual method 4703: Landroidx/test/internal/runner/hidden/ExposedInstrumentationApi;.execStartActivity (Landroid/content/Context;Landroid/os/IBinder;Landroid/os/IBinder;Ljava/lang/String;Landroid/content/Intent;ILandroid/os/Bundle;)Landroid/app/Instrumentation$ActivityResult;
2023-01-23 10:04:26.914  2910-2910  dalvikvm                com.datmedia.mediaplayertest.test    W  VFY: unable to resolve virtual method 122: Landroid/content/pm/PackageManager;.isInstantApp ()Z
2023-01-23 10:04:26.924  2910-2910  dalvikvm                com.datmedia.mediaplayertest.test    W  VFY: unable to resolve virtual method 37: Landroid/app/UiAutomation;.executeShellCommand (Ljava/lang/String;)Landroid/os/ParcelFileDescriptor;
2023-01-23 10:04:27.074  2910-2950  dalvikvm                com.datmedia.mediaplayertest.test    W  Unable to resolve superclass of Landroidx/core/app/CoreComponentFactory; (7)
2023-01-23 10:04:27.074  2910-2950  dalvikvm                com.datmedia.mediaplayertest.test    W  Link of class 'Landroidx/core/app/CoreComponentFactory;' failed
2023-01-23 10:04:27.074  2910-2950  dalvikvm                com.datmedia.mediaplayertest.test    W  Unable to resolve superclass of Landroidx/core/app/CoreComponentFactory; (7)
2023-01-23 10:04:27.074  2910-2950  dalvikvm                com.datmedia.mediaplayertest.test    W  Link of class 'Landroidx/core/app/CoreComponentFactory;' failed
2023-01-23 10:04:27.074  2910-2950  TestLoader              com.datmedia.mediaplayertest.test    E  Could not find class: androidx.core.app.CoreComponentFactory
2023-01-23 10:04:27.364  2910-2950  dalvikvm                com.datmedia.mediaplayertest.test    W  Unable to match class for part: 'Ljava/nio/file/Path;Ljava/lang/String;[Ljava/nio/file/attribute/FileAttribute;)Ljava/nio/file/Path;'
2023-01-23 10:04:27.364  2910-2950  AndroidJUnit4Builder    com.datmedia.mediaplayertest.test    W  java.lang.NoClassDefFoundError: java/nio/file/Path in hasTestMethods for kotlin.io.path.PathsKt__PathUtilsKt
2023-01-23 10:04:27.454  2910-2950  dalvikvm                com.datmedia.mediaplayertest.test    W  Unable to match class for part: 'Ljava/util/stream/Stream;'
2023-01-23 10:04:27.454  2910-2950  AndroidJUnit4Builder    com.datmedia.mediaplayertest.test    W  java.lang.NoClassDefFoundError: java/util/stream/Stream in hasTestMethods for io.reactivex.rxjava3.processors.MulticastProcessor
2023-01-23 10:04:27.684  2910-2950  InfraTrack              com.datmedia.mediaplayertest.test    W  Analytics post: AndroidJUnitRunner=1.1.0 failed.
2023-01-23 10:04:27.694  2910-2950  dalvikvm                com.datmedia.mediaplayertest.test    W  VFY: unable to resolve static method 290: Landroid/os/Trace;.isEnabled ()Z
</code>```

Body:
Why would the Android Instrumentation Runner fail to find tests in a package?

This is an old and quite large project, and it used to work but now it does not. I have tried creating a brand new test project, and it works fine. I do not know where to start in trying to pinpoint the problem.

Here is the experience I am having:

I run the following on the command line:

am instrument -w -r    -e debug false -e class 'com.datmedia.mediaplayertest.ScreenControl.LgTranslatorTests' com.datmedia.mediaplayertest.test/androidx.test.runner.AndroidJUnitRunner

It correctly finds the tests in my LgTranslatorTests class and runs them.

INSTRUMENTATION_CODE: -1
ts' com.datmedia.mediaplayertest.test/androidx.test.runner.AndroidJUnitRunner <
INSTRUMENTATION_STATUS: numtests=3
INSTRUMENTATION_STATUS: stream=
com.datmedia.mediaplayertest.ScreenControl.LgTranslatorTests:
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: test=readPartialMessage
INSTRUMENTATION_STATUS: class=com.datmedia.mediaplayertest.ScreenControl.LgTranslatorTests
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS_CODE: 1
INSTRUMENTATION_STATUS: numtests=3
INSTRUMENTATION_STATUS: stream=.
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: test=readPartialMessage
INSTRUMENTATION_STATUS: class=com.datmedia.mediaplayertest.ScreenControl.LgTranslatorTests
(...)
INSTRUMENTATION_RESULT: stream=

Time: 0.242

OK (3 tests)

But if I attempt to run all of the tests in the containing package, the test runner fails to find any.

am instrument -w -r -e package com.datmedia.mediaplayertest.ScreenControl -e debug false com.datmedia.mediaplayertest.test/androidx.test.runner.AndroidJUnitRunner

Spits out the following:

INSTRUMENTATION_RESULT: stream=

Time: 0

OK (0 tests)

INSTRUMENTATION_CODE: -1

I found that the tests could run successfully on an Android 11 device but not on an Android 4.4 device.

On the Android 4.4 device (when it fails to locate tests), I get the following warnings and errors:

2023-01-23 10:04:22.074  2910-2910  dalvikvm                com.datmedia.mediaplayertest.test    W  VFY: unable to resolve static method 5065: Landroidx/test/internal/util/ReflectionUtil;.reflectivelyInvokeRemoteMethod (Ljava/lang/String;Ljava/lang/String;)V
2023-01-23 10:04:22.084  2910-2910  dalvikvm                com.datmedia.mediaplayertest.test    W  VFY: unable to resolve instance field 7
2023-01-23 10:04:22.084  2910-2910  dalvikvm                com.datmedia.mediaplayertest.test    W  VFY: unable to resolve virtual method 4699: Landroidx/test/internal/runner/hidden/ExposedInstrumentationApi;.execStartActivity (Landroid/content/Context;Landroid/os/IBinder;Landroid/os/IBinder;Landroid/app/Activity;Landroid/content/Intent;I)Landroid/app/Instrumentation$ActivityResult;
2023-01-23 10:04:22.084  2910-2910  dalvikvm                com.datmedia.mediaplayertest.test    W  VFY: unable to resolve virtual method 4703: Landroidx/test/internal/runner/hidden/ExposedInstrumentationApi;.execStartActivity (Landroid/content/Context;Landroid/os/IBinder;Landroid/os/IBinder;Ljava/lang/String;Landroid/content/Intent;ILandroid/os/Bundle;)Landroid/app/Instrumentation$ActivityResult;
2023-01-23 10:04:26.914  2910-2910  dalvikvm                com.datmedia.mediaplayertest.test    W  VFY: unable to resolve virtual method 122: Landroid/content/pm/PackageManager;.isInstantApp ()Z
2023-01-23 10:04:26.924  2910-2910  dalvikvm                com.datmedia.mediaplayertest.test    W  VFY: unable to resolve virtual method 37: Landroid/app/UiAutomation;.executeShellCommand (Ljava/lang/String;)Landroid/os/ParcelFileDescriptor;
2023-01-23 10:04:27.074  2910-2950  dalvikvm                com.datmedia.mediaplayertest.test    W  Unable to resolve superclass of Landroidx/core/app/CoreComponentFactory; (7)
2023-01-23 10:04:27.074  2910-2950  dalvikvm                com.datmedia.mediaplayertest.test    W  Link of class 'Landroidx/core/app/CoreComponentFactory;' failed
2023-01-23 10:04:27.074  2910-2950  dalvikvm                com.datmedia.mediaplayertest.test    W  Unable to resolve superclass of Landroidx/core/app/CoreComponentFactory; (7)
2023-01-23 10:04:27.074  2910-2950  dalvikvm                com.datmedia.mediaplayertest.test    W  Link of class 'Landroidx/core/app/CoreComponentFactory;' failed
2023-01-23 10:04:27.074  2910-2950  TestLoader              com.datmedia.mediaplayertest.test    E  Could not find class: androidx.core.app.CoreComponentFactory
2023-01-23 10:04:27.364  2910-2950  dalvikvm                com.datmedia.mediaplayertest.test    W  Unable to match class for part: 'Ljava/nio/file/Path;Ljava/lang/String;[Ljava/nio/file/attribute/FileAttribute;)Ljava/nio/file/Path;'
2023-01-23 10:04:27.364  2910-2950  AndroidJUnit4Builder    com.datmedia.mediaplayertest.test    W  java.lang.NoClassDefFoundError: java/nio/file/Path in hasTestMethods for kotlin.io.path.PathsKt__PathUtilsKt
2023-01-23 10:04:27.454  2910-2950  dalvikvm                com.datmedia.mediaplayertest.test    W  Unable to match class for part: 'Ljava/util/stream/Stream;'
2023-01-23 10:04:27.454  2910-2950  AndroidJUnit4Builder    com.datmedia.mediaplayertest.test    W  java.lang.NoClassDefFoundError: java/util/stream/Stream in hasTestMethods for io.reactivex.rxjava3.processors.MulticastProcessor
2023-01-23 10:04:27.684  2910-2950  InfraTrack              com.datmedia.mediaplayertest.test    W  Analytics post: AndroidJUnitRunner=1.1.0 failed.
2023-01-23 10:04:27.694  2910-2950  dalvikvm                com.datmedia.mediaplayertest.test    W  VFY: unable to resolve static method 290: Landroid/os/Trace;.isEnabled ()Z


问:
How to add PDF/ Print capability as in Safari's Share sheet?
Here's my typical code to share my app's text, images and sound file in the app.

```<code>static func share(viewController: UIViewController, title: String?, body: String?, attachments: [Attachment], recordings: [Recording]) {
    var activityItems = [Any]()

    if let title = title {
        activityItems.append(title)
    }

    if let body = body {
        activityItems.append(body)
    }

    for attachment in attachments {
        let path = attachment.path
        let fileURL = NSURL(fileURLWithPath: path)
        activityItems.append(fileURL)
    }

    for recording in recordings {
        let path = recording.path
        let fileURL = NSURL(fileURLWithPath: path)
        activityItems.append(fileURL)
    }

    let activityViewController = UIActivityViewController(activityItems: activityItems, applicationActivities: nil)

    viewController.present(activityViewController, animated: true)
}
</code>```

and here's the outcome.

I do however, notice that Safari has the capability, to let user has an option to share the content, as a PDF file.

Here's the share feature in Safari.

I was wondering, how is this being done by using UIActivityViewController? Or, such a PDF feature is an undocumented API in UIActivityViewController, and is not available for public usage?

Body:
Here's my typical code to share my app's text, images and sound file in the app.

static func share(viewController: UIViewController, title: String?, body: String?, attachments: [Attachment], recordings: [Recording]) {
    var activityItems = [Any]()

    if let title = title {
        activityItems.append(title)
    }

    if let body = body {
        activityItems.append(body)
    }

    for attachment in attachments {
        let path = attachment.path
        let fileURL = NSURL(fileURLWithPath: path)
        activityItems.append(fileURL)
    }

    for recording in recordings {
        let path = recording.path
        let fileURL = NSURL(fileURLWithPath: path)
        activityItems.append(fileURL)
    }

    let activityViewController = UIActivityViewController(activityItems: activityItems, applicationActivities: nil)

    viewController.present(activityViewController, animated: true)
}

and here's the outcome.

I do however, notice that Safari has the capability, to let user has an option to share the content, as a PDF file.

Here's the share feature in Safari.

I was wondering, how is this being done by using UIActivityViewController? Or, such a PDF feature is an undocumented API in UIActivityViewController, and is not available for public usage?


问:
How are some apps updating widgets every second?
How is it possible for some apps on App Store to have their widgets update every second, when we all know that Apple only allows for up to 70 or so updates every 24 hours?

Here is an example of one app that does this:

https://apps.apple.com/us/app/analog-clock-widgets/id1593608656

I have been staring at it for the last 30 minutes, and it made way more than 70 updates in those 30 minutes. It is precise and it doesn't lag. It doesn't have location services or background refresh. What is worse, its seconds hand (analog clock) sweeps through it like a mechanical watch. In one minute, it probably does a couple of hundreds of refreshes. The only thing I can think of is private API. But what and how?

I tried using all kind of different code, but lately this one works for one minute updates, Credit goes to pawell02222 from this link:

Updating time text label each minute in WidgetKit

```<code>    for offset in 0 ..< 60 * 24 {
        let entryDate = Calendar.current.date(byAdding: .minute, value: offset, to: midnight)!
        entries.append(SimpleEntry(date: entryDate))
    }
</code>```

Body:
How is it possible for some apps on App Store to have their widgets update every second, when we all know that Apple only allows for up to 70 or so updates every 24 hours?

Here is an example of one app that does this:

https://apps.apple.com/us/app/analog-clock-widgets/id1593608656

I have been staring at it for the last 30 minutes, and it made way more than 70 updates in those 30 minutes. It is precise and it doesn't lag. It doesn't have location services or background refresh. What is worse, its seconds hand (analog clock) sweeps through it like a mechanical watch. In one minute, it probably does a couple of hundreds of refreshes. The only thing I can think of is private API. But what and how?

I tried using all kind of different code, but lately this one works for one minute updates, Credit goes to pawell02222 from this link:

Updating time text label each minute in WidgetKit

    for offset in 0 ..< 60 * 24 {
        let entryDate = Calendar.current.date(byAdding: .minute, value: offset, to: midnight)!
        entries.append(SimpleEntry(date: entryDate))
    }


问:
Is there a way to collect recorded voice data?
I'm looking for a way to collect voice data on Qualtrics. Specifically, I would like participants to record their responses through voice and be able to analyse them. Phonics.ai seems like a good tool, and it works very well, but it's also too costly for a grad student like me.

Is there an alternative software or method I can look at? I do not have any programming background, so it would be challenging for me to build one by myself.


问:
how to postpone a open event in post operation in windows kernel WDK?
Basically, I am trying to learn file system mini-filter driver development, currently following microsoft's AVScan example at: https://github.com/microsoft/Windows-driver-samples/tree/main/filesys/miniFilter/avscan

Under AvScanInUser function on scan.c file, I send the file path to user mode for scanning as oppose to microsoft's example where they map a section of the file in memory and then tell the user mode to scan that section of the memory (I am not concerned about this right now).

Sometimes, it may take a while for user mode to scan the file. So, I am wondering if there is a way for the kernel to not release the current file open event and hold it until a message is received from user mode under MessageNotifyCallback from FltCreateCommunicationPort, while in the meantime do process other files.

If you are suggesting to use threads, I would really appreciate if you could tell me how would I implement it in the AVScan's example.