问:
How to implement SwiftUI’s .onDrag modifier with NSImage (macOS)
I am building a sandboxed app for macOS with SwiftUI. I have a NSImage that is displayed as Image(nsImage: myNSImage). I want that View to support drag and drop, meaning that it can be dragged to any location that can receive image files.

Here’s my approach:

```<code>Image(nsImage: myNSImage)
    .onDrag({
        let itemProvider = NSItemProvider()
        itemProvider.suggestedName = "image.png"
        itemProvider.registerDataRepresentation(for: UTType.png) {
            loadHandler in

            loadHandler(nsImage.pngRepresentation, nil)
            print("loadHandler completed") // Never prints !!
            return nil

        }
        return itemProvider
    })
</code>```

This way I can drag the View. But it seems like it isn’t able to provide the image.

The “drop”, i.e. on the Desktop, is simply not working. I would expect that it saves an "image.png" in the destination URL, but it doesn’t.

How can I implement .onDrag so that it provides a image file based on NSImage?

Edit: I already have tried different UTTypes, for example .tiff in combination with nsImage.tiffRepresentation without luck.

Body:
I am building a sandboxed app for macOS with SwiftUI. I have a NSImage that is displayed as Image(nsImage: myNSImage). I want that View to support drag and drop, meaning that it can be dragged to any location that can receive image files.

Here’s my approach:

Image(nsImage: myNSImage)
    .onDrag({
        let itemProvider = NSItemProvider()
        itemProvider.suggestedName = "image.png"
        itemProvider.registerDataRepresentation(for: UTType.png) {
            loadHandler in

            loadHandler(nsImage.pngRepresentation, nil)
            print("loadHandler completed") // Never prints !!
            return nil

        }
        return itemProvider
    })

This way I can drag the View. But it seems like it isn’t able to provide the image.

The “drop”, i.e. on the Desktop, is simply not working. I would expect that it saves an "image.png" in the destination URL, but it doesn’t.

How can I implement .onDrag so that it provides a image file based on NSImage?

Edit: I already have tried different UTTypes, for example .tiff in combination with nsImage.tiffRepresentation without luck.


来源: stackexchange

问:
NodeJS Importing firebase callable functions shows error "Expected 2 arguments, but got 0"
I'm importing a firebase callable onCall function inside my functions/index.js from another file inside functions/sendgrid.js. I import the file using sendgrid.sendEmail() and it shows an error saying "expected 2 arguments, but got 0", but when i write this same exact callable function directly inside functions/index.js, it works perfectly fine with no error messages.

Here's my code:

function/sendgrid.js

```<code>module.exports.sendEmail = functions.http.onCall((data, context) => //...send email code)`
</code>```

I then import into index.js

functions/index.js

```<code>const sendgrid = require('./src/sendgrid')
sendgrid.sendEmail() //error expected 2 arguments but got 0.
</code>```

Why would i need to pass paramters in index.js if i'm already passing them in sendgrid.js?
Main question is can i (and if so, how) can i keep the import clean one liner like: sendgrid.sendEmail() without writing the entire onCall function out inside index.js

ContentLicense: CC BY-SA 4.0

Body:
I'm importing a firebase callable onCall function inside my functions/index.js from another file inside functions/sendgrid.js. I import the file using sendgrid.sendEmail() and it shows an error saying "expected 2 arguments, but got 0", but when i write this same exact callable function directly inside functions/index.js, it works perfectly fine with no error messages.

Here's my code:

function/sendgrid.js

module.exports.sendEmail = functions.http.onCall((data, context) => //...send email code)`

I then import into index.js

functions/index.js

const sendgrid = require('./src/sendgrid')
sendgrid.sendEmail() //error expected 2 arguments but got 0.

Why would i need to pass paramters in index.js if i'm already passing them in sendgrid.js?
Main question is can i (and if so, how) can i keep the import clean one liner like: sendgrid.sendEmail() without writing the entire onCall function out inside index.js


问:
TypeORM DON'T RUN migrations that I generated
I'm using TypeORM to map schema database that I have created with a MySQL script. My entities have already been created in TypeORM syntax and I want to generate the SQL code of them. The problem appear when I try to run the migration of the script generated by TypeORM and don't work, the terminal only show me:

```<code>query: SELECT VERSION() AS `version`
query: SELECT \* FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA` = 'levels' AND `TABLE_NAME` = 'migrations'
query: SELECT \* FROM `levels`.`migrations` `migrations` ORDER BY `id` DESC
No migrations are pending
</code>```

However, TypeORM did generate a .ts file with the creations of the tables in a folder "migrations" from my proyect:
enter image description here

The configuration of my AppDataSource is this:

```<code>// File in '/src/config/mysql.ts'

const AppDataSource = new DataSource({
    type: "mysql",
    host: <string>process.env.HOST_DB,
    port: 3306,
    username: <string>process.env.USER_DB,
    password: <string>process.env.PASSWORD_DB,
    database: <string>process.env.DB,
    synchronize: false,
    logging: true,
    entities: [User, Album, Genre, Playlist],
    migrations: [__dirname + "/migrations/*{.ts,.js}"],
    migrationsRun: true,
});

export { AppDataSource };
</code>```

The scripts that I execute in the package.json:

```<code>
"scripts": {
    "test": "echo "Error: no test specified" && exit 1",
    "dev": "nodemon src/app.ts",
    "typeorm": "typeorm-ts-node-esm -d ./src/config/mysql.ts",
    "m:gen": "npm run typeorm migration:generate",
    "m:run": "npm run typeorm migration:run"
},
</code>```

The command I ran to generate a migration that WORKED FOR ME was: npm run m:gen -- src/migrations/test1

The command for me to run the migration is: npm run m:run

I only need that TypeORM executes the .ts file that it generated, but I can’t make it work.

Body:
I'm using TypeORM to map schema database that I have created with a MySQL script. My entities have already been created in TypeORM syntax and I want to generate the SQL code of them. The problem appear when I try to run the migration of the script generated by TypeORM and don't work, the terminal only show me:

query: SELECT VERSION() AS `version`
query: SELECT \* FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA` = 'levels' AND `TABLE_NAME` = 'migrations'
query: SELECT \* FROM `levels`.`migrations` `migrations` ORDER BY `id` DESC
No migrations are pending

However, TypeORM did generate a .ts file with the creations of the tables in a folder "migrations" from my proyect:
enter image description here

The configuration of my AppDataSource is this:

// File in '/src/config/mysql.ts'

const AppDataSource = new DataSource({
    type: "mysql",
    host: <string>process.env.HOST_DB,
    port: 3306,
    username: <string>process.env.USER_DB,
    password: <string>process.env.PASSWORD_DB,
    database: <string>process.env.DB,
    synchronize: false,
    logging: true,
    entities: [User, Album, Genre, Playlist],
    migrations: [__dirname + "/migrations/*{.ts,.js}"],
    migrationsRun: true,
});

export { AppDataSource };

The scripts that I execute in the package.json:

"scripts": {
    "test": "echo "Error: no test specified" && exit 1",
    "dev": "nodemon src/app.ts",
    "typeorm": "typeorm-ts-node-esm -d ./src/config/mysql.ts",
    "m:gen": "npm run typeorm migration:generate",
    "m:run": "npm run typeorm migration:run"
},

The command I ran to generate a migration that WORKED FOR ME was: npm run m:gen -- src/migrations/test1

The command for me to run the migration is: npm run m:run

I only need that TypeORM executes the .ts file that it generated, but I can’t make it work.


问:
windows.print() stopped working in chrome after recent chrome update
A .net print page that used to render correctly on chrome for a long time is not doing so any more. This problem started after we noticed a series of chrome updates recently. The text appears overlapped. The print preview and the print renders fine on edge. The function used is windows.print(). Has anyone been able to resolve it.</p>


问:
Edit Excel File in Stored in Resources
Trying to edit my Excel template that is stored in my resources. When I get to the line that actually inserts text into the resource file: ws.Cells["C1"].Value = "TestText";, I get an error that says "System.ArgumentException: 'The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))'"  How can I solve this problem?

```<code>  private void exceltest()
        {
            Excel._Workbook excelWorkbook;
            //save resource to disk
            string pathz = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
            string filepath = pathz + @"\resource.xltx";
            //string strPathToResource = @"c:\resource.xltx";
            using (FileStream cFileStream = new FileStream(filepath, FileMode.Create))
            {
                cFileStream.Write(Resources.resource, 0, Resources.resource.Length);
            }

            //open workbook
            Excel.Application xlApp = new Excel.Application();
            excelWorkbook = xlApp.Workbooks.Open(filepath);
            if (excelWorkbook == null)
            {
                MessageBox.Show("Error: Unable to open Excel file.");
                return;
            }
            Excel.Worksheet ws = excelWorkbook.ActiveSheet;
            ws.Cells["C1"].Value = "TestText";

            xlApp.Visible = true;
        }
</code>```

Title: Edit Excel File in Stored in Resources

Body:
Trying to edit my Excel template that is stored in my resources. When I get to the line that actually inserts text into the resource file: ws.Cells["C1"].Value = "TestText";, I get an error that says "System.ArgumentException: 'The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))'"  How can I solve this problem?

  private void exceltest()
        {
            Excel._Workbook excelWorkbook;
            //save resource to disk
            string pathz = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
            string filepath = pathz + @"\resource.xltx";
            //string strPathToResource = @"c:\resource.xltx";
            using (FileStream cFileStream = new FileStream(filepath, FileMode.Create))
            {
                cFileStream.Write(Resources.resource, 0, Resources.resource.Length);
            }

            //open workbook
            Excel.Application xlApp = new Excel.Application();
            excelWorkbook = xlApp.Workbooks.Open(filepath);
            if (excelWorkbook == null)
            {
                MessageBox.Show("Error: Unable to open Excel file.");
                return;
            }
            Excel.Worksheet ws = excelWorkbook.ActiveSheet;
            ws.Cells["C1"].Value = "TestText";

            xlApp.Visible = true;
        }


问:
js global array to table - show all the values in the array over and over again (duplicated in the table)
i need a global array that keep players details and inner into table but when I add a new player from a form, in the table i see duplicated values always. for example if i have [1], the table show 1, when i add some [1,2] for example, the table show 1,1,2 and if i add more, the table show to me 1,1,1,2,2,3
i work with real time database, with onValue to show the players in the table.

i want a global array and when i add one object its will add only this object to the table.

```<code>  var playerslist = [];

function addplayertotable(name, age, number, rule){
      let trowplayers = document.createElement("tr");
      let tdplayername = document.createElement("td");
      let tdplayerage = document.createElement("td");
      let tdplayernumber = document.createElement("td");
      let tdplayerrule = document.createElement("td");

      tdplayername.innerHTML = name;
      tdplayerage.innerHTML = age;
      tdplayernumber.innerHTML = number;
      tdplayerrule.innerHTML = rule;

      trowplayers.appendChild(tdplayername);
      trowplayers.appendChild(tdplayerage);
      trowplayers.appendChild(tdplayernumber);
      trowplayers.appendChild(tdplayerrule);
      tbodyplayers.appendChild(trowplayers);
    }
  function addallitemstotable(theplayer){
    tbodyplayers.innerHTML = "";
    theplayer.forEach(element =>{
      addplayertotable(element.PlayerName, element.PlayerAge, element.PlayerNum, element.PlayerRule);
    });
  }

  function getplayersdata(){
    auth.onAuthStateChanged(user =>{
      if(user){
        const dbRef = ref(database, 'players/' + user.uid);
        onValue(dbRef, (snapshot) =>{
          snapshot.forEach(childsnapshotplayer => {
            playerslist.push(childsnapshotplayer.val());
          });
          addallitemstotable(playerslist);
        })
      }
      else{
        console.log("null")
      }
    })
  }
</code>```

Body:
i need a global array that keep players details and inner into table but when I add a new player from a form, in the table i see duplicated values always. for example if i have [1], the table show 1, when i add some [1,2] for example, the table show 1,1,2 and if i add more, the table show to me 1,1,1,2,2,3
i work with real time database, with onValue to show the players in the table.

i want a global array and when i add one object its will add only this object to the table.

  var playerslist = [];

function addplayertotable(name, age, number, rule){
      let trowplayers = document.createElement("tr");
      let tdplayername = document.createElement("td");
      let tdplayerage = document.createElement("td");
      let tdplayernumber = document.createElement("td");
      let tdplayerrule = document.createElement("td");

      tdplayername.innerHTML = name;
      tdplayerage.innerHTML = age;
      tdplayernumber.innerHTML = number;
      tdplayerrule.innerHTML = rule;

      trowplayers.appendChild(tdplayername);
      trowplayers.appendChild(tdplayerage);
      trowplayers.appendChild(tdplayernumber);
      trowplayers.appendChild(tdplayerrule);
      tbodyplayers.appendChild(trowplayers);
    }
  function addallitemstotable(theplayer){
    tbodyplayers.innerHTML = "";
    theplayer.forEach(element =>{
      addplayertotable(element.PlayerName, element.PlayerAge, element.PlayerNum, element.PlayerRule);
    });
  }

  function getplayersdata(){
    auth.onAuthStateChanged(user =>{
      if(user){
        const dbRef = ref(database, 'players/' + user.uid);
        onValue(dbRef, (snapshot) =>{
          snapshot.forEach(childsnapshotplayer => {
            playerslist.push(childsnapshotplayer.val());
          });
          addallitemstotable(playerslist);
        })
      }
      else{
        console.log("null")
      }
    })
  }


问:
Can't get the vue-fitty plugin to work with nuxt 3?
Following the Nuxt.com docs for adding vue-fitty plugin.
My Nuxt config.

```<code>export default defineNuxtConfig({
    modules: [
        "@nuxtjs/tailwindcss",
        '~/plugins/vue-fitty.js'

    ]
})
</code>```

In my plugins folder
I created a vue-fitty.js with this in it.

```<code>import { defineNuxtPlugin } from 'nuxt/app';
import Fitty from "vue-fitty"
export default defineNuxtPlugin((nuxtApp) => nuxtApp.vueApp.use(Fitty)
)
</code>```

Getting this error.

```<code>Cannot start nuxt: Cannot use 'import.meta' outside a module
if (import.meta.hot) {
^^^^
</code>```

Any one know anything?

I also tried using a Vue 3 version vue3-fitty, But my IDE says its not installed when it is?

Body:
Following the Nuxt.com docs for adding vue-fitty plugin.
My Nuxt config.

export default defineNuxtConfig({
    modules: [
        "@nuxtjs/tailwindcss",
        '~/plugins/vue-fitty.js'

    ]
})

In my plugins folder
I created a vue-fitty.js with this in it.

import { defineNuxtPlugin } from 'nuxt/app';
import Fitty from "vue-fitty"
export default defineNuxtPlugin((nuxtApp) => nuxtApp.vueApp.use(Fitty)
)

Getting this error.

Cannot start nuxt: Cannot use 'import.meta' outside a module
if (import.meta.hot) {
^^^^

Any one know anything?

I also tried using a Vue 3 version vue3-fitty, But my IDE says its not installed when it is?


问:
mat table, style specific cell
I have a mat table with [dataSource] got from api. I need to change cell style of specific column based on condition as the content value of cell is bigger than 10000 for example.
This is what I tried so far and it is totally not right as it dropped into the infinite loops.

The function is for changing the cell background color when this.selectedSectionWarning[4] is ticked based on the condition of any cells have value of item.blkFuel < 12000.

How can this be done?

```<code>getTitle(): any {
    const search = {
      page: this.paginationRequest.page,
      size: this.paginationRequest.size
    }
    this.titleServices.getTitle(search.page, search.size).subscribe({
      next: (data: any) => {
        this.titleList = data;

        this.titleList.map(item => {
          if(parseInt(item.blkFuel) < 12000 ){
            this.titleList.indexOf(item)
            if(this.sectionSelectedWarning.includes(this.selectedSectionWarningList[4])) {
              item.blkFuel ? style({background: 'darkorange'}) : '';
            }
          }
        })
      },
      error: (e) => console.log(e)
    })
  }
</code>```

Title: mat table, style specific cell

Body:
I have a mat table with [dataSource] got from api. I need to change cell style of specific column based on condition as the content value of cell is bigger than 10000 for example.
This is what I tried so far and it is totally not right as it dropped into the infinite loops.

The function is for changing the cell background color when this.selectedSectionWarning[4] is ticked based on the condition of any cells have value of item.blkFuel < 12000.

How can this be done?

getTitle(): any {
    const search = {
      page: this.paginationRequest.page,
      size: this.paginationRequest.size
    }
    this.titleServices.getTitle(search.page, search.size).subscribe({
      next: (data: any) => {
        this.titleList = data;

        this.titleList.map(item => {
          if(parseInt(item.blkFuel) < 12000 ){
            this.titleList.indexOf(item)
            if(this.sectionSelectedWarning.includes(this.selectedSectionWarningList[4])) {
              item.blkFuel ? style({background: 'darkorange'}) : '';
            }
          }
        })
      },
      error: (e) => console.log(e)
    })
  }


问:
Enable listen hook in production in Nuxt
Anybody know how to enable the listen hook in Nuxt in production ?
It works with npm run dev (dev) but not with npm run build & npm run preview (production)

I want to have access to the node server to link it with a WebSocketServer, this is my nuxt.config.ts:

```<code>
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({

        hooks: {
            listen(server) {
                console.log(server)

                const yogaApp = createYoga({
                    graphqlEndpoint: '/api/graphql',
                    schema: createSchema({
                        typeDefs: /* GraphQL */ `
                            type Query {
                                hello: String
                            }

                            type Subscription {
                                countdown(from: Int!): Int!
                            }
                        `,
                        resolvers: {
                            Query: {
                                hello: () => 'world'
                            },
                            Subscription: {
                                countdown: {
                                    // This will return the value on every 1 sec until it reaches 0
                                    subscribe: async function* (_, { from }) {
                                        for (let i = from; i >= 0; i--) {
                                            await new Promise((resolve) => setTimeout(resolve, 1000))
                                            yield { countdown: i }
                                        }
                                    }
                                }
                            }
                        }
                    }),
                    graphiql:{
                        subscriptionsProtocol: "WS"
                    }
                })

                console.log(yogaApp.graphqlEndpoint)

                // Get NodeJS Server from Yoga
                // Create WebSocket server instance from our Node server
                const wsServer = new WebSocketServer({
                    server,
                    path: yogaApp.graphqlEndpoint
                })

                // Integrate Yoga's Envelop instance and NodeJS server with graphql-ws
                useServer(
                    {
                        execute: (args: any) => args.rootValue.execute(args),
                        subscribe: (args: any) => args.rootValue.subscribe(args),
                        onSubscribe: async (ctx, msg) => {
                            const { schema, execute, subscribe, contextFactory, parse, validate } =
                                yogaApp.getEnveloped({
                                    ...ctx,
                                    req: ctx.extra.request,
                                    socket: ctx.extra.socket,
                                    params: msg.payload
                                })

                            const args = {
                                schema,
                                operationName: msg.payload.operationName,
                                document: parse(msg.payload.query),
                                variableValues: msg.payload.variables,
                                contextValue: await contextFactory(),
                                rootValue: {
                                    execute,
                                    subscribe
                                }
                            }

                            const errors = validate(args.schema, args.document)
                            if (errors.length) return errors
                            return args
                        }
                    },
                    wsServer
                )
            }
        },

})

</code>```

Body:
Anybody know how to enable the listen hook in Nuxt in production ?
It works with npm run dev (dev) but not with npm run build & npm run preview (production)

I want to have access to the node server to link it with a WebSocketServer, this is my nuxt.config.ts:

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({

        hooks: {
            listen(server) {
                console.log(server)

                const yogaApp = createYoga({
                    graphqlEndpoint: '/api/graphql',
                    schema: createSchema({
                        typeDefs: /* GraphQL */ `
                            type Query {
                                hello: String
                            }

                            type Subscription {
                                countdown(from: Int!): Int!
                            }
                        `,
                        resolvers: {
                            Query: {
                                hello: () => 'world'
                            },
                            Subscription: {
                                countdown: {
                                    // This will return the value on every 1 sec until it reaches 0
                                    subscribe: async function* (_, { from }) {
                                        for (let i = from; i >= 0; i--) {
                                            await new Promise((resolve) => setTimeout(resolve, 1000))
                                            yield { countdown: i }
                                        }
                                    }
                                }
                            }
                        }
                    }),
                    graphiql:{
                        subscriptionsProtocol: "WS"
                    }
                })

                console.log(yogaApp.graphqlEndpoint)

                // Get NodeJS Server from Yoga
                // Create WebSocket server instance from our Node server
                const wsServer = new WebSocketServer({
                    server,
                    path: yogaApp.graphqlEndpoint
                })

                // Integrate Yoga's Envelop instance and NodeJS server with graphql-ws
                useServer(
                    {
                        execute: (args: any) => args.rootValue.execute(args),
                        subscribe: (args: any) => args.rootValue.subscribe(args),
                        onSubscribe: async (ctx, msg) => {
                            const { schema, execute, subscribe, contextFactory, parse, validate } =
                                yogaApp.getEnveloped({
                                    ...ctx,
                                    req: ctx.extra.request,
                                    socket: ctx.extra.socket,
                                    params: msg.payload
                                })

                            const args = {
                                schema,
                                operationName: msg.payload.operationName,
                                document: parse(msg.payload.query),
                                variableValues: msg.payload.variables,
                                contextValue: await contextFactory(),
                                rootValue: {
                                    execute,
                                    subscribe
                                }
                            }

                            const errors = validate(args.schema, args.document)
                            if (errors.length) return errors
                            return args
                        }
                    },
                    wsServer
                )
            }
        },

})


问:
MySQL Workbench fails to make connection
completely new to MySQL, have no idea, just trying to learn, so any help would be deeply appreciated.

I installed the ubuntu version of MySQL Workbench although I have Linux Mint. Had to do this since there is no mint version. And besides most ubuntu apps work on mint, well, maybe.

But this may be causing the problems I am facing.

Even though I managed to install it on my mint box, when I started it for the first time I got a warning that it is unsupported (or something like that) and hence this can cause problems. I proceeded anyway.

Before going any further, I should point out that MySQL is working in a docker container. did not want to use docker this early, but its in the tutorial, so yeah.

I have made 2 connections but none of them work.

Here are the details on both these connections as they appear in 'Manage Server Connections'.

Connection Name: Connection1
Connection Method: Standard (TCP/IP)
Hostname: 127.0.0.1
Port: 3306
Username: v.je

Connection Name: Connection2
Connection Method: Standard (TCP/IP)
Hostname: 192.168.10.10
Port: 3306
Username: v.je

When I click on Connection1 under 'MySQL Connections' on the 'Welcome to MySQL Workbench' window, the SQL editor opens.

However, there is no 'SCHEMAS' category on the left-side pane. There are Management, Instance and Performance categories but no schemas. Because of this I cant proceed further on the tutorial I am using.

and on the top tab its written "Connection1- Warning - not supported".

WHy is this happening and what is the solution?

Connection2 simply does not work. When I click on it, an error message pops up saying "Your connection attempt failed for user v.je to the MySQL server at 192.168.10.10:330: Unable to connect to localhost"

There are so many possibilities, that I dont really know what to do. Any help to get it going would be appreciated, thanks a lot.


问:
Problem with loading .gltf files in Github pages of my React Three.js app with Vite
I deployed my React Three.js with Vite app in Github pages, and I can't get it running on a live server - https://thehero9.github.io/ThreeJsReactFiber/

This here is the code in my repo - https://github.com/TheHero9/ThreeJsReactFiber
I have no trouble with the app locally, you can try cloning it with git, then run:

```<code>npm install
npm run dev
</code>```

In order to check how it works locally.

I think the .gltf files are not being loaded correctly due to a problem with the file paths or the loading code. Please, can you help us and check whether you can find why the .gltf files are not loading?

Errors:

Everything is loaded properly on a local server:
[3]: https://i.stack.imgur.com/xV31l.jpg

Body:
I deployed my React Three.js with Vite app in Github pages, and I can't get it running on a live server - https://thehero9.github.io/ThreeJsReactFiber/

This here is the code in my repo - https://github.com/TheHero9/ThreeJsReactFiber
I have no trouble with the app locally, you can try cloning it with git, then run:

npm install
npm run dev

In order to check how it works locally.

I think the .gltf files are not being loaded correctly due to a problem with the file paths or the loading code. Please, can you help us and check whether you can find why the .gltf files are not loading?

Errors:

Everything is loaded properly on a local server:
[3]: https://i.stack.imgur.com/xV31l.jpg


问:
Windows properly detect active window changed
I write a DLL need to know current active window and detect when active window changed.

For detecting active window changed, I use SetWinEventHook and listen for the EVENT_SYSTEM_FOREGROUND event.

```<code>hEvent = SetWinEventHook(EVENT_SYSTEM_FOREGROUND, EVENT_SYSTEM_FOREGROUND , NULL, WinEventProcCallback,0, 0, WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS);
</code>```

I've found that this doesn't work consistently. Sometimes my callback is called, other times not, depending from what to what focus is switched. Perhaps another event...

Is there any Windows (WINAPI?) event which fires every time the active (focused) window changed? I'd like to subscribe with my callback function.

Thanks.

Body:
I write a DLL need to know current active window and detect when active window changed.

For detecting active window changed, I use SetWinEventHook and listen for the EVENT_SYSTEM_FOREGROUND event.

hEvent = SetWinEventHook(EVENT_SYSTEM_FOREGROUND, EVENT_SYSTEM_FOREGROUND , NULL, WinEventProcCallback,0, 0, WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS);

I've found that this doesn't work consistently. Sometimes my callback is called, other times not, depending from what to what focus is switched. Perhaps another event...

Is there any Windows (WINAPI?) event which fires every time the active (focused) window changed? I'd like to subscribe with my callback function.

Thanks.


问:
Getting deserialization error only if I pass extra variable not for missing variable in java
I have a class

```<code>@Builder(builderClassName = "Builder", toBuilder = true)
Class Student {
    @JsonProperty long studentId;
    @JsonProperty long marks;

    @JsonPOJOBuilder(withPrefix = "")
    public static class Builder
    {
    }
}
@Builder(builderClassName = "Builder", toBuilder = true)
public class People
{
    @JsonProperty List<Student> students;
    @JsonPOJOBuilder(withPrefix = "")
    public static class Builder
    {
    }
}
</code>```

When I am sending json {{"studentId":123}} code is working fine, however when I send {{"studentId":123, "marks":230, "firstname":"hello"}} it's giving the error People$Builder["students"]->java.util.ArrayList[0]->com.main.Student$Builder["firstname"]. It is fine with sending less data but if send an extra field it's failing. I am new to java why is it hapenning this way?

Is it possible to make even first case also fail because it's not missing marks field.

Body:
I have a class

@Builder(builderClassName = "Builder", toBuilder = true)
Class Student {
    @JsonProperty long studentId;
    @JsonProperty long marks;

    @JsonPOJOBuilder(withPrefix = "")
    public static class Builder
    {
    }
}
@Builder(builderClassName = "Builder", toBuilder = true)
public class People
{
    @JsonProperty List<Student> students;
    @JsonPOJOBuilder(withPrefix = "")
    public static class Builder
    {
    }
}

When I am sending json {{"studentId":123}} code is working fine, however when I send {{"studentId":123, "marks":230, "firstname":"hello"}} it's giving the error People$Builder["students"]->java.util.ArrayList[0]->com.main.Student$Builder["firstname"]. It is fine with sending less data but if send an extra field it's failing. I am new to java why is it hapenning this way?

Is it possible to make even first case also fail because it's not missing marks field.


问:
Using two or more where conditions to filter FireStore collection
I need to filter a Cloud Firestore Collection.

Here you have the current code:

```<code>Widget build(BuildContext context) {
    return StreamBuilder<QuerySnapshot<Map<String, dynamic>>>(
      stream: FirebaseFirestore.instance
          .collection("postsmedia")
          .where('postmedia_post', isEqualTo: widget.postId)
          .orderBy("postmedia_creado_el", descending: true)
          .snapshots(),
      builder: (ctx, snapShot) {
. . .
</code>```

This code is filtering the collection as needed.

But now I would need to add another condition, as follows:

```<code>stream: FirebaseFirestore.instance
          .collection("postsmedia")
          .where('postmedia_post', isEqualTo: widget.postId)
          .where('postmedia_tipo', isEqualTo: "foto")
          .orderBy("postmedia_creado_el", descending: true)
          .snapshots(),
</code>```

but adding the second .where the apps throws an exception:

```<code>======== Exception caught by widgets library =======================================================
The following _CastError was thrown building StreamBuilder<QuerySnapshot<Map<String, dynamic>>>(dirty, state: _StreamBuilderBaseState<QuerySnapshot<Map<String, dynamic>>, AsyncSnapshot<QuerySnapshot<Map<String, dynamic>>>>#6d6d2):
Null check operator used on a null value
</code>```

Is there another way to implement two or more -where conditions?

Body:
I need to filter a Cloud Firestore Collection.

Here you have the current code:

Widget build(BuildContext context) {
    return StreamBuilder<QuerySnapshot<Map<String, dynamic>>>(
      stream: FirebaseFirestore.instance
          .collection("postsmedia")
          .where('postmedia_post', isEqualTo: widget.postId)
          .orderBy("postmedia_creado_el", descending: true)
          .snapshots(),
      builder: (ctx, snapShot) {
. . .

This code is filtering the collection as needed.

But now I would need to add another condition, as follows:

stream: FirebaseFirestore.instance
          .collection("postsmedia")
          .where('postmedia_post', isEqualTo: widget.postId)
          .where('postmedia_tipo', isEqualTo: "foto")
          .orderBy("postmedia_creado_el", descending: true)
          .snapshots(),

but adding the second .where the apps throws an exception:

======== Exception caught by widgets library =======================================================
The following _CastError was thrown building StreamBuilder<QuerySnapshot<Map<String, dynamic>>>(dirty, state: _StreamBuilderBaseState<QuerySnapshot<Map<String, dynamic>>, AsyncSnapshot<QuerySnapshot<Map<String, dynamic>>>>#6d6d2):
Null check operator used on a null value

Is there another way to implement two or more -where conditions?


问:
REST URI appears to be returning only one object. Is this something I can affect?
Using Hevo because I am not an engineer and I'm getting stuck at the step where I ID a data root.

```<code>I'm expecting to be able to extract the 'Minutes Per Game' for each player to inject into my database. Instead it seams I'm returning a single object. I don't know what that means or how to remedy it.

</code>```

URI: https://api.dataprovider.com/v2/stats/WBB/player/?key=********&format=json&max=1000&season=2023&stat=MPG

JSON returned:

`

```<code>{
    "stats": {
        "Stat": "MPG",
        "StatName": "Minutes per Game",
        "Season": "2023",
        "stat_301207961": {
            "Player": "Nicole Flennaugh",
            "Player_ID": "41157230",
            "Stat": "MPG",
            "Value": "41.0",
            "Qualifier": "N",
            "Season": "2023"
        },
        "stat_305994500": {
            "Player": "Taylor Smith",
            "Player_ID": "48037508",
            "Stat": "MPG",
            "Value": "40.0",
            "Qualifier": "N",
            "Season": "2023"
        },
        "stat_305381466": {
            "Player": "Julianna Martinez",
            "Player_ID": "48254073",
            "Stat": "MPG",
            "Value": "40.0",
            "Qualifier": "N",
            "Season": "2023"
        },
        "stat_294240537": {
            "Player": "Jayla Reliford",
            "Player_ID": "41159650",
            "Stat": "MPG",
            "Value": "40.0",
            "Qualifier": "N",
            "Season": "2023"
        },
        "stat_294098135": {
            "Player": "Denasia Mitchell",
            "Player_ID": "48075649",
            "Stat": "MPG",
            "Value": "40.0",
            "Qualifier": "N",
            "Season": "2023"
        },
</code>```

`

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

Body:
Using Hevo because I am not an engineer and I'm getting stuck at the step where I ID a data root.

I'm expecting to be able to extract the 'Minutes Per Game' for each player to inject into my database. Instead it seams I'm returning a single object. I don't know what that means or how to remedy it.

URI: https://api.dataprovider.com/v2/stats/WBB/player/?key=********&format=json&max=1000&season=2023&stat=MPG

JSON returned:

`

{
    "stats": {
        "Stat": "MPG",
        "StatName": "Minutes per Game",
        "Season": "2023",
        "stat_301207961": {
            "Player": "Nicole Flennaugh",
            "Player_ID": "41157230",
            "Stat": "MPG",
            "Value": "41.0",
            "Qualifier": "N",
            "Season": "2023"
        },
        "stat_305994500": {
            "Player": "Taylor Smith",
            "Player_ID": "48037508",
            "Stat": "MPG",
            "Value": "40.0",
            "Qualifier": "N",
            "Season": "2023"
        },
        "stat_305381466": {
            "Player": "Julianna Martinez",
            "Player_ID": "48254073",
            "Stat": "MPG",
            "Value": "40.0",
            "Qualifier": "N",
            "Season": "2023"
        },
        "stat_294240537": {
            "Player": "Jayla Reliford",
            "Player_ID": "41159650",
            "Stat": "MPG",
            "Value": "40.0",
            "Qualifier": "N",
            "Season": "2023"
        },
        "stat_294098135": {
            "Player": "Denasia Mitchell",
            "Player_ID": "48075649",
            "Stat": "MPG",
            "Value": "40.0",
            "Qualifier": "N",
            "Season": "2023"
        },

`


问:
Make vue router stay on same page if condition is not met
Im working on a vue app and I navigate through pages with vue router from the different page views, I want to set up vue router in a way where it would push a route if there is no error and stay on the same view/route if there is one. I have the following code that succeeds but I'm unsure if that is the best way to do it, and afraid it may cause bugs:</p>
```<code>login() {
  this.$store
    .dispatch("method", {})
    .then(() => {
      if (!this.error) {
        this.$router.push({ name: "nextPage" });
      } else {
        this.$router.push({ name: "samePage" });
      }
    });
}
</code>```

Body:
Im working on a vue app and I navigate through pages with vue router from the different page views, I want to set up vue router in a way where it would push a route if there is no error and stay on the same view/route if there is one. I have the following code that succeeds but I'm unsure if that is the best way to do it, and afraid it may cause bugs:

login() {
  this.$store
    .dispatch("method", {})
    .then(() => {
      if (!this.error) {
        this.$router.push({ name: "nextPage" });
      } else {
        this.$router.push({ name: "samePage" });
      }
    });
}


问:
how to parse dynamically and take action with the current output of the shell?
Considering a first script (language does not matter, it could be replaced by whatever you like, the idea is what it does: replacing, stopping,..)

my_parsing_script.py

```<code>for line in sys.stdin:
    for line in file:
        if line:
            if 'plop' in line:
                raise Exception("'plop' found, aborting target")
            line = re.sub(r'not possible yet', r'nice' , line):

</code>```

I want to use my_parsing_script.py in background

Then I run other scripts

```<code>not_usefull.sh
> echo "this is not possible yet and will never be"

something_nice.sh
> echo "this is not possible yet"

something_very_nice.sh
> echo "this is not possible yet again"

something_bad.sh
> echo "this is not possible yet plop"
</code>```

use and expected outputs:

when MAKING_IMPOSSIBLE_NICE is NOT yes, the output is NOT changed

when MAKING_IMPOSSIBLE_NICE is yes, the output is changed

```<code>$ export MAKING_IMPOSSIBLE_NICE=yes;

$ ./something_nice.sh
> "this is nice"

$ ./something_very_nice.sh
> "this is nice again"

</code>```

I also would like that, setting MAKING_IMPOSSIBLE_NICE is yes,
has no effect on scripts not starting by 'something_'

```<code>$ export MAKING_IMPOSSIBLE_NICE=yes;

$ ./not_usefull.sh
> "this is not possible yet and will never be"

</code>```

I would also like to be able to stop another (makefile) process if a specific string appears (forbidden 'plop')

```<code>$ export MAKING_IMPOSSIBLE_NICE=yes;

$ ./something_bad || echo "bad"
> "'plop' found, aborting target"
> "bad"

</code>```

My first post was talking about Makefiles,
but, as I found nothing yet, I'm trying to find another way using shell only. (I suggest you reading it to understand the first issue).

That looks way more complicated in shell, but at least not impossible...is it?

Ok, I already see you coming: "this is a XY problem", "Why don't you just pipe your parsing script?"

```<code>$ ./something_nice.sh | my_parsing_script.sh
> "this is nice"

$ ./something_very_nice.sh | my_parsing_script.sh
> "this is nice again"

</code>```

This is exactly what I don't want to do : having to type each time the '| script'

I want this to be automatic if the variable is set.

How could I do this? I have no clue

Body:
Considering a first script (language does not matter, it could be replaced by whatever you like, the idea is what it does: replacing, stopping,..)

my_parsing_script.py

for line in sys.stdin:
    for line in file:
        if line:
            if 'plop' in line:
                raise Exception("'plop' found, aborting target")
            line = re.sub(r'not possible yet', r'nice' , line):

I want to use my_parsing_script.py in background

Then I run other scripts

not_usefull.sh
> echo "this is not possible yet and will never be"

something_nice.sh
> echo "this is not possible yet"

something_very_nice.sh
> echo "this is not possible yet again"

something_bad.sh
> echo "this is not possible yet plop"

use and expected outputs:

when MAKING_IMPOSSIBLE_NICE is NOT yes, the output is NOT changed

when MAKING_IMPOSSIBLE_NICE is yes, the output is changed

$ export MAKING_IMPOSSIBLE_NICE=yes;

$ ./something_nice.sh
> "this is nice"

$ ./something_very_nice.sh
> "this is nice again"

I also would like that, setting MAKING_IMPOSSIBLE_NICE is yes,
has no effect on scripts not starting by 'something_'

$ export MAKING_IMPOSSIBLE_NICE=yes;

$ ./not_usefull.sh
> "this is not possible yet and will never be"

I would also like to be able to stop another (makefile) process if a specific string appears (forbidden 'plop')

$ export MAKING_IMPOSSIBLE_NICE=yes;

$ ./something_bad || echo "bad"
> "'plop' found, aborting target"
> "bad"

My first post was talking about Makefiles,
but, as I found nothing yet, I'm trying to find another way using shell only. (I suggest you reading it to understand the first issue).

That looks way more complicated in shell, but at least not impossible...is it?

Ok, I already see you coming: "this is a XY problem", "Why don't you just pipe your parsing script?"

$ ./something_nice.sh | my_parsing_script.sh
> "this is nice"

$ ./something_very_nice.sh | my_parsing_script.sh
> "this is nice again"

This is exactly what I don't want to do : having to type each time the '| script'

I want this to be automatic if the variable is set.

How could I do this? I have no clue


问:
CGI script to display postfix logs showing all values as 0 on browser but works fine on command line
CGI script written to see postfix logs in real time using pflogsumm command returns all values (send mails, received mails, bounced mails etc) as 0. But on command line the script works fine. This is the script.

```<code>#!/bin/bash
echo "Content-type: text/html"
echo ""
echo "<html><head><title>Mail Server Dashboard"
echo "</title></head><body>"
echo "<h1>Postfix Log information for host ####</h1>"
echo ""
echo "``` $(/usr/sbin/pflogsumm -d today /var/log/maillog) ```"
echo "</body></html>"
</code>```

I feel like it's because the script is getting the values from Log files written in ASCII ? What could be the issue ?

Since the CGI script runs fine on command line. I tried saving the pflogsumm's output in a text file and then parsing it on the CGI script. But that just breaks all the table.

Body:
CGI script written to see postfix logs in real time using pflogsumm command returns all values (send mails, received mails, bounced mails etc) as 0. But on command line the script works fine. This is the script.

#!/bin/bash
echo "Content-type: text/html"
echo ""
echo "<title>Mail Server Dashboard"
echo "</title>"
echo "
Postfix Log information for host ####
"
echo ""
echo "
 $(/usr/sbin/pflogsumm -d today /var/log/maillog)
"
echo ""

I feel like it's because the script is getting the values from Log files written in ASCII ? What could be the issue ?

Since the CGI script runs fine on command line. I tried saving the pflogsumm's output in a text file and then parsing it on the CGI script. But that just breaks all the table.


问:
Lazily (de-)serialize JSON with EF Core
I want to write and read JSON data into/from a PostgreSQL database and (de-)serialize them lazily. Please see the following C# types:

// project: Business
public class Person // shall be persisted with EF Core in the database
{
    public int Id { get; private set; }

    public string Name { get; set; }

    public PersonDto? RawData { get; set; }
}

// vendor assembly (via NuGet)
public class PersonDto // input from another system, coming as JSON over the wire
{
    public string Name { get; set; }

    public int Age { get; set; }

    // ...a lot of other properties
}

// project: Persistence
public class PersonContext : DbContext
{
    public DbSet<Person> Persons { get; private set; }
}

// project: Service
public class Handler
{
    private readonly PersonContext _context;

    public Handler(PersonContext context) => _context = context;

    public async Task HandleInputAsync(PersonDto input)
    {
        var person = new Person { Name = input.Name, RawData = input };
        await _context.Persons.AddAsync(person);
        await _context.SaveChangesAsync();
    }
}
```
<p>On the database (PostgreSQL), the data should be persisted like this:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>Id (int)</th>
<th>Name (text)</th>
<th>RawData (json)</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Mike</td>
<td>{ "Name": "Mike", "Age": 33 }</td>
</tr>
</tbody>
</table>
</div>
<p>So I want to store the raw input in a JSON column. I've written a custom converter to do the JSON (de-)serialization. This implementation works, but it has the downside in that the (de-)serialization happens whenever materializing an object from the DB into an EF Core entity. But I only need to access <code>RawData</code> on certain occasions, therefore the (de-)serialization is often not necessary (in terms of computation). Furthermore, I want to avoid the unnecessary allocation of <code>PersonDto</code> if not necessary.</p>
<p>Now comes my sixty-four-thousand-dollar question: is it possible to do the (de-)serialization only on demand/lazily? Some usage examples from inside my business layer:</p>
<pre class="lang-cs prettyprint-override"><code>var name = person.Name; // person.RawData has not yet been used and is therefore uninitialized
var rawData = person.RawData; // now the deserialization takes place.
</code>```

I tried the following approach:

// project: Business
public class Person
{
    public int Id { get; private set; }

    public string Name { get; set; }

    public string? RawData { get; set; }

    public PersonDto GetRawData() => JsonSerializer.Deserialize<PersonDto>(RawData);
}
```

That works, but I wouldn't say I like the following facts:

The string? RawData gets loaded from the DB no matter whether GetRawData() is called or not → large unneeded string in memory

My business layer has to work with JSON (de-)serialization APIs. From a Clean Architecture perspective, I don't like that a high-level component (Person) needs to access low-level details like JSON.

So is there any alternative to solve this in EF Core 7?

Thanks in advance!

Title: Lazily (de-)serialize JSON with EF Core

Body:
I want to write and read JSON data into/from a PostgreSQL database and (de-)serialize them lazily. Please see the following C# types:

// project: Business
public class Person // shall be persisted with EF Core in the database
{
    public int Id { get; private set; }

    public string Name { get; set; }

    public PersonDto? RawData { get; set; }
}

// vendor assembly (via NuGet)
public class PersonDto // input from another system, coming as JSON over the wire
{
    public string Name { get; set; }

    public int Age { get; set; }

    // ...a lot of other properties
}

// project: Persistence
public class PersonContext : DbContext
{
    public DbSet<Person> Persons { get; private set; }
}

// project: Service
public class Handler
{
    private readonly PersonContext _context;

    public Handler(PersonContext context) => _context = context;

    public async Task HandleInputAsync(PersonDto input)
    {
        var person = new Person { Name = input.Name, RawData = input };
        await _context.Persons.AddAsync(person);
        await _context.SaveChangesAsync();
    }
}

On the database (PostgreSQL), the data should be persisted like this:

Id (int)
Name (text)
RawData (json)

1
Mike
{ "Name": "Mike", "Age": 33 }

So I want to store the raw input in a JSON column. I've written a custom converter to do the JSON (de-)serialization. This implementation works, but it has the downside in that the (de-)serialization happens whenever materializing an object from the DB into an EF Core entity. But I only need to access RawData on certain occasions, therefore the (de-)serialization is often not necessary (in terms of computation). Furthermore, I want to avoid the unnecessary allocation of PersonDto if not necessary.

Now comes my sixty-four-thousand-dollar question: is it possible to do the (de-)serialization only on demand/lazily? Some usage examples from inside my business layer:

var name = person.Name; // person.RawData has not yet been used and is therefore uninitialized
var rawData = person.RawData; // now the deserialization takes place.

I tried the following approach:

// project: Business
public class Person
{
    public int Id { get; private set; }

    public string Name { get; set; }

    public string? RawData { get; set; }

    public PersonDto GetRawData() => JsonSerializer.Deserialize<PersonDto>(RawData);
}

That works, but I wouldn't say I like the following facts:

The string? RawData gets loaded from the DB no matter whether GetRawData() is called or not → large unneeded string in memory

My business layer has to work with JSON (de-)serialization APIs. From a Clean Architecture perspective, I don't like that a high-level component (Person) needs to access low-level details like JSON.

So is there any alternative to solve this in EF Core 7?

Thanks in advance!


问:
Prebid - Index video outstream configuration with multiple playerSize in bidders
I would like to create an adUnit video outstream with multiple playserSizes for Index (documentation there

At first I thought to put the playerSize at the adUnit level, but because I want to define multiple playerSizes, I decided to move it at bidder level in  params > video > playerSize. Nonetheless it does not work whereas in the documentation it is written

```<code>If you are using Index’s outstream player and have placed the video object at the bidder level, you must include the Index required parameters at the bidder level``` (link above)

Here is my prebid configuration

```javascript
{
    "code": slotCode,
    "sizes": [[1,1],[300,250],[160,600],[300,600],[640,360]],
    "bids": [
        {
            "bidder": "criteo",
            "params": {
                "networkId": networkId,
                "video": {
                    "playerSize": [640, 480],
                    "skip": 0,
                    "playbackmethod": 1,
                    "placement": 1,
                    "mimes": [
                        "video/mp4"
                    ],
                    "maxduration": 30,
                    "api": [
                        1,
                        2
                    ],
                    "protocols": [
                        2,
                        3
                    ]
                }
            },
            "userId": {...},
            "userIdAsEids": [...],
            "crumbs": {...}
        },
        {
            "bidder": "index",
            "params": {
                "siteId": siteId,
                "size": [
                    640,
                    360
                ],
                "video": {
                    "playerSize": [640, 480],
                    "h": 640,
                    "w": 360,
                    "protocols": [
                        2,
                        3,
                        5,
                        6
                    ],
                    "minduration": 5,
                    "maxduration": 30,
                    "mimes": [
                        "video/mp4",
                        "application/javascript"
                    ],
                    "playerSize": [
                        640,
                        360
                    ]
                }
            },
            "userId": {... },
            "userIdAsEids": [...],
            "crumbs": {...}
        }
    ],
    "mediaTypes": {
        "video": {
            "context": "outstream"
        }
    },
    "pubstack": {...}
}
</code>```

If I use this configuration, I got this error

```<code>ERROR: IX Bid Adapter: bid size is not included in ad unit sizes or player size.
</code>```

Even if my playerSize for index ([640, 360]) is in the adUnit sizes.

I wonder if it is possible for an adUnit to have multiple payerSizes?

Body:
I would like to create an adUnit video outstream with multiple playserSizes for Index (documentation there

At first I thought to put the playerSize at the adUnit level, but because I want to define multiple playerSizes, I decided to move it at bidder level in  params > video > playerSize. Nonetheless it does not work whereas in the documentation it is written

If you are using Index’s outstream player and have placed the video object at the bidder level, you must include the Index required parameters at the bidder level``` (link above)

Here is my prebid configuration

```javascript
{
    "code": slotCode,
    "sizes": [[1,1],[300,250],[160,600],[300,600],[640,360]],
    "bids": [
        {
            "bidder": "criteo",
            "params": {
                "networkId": networkId,
                "video": {
                    "playerSize": [640, 480],
                    "skip": 0,
                    "playbackmethod": 1,
                    "placement": 1,
                    "mimes": [
                        "video/mp4"
                    ],
                    "maxduration": 30,
                    "api": [
                        1,
                        2
                    ],
                    "protocols": [
                        2,
                        3
                    ]
                }
            },
            "userId": {...},
            "userIdAsEids": [...],
            "crumbs": {...}
        },
        {
            "bidder": "index",
            "params": {
                "siteId": siteId,
                "size": [
                    640,
                    360
                ],
                "video": {
                    "playerSize": [640, 480],
                    "h": 640,
                    "w": 360,
                    "protocols": [
                        2,
                        3,
                        5,
                        6
                    ],
                    "minduration": 5,
                    "maxduration": 30,
                    "mimes": [
                        "video/mp4",
                        "application/javascript"
                    ],
                    "playerSize": [
                        640,
                        360
                    ]
                }
            },
            "userId": {... },
            "userIdAsEids": [...],
            "crumbs": {...}
        }
    ],
    "mediaTypes": {
        "video": {
            "context": "outstream"
        }
    },
    "pubstack": {...}
}

If I use this configuration, I got this error

ERROR: IX Bid Adapter: bid size is not included in ad unit sizes or player size.

Even if my playerSize for index ([640, 360]) is in the adUnit sizes.

I wonder if it is possible for an adUnit to have multiple payerSizes?


问:
Why PdhExpandWildCardPath does not return paths for newly started processes?
I have tried to use PdhExpandWildCardPath to detect if I need to create a new performance counter for the newly started process or to remove the existing counter for the stopped process.

However, for some reason, PdhExpandWildCardPath always returns the same list of paths, regardless of whether the new process is started or stopped on the local machine.

This is my code:

```<code>void main(void)
{
    std::wstring wildcard = L"\\Process(powershe*)\\ID Process";
    LPWSTR paths = NULL;
    DWORD size = 0;
    PDH_STATUS status = ERROR_SUCCESS;
    LPWSTR pTemp = NULL;

    int counter = 0;
    status = PdhExpandWildCardPath(NULL, wildcard.c_str(), paths, &size, PDH_REFRESHCOUNTERS);
    if (status == PDH_MORE_DATA)
    {
        paths = (LPWSTR)malloc(size * sizeof(WCHAR));
        status = PdhExpandWildCardPath(NULL, wildcard.c_str(), paths, &size, PDH_REFRESHCOUNTERS);
        if (status == ERROR_SUCCESS)
        {
            for (pTemp = paths; *pTemp != 0; pTemp += wcslen(pTemp) + 1)
            {
                wprintf(L"%s\n", pTemp);
                counter++;
            }
            wprintf(L"Count: %d\n", counter);
        }
    }

    //in this period I have started new instance of powershell
    system("pause");

    paths = NULL;
    size = 0;
    status = ERROR_SUCCESS;
    pTemp = NULL;
    counter = 0;
    status = PdhExpandWildCardPath(NULL, wildcard.c_str(), paths, &size, PDH_REFRESHCOUNTERS);
    if (status == PDH_MORE_DATA)
    {
        paths = (LPWSTR)malloc(size * sizeof(WCHAR));
        status = PdhExpandWildCardPath(NULL, wildcard.c_str(), paths, &size, PDH_REFRESHCOUNTERS);
        if (status == ERROR_SUCCESS)
        {
            for (pTemp = paths; *pTemp != 0; pTemp += wcslen(pTemp) + 1)
            {
                wprintf(L"%s\n", pTemp);
                counter++;
            }
            wprintf(L"Count: %d\n", counter);
        }
    }
}
</code>```

I expected, after starting new process, paths should be extended for new process counter

Body:
I have tried to use PdhExpandWildCardPath to detect if I need to create a new performance counter for the newly started process or to remove the existing counter for the stopped process.

However, for some reason, PdhExpandWildCardPath always returns the same list of paths, regardless of whether the new process is started or stopped on the local machine.

This is my code:

void main(void)
{
    std::wstring wildcard = L"\\Process(powershe*)\\ID Process";
    LPWSTR paths = NULL;
    DWORD size = 0;
    PDH_STATUS status = ERROR_SUCCESS;
    LPWSTR pTemp = NULL;

    int counter = 0;
    status = PdhExpandWildCardPath(NULL, wildcard.c_str(), paths, &size, PDH_REFRESHCOUNTERS);
    if (status == PDH_MORE_DATA)
    {
        paths = (LPWSTR)malloc(size * sizeof(WCHAR));
        status = PdhExpandWildCardPath(NULL, wildcard.c_str(), paths, &size, PDH_REFRESHCOUNTERS);
        if (status == ERROR_SUCCESS)
        {
            for (pTemp = paths; *pTemp != 0; pTemp += wcslen(pTemp) + 1)
            {
                wprintf(L"%s\n", pTemp);
                counter++;
            }
            wprintf(L"Count: %d\n", counter);
        }
    }

    //in this period I have started new instance of powershell
    system("pause");

    paths = NULL;
    size = 0;
    status = ERROR_SUCCESS;
    pTemp = NULL;
    counter = 0;
    status = PdhExpandWildCardPath(NULL, wildcard.c_str(), paths, &size, PDH_REFRESHCOUNTERS);
    if (status == PDH_MORE_DATA)
    {
        paths = (LPWSTR)malloc(size * sizeof(WCHAR));
        status = PdhExpandWildCardPath(NULL, wildcard.c_str(), paths, &size, PDH_REFRESHCOUNTERS);
        if (status == ERROR_SUCCESS)
        {
            for (pTemp = paths; *pTemp != 0; pTemp += wcslen(pTemp) + 1)
            {
                wprintf(L"%s\n", pTemp);
                counter++;
            }
            wprintf(L"Count: %d\n", counter);
        }
    }
}

I expected, after starting new process, paths should be extended for new process counter


问:
How to update package reference in project C# by Visual studio
I have a common source C# and this is inject in another project.

Now I have update this common source

But I don't know to update version in other source

How can I do this??

I want to update verion of common source that I have updated into another source


问:
Segmentation fault only query with parameter
I installed the adsdbc-11.10.0.24 connector on a container (docker).
I use this connection with php + symfony. When I query the database with a query without parameters I get a result. On the other hand, if I use parameters, I get a Segmentation fault error.

I have testing with PDO sql connexion, request with parameters works. It's not a symfony problem.

Is there a special library needed?

My odbc.ini file:

```<code>[ODBC Data Sources]
CAFETERIA_ODBC = Advantage ODBC Driver

[CAFETERIA_ODBC]
Driver=/usr/local/ads/odbc/redistribute/x64/libadsodbc.so
Setup=/usr/local/ads/odbc/redistribute/x64/libadsodbc.so
DataDirectory=\\172.22.9.4:6262\CAFTECH\DBF
Description=Advantage ODBC driver
DefaultType=FoxPro
MaxTableCloseCache=0
LOCKING=FILE
CharSet=ANSI
Language=ANSI
Compression=INTERNET
ADVANTAGELOCKING=ON
ServerTypes=2
CommType=TCP_IP
TableExtension=
TrimTrailingSpaces=TRUE
</code>```

A query that works :

```<code>$cafeteriaEm = $this->getContainer()->get('doctrine.orm.advantage_entity_manager');
$rawSql = "
    SELECT *
    FROM assure
    WHERE assure='10679257'
    ";
$stmt  = $cafeteriaEm->getConnection()->prepare($rawSql);
$stmt->execute();
$assures= $stmt->fetchAll();
</code>```

A request that does not work (Segmentation fault )

```<code>$rawSql = "
    SELECT *
    FROM assure
    WHERE assure=:assure;
    ";
$stmt  = $cafeteriaEm->getConnection()->prepare($rawSql);
$stmt->bindValue(':assure', '10679257');
$stmt->execute();
$assures= $stmt->fetchAll();
dump($assures);
</code>```

Body:
I installed the adsdbc-11.10.0.24 connector on a container (docker).
I use this connection with php + symfony. When I query the database with a query without parameters I get a result. On the other hand, if I use parameters, I get a Segmentation fault error.

I have testing with PDO sql connexion, request with parameters works. It's not a symfony problem.

Is there a special library needed?

My odbc.ini file:

[ODBC Data Sources]
CAFETERIA_ODBC = Advantage ODBC Driver

[CAFETERIA_ODBC]
Driver=/usr/local/ads/odbc/redistribute/x64/libadsodbc.so
Setup=/usr/local/ads/odbc/redistribute/x64/libadsodbc.so
DataDirectory=\\172.22.9.4:6262\CAFTECH\DBF
Description=Advantage ODBC driver
DefaultType=FoxPro
MaxTableCloseCache=0
LOCKING=FILE
CharSet=ANSI
Language=ANSI
Compression=INTERNET
ADVANTAGELOCKING=ON
ServerTypes=2
CommType=TCP_IP
TableExtension=
TrimTrailingSpaces=TRUE

A query that works :

$cafeteriaEm = $this->getContainer()->get('doctrine.orm.advantage_entity_manager');
$rawSql = "
    SELECT *
    FROM assure
    WHERE assure='10679257'
    ";
$stmt  = $cafeteriaEm->getConnection()->prepare($rawSql);
$stmt->execute();
$assures= $stmt->fetchAll();

A request that does not work (Segmentation fault )

$rawSql = "
    SELECT *
    FROM assure
    WHERE assure=:assure;
    ";
$stmt  = $cafeteriaEm->getConnection()->prepare($rawSql);
$stmt->bindValue(':assure', '10679257');
$stmt->execute();
$assures= $stmt->fetchAll();
dump($assures);


问:
Can't make elements visible in Autodesk viewer when isolating fittings elements
[enter image description here](https://i.stack.imgur.com/I5Fye.png)

When we open a 3D view and proceed to isolate some elements that are attached from each other (for example and assembly), the viewer proceeds to make a zoom extent and isolate the parts. As you can see in the clips attached, the fitting elements disappear from the viewer.

We are using the latest version (7.82) of autodesk viewer and we have found out that in previous versions (7.80) the fittings are showing properly.

We noticed that is working properly in previous versions and maybe, this is an issue corresponding to the latest version updates


问:
woocommerce product gallery flex-control mobile
I have a problem in mobile display for the photo gallery of product pages.
I don't know why from the 2nd line it no longer works properly.
gallery product

Thank you

I find this css :
css

Thank you


问:
Callback to main thread once CoreData backgroundContext persistentContainer is complete?
Is there a way to "callback" to the main thread once CoreData persistentContainer is complete? Similar to a completion handler? I'd like to update the UI once CoreData is done writing data to my SQLite database.

This is what I have. Once backgroundContext.perform is done, I'd like to callback to the main thread.

```<code>let backgroundContext = persistentContainer.newBackgroundContext()
persistentContainer.viewContext.automaticallyMergesChangesFromParent = true

backgroundContext.perform {
    //Computationally heavy write to SQLite database. Once complete, callback to main thread
}
</code>```

I've tried looking at a few different approaches but nothing seems to work or gives weird behavior. Any help would be appreciated.

Body:
Is there a way to "callback" to the main thread once CoreData persistentContainer is complete? Similar to a completion handler? I'd like to update the UI once CoreData is done writing data to my SQLite database.

This is what I have. Once backgroundContext.perform is done, I'd like to callback to the main thread.

let backgroundContext = persistentContainer.newBackgroundContext()
persistentContainer.viewContext.automaticallyMergesChangesFromParent = true

backgroundContext.perform {
    //Computationally heavy write to SQLite database. Once complete, callback to main thread
}

I've tried looking at a few different approaches but nothing seems to work or gives weird behavior. Any help would be appreciated.


问:
Ruby omniauth-ebay-oauth gem only getting user consent...not auth token
I had no problem getting omniauth-ebay-oauth (https://github.com/evilmartians/omniauth-ebay-oauth) working with Devise, but when Ebay hits the callback I've got a code, but I'd expect the gem to also exchange the code for an auth_token.

Is there something I'm missing with the gem? I don't see anything in the documentation that mentions swapping the code for an auth_token.

I can get the auth_token by doing an HTTP post in the controller, but it seems like a bit of a wasted usage of the gem.


问:
Displaying a snackbar above modal bottom sheet with dynamic height in Flutter
Is it possible to display a snackbar above the modal bottom sheet, that will have a minimum possible height?

Example one: the bottom sheet has a minimum height, but the snackbar appears behind it

```<code> await showModalBottomSheet(
  context: context,
  isScrollControlled: true,
  builder: (BuildContext context) {
    return ListTile(
      title: Text("Click me"),
      onTap: () {
        snackbars.showError(message: 'Hello');
      },
    );
  },
);
</code>```

Example two: the snackbar appears above the bottom sheet, but the bottom sheet has no minimum possible height

```<code>await showModalBottomSheet(
      context: context,
      builder: (BuildContext context) {
        return Scaffold(
          body: ListTile(
            title: Text("Click me"),
            onTap: () {
              snackbars.showError(message: 'Hello');
            },
          ),
        );
      },
    );
</code>```

Can it be combined?

Body:
Is it possible to display a snackbar above the modal bottom sheet, that will have a minimum possible height?

Example one: the bottom sheet has a minimum height, but the snackbar appears behind it

 await showModalBottomSheet(
  context: context,
  isScrollControlled: true,
  builder: (BuildContext context) {
    return ListTile(
      title: Text("Click me"),
      onTap: () {
        snackbars.showError(message: 'Hello');
      },
    );
  },
);

Example two: the snackbar appears above the bottom sheet, but the bottom sheet has no minimum possible height

await showModalBottomSheet(
      context: context,
      builder: (BuildContext context) {
        return Scaffold(
          body: ListTile(
            title: Text("Click me"),
            onTap: () {
              snackbars.showError(message: 'Hello');
            },
          ),
        );
      },
    );

Can it be combined?


问:
Can't install packages in Jupyter Lab R kernel
I have tried to install basic packages in R using the R Jupyter lab kernel, but got this error message:

```<code>install.packages("devtools", repos='http://cran.us.r-project.org')
</code>```

also installing the dependencies ‘credentials’, ‘curl’, ‘gert’, ‘gh’,
‘httr’, ‘ragg’, ‘usethis’, ‘pkgdown’, ‘rcmdcheck’, ‘rversions’,
‘urlchecker’
Warning message in install.packages("devtools", repos =
"http://cran.us.r-project.org"): “installation of package ‘curl’ had
non-zero exit status” Warning message in install.packages("devtools",
repos = "http://cran.us.r-project.org"): “installation of package
‘ragg’ had non-zero exit status” Warning message in
install.packages("devtools", repos = "http://cran.us.r-project.org"):
“installation of package ‘credentials’ had non-zero exit status”
Warning message in install.packages("devtools", repos =
"http://cran.us.r-project.org"): “installation of package ‘httr’ had
non-zero exit status” Warning message in install.packages("devtools",
repos = "http://cran.us.r-project.org"): “installation of package
‘rcmdcheck’ had non-zero exit status” Warning message in
install.packages("devtools", repos = "http://cran.us.r-project.org"):
“installation of package ‘rversions’ had non-zero exit status” Warning
message in install.packages("devtools", repos =
"http://cran.us.r-project.org"): “installation of package ‘urlchecker’
had non-zero exit status” Warning message in
install.packages("devtools", repos = "http://cran.us.r-project.org"):
“installation of package ‘gert’ had non-zero exit status” Warning
message in install.packages("devtools", repos =
"http://cran.us.r-project.org"): “installation of package ‘gh’ had
non-zero exit status” Warning message in install.packages("devtools",
repos = "http://cran.us.r-project.org"): “installation of package
‘pkgdown’ had non-zero exit status” Warning message in
install.packages("devtools", repos = "http://cran.us.r-project.org"):
“installation of package ‘usethis’ had non-zero exit status” Warning
message in install.packages("devtools", repos =
"http://cran.us.r-project.org"): “installation of package ‘devtools’
had non-zero exit status” Updating HTML index of packages in
'.Library'

Making 'packages.html' ...  done

I have tried to solve this problem using the following code:
Cannot install R packages in Jupyter Notebook

```<code>install.packages('IRkernel')
IRkernel::installspec(user = FALSE)
</code>```

But it does not work. Any idea to fix this problem?
Do you work with Jupyter lab with R kernel? Did you have this issue?

Body:
I have tried to install basic packages in R using the R Jupyter lab kernel, but got this error message:

install.packages("devtools", repos='http://cran.us.r-project.org')

also installing the dependencies ‘credentials’, ‘curl’, ‘gert’, ‘gh’,
‘httr’, ‘ragg’, ‘usethis’, ‘pkgdown’, ‘rcmdcheck’, ‘rversions’,
‘urlchecker’
Warning message in install.packages("devtools", repos =
"http://cran.us.r-project.org"): “installation of package ‘curl’ had
non-zero exit status” Warning message in install.packages("devtools",
repos = "http://cran.us.r-project.org"): “installation of package
‘ragg’ had non-zero exit status” Warning message in
install.packages("devtools", repos = "http://cran.us.r-project.org"):
“installation of package ‘credentials’ had non-zero exit status”
Warning message in install.packages("devtools", repos =
"http://cran.us.r-project.org"): “installation of package ‘httr’ had
non-zero exit status” Warning message in install.packages("devtools",
repos = "http://cran.us.r-project.org"): “installation of package
‘rcmdcheck’ had non-zero exit status” Warning message in
install.packages("devtools", repos = "http://cran.us.r-project.org"):
“installation of package ‘rversions’ had non-zero exit status” Warning
message in install.packages("devtools", repos =
"http://cran.us.r-project.org"): “installation of package ‘urlchecker’
had non-zero exit status” Warning message in
install.packages("devtools", repos = "http://cran.us.r-project.org"):
“installation of package ‘gert’ had non-zero exit status” Warning
message in install.packages("devtools", repos =
"http://cran.us.r-project.org"): “installation of package ‘gh’ had
non-zero exit status” Warning message in install.packages("devtools",
repos = "http://cran.us.r-project.org"): “installation of package
‘pkgdown’ had non-zero exit status” Warning message in
install.packages("devtools", repos = "http://cran.us.r-project.org"):
“installation of package ‘usethis’ had non-zero exit status” Warning
message in install.packages("devtools", repos =
"http://cran.us.r-project.org"): “installation of package ‘devtools’
had non-zero exit status” Updating HTML index of packages in
'.Library'

Making 'packages.html' ...  done

I have tried to solve this problem using the following code:
Cannot install R packages in Jupyter Notebook

install.packages('IRkernel')
IRkernel::installspec(user = FALSE)

But it does not work. Any idea to fix this problem?
Do you work with Jupyter lab with R kernel? Did you have this issue?


问:
how to send data from non view folder in application folder in codeigniter
I am trying to send data to the view folder which is not from the application folder

I have tried using the render() function but it doesn't display the desired data


问:
How to tune number hidden layer size in Keras, TensorFlow (Non Geneic Methods)?
I intend to find the best value (sub-optimal) of the hidden layer size of a Keras model.
As the search space is too big, I could not use generic algorithms such as GS and RS. Is there any hyperparameter optimization algorithm suitable for this task?</p>


问:
how to implement a log-in with latest version of keycloak 20.0.1 in next.js
how to implements keycloak 20.0.1 in a nextjs project
with tx with role restrictions, using

I try to log-in with keycloak but it only works in the previous versions, there is no way to implement it since version 20.0.1 and it is complicated to find a current way to implement it because the way to implement it changes as the keycloak versions are released.


问:
How to wrap Scala Infix expressions within long lines in IntellijIDEA?
I am using the .editorconfig file in order to configure my IntellijIDEA IDE to reformat Scala code in a specific way.

I specified a right margin, and specified for it not to be exceeded, however, this has a bad impact on long lines that have an Infix expression, which breaks the code.
Everything else is reformatted correctly.

Specific editorconfig configuration :

```<code>max_line_length = 100
ij_scala_call_parameters_wrap = normal
ij_scala_method_call_chain_wrap = normal
ij_scala_variable_annotation_wrap = normal
ij_scala_wrap_long_lines = true
</code>```

The line i am trying to reformat :

```<code>  override val fooBarJognDoeLongVar: List[fooBarJognDoeLongVarType] = DoThisDoThat() :: DoThisDoThatAgain() :: DoThisDoThatAgainOneMoreTime() :: DoThisDoThatAgainOneMoreTimeOnceAgain() :: Nil
</code>```

When it's reformatted, it looks like this :

```<code>  override val fooBarJognDoeLongVar: List[fooBarJognDoeLongVarType] = DoThisDoThat() :: DoThisDoThatAgain() :: DoThisDoThatAgainOneMoreTime()
  :: DoThisDoThatAgainOneMoreTimeOnceAgain() :: Nil
</code>```

And that breaks the expression apparently. This line should be broken like this :

```<code>  override val fooBarJognDoeLongVar: List[fooBarJognDoeLongVarType] = DoThisDoThat() :: DoThisDoThatAgain() :: DoThisDoThatAgainOneMoreTime() ::
  DoThisDoThatAgainOneMoreTimeOnceAgain() :: Nil
</code>```

With the :: kept on the first line, before the line return.

Any ideas on how to do this please ? Of course, using the editorconfig file.

Body:
I am using the .editorconfig file in order to configure my IntellijIDEA IDE to reformat Scala code in a specific way.

I specified a right margin, and specified for it not to be exceeded, however, this has a bad impact on long lines that have an Infix expression, which breaks the code.
Everything else is reformatted correctly.

Specific editorconfig configuration :

max_line_length = 100
ij_scala_call_parameters_wrap = normal
ij_scala_method_call_chain_wrap = normal
ij_scala_variable_annotation_wrap = normal
ij_scala_wrap_long_lines = true

The line i am trying to reformat :

  override val fooBarJognDoeLongVar: List[fooBarJognDoeLongVarType] = DoThisDoThat() :: DoThisDoThatAgain() :: DoThisDoThatAgainOneMoreTime() :: DoThisDoThatAgainOneMoreTimeOnceAgain() :: Nil

When it's reformatted, it looks like this :

  override val fooBarJognDoeLongVar: List[fooBarJognDoeLongVarType] = DoThisDoThat() :: DoThisDoThatAgain() :: DoThisDoThatAgainOneMoreTime()
  :: DoThisDoThatAgainOneMoreTimeOnceAgain() :: Nil

And that breaks the expression apparently. This line should be broken like this :

  override val fooBarJognDoeLongVar: List[fooBarJognDoeLongVarType] = DoThisDoThat() :: DoThisDoThatAgain() :: DoThisDoThatAgainOneMoreTime() ::
  DoThisDoThatAgainOneMoreTimeOnceAgain() :: Nil

With the :: kept on the first line, before the line return.

Any ideas on how to do this please ? Of course, using the editorconfig file.


问:
Dependent dropdown NodeJS Express handlebars
I'm a newbie in NodeJS.

I don't know how can I do a dependent dropdown when the value changes, I know that I have to use Ajax or an event handle but I don't know how can I do it, I'm using handlebars in my view.

When I change the value from the first dropdown I want to show data in the second dropdown with the id "new_dropdown" but I don't know how can I send data to my routes file and then, receive the data for the dropdown.

This is my code for the view:

```<code>        <select class="form-select" aria-label="Default select example" id="customers_dropdown">
          {{#each customers}}
          <option value="{{customer_id}}">{{customer_name}}</option>
          {{/each}}
        </select>
        <select class="form-select" id="new_dropdown">
        </select>
</code>```

This is my code for the routes:

```<code>const express = require("express");
const router = express.Router();
const pool2 = require("../database");
const { isLoggedIn, isNotLoggedIn } = require("../lib/auth");

router.get("/", isLoggedIn, async (req, res) => {
  const customers = await pool2.query(
    "SELECT c.id AS 'customer_id', c.name AS 'customer_name' FROM customers c WHERE c.user_id = ?",
    [req.user.id]
  );
  res.render("index", { customers });
});

router.post("/show_data", (req, res) => {

});

module.exports = router;

</code>```

The query that I want to use to receive the data is
SELECT s.name FROM stores s WHERE s.customer_id = ?
And then, pass the value from the select box to my route and then receive the data.

I want to send data from my view and receive new data dependent on the dropdown.

Body:
I'm a newbie in NodeJS.

I don't know how can I do a dependent dropdown when the value changes, I know that I have to use Ajax or an event handle but I don't know how can I do it, I'm using handlebars in my view.

When I change the value from the first dropdown I want to show data in the second dropdown with the id "new_dropdown" but I don't know how can I send data to my routes file and then, receive the data for the dropdown.

This is my code for the view:

        <select class="form-select" aria-label="Default select example" id="customers_dropdown">
          {{#each customers}}
          <option value="{{customer_id}}">{{customer_name}}</option>
          {{/each}}
        </select>
        <select class="form-select" id="new_dropdown">
        </select>

This is my code for the routes:

const express = require("express");
const router = express.Router();
const pool2 = require("../database");
const { isLoggedIn, isNotLoggedIn } = require("../lib/auth");

router.get("/", isLoggedIn, async (req, res) => {
  const customers = await pool2.query(
    "SELECT c.id AS 'customer_id', c.name AS 'customer_name' FROM customers c WHERE c.user_id = ?",
    [req.user.id]
  );
  res.render("index", { customers });
});

router.post("/show_data", (req, res) => {

});

module.exports = router;

The query that I want to use to receive the data is
SELECT s.name FROM stores s WHERE s.customer_id = ?
And then, pass the value from the select box to my route and then receive the data.

I want to send data from my view and receive new data dependent on the dropdown.


问:
Tkinter dropdown is acting weird when calling the dropdown on a sub file when clicking on a button
I'm using tkinter dropdown for a project, and I created a function on a sub file, which, when given parameters (2 arrays and one string), create a new window and add a dropdown which contain all of the values on one of the array.

The function work fine when I'm calling the function manually or when I'm importing the file and just write the function with the arguments, and when I'm calling the function when a button is pressed, the dropdown shown but no values are shown on the dropdown.

Here are all the codes:

Dropdown function:

```<code>import tkinter as tk
import tkintertable as tkt

def addOrRemove(categoryList:list[str],quantityList:list[int],options:str):
    window = tk.Tk()
    window.minsize(200,200)
    window.resizable(False,False)
    clicked = tkt.StringVar()
    clicked.set(categoryList[0])
    dropdown = tk.OptionMenu(window, clicked, *categoryList)
    dropdown.place(x=10,y=10)
    if options == "remove":
        def deleteCategory():
            place = categoryList.index(clicked.get())
            categoryList.remove(clicked.get())
            quantityList.remove(quantityList[place])
        button = tk.Button(window,text = "Delete category", command = deleteCategory)
        button.place(x=10,y=50)
    window.mainloop()
</code>```

Main function:

```<code>from categoryAddOrRemove import *
root = Tk()

button = Button(root,text="ee",command= lambda:addOrRemove(["Test","Test2"],[1,2],"remove"))
button.place(x=10,y=10)
</code>```

The dropdown I'm getting:

The dropdown I'm getting (2):

Body:
I'm using tkinter dropdown for a project, and I created a function on a sub file, which, when given parameters (2 arrays and one string), create a new window and add a dropdown which contain all of the values on one of the array.

The function work fine when I'm calling the function manually or when I'm importing the file and just write the function with the arguments, and when I'm calling the function when a button is pressed, the dropdown shown but no values are shown on the dropdown.

Here are all the codes:

Dropdown function:

import tkinter as tk
import tkintertable as tkt

def addOrRemove(categoryList:list[str],quantityList:list[int],options:str):
    window = tk.Tk()
    window.minsize(200,200)
    window.resizable(False,False)
    clicked = tkt.StringVar()
    clicked.set(categoryList[0])
    dropdown = tk.OptionMenu(window, clicked, *categoryList)
    dropdown.place(x=10,y=10)
    if options == "remove":
        def deleteCategory():
            place = categoryList.index(clicked.get())
            categoryList.remove(clicked.get())
            quantityList.remove(quantityList[place])
        button = tk.Button(window,text = "Delete category", command = deleteCategory)
        button.place(x=10,y=50)
    window.mainloop()

Main function:

from categoryAddOrRemove import *
root = Tk()

button = Button(root,text="ee",command= lambda:addOrRemove(["Test","Test2"],[1,2],"remove"))
button.place(x=10,y=10)

The dropdown I'm getting:

The dropdown I'm getting (2):


问:
Merging multiple nested dictionaries but taking only the last one in python3
For each file/doc, I print out the result in dictionary format, there are 2 dictionaries for each file/doc, I want to merge them into 1 dictionary without overwriting, but after merge, it prints out only the second dictionary.

Thanks a lot in advance!

Solution before merge:

```<code>defaultdict(<class 'list'>, {'edu_02_blond_dejouer': defaultdict(<class 'list'>, {'ImageFieldCheckers': defaultdict(<class 'list'>, {"['print', 'GRAPHIQUE 2\\xa0: Qualification des aspects de l’activité GG par les institutions d’accueil (en %). Source\\xa0: LISER, Base de données «\\xa0GG_institutions\\xa0», 2020. (N=54\\xa0/ 32 femmes, 22 hommes)\\n[C3. Comment qualifiez-vous les aspects suivants de l’activité GG\\xa0?] \\nGuide de lecture / L’aspect pédagogique du GG est qualifié de «\\xa0bon\\xa0» par 88 % et de «\\xa0moyen\\xa0» par 11 % des répondant·e·s\\xa0: 2 % de non réponse', 'graphique2.png]]]']": ['Add 3 square brackets at beginning', '4 fields are required'], "['[[[image', 'print', 'SCHEMA 1\\xa0: Méthodologie de la mesure de l’impact du GG', 'schema.png']": 'Add 3 square brackets at end', 'graphique.png': 'Image not existing in assets'})})})

defaultdict(<class 'list'>, {'edu_02_blond_dejouer': defaultdict(<class 'list'>, {'MetadataCheckers': defaultdict(<class 'list'>, {'ENG Abstract': 'The content is missing (it is required)'})})})
</code>```

Wrong solution after merge:

```<code>defaultdict(<class 'list'>, {'edu_02_blond_dejouer': defaultdict(<class 'list'>, {'MetadataCheckers': defaultdict(<class 'list'>, {'ENG Abstract': 'The content is missing (it is required)'})})})
</code>```

Solution that I expect after merge:

```<code>defaultdict(<class 'list'>, {'edu_02_blond_dejouer': defaultdict(<class 'list'>, {'ImageFieldCheckers': defaultdict(<class 'list'>, {"['print', 'GRAPHIQUE 2\\xa0: Qualification des aspects de l’activité GG par les institutions d’accueil (en %). Source\\xa0: LISER, Base de données «\\xa0GG_institutions\\xa0», 2020. (N=54\\xa0/ 32 femmes, 22 hommes)\\n[C3. Comment qualifiez-vous les aspects suivants de l’activité GG\\xa0?] \\nGuide de lecture / L’aspect pédagogique du GG est qualifié de «\\xa0bon\\xa0» par 88 % et de «\\xa0moyen\\xa0» par 11 % des répondant·e·s\\xa0: 2 % de non réponse', 'graphique2.png]]]']": ['Add 3 square brackets at beginning', '4 fields are required'], "['[[[image', 'print', 'SCHEMA 1\\xa0: Méthodologie de la mesure de l’impact du GG', 'schema.png']": 'Add 3 square brackets at end', 'graphique.png': 'Image not existing in assets'})})}), defaultdict(<class 'list'>, {'MetadataCheckers': defaultdict(<class 'list'>, {'ENG Abstract': 'The content is missing (it is required)'})})})
</code>```

Body:
For each file/doc, I print out the result in dictionary format, there are 2 dictionaries for each file/doc, I want to merge them into 1 dictionary without overwriting, but after merge, it prints out only the second dictionary.

Thanks a lot in advance!

Solution before merge:

defaultdict(<class 'list'>, {'edu_02_blond_dejouer': defaultdict(<class 'list'>, {'ImageFieldCheckers': defaultdict(<class 'list'>, {"['print', 'GRAPHIQUE 2\\xa0: Qualification des aspects de l’activité GG par les institutions d’accueil (en %). Source\\xa0: LISER, Base de données «\\xa0GG_institutions\\xa0», 2020. (N=54\\xa0/ 32 femmes, 22 hommes)\\n[C3. Comment qualifiez-vous les aspects suivants de l’activité GG\\xa0?] \\nGuide de lecture / L’aspect pédagogique du GG est qualifié de «\\xa0bon\\xa0» par 88 % et de «\\xa0moyen\\xa0» par 11 % des répondant·e·s\\xa0: 2 % de non réponse', 'graphique2.png]]]']": ['Add 3 square brackets at beginning', '4 fields are required'], "['[[[image', 'print', 'SCHEMA 1\\xa0: Méthodologie de la mesure de l’impact du GG', 'schema.png']": 'Add 3 square brackets at end', 'graphique.png': 'Image not existing in assets'})})})

defaultdict(<class 'list'>, {'edu_02_blond_dejouer': defaultdict(<class 'list'>, {'MetadataCheckers': defaultdict(<class 'list'>, {'ENG Abstract': 'The content is missing (it is required)'})})})

Wrong solution after merge:

defaultdict(<class 'list'>, {'edu_02_blond_dejouer': defaultdict(<class 'list'>, {'MetadataCheckers': defaultdict(<class 'list'>, {'ENG Abstract': 'The content is missing (it is required)'})})})

Solution that I expect after merge:

defaultdict(<class 'list'>, {'edu_02_blond_dejouer': defaultdict(<class 'list'>, {'ImageFieldCheckers': defaultdict(<class 'list'>, {"['print', 'GRAPHIQUE 2\\xa0: Qualification des aspects de l’activité GG par les institutions d’accueil (en %). Source\\xa0: LISER, Base de données «\\xa0GG_institutions\\xa0», 2020. (N=54\\xa0/ 32 femmes, 22 hommes)\\n[C3. Comment qualifiez-vous les aspects suivants de l’activité GG\\xa0?] \\nGuide de lecture / L’aspect pédagogique du GG est qualifié de «\\xa0bon\\xa0» par 88 % et de «\\xa0moyen\\xa0» par 11 % des répondant·e·s\\xa0: 2 % de non réponse', 'graphique2.png]]]']": ['Add 3 square brackets at beginning', '4 fields are required'], "['[[[image', 'print', 'SCHEMA 1\\xa0: Méthodologie de la mesure de l’impact du GG', 'schema.png']": 'Add 3 square brackets at end', 'graphique.png': 'Image not existing in assets'})})}), defaultdict(<class 'list'>, {'MetadataCheckers': defaultdict(<class 'list'>, {'ENG Abstract': 'The content is missing (it is required)'})})})


问:
How can I access the variable of the outer class?
I have three files: one for the game, one for the main menu, and one for the options. Because entire other files are one class, I have another file that determines which class is called. Now in my game file, which is one class) I made another class for the purposes of the game, so an inner class. However, if I want to call a variable of the outer class in the inner, "self" doesn't work, and neither does "insert name of the outer class" work. So how can I call the variable of the outer class?</p>


问:
Google Smarthome local fulfillment hub ReachableDevicesRequest does not work anymore
A few days ago google smart home local fulfillment stop working. Even with correct response to
ReachableDevicesRequest request, Gooogle does not trigger local execution or query.

I also reverted back to example https://github.com/actions-on-google/smart-home-local, but even this one does not work anymore.

SDK 1.5.4. Google home, Google home nest mini (2nd gen) 1.56.324896)

**Has anyone else experienced similar problem lately? **

Cloud fulfillment log shows that the device behind the hub falls back to cloud execution, but fails since that this not implemented. Devices are only reachable via local.


问:
Create a mesh from a point cloud using trimesh
I am trying to Create a simple triangle mesh from a point cloud using trimesh. I don't have face normals or the vertex ordering (the faces attribute in trimesh). The mesh that I am trying to reconstruct is a simple curved plane. It does not need to be watertight.

The library open3D has a few methods to estimate normals from a point cloud and generate a mesh. This can be done using the Ball Pivoting method, Screened Poisson Surface Reconstruction, and a few other methods.

I am looking for similar ways to create a mesh using trimesh. The closest approach I found reading the documentation as well as other people's questions is to use the convex_hull attribute of a PointCloud. However this method often fails, especially when the points lie on a plane. Thank you for any suggestions you might have.


问:
WordPress Image Renamed
I have a client who's multisite wordpress website renamed an image to another images name from a different  post.

The renamed image was the featured image, the name it was renamed to was a different featured image name.

Upon renaming, it added "-1" to the renamed image.

I have no idea how this could have happened. Has anyone experienced this before? If so how do I make sure it doesn't happen again?

We are using lightspeed caching plugin on a litespeed server.

I haven't tried anything since it has only happened once. We have uploaded many images after that and it hasn't happened since.

Title: WordPress Image Renamed


问:
rtk query fetch error: request returns 200 but no data on localhost
Even though the query is correct and the api is not protected, I get a fetch error and no data. The backend runs locally on a different port than the frontend. We are using rtk query for data fetching.

The basic api setup:

```<code>import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'

const baseQuery = fetchBaseQuery({
    baseUrl: 'http://localhost:8000',
})

export const api = createApi({
    baseQuery,
    endpoints: () => ({}),
})
</code>```

The endpoints:

```<code>import { api } from '../services/api/api'

const ingredientsApi = api.injectEndpoints({
    endpoints: (build) => ({
        getIngredients: build.query<any, void>({
            query: () => '/ingredients/load',
            transformResponse: (response) => {
                console.log('Response, ', response)
                return response
            },
        }),
        getRecipe: build.query<any, void>({
            query: () => '/recipes/recipe/154007',
            transformResponse: (response) => {
                console.log('Response, ', response)
                return response
            },
        }),
    }),
    overrideExisting: false,
})

export const { useGetIngredientsQuery, useGetRecipeQuery } = ingredientsApi
</code>```

We are wrapping out app with the ApiProvider.

The error we get is {status: 'FETCH_ERROR', error: 'TypeError: Failed to fetch'}.

If we use an open api, we receive data, so the basic setup works.
If we call the api in the browser (http://localhost:8000/ingredients/load), the data shows, so the api works as well.
The data the api sends is in json format, so as expected.

We are out of ideas why our requests fail, any hints are appreciated!

Body:
Even though the query is correct and the api is not protected, I get a fetch error and no data. The backend runs locally on a different port than the frontend. We are using rtk query for data fetching.

The basic api setup:

import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'

const baseQuery = fetchBaseQuery({
    baseUrl: 'http://localhost:8000',
})

export const api = createApi({
    baseQuery,
    endpoints: () => ({}),
})

The endpoints:

import { api } from '../services/api/api'

const ingredientsApi = api.injectEndpoints({
    endpoints: (build) => ({
        getIngredients: build.query<any, void>({
            query: () => '/ingredients/load',
            transformResponse: (response) => {
                console.log('Response, ', response)
                return response
            },
        }),
        getRecipe: build.query<any, void>({
            query: () => '/recipes/recipe/154007',
            transformResponse: (response) => {
                console.log('Response, ', response)
                return response
            },
        }),
    }),
    overrideExisting: false,
})

export const { useGetIngredientsQuery, useGetRecipeQuery } = ingredientsApi

We are wrapping out app with the ApiProvider.

The error we get is {status: 'FETCH_ERROR', error: 'TypeError: Failed to fetch'}.

If we use an open api, we receive data, so the basic setup works.
If we call the api in the browser (http://localhost:8000/ingredients/load), the data shows, so the api works as well.
The data the api sends is in json format, so as expected.

We are out of ideas why our requests fail, any hints are appreciated!