问:
Access postgres db on host machine from container built with docker compose
I have a Postgres db set up on a ubuntu box and on the same box I have some containers from a  docker compose which trying to access the database on this box. (The Postgres/database is NOT in a container. it is installed on the box)

I can access the db fine using dbeaver and can even connect to it from the site running on my dev environment on my pc

I'm using a .net core backend to connect to the db.

I have added this to the end of my backend service in the docker compose:

```<code>extra_hosts:
- "host.docker.internal:host-gateway"
</code>```

Also I have tried adjusting the connection string and nothing works

```<code>Server=host.docker.internal;Port=5432;Database=mydb;User Id=xx;Password=xx;
Server=<IP address>;Port=5432;Database=mydb;User Id=xx;Password=xx;
Server=172.17.0.1;Port=5432;Database=mydb;User Id=xx;Password=xx;
</code>```

Any ideas what to do?

in the logs I can see the following error

```<code>Connection id "0HMMVM72IIA14", Request id "0HMMVM72IIA14:00000002": An unhandled exception was thrown by the application.
      System.InvalidOperationException: An exception has been raised that is likely due to a transient failure.
       ---> Npgsql.NpgsqlException (0x80004005): Failed to connect to <IP REMOVED>:5432
       ---> System.TimeoutException: Timeout during connection attempt
         at Npgsql.Internal.NpgsqlConnector.ConnectAsync(NpgsqlTimeout timeout, CancellationToken cancellationToken)
         at Npgsql.Internal.NpgsqlConnector.RawOpen(SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken, Boolean isFirstAttempt)
</code>```

Body:
I have a Postgres db set up on a ubuntu box and on the same box I have some containers from a  docker compose which trying to access the database on this box. (The Postgres/database is NOT in a container. it is installed on the box)

I can access the db fine using dbeaver and can even connect to it from the site running on my dev environment on my pc

I'm using a .net core backend to connect to the db.

I have added this to the end of my backend service in the docker compose:

extra_hosts:
- "host.docker.internal:host-gateway"

Also I have tried adjusting the connection string and nothing works

Server=host.docker.internal;Port=5432;Database=mydb;User Id=xx;Password=xx;
Server=<IP address>;Port=5432;Database=mydb;User Id=xx;Password=xx;
Server=172.17.0.1;Port=5432;Database=mydb;User Id=xx;Password=xx;

Any ideas what to do?

in the logs I can see the following error

Connection id "0HMMVM72IIA14", Request id "0HMMVM72IIA14:00000002": An unhandled exception was thrown by the application.
      System.InvalidOperationException: An exception has been raised that is likely due to a transient failure.
       ---> Npgsql.NpgsqlException (0x80004005): Failed to connect to <IP REMOVED>:5432
       ---> System.TimeoutException: Timeout during connection attempt
         at Npgsql.Internal.NpgsqlConnector.ConnectAsync(NpgsqlTimeout timeout, CancellationToken cancellationToken)
         at Npgsql.Internal.NpgsqlConnector.RawOpen(SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken, Boolean isFirstAttempt)


来源: stackexchange

问:
What is the "best practice" for a notification when a query fails in RTK Query?
I need to show a toast notification whenever an API call encounters an error. With RTK Query, I can either wrap the query in another function or use a listener middleware.

Wrapping the query function:

```<code>const loadFooWithToast = async () => {
    const { error } = await loadFooQuery()
    if (error) showErrorToast("Error loading Foo")
}
</code>```

Note: To make this more generic (like the example below) I could create a custom hook which accepts the query function and the error message as arguments but the logic would stay the same.

Using a listener middleware:

```<code>startAppListening({
    predicate: (action) => {
        return action.type === "api/executeQuery/rejected"
    },
    effect: ({
        meta: {
            originalArgs: { errorMessage }
        },
    }) => {
        showErrorToast(errorMessage)
    },
})

loadFooQuery({ errorMessage: "Error loading Foo" })
</code>```

Is one method preferable to the other and why?

ContentLicense: CC BY-SA 4.0

Body:
I need to show a toast notification whenever an API call encounters an error. With RTK Query, I can either wrap the query in another function or use a listener middleware.

Wrapping the query function:

const loadFooWithToast = async () => {
    const { error } = await loadFooQuery()
    if (error) showErrorToast("Error loading Foo")
}

Note: To make this more generic (like the example below) I could create a custom hook which accepts the query function and the error message as arguments but the logic would stay the same.

Using a listener middleware:

startAppListening({
    predicate: (action) => {
        return action.type === "api/executeQuery/rejected"
    },
    effect: ({
        meta: {
            originalArgs: { errorMessage }
        },
    }) => {
        showErrorToast(errorMessage)
    },
})

loadFooQuery({ errorMessage: "Error loading Foo" })

Is one method preferable to the other and why?


问:
How can I create a custom MMC View for Active Directory Users and Computers that only shows 2 specific Organizational Units?
I am attempting to create a custom MMC for down-level administrators that only need access to certain OUs.

In the Active Directory Users and Computers mmc snap in, it is possible to display a single OU by right clicking on the OU and selecting New Window from Here.

The resulting New window only has the previously selected OU as a parent.

Is there any way to add a second OU to the snap in? (that is not a child)

I have also tried using an LDAP query filter and have not been able to filter out OUs.

Filter has no effect on OUs.


问:
Adding custom notifications with Reality Composer
New to Reality Composer and ARKit, using iOS 16

Created a scene with RealityKit, with a sphere in it.
Added a custom notification to it, added it, works but it doesn't...

Need to tap hard to get this to fire, and won't fire reliably? What am I missing?

```<code>BoardSquare.loadBoardAsync(completion: { ( loading ) in
            switch loading {
            case .success(let boardBoard):
                boardBoard.generateCollisionShapes(recursive: true)
                anchor.addChild(boardBoard)

                boardBoard.actions.customNotification.onAction = { entity in
                    print("custom action")
                }

                anchor.addChild((boardBoard.ball)!)
            case .failure(let error):
                print(error.localizedDescription)
            }
        })
</code>```

Body:
New to Reality Composer and ARKit, using iOS 16

Created a scene with RealityKit, with a sphere in it.
Added a custom notification to it, added it, works but it doesn't...

Need to tap hard to get this to fire, and won't fire reliably? What am I missing?

BoardSquare.loadBoardAsync(completion: { ( loading ) in
            switch loading {
            case .success(let boardBoard):
                boardBoard.generateCollisionShapes(recursive: true)
                anchor.addChild(boardBoard)

                boardBoard.actions.customNotification.onAction = { entity in
                    print("custom action")
                }

                anchor.addChild((boardBoard.ball)!)
            case .failure(let error):
                print(error.localizedDescription)
            }
        })


问:
Parameter type checking different in call signature vs function type expression
I noticed a difference in how the arguments are type-checked between the different syntax of function types in TypeScript.

```<code>type TypeA = {
  callback(value?: string): void,
}

type TypeB = {
  callback: (value?: string) => void,
}

function foo (value: string) {}

const a: TypeA = {
 // No error
 callback: foo,
}

// Property 'callback' is missing in type '{}'
// but required in type 'TypeA'
const a2: TypeA = {
}

const b: TypeB = {
  // Type '(value: string) => void' is not assignable to
  // type '(value?: string | undefined) => void'.
  callback: foo,
}
</code>```

Here's the typescript playground link

The call signature function type happily accepts a function with param value: string, while the function type expression complaints that it is not exactly value: string | undefined.

I would've expected a type error in both the cases.

Why is the call signature syntax more relaxed about the argument type?

Body:
I noticed a difference in how the arguments are type-checked between the different syntax of function types in TypeScript.

type TypeA = {
  callback(value?: string): void,
}

type TypeB = {
  callback: (value?: string) => void,
}

function foo (value: string) {}

const a: TypeA = {
 // No error
 callback: foo,
}

// Property 'callback' is missing in type '{}'
// but required in type 'TypeA'
const a2: TypeA = {
}

const b: TypeB = {
  // Type '(value: string) => void' is not assignable to
  // type '(value?: string | undefined) => void'.
  callback: foo,
}

Here's the typescript playground link

The call signature function type happily accepts a function with param value: string, while the function type expression complaints that it is not exactly value: string | undefined.

I would've expected a type error in both the cases.

Why is the call signature syntax more relaxed about the argument type?


问:
Passing extra arguments into objective function Nonconvex.jl
I am working on implementing an optimizer using Nonconvex.jl and following this example. The description of objective function indicates that,

The vector input to obj will be of the same structure, shape and types
as the initial solution, lower bound and upper bound vector.

In my case I would like my objective function to calculate difference between model and measured values as RMS difference ([model - measured]^2). For this I need to pass the measured values to the objective function, just like one would do in scipy.optimize.minimize with the help of args attribute.

So how do I send extra arguments to the objective function in Nonconvex.jl?


问:
Can't Escape $ (Dollar Sign) in Environment Variable in Dockerfile
I am trying to put a password in a command in a Dockerfile. The problem is it has a $ in it, so the variable get evaluated but the $ is in the value so it tries to evaluate that afterwards.

The Dockerfile is called from a bash script, so to get the password into the file I did something like:

```<code>read -p "Input Username:" Username
read -s -p "Input Password:" Password
docker build --build-arg Username=$Username --build-arg Password=$Password...
</code>```

And in the Dockerfile I have:

```<code>ARG Username
ARG Password
</code>```

Then within the Dockerfile, I have tried this:

```<code>curl -u "$Username:$Password"
</code>```

It gets expanded to something like

```<code>curl -u "Username:Pass12$34"
</code>```

Which doesn't work as it tries to evaluate $34 as a variable. I tried using single quotes but that didn't evaluate the variable at all. Any help is appreciated.

Body:
I am trying to put a password in a command in a Dockerfile. The problem is it has a $ in it, so the variable get evaluated but the $ is in the value so it tries to evaluate that afterwards.

The Dockerfile is called from a bash script, so to get the password into the file I did something like:

read -p "Input Username:" Username
read -s -p "Input Password:" Password
docker build --build-arg Username=$Username --build-arg Password=$Password...

And in the Dockerfile I have:

ARG Username
ARG Password

Then within the Dockerfile, I have tried this:

curl -u "$Username:$Password"

It gets expanded to something like

curl -u "Username:Pass12$34"

Which doesn't work as it tries to evaluate $34 as a variable. I tried using single quotes but that didn't evaluate the variable at all. Any help is appreciated.


问:
Oracle SELECT statement
I am trying to select the Top 5 best-selling products in terms of quantity per year.

```<code>CREATE TABLE purchaseorderheader(
purchaseorderid NUMBER(4),
revisionnumber NUMBER(2),
status NUMBER(1),
employeeid NUMBER(3),
vendorid NUMBER(4),
shipmethodid NUMBER(1),
orderdate TIMESTAMP,
shipdate TIMESTAMP,
subtotal FLOAT(10),
taxamt FLOAT(10),
freight FLOAT(10),
modifieddate TIMESTAMP,
PRIMARY KEY(purchaseorderid)
);

CREATE TABLE purchaseorderdetail(
purchaseorderid NUMBER(4),
purchaseorderdetailid NUMBER(4),
duedate TIMESTAMP,
orderqty NUMBER(6),
productid NUMBER(6),
unitprice FLOAT(10),
receivedqty FLOAT(10),
rejectedqty FLOAT(10),
modifieddate TIMESTAMP,
PRIMARY KEY(purchaseorderdetailid),
CONSTRAINT fk_orderid FOREIGN KEY (purchaseorderid) REFERENCES purchaseorderheader(purchaseorderid)
);
</code>```

Here's what I've done so far but it's not by year and I have no clue of how to do it...

```<code>SELECT EXTRACT(year FROM h.orderdate) "Year", d.productid, SUM(d.orderqty) "Somme"
FROM purchaseorderheader h
INNER JOIN purchaseorderdetail d ON h.purchaseorderid = d.purchaseorderid
GROUP BY EXTRACT(year FROM h.orderdate), d.productid
ORDER BY "Somme"
DESC FETCH FIRST 5 ROWS ONLY;

</code>```

I also would like to select The Top 5 vendors who have the lowest percentage of rejected received items if you have any idea

Title: Oracle SELECT statement

Body:
I am trying to select the Top 5 best-selling products in terms of quantity per year.

CREATE TABLE purchaseorderheader(
purchaseorderid NUMBER(4),
revisionnumber NUMBER(2),
status NUMBER(1),
employeeid NUMBER(3),
vendorid NUMBER(4),
shipmethodid NUMBER(1),
orderdate TIMESTAMP,
shipdate TIMESTAMP,
subtotal FLOAT(10),
taxamt FLOAT(10),
freight FLOAT(10),
modifieddate TIMESTAMP,
PRIMARY KEY(purchaseorderid)
);

CREATE TABLE purchaseorderdetail(
purchaseorderid NUMBER(4),
purchaseorderdetailid NUMBER(4),
duedate TIMESTAMP,
orderqty NUMBER(6),
productid NUMBER(6),
unitprice FLOAT(10),
receivedqty FLOAT(10),
rejectedqty FLOAT(10),
modifieddate TIMESTAMP,
PRIMARY KEY(purchaseorderdetailid),
CONSTRAINT fk_orderid FOREIGN KEY (purchaseorderid) REFERENCES purchaseorderheader(purchaseorderid)
);

Here's what I've done so far but it's not by year and I have no clue of how to do it...

SELECT EXTRACT(year FROM h.orderdate) "Year", d.productid, SUM(d.orderqty) "Somme"
FROM purchaseorderheader h
INNER JOIN purchaseorderdetail d ON h.purchaseorderid = d.purchaseorderid
GROUP BY EXTRACT(year FROM h.orderdate), d.productid
ORDER BY "Somme"
DESC FETCH FIRST 5 ROWS ONLY;

I also would like to select The Top 5 vendors who have the lowest percentage of rejected received items if you have any idea


问:
Is there a way to query more than 2,000 Intents in Dialogflow CX? I.e. Setting up parallel flows?
I'm creating an agent with more than 2,000 intents. Basically a FAQ bot that can answer thousands of questions.

In Dialogflow ES, there was the concept of MegaAgents and SubAgent. The maximum number of intent for a SubAgent was 2,000. Using a MegaAgent, I could put together up to 20 Sub Agents (total 20,000 intents). When the user queries the bot, each intent is weighted differently.

Now in Dialogflow CX, although the entire agent has a maximum 10,000 intents, each flow has a 2,000 limit. I can't figure out a way to design the bot to have multiple "parallel" flows where there is equal weighting given to each flow.

The only way is string together multiple flows in sequence, and use a Fallback to transition from one flow to another. However, this doesn't put equal query weighting on my many thousand intents.

Any suggestions?


问:
Disabling all interrupts (including CAL/TLB) on a specific core of an Intel processor (at any cost)
I need to run a specific core a hard real time application, I cannot tolerate interruptions higher than 1 usec. Unfortunately, when a CAL/TLB interrupt kicks in, the interruption can reach up to 6-7 usecs.

Is it possible to disable all interrupts on a single specific core? I know that stopping TLB flushes can cause problems but my application does setup memory at startup and virt to phys mappings are static.
I know linux has spinlock_irq_disable but how do I assure that this API is called on the core I need it?
Is not possible to do it from normal application that has root rights?


问:
Retrieving Key-Value pairs from PHP
I'm trying to take a JSON string i'm receiving from an API and process the contents with PHP. I just can't figure out how to get the info out. I convert the JSON to an object with json_decode and try to get the products' array with dot and bracket syntax (see my commented lines in code snippet). Could somebody tell me what I am missing here? I haven't used PHP in many many years.

```<code><?php
$sampleJson = '{"products": [{"id": 6806481862794,"title": "Berry Soap"},{"id": 6806481600650,"title": "Lavender Soap"},{"id": 6806481666186,"title": "Vanilla Soap"},{"id": 6806481993866,"title": "Aloe Soap"}]}';

echo $sampleJson;

$sampleObject = json_decode($sampleJson);

echo "<br/>------<br/>";
var_dump($sampleObject);
echo "<br/>------<br/>";
//var_dump($sampleObject.products);
//var_dump($sampleObject[products]);
var_dump($sampleObject['products']);
</code>```

Title: Retrieving Key-Value pairs from PHP

Body:
I'm trying to take a JSON string i'm receiving from an API and process the contents with PHP. I just can't figure out how to get the info out. I convert the JSON to an object with json_decode and try to get the products' array with dot and bracket syntax (see my commented lines in code snippet). Could somebody tell me what I am missing here? I haven't used PHP in many many years.

<?php
$sampleJson = '{"products": [{"id": 6806481862794,"title": "Berry Soap"},{"id": 6806481600650,"title": "Lavender Soap"},{"id": 6806481666186,"title": "Vanilla Soap"},{"id": 6806481993866,"title": "Aloe Soap"}]}';

echo $sampleJson;

$sampleObject = json_decode($sampleJson);

echo "
------
";
var_dump($sampleObject);
echo "
------
";
//var_dump($sampleObject.products);
//var_dump($sampleObject[products]);
var_dump($sampleObject['products']);


问:
localStorage is saving but not displaying after refresh?
I am trying to save the users created flashcards so that when you refresh they will still be there. The innerHTML of my grid is saving fine it seems but when I try to put my grid.innerHTML set to the saved data and refresh my page it goes back to showing no flashcards. Here is the Codepen: https://codepen.io/Chasehud26/pen/rNrBmzJ

```<code>//Add Question button toggle and close button function
const addQuestionBtn = document.querySelector("#add-question")
const formContainer = document.querySelector(".hidden")
const closeBtn = document.querySelector("#close-btn")

addQuestionBtn.addEventListener("click", function addBtnToggle() {
    if (formContainer.className == "hidden") {
        formContainer.classList.remove("hidden")
        formContainer.classList.add("form-container")
    } else if (formContainer.className == "form-container") {
        formContainer.classList.remove("form-container")
        formContainer.classList.add("hidden")
    }
})

closeBtn.addEventListener("click", function closeForm() {
    if (formContainer.className == "form-container") {
        formContainer.classList.remove("form-container")
        formContainer.classList.add("hidden")
    }
})

//Form event listener / Creating cards to populate grid
const questionInput = document.querySelector("#question-input")
const answerInput = document.querySelector("#answer-input")
const saveBtn = document.querySelector("#save-btn")
const form = document.querySelector("form")
const grid = document.querySelector(".grid-cards")

form.addEventListener("submit", function sumbit(e) {
    e.preventDefault()

    //Creating elements
    let questionValue = questionInput.value
    let answerValue = answerInput.value
    let div = document.createElement("div")
    div.classList.add("card")
    let h3 = document.createElement("h3")
    h3.setAttribute("id", "question")
    showHideAnswer = document.createElement("a")
    showHideAnswer.setAttribute("href", "")
    showHideAnswer.innerHTML = "Show/Hide Answer"
    let p = document.createElement("p")
    p.classList.add("hidden")
    let deleteBtn = document.createElement("button")
    deleteBtn.setAttribute("id", "deleteBtn")

    //Appending created elements to div
    grid.appendChild(div)
    div.append(h3)
    div.append(showHideAnswer)
    div.append(p)
    div.append(deleteBtn)
    h3.innerHTML = questionValue
    p.innerHTML = answerValue
    deleteBtn.innerHTML = "Delete"

    //Show and hide answer
    showHideAnswer.addEventListener("click", function showAnswer(e) {
        e.preventDefault()
        if (p.className == "hidden") {
            p.classList.remove("hidden")
            p.classList.add("answer")
        } else if (p.className == "answer") {
            p.classList.remove("answer")
            p.classList.add("hidden")
        }
    })

    //Delete a flashcard
    deleteBtn.addEventListener("click", function deleted() {
        grid.removeChild(div)
    })

    //LOCAL STORAGE
    function storedCards() {
        localStorage.setItem("items", grid.innerHTML)
        inner = localStorage.getItem("items")
        grid.innerHTML = inner
    }
})
</code>```

I have tried many different thongs but nothing seems to be working. Any help would be greatly appreciated!

Body:
I am trying to save the users created flashcards so that when you refresh they will still be there. The innerHTML of my grid is saving fine it seems but when I try to put my grid.innerHTML set to the saved data and refresh my page it goes back to showing no flashcards. Here is the Codepen: https://codepen.io/Chasehud26/pen/rNrBmzJ

//Add Question button toggle and close button function
const addQuestionBtn = document.querySelector("#add-question")
const formContainer = document.querySelector(".hidden")
const closeBtn = document.querySelector("#close-btn")

addQuestionBtn.addEventListener("click", function addBtnToggle() {
    if (formContainer.className == "hidden") {
        formContainer.classList.remove("hidden")
        formContainer.classList.add("form-container")
    } else if (formContainer.className == "form-container") {
        formContainer.classList.remove("form-container")
        formContainer.classList.add("hidden")
    }
})

closeBtn.addEventListener("click", function closeForm() {
    if (formContainer.className == "form-container") {
        formContainer.classList.remove("form-container")
        formContainer.classList.add("hidden")
    }
})

//Form event listener / Creating cards to populate grid
const questionInput = document.querySelector("#question-input")
const answerInput = document.querySelector("#answer-input")
const saveBtn = document.querySelector("#save-btn")
const form = document.querySelector("form")
const grid = document.querySelector(".grid-cards")

form.addEventListener("submit", function sumbit(e) {
    e.preventDefault()

    //Creating elements
    let questionValue = questionInput.value
    let answerValue = answerInput.value
    let div = document.createElement("div")
    div.classList.add("card")
    let h3 = document.createElement("h3")
    h3.setAttribute("id", "question")
    showHideAnswer = document.createElement("a")
    showHideAnswer.setAttribute("href", "")
    showHideAnswer.innerHTML = "Show/Hide Answer"
    let p = document.createElement("p")
    p.classList.add("hidden")
    let deleteBtn = document.createElement("button")
    deleteBtn.setAttribute("id", "deleteBtn")

    //Appending created elements to div
    grid.appendChild(div)
    div.append(h3)
    div.append(showHideAnswer)
    div.append(p)
    div.append(deleteBtn)
    h3.innerHTML = questionValue
    p.innerHTML = answerValue
    deleteBtn.innerHTML = "Delete"

    //Show and hide answer
    showHideAnswer.addEventListener("click", function showAnswer(e) {
        e.preventDefault()
        if (p.className == "hidden") {
            p.classList.remove("hidden")
            p.classList.add("answer")
        } else if (p.className == "answer") {
            p.classList.remove("answer")
            p.classList.add("hidden")
        }
    })

    //Delete a flashcard
    deleteBtn.addEventListener("click", function deleted() {
        grid.removeChild(div)
    })

    //LOCAL STORAGE
    function storedCards() {
        localStorage.setItem("items", grid.innerHTML)
        inner = localStorage.getItem("items")
        grid.innerHTML = inner
    }
})

I have tried many different thongs but nothing seems to be working. Any help would be greatly appreciated!


问:
Firebase/Firestore logical OR query on multiple fields
I have a simple global public transactions collection, similar to Ethereum/Etherscan.

```<code>/Transactions -> tx1
              -> tx2
</code>```

Tx document looks like this

```<code>{
  timestamp,
  from: username1,
  to: username2,
  amount
}
</code>```

Now I would like to query all the Tx documents where username is equal to from OR to and order by timestamp.

Is this natively possible in Firestore?

If not do I have to create separate transaction collections for all the users along with the global one? And then do I need to add 3 documents - global, user1 and user2 transaction collections when user1 sends a transaction to user2 ?

Or is there a better approach?

Body:
I have a simple global public transactions collection, similar to Ethereum/Etherscan.

/Transactions -> tx1
              -> tx2

Tx document looks like this

{
  timestamp,
  from: username1,
  to: username2,
  amount
}

Now I would like to query all the Tx documents where username is equal to from OR to and order by timestamp.

Is this natively possible in Firestore?

If not do I have to create separate transaction collections for all the users along with the global one? And then do I need to add 3 documents - global, user1 and user2 transaction collections when user1 sends a transaction to user2 ?

Or is there a better approach?


问:
Does type input and click not support multiple lines?
I am trying to send a DM on Instagram, but each new line is sent as one message.

Does type input and click not support multiple lines?
If so, does anyone have any insight into alternative solutions, such as fixing this area of the puppeteer source code?

The simplified code is as follows. It may not work as it is because of the different language area. Sorry.

```<code>import pp from 'puppeteer';
import puppeteer from 'puppeteer-extra';

export const instagram = async () => {
  console.log('START!!!');

  const browser = await puppeteer.launch({
    executablePath: pp.executablePath(),
    args: [
      '--user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36',
    ],
    headless: true,
    slowMo: 100,
    timeout: 30000,
  });

  const page = await browser.newPage();
  await page.setViewport({
    height: 900,
    width: 1366,
  });

  await page.goto('https://www.instagram.com/accounts/login/');
  await page.waitForSelector('input[name="username"]');
  await page.type('input[name=username]', '___your_id___');
  await page.type('input[name=password]', '___your_password___');
  await page.click('button[type=submit]');
  await page.waitForNavigation({ waitUntil: 'domcontentloaded' });

  await page.goto('https://www.instagram.com/direct/__your_frend_dm_direct_url__');

  await page.waitForSelector('textarea[placeholder="メッセージ..."]'); // japanese
  await page.type('textarea[placeholder="メッセージ..."]', "this is\nmultiple line");

  await browser.close();
};

</code>```

enter image description here

I want to send a multi-line message in a single transmission.

Body:
I am trying to send a DM on Instagram, but each new line is sent as one message.

Does type input and click not support multiple lines?
If so, does anyone have any insight into alternative solutions, such as fixing this area of the puppeteer source code?

The simplified code is as follows. It may not work as it is because of the different language area. Sorry.

import pp from 'puppeteer';
import puppeteer from 'puppeteer-extra';

export const instagram = async () => {
  console.log('START!!!');

  const browser = await puppeteer.launch({
    executablePath: pp.executablePath(),
    args: [
      '--user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36',
    ],
    headless: true,
    slowMo: 100,
    timeout: 30000,
  });

  const page = await browser.newPage();
  await page.setViewport({
    height: 900,
    width: 1366,
  });

  await page.goto('https://www.instagram.com/accounts/login/');
  await page.waitForSelector('input[name="username"]');
  await page.type('input[name=username]', '___your_id___');
  await page.type('input[name=password]', '___your_password___');
  await page.click('button[type=submit]');
  await page.waitForNavigation({ waitUntil: 'domcontentloaded' });

  await page.goto('https://www.instagram.com/direct/__your_frend_dm_direct_url__');

  await page.waitForSelector('textarea[placeholder="メッセージ..."]'); // japanese
  await page.type('textarea[placeholder="メッセージ..."]', "this is\nmultiple line");

  await browser.close();
};

enter image description here

I want to send a multi-line message in a single transmission.


问:
How to use unfixed json structure in a column with EntityFramework 7?
Consider this example:

```<code>    public class Config
    {
        public string Name { get; set; }
        public string Description { get; set; }
        public DateTime? DateCreated { get; set; }
        public int? ValueInt { get; set; }
        public decimal? ValueDecimal { get; set; }
        public string ValueText { get; set; }
        public DateTime? ValueDate { get; set; }
        public virtual ConfigValueJson ValueJson { get; set; }
    }

    public class ConfigValueJson
    {
        public ClanoviKartice ClanoviKartice { get; set; }

        public ClanoviKartice2 ClanoviKartice2 { get; set; }
    }

    public class ClanoviKartice
    {
        public DateTime? DatumZadnjegPrintanja { get; set; }
    }
    public class ClanoviKartice2
    {
        public DateTime? DatumZadnjegPrintanja { get; set; }
    }

    public class ConfigEC : IEntityTypeConfiguration<Config>
    {
        public void Configure(EntityTypeBuilder<Config> builder)
        {
            builder.HasKey(e => e.Name);
            builder.OwnsOne(c => c.ValueJson, optons =>
            {
                optons.ToJson();
                optons.OwnsOne(c => c.ClanoviKartice);
                optons.OwnsOne(c => c.ClanoviKartice2);
            });
        }
    }

</code>```

This forces json to be of this structure:
{ "ClanoviKartice":{"DatumZadnjegPrintanja":"2019-12-09T00:00:00.000Z"}, "ClanoviKartice2":null }

I want to be able not to specify all types in json, like this (EF throws exception):
{ "ClanoviKartice":{"DatumZadnjegPrintanja":"2019-12-09T00:00:00.000Z"} }

This limitation forces me to have the same structure for all rows where there is a value, or create a separate column for each structure. They should've just treated no json property as null value.

The ideal would be to have multiple properties with different types in Config for the same JSON column.

Body:
Consider this example:

    public class Config
    {
        public string Name { get; set; }
        public string Description { get; set; }
        public DateTime? DateCreated { get; set; }
        public int? ValueInt { get; set; }
        public decimal? ValueDecimal { get; set; }
        public string ValueText { get; set; }
        public DateTime? ValueDate { get; set; }
        public virtual ConfigValueJson ValueJson { get; set; }
    }

    public class ConfigValueJson
    {
        public ClanoviKartice ClanoviKartice { get; set; }

        public ClanoviKartice2 ClanoviKartice2 { get; set; }
    }

    public class ClanoviKartice
    {
        public DateTime? DatumZadnjegPrintanja { get; set; }
    }
    public class ClanoviKartice2
    {
        public DateTime? DatumZadnjegPrintanja { get; set; }
    }

    public class ConfigEC : IEntityTypeConfiguration<Config>
    {
        public void Configure(EntityTypeBuilder<Config> builder)
        {
            builder.HasKey(e => e.Name);
            builder.OwnsOne(c => c.ValueJson, optons =>
            {
                optons.ToJson();
                optons.OwnsOne(c => c.ClanoviKartice);
                optons.OwnsOne(c => c.ClanoviKartice2);
            });
        }
    }

This forces json to be of this structure:
{ "ClanoviKartice":{"DatumZadnjegPrintanja":"2019-12-09T00:00:00.000Z"}, "ClanoviKartice2":null }

I want to be able not to specify all types in json, like this (EF throws exception):
{ "ClanoviKartice":{"DatumZadnjegPrintanja":"2019-12-09T00:00:00.000Z"} }

This limitation forces me to have the same structure for all rows where there is a value, or create a separate column for each structure. They should've just treated no json property as null value.

The ideal would be to have multiple properties with different types in Config for the same JSON column.


问:
Routing Error when trying to access a linkother than the baseURL
I have a "routing" problem on CodeIgniter 4.2.7.

My home page is displayed well, the page also reloads well when I click on "home" in my menu, on this side there is no problem, however when I want to access another page I have the message error following "Error 404".

Here is my controller:

```<code>class c_accueil extends BaseController
{
    public function index()
    {
        $data['titre'] = "Accueil";
        return
            view('v_menu')
            . view('v_accueil',$data)
            . view('v_footer');
    }
    public function espaceNintendo()
    {
        $data['titre'] = "Espace Nintendo";
        return
            view('v_menu')
            . view('v_espaceNintendo', $data)
            . view('v_footer');
    }
</code>```

Here is my base url:

```<code>public $baseURL = 'http://localhost:63342/ProjetWeb';
</code>```

Here is my route:

```<code>$routes->get('/', 'c_accueil::index');$routes->get('/public/espaceNintendo', 'c_accueil::espaceNintendo');
</code>```

Here is my view (v_menu) :

```<code><?=anchor(base_url().'/public/', 'Accueil')?>
<?=anchor(base_url().'/public/espaceNintendo', 'Espace Nintendo')?>
</code>```

So "Accueil" works fine but not "espaceNintendo"

Url of my home page which works well:

http://localhost:63342/ProjetWeb/public/

However, the URL as soon as I click on "Espace nintendo" is this:

http://localhost:63342/ProjetWeb/public/espaceNintendo

But it gives me "error 404".

Do you have any idea where the problem comes from?

My helpers are well loaded on my base_controller:

```<code>
protected $helpers = ['html', 'form', 'url'];
</code>```

Body:
I have a "routing" problem on CodeIgniter 4.2.7.

My home page is displayed well, the page also reloads well when I click on "home" in my menu, on this side there is no problem, however when I want to access another page I have the message error following "Error 404".

Here is my controller:

class c_accueil extends BaseController
{
    public function index()
    {
        $data['titre'] = "Accueil";
        return
            view('v_menu')
            . view('v_accueil',$data)
            . view('v_footer');
    }
    public function espaceNintendo()
    {
        $data['titre'] = "Espace Nintendo";
        return
            view('v_menu')
            . view('v_espaceNintendo', $data)
            . view('v_footer');
    }

Here is my base url:

public $baseURL = 'http://localhost:63342/ProjetWeb';

Here is my route:

$routes->get('/', 'c_accueil::index');$routes->get('/public/espaceNintendo', 'c_accueil::espaceNintendo');

Here is my view (v_menu) :

<?=anchor(base_url().'/public/', 'Accueil')?>
<?=anchor(base_url().'/public/espaceNintendo', 'Espace Nintendo')?>

So "Accueil" works fine but not "espaceNintendo"

Url of my home page which works well:

http://localhost:63342/ProjetWeb/public/

However, the URL as soon as I click on "Espace nintendo" is this:

http://localhost:63342/ProjetWeb/public/espaceNintendo

But it gives me "error 404".

Do you have any idea where the problem comes from?

My helpers are well loaded on my base_controller:

protected $helpers = ['html', 'form', 'url'];


问:
IndexWriter takes long time on close/commit and flush
I am using a nfs share for Lucene indexes, where close/commit and flush take very long time. Is there a way to make it run bit faster?</p>


问:
Error in Seurat - Error in validityMethod()
I am running the below code

```<code>pbmc.sce <- as.SingleCellExperiment(pbmc,assay = "RNA")
</code>```

then i got this

```<code>Error in validityMethod(as(object, superClass)) :
  object 'CsparseMatrix_validate' not found
</code>```

in some old post, it ask us to update.packages("Matirx")

tried and didn't work for me. Your help would be much appreciated

Body:
I am running the below code

pbmc.sce <- as.SingleCellExperiment(pbmc,assay = "RNA")

then i got this

Error in validityMethod(as(object, superClass)) :
  object 'CsparseMatrix_validate' not found

in some old post, it ask us to update.packages("Matirx")

tried and didn't work for me. Your help would be much appreciated


问:
how to copy a existing glue table to a iceberg format table with athena?
i have a a lot of json files in s3 which are updated frequently. Basically i am doing CRUD operations in a datalake. Because apache iceberg can handle item-level manipulations, i would like to migrate my data to use apache iceberg as table format.

my data is in json files, but i have crawled the data and created a glue-table.
The glue table was basically created automatically after crawling and the schema with all the data types was automatically detected.

i want to migrate this table to a table with iceberg format. Therefore i created a iceberg table with the same schema i read from the existing crawled glue table:

```<code>  CREATE TABLE
      icebergtest
      (
        `name` string,
        `address` string,
        `customer` boolean,
        `features` array<struct<featurename:string,featureId:string,featureAge:double,featureVersion:string>>,
      )
  LOCATION 's3://<s3-bucket-name>/<blablapath>/'
  TBLPROPERTIES ( 'table_type' ='ICEBERG'  );
</code>```

as you can see, i have some attributes in my json files an features is an array with json objects. I just copy pasted the data types from my exising glue table.
creating the table was successful, but filling the iceberg table with the data from the glue table fails:

```<code>INSERT INTO "icebergtest"
SELECT * FROM "customer_json_table";
</code>```

ERRORs : SYNTAX_ERROR: Insert query has mismatched column types:
Table: [varchar, varchar, boolean, array(row(featurename varchar,
featureId varchar, featureAge double, featureVersion varchar)), ...

for me it seems like it i am trying to insert varchar to a string datafield. But my glue tables has also a string as data type configure.. i dont understand where suddenly varchar is coming from and how i can fix that problem.

Body:
i have a a lot of json files in s3 which are updated frequently. Basically i am doing CRUD operations in a datalake. Because apache iceberg can handle item-level manipulations, i would like to migrate my data to use apache iceberg as table format.

my data is in json files, but i have crawled the data and created a glue-table.
The glue table was basically created automatically after crawling and the schema with all the data types was automatically detected.

i want to migrate this table to a table with iceberg format. Therefore i created a iceberg table with the same schema i read from the existing crawled glue table:

  CREATE TABLE
      icebergtest
      (
        `name` string,
        `address` string,
        `customer` boolean,
        `features` array<struct<featurename:string,featureId:string,featureAge:double,featureVersion:string>>,
      )
  LOCATION 's3://<s3-bucket-name>/<blablapath>/'
  TBLPROPERTIES ( 'table_type' ='ICEBERG'  );

as you can see, i have some attributes in my json files an features is an array with json objects. I just copy pasted the data types from my exising glue table.
creating the table was successful, but filling the iceberg table with the data from the glue table fails:

INSERT INTO "icebergtest"
SELECT * FROM "customer_json_table";

ERRORs : SYNTAX_ERROR: Insert query has mismatched column types:
Table: [varchar, varchar, boolean, array(row(featurename varchar,
featureId varchar, featureAge double, featureVersion varchar)), ...

for me it seems like it i am trying to insert varchar to a string datafield. But my glue tables has also a string as data type configure.. i dont understand where suddenly varchar is coming from and how i can fix that problem.


问:
Autofill in Android proposes the wrong field (email instead of the phone). Filtering of the autofill combinations
I have a signIn in the Android app by the email and password combination. After a month of the using I have a list of this combinations in the "Passwords & accounts" list on my device.

Now I have a signIn by the phone and password, but the autofill propose the email/password combination on the screen with a phone input and password.

Methods like:

binding.phoneEditText.setAutofillHints(HintConstants.AUTOFILL_HINT_PHONE_NATIONAL)

Changes nothing in this case. It works only if there is no password field on the screen.

Can I somehow filter the saved combination of the credentials to show only "phone/password" not "email/password"?

```<code><?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/loginLayout"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="24dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <com.google.android.material.textfield.TextInputLayout
            android:id="@+id/codeEditTextLayout"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            app:layout_constraintEnd_toStartOf="@+id/phoneEditTextLayout"
            app:layout_constraintHorizontal_weight="0.4"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

         <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/codeEditText"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />
        </com.google.android.material.textfield.TextInputLayout>

        <com.google.android.material.textfield.TextInputLayout
            android:id="@+id/phoneEditTextLayout"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_weight="0.6"
            app:layout_constraintStart_toEndOf="@+id/codeEditTextLayout"
            app:layout_constraintTop_toTopOf="parent">

            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/phoneEditText"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:autofillHints="phone"
                android:gravity="center"
                android:importantForAutofill="yes"
                android:inputType="phone" />
        </com.google.android.material.textfield.TextInputLayout>

    </androidx.constraintlayout.widget.ConstraintLayout>

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/passwordEditTextLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/loginLayout">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/passwordEditText"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:autofillHints="password"
            android:gravity="center"
            android:importantForAutofill="yes"
            android:inputType="textPassword" />
    </com.google.android.material.textfield.TextInputLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</code>```

Body:
I have a signIn in the Android app by the email and password combination. After a month of the using I have a list of this combinations in the "Passwords & accounts" list on my device.

Now I have a signIn by the phone and password, but the autofill propose the email/password combination on the screen with a phone input and password.

Methods like:

binding.phoneEditText.setAutofillHints(HintConstants.AUTOFILL_HINT_PHONE_NATIONAL)

Changes nothing in this case. It works only if there is no password field on the screen.

Can I somehow filter the saved combination of the credentials to show only "phone/password" not "email/password"?

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/loginLayout"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="24dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <com.google.android.material.textfield.TextInputLayout
            android:id="@+id/codeEditTextLayout"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            app:layout_constraintEnd_toStartOf="@+id/phoneEditTextLayout"
            app:layout_constraintHorizontal_weight="0.4"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

         <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/codeEditText"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />
        </com.google.android.material.textfield.TextInputLayout>

        <com.google.android.material.textfield.TextInputLayout
            android:id="@+id/phoneEditTextLayout"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_weight="0.6"
            app:layout_constraintStart_toEndOf="@+id/codeEditTextLayout"
            app:layout_constraintTop_toTopOf="parent">

            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/phoneEditText"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:autofillHints="phone"
                android:gravity="center"
                android:importantForAutofill="yes"
                android:inputType="phone" />
        </com.google.android.material.textfield.TextInputLayout>

    </androidx.constraintlayout.widget.ConstraintLayout>

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/passwordEditTextLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/loginLayout">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/passwordEditText"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:autofillHints="password"
            android:gravity="center"
            android:importantForAutofill="yes"
            android:inputType="textPassword" />
    </com.google.android.material.textfield.TextInputLayout>
</androidx.constraintlayout.widget.ConstraintLayout>


问:
Postgresql with heroku
I have a Postgres database on my PC with all data that I need so far in the project, my app is deployed on Heroku without any data in the database Heroku gave to me. I want to provide my app on Heroku with data from my DB. I tried using pg_dump but couldn't figure out what I was doing wrong, I thought I could host my DB and then somehow connect it.</p>

Title: Postgresql with heroku


问:
Editing it in html when we pull data from Django
The news saved in the system will come to my page. I pulled data from django. Currently the data is coming one after the other. I want to pull 3 data side by side after it's will be 3 data below again and so it will go like that. How can i do this?

My kategori.html:

```<code>{%  extends "homebase.html" %}

{% block title %} {{ setting.title }} {% endblock %}
{% block keywords %} {{ setting.keywords }} {% endblock %}
{% block description %} {{ setting.description }} {% endblock %}

{% block head %}
    <link rel="icon" type='image/png' href='{{ setting.icon.url }}'/>
{% endblock %}

{% block header %}{% include 'header.html'%}{% endblock %}
{% block sidebar %}{% include "sidebar.html" %}{% endblock %}
{% block content %}

{% load static %}
  <section id="news" data-stellar-background-ratio="2.5">
    <div class="container">
         <div class="row">

              <div class="col-md-12 col-sm-12">
                   <div class="section-title wow fadeInUp" data-wow-delay="0.1s">
                        <h2>TIBBİ BİRİMLER KATEGORİSİ</h2>
                   </div>
              </div>

              <div class="col-md-4 col-sm-6" >
                   <!-- NEWS THUMB -->
                   <div class="news-thumb wow fadeInUp" data-wow-delay="0.4s">
                    {% for rs in category %}
                        <a href="kategori.html">
                            <img src="{{rs.image.url}}" class="img-responsive" alt="">
                        </a>
                        <div class="news-info">
                             <span>{{rs.create_at}}</span>
                             <h3><a href="bos-sayfa.html">{{rs.title}}</a></h3>
                             <p>{{rs.description}}</p>
                             <div class="author">
                                  <div class="author-info">

                                       <p>{{rs.keywords}}</p>
                                  </div>
                             </div>
                        </div>
                    {% endfor %}
                   </div>
              </div>
         </div>
    </div>
</section>

{% endblock %}
{% block footer %}{% include "footer.html" %}{% endblock %}

</code>```

My page's screenshots for rn:
enter image description here

Body:
The news saved in the system will come to my page. I pulled data from django. Currently the data is coming one after the other. I want to pull 3 data side by side after it's will be 3 data below again and so it will go like that. How can i do this?

My kategori.html:

{%  extends "homebase.html" %}

{% block title %} {{ setting.title }} {% endblock %}
{% block keywords %} {{ setting.keywords }} {% endblock %}
{% block description %} {{ setting.description }} {% endblock %}

{% block head %}
    <link rel="icon" type='image/png' href='{{ setting.icon.url }}'/>
{% endblock %}

{% block header %}{% include 'header.html'%}{% endblock %}
{% block sidebar %}{% include "sidebar.html" %}{% endblock %}
{% block content %}

{% load static %}

TIBBİ BİRİMLER KATEGORİSİ

                    {% for rs in category %}

                             {{rs.create_at}}

{{rs.title}}

{{rs.description}}

{{rs.keywords}}

                    {% endfor %}

{% endblock %}
{% block footer %}{% include "footer.html" %}{% endblock %}

My page's screenshots for rn:
enter image description here


问:
How to snap an element to one corner of his parent reference
I have a parent container in which I load a small camera video, I've set it to have this parent as his constraint.

```<code>   <motion.div
          ref={constraintsRef}
          className="absolute top-4 left-0 right-0 bottom-20 p-4"
        >
          <motion.video
            ref={videoRef}
            drag
            dragConstraints={constraintsRef}
            dragSnapToOrigin
            onDragEnd={(e, info) => {
              console.log(info.point.x, info.point.y);

              debugger;
            }}
            autoPlay
            playsInline
            muted
            loop
            className={`absolute h-40 draggable aspect-video  shadow-2xl z-50 top-0 rounded-xl resize  object-cover   bg-[#333] ${
              cameraOpen ? "hidden" : ""
            }`}
          />
        </motion.div>
</code>```

I would like to have it snap to one of the 4 angles of the parent container, but I don't understand how to change the origin of this motion.video element so that I can do that in the onDragEnd event,

Thank you in advances for your help

Body:
I have a parent container in which I load a small camera video, I've set it to have this parent as his constraint.

   <motion.div
          ref={constraintsRef}
          className="absolute top-4 left-0 right-0 bottom-20 p-4"
        >
          <motion.video
            ref={videoRef}
            drag
            dragConstraints={constraintsRef}
            dragSnapToOrigin
            onDragEnd={(e, info) => {
              console.log(info.point.x, info.point.y);

              debugger;
            }}
            autoPlay
            playsInline
            muted
            loop
            className={`absolute h-40 draggable aspect-video  shadow-2xl z-50 top-0 rounded-xl resize  object-cover   bg-[#333] ${
              cameraOpen ? "hidden" : ""
            }`}
          />
        </motion.div>

I would like to have it snap to one of the 4 angles of the parent container, but I don't understand how to change the origin of this motion.video element so that I can do that in the onDragEnd event,

Thank you in advances for your help


问:
Questions about Unicorn::ClientShutdown
Can anyone help me better understand Unicorn::ClientShutdown errors? I see them occasionally via my web app's error logs and I have no idea what's causing them, how I can replicate the issue, or whether it's safe to ignore it altogether.

From the documentation (https://www.rubydoc.info/gems/unicorn/2.0.0/Unicorn/ClientShutdown), it seems like this has something to do with interrupted sockets, but I'm not sure exactly what that means or how it relates to my app.

I believe I've only ever seen this on POST requests, and the error has almost exclusively been associated with a simple POST request that tracks page views (and is by far the most common non-GET request made by the web app).

Thanks in advance for your help!

Title: Questions about Unicorn::ClientShutdown


问:
Power BI Report Server Paginated subscription in HTML 4.0 not showing images when saving to fileshare then embedding in email
In order to implement custom from addresses for paginated subscription, I am saving HTML 4.0 formatted report to a file share, then using OPENROWSET/BULK load in SQL plus sp_send_dbmail to send the mail.  All worked great after adding the HTML 4.0 type and configured embedding.  The only issue is that images do not show in the email.
In my research, all of the articles I am seeing are people rendering the reports via web service or code. SSRS -Image not rendering on HTML 4.0 Report(Unauthorization )
I am on Power BI report server and wondering if it would even be possible to get the images to render.  The article mentions overriding the Deviceinfo StreamRoot, is this something I could do in my scenario without external code?  Like via settings or anything else?  I also saw a suggestion to just add a rectangle but that had no affect.  Any ideas are appreciated.</p>


问:
Use OpenTelemetry to track Kubernetes pods/containers cpu, memory and health
Does opentelemetry provide auto instrumentation for Kubernetes pods/containers cpu, memory and health if I am using opentelemetry-collector-contrib?</p>


问:
Should the video be entirely loaded to memory before it can be navigated?
Assume having video metadata chapters stored in a database, with a start/end timestamps for each chapter. Can the computer load only a requested video chapter from disk to memory before playback, or the entire video should be loaded from disk to memory before navigating through chapters?

I don't have solid background on how video is stored on disk except that it is stored in a linear bytes form, thus I can't understand how a video chapter's timestamps be linked to that linear bytes video data.

Many thanks


问:
R functions that print plots won't resolve
I've seen other questions here about RStudio not displaying plots, but in my case, R won't even finish the computation. At first I thought it had to do with the size of the datasets, but commands like plot(rnorm(50), rnorm(50)) yield the same result. I can create ggplot objects but cannot print them. The memory usage slowly trickles down to <10MiB, and only by terminating the R session can I exit. The problem randomly started on the ~400th iteration of a for loop that was calling car::confidenceEllipse. Can anyone explain to me why I might be experiencing this bug?

I tried updating both R and RStudio. I tried dev.off down to the null device. The same behavior persisted.

I am running the latest versions of R and RStudio on MacOS 12.1


问:
Asp.net using oauth to to communicate with .netwebapi, any articles or exampls on the best way to do this?
I want to take an existing an asp.net 4.5.2 mvc webapp that's using ad authentication, and without breaking the Ad authentication, I want to write a jwt so it can talk to a .netcore webapi securely

What is the best way to do this? links to Article and Code examples are appreciated.


问:
Trigger TV alarms with If
Is there a way to trigger Tadingview alerts without going long or short. I want to close the trade at the end of the trading session. I tried that but nothing happens, no alarm is triggered

days_close_trade = input.session("1545-1600", "Zeit für Tradeabbruch", group="Tradingzeiten selektieren")
time_is_close = time("1", days_close_trade)

if time_is_close and barstate.isconfirmed
strategy.close('Close', alert_message="Entry Close {{ticker}}!")
alertLongEntry = input.string("Entry Close {{ticker}}!", "Alert Message Close Entry: ", group = "Alert Settings")

Title: Trigger TV alarms with If


问:
PDM Plugin Installation Error with VSCode Plugin
I am getting the following error when I install the pdm-vscode plugin for PDM and not sure how to debug it. I setup my PDM interpreter to be Python 3.10.</p>
```<code>$ pdm plugin add pdm-vscode
Installation failed:
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3/dist-packages/pip/__main__.py", line 19, in <module>
    sys.exit(_main())
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line 73, in main
    command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
  File "/usr/lib/python3/dist-packages/pip/_internal/commands/__init__.py", line 96, in create_command
    module = importlib.import_module(module_path)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name, package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 24, in <module>
    from pip._internal.cli.req_command import RequirementCommand
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/req_command.py", line 15, in <module>
    from pip._internal.index.package_finder import PackageFinder
  File "/usr/lib/python3/dist-packages/pip/_internal/index/package_finder.py", line 21, in <module>
    from pip._internal.index.collector import parse_links
  File "/usr/lib/python3/dist-packages/pip/_internal/index/collector.py", line 12, in <module>
    from pip._vendor import html5lib, requests
ImportError: cannot import name 'html5lib' from 'pip._vendor' (/usr/lib/python3/dist-packages/pip/_vendor/__init__.py)
</code>```

Body:
I am getting the following error when I install the pdm-vscode plugin for PDM and not sure how to debug it. I setup my PDM interpreter to be Python 3.10.

$ pdm plugin add pdm-vscode
Installation failed:
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3/dist-packages/pip/__main__.py", line 19, in <module>
    sys.exit(_main())
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line 73, in main
    command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
  File "/usr/lib/python3/dist-packages/pip/_internal/commands/__init__.py", line 96, in create_command
    module = importlib.import_module(module_path)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name, package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 24, in <module>
    from pip._internal.cli.req_command import RequirementCommand
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/req_command.py", line 15, in <module>
    from pip._internal.index.package_finder import PackageFinder
  File "/usr/lib/python3/dist-packages/pip/_internal/index/package_finder.py", line 21, in <module>
    from pip._internal.index.collector import parse_links
  File "/usr/lib/python3/dist-packages/pip/_internal/index/collector.py", line 12, in <module>
    from pip._vendor import html5lib, requests
ImportError: cannot import name 'html5lib' from 'pip._vendor' (/usr/lib/python3/dist-packages/pip/_vendor/__init__.py)


问:
MongoDB Database on Java
I figured I'd make this new personal project with MongoDB, after all seems pretty easy. And in fact, it was pretty painless, except it won't connect to the right Database, and I don't know why.

This what Compass looks like

So I want it to connect to the 'doteco' database. And it just won't, it keeps going to that 'test' database.

I've tried both

```<code>spring.data.mongodb.uri=mongodb://localhost:27017
spring.data.mongodb.database=doteco
</code>```

and

```<code>spring.data.mongodb.uri=mongodb://localhost:27017/doteco
</code>```

But it refuses, it only connects to Test. The program doesn't have any manual connecting to it, it's just the URI on the properties and that's it. It just creates a the collection words under Test and keeps populating it.

Edit-

Some of the code, it's so simple it's a case of 'I don't know why this is going wrong.'

The Entity/Document

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Document("words")
public class WordDocument {

    @Id
    private String id;
    private String word;
    private Integer numberOfLetters;
    private Integer flag;
}
```
<p>The Repository</p>
<pre class="lang-java prettyprint-override"><code>@Repository
public interface WordRepository extends MongoRepository<WordDocument, String> {

    @Query("{word:'?0'}")
    Optional<WordDocument> findByWord(String word);
}
</code>```

The properties is the ones I've shown earlier, and just manually creating the object to test.

@Override
    public void save() {
        WordDocument word = new WordDocument();
        word.setWord("Word");
        word.setFlag(1);
        word.setNumberOfLetters(7);
        WordDocument save = wordRepository.insert(word);
        System.out.println(save);
    }
```
<p>And it's just a regular run, there are no configuration classes, no extra beans, no nothing.</p>
<pre class="lang-java prettyprint-override"><code>@SpringBootApplication
@EnableMongoRepositories
public class DotecoApplication {

    public static void main(String[] args) {
        SpringApplication.run(DotecoApplication.class);
    }
}
</code>```

I want it to save on the doteco database, not on the 'test' one. I had a Database Test using the Intellij Ultimate Database feature on, thought might be the case, but persists even when I turn it off, or use the regular Intellij Community. Maybe it just THINKS it belongs there for some reason now?

Title: MongoDB Database on Java

Body:
I figured I'd make this new personal project with MongoDB, after all seems pretty easy. And in fact, it was pretty painless, except it won't connect to the right Database, and I don't know why.

This what Compass looks like

So I want it to connect to the 'doteco' database. And it just won't, it keeps going to that 'test' database.

I've tried both

spring.data.mongodb.uri=mongodb://localhost:27017
spring.data.mongodb.database=doteco

and

spring.data.mongodb.uri=mongodb://localhost:27017/doteco

But it refuses, it only connects to Test. The program doesn't have any manual connecting to it, it's just the URI on the properties and that's it. It just creates a the collection words under Test and keeps populating it.

Edit-

Some of the code, it's so simple it's a case of 'I don't know why this is going wrong.'

The Entity/Document

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Document("words")
public class WordDocument {

    @Id
    private String id;
    private String word;
    private Integer numberOfLetters;
    private Integer flag;
}

The Repository

@Repository
public interface WordRepository extends MongoRepository<WordDocument, String> {

    @Query("{word:'?0'}")
    Optional<WordDocument> findByWord(String word);
}

The properties is the ones I've shown earlier, and just manually creating the object to test.

@Override
    public void save() {
        WordDocument word = new WordDocument();
        word.setWord("Word");
        word.setFlag(1);
        word.setNumberOfLetters(7);
        WordDocument save = wordRepository.insert(word);
        System.out.println(save);
    }

And it's just a regular run, there are no configuration classes, no extra beans, no nothing.

@SpringBootApplication
@EnableMongoRepositories
public class DotecoApplication {

    public static void main(String[] args) {
        SpringApplication.run(DotecoApplication.class);
    }
}

I want it to save on the doteco database, not on the 'test' one. I had a Database Test using the Intellij Ultimate Database feature on, thought might be the case, but persists even when I turn it off, or use the regular Intellij Community. Maybe it just THINKS it belongs there for some reason now?


问:
Inverse of double colon indexing
I'm in want of figuring out the inverse of double indexing. For example, If I index my data [::3] at every three steps, then I want the negation of all those that were selected, so all those not in three steps. How can I achieve this?

For example:

```<code>df = {
    'OR': [0, 1, 0, 0, 1, 0, 0],
    'name': ['EPL Prekickoff 15m Next Arsenal Match Timer Over', 'EPL Prekickoff 15m Next Arsenal Match Timer Over', 'EPL Prekickoff 15m Next Chelsea Match Timer Over', 'Set Time Targeting 15m Next Event 1 Timer Over', 'Set Time Targeting 15m Next Event 1 Timer Over', 'Sportsbook Convert View to Bet Timer Over', 'Timer is up - send back to main profile'],
    'id': ['_unibet-delay_120', '_unibet-delay_120', '_unibet-delay_121', '_unibet-delay_123', '_unibet-delay_123', '_unibet-delay_122', 'unibet-delay_102'],
    'baseOperator': [None, None, None, None, None, None, None],
    'operator': ['equals_ignore_case', 'equals_ignore_case', 'equals_ignore_case', 'equals', 'greater_than', 'equals', 'exists'],
    'operand1': ['metrics.5130', 'metrics.29', 'metrics.29', 'metrics.5140', 'metrics.29', 'metrics.5136', 'properties.5012'],
    'operand2': [1, 2, 2, '1', '1', 1, 0]
}
</code>```

Then create a few repeats:

```<code>DF = df.apply(lambda x: pd.Series.repeat(x, 3))
</code>```

But how to get the indexing right?

```<code>DF[::3]

>    OR                                              name                        id baseOperator            operator         operand1 operand2
1    0  EPL Prekickoff 15m Next Arsenal Match Timer Over  _unibet-delay_120         None  equals_ignore_case     metrics.5130        1
2    1  EPL Prekickoff 15m Next Arsenal Match Timer Over  _unibet-delay_120         None  equals_ignore_case       metrics.29        2
3    0  EPL Prekickoff 15m Next Chelsea Match Timer Over  _unibet-delay_121         None  equals_ignore_case       metrics.29        2
20   0    Set Time Targeting 15m Next Event 1 Timer Over  _unibet-delay_123         None              equals     metrics.5140        1
21   1    Set Time Targeting 15m Next Event 1 Timer Over  _unibet-delay_123         None        greater_than       metrics.29        1
22   0         Sportsbook Convert View to Bet Timer Over  _unibet-delay_122         None              equals     metrics.5136        1
23   0           Timer is up - send back to main profile  _unibet-delay_102         None              exists  properties.5012        0
</code>```

Prints out the original dataset, I have tried using - signs but this reorders the data.

Title: Inverse of double colon indexing

Body:
I'm in want of figuring out the inverse of double indexing. For example, If I index my data [::3] at every three steps, then I want the negation of all those that were selected, so all those not in three steps. How can I achieve this?

For example:

df = {
    'OR': [0, 1, 0, 0, 1, 0, 0],
    'name': ['EPL Prekickoff 15m Next Arsenal Match Timer Over', 'EPL Prekickoff 15m Next Arsenal Match Timer Over', 'EPL Prekickoff 15m Next Chelsea Match Timer Over', 'Set Time Targeting 15m Next Event 1 Timer Over', 'Set Time Targeting 15m Next Event 1 Timer Over', 'Sportsbook Convert View to Bet Timer Over', 'Timer is up - send back to main profile'],
    'id': ['_unibet-delay_120', '_unibet-delay_120', '_unibet-delay_121', '_unibet-delay_123', '_unibet-delay_123', '_unibet-delay_122', 'unibet-delay_102'],
    'baseOperator': [None, None, None, None, None, None, None],
    'operator': ['equals_ignore_case', 'equals_ignore_case', 'equals_ignore_case', 'equals', 'greater_than', 'equals', 'exists'],
    'operand1': ['metrics.5130', 'metrics.29', 'metrics.29', 'metrics.5140', 'metrics.29', 'metrics.5136', 'properties.5012'],
    'operand2': [1, 2, 2, '1', '1', 1, 0]
}

Then create a few repeats:

DF = df.apply(lambda x: pd.Series.repeat(x, 3))

But how to get the indexing right?

DF[::3]

>    OR                                              name                        id baseOperator            operator         operand1 operand2
1    0  EPL Prekickoff 15m Next Arsenal Match Timer Over  _unibet-delay_120         None  equals_ignore_case     metrics.5130        1
2    1  EPL Prekickoff 15m Next Arsenal Match Timer Over  _unibet-delay_120         None  equals_ignore_case       metrics.29        2
3    0  EPL Prekickoff 15m Next Chelsea Match Timer Over  _unibet-delay_121         None  equals_ignore_case       metrics.29        2
20   0    Set Time Targeting 15m Next Event 1 Timer Over  _unibet-delay_123         None              equals     metrics.5140        1
21   1    Set Time Targeting 15m Next Event 1 Timer Over  _unibet-delay_123         None        greater_than       metrics.29        1
22   0         Sportsbook Convert View to Bet Timer Over  _unibet-delay_122         None              equals     metrics.5136        1
23   0           Timer is up - send back to main profile  _unibet-delay_102         None              exists  properties.5012        0

Prints out the original dataset, I have tried using - signs but this reorders the data.


问:
how to configure multiple databases -- datatsource in spring boot
I have a system that performs a query to a view in a database and stores it in another database.

I need to configure 5 databases to do the query, the databases handle the same view

The inconvenience is that when adding the third datasource of the database it throws me a problem where it tells me that the query is already being carried out in another datasource.

How could I differentiate the 5 datasources when making the query to the view?


问:
Seaborn barplot chart visualisation messed up
I have made a barplot using seaborn but it doesn't look very good. The bars are not wide enough, the bar labels are too small(if I make them bigger they overlap with each other), and the legend is too small. Can someone make suggestions pleas on how to make this chart more presentable? Here is my code along with the screenshot of my chart(most likely some lines of code are unnecessary). Also, attached is the link to raw data on github as I didn't know how to upload csv file directly here. Data can be copied and saved as csv in excel. Thanks.

https://github.com/macimacileona/stackoverflow_repository/blob/main/SB%20vs%20SS%20python%20leagues%20analysis%20pregame1.csv

```<code>sns.set_theme(style="white", palette=None)
f, ax = plt.subplots(figsize=(55, 15))
league_chart =sns.barplot(data = leagues_pregame_data,x = 'League', y ="1x2", hue = "Operator",ci = None)
league_chart.set_title('1X2 overround comparison per league',fontdict= { 'fontsize': 40})
ax.title.set_position([.5, 1])
ax.legend(ncol=2, loc="upper right", frameon=True,prop={'size': 40})
ax.set(ylim=(98, 113), ylabel="Overround (%)",
       xlabel="")
ax.tick_params(bottom=False, left = False,labelleft=False)

for i in ax.containers:
    ax.bar_label(i,fontsize = 17)
sns.despine(left=True, bottom=True)

#change_width(ax, 40)
for item in league_chart.get_xticklabels():
    item.set_rotation(45)
plt.tight_layout()
plt.xticks(fontsize = 25)
sns.move_legend(league_chart,loc = "upper left")
plt.savefig("Leagues 1x2", orientation = "landscape")
</code>```

Body:
I have made a barplot using seaborn but it doesn't look very good. The bars are not wide enough, the bar labels are too small(if I make them bigger they overlap with each other), and the legend is too small. Can someone make suggestions pleas on how to make this chart more presentable? Here is my code along with the screenshot of my chart(most likely some lines of code are unnecessary). Also, attached is the link to raw data on github as I didn't know how to upload csv file directly here. Data can be copied and saved as csv in excel. Thanks.

https://github.com/macimacileona/stackoverflow_repository/blob/main/SB%20vs%20SS%20python%20leagues%20analysis%20pregame1.csv

sns.set_theme(style="white", palette=None)
f, ax = plt.subplots(figsize=(55, 15))
league_chart =sns.barplot(data = leagues_pregame_data,x = 'League', y ="1x2", hue = "Operator",ci = None)
league_chart.set_title('1X2 overround comparison per league',fontdict= { 'fontsize': 40})
ax.title.set_position([.5, 1])
ax.legend(ncol=2, loc="upper right", frameon=True,prop={'size': 40})
ax.set(ylim=(98, 113), ylabel="Overround (%)",
       xlabel="")
ax.tick_params(bottom=False, left = False,labelleft=False)

for i in ax.containers:
    ax.bar_label(i,fontsize = 17)
sns.despine(left=True, bottom=True)

#change_width(ax, 40)
for item in league_chart.get_xticklabels():
    item.set_rotation(45)
plt.tight_layout()
plt.xticks(fontsize = 25)
sns.move_legend(league_chart,loc = "upper left")
plt.savefig("Leagues 1x2", orientation = "landscape")


问:
Why the actualDuration is not the same as the difference between endTime and startTime inside the onRender prop callback of the React.Profiler API?
Why the actualDuration is not the same as the difference between endTime and startTime inside the onRender prop callback of the React.Profiler API?
I have this code (just to play around with the React.Profiler):

```<code>import React from "react";
import Button from "./Button";
import "./App.css";
import "./index.css";

const App = () => {
  const [counter, setCounter] = React.useState(0);
  return (
    <>
      <React.Profiler
        id="counter"
        onRender={(
          id, // the "id" prop of the Profiler tree that has just committed
          phase, // either "mount" (if the tree just mounted) or "update" (if it re-rendered)
          actualDuration, // time spent rendering the committed update
          baseDuration, // estimated time to render the entire subtree without memoization
          startTime, // when React began rendering this update
          commitTime // when React committed this update
        ) => {

          console.log(commitTime - startTime === actualDuration); //always false
        }}
      >
        <button onClick={() => setCounter((counter) => counter + 1)}>
          {counter}
        </button>
        <Button />
        <Button />
        <Button />
      </React.Profiler>
    </>
  );
};

export default App;
</code>```

Can someone explain to me why the subtraction (commitTime - startTime) is always bigger than the actualDuration? From what I understood, these two expressions mean the same and have to be equal. But I have for example:
0.10000000894069672 - actualDuration
0.29999999701976776 - (commitTime - startTime)

Body:
Why the actualDuration is not the same as the difference between endTime and startTime inside the onRender prop callback of the React.Profiler API?
I have this code (just to play around with the React.Profiler):

import React from "react";
import Button from "./Button";
import "./App.css";
import "./index.css";

const App = () => {
  const [counter, setCounter] = React.useState(0);
  return (
    <>
      <React.Profiler
        id="counter"
        onRender={(
          id, // the "id" prop of the Profiler tree that has just committed
          phase, // either "mount" (if the tree just mounted) or "update" (if it re-rendered)
          actualDuration, // time spent rendering the committed update
          baseDuration, // estimated time to render the entire subtree without memoization
          startTime, // when React began rendering this update
          commitTime // when React committed this update
        ) => {

          console.log(commitTime - startTime === actualDuration); //always false
        }}
      >
        <button onClick={() => setCounter((counter) => counter + 1)}>
          {counter}
        </button>
        <Button />
        <Button />
        <Button />
      </React.Profiler>
    </>
  );
};

export default App;

Can someone explain to me why the subtraction (commitTime - startTime) is always bigger than the actualDuration? From what I understood, these two expressions mean the same and have to be equal. But I have for example:
0.10000000894069672 - actualDuration
0.29999999701976776 - (commitTime - startTime)


问:
OS X Ventura TypeError: libmemcached does not support SASL
I'm using Flask_Caching 2.0.1 in a Flask app, which uses pylibmc, which uses libmemcached 1.0.18_2 on OS X Ventura 13.0.1. Either the libmemcached that comes standard or using brew install libmemcached doesn't seem to support SASL. Here is the relevant part of the error message:

```<code>File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask_caching/backends/memcache.py", line 123, in factory
    return cls(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask_caching/backends/memcache.py", line 107, in __init__
    self._client = pylibmc.Client(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pylibmc/client.py", line 142, in __init__
    super().__init__(servers=translate_server_specs(servers),
TypeError: libmemcached does not support SASL
</code>```

I tried building from source, and hit tons of errors that others overcame but I could not (like here: How can I install libmemcached for Mac OS X Yosemite 10.10 in order to install the memcached.so PHP extension on Mamp 3?).

Has anyone run into and overcome this issue? Is there a flag or process that can enable SASL support in libmemcached either using Homebrew or other? All relevant SO responses are from 2016 and earlier it seems and did not work for me.

Body:
I'm using Flask_Caching 2.0.1 in a Flask app, which uses pylibmc, which uses libmemcached 1.0.18_2 on OS X Ventura 13.0.1. Either the libmemcached that comes standard or using brew install libmemcached doesn't seem to support SASL. Here is the relevant part of the error message:

File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask_caching/backends/memcache.py", line 123, in factory
    return cls(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask_caching/backends/memcache.py", line 107, in __init__
    self._client = pylibmc.Client(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pylibmc/client.py", line 142, in __init__
    super().__init__(servers=translate_server_specs(servers),
TypeError: libmemcached does not support SASL

I tried building from source, and hit tons of errors that others overcame but I could not (like here: How can I install libmemcached for Mac OS X Yosemite 10.10 in order to install the memcached.so PHP extension on Mamp 3?).

Has anyone run into and overcome this issue? Is there a flag or process that can enable SASL support in libmemcached either using Homebrew or other? All relevant SO responses are from 2016 and earlier it seems and did not work for me.


问:
How to set the default phone app with a dialog
I'm trying to set an app as default phone app, currently I'm using an internet to launch the settings screen and the user must manually do the change, however I found that the stock Google phone app displays a dialog instead, is anyway to have this behavior?


问:
How to convert WPF Control to XPS document via FixedDoc
I am building a test report in XAML that needs to be exported into an XPS file. This is the code I have below, however I'm running into an "Specified element is already the logical child of another element. Disconnect it first." error when running fixedPage.Children.Add(TestReportXAML);
TestReportXAML is the name of my Grid in the Xaml.cs file

```<code>FixedDocument fixedDoc = new FixedDocument();
PageContent pageContent = new PageContent();
FixedPage fixedPage = new FixedPage();

fixedDoc.DocumentPaginator.PageSize = new Size(96 * 11, 96 * 8.5); // LANDSCAPE
fixedPage.Width = 11 * 96;
fixedPage.Height = 8.5 * 96;

fixedPage.Children.Add(TestReportXAML);
((System.Windows.Markup.IAddChild)pageContent).AddChild(fixedPage);
fixedDoc.Pages.Add(pageContent);

XpsDocument xpsDoc = new XpsDocument(pathFileNameXPS, FileAccess.ReadWrite);
XpsDocumentWriter xpsWriter = XpsDocument.CreateXpsDocumentWriter(xpsDoc);
xpsWriter.Write(fixedDoc);
xpsDoc.Close();
</code>```

Initially I had this set of code that worked, however the problem with this is that my XAML gets saved in portrait mode. I don't know if there's a proper way to make this landscape so I'm trying to use a fixed document to convert the XAML orientation before exporting it to XPS.

```<code>XpsDocument xpsDoc = new XpsDocument(pathFileNameXPS, FileAccess.ReadWrite);
XpsDocumentWriter xpsWriter = XpsDocument.CreateXpsDocumentWriter(xpsDoc);
xpsWriter.Write(TestReportXAML);
xpsDoc.Close();
</code>```

I am a new developer and new to XAML/WPF, appreciate if things could be explained in less technical terms. Thanks

Body:
I am building a test report in XAML that needs to be exported into an XPS file. This is the code I have below, however I'm running into an "Specified element is already the logical child of another element. Disconnect it first." error when running fixedPage.Children.Add(TestReportXAML);
TestReportXAML is the name of my Grid in the Xaml.cs file

FixedDocument fixedDoc = new FixedDocument();
PageContent pageContent = new PageContent();
FixedPage fixedPage = new FixedPage();

fixedDoc.DocumentPaginator.PageSize = new Size(96 * 11, 96 * 8.5); // LANDSCAPE
fixedPage.Width = 11 * 96;
fixedPage.Height = 8.5 * 96;

fixedPage.Children.Add(TestReportXAML);
((System.Windows.Markup.IAddChild)pageContent).AddChild(fixedPage);
fixedDoc.Pages.Add(pageContent);

XpsDocument xpsDoc = new XpsDocument(pathFileNameXPS, FileAccess.ReadWrite);
XpsDocumentWriter xpsWriter = XpsDocument.CreateXpsDocumentWriter(xpsDoc);
xpsWriter.Write(fixedDoc);
xpsDoc.Close();

Initially I had this set of code that worked, however the problem with this is that my XAML gets saved in portrait mode. I don't know if there's a proper way to make this landscape so I'm trying to use a fixed document to convert the XAML orientation before exporting it to XPS.

XpsDocument xpsDoc = new XpsDocument(pathFileNameXPS, FileAccess.ReadWrite);
XpsDocumentWriter xpsWriter = XpsDocument.CreateXpsDocumentWriter(xpsDoc);
xpsWriter.Write(TestReportXAML);
xpsDoc.Close();

I am a new developer and new to XAML/WPF, appreciate if things could be explained in less technical terms. Thanks


问:
Twitter API v2 Academic Web Scraping in R
I am trying to get the Twitter API v2 to scrape some tweets using the academictwitteR package.

Here is my code (you will have to set your credentials using set_bearer() beforehand):

```<code>q = build_query(query = "news",
                is_retweet = F, is_quote = F, lang = "es")

mig <- get_all_tweets(query = q,
                      start_tweets = '2012-01-01T00:00:00Z',
                      end_tweets = '2022-12-16T00:00:00Z',
                      n = 500, bearer_token = get_bearer())
</code>```

I cannot figure out a way to remove retweets. I have included "-is:retweet" in every way that I can, but I every time, a majority of the tweets that I scrape start with "RT..." I appreciate your help!

Body:
I am trying to get the Twitter API v2 to scrape some tweets using the academictwitteR package.

Here is my code (you will have to set your credentials using set_bearer() beforehand):

q = build_query(query = "news",
                is_retweet = F, is_quote = F, lang = "es")

mig <- get_all_tweets(query = q,
                      start_tweets = '2012-01-01T00:00:00Z',
                      end_tweets = '2022-12-16T00:00:00Z',
                      n = 500, bearer_token = get_bearer())

I cannot figure out a way to remove retweets. I have included "-is:retweet" in every way that I can, but I every time, a majority of the tweets that I scrape start with "RT..." I appreciate your help!


问:
intellisense for global JS scripts on website (vanilla) (like jquery etc.) included globally via `<link>` on pages
I have a very simple vanilla page — a bunch of .html and .js files. I also use some scripts from CDN like jQuery and highlight.js. I add them using <link> tags on my pages.

Is there any way to add intellisense for those externally linked scripts inside my *.js files in VSCode?

Currently I am working with Jekyll, so I don't have any npm package setup, nor any webpack etc (I don't even know how webpack works)

Normally in node I use import _ from <package installed with npm>. Is there anything similar when writing a website?


问:
can't build non-loopback version of mqtt-sn-gateway
Trying to build mqtt-sn-gateway from https://github.com/simon622/mqtt-sn. Instructions:

```<code>mvn -f mqtt-sn-codec clean install
mvn -f mqtt-sn-core clean install
mvn -f mqtt-sn-gateway clean package
mvn -f mqtt-sn-client clean install
</code>```

Build completes, but only loopback jar, e.g. mqtt-sn-gateway-loopback-0.1.15-alpha.jar. Want to build full functional gateway for MQTT-SN aggregation forwarding to MQTT broker. Tried a few of the prior releases, built gateway jar is loopback only.

Body:
Trying to build mqtt-sn-gateway from https://github.com/simon622/mqtt-sn. Instructions:

mvn -f mqtt-sn-codec clean install
mvn -f mqtt-sn-core clean install
mvn -f mqtt-sn-gateway clean package
mvn -f mqtt-sn-client clean install

Build completes, but only loopback jar, e.g. mqtt-sn-gateway-loopback-0.1.15-alpha.jar. Want to build full functional gateway for MQTT-SN aggregation forwarding to MQTT broker. Tried a few of the prior releases, built gateway jar is loopback only.


问:
Im trying to figure out how to make this code print out a gray scale image. My teacher wants us to use this code to make it yet I've been stuck
```<code>from cImage import *
fileImageName = "butterfly.png"

def getNegativePixel(oldPixel):
    newRed = 255 - oldPixel.getRed()
    newGreen = 255 - oldPixel.getGreen()
    newBlue = 255 - oldPixel.getBlue()
    newPixel = Pixel(newRed, newGreen, newBlue)
    return newPixel

def makeNegativeImage(imageFile):
    oldImage = FileImage(imageFile)
    oHeight = oldImage.getHeight()
    oWidth = oldImage.getWidth()

    myWindow = ImageWin("Negative Butterfly Image",oWidth * 2, oHeight)
    oldImage.draw(myWindow)

    newImage = EmptyImage(oWidth,oHeight)

    for row in range(oHeight):
        for column in range(oWidth):
            oldPixel = oldImage.getPixel(column, row)
            newPixel = getNegativePixel(oldPixel)
            newImage.setPixel( column, row,newPixel )

    newImage.setPosition(oWidth + 1, 0)
    newImage.draw(myWindow)

    myWindow.exitOnClick()

makeNegativeImage(fileImageName)
</code>```

I have just been stuck with it tried changing certain variables but couldn't really work it out. Ive tried asking them for help but didnt really provide so im hoping someone would know how to do it, so i could better understand how to make it work

Body:
from cImage import *
fileImageName = "butterfly.png"

def getNegativePixel(oldPixel):
    newRed = 255 - oldPixel.getRed()
    newGreen = 255 - oldPixel.getGreen()
    newBlue = 255 - oldPixel.getBlue()
    newPixel = Pixel(newRed, newGreen, newBlue)
    return newPixel

def makeNegativeImage(imageFile):
    oldImage = FileImage(imageFile)
    oHeight = oldImage.getHeight()
    oWidth = oldImage.getWidth()

    myWindow = ImageWin("Negative Butterfly Image",oWidth * 2, oHeight)
    oldImage.draw(myWindow)

    newImage = EmptyImage(oWidth,oHeight)

    for row in range(oHeight):
        for column in range(oWidth):
            oldPixel = oldImage.getPixel(column, row)
            newPixel = getNegativePixel(oldPixel)
            newImage.setPixel( column, row,newPixel )

    newImage.setPosition(oWidth + 1, 0)
    newImage.draw(myWindow)

    myWindow.exitOnClick()

makeNegativeImage(fileImageName)

I have just been stuck with it tried changing certain variables but couldn't really work it out. Ive tried asking them for help but didnt really provide so im hoping someone would know how to do it, so i could better understand how to make it work


问:
Update Apache Beam Jave RunTime for Dataflow runner from Java8 to Java11
We have compose function written in node.js and DAG written in python and the data flow job is in Java. All the dependencies including the dataflow job is compiled in java11 and when I try to run the dataflow job, getting
Exception in thread "main" java.lang.UnsupportedClassVersionError: apache_beam_2/EdnCoder has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

enter image description here
enter image description here

I am not sure how to set the runtime to java11.
As apache/beam_java11_sdk is one of the default images, looking to set that as runtime version.
sdkContainerImage part of pipeline option is one way but I dont have any customization need here, so checking if there is any straight forward way of changing the java runtime version.


问:
Trouble Looping Through an Excel Table by Column First, then Row
I have an Excel table (365) imported from pdf data that I wish to write out specific Lot details for use elsewhere. I have all the code to do so and it nearly performs as expected!, but I am moving through the table row by row, and I really need the code to move through the table column by column - it affects the usability of the written output.
All of the output by column headers should be together...
Note: I'm only looking at the data - not writing into the Table. I think this is only a sequencing of code issue - but I'm stumped. I've read everything I can get my hands on about looping in tables, but I can't seem to make this work.
Any help would be gratefully received...

The guts of the code is here (full code attached)..

    For Each cell In tblDBR
    Select Case cell.Column
    Case 3 To 13
        If cell.Value <> 0 Then
            Process each formatted item and move to next formatted cell etc
        End If
    End Select
    Next cell
```
<p>This code moves through the table row by row (horizontally), and I need it to move (and therefore output) column by column (vertically).</p>
<p>Full code here...</p>
```Private Sub CommandButton1_Click()
    'Macro to loop through LTD table and write 'lot' information for use elsewhere
    Dim ws As Worksheet, tbl As ListObject, tblCol As ListColumn, cell As Range, tblCols As ListColumns, tblDataCol As Range, tblDBR As Range, POD As String

    Set ws = ActiveSheet
    Set tbl = ws.ListObjects("LTD")
    Set tblDBR = tbl.DataBodyRange
    Set tblCols = tbl.ListColumns
    Set tblDataCol = tbl.ListColumns(3).DataBodyRange
    POD = "CHINA"

    Range("N6").Select      'location to start writing Lots - arbitrary

    For Each cell In tblDBR

    Select Case cell.Column
    Case 3 To 13        'always this many columns, always starts at 3

    If cell.Value <> 0 Then
        cell.Interior.ColorIndex = 6        'useful color changer to show progress and problem
        ActiveCell.Value = tbl.HeaderRowRange.Cells(1, cell.Column - tbl.Range.Column + 1).Value
        ActiveCell.Offset(0, 1).Select
        ActiveCell.Value = "Lot " & cell.Offset(0, -(cell.Column - 1)).Value    'Lot Number
        ActiveCell.Offset(1, 1).Select
        ActiveCell.Value = cell.Offset(0, -(cell.Column - 2)).Value & " M"      'Length
        ActiveCell.Offset(0, -1).Select
        ActiveCell.Value = Application.WorksheetFunction.Round(cell.Value, 0)   'Volume
        ActiveCell.Offset(1, 0).Select
        ActiveCell.Value = POD      'Disport
        ActiveCell.Offset(2, -1).Select  'move down a line and start again
    End If
    End Select
    Next cell
End Sub
```

Snapshot of issue:

Body:
I have an Excel table (365) imported from pdf data that I wish to write out specific Lot details for use elsewhere. I have all the code to do so and it nearly performs as expected!, but I am moving through the table row by row, and I really need the code to move through the table column by column - it affects the usability of the written output.
All of the output by column headers should be together...
Note: I'm only looking at the data - not writing into the Table. I think this is only a sequencing of code issue - but I'm stumped. I've read everything I can get my hands on about looping in tables, but I can't seem to make this work.
Any help would be gratefully received...

The guts of the code is here (full code attached)..

    For Each cell In tblDBR
    Select Case cell.Column
    Case 3 To 13
        If cell.Value <> 0 Then
            Process each formatted item and move to next formatted cell etc
        End If
    End Select
    Next cell

This code moves through the table row by row (horizontally), and I need it to move (and therefore output) column by column (vertically).

Full code here...

Private Sub CommandButton1_Click()
    'Macro to loop through LTD table and write 'lot' information for use elsewhere
    Dim ws As Worksheet, tbl As ListObject, tblCol As ListColumn, cell As Range, tblCols As ListColumns, tblDataCol As Range, tblDBR As Range, POD As String

    Set ws = ActiveSheet
    Set tbl = ws.ListObjects("LTD")
    Set tblDBR = tbl.DataBodyRange
    Set tblCols = tbl.ListColumns
    Set tblDataCol = tbl.ListColumns(3).DataBodyRange
    POD = "CHINA"

    Range("N6").Select      'location to start writing Lots - arbitrary

    For Each cell In tblDBR

    Select Case cell.Column
    Case 3 To 13        'always this many columns, always starts at 3

    If cell.Value <> 0 Then
        cell.Interior.ColorIndex = 6        'useful color changer to show progress and problem
        ActiveCell.Value = tbl.HeaderRowRange.Cells(1, cell.Column - tbl.Range.Column + 1).Value
        ActiveCell.Offset(0, 1).Select
        ActiveCell.Value = "Lot " & cell.Offset(0, -(cell.Column - 1)).Value    'Lot Number
        ActiveCell.Offset(1, 1).Select
        ActiveCell.Value = cell.Offset(0, -(cell.Column - 2)).Value & " M"      'Length
        ActiveCell.Offset(0, -1).Select
        ActiveCell.Value = Application.WorksheetFunction.Round(cell.Value, 0)   'Volume
        ActiveCell.Offset(1, 0).Select
        ActiveCell.Value = POD      'Disport
        ActiveCell.Offset(2, -1).Select  'move down a line and start again
    End If
    End Select
    Next cell
End Sub

Snapshot of issue: