问:
#HTML Input and output variables(IXL Bot)
I'm trying to make a bot that does equations that a standard calculator can't. I'm okay with using HTML, CSS, and Javascript. I want it to do this: If I put a specific question in the textbox, like "Is 48 a composite or prime number?" it sends an alert and in the alert, it says "Composite" but I want it so I can put in multiple questions in the textbox, for now, I can only have one question or it crashes. Here is my code so far.

```<code><!DOCTYPE html>
<html>
    <input type="text" id="text" placeholder="text here"></input>
    <button type="button" id="u" onclick="run()">submit</button>
    <script type="text/javascript">

        var a = 1;
        function run() {
            if (document.getElementById("text").value.includes("Is 48 a prime number or a composite number?")) {
                alert("Composite");
                document.body.innerHTML += "<li>attempt #" + a + ": correct";
                a++
            } else {
                alert("try again!")
                document.body.innerHTML += "<li>attempt #" + a + ": try again";
                a++
            }

        }
    </script>
</html>
</code>```

I need help with this part. I need so multiple questions can be put in the textbox and a different output comes out every time.

```<code>var a = 1;
function run() {
    if (document.getElementById("text").value.includes("Is 48 a prime number or a composite number?")) {
        alert("Composite");
    }
}
</code>```

I tried to copy and paste the code a few times it didn't work. I tried to change the variable name the thing crashed.

Thank you to anyone who helps.

I'm expecting a textbox where if you put in a question it answers but it is a word problem so a normal calculator won't always work.

Body:
I'm trying to make a bot that does equations that a standard calculator can't. I'm okay with using HTML, CSS, and Javascript. I want it to do this: If I put a specific question in the textbox, like "Is 48 a composite or prime number?" it sends an alert and in the alert, it says "Composite" but I want it so I can put in multiple questions in the textbox, for now, I can only have one question or it crashes. Here is my code so far.

<!DOCTYPE html>

    <input type="text" id="text" placeholder="text here"></input>
    <button type="button" id="u" onclick="run()">submit</button>

I need help with this part. I need so multiple questions can be put in the textbox and a different output comes out every time.

var a = 1;
function run() {
    if (document.getElementById("text").value.includes("Is 48 a prime number or a composite number?")) {
        alert("Composite");
    }
}

I tried to copy and paste the code a few times it didn't work. I tried to change the variable name the thing crashed.

Thank you to anyone who helps.

I'm expecting a textbox where if you put in a question it answers but it is a word problem so a normal calculator won't always work.


来源: stackexchange

问:
How to clean incorrect data by histotical data in ML
Describe:
The demand is about ecommercial sales forecast based on the incremetal datastream.We have a serials of historical snapshot, data source from kafka, includes those columns,productID,sellerID,sales,promotion,festival,date.

productID
sellerID
sales
promotion
festival
date

A
S1
175
0
0
2022-12-14

B
S1
10
0
0
2022-12-14

A
S1
193
0
0
2022-12-15

A
S1
98
0
0
2022-12-16

A
S1
1100
1
0
2022-12-17

A
S1
1300
0
0
2022-12-20

A
S1
187
0
0
2022-12-21

A
S1
8700
0
0
2022-12-22

...
...
...
...
...
...

From above data, there is some incorrect data like 1300,8700.1100 is maybe a correct number because of the factor promotion.We must take factors into account.The data is reading from kafka via Flink.So how to clean incorrect data from incremental datastream?

ContentLicense: CC BY-SA 4.0


问:
Nothing is displayed by the web server
After running the command "npm start," my React and Redux-based LinkedIn clone doesn't display anything on the web server.

As I write the header code, the LinkedIn header on the server should appear.`

file name :Header.js

```<code>import React from 'react';
import "./Header.css";
import HeaderOption from './HeaderOption';
import SearchIcon from '@mui/icons-material/Search';
import HomeIcon from '@mui/icons-material/Home';
import SupervisorAccountIcon from '@mui/icons-material/SupervisorAccount';

function Header() {
  return (
    <div className='header' >
      <div className='header_left' >
        <img src='https://upload.wikimedia.org/wikipedia/commons/thumb/8/81/LinkedIn_icon.svg/2048px-LinkedIn_icon.svg.png' alt='' />
        <div className='header_search' >
          <SearchIcon />
          <input type="text" />
        </div>

      </div>
      <div className='header_right' >
        <HeaderOption Icon={HomeIcon} title="home" />
        <HeaderOption Icon={SupervisorAccountIcon} title="My Network" />
      </div>
    </div>
  );
}

export default Header;

</code>```

file name : HeaderOption.js

```<code>import React from 'react';
import "./HeaderOption.css";

function HeaderOption(Icon, title) {
  return (
    <div className='headeroption'>
      {Icon && <Icon className="headeroption_icon" />}
      <h3 className='headeroption_title'>{title}</h3>

    </div>
  );
}
export default HeaderOption;
</code>```

file name :App.js

```<code>import React from 'react';
import './App.css';
import Header from "./Header";

function App() {
  return (
    <div className="app">

      {/* header */}
      <Header />
      {/* App body */}
      {/* Sidebar */}
      {/* Feed */}
      {/* Widgets */}
    </div>
  );
}

export default App;
</code>```

Title: Nothing is displayed by the web server

Body:
After running the command "npm start," my React and Redux-based LinkedIn clone doesn't display anything on the web server.

As I write the header code, the LinkedIn header on the server should appear.`

file name :Header.js

import React from 'react';
import "./Header.css";
import HeaderOption from './HeaderOption';
import SearchIcon from '@mui/icons-material/Search';
import HomeIcon from '@mui/icons-material/Home';
import SupervisorAccountIcon from '@mui/icons-material/SupervisorAccount';

function Header() {
  return (

          <SearchIcon />
          <input type="text" />

        <HeaderOption Icon={HomeIcon} title="home" />
        <HeaderOption Icon={SupervisorAccountIcon} title="My Network" />

  );
}

export default Header;

file name : HeaderOption.js

import React from 'react';
import "./HeaderOption.css";

function HeaderOption(Icon, title) {
  return (

      {Icon && <Icon className="headeroption_icon" />}

{title}

  );
}
export default HeaderOption;

file name :App.js

import React from 'react';
import './App.css';
import Header from "./Header";

function App() {
  return (

      {/* header */}

      {/* App body */}
      {/* Sidebar */}
      {/* Feed */}
      {/* Widgets */}

  );
}

export default App;


问:
Increment the field value with using max field value in mongodb collection
How to auto increment the field value using maximum field value in MongoDB collection.

Suppose I have some documents in collection with Emp id= 1,2,3,4 like this if i add new documents then Emp id field is automatically increase.

```<code>db.col1.find({'Empid: 1}, {'Empid': 2}, {'Empid':3}, {'Empid': 4})
</code>```

then I add another 3 new documents, which will come like this

```<code>db.col1.find({'Empid: 1}, {'Empid': 2}, {'Empid':3}, {'Empid': 4},{'Empid':5}, {'Empid':6}, {'Empid':7})
</code>```

Thanks.

Body:
How to auto increment the field value using maximum field value in MongoDB collection.

Suppose I have some documents in collection with Emp id= 1,2,3,4 like this if i add new documents then Emp id field is automatically increase.

db.col1.find({'Empid: 1}, {'Empid': 2}, {'Empid':3}, {'Empid': 4})

then I add another 3 new documents, which will come like this

db.col1.find({'Empid: 1}, {'Empid': 2}, {'Empid':3}, {'Empid': 4},{'Empid':5}, {'Empid':6}, {'Empid':7})

Thanks.


问:
No instance of Strings was loaded. Try to initialize the Strings delegate before accessing Strings.current
I am writing test for ViewModel. In that process I don't have access to BuildContext. When I use as Strings.current.SOME_KEY in that scenario I got an error.

Here is my code:

```<code>void main() {
  late MyViewModel viewModel;

  setUpAll(() {});

  setUp(() {
    setupLocators();
    viewModel = MyViewModel(repository: Locators.repository);
  });

  test("MyViewModel has some initial data", () async {
    expect(viewModel.selectedColorType.value, -1 );
    viewModel.setSelectedColorType= const Color(title: "title", value: 1);

    expect(viewModel.selectedColor.value, 1);
  });
}
</code>```

In this scenario I am facing following error:

```<code>Testing started at 11:48 AM ...

dart:core                                                                           _AssertionError._throwNew
package:my_mobile_app/generated/l10n.dart 21:12                                      Strings.current
package: my_mobile_app/view_models/colors/color_view_model.dart 11:13  new ColorsViewModel
test/view_models/colors/_view_model_test.dart 18:17             main.<fn>

'package: my_mobile_app/generated/l10n.dart': Failed assertion: line 21 pos 12: '_current != null': No instance of Strings was loaded. Try to initialize the Strings delegate before accessing Strings.current.
</code>```

Is there any other way I can access these localized strings.

On ColorsViewModel screen I do have following declaration which shows in log:

```<code>final List<String> stepTitles = [
    Strings.current.firstPage,
    Strings.current.secondPage,
    Strings.current.thirdPage,
    Strings.current.fourthPage
  ];
</code>```

Body:
I am writing test for ViewModel. In that process I don't have access to BuildContext. When I use as Strings.current.SOME_KEY in that scenario I got an error.

Here is my code:

void main() {
  late MyViewModel viewModel;

  setUpAll(() {});

  setUp(() {
    setupLocators();
    viewModel = MyViewModel(repository: Locators.repository);
  });

  test("MyViewModel has some initial data", () async {
    expect(viewModel.selectedColorType.value, -1 );
    viewModel.setSelectedColorType= const Color(title: "title", value: 1);

    expect(viewModel.selectedColor.value, 1);
  });
}

In this scenario I am facing following error:

Testing started at 11:48 AM ...

dart:core                                                                           _AssertionError._throwNew
package:my_mobile_app/generated/l10n.dart 21:12                                      Strings.current
package: my_mobile_app/view_models/colors/color_view_model.dart 11:13  new ColorsViewModel
test/view_models/colors/_view_model_test.dart 18:17             main.<fn>

'package: my_mobile_app/generated/l10n.dart': Failed assertion: line 21 pos 12: '_current != null': No instance of Strings was loaded. Try to initialize the Strings delegate before accessing Strings.current.

Is there any other way I can access these localized strings.

On ColorsViewModel screen I do have following declaration which shows in log:

final List<String> stepTitles = [
    Strings.current.firstPage,
    Strings.current.secondPage,
    Strings.current.thirdPage,
    Strings.current.fourthPage
  ];


问:
Trouble configuring NextAuth and tRPC's Websockets when deploying
I have built an app with tRPCv10 and NextAuth. As my app requires realtime updates, I have followed tRPC's docs on implementing subscriptions with websockets. tRPC docs on subscription tRPC example app.

From what I understand, to use websockets in tRPC, I need to create a standalone http server and run it alongside my Nextjs app. When I emit data through EventEmitter, the data is proxied through this http server and sent to all other subscribers. Thus, I have deployed my standalone http server on Railway with port 6957, and my Nextjs app on Vercel

Everything is working well when I am developing, through localhost. However, when I'm trying to deploy it, there is an error trying to connect to the websocket server and I'm receiving a NextAuth error when logging in too.

For example, my server name is "https://xxx-server.up.railway.app/" and my Nextjs app is "https://xxx-client.vercel.app/".

On the client side, I'm receiving an error: WebSocket connection to 'wss://xxx-server.up.railway.app:6957/' failed. When I hit the login button which runs the authorize function in NextAuth, the console returns the error: POST https://xxx-client.vercel.app/api/auth/calback/credentials? 401.

For reference, here are the file for _app.tsx and my websocket server:

```<code>// _app.tsx
const MyApp: AppType = ({
  Component,
  pageProps: { session, ...pageProps },
}) => {
  return (

      <SessionProvider session={session} refetchOnWindowFocus={false}>
        <Component {...pageProps} />
      </SessionProvider>
  );
};

const getBaseUrl = () => {
  if (typeof window !== "undefined") {
    return "";
  }
  if (process.env.VERCEL_URL) return `https://${process.env.VERCEL_URL}`; // SSR should use vercel url

  return `http://localhost:${process.env.PORT ?? 3000}`; // dev SSR should use localhost
};

function getEndingLink() {
  if (typeof window === "undefined") {
    return httpBatchLink({
      url: `${getBaseUrl()}/api/trpc`,
    });
  }

  const client = createWSClient({
    url: "wss://xxx-server.up.railway.app:6957"
  });

  return wsLink<AppRouter>({
    client,
  });
}

export default withTRPC<AppRouter>({
  config({ ctx }) {
    /**
     * If you want to use SSR, you need to use the server's full URL
     * @link https://trpc.io/docs/ssr
     */
    const url = `${getBaseUrl()}/api/trpc`;

    return {
      url,
      transformer: superjson,
      links: [getEndingLink()],

      /**
       * @link https://react-query.tanstack.com/reference/QueryClient
       */
      // queryClientConfig: { defaultOptions: { queries: { staleTime: 60 } } },
    };
  },
  /**
   * @link https://trpc.io/docs/ssr
   */
  ssr: true,
})(MyApp);
</code>```
```<code>// prodServer.ts
const port = parseInt(process.env.PORT || "3000", 10);
const dev = process.env.NODE_ENV !== "production";
const app = next({ dev });
const handle = app.getRequestHandler();

app.prepare().then(() => {
  const server = http.createServer((req, res) => {
    const proto = req.headers["x-forwarded-proto"];
    if (proto && proto === "http") {
      // redirect to ssl
      res.writeHead(303, {
        location: `https://` + req.headers.host + (req.headers.url ?? ""),
      });
      res.end();
      return;
    }
    const parsedUrl = parse(req.url!, true);
    handle(req, res, parsedUrl);
  });
  const wss = new ws.Server({ server });
  const handler = applyWSSHandler({ wss, router: appRouter, createContext });

  process.on("SIGTERM", () => {
    console.log("SIGTERM");
    handler.broadcastReconnectNotification();
  });
  server.listen(port);

  // tslint:disable-next-line:no-console
  console.log(
    `> Server listening at http://localhost:${port} as ${
      dev ? "development" : process.env.NODE_ENV
    }`
  );
});
</code>```

Body:
I have built an app with tRPCv10 and NextAuth. As my app requires realtime updates, I have followed tRPC's docs on implementing subscriptions with websockets. tRPC docs on subscription tRPC example app.

From what I understand, to use websockets in tRPC, I need to create a standalone http server and run it alongside my Nextjs app. When I emit data through EventEmitter, the data is proxied through this http server and sent to all other subscribers. Thus, I have deployed my standalone http server on Railway with port 6957, and my Nextjs app on Vercel

Everything is working well when I am developing, through localhost. However, when I'm trying to deploy it, there is an error trying to connect to the websocket server and I'm receiving a NextAuth error when logging in too.

For example, my server name is "https://xxx-server.up.railway.app/" and my Nextjs app is "https://xxx-client.vercel.app/".

On the client side, I'm receiving an error: WebSocket connection to 'wss://xxx-server.up.railway.app:6957/' failed. When I hit the login button which runs the authorize function in NextAuth, the console returns the error: POST https://xxx-client.vercel.app/api/auth/calback/credentials? 401.

For reference, here are the file for _app.tsx and my websocket server:

// _app.tsx
const MyApp: AppType = ({
  Component,
  pageProps: { session, ...pageProps },
}) => {
  return (

      <SessionProvider session={session} refetchOnWindowFocus={false}>
        <Component {...pageProps} />
      </SessionProvider>
  );
};

const getBaseUrl = () => {
  if (typeof window !== "undefined") {
    return "";
  }
  if (process.env.VERCEL_URL) return `https://${process.env.VERCEL_URL}`; // SSR should use vercel url

  return `http://localhost:${process.env.PORT ?? 3000}`; // dev SSR should use localhost
};

function getEndingLink() {
  if (typeof window === "undefined") {
    return httpBatchLink({
      url: `${getBaseUrl()}/api/trpc`,
    });
  }

  const client = createWSClient({
    url: "wss://xxx-server.up.railway.app:6957"
  });

  return wsLink<AppRouter>({
    client,
  });
}

export default withTRPC<AppRouter>({
  config({ ctx }) {
    /**
     * If you want to use SSR, you need to use the server's full URL
     * @link https://trpc.io/docs/ssr
     */
    const url = `${getBaseUrl()}/api/trpc`;

    return {
      url,
      transformer: superjson,
      links: [getEndingLink()],

      /**
       * @link https://react-query.tanstack.com/reference/QueryClient
       */
      // queryClientConfig: { defaultOptions: { queries: { staleTime: 60 } } },
    };
  },
  /**
   * @link https://trpc.io/docs/ssr
   */
  ssr: true,
})(MyApp);

// prodServer.ts
const port = parseInt(process.env.PORT || "3000", 10);
const dev = process.env.NODE_ENV !== "production";
const app = next({ dev });
const handle = app.getRequestHandler();

app.prepare().then(() => {
  const server = http.createServer((req, res) => {
    const proto = req.headers["x-forwarded-proto"];
    if (proto && proto === "http") {
      // redirect to ssl
      res.writeHead(303, {
        location: `https://` + req.headers.host + (req.headers.url ?? ""),
      });
      res.end();
      return;
    }
    const parsedUrl = parse(req.url!, true);
    handle(req, res, parsedUrl);
  });
  const wss = new ws.Server({ server });
  const handler = applyWSSHandler({ wss, router: appRouter, createContext });

  process.on("SIGTERM", () => {
    console.log("SIGTERM");
    handler.broadcastReconnectNotification();
  });
  server.listen(port);

  // tslint:disable-next-line:no-console
  console.log(
    `> Server listening at http://localhost:${port} as ${
      dev ? "development" : process.env.NODE_ENV
    }`
  );
});


问:
How do i show product varient in react js with drop down menu without duplicate value?
I am creating e-commerce app in node , mongoDb and react. i have two model one for product and another for product varient. i want to show the product varient data in react like size in drop down  and color as radio button. But I am getting duplicate value of color and size . like small size 2 times  or color pink 2  or 3 times while showing its varient. I am requesting the for two request one for product and another for its varient.

Here is varient model

```<code>// Here is my backend code for creating product varient

ProductVarient_Model.create({
    stock: Data.stock,
    price: Data.price,
    product: Data.productid,
    assets: {
        images: [image url]
    },
    product_attribute: Data.attributes,
    seller: req.user_id
})

// Data.attributes is look like this
[{ "color": "pink", "size": "medium" }]

// here is my product code for endpoint /v4/api/product/id
const { id } = req.params;
    await ProductModel.findById(id)
        .exec((error, data) => {
            if (error) {
                next(new ErrorHandler(error.message, 400))
            }
            else {
                if (data === null) {
                    next(new ErrorHandler("No product found", 400))
                }
                else {
                    return res.status(200).json({ data })
                    // return res.status(200).json({ data: data })
                }

            }
        })

</code>```

if a product varients with size medium is available in 3 color so size medium is three time repeat in varients what i don't want.

In this data product_attribute  color value slilver is 3 times in whole data .But logically we can only show color silver only one time. same goes with the size with different color .

if a product is availble in 3 sizes and 3 colors total vaient of a product is 9 and its value show 3 times. i want to show only one.

Here is my frontend code

```<code>useEffect(() => {
        const result = Promise.all([
            fetch(`http://localhost:5000/v4/api/product/${id}`, {
                method: "GET",
                credentials: 'include'
            }).then(async (res) => {
                if (res.status === 200) {
                    const { data } = await res.json();
                    setProduct_detail([data])
                }
            })
                .catch(error => console.log(error)),
            fetch(`http://localhost:5000/v3/api/product/varientById/${id}`, {
                method: "GET",
                credentials: 'include'
            })
                .then(async (res) => {
                    if (res.status === 200) {
                        const { data } = await res.json();
                        setProduct_varient(data)
                    }
                })
        ])
    }, [])

    const Attributes = () => {
        const ProductAttribute = [];
        product_varient.forEach(element => {
            const { product_attribute } = element;
            product_attribute.map(item => {
                ProductAttribute.push(item)
            })

        });
        return ProductAttribute;
    }
    const Atr = Attributes();

{
    product_details.map((item)=>(
        // some code
        {
            Atr.map((element, index) => (
             <option value={element.size}
                  className='size_option hover:bg-indigo-700 hover:text-white'>
                    {element.size}
             </option>
            ))

    ))
}
</code>```

Varient data look like this

```<code>{
  "data": [
    {

      "product_attribute": [
        {
          "color": "silver",
          "size": "small"
        }
      ]
    },
    {

      "product_attribute": [
        {
          "color": "silver",
          "size": "medium"
        }
      ],
    },
    {

      "product_attribute": [
        {
          "color": "silver",
          "size": "large"
        }
      ],

    },
    {
      "product_attribute": [
        {
          "color": "pink",
          "size": "large"
        }
      ]

    },
    {
      "product_attribute": [
        {
          "color": "pink",
          "size": "small"
        }
      ]
    },
    {

      "product_attribute": [
        {
          "color": "pink",
          "size": "medium"
        }
      ],

    }
  ]
}

</code>```

Body:
I am creating e-commerce app in node , mongoDb and react. i have two model one for product and another for product varient. i want to show the product varient data in react like size in drop down  and color as radio button. But I am getting duplicate value of color and size . like small size 2 times  or color pink 2  or 3 times while showing its varient. I am requesting the for two request one for product and another for its varient.

Here is varient model

// Here is my backend code for creating product varient

ProductVarient_Model.create({
    stock: Data.stock,
    price: Data.price,
    product: Data.productid,
    assets: {
        images: [image url]
    },
    product_attribute: Data.attributes,
    seller: req.user_id
})

// Data.attributes is look like this
[{ "color": "pink", "size": "medium" }]

// here is my product code for endpoint /v4/api/product/id
const { id } = req.params;
    await ProductModel.findById(id)
        .exec((error, data) => {
            if (error) {
                next(new ErrorHandler(error.message, 400))
            }
            else {
                if (data === null) {
                    next(new ErrorHandler("No product found", 400))
                }
                else {
                    return res.status(200).json({ data })
                    // return res.status(200).json({ data: data })
                }

            }
        })

if a product varients with size medium is available in 3 color so size medium is three time repeat in varients what i don't want.

In this data product_attribute  color value slilver is 3 times in whole data .But logically we can only show color silver only one time. same goes with the size with different color .

if a product is availble in 3 sizes and 3 colors total vaient of a product is 9 and its value show 3 times. i want to show only one.

Here is my frontend code

useEffect(() => {
        const result = Promise.all([
            fetch(`http://localhost:5000/v4/api/product/${id}`, {
                method: "GET",
                credentials: 'include'
            }).then(async (res) => {
                if (res.status === 200) {
                    const { data } = await res.json();
                    setProduct_detail([data])
                }
            })
                .catch(error => console.log(error)),
            fetch(`http://localhost:5000/v3/api/product/varientById/${id}`, {
                method: "GET",
                credentials: 'include'
            })
                .then(async (res) => {
                    if (res.status === 200) {
                        const { data } = await res.json();
                        setProduct_varient(data)
                    }
                })
        ])
    }, [])

    const Attributes = () => {
        const ProductAttribute = [];
        product_varient.forEach(element => {
            const { product_attribute } = element;
            product_attribute.map(item => {
                ProductAttribute.push(item)
            })

        });
        return ProductAttribute;
    }
    const Atr = Attributes();

{
    product_details.map((item)=>(
        // some code
        {
            Atr.map((element, index) => (
             <option value={element.size}
                  className='size_option hover:bg-indigo-700 hover:text-white'>
                    {element.size}
             </option>
            ))

    ))
}

Varient data look like this

{
  "data": [
    {

      "product_attribute": [
        {
          "color": "silver",
          "size": "small"
        }
      ]
    },
    {

      "product_attribute": [
        {
          "color": "silver",
          "size": "medium"
        }
      ],
    },
    {

      "product_attribute": [
        {
          "color": "silver",
          "size": "large"
        }
      ],

    },
    {
      "product_attribute": [
        {
          "color": "pink",
          "size": "large"
        }
      ]

    },
    {
      "product_attribute": [
        {
          "color": "pink",
          "size": "small"
        }
      ]
    },
    {

      "product_attribute": [
        {
          "color": "pink",
          "size": "medium"
        }
      ],

    }
  ]
}


问:
Unable to use irregular column names from source table in dbt
We are using a table TABLE_NAME as a source for a dbt snapshot run and this table has few columns named 'abc[l2]' and 'xyz[l1]' in it. Now, since the column name itself has square brackets '[]', we are getting the below error while trying to run an incremental load for dbt snapshot:

```<code>Runtime Error in snapshot TABLE_NAME (snapshots/dse/facts/TABLE_NAME.sql)
06:24:03    [UNRESOLVED_COLUMN.WITH_SUGGESTION] A column or function parameter with name `snapshotted_data`.`abc` cannot be resolved. Did you mean one of the following?
</code>```

Tried adding backslash, single tick, double tick and back tick as escape characters but nothing seems to be working

Body:
We are using a table TABLE_NAME as a source for a dbt snapshot run and this table has few columns named 'abc[l2]' and 'xyz[l1]' in it. Now, since the column name itself has square brackets '[]', we are getting the below error while trying to run an incremental load for dbt snapshot:

Runtime Error in snapshot TABLE_NAME (snapshots/dse/facts/TABLE_NAME.sql)
06:24:03    [UNRESOLVED_COLUMN.WITH_SUGGESTION] A column or function parameter with name `snapshotted_data`.`abc` cannot be resolved. Did you mean one of the following?

Tried adding backslash, single tick, double tick and back tick as escape characters but nothing seems to be working


问:
Modify PDF document to display image on mouse over text using Python or Javascript?
I have a PDF document in which I need to add a mouse over event on a particular text such that it displays a image when user hovers over that text and hides it on mouse exit. I can use Python or Javascript to achieve this. Is there any way to achieve this?</p>


问:
Can you detect a specific DLLand function load using ETW?
Is it possible to monitor calls to specific DLL functions in ETW?
I am still new to ETW, so is there any good site or procedure that might be helpful to me?

It would be great to be able to run it from powershell using the logman command.

Sorry for the messy question. But I am in trouble....
Thanks for reading.

I am now looking into whether this might work.

```<code>> logman query providers "{22FB2CD6-0E7B-422B-A0C7-2FAD1FD0E716}"

providers                                GUID
-------------------------------------------------------------------------------
Microsoft-Windows-Kernel-Process         {22FB2CD6-0E7B-422B-A0C7-2FAD1FD0E716}

値                   キーワード                説明
-------------------------------------------------------------------------------
0x0000000000000010  WINEVENT_KEYWORD_PROCESS
0x0000000000000020  WINEVENT_KEYWORD_THREAD
0x0000000000000040  WINEVENT_KEYWORD_IMAGE
0x0000000000000080  WINEVENT_KEYWORD_CPU_PRIORITY
0x0000000000000100  WINEVENT_KEYWORD_OTHER_PRIORITY
0x0000000000000200  WINEVENT_KEYWORD_PROCESS_FREEZE
0x0000000000000400  WINEVENT_KEYWORD_JOB
0x0000000000000800  WINEVENT_KEYWORD_ENABLE_PROCESS_TRACING_CALLBACKS
0x0000000000001000  WINEVENT_KEYWORD_JOB_IO
0x0000000000002000  WINEVENT_KEYWORD_WORK_ON_BEHALF
0x0000000000004000  WINEVENT_KEYWORD_JOB_SILO
0x8000000000000000  Microsoft-Windows-Kernel-Process/Analytic

</code>```

Body:
Is it possible to monitor calls to specific DLL functions in ETW?
I am still new to ETW, so is there any good site or procedure that might be helpful to me?

It would be great to be able to run it from powershell using the logman command.

Sorry for the messy question. But I am in trouble....
Thanks for reading.

I am now looking into whether this might work.

> logman query providers "{22FB2CD6-0E7B-422B-A0C7-2FAD1FD0E716}"

providers                                GUID
-------------------------------------------------------------------------------
Microsoft-Windows-Kernel-Process         {22FB2CD6-0E7B-422B-A0C7-2FAD1FD0E716}

値                   キーワード                説明
-------------------------------------------------------------------------------
0x0000000000000010  WINEVENT_KEYWORD_PROCESS
0x0000000000000020  WINEVENT_KEYWORD_THREAD
0x0000000000000040  WINEVENT_KEYWORD_IMAGE
0x0000000000000080  WINEVENT_KEYWORD_CPU_PRIORITY
0x0000000000000100  WINEVENT_KEYWORD_OTHER_PRIORITY
0x0000000000000200  WINEVENT_KEYWORD_PROCESS_FREEZE
0x0000000000000400  WINEVENT_KEYWORD_JOB
0x0000000000000800  WINEVENT_KEYWORD_ENABLE_PROCESS_TRACING_CALLBACKS
0x0000000000001000  WINEVENT_KEYWORD_JOB_IO
0x0000000000002000  WINEVENT_KEYWORD_WORK_ON_BEHALF
0x0000000000004000  WINEVENT_KEYWORD_JOB_SILO
0x8000000000000000  Microsoft-Windows-Kernel-Process/Analytic


问:
how to reshape CNN features efficiently to be used in specific task
The following code defines model for image captioning where the CNN feature vector is 4096. I want to use this model for video caption and my CNN features for one video is (28,1536), where 28 is number of frames.</p>
```<code># define the captioning model
def define_model(vocab_size, max_length):
  # feature extractor model
    # define an input of shape (4096,)
  inputs1 = Input(shape=(4096,))
    # Add a dropout layer of 0.5
  fe1 = Dropout(0.5)(inputs1)
    # Add a dense layer of 256 units with relu activation
  fe2 = Dense(256, activation='relu')(fe1)

    # sequence model
    # Define input of shape (max_length,)
  inputs2 = Input(shape=(max_length,))
    # Define an 256 dimension embedding layer with the vocab_size and parameter mark_zero=True
  se1 = Embedding(vocab_size, 256, mask_zero=True)(inputs2)
    # Add a dropout layer of 0.5
  se2 = Dropout(0.5)(se1)
    # Add an LSTM layer with 256 units
  se3 = LSTM(256)(se2)

    # decoder model
    # Add the outputs of feature extractor model and sequence model
  decoder1 = add([fe2, se3])
    # Feed it to a dense layer of 512 units with relu activation
  decoder2 = Dense(256, activation='relu')(decoder1)
    # Add a dense layer with no. of units=vocab_size, and softmax activation
  outputs = Dense(vocab_size, activation='softmax')(decoder2)

    # tie it together and create a model instance which takes input as [image, seq] and gives output as [word]
  model = Model(inputs=[inputs1, inputs2], outputs=outputs)

    # compile model with categorical crossentropy loss and rmsprop optimizer
  model.compile(loss='categorical_crossentropy', optimizer='adam')

    # summarize model
  model.summary()

    # check if this is same as image provided
  plot_model(model, to_file='model.png', show_shapes=True)
  return model
</code>```

Body:
The following code defines model for image captioning where the CNN feature vector is 4096. I want to use this model for video caption and my CNN features for one video is (28,1536), where 28 is number of frames.

# define the captioning model
def define_model(vocab_size, max_length):
  # feature extractor model
    # define an input of shape (4096,)
  inputs1 = Input(shape=(4096,))
    # Add a dropout layer of 0.5
  fe1 = Dropout(0.5)(inputs1)
    # Add a dense layer of 256 units with relu activation
  fe2 = Dense(256, activation='relu')(fe1)

    # sequence model
    # Define input of shape (max_length,)
  inputs2 = Input(shape=(max_length,))
    # Define an 256 dimension embedding layer with the vocab_size and parameter mark_zero=True
  se1 = Embedding(vocab_size, 256, mask_zero=True)(inputs2)
    # Add a dropout layer of 0.5
  se2 = Dropout(0.5)(se1)
    # Add an LSTM layer with 256 units
  se3 = LSTM(256)(se2)

    # decoder model
    # Add the outputs of feature extractor model and sequence model
  decoder1 = add([fe2, se3])
    # Feed it to a dense layer of 512 units with relu activation
  decoder2 = Dense(256, activation='relu')(decoder1)
    # Add a dense layer with no. of units=vocab_size, and softmax activation
  outputs = Dense(vocab_size, activation='softmax')(decoder2)

    # tie it together and create a model instance which takes input as [image, seq] and gives output as [word]
  model = Model(inputs=[inputs1, inputs2], outputs=outputs)

    # compile model with categorical crossentropy loss and rmsprop optimizer
  model.compile(loss='categorical_crossentropy', optimizer='adam')

    # summarize model
  model.summary()

    # check if this is same as image provided
  plot_model(model, to_file='model.png', show_shapes=True)
  return model


问:
line chart has white space when using adjust Width react native Gifted Chart
I need to adjust and fix my chart width as per the data in the container, but when there is max data then it shows okay while there is min data then it will show some data and some white spaces, my requirement is just to remove white spaces and to show fix chart on the container. Also same as Bar Chart.
kindly help me, I will be really glad.
Thanks


问:
Blazor server and Google Auth
I tried to implement google auth to my blazor app. but I received this error:

```<code>`ArgumentException: The 'ClientSecret' option must be provided. (Parameter 'ClientSecret')
Microsoft.AspNetCore.Authentication.OAuth.OAuthOptions.Validate()
Microsoft.AspNetCore.Authentication.RemoteAuthenticationOptions.Validate(string scheme)
Microsoft.AspNetCore.Authentication.AuthenticationBuilder+<>c__DisplayClass4_0<TOptions, THandler>.<AddSchemeHelper>b__1(TOptions o)
Microsoft.Extensions.Options.ValidateOptions<TOptions>.Validate(string name, TOptions options)
Microsoft.Extensions.Options.OptionsFactory<TOptions>.Create(string name)
Microsoft.Extensions.Options.OptionsCache<TOptions>+<>c__3<TArg>.<GetOrAdd>b__3_0(string name, ValueTuple<Func<string, TArg, TOptions>, TArg> arg)
System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue>.GetOrAdd<TArg>(TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument)
Microsoft.Extensions.Options.OptionsCache<TOptions>.GetOrAdd<TArg>(string name, Func<string, TArg, TOptions> createOptions, TArg factoryArgument)
Microsoft.Extensions.Options.OptionsMonitor<TOptions>.Get(string name)
Microsoft.AspNetCore.Authentication.AuthenticationHandler<TOptions>.InitializeAsync(AuthenticationScheme scheme, HttpContext context)
Microsoft.AspNetCore.Authentication.AuthenticationHandlerProvider.GetHandlerAsync(HttpContext context, string authenticationScheme)
Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
`
</code>```

And this is my Program.cs

```<code>

builder.Services.AddAuthentication(options =>
{

}).AddGoogle(options =>
{
    options.ClientId = GoogleCredentials.CLientId;
    options.ClientSecret = options.ClientSecret;
    options.SignInScheme = GoogleDefaults.AuthenticationScheme;
});

// Add services to the container.
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection") ?? throw new InvalidOperationException("Connection string 'DefaultConnection' not found.");
builder.Services.AddDbContext<ApplicationDbContext>(options =>
    options.UseSqlServer(connectionString));
builder.Services.AddDatabaseDeveloperPageExceptionFilter();

builder.Services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
    .AddEntityFrameworkStores<ApplicationDbContext>();

</code>```

How can we fix this error?
If someone can help me, reply please.

Title: Blazor server and Google Auth

Body:
I tried to implement google auth to my blazor app. but I received this error:

`ArgumentException: The 'ClientSecret' option must be provided. (Parameter 'ClientSecret')
Microsoft.AspNetCore.Authentication.OAuth.OAuthOptions.Validate()
Microsoft.AspNetCore.Authentication.RemoteAuthenticationOptions.Validate(string scheme)
Microsoft.AspNetCore.Authentication.AuthenticationBuilder+<>c__DisplayClass4_0<TOptions, THandler>.<AddSchemeHelper>b__1(TOptions o)
Microsoft.Extensions.Options.ValidateOptions<TOptions>.Validate(string name, TOptions options)
Microsoft.Extensions.Options.OptionsFactory<TOptions>.Create(string name)
Microsoft.Extensions.Options.OptionsCache<TOptions>+<>c__3<TArg>.<GetOrAdd>b__3_0(string name, ValueTuple<Func<string, TArg, TOptions>, TArg> arg)
System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue>.GetOrAdd<TArg>(TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument)
Microsoft.Extensions.Options.OptionsCache<TOptions>.GetOrAdd<TArg>(string name, Func<string, TArg, TOptions> createOptions, TArg factoryArgument)
Microsoft.Extensions.Options.OptionsMonitor<TOptions>.Get(string name)
Microsoft.AspNetCore.Authentication.AuthenticationHandler<TOptions>.InitializeAsync(AuthenticationScheme scheme, HttpContext context)
Microsoft.AspNetCore.Authentication.AuthenticationHandlerProvider.GetHandlerAsync(HttpContext context, string authenticationScheme)
Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
`

And this is my Program.cs

builder.Services.AddAuthentication(options =>
{

}).AddGoogle(options =>
{
    options.ClientId = GoogleCredentials.CLientId;
    options.ClientSecret = options.ClientSecret;
    options.SignInScheme = GoogleDefaults.AuthenticationScheme;
});

// Add services to the container.
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection") ?? throw new InvalidOperationException("Connection string 'DefaultConnection' not found.");
builder.Services.AddDbContext<ApplicationDbContext>(options =>
    options.UseSqlServer(connectionString));
builder.Services.AddDatabaseDeveloperPageExceptionFilter();

builder.Services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
    .AddEntityFrameworkStores<ApplicationDbContext>();

How can we fix this error?
If someone can help me, reply please.


问:
How to make a convolutional - deconvolutional neural network that gives the same output dimension as the input dimensions?
Input dimension is (257,40,1).Output dimension after 5 convolutional layer is (8,1,64). I am using tensorflow for model's implementation.

I tried by changing the padding to 'same' or 'valid' of various layer, but output dimensions are coming (264,40,1) or (263,39,1).


问:
How to Load Train and test data from a saved ML model
I have a saved ML model and I want to load its training and testing set data so that I can add it to the next month data of training and testing

Currently I am  concatnating the x_train,y_train,x_test,y_test of the model to the training and testing se without loading the model


问:
connect to replicated Postgresql through Pg_bouncer deployed on local cluster using Minikube
I'm new to Kubernetes and Helm, I took time to read the docs to understand the concepts to move on with my task which I mentioned in the question's title.

I looked for the examples and based on what I see in the docs & values example, I can add pg_bouncer to create the connection pool.

So, the commands that I run with the values.yaml file is :

minikube start

helm install comp-db timescale/timescaledb-single --version 0.13.1 -f ./values.yml

wait for the pods (3 replicas) to be ready

minikube tunnel ( to expose the LoadBalancer, so that I can connect to it )

The problem is that the Helm Release gets created successfully, I can see the Statefulset,Pods,Svcs and I can connect and exec statements through pgAdmin GUI, but I keep getting the following error on node app, where i intend to connect and run the migrations.

```<code>error:migrate eaa24d98 migrations error: pg_hba.conf rejects connection for host "172.17.0.1", user "superuser", database "postgres", no encryption
    at Parser.parseErrorMessage (/Users/jafar/Desktop/dev/wave/wave_stores/node_modules/pg-protocol/dist/parser.js:287:98)
    at Parser.handlePacket (/Users/jafar/Desktop/dev/wave/wave_stores/node_modules/pg-protocol/dist/parser.js:126:29)
    at Parser.parse (/Users/jafar/Desktop/dev/wave/wave_stores/node_modules/pg-protocol/dist/parser.js:39:38)
    at Socket.<anonymous> (/Users/jafar/Desktop/dev/wave/wave_stores/node_modules/pg-protocol/dist/index.js:11:42)
    at Socket.emit (node:events:394:28)
    at addChunk (node:internal/streams/readable:312:12)
    at readableAddChunk (node:internal/streams/readable:287:9)
    at Socket.Readable.push (node:internal/streams/readable:226:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
  length: 169,
  severity: 'FATAL',
  code: '28000',
  detail: undefined,
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'auth.c',
  line: '477',
  routine: 'ClientAuthentication'
} +0ms
</code>```

I don't know why this ip address gets applied, although I provide the ip address that I get from the tunnel.

the values that I'm providing is as follows:

```<code>image:
  pullPolicy: IfNotPresent
  tag: pg13.6-ts2.6.1-latest
timescaledbTune:
        enabled: true
loadBalancer:
        enabled: false
replicaLoadbalancer:
        enabled: false
secrets:
  credentialsSecretName: "comp-db-credentials"
patroni:
  bootstrap:
    dcs:
      postgresql:
        parameters:
          ssl: 'off'  # disable all ssl connections to not require Patroni certificate
          shared_buffers: '8028MB'
          effective_cache_size: '24084MB'
          maintenance_work_mem: '2047MB'
          work_mem: '10275kB'
          timescaledb:
                  max_background_workers: 8
          max_worker_processes: 19
          max_parallel_workers_per_gather: 4
          max_parallel_workers: 8
          wal_buffers: '16MB'
          min_wal_size: '512MB'
          max_wal_size: '1GB'
          max_connections: 150
          autovacuum_max_workers: 10
          autovacuum_naptime: '5s'
          default_statistics_target: 500
          random_page_cost: 1.1
          checkpoint_completion_target: 0.9
          max_connections: 150
          max_locks_per_transaction: 1000
          autovacuum_max_workers: 10
          autovacuum_naptime: 10
          effective_io_concurrency: 256
  postgresql:
    pg_hba:
    - local     all             postgres                            peer
    # pgBouncer connections will come through local
    - local     all             all               all               md5
    - hostnossl all,replication all               all               md5
    - host replication replicator 127.0.0.1/32 md5
pgBouncer:
  enabled: true
  config:
    max_client_conn: 1000
    default_pool_size: 36
    client_tls_sslmode: allow
    server_tls_sslmode: allow
  pg_hba:
  - local     all postgres                   peer
  - host      all postgres,standby 0.0.0.0/0 reject
  - host      all postgres,standby ::0/0     reject
  - hostssl   all all              0.0.0.0/0 md5
  - hostssl   all all              ::0/0     md5
  - hostnossl all all              0.0.0.0/0 md5
  - hostnossl all all              ::0/0     md5
</code>```

I also tried to update the pg_hba for Postgresql to the following to allow connections but the error still exists.

```<code>         pg_hba:
         - local     all             postgres                              peer
         - local     all             all                                   md5
         - hostnossl all,replication all                all                md5
         - hostssl   all             all                127.0.0.1/32       md5
         - hostssl   all             all                ::1/128            md5
         - hostssl   replication     standby            all                md5
         - hostssl   all             all                all                md5
</code>```

I have searched for this error and similar questions and answers here, but didn't find any that can help me to resolve the issue. Thoughts?

Body:
I'm new to Kubernetes and Helm, I took time to read the docs to understand the concepts to move on with my task which I mentioned in the question's title.

I looked for the examples and based on what I see in the docs & values example, I can add pg_bouncer to create the connection pool.

So, the commands that I run with the values.yaml file is :

minikube start

helm install comp-db timescale/timescaledb-single --version 0.13.1 -f ./values.yml

wait for the pods (3 replicas) to be ready

minikube tunnel ( to expose the LoadBalancer, so that I can connect to it )

The problem is that the Helm Release gets created successfully, I can see the Statefulset,Pods,Svcs and I can connect and exec statements through pgAdmin GUI, but I keep getting the following error on node app, where i intend to connect and run the migrations.

error:migrate eaa24d98 migrations error: pg_hba.conf rejects connection for host "172.17.0.1", user "superuser", database "postgres", no encryption
    at Parser.parseErrorMessage (/Users/jafar/Desktop/dev/wave/wave_stores/node_modules/pg-protocol/dist/parser.js:287:98)
    at Parser.handlePacket (/Users/jafar/Desktop/dev/wave/wave_stores/node_modules/pg-protocol/dist/parser.js:126:29)
    at Parser.parse (/Users/jafar/Desktop/dev/wave/wave_stores/node_modules/pg-protocol/dist/parser.js:39:38)
    at Socket.<anonymous> (/Users/jafar/Desktop/dev/wave/wave_stores/node_modules/pg-protocol/dist/index.js:11:42)
    at Socket.emit (node:events:394:28)
    at addChunk (node:internal/streams/readable:312:12)
    at readableAddChunk (node:internal/streams/readable:287:9)
    at Socket.Readable.push (node:internal/streams/readable:226:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
  length: 169,
  severity: 'FATAL',
  code: '28000',
  detail: undefined,
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'auth.c',
  line: '477',
  routine: 'ClientAuthentication'
} +0ms

I don't know why this ip address gets applied, although I provide the ip address that I get from the tunnel.

the values that I'm providing is as follows:

image:
  pullPolicy: IfNotPresent
  tag: pg13.6-ts2.6.1-latest
timescaledbTune:
        enabled: true
loadBalancer:
        enabled: false
replicaLoadbalancer:
        enabled: false
secrets:
  credentialsSecretName: "comp-db-credentials"
patroni:
  bootstrap:
    dcs:
      postgresql:
        parameters:
          ssl: 'off'  # disable all ssl connections to not require Patroni certificate
          shared_buffers: '8028MB'
          effective_cache_size: '24084MB'
          maintenance_work_mem: '2047MB'
          work_mem: '10275kB'
          timescaledb:
                  max_background_workers: 8
          max_worker_processes: 19
          max_parallel_workers_per_gather: 4
          max_parallel_workers: 8
          wal_buffers: '16MB'
          min_wal_size: '512MB'
          max_wal_size: '1GB'
          max_connections: 150
          autovacuum_max_workers: 10
          autovacuum_naptime: '5s'
          default_statistics_target: 500
          random_page_cost: 1.1
          checkpoint_completion_target: 0.9
          max_connections: 150
          max_locks_per_transaction: 1000
          autovacuum_max_workers: 10
          autovacuum_naptime: 10
          effective_io_concurrency: 256
  postgresql:
    pg_hba:
    - local     all             postgres                            peer
    # pgBouncer connections will come through local
    - local     all             all               all               md5
    - hostnossl all,replication all               all               md5
    - host replication replicator 127.0.0.1/32 md5
pgBouncer:
  enabled: true
  config:
    max_client_conn: 1000
    default_pool_size: 36
    client_tls_sslmode: allow
    server_tls_sslmode: allow
  pg_hba:
  - local     all postgres                   peer
  - host      all postgres,standby 0.0.0.0/0 reject
  - host      all postgres,standby ::0/0     reject
  - hostssl   all all              0.0.0.0/0 md5
  - hostssl   all all              ::0/0     md5
  - hostnossl all all              0.0.0.0/0 md5
  - hostnossl all all              ::0/0     md5

I also tried to update the pg_hba for Postgresql to the following to allow connections but the error still exists.

         pg_hba:
         - local     all             postgres                              peer
         - local     all             all                                   md5
         - hostnossl all,replication all                all                md5
         - hostssl   all             all                127.0.0.1/32       md5
         - hostssl   all             all                ::1/128            md5
         - hostssl   replication     standby            all                md5
         - hostssl   all             all                all                md5

I have searched for this error and similar questions and answers here, but didn't find any that can help me to resolve the issue. Thoughts?


问:
PHP NGINX STOPS WORKING ON WINDOWS AFTER A PERIOD OF TIME
I am facing a weird issue on windows machine. I am using php-cgi and nginx to run my php project. Everything works fine for a specific period of time like for example 15 to 20 hours then php-cgi and nginx both services stopped working. This happens repeatedly when I start the services again. Please check below is my bat file content.

Bat file content:

```<code>@ECHO OFF
ECHO Starting PHP FastCGI...
SET PHP_FCGI_MAX_REQUESTS=0
start C:\webserver\nginx\nginx.exe
C:\RunHiddenConsole.exe C:\webserver\php\php-cgi.exe -b 127.0.0.1:9000 -c "C:\werbserver\php.ini"
</code>```

Body:
I am facing a weird issue on windows machine. I am using php-cgi and nginx to run my php project. Everything works fine for a specific period of time like for example 15 to 20 hours then php-cgi and nginx both services stopped working. This happens repeatedly when I start the services again. Please check below is my bat file content.

Bat file content:

@ECHO OFF
ECHO Starting PHP FastCGI...
SET PHP_FCGI_MAX_REQUESTS=0
start C:\webserver\nginx\nginx.exe
C:\RunHiddenConsole.exe C:\webserver\php\php-cgi.exe -b 127.0.0.1:9000 -c "C:\werbserver\php.ini"


问:
Unable to run ASP.NET Core migration in docker container
I have created Dockerfile for the backend api. I want to update my database before the application starts to run.

Below is the docker file

```<code># Build Stage
FROM mcr.microsoft.com/dotnet/sdk:6.0-focal AS build
WORKDIR /source
COPY ./orh-backend ./project
COPY ./function-script ./function-script
RUN dotnet restore "./project/md.api/md.api.csproj" --disable-parallel
RUN dotnet publish "./project/md.api/md.api.csproj" -c release -o /app --no-restore
WORKDIR /source/project/md.ef
RUN dotnet tool install --global dotnet-ef
RUN dotnet ef database update --context=TransactionDbContext

# Serve stage
FROM mcr.microsoft.com/dotnet/aspnet:6.0-focal
WORKDIR /app
COPY --from=build /app ./

EXPOSE 5000
ENV ASPNETCORE_URLS=http://+:5000
ENV ASPNETCORE_ENVIRONMENT=Production
# ENTRYPOINT ["dotnet", "orch.api.dll"]
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
</code>```

When I run docker compose build below error comes

I was expecting tables to be created.

I have tried the below commands as well.

```<code>CMD ["dotnet", "ef", " database update  --context=TransactionDbContext" ]
</code>```
```<code>ENV PATH $PATH:/root/.dotnet/tools
</code>```

Body:
I have created Dockerfile for the backend api. I want to update my database before the application starts to run.

Below is the docker file

# Build Stage
FROM mcr.microsoft.com/dotnet/sdk:6.0-focal AS build
WORKDIR /source
COPY ./orh-backend ./project
COPY ./function-script ./function-script
RUN dotnet restore "./project/md.api/md.api.csproj" --disable-parallel
RUN dotnet publish "./project/md.api/md.api.csproj" -c release -o /app --no-restore
WORKDIR /source/project/md.ef
RUN dotnet tool install --global dotnet-ef
RUN dotnet ef database update --context=TransactionDbContext

# Serve stage
FROM mcr.microsoft.com/dotnet/aspnet:6.0-focal
WORKDIR /app
COPY --from=build /app ./

EXPOSE 5000
ENV ASPNETCORE_URLS=http://+:5000
ENV ASPNETCORE_ENVIRONMENT=Production
# ENTRYPOINT ["dotnet", "orch.api.dll"]
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

When I run docker compose build below error comes

I was expecting tables to be created.

I have tried the below commands as well.

CMD ["dotnet", "ef", " database update  --context=TransactionDbContext" ]

ENV PATH $PATH:/root/.dotnet/tools


问:
Filetype PDF is not getting uploaded through Antd upload
While using Ant design upload component, pdf file is not getting uploaded and throwing dropdown.pdf file upload failed as error.

```<code>import React from 'react'
import { Upload , message, Button }  from 'antd';
import { UploadOutlined } from '@ant-design/icons';

const Dropdown = () => {
    const props = {
        name: 'file',
        action: 'https://www.mocky.io/v2/5cc8019d300000980a055e76',
        accept: ".pdf",
        onChange(info) {
          if (info.file.status !== 'uploading') {
            console.log(info.file, info.fileList);
          }

          if (info.file.status === 'done') {
            message.success(`${info.file.name} file uploaded successfully`);
          } else if (info.file.status === 'error') {
            message.error(`${info.file.name} file upload failed.`);
          }
        },
      };

    return (
        <div>
            <h1>
                Dropdown
            </h1>
            <div>
                <Upload {...props} accept='.doc,.docx,application/pdf'>
                    <Button
                        accept={[".pdf"]} icon={<UploadOutlined />}
                    >
                        Click to Upload
                    </Button>
                    <p>Choose file to upload</p>
                </Upload>
                <Button onClick={fetch}>
                    Upload
                </Button>
            </div>
        </div>
    )
}

export default DropDown
</code>```

I have tried other methods and help from youtube and this repository by HamzaAnwar even couldn't solve my problem. I will welcome any answers for uploading files through antd in reactjs.

Body:
While using Ant design upload component, pdf file is not getting uploaded and throwing dropdown.pdf file upload failed as error.

import React from 'react'
import { Upload , message, Button }  from 'antd';
import { UploadOutlined } from '@ant-design/icons';

const Dropdown = () => {
    const props = {
        name: 'file',
        action: 'https://www.mocky.io/v2/5cc8019d300000980a055e76',
        accept: ".pdf",
        onChange(info) {
          if (info.file.status !== 'uploading') {
            console.log(info.file, info.fileList);
          }

          if (info.file.status === 'done') {
            message.success(`${info.file.name} file uploaded successfully`);
          } else if (info.file.status === 'error') {
            message.error(`${info.file.name} file upload failed.`);
          }
        },
      };

    return (

                Dropdown

                <Upload {...props} accept='.doc,.docx,application/pdf'>
                    <Button
                        accept={[".pdf"]} icon={<UploadOutlined />}
                    >
                        Click to Upload
                    </Button>

Choose file to upload

                </Upload>
                <Button onClick={fetch}>
                    Upload
                </Button>

    )
}

export default DropDown

I have tried other methods and help from youtube and this repository by HamzaAnwar even couldn't solve my problem. I will welcome any answers for uploading files through antd in reactjs.


问:
ESP32 cam Webview problem showing local IP address
```<code>import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

void main() => runApp(MaterialApp(home: Home(),));

class Home extends StatefulWidget{
  @override
  _HomeState createState() => _HomeState();
}
class _HomeState extends State<Home> {
  @override
  Widget build(BuildContext context) {
    return
      Scaffold(
        appBar: AppBar(
          title: Text('ESP32'),
          centerTitle: true,
        ),
        body: WebView(initialUrl: 'https://192.168.4.1',javascriptMode: JavascriptMode.unrestricted,),
      );
  }
}
</code>```

So I have this code and I am trying to display the content from esp32 through the ip address but I keep on getting an error, net:ERR_CONNECTION_REFUSED. Looked through multiple threads but could not find the issue. Does anyone know what I'm doing wrong? It works on the IOS emulator but not the android emulator.

I tried adding :8000 and the solution from here why is flutter refusing to connect on localhost:8000 or 127.0.01:8000? but didnt work.

Body:
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

void main() => runApp(MaterialApp(home: Home(),));

class Home extends StatefulWidget{
  @override
  _HomeState createState() => _HomeState();
}
class _HomeState extends State<Home> {
  @override
  Widget build(BuildContext context) {
    return
      Scaffold(
        appBar: AppBar(
          title: Text('ESP32'),
          centerTitle: true,
        ),
        body: WebView(initialUrl: 'https://192.168.4.1',javascriptMode: JavascriptMode.unrestricted,),
      );
  }
}

So I have this code and I am trying to display the content from esp32 through the ip address but I keep on getting an error, net:ERR_CONNECTION_REFUSED. Looked through multiple threads but could not find the issue. Does anyone know what I'm doing wrong? It works on the IOS emulator but not the android emulator.

I tried adding :8000 and the solution from here why is flutter refusing to connect on localhost:8000 or 127.0.01:8000? but didnt work.


问:
Interface Builder can’t determine the type of “LaunchScreen.storyboard”. This may be due to a missing SDK
After trying to build the project from Xcode, it'll launch metro but will end up with error in launch screen/.storyboard file with popup stating "Interface Builder can’t determine the type of “LaunchScreen.storyboard”. This may be due to a missing SDK."

Working on macos Monterey Version 12.6 (M1) && Xcode Version 14.2 (14C18). This is how code in my LaunchScreen.storyboard looks like :-

```<code><?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
    <device id="retina4_0" orientation="portrait" appearance="light"/>
    <dependencies>
        <deployment identifier="iOS"/>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
    </dependencies>
    <objects>
        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
        <view contentMode="scaleToFill" id="iN0-l3-epB">
            <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
            <subviews>
                <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="splashLogo" translatesAutoresizingMaskIntoConstraints="NO" id="V0e-CK-Gd0">
                    <rect key="frame" x="11" y="193.5" width="298" height="182"/>
                    <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                    <constraints>
                        <constraint firstAttribute="height" constant="182" id="DBk-nu-v9T"/>
                        <constraint firstAttribute="width" constant="298" id="ILh-gi-q0x"/>
                    </constraints>
                </imageView>
            </subviews>
            <color key="backgroundColor" red="0.46460307013128221" green="0.18067300374471776" blue="0.22014992144391368" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
            <constraints>
                <constraint firstItem="V0e-CK-Gd0" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="BZK-x8-i1z"/>
                <constraint firstItem="V0e-CK-Gd0" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" constant="0.5" id="jfE-kw-T4w"/>
            </constraints>
            <nil key="simulatedStatusBarMetrics"/>
            <point key="canvasLocation" x="7.5" y="244.01408450704227"/>
        </view>
    </objects>
    <resources>
        <image name="splashLogo" width="697" height="773.5"/>
    </resources>
</document>
</code>```

Body:
After trying to build the project from Xcode, it'll launch metro but will end up with error in launch screen/.storyboard file with popup stating "Interface Builder can’t determine the type of “LaunchScreen.storyboard”. This may be due to a missing SDK."

Working on macos Monterey Version 12.6 (M1) && Xcode Version 14.2 (14C18). This is how code in my LaunchScreen.storyboard looks like :-

<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
    <device id="retina4_0" orientation="portrait" appearance="light"/>
    <dependencies>
        <deployment identifier="iOS"/>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
    </dependencies>
    <objects>
        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
        <view contentMode="scaleToFill" id="iN0-l3-epB">
            <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
            <subviews>
                <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="splashLogo" translatesAutoresizingMaskIntoConstraints="NO" id="V0e-CK-Gd0">
                    <rect key="frame" x="11" y="193.5" width="298" height="182"/>
                    <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                    <constraints>
                        <constraint firstAttribute="height" constant="182" id="DBk-nu-v9T"/>
                        <constraint firstAttribute="width" constant="298" id="ILh-gi-q0x"/>
                    </constraints>
                </imageView>
            </subviews>
            <color key="backgroundColor" red="0.46460307013128221" green="0.18067300374471776" blue="0.22014992144391368" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
            <constraints>
                <constraint firstItem="V0e-CK-Gd0" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="BZK-x8-i1z"/>
                <constraint firstItem="V0e-CK-Gd0" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" constant="0.5" id="jfE-kw-T4w"/>
            </constraints>
            <nil key="simulatedStatusBarMetrics"/>
            <point key="canvasLocation" x="7.5" y="244.01408450704227"/>
        </view>
    </objects>
    <resources>
        <image name="splashLogo" width="697" height="773.5"/>
    </resources>
</document>


问:
What is DTRACE_BLOCK_STATISTICS in VTM software and how to implement it?
I am using VVC and VTM software. What is DTRACE_BLOCK_STATISTICS in vtm software, and how can it be use in the commandline?

whether can it be used to extract certain information from a video, if so how can I get the difference of max and min pixel values in a coding unit?

I tried declaring the macros

#define K0149_BLOCK_STATISTICS 1

#define ENABLE_TRACING 1

in dtrace_blockstatistics.h file and run the command "make all" to compile


问:
Excel file created from box/spout library is not editable in microsoft excel
I just recently implemented box/spout library replacing the phpspreadsheet library in favour of memory efficiency.

I am also able to produce the excel file using it.

But after opening the excel file using ms office 2019, I cannot edit the cells at all, it just seems all shown read-only.

But if I use phpspreadsheet to generate the same thing, I can edit the file.

Do any of you folks know anything that I am missing out here.

Following is my implementation of box/spout

```<code>use Box\Spout\Common\Type;
use Box\Spout\Writer\Common\Creator\Style\StyleBuilder;
use Box\Spout\Writer\Common\Creator\WriterEntityFactory;
use PhpOffice\PhpSpreadsheet\Shared\Date;

function exprot_table($xmlObjectArray, $rows)
{
    error_reporting(E_ALL);
    $head = (array) $rows[0];
    $headArray = array_keys($head);

    $writer = WriterEntityFactory::createWriter(Type::XLSX);
    $writer->openToBrowser("demoexcel.xlsx");

    $rowFromValues = WriterEntityFactory::createRowFromArray($headArray);
    $writer->addRow($rowFromValues);

    $excelRows = array();
    foreach ($rows as $key => $row) {
        $row = (array) $row;
        $cells = array();
        foreach ($headArray as $keyc => $column) {
            $fieldType = $xmlObjectArray[$column]['type'];
            $col_name = $this->get_col_name($keyc);
            // set date formate
            if ($fieldType == "datetime") {
                if (! empty($row[$column])) {
                    // Get server time zone offset in seconds and add or subtract from main value
                    $timeZoneOffset = date('Z', $row[$column]);
                    $date = $row[$column] + $timeZoneOffset;
                    $date = Date::PHPToExcel(trim($date));
                    $cellstyle = (new StyleBuilder())->setFormat('dd mmm yyyy')->build();
                    $cells[] = WriterEntityFactory::createCell($date, $cellstyle);

                } else {

                    $cells[] = WriterEntityFactory::createCell('');
                }
            } elseif ($fieldType == "money") {
                if (strlen($row[$column]) > 0) {

                    $cellstyle = (new StyleBuilder())->setFormat('#,##0.00;[Red]#,##0.00')->build();
                    $cells[] = WriterEntityFactory::createCell($row[$column], $cellstyle);
                } else {

                    $cells[] = WriterEntityFactory::createCell('');
                }
            }elseif ($fieldType == "number") {
                if (strlen($row[$column]) > 0) {

                    $cellstyle = (new StyleBuilder())->setFormat('#,##')->build();
                    $cells[] = WriterEntityFactory::createCell($row[$column], $cellstyle);
                } else {

                    $cells[] = WriterEntityFactory::createCell('');
                }
            } elseif ($fieldType == "image") {
                $value = $row[$column];
                if (! empty($value)) {
                    $imageFolder = $this->config->item('img_upload_path');
                    $subDirectory = (string) $xmlObjectArray[$column]['sub_directory'];
                    if (isset($subDirectory) and ! empty($subDirectory)) {
                        $imageFolder .= $subDirectory . "/";
                    }
                    $filePath = $imageFolder . $value;
                    if (stripos($value, 'https://') !== false || stripos($value, 'http://') !== false) {

                        $cells[] = WriterEntityFactory::createCell('=HYPERLINK("'. $value .'","'. $value .'")');
                    } else {

                        $cells[] = WriterEntityFactory::createCell($value);
                    }
                }

            } elseif ($fieldType == "file") {

                $value = $row[$column];
                $imageFolder = $this->config->item('img_upload_path');
                if (! empty($value)) {
                    $value = CDN_URL . $imageFolder . $value;
                }

                $cells[] = WriterEntityFactory::createCell($value);
            } else {

                $cells[] = WriterEntityFactory::createCell($row[$column]);
            }
        }

        $excelRows[] = WriterEntityFactory::createRow($cells);
    }

    $writer->addRows($excelRows);

    ob_clean();
    $writer->close();

    exit();
}
</code>```

Body:
I just recently implemented box/spout library replacing the phpspreadsheet library in favour of memory efficiency.

I am also able to produce the excel file using it.

But after opening the excel file using ms office 2019, I cannot edit the cells at all, it just seems all shown read-only.

But if I use phpspreadsheet to generate the same thing, I can edit the file.

Do any of you folks know anything that I am missing out here.

Following is my implementation of box/spout

use Box\Spout\Common\Type;
use Box\Spout\Writer\Common\Creator\Style\StyleBuilder;
use Box\Spout\Writer\Common\Creator\WriterEntityFactory;
use PhpOffice\PhpSpreadsheet\Shared\Date;

function exprot_table($xmlObjectArray, $rows)
{
    error_reporting(E_ALL);
    $head = (array) $rows[0];
    $headArray = array_keys($head);

    $writer = WriterEntityFactory::createWriter(Type::XLSX);
    $writer->openToBrowser("demoexcel.xlsx");

    $rowFromValues = WriterEntityFactory::createRowFromArray($headArray);
    $writer->addRow($rowFromValues);

    $excelRows = array();
    foreach ($rows as $key => $row) {
        $row = (array) $row;
        $cells = array();
        foreach ($headArray as $keyc => $column) {
            $fieldType = $xmlObjectArray[$column]['type'];
            $col_name = $this->get_col_name($keyc);
            // set date formate
            if ($fieldType == "datetime") {
                if (! empty($row[$column])) {
                    // Get server time zone offset in seconds and add or subtract from main value
                    $timeZoneOffset = date('Z', $row[$column]);
                    $date = $row[$column] + $timeZoneOffset;
                    $date = Date::PHPToExcel(trim($date));
                    $cellstyle = (new StyleBuilder())->setFormat('dd mmm yyyy')->build();
                    $cells[] = WriterEntityFactory::createCell($date, $cellstyle);

                } else {

                    $cells[] = WriterEntityFactory::createCell('');
                }
            } elseif ($fieldType == "money") {
                if (strlen($row[$column]) > 0) {

                    $cellstyle = (new StyleBuilder())->setFormat('#,##0.00;[Red]#,##0.00')->build();
                    $cells[] = WriterEntityFactory::createCell($row[$column], $cellstyle);
                } else {

                    $cells[] = WriterEntityFactory::createCell('');
                }
            }elseif ($fieldType == "number") {
                if (strlen($row[$column]) > 0) {

                    $cellstyle = (new StyleBuilder())->setFormat('#,##')->build();
                    $cells[] = WriterEntityFactory::createCell($row[$column], $cellstyle);
                } else {

                    $cells[] = WriterEntityFactory::createCell('');
                }
            } elseif ($fieldType == "image") {
                $value = $row[$column];
                if (! empty($value)) {
                    $imageFolder = $this->config->item('img_upload_path');
                    $subDirectory = (string) $xmlObjectArray[$column]['sub_directory'];
                    if (isset($subDirectory) and ! empty($subDirectory)) {
                        $imageFolder .= $subDirectory . "/";
                    }
                    $filePath = $imageFolder . $value;
                    if (stripos($value, 'https://') !== false || stripos($value, 'http://') !== false) {

                        $cells[] = WriterEntityFactory::createCell('=HYPERLINK("'. $value .'","'. $value .'")');
                    } else {

                        $cells[] = WriterEntityFactory::createCell($value);
                    }
                }

            } elseif ($fieldType == "file") {

                $value = $row[$column];
                $imageFolder = $this->config->item('img_upload_path');
                if (! empty($value)) {
                    $value = CDN_URL . $imageFolder . $value;
                }

                $cells[] = WriterEntityFactory::createCell($value);
            } else {

                $cells[] = WriterEntityFactory::createCell($row[$column]);
            }
        }

        $excelRows[] = WriterEntityFactory::createRow($cells);
    }

    $writer->addRows($excelRows);

    ob_clean();
    $writer->close();

    exit();
}


问:
Laravel 9 Digitalocean spaces upload file
```<code>   $filename = time() . $file->getClientOriginalName();

        Storage::disk('do')->put("public/images/{$directory}/{$filename}", File::get($file), 'public');

        return "images/avatars/{$filename}";
</code>```

I upload file there is not any error but file doesn't upload to digitalocean spaces

Body:
   $filename = time() . $file->getClientOriginalName();

        Storage::disk('do')->put("public/images/{$directory}/{$filename}", File::get($file), 'public');

        return "images/avatars/{$filename}";

I upload file there is not any error but file doesn't upload to digitalocean spaces


问:
Nginx Redirect Request-Body As Parameter
I send a post-request and redirect it to a new path.

```<code>location  /post_request {
    return 307 http://0.0.0.0:5555/success?body=$request_body;
}
</code>```

But here $request_body looks empty. Is there a way to handle it?

Body:
I send a post-request and redirect it to a new path.

location  /post_request {
    return 307 http://0.0.0.0:5555/success?body=$request_body;
}

But here $request_body looks empty. Is there a way to handle it?


问:
withCredentials() block jenkinsfile syntax error
The withCredentials block syntax is confusing me. I have tried placing it outside stages{}, outside stage('saving stross...'), and now within the stage('saving stross...'), but I am unable to fix this syntax error in the jenkins pipeline.

jenkinsfile:

```<code>pipeline {
    agent {
        node {
            label 'node1'
        }
    }
    stages {
        stage('saving stross token and printing') {
            withCredentials([string(credentialsId: 'devadrita-stross', variable: 'deva-stross')]) {
                steps {
                    script {
                        bat """
                        python -u C://Users//Administrator//Desktop//stross//stross-script.py, token = "${deva-stross}"
                        """
                    }
                }
            }
        }
    }
}
</code>```

error-

```<code>Started by user admin
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 8: Unknown stage section "withCredentials". Starting with version 0.5, steps in a stage must be in a ‘steps’ block. @ line 8, column 9.
           stage('saving stross token and printing') {
           ^

WorkflowScript: 8: Expected one of "steps", "stages", or "parallel" for stage "saving stross token and printing" @ line 8, column 9.
           stage('saving stross token and printing') {
           ^
</code>```

Body:
The withCredentials block syntax is confusing me. I have tried placing it outside stages{}, outside stage('saving stross...'), and now within the stage('saving stross...'), but I am unable to fix this syntax error in the jenkins pipeline.

jenkinsfile:

pipeline {
    agent {
        node {
            label 'node1'
        }
    }
    stages {
        stage('saving stross token and printing') {
            withCredentials([string(credentialsId: 'devadrita-stross', variable: 'deva-stross')]) {
                steps {
                    script {
                        bat """
                        python -u C://Users//Administrator//Desktop//stross//stross-script.py, token = "${deva-stross}"
                        """
                    }
                }
            }
        }
    }
}

error-

Started by user admin
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 8: Unknown stage section "withCredentials". Starting with version 0.5, steps in a stage must be in a ‘steps’ block. @ line 8, column 9.
           stage('saving stross token and printing') {
           ^

WorkflowScript: 8: Expected one of "steps", "stages", or "parallel" for stage "saving stross token and printing" @ line 8, column 9.
           stage('saving stross token and printing') {
           ^


问:
Static local variable colorization
Is there a way to colorize a function's static variable?

I have tried to customize editor.tokenColorCustomizations. For that i have used "Inspect Editor Token and Scopes" and them field "modifiers".
I have figured out static local variable has only "local" modifiers just like non-static local variable.

I also have tried to use "storage.modifiers.static" scope, but it highlights a static-keyword, not the variable.

Title: Static local variable colorization


问:
(not set) in event list
I am getting a (not set) value in the event list for a user id, after debugging I found that I am not getting the user_engagement event in this event list, I think instead of user_engagement, it is showing (not_set). In the Firebase debugger, I see that all custom events are sent successfully.

I checked custom events in the Firebase debugger and all events are sent successfully.

Title: (not set) in event list


问:
How to make a chart in a windows form which takes the x and y axis from two comboboxes in another form. (The comboboxes has db column names as items)
I want to make a windows forms application with two forms: form1 and form2, form2 displays a 3D chart with a local SQL server connection to make a database as it's DataSource.

I gave two combobox in form1 which will display the columns in the data so that the user can select the columns they want and then click a button on form1 which will open the form2 with the 3D chart made from taking the columns as it's x and y axis.

For this I made a DataTable and added the data, then provided the DataTable columns names to both the combobox then I made an instance of form2 inside form1 and passed the combobox items as strings to the string variables created in form2.

But it's showing the exception 'Object reference not set to an instance of an object.'
How do I fix this error?

```<code>
//Form1
    public void GetColumns()
        {
            DataTable dt=new DataTable();
            data d = new Dataaccess.data();
            dt = (DataTable)d.GetData();

            foreach (DataColumn dc in dt.Columns)
                {
                    Xaxis.Items.Add(dc.ColumnName);
                    Yaxis.Items.Add(dc.ColumnName);
                }
        }
        Form2 frm = new Form2();
        public void Xaxis_SelectedIndexChanged(object sender, EventArgs e)
        {
            frm.xaxis = Xaxis.SelectedItem.ToString();
        }

        public void Yaxis_SelectedIndexChanged(object sender, EventArgs e)
        {
            frm.yaxis = Yaxis.SelectedItem.ToString();
        }

        public void Loadchart_Click(object sender, EventArgs e)
        {
            this.Hide();
            frm.Show();
        }
</code>```
```<code>//Form2
public partial class Form2 : Form
    {
        public string xaxis;
        public string yaxis;
        public Application()
        {
            InitializeComponent();
            FillData();
        }

public void FillData()
        {
                object dt;
                data d = new Dataaccess.data();
                dt = d.GetData();
                chart1.DataSource = dt;

                chart1.Series[0].LegendText = xaxis;
                chart1.Series[0].IsVisibleInLegend = true;
                chart1.Series[0].XValueMember = xaxis;
                chart1.Series[0].YValueMembers = yaxis;
        }

</code>```

Body:
I want to make a windows forms application with two forms: form1 and form2, form2 displays a 3D chart with a local SQL server connection to make a database as it's DataSource.

I gave two combobox in form1 which will display the columns in the data so that the user can select the columns they want and then click a button on form1 which will open the form2 with the 3D chart made from taking the columns as it's x and y axis.

For this I made a DataTable and added the data, then provided the DataTable columns names to both the combobox then I made an instance of form2 inside form1 and passed the combobox items as strings to the string variables created in form2.

But it's showing the exception 'Object reference not set to an instance of an object.'
How do I fix this error?

//Form1
    public void GetColumns()
        {
            DataTable dt=new DataTable();
            data d = new Dataaccess.data();
            dt = (DataTable)d.GetData();

            foreach (DataColumn dc in dt.Columns)
                {
                    Xaxis.Items.Add(dc.ColumnName);
                    Yaxis.Items.Add(dc.ColumnName);
                }
        }
        Form2 frm = new Form2();
        public void Xaxis_SelectedIndexChanged(object sender, EventArgs e)
        {
            frm.xaxis = Xaxis.SelectedItem.ToString();
        }

        public void Yaxis_SelectedIndexChanged(object sender, EventArgs e)
        {
            frm.yaxis = Yaxis.SelectedItem.ToString();
        }

        public void Loadchart_Click(object sender, EventArgs e)
        {
            this.Hide();
            frm.Show();
        }

//Form2
public partial class Form2 : Form
    {
        public string xaxis;
        public string yaxis;
        public Application()
        {
            InitializeComponent();
            FillData();
        }

public void FillData()
        {
                object dt;
                data d = new Dataaccess.data();
                dt = d.GetData();
                chart1.DataSource = dt;

                chart1.Series[0].LegendText = xaxis;
                chart1.Series[0].IsVisibleInLegend = true;
                chart1.Series[0].XValueMember = xaxis;
                chart1.Series[0].YValueMembers = yaxis;
        }


问:
I want to add a file to the tag <input type"file"> but I can't
```<code><script id="TEMPLATE_GROUP_INFO_STRUCTURE" type="text/template"><button type="button"
  class="MdBtn01Close02"><%= COMMON_CLOSE %></button>
    <h1 class="MdHide"><%= BUDDY_GROUP_EDIT %></h1>
      <div class="MdBox04">
        <div class="MdCMN09ImgEdit">
          <input type="file" accept="image/x-png, image/gif, image/jpeg"
    class="mdCMN09ImgInput" style="background-image: url({{thumbnailImage}})" data-
    picture-path="{{groupInfo.picturePath}}"
                   title="<%= BUDDY_GROUP_EDIT %>">
            </div>

        </div>
</script>
</code>```

I want to add a file to the tag <input type"file"> but I can't

```<code>img = driver.find_element(By.XPATH,'//*[@class="mdCMN09ImgInput"]')
img.send_keys('C:\\Users\\MyPc\\Desktop\\Ufazoom\\ban6 copy.png')
</code>```

This is what I did. I got the Error NoSuchElementException.

Body:
I want to add a file to the tag <input type"file"> but I can't

img = driver.find_element(By.XPATH,'//*[@class="mdCMN09ImgInput"]')
img.send_keys('C:\\Users\\MyPc\\Desktop\\Ufazoom\\ban6 copy.png')

This is what I did. I got the Error NoSuchElementException.


问:
Which function is right hook point to capture info of packets kernel has received?
I want to use eBPF to monitor how many bytes the a  K8s pod has sent to and received  from out side cluster. I guess tracepoints at /net/* should work, but I find the only output traffic goes through these tracepoints (e.g. net:net_dev_xmit)  so what about the incoming traffic ?

Here is the example,the result shows incoming traffic do not trigger netif_receive_skb or netif_rx.

❯ sudo perf trace --no-syscall --event 'net:*' curl example.com > /dev/null
     0.000 :3786880/3786880 net:net_dev_queue(skbaddr: 0xffff894b2703cc00, len: 71, name: "eno1")
     0.009 :3786880/3786880 net:net_dev_start_xmit
     0.012 :3786880/3786880 net:net_dev_xmit(skbaddr: 0xffff894b2703cc00, len: 71, name: "eno1")
     0.015 :3786880/3786880 net:net_dev_queue(skbaddr: 0xffff894b2703c900, len: 71, name: "eno1")
     0.016 :3786880/3786880 net:net_dev_start_xmit
     0.018 :3786880/3786880 net:net_dev_xmit(skbaddr: 0xffff894b2703c900, len: 71, name: "eno1")
   171.319 curl/3786879 net:net_dev_queue(skbaddr: 0xffff894b45c9cee0, len: 74, name: "eno1")
   171.326 curl/3786879 net:net_dev_start_xmit
   171.330 curl/3786879 net:net_dev_xmit(skbaddr: 0xffff894b45c9cee0, len: 74, name: "eno1")
  1352.743 curl/3786879 net:net_dev_start_xmit()
  1352.745 curl/3786879 net:net_dev_xmit(skbaddr: 0xffff894b45c9cce0, len: 141, name: "eno1")
  1993.436 curl/3786879 net:net_dev_queue(skbaddr: 0xffff894b45c9d4e0, len: 66, name: "eno1")
  1993.444 curl/3786879 net:net_dev_start_xmit(name: "eno1", skbaddr: 0xffff894b45c9d4e0)
  1993.446 curl/3786879 net:net_dev_xmit(skbaddr: 0xffff894b45c9d4e0, len: 66, name: "eno1")
```

Because  I want to eBPF program ioslates from host network (do not share network namespace) and exclude in-cluster network tarffic, So tcp_sendmgs and tcp_recvmsg are not suitable hook point.

Thank you for very much if you could give some suggestion.

PS: I remove inrelative info of perf trace  for simplicity.

Body:
I want to use eBPF to monitor how many bytes the a  K8s pod has sent to and received  from out side cluster. I guess tracepoints at /net/* should work, but I find the only output traffic goes through these tracepoints (e.g. net:net_dev_xmit)  so what about the incoming traffic ?

Here is the example,the result shows incoming traffic do not trigger netif_receive_skb or netif_rx.

❯ sudo perf trace --no-syscall --event 'net:*' curl example.com > /dev/null
     0.000 :3786880/3786880 net:net_dev_queue(skbaddr: 0xffff894b2703cc00, len: 71, name: "eno1")
     0.009 :3786880/3786880 net:net_dev_start_xmit
     0.012 :3786880/3786880 net:net_dev_xmit(skbaddr: 0xffff894b2703cc00, len: 71, name: "eno1")
     0.015 :3786880/3786880 net:net_dev_queue(skbaddr: 0xffff894b2703c900, len: 71, name: "eno1")
     0.016 :3786880/3786880 net:net_dev_start_xmit
     0.018 :3786880/3786880 net:net_dev_xmit(skbaddr: 0xffff894b2703c900, len: 71, name: "eno1")
   171.319 curl/3786879 net:net_dev_queue(skbaddr: 0xffff894b45c9cee0, len: 74, name: "eno1")
   171.326 curl/3786879 net:net_dev_start_xmit
   171.330 curl/3786879 net:net_dev_xmit(skbaddr: 0xffff894b45c9cee0, len: 74, name: "eno1")
  1352.743 curl/3786879 net:net_dev_start_xmit()
  1352.745 curl/3786879 net:net_dev_xmit(skbaddr: 0xffff894b45c9cce0, len: 141, name: "eno1")
  1993.436 curl/3786879 net:net_dev_queue(skbaddr: 0xffff894b45c9d4e0, len: 66, name: "eno1")
  1993.444 curl/3786879 net:net_dev_start_xmit(name: "eno1", skbaddr: 0xffff894b45c9d4e0)
  1993.446 curl/3786879 net:net_dev_xmit(skbaddr: 0xffff894b45c9d4e0, len: 66, name: "eno1")

Because  I want to eBPF program ioslates from host network (do not share network namespace) and exclude in-cluster network tarffic, So tcp_sendmgs and tcp_recvmsg are not suitable hook point.

Thank you for very much if you could give some suggestion.

PS: I remove inrelative info of perf trace  for simplicity.


问:
Under imported Flutter Awesome Notification plugin,why my popup notification showed twice after receiving one message without firebase?
As title,
first,I created a button and ran a method,
clicked once,showed once,the behavior is normal,as below:

```<code>tmp.add(TextButton(
        onPressed: () async {
          await AwesomeNotifications().createNotification(
              content: NotificationContent(
                  id: -1,
                  channelKey: 'alerts',
                  title: 'Simple Notification',
                  body: 'test',
                  actionType: ActionType.Default));
        },
        child: const Text('local test')));
</code>```

but,after integrating Telephony plugin and received one SMS message,my notification showed twice,every time is the same situation,it should only show once,I don't know why,
and I didn't use any firebase service,please see my code:

```<code>onMessage(SmsMessage? message) async {
    if (message != null) {
      setState(() {
        _message = message.body!;
      });
      if (Platform.isAndroid) {
        await AwesomeNotifications().createNotification(
          content: NotificationContent(
              // id: Random().nextInt(2147483647),
              id: -1,
              channelKey: 'alerts',
              title: message.address,
              body: message.body,
              category: NotificationCategory.Message,
              actionType: ActionType.Default),
        );
      }
    }
  }
</code>```

Is there anyone meet the same problem?Please help,many thanks.

Body:
As title,
first,I created a button and ran a method,
clicked once,showed once,the behavior is normal,as below:

tmp.add(TextButton(
        onPressed: () async {
          await AwesomeNotifications().createNotification(
              content: NotificationContent(
                  id: -1,
                  channelKey: 'alerts',
                  title: 'Simple Notification',
                  body: 'test',
                  actionType: ActionType.Default));
        },
        child: const Text('local test')));

but,after integrating Telephony plugin and received one SMS message,my notification showed twice,every time is the same situation,it should only show once,I don't know why,
and I didn't use any firebase service,please see my code:

onMessage(SmsMessage? message) async {
    if (message != null) {
      setState(() {
        _message = message.body!;
      });
      if (Platform.isAndroid) {
        await AwesomeNotifications().createNotification(
          content: NotificationContent(
              // id: Random().nextInt(2147483647),
              id: -1,
              channelKey: 'alerts',
              title: message.address,
              body: message.body,
              category: NotificationCategory.Message,
              actionType: ActionType.Default),
        );
      }
    }
  }

Is there anyone meet the same problem?Please help,many thanks.


问:
Suitescript clientScript not respond
I upload an clientScript at customer  deposit field. but this script not respond it doesn't even show an error notification. how to fix it (I have also deleted browser history and cookies) and set all role</p>

Title: Suitescript clientScript not respond


问:
Error: operation has timed out - socket.io
Frequently getting this error "Error: operation has timed out" in my sails logs. The error message points to this location "socket.io\dist\broadcast-operator.js:181:30".

Can somebody help me with this?

Error from sails log given below: Error: operation has timed out at
Timeout._onTimeout (socket.io/dist/broadcast-operator.js:181:30) at
listOnTimeout (node:internal/timers:557:17) at processTimers
(node:internal/timers:500:7)

```<code>Node Version:16.10.0
Socket.io Version: 4.5.4
Sails Version: 1.5.3
</code>```

Also  I tried giving timeout of 30s while emitting after which the timeout error didn't come but there is not acknowledgement from client side also

Body:
Frequently getting this error "Error: operation has timed out" in my sails logs. The error message points to this location "socket.io\dist\broadcast-operator.js:181:30".

Can somebody help me with this?

Error from sails log given below: Error: operation has timed out at
Timeout._onTimeout (socket.io/dist/broadcast-operator.js:181:30) at
listOnTimeout (node:internal/timers:557:17) at processTimers
(node:internal/timers:500:7)

Node Version:16.10.0
Socket.io Version: 4.5.4
Sails Version: 1.5.3

Also  I tried giving timeout of 30s while emitting after which the timeout error didn't come but there is not acknowledgement from client side also


问:
how to find my data from mongodb in node js
```<code>import express from 'express'
import child_process ,{execSync}from 'child_process'
import mongoose from 'mongoose';
const app=express();
const connectDB = async() => {
    mongoose.connect('mongodb://localhost:27017/test')
    const dockSchema  = new mongoose.Schema({
        image:String,
        run:String,
        close:String
    })
    const dock = mongoose.model('docker',dockSchema)
    const data = await dock.find();
    console.warn(data)
    console.log("connection done")
}
connectDB();

app.get("/", (_req,res)=>{
    res.send("hello from satyam")
})
app.listen(8000,()=>console.log("use local host at port 8000"))
output:
use local host at port 8000
[]
connection done
</code>```

why show this blank array ...mongodb is running

i will try to get data from mongodb in node js console.but i find empty array

Body:
import express from 'express'
import child_process ,{execSync}from 'child_process'
import mongoose from 'mongoose';
const app=express();
const connectDB = async() => {
    mongoose.connect('mongodb://localhost:27017/test')
    const dockSchema  = new mongoose.Schema({
        image:String,
        run:String,
        close:String
    })
    const dock = mongoose.model('docker',dockSchema)
    const data = await dock.find();
    console.warn(data)
    console.log("connection done")
}
connectDB();

app.get("/", (_req,res)=>{
    res.send("hello from satyam")
})
app.listen(8000,()=>console.log("use local host at port 8000"))
output:
use local host at port 8000
[]
connection done

why show this blank array ...mongodb is running

i will try to get data from mongodb in node js console.but i find empty array


问:
How can I make a new Svelte Kit project but use an older version?
I am trying to make a new Svelte Kit project but use the version that was just previous to 1.0 (I think)... the version right before they change the routes to folder-based instead of file-based.  Does anyone know how I can do this?  THANKS IN ADVANCE!</p>