问:
About the SQL first-in-first-out write-off quantity
At present, there are BOM and picking materials. According to the demand quantity of BOM and the principle of first-in-first-out, which picking materials are used by BOM, the currently conceivable solution is to use the cursor to judge the order line by line and record the number of write-offs. In relatively large cases, the execution efficiency is very low. Is there a more efficient solution?

IF OBJECT_ID('tempdb.dbo.#BOM') IS NOT NULL DROP TABLE #BOM
CREATE TABLE #BOM
(
    in_Code NVARCHAR(60),
    in_Date DATETIME,
    Orders NVARCHAR(60),
    BOM_materials NVARCHAR(60),
    in_Qty DECIMAL(18,4)
)
INSERT INTO #BOM
(in_Code, in_Date, Orders, BOM_materials, in_Qty)
VALUES (N'RK0001', '2022-03-08', N'A01', N'L01', 50),
       (N'RK0001', '2022-03-08', N'A01', N'L02', 30),
       (N'RK0002', '2022-03-15', N'A01', N'L01', 50)
SELECT * FROM #BOM
```
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>in_Code</th>
<th>in_Date</th>
<th>Orders</th>
<th>BOM_materials</th>
<th>in_Qty</th>
</tr>
</thead>
<tbody>
<tr>
<td>RK0001</td>
<td>2022-03-05</td>
<td>A01</td>
<td>L01</td>
<td>50</td>
</tr>
<tr>
<td>RK0001</td>
<td>2022-03-05</td>
<td>A01</td>
<td>L02</td>
<td>30</td>
</tr>
<tr>
<td>RK0002</td>
<td>2022-03-18</td>
<td>A01</td>
<td>L01</td>
<td>50</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<pre class="lang-sql prettyprint-override"><code>IF OBJECT_ID('tempdb.dbo.#picking') IS NOT NULL DROP TABLE #picking
CREATE TABLE #picking
(
    out_Code NVARCHAR(60),
    out_Date DATETIME,
    Orders NVARCHAR(60),
    materials NVARCHAR(60),
    out_Qty DECIMAL(18,4),
    out_ID BIGINT
)
INSERT INTO #picking
(out_Code, out_Date, Orders, materials, out_Qty, out_ID)
VALUES (N'CK0001', '2022-01-08', N'A01', N'L01', 90, 1),
       (N'CK0002', '2022-01-20', N'A01', N'L01', 70, 2),
       (N'CK0003', '2022-01-30', N'A01', N'L02', 10, 3)
SELECT * FROM #picking
</code>```

out_Code
out_Date
Orders
materials
out_Qty
out_ID

CK0001
2022-01-08
A01
L01
90
1

CK0002
2022-01-20
A01
L01
70
2

CK0003
2022-01-30
A01
L02
10
3

Desired result

in_Code
in_Date
Orders
BOM_materials
in_Qty
out_Code
out_Qty
need_Qty
out_id

RK0001
2022-03-05
A01
L01
50
CK0001
90
50
1

RK0001
2022-03-05
A01
L02
30
CK0003
10
10
3

RK0002
2022-03-18
A01
L01
50
CK0001
90
40
1

RK0002
2022-03-18
A01
L01
50
CK0002
70
10
2

My current solution,But the result is wrong。

SELECT A.in_Code, A.in_Date, A.Orders, A.BOM_materials, A.in_Qty, B.out_Code, B.out_Qty,
    CASE
            WHEN (
                    SELECT A.in_Qty - ( ISNULL(SUM(out_Qty),0) )
                    FROM #picking
                    WHERE Orders = A.Orders
                        AND materials = A.BOM_materials
                        AND out_Date <= B.out_Date
                    )
                    >= 0 THEN B.out_Qty
            ELSE
                CASE
                    WHEN (
                            SELECT A.in_Qty - ( ISNULL(SUM(out_Qty),0) )
                            FROM #picking
                            WHERE Orders = A.Orders
                                AND materials = A.BOM_materials
                                AND out_Date < B.out_Date
                            )
                            < 0 THEN 0
                        ELSE (
                                SELECT A.in_Qty - ( ISNULL(SUM(out_Qty),0) )
                                FROM #picking
                                WHERE Orders = A.Orders
                                    AND materials = A.BOM_materials
                                    AND out_Date < B.out_Date
                            )
                END
        END  AS need_Qty, B.out_ID
FROM #BOM A
    LEFT JOIN #picking B ON A.Orders = B.Orders AND A.BOM_materials = B.materials
```

Body:
At present, there are BOM and picking materials. According to the demand quantity of BOM and the principle of first-in-first-out, which picking materials are used by BOM, the currently conceivable solution is to use the cursor to judge the order line by line and record the number of write-offs. In relatively large cases, the execution efficiency is very low. Is there a more efficient solution?

IF OBJECT_ID('tempdb.dbo.#BOM') IS NOT NULL DROP TABLE #BOM
CREATE TABLE #BOM
(
    in_Code NVARCHAR(60),
    in_Date DATETIME,
    Orders NVARCHAR(60),
    BOM_materials NVARCHAR(60),
    in_Qty DECIMAL(18,4)
)
INSERT INTO #BOM
(in_Code, in_Date, Orders, BOM_materials, in_Qty)
VALUES (N'RK0001', '2022-03-08', N'A01', N'L01', 50),
       (N'RK0001', '2022-03-08', N'A01', N'L02', 30),
       (N'RK0002', '2022-03-15', N'A01', N'L01', 50)
SELECT * FROM #BOM

in_Code
in_Date
Orders
BOM_materials
in_Qty

RK0001
2022-03-05
A01
L01
50

RK0001
2022-03-05
A01
L02
30

RK0002
2022-03-18
A01
L01
50

IF OBJECT_ID('tempdb.dbo.#picking') IS NOT NULL DROP TABLE #picking
CREATE TABLE #picking
(
    out_Code NVARCHAR(60),
    out_Date DATETIME,
    Orders NVARCHAR(60),
    materials NVARCHAR(60),
    out_Qty DECIMAL(18,4),
    out_ID BIGINT
)
INSERT INTO #picking
(out_Code, out_Date, Orders, materials, out_Qty, out_ID)
VALUES (N'CK0001', '2022-01-08', N'A01', N'L01', 90, 1),
       (N'CK0002', '2022-01-20', N'A01', N'L01', 70, 2),
       (N'CK0003', '2022-01-30', N'A01', N'L02', 10, 3)
SELECT * FROM #picking

out_Code
out_Date
Orders
materials
out_Qty
out_ID

CK0001
2022-01-08
A01
L01
90
1

CK0002
2022-01-20
A01
L01
70
2

CK0003
2022-01-30
A01
L02
10
3

Desired result

in_Code
in_Date
Orders
BOM_materials
in_Qty
out_Code
out_Qty
need_Qty
out_id

RK0001
2022-03-05
A01
L01
50
CK0001
90
50
1

RK0001
2022-03-05
A01
L02
30
CK0003
10
10
3

RK0002
2022-03-18
A01
L01
50
CK0001
90
40
1

RK0002
2022-03-18
A01
L01
50
CK0002
70
10
2

My current solution,But the result is wrong。

SELECT A.in_Code, A.in_Date, A.Orders, A.BOM_materials, A.in_Qty, B.out_Code, B.out_Qty,
    CASE
            WHEN (
                    SELECT A.in_Qty - ( ISNULL(SUM(out_Qty),0) )
                    FROM #picking
                    WHERE Orders = A.Orders
                        AND materials = A.BOM_materials
                        AND out_Date <= B.out_Date
                    )
                    >= 0 THEN B.out_Qty
            ELSE
                CASE
                    WHEN (
                            SELECT A.in_Qty - ( ISNULL(SUM(out_Qty),0) )
                            FROM #picking
                            WHERE Orders = A.Orders
                                AND materials = A.BOM_materials
                                AND out_Date < B.out_Date
                            )
                            < 0 THEN 0
                        ELSE (
                                SELECT A.in_Qty - ( ISNULL(SUM(out_Qty),0) )
                                FROM #picking
                                WHERE Orders = A.Orders
                                    AND materials = A.BOM_materials
                                    AND out_Date < B.out_Date
                            )
                END
        END  AS need_Qty, B.out_ID
FROM #BOM A
    LEFT JOIN #picking B ON A.Orders = B.Orders AND A.BOM_materials = B.materials


来源: stackexchange

问:
Android | How to show the search item in the view without open the app
I want to show items same as in attached screenshot when I search any text if app is exist in the device may be it is the some part of matched content/deeplink/universal deeplink. Can anyone help me out about this particular spotlight in android does anyone has any idea about the implementation, any help with relevant articles or something would be highly appreciated. Thanks.

I find out this but its not expectations.
https://developer.android.com/develop/ui/views/search[enter image description here](https://i.stack.imgur.com/yYuWc.jpg)

ContentLicense: CC BY-SA 4.0


问:
Unity Breakpoint Debugging on Mac M1 does not detect iPad
I'm trying to setup my debugging pipeline to test my game on the iPad, but when I try to attach Visual Studio the iPad is not shown in VS. Interestingly the iPad is actually shown in the Unity Console when connected using a USB cable, and XCode both via USB and Wifi.

'Till now I failed to find propper instructions on how to fix this problem.

Mac Studio M1 Ultra

MacOS 13.0.1 (22A400)

Unity 2020.3.39f (intel); Unity 2022.2.0f1 (silicon)

XCode Version 14.1 (14B47b)

Visual Studio for Mac 17.4.1 (build 28)

iPad (10th Generation)

iPadOS 16.0; iPadOS 16.1.1

UPDATE:
There seems to be an issue with iOS 16, as this discussion in the unity-forum suggests. I checked that an an older iPhone with iOS 14.4 in indeed detected. Anyway, no solution to that problem yet...

ANOTHER UPDATE: Corresponding ticket on the Unity Issue Page:
https://issuetracker.unity3d.com/issues/managed-debugger-does-not-work-on-ios-16


问:
Setting up Spark and Icerberg on Jupyter Notebooks
I need help to setup spark and iceberg on Jupyter Notebooks, I followed this tutorial on my local but I can't replicate it on J Notebooks, please send any tutorials or walkarounds that you may know.

Thanks


问:
multiple drawers one on click with custom list and other on slide in react native
I have a main navigation drawer which directs to all the screens,and in one of the  screen i want a functionality when we click on a button,a new drawer should open from the left with custom list which comes from the api ,if i click on any of the item in the list,it should redirect to the  same screen with different props.how to solve this?should i have to use multiple navigation drawer or is there any other approach?

should i have to use multiple navigation drawer or is there any other approach?


问:
Matplotlib set colors based on values
I have a 2D numpy array containing values ranging from 0 to 4.
To make my graph more readable, I would like to assign colors according to the values in my numpy:
0: transparent (None) | 1: blue | 2: green | 3: red | 4: orange

I thought I had succeeded but my colors are random. And it is enough that a value is missing in my Numpy (no value 2) and that shifts everything :/

Do you have an idea ?
Here is my basic code to better understand the syntax

import numpy as np
import matplotlib.pyplot as plt

size= (601,1031)
coordinates = np.zeros(size)
#fill my Numpy with 1/2/3/4
coordinatesMRE = np.random.randint(0,5,(601,1031))

fig, ax = plt.subplots()
img = plt.imread("map.png") #Background img
ax.imshow(img, aspect='auto')
plt.axis('off')

plt.imshow(coordinatesMRE) #print color on my graph
```

Thank you in advance for your help !

Title: Matplotlib set colors based on values

Body:
I have a 2D numpy array containing values ranging from 0 to 4.
To make my graph more readable, I would like to assign colors according to the values in my numpy:
0: transparent (None) | 1: blue | 2: green | 3: red | 4: orange

I thought I had succeeded but my colors are random. And it is enough that a value is missing in my Numpy (no value 2) and that shifts everything :/

Do you have an idea ?
Here is my basic code to better understand the syntax

import numpy as np
import matplotlib.pyplot as plt

size= (601,1031)
coordinates = np.zeros(size)
#fill my Numpy with 1/2/3/4
coordinatesMRE = np.random.randint(0,5,(601,1031))

fig, ax = plt.subplots()
img = plt.imread("map.png") #Background img
ax.imshow(img, aspect='auto')
plt.axis('off')

plt.imshow(coordinatesMRE) #print color on my graph

Thank you in advance for your help !


问:
is it possible to know the importance of each word in a sentence?
I'm actually working on finding the topic of each sentence, i trained a BERT model and is working good and to improve the result i wanted to add weights for the words, i used at the beginning the tf-idf but i'm not getting the result i want..
For example Sentence='Morocco won the last match against Spain in the Worldcup in Qatar'
Expected output : Worldcup should have the highest weight, but in my case i got :

```<code>Word: Morocco, TF-IDF: 0.06758
Word: last, TF-IDF: 0.06758
Word: match, TF-IDF: 0.06758
Word: spain, TF-IDF: 0.06758

</code>```

If i got it correctly TF-IDF gives the weights by looking on how much every word has appeared on a sentence(TF) and how much that word has appeared on a document (IDF).. in my case i want to take also the context into consideration (the meaning of a sentence), the amount of accurence is not important but the relevance/meaning of the word is important , is that possible ?
Thank you :)

My tf-idf code is the following :

```<code>def tf(word, blob):
    return blob.words.count(word) / len(blob.words)

def n_containing(word, bloblist):
    return sum(1 for blob in bloblist if word in blob.words)

def idf(word, bloblist):
    return math.log(len(bloblist) / (1 + n_containing(word, bloblist)))

def tfidf(word, blob, bloblist):
    return tf(word, blob) * idf(word, bloblist)

document1 = "Morocco won the last match against spain in the worldcup in qatar"

document2 = "Python, from the Greek word (πύθων/πύθωνας), is a genus of nonvenomous pythons[2] found in Africa and Asia."

document3 = "The Colt Python is a .357 Magnum caliber revolver formerly manufactured by Colt's Manufacturing Company of Hartford, Connecticut."
token1=keywords(document1)
token2=keywords(document2)
token3=keywords(document3)

token1 = list(filter(lambda ele: re.search("[a-zA-Z\s]+", ele) is not None, token1))
token2 = list(filter(lambda ele: re.search("[a-zA-Z\s]+", ele) is not None, token2))
token3 = list(filter(lambda ele: re.search("[a-zA-Z\s]+", ele) is not None, token3))
s1 = ' '.join(token1)
s2 = ' '.join(token2)
s3 = ' '.join(token3)
bloblist = [tb(s1), tb(s2), tb(s3)]
for i, blob in enumerate(bloblist):
    print("Top words in document {}".format(i + 1))
    scores = {word: tfidf(word, blob, bloblist) for word in blob.words}
    sorted_words = sorted(scores.items(), key=lambda x: x[1], reverse=True)
    for word, score in sorted_words[:5]:
        print("\tWord: {}, TF-IDF: {}".format(word, round(score, 5)))
</code>```

Body:
I'm actually working on finding the topic of each sentence, i trained a BERT model and is working good and to improve the result i wanted to add weights for the words, i used at the beginning the tf-idf but i'm not getting the result i want..
For example Sentence='Morocco won the last match against Spain in the Worldcup in Qatar'
Expected output : Worldcup should have the highest weight, but in my case i got :

Word: Morocco, TF-IDF: 0.06758
Word: last, TF-IDF: 0.06758
Word: match, TF-IDF: 0.06758
Word: spain, TF-IDF: 0.06758

If i got it correctly TF-IDF gives the weights by looking on how much every word has appeared on a sentence(TF) and how much that word has appeared on a document (IDF).. in my case i want to take also the context into consideration (the meaning of a sentence), the amount of accurence is not important but the relevance/meaning of the word is important , is that possible ?
Thank you :)

My tf-idf code is the following :

def tf(word, blob):
    return blob.words.count(word) / len(blob.words)

def n_containing(word, bloblist):
    return sum(1 for blob in bloblist if word in blob.words)

def idf(word, bloblist):
    return math.log(len(bloblist) / (1 + n_containing(word, bloblist)))

def tfidf(word, blob, bloblist):
    return tf(word, blob) * idf(word, bloblist)

document1 = "Morocco won the last match against spain in the worldcup in qatar"

document2 = "Python, from the Greek word (πύθων/πύθωνας), is a genus of nonvenomous pythons[2] found in Africa and Asia."

document3 = "The Colt Python is a .357 Magnum caliber revolver formerly manufactured by Colt's Manufacturing Company of Hartford, Connecticut."
token1=keywords(document1)
token2=keywords(document2)
token3=keywords(document3)

token1 = list(filter(lambda ele: re.search("[a-zA-Z\s]+", ele) is not None, token1))
token2 = list(filter(lambda ele: re.search("[a-zA-Z\s]+", ele) is not None, token2))
token3 = list(filter(lambda ele: re.search("[a-zA-Z\s]+", ele) is not None, token3))
s1 = ' '.join(token1)
s2 = ' '.join(token2)
s3 = ' '.join(token3)
bloblist = [tb(s1), tb(s2), tb(s3)]
for i, blob in enumerate(bloblist):
    print("Top words in document {}".format(i + 1))
    scores = {word: tfidf(word, blob, bloblist) for word in blob.words}
    sorted_words = sorted(scores.items(), key=lambda x: x[1], reverse=True)
    for word, score in sorted_words[:5]:
        print("\tWord: {}, TF-IDF: {}".format(word, round(score, 5)))


问:
Twice linear kata on codewars Python
I am solving 'Twice linear' kata on Codewars

It goes so:

Consider a sequence u where u is defined as follows:

The number u(0) = 1 is the first one in u.
For each x in u, then y = 2 * x + 1 and z = 3 * x + 1 must be in u too.
There are no other numbers in u.

Ex: u = [1, 3, 4, 7, 9, 10, 13, 15, 19, 21, 22, 27, ...]

1 gives 3 and 4, then 3 gives 7 and 10, 4 gives 9 and 13, then 7 gives 15 and 22 and so on...

Task:

Given parameter n the function dbl_linear (or dblLinear...) returns the element u(n) of the ordered (with <) sequence u (so, there are no duplicates).

Example:

dbl_linear(10) should return 22

I made a solution

```<code>def dbl_linear(n):
    u_list= [1]
    for i in range(0, n+1):
        u_list.append(u_list[i] * 2 + 1)
        u_list.append(u_list[i] * 3 + 1)
        u_list= sorted(set(u_list))
    return u_list[n]
</code>```

it works, but when it goes to 6 figure numbers time runs out

how can i optimize this solution?

if sorting is out of loop its making wrong numbers after like 200 so it probably beeds to be in
And its still runs out of time

Title: Twice linear kata on codewars Python

Body:
I am solving 'Twice linear' kata on Codewars

It goes so:

Consider a sequence u where u is defined as follows:

The number u(0) = 1 is the first one in u.
For each x in u, then y = 2 * x + 1 and z = 3 * x + 1 must be in u too.
There are no other numbers in u.

Ex: u = [1, 3, 4, 7, 9, 10, 13, 15, 19, 21, 22, 27, ...]

1 gives 3 and 4, then 3 gives 7 and 10, 4 gives 9 and 13, then 7 gives 15 and 22 and so on...

Task:

Given parameter n the function dbl_linear (or dblLinear...) returns the element u(n) of the ordered (with <) sequence u (so, there are no duplicates).

Example:

dbl_linear(10) should return 22

I made a solution

def dbl_linear(n):
    u_list= [1]
    for i in range(0, n+1):
        u_list.append(u_list[i] * 2 + 1)
        u_list.append(u_list[i] * 3 + 1)
        u_list= sorted(set(u_list))
    return u_list[n]

it works, but when it goes to 6 figure numbers time runs out

how can i optimize this solution?

if sorting is out of loop its making wrong numbers after like 200 so it probably beeds to be in
And its still runs out of time


问:
Can I save timestamp in a video file on Android?
Now, I am trying to create a video recording application, I am going to use Image analysis of CameraX.(Why not video capture? I think video capture can not save the timestamp of every frame)

Have any way save fame with timestamp from Image analysis?

Thanks


问:
How to select iOS App build for macOS app?
When developing you can use Mac (Designed for iPad) which is running on iOS. When archiving I'm using "Any iOS device (arm64)". In the targets section in Xcode I have selected the iOS SDK for Mac (Designed for iPad).

In the iOS-App tab it lets me select a build I have uploaded. In the macOS tab it tells me I have to upload a build. So why can I not select an iOS build when submitting to the app store?

For some reason it's impossible to find any information on this. What am I supposed to do?


问:
Eclipse Link MongoDB datasource Configuration in Spring Boot
How to configure JDBC MongoDB datasource with Eclipse Link in Spring Boot application without below mongodb starter dependency spring-boot-starter-data-mongodb

Added below dependencies in pom.xml

```<code><properties>
    <java.version>17</java.version>
    <org.eclipse.persistence.version>2.7.11</org.eclipse.persistence.version>
</properties>

 <dependency>
        <groupId>org.mongodb</groupId>
        <artifactId>mongo-java-driver</artifactId>
        <version>3.12.11</version>
    </dependency>

    <dependency>
        <groupId>org.mongodb</groupId>
        <artifactId>mongodb-jdbc</artifactId>
        <version>2.0.1</version>
    </dependency>

    <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>org.eclipse.persistence.jpa</artifactId>
        <!-- <version>4.0.0</version> -->
        <version>${org.eclipse.persistence.version}</version>
        <!-- <version>2.7.11</version> -->
    </dependency>
    <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>eclipselink</artifactId>
        <!-- <version>2.4.2-SNAPSHOT</version> -->
        <version>${org.eclipse.persistence.version}</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>org.eclipse.persistence.nosql</artifactId>
        <!-- <version>2.4.2-SNAPSHOT</version> -->
        <version>${org.eclipse.persistence.version}</version>
    </dependency>
</code>```

Body:
How to configure JDBC MongoDB datasource with Eclipse Link in Spring Boot application without below mongodb starter dependency spring-boot-starter-data-mongodb

Added below dependencies in pom.xml

<properties>
    <java.version>17</java.version>
    <org.eclipse.persistence.version>2.7.11</org.eclipse.persistence.version>
</properties>

 <dependency>
        <groupId>org.mongodb</groupId>
        <artifactId>mongo-java-driver</artifactId>
        <version>3.12.11</version>
    </dependency>

    <dependency>
        <groupId>org.mongodb</groupId>
        <artifactId>mongodb-jdbc</artifactId>
        <version>2.0.1</version>
    </dependency>

    <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>org.eclipse.persistence.jpa</artifactId>

        <version>${org.eclipse.persistence.version}</version>

    </dependency>
    <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>eclipselink</artifactId>

        <version>${org.eclipse.persistence.version}</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>org.eclipse.persistence.nosql</artifactId>

        <version>${org.eclipse.persistence.version}</version>
    </dependency>


问:
mongoose-paginate-v2, search inside populated object
I have a Model called issues, its kind of a support ticket and have a Model client-project model, clientProjectId attribute in the issues model referenced to the client-project Model.

```<code>const issues = await issueModel.paginate(
  {
    title: { $regex: search, $options: 'i' },
    description: { $regex: search, $options: 'i' },
  },
  {
    page,
    limit,
    sort,
    populate: 'clientProjectId',
  },
);
</code>```

I want to filter the data by populated object _id attribute.

The Goal is get issues by specific client-project

Body:
I have a Model called issues, its kind of a support ticket and have a Model client-project model, clientProjectId attribute in the issues model referenced to the client-project Model.

const issues = await issueModel.paginate(
  {
    title: { $regex: search, $options: 'i' },
    description: { $regex: search, $options: 'i' },
  },
  {
    page,
    limit,
    sort,
    populate: 'clientProjectId',
  },
);

I want to filter the data by populated object _id attribute.

The Goal is get issues by specific client-project


问:
Add custom legend for two variables from the same data set in R
I tried to add custom legend into my R plot that uses same x value but two different y values. I used the approach from the following post but it does not work:

Custom legend for multiple layer ggplot

```<code>ggplot(combo_plot, aes(x))+
  geom_point(aes(y=y1),size=2,color="black")+
  geom_point(aes(y=y2),size=2,color="red")+
  coord_cartesian(xlim = c(0,1.25),ylim=c(200,450)) +
  scale_x_continuous(breaks = seq(0,1.25,0.25), minor_breaks = seq(0,1.5,0.25),expand = c(0, 0)) +
  scale_y_continuous(breaks = seq(200,450,25), minor_breaks = seq(200,450,25),expand = c(0, 0)) +
  scale_colour_manual(name = 'the colour',
                      values =c('black'='black','red'='red'), labels = c('c2','c1'))+
  theme(plot.title = element_text(family = "GE Inspira", color="#666666", face="bold", size=16, hjust=0.5))+
  theme(axis.title = element_text(family = "GE Inspira", color="#666666", face="bold", size=12, hjust=0.5))
</code>```

Any idea why it does not work in this case?

Body:
I tried to add custom legend into my R plot that uses same x value but two different y values. I used the approach from the following post but it does not work:

Custom legend for multiple layer ggplot

ggplot(combo_plot, aes(x))+
  geom_point(aes(y=y1),size=2,color="black")+
  geom_point(aes(y=y2),size=2,color="red")+
  coord_cartesian(xlim = c(0,1.25),ylim=c(200,450)) +
  scale_x_continuous(breaks = seq(0,1.25,0.25), minor_breaks = seq(0,1.5,0.25),expand = c(0, 0)) +
  scale_y_continuous(breaks = seq(200,450,25), minor_breaks = seq(200,450,25),expand = c(0, 0)) +
  scale_colour_manual(name = 'the colour',
                      values =c('black'='black','red'='red'), labels = c('c2','c1'))+
  theme(plot.title = element_text(family = "GE Inspira", color="#666666", face="bold", size=16, hjust=0.5))+
  theme(axis.title = element_text(family = "GE Inspira", color="#666666", face="bold", size=12, hjust=0.5))

Any idea why it does not work in this case?


问:
Creating xr.DataArray with dask.delayed coordinates
I am trying to create a xr.DataArray from the output of dask.delayed. Both the data and its coordinates are read from file in the same call to the delayed function, therefore the coordinates are not known until computation happens. Both data and coordinates have np.nan lenght, since the length cannot be known until I open the file.

When i try to construct the DataArray with:

```<code>data_array = xr.DataArray(delayed_values, dims=['pulseId'],
                                          coords=[delayed_coords])
</code>```

xarray triggers the computation on delayed_coords and I get this error:

```<code>ValueError: conflicting sizes for dimension 'pulseId': length nan on the data but length 102 on coordinate 'pulseId'
</code>```

Since the delayed_values dimension is still np.nan but the coordinates dimension has been computed.

Is there a way to tell xarray not to compute the result for the coordinates and treat it as a delayed array?

Thanks a lot!

Body:
I am trying to create a xr.DataArray from the output of dask.delayed. Both the data and its coordinates are read from file in the same call to the delayed function, therefore the coordinates are not known until computation happens. Both data and coordinates have np.nan lenght, since the length cannot be known until I open the file.

When i try to construct the DataArray with:

data_array = xr.DataArray(delayed_values, dims=['pulseId'],
                                          coords=[delayed_coords])

xarray triggers the computation on delayed_coords and I get this error:

ValueError: conflicting sizes for dimension 'pulseId': length nan on the data but length 102 on coordinate 'pulseId'

Since the delayed_values dimension is still np.nan but the coordinates dimension has been computed.

Is there a way to tell xarray not to compute the result for the coordinates and treat it as a delayed array?

Thanks a lot!


问:
How to Reuse the api gate TokenAuthorizer
I want to reuse the TokenAuthorizer which I have created in another stack.  If a do the below it gives an error that it already exists, and if I change the authorizerName it creates a new one.

Is there a way I can reuse this resource?

```<code>const authzHandler = lambda.Function.fromFunctionName(this, 'AuthHandlerLookup', 'auth-handler');

const authorizer = new apigateway.TokenAuthorizer(this, 'WebApiTokenAuthorizer', {
      handler: authzHandler,
      resultsCacheTtl: Duration.seconds(600),
      authorizerName: 'test-Authorizer',
      assumeRole: lambdaExecutionRole
    });

test.addMethod('GET', new apigateway.LambdaIntegration(TestLambda , { proxy: true }),
    {
      authorizer
    }
</code>```

i am able to get the authorizer information in cli , but now sure how to do the same using cdk

aws apigateway get-authorizer --rest-api-id wrrt25mzme0m --authorizer-id vffawds

Body:
I want to reuse the TokenAuthorizer which I have created in another stack.  If a do the below it gives an error that it already exists, and if I change the authorizerName it creates a new one.

Is there a way I can reuse this resource?

const authzHandler = lambda.Function.fromFunctionName(this, 'AuthHandlerLookup', 'auth-handler');

const authorizer = new apigateway.TokenAuthorizer(this, 'WebApiTokenAuthorizer', {
      handler: authzHandler,
      resultsCacheTtl: Duration.seconds(600),
      authorizerName: 'test-Authorizer',
      assumeRole: lambdaExecutionRole
    });

test.addMethod('GET', new apigateway.LambdaIntegration(TestLambda , { proxy: true }),
    {
      authorizer
    }

i am able to get the authorizer information in cli , but now sure how to do the same using cdk

aws apigateway get-authorizer --rest-api-id wrrt25mzme0m --authorizer-id vffawds


问:
T-SQL function 'json_object' not supported in Visual Studio / SSDT?
Visual Studio will no longer build a project since I started using the json_object function.

Code sample:

```<code>declare @j varchar(max) = json_object(
    'key1': 'value1',
    'key2': 'value2'
)
</code>```

This works fine in Azure SQL DB.

When I update the database to my SSDT project, the project will not build, throwing a bunch of errors.

```<code>SQL46010: Incorrect syntax near 'key1'.`, `SQL80001: Incorrect syntax near ':'.
SQL80001: Incorrect syntax near ','.
SQL80001: Incorrect syntax near ','.
SQL80001: Incorrect syntax near ')'.  Expecting '(', or SELECT.
</code>```

I updated Visual Studio and SSDT to the latest versions. SSDT is version 1.4.

Is there any way I can update or configure Visual Studio to the latest SQL version? If not, can I get Visual Studio to suppress the errors linked to json_object so building and publishing will succeed?

Body:
Visual Studio will no longer build a project since I started using the json_object function.

Code sample:

declare @j varchar(max) = json_object(
    'key1': 'value1',
    'key2': 'value2'
)

This works fine in Azure SQL DB.

When I update the database to my SSDT project, the project will not build, throwing a bunch of errors.

SQL46010: Incorrect syntax near 'key1'.`, `SQL80001: Incorrect syntax near ':'.
SQL80001: Incorrect syntax near ','.
SQL80001: Incorrect syntax near ','.
SQL80001: Incorrect syntax near ')'.  Expecting '(', or SELECT.

I updated Visual Studio and SSDT to the latest versions. SSDT is version 1.4.

Is there any way I can update or configure Visual Studio to the latest SQL version? If not, can I get Visual Studio to suppress the errors linked to json_object so building and publishing will succeed?


问:
Recyclerview crop last and first items shadow
Recyclerview crop first and last items shadows and i cant't fix it with any attributes.
I have a such xml screen:

```<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"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".screens.view.CreateRequestFragment">

    <ScrollView
        android:id="@+id/createRequestScrollView"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        app:layout_constraintBottom_toTopOf="@+id/sendRequestButton"
        app:layout_constraintEnd_toEndOf="parent"
        android:background="@color/transparent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <!-- ... some elements inside scrollview -->

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/usersRecyclerView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/margin_m"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/selectUsersTitle" />
        </androidx.constraintlayout.widget.ConstraintLayout>
    </ScrollView>

    <Button
        android:id="@+id/sendRequestButton"
        style="@style/OnDutyButtonStart"
        android:text="Send Request"
        android:layout_margin="@dimen/margin_m"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        tools:text="Send Request" />
</androidx.constraintlayout.widget.ConstraintLayout>
</code>```

In this case i get cropped last and first items shadows:

but i need it like this:

If i add margin or padding - i get the same with blank white space and always cropped shadows.

Body:
Recyclerview crop first and last items shadows and i cant't fix it with any attributes.
I have a such xml screen:

<?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"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".screens.view.CreateRequestFragment">

    <ScrollView
        android:id="@+id/createRequestScrollView"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        app:layout_constraintBottom_toTopOf="@+id/sendRequestButton"
        app:layout_constraintEnd_toEndOf="parent"
        android:background="@color/transparent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/usersRecyclerView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/margin_m"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/selectUsersTitle" />
        </androidx.constraintlayout.widget.ConstraintLayout>
    </ScrollView>

    <Button
        android:id="@+id/sendRequestButton"
        style="@style/OnDutyButtonStart"
        android:text="Send Request"
        android:layout_margin="@dimen/margin_m"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        tools:text="Send Request" />
</androidx.constraintlayout.widget.ConstraintLayout>

In this case i get cropped last and first items shadows:

but i need it like this:

If i add margin or padding - i get the same with blank white space and always cropped shadows.


问:
GooglePlay closed beta, can I add a tester to 2 tracks, for example, a tester starts on track A (version 1.0)
GooglePlay closed beta, can I add a tester to 2 tracks, for example, a tester starts on track A (version 1.0), and after a few days, I add the same tester to track B (version 2.0) Can he receive the latest version 2.0 update prompt? Or can he only see the A track version forever

What I want is that testers can see the latest version 2.0, but it doesn't work


问:
GTM - how to capture click event on button and change it's behavior
I've searched a lot, read the docs but all I found on this issue refers to analytics and following, counting clicks only.

But the thing I need to do is to change the behavior of one of the buttons on the website, so that when user clicks on one product card's 'buy' button, the gtm would capture this click and redirect the user to another url instead of adding the product to cart (default behavior).

The reason I need to do it thru gtm and not by changing frontend code directly is the long release cycle of our product (2 weeks), but we need to change button behavior for several days only, check reactions and than cancel it.

Is it possible to do at all with gtm and what should I add there (trigger / tag)? Do I need to write special script for this or is it possible to do by native gtm functions?


问:
JavaFx application under Ubuntu 22.04 window twitches briefly
Under Ubuntu 22.04 there is a strange behavior of a JavaFx application. When a new window or message box is opened, the window and message box twitches briefly. Also, an open menu detaches from the window when it is moved.

What can be done about this?

See webm: https://webm.red/view/pKM7.webm

```<code>import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

import java.io.IOException;

public class Application extends javafx.application.Application {
    @Override
    public void start(Stage stage) throws IOException {
        MenuBar menuBar = new MenuBar();
        Menu menu = new Menu("Menu");
        MenuItem menuItem1 = new MenuItem("MenuItem 1");
        MenuItem menuItem2 = new MenuItem("MenuItem 2");
        menuBar.getMenus().add(menu);
        menu.getItems().addAll(menuItem1, menuItem2);
        menuBar.setPrefHeight(30d);
        Button button = new Button("Messagebox");
        button.prefWidth(100d);
        button.prefHeight(30d);
        button.setOnAction(actionEvent -> {
            Alert alert = new Alert(Alert.AlertType.INFORMATION);
            alert.setTitle("Messagebox");
            alert.setHeaderText(null);
            alert.setContentText("Message...");
            alert.showAndWait();
        });
        StackPane stackPane = new StackPane(button);
        stackPane.setPadding(new Insets(50));
        VBox vbox = new VBox();
        vbox.getChildren().add(menuBar);
        vbox.getChildren().add(stackPane);
        Scene scene = new Scene(vbox);
        stage.setWidth(500);
        stage.setHeight(400);
        stage.setTitle("Hello!");
        stage.setScene(scene);
        stage.show();
    }

    public static void main(String[] args) {
        launch();
    }
}
</code>```

On Lubuntu 22.04 and on Windows 10 the application behaves normally.

Body:
Under Ubuntu 22.04 there is a strange behavior of a JavaFx application. When a new window or message box is opened, the window and message box twitches briefly. Also, an open menu detaches from the window when it is moved.

What can be done about this?

See webm: https://webm.red/view/pKM7.webm

import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

import java.io.IOException;

public class Application extends javafx.application.Application {
    @Override
    public void start(Stage stage) throws IOException {
        MenuBar menuBar = new MenuBar();
        Menu menu = new Menu("Menu");
        MenuItem menuItem1 = new MenuItem("MenuItem 1");
        MenuItem menuItem2 = new MenuItem("MenuItem 2");
        menuBar.getMenus().add(menu);
        menu.getItems().addAll(menuItem1, menuItem2);
        menuBar.setPrefHeight(30d);
        Button button = new Button("Messagebox");
        button.prefWidth(100d);
        button.prefHeight(30d);
        button.setOnAction(actionEvent -> {
            Alert alert = new Alert(Alert.AlertType.INFORMATION);
            alert.setTitle("Messagebox");
            alert.setHeaderText(null);
            alert.setContentText("Message...");
            alert.showAndWait();
        });
        StackPane stackPane = new StackPane(button);
        stackPane.setPadding(new Insets(50));
        VBox vbox = new VBox();
        vbox.getChildren().add(menuBar);
        vbox.getChildren().add(stackPane);
        Scene scene = new Scene(vbox);
        stage.setWidth(500);
        stage.setHeight(400);
        stage.setTitle("Hello!");
        stage.setScene(scene);
        stage.show();
    }

    public static void main(String[] args) {
        launch();
    }
}

On Lubuntu 22.04 and on Windows 10 the application behaves normally.


问:
How do I play audio in soundtouch?
How can I play audio using soundtouch? I tried for a long time to find the answer on the Internet, but I couldn't find anything. Forgive me if the answer lies on the surface. It would also be cool to understand how to change the playback speed of an audio file.</p>

Title: How do I play audio in soundtouch?


问:
Animation changes transform when entering game mode
In my Unity 3D project I've added an animated body as a child to the Player object. The player moves as is should, with the right animations displaying for each key. The problem however is that the transform of the child changes when I enter game mode, meaning the character is walking above the ground. In scene mode it's relative to it's parent, it's grounded, but when I switch to game mode the character suddenly changes it's y-axis transform. I also checked the inspector for this object, it's y-axis changes.

I tried disabling the movement script, to check if this could have anything to do with it, but nothing changes. The transform still changes. I'm new to this problem, and every thread I've found on the topic hasn't helped much. Does anyone know what might cause this?

The hierarchy. mixamorig:Hips is the one changing it's transform. The animations and animation skin I'm using is from Mixamo.


问:
Expose the swagger generation route(s) in the swagger.json with Swashbuckle
I am trying to expose the routes which give back the swagger.json documents for an ASP.Net 6 web api, in the generated swagger.json itself.
I just need to see the swagger generation route used to generate the JSON document, alongside the other endpoints of my API.

I tried both app.UseSwagger and app.MapSwagger but the route template (containing the {documentName} token) never make its way to the Operations parsed by Swashbuckle.

How can I achieve this goal ?

Thx !


问:
UI automation defined in XAML file
I am trying to make Ui automation, I want to extract the workflow from the XAML file and execute it.
I searched how to use Microsoft libraries in .NET to make such UI automation, but I cannot find a solution</p>

Title: UI automation defined in XAML file


问:
Images will be lost and blank when using the openseadragon filtering plug-in
I'm a user of openseadragon. When I use the openseadragon filtering plug-in, some images on the page will be lost and the blank console will output Ignoring tile 8/0_ 0 loaded before reset:xxx.jpg
like this

I have searched a lot. The openseadragon Filtering plug-in demo does not have this problem, but its demo does not have a solution to this problem
demo I need help


问:
How can I make a button navigate my page to a text field on a page when I click edit in .net maui

await Shell.Current.GoToAsync(nameof(CarPage), true, new Dictionary<string, object> { { nameof(CarItems),carItem }});
```
<p>this removes the car details but goes on to edit the car parts, I want it to keep current car details but allow me to edit the parts</p>
<pre class="lang-cs prettyprint-override"><code>await Shell.Current.GoToAsync(nameof(CarPage), true, new Dictionary<string, object> { { nameof(CarItems),carItem }});
</code>```

this navigates to car page, and goes to the edit car item but it removes the car details

Body:
await Shell.Current.GoToAsync(nameof(CarPage), true, new Dictionary<string, object> { { nameof(CarItems),carItem }});

this removes the car details but goes on to edit the car parts, I want it to keep current car details but allow me to edit the parts

await Shell.Current.GoToAsync(nameof(CarPage), true, new Dictionary<string, object> { { nameof(CarItems),carItem }});

this navigates to car page, and goes to the edit car item but it removes the car details


问:
FB Prophet: Does add_regressor() use historic values of the regressors in its forecast?
From the documentation:
https://facebook.github.io/prophet/docs/seasonality,_holiday_effects,_and_regressors.html#additional-regressors

The only sentence in the documentation I can find regarding this is here:

```<code>"The extra regressor must be known for both the history and for future dates."
</code>```

And then it mostly goes on about how it uses the future values of the regressor to predict the target variable.
But it doesn't specify if and how it uses the historical values of the regressors.

This leads me to consider / question if I should add the lagged values of the regressors as extra input parameters to the model to make sure it uses the historical values of the regressors as input?

What I can find about the target variable is more clear:

Source: https://facebook.github.io/prophet/docs/quick_start.html#python-api:

```<code>  By default it will also include the dates from the history, so we will see the model fit as well.
</code>```

'it' referring to the target variable.

Body:
From the documentation:
https://facebook.github.io/prophet/docs/seasonality,_holiday_effects,_and_regressors.html#additional-regressors

The only sentence in the documentation I can find regarding this is here:

"The extra regressor must be known for both the history and for future dates."

And then it mostly goes on about how it uses the future values of the regressor to predict the target variable.
But it doesn't specify if and how it uses the historical values of the regressors.

This leads me to consider / question if I should add the lagged values of the regressors as extra input parameters to the model to make sure it uses the historical values of the regressors as input?

What I can find about the target variable is more clear:

Source: https://facebook.github.io/prophet/docs/quick_start.html#python-api:

  By default it will also include the dates from the history, so we will see the model fit as well.

'it' referring to the target variable.


问:
Random Network error on API call (axios post)
This is on a vuejs project, I use axios to make API calls.

I have the following API call :

```<code>await axios.post(`https://my-api.com/client/upload`,
    formData,
    { headers: { 'Content-Type': 'multipart/form-data' }, withCredentials: true })
</code>```

formData contains a pdf file.

And sometimes we get a Network error. This is the exception :

```<code>{
 "message" : "Network Error",
 "name": "Error",
 "stack": "Error: Network Error\n
   at t.exports (https://my-site.com/_nuxt/c3e2d4e.js:2:210975)\n
   at w.onerror (https://my-site.com/_nuxt/c3e2d4e.js:2:209955)",
 "config" : {
   "url":"https://my-api.com/client/upload",
   "method":"post","data":{},"headers":{"Accept":"application/json, text/plain, */*"},
   "transformRequest":[null],"transformResponse":[null],"timeout":0,"withCredentials":true,
   "xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1
   }
 }
</code>```

From what I see I get this error when a client tries to upload a specific file. They try several times with one file and it never works but if they switch device it works (with the same file). May be a false lead but that's what I can see from the logs.
Any idea how I can improve my logs to see the root of the problem ?

Body:
This is on a vuejs project, I use axios to make API calls.

I have the following API call :

await axios.post(`https://my-api.com/client/upload`,
    formData,
    { headers: { 'Content-Type': 'multipart/form-data' }, withCredentials: true })

formData contains a pdf file.

And sometimes we get a Network error. This is the exception :

{
 "message" : "Network Error",
 "name": "Error",
 "stack": "Error: Network Error\n
   at t.exports (https://my-site.com/_nuxt/c3e2d4e.js:2:210975)\n
   at w.onerror (https://my-site.com/_nuxt/c3e2d4e.js:2:209955)",
 "config" : {
   "url":"https://my-api.com/client/upload",
   "method":"post","data":{},"headers":{"Accept":"application/json, text/plain, */*"},
   "transformRequest":[null],"transformResponse":[null],"timeout":0,"withCredentials":true,
   "xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1
   }
 }

From what I see I get this error when a client tries to upload a specific file. They try several times with one file and it never works but if they switch device it works (with the same file). May be a false lead but that's what I can see from the logs.
Any idea how I can improve my logs to see the root of the problem ?


问:
scraping of target href not possible, result is undefined
I'm trying to scrape a href attribute from Google images. My code looks fine, but something seems to be wrong. I'm posting a screenshot of it, because there is a lot of unnecessary code from Google itself.

My goal is to reach the href of the first "a" class "wXeWr.islib.nfEiy". But everything I get as a result is undefined. If I'm doing the same with the lower href from the "a" class ="VFACy..." everything works fine. Seems like I can't reach the attribute of the first a class. But why?

This is my code for scraping all href in "MSM1fd" class

async function collectURLs(){
    let header = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36"
    };

    return unirest
        .get(URL)
        .headers(header)
            .then((response) => {
                let $ = cheerio.load(response.body);
                const images_results = [];

                $(".isrlc").each((i,el) => {
                    $(el).find("a").each(function(i, link){
                        console.log($(link).attr('href'), true);
                })
            })
        });
}```
</div>
</div>
</p>
<p>A result is for example looking like this:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>undefined true  #seems to be the first href
https://tempsens.com/utility-pressure-gauge.html true #2nd href</code>```

Body:
I'm trying to scrape a href attribute from Google images. My code looks fine, but something seems to be wrong. I'm posting a screenshot of it, because there is a lot of unnecessary code from Google itself.

My goal is to reach the href of the first "a" class "wXeWr.islib.nfEiy". But everything I get as a result is undefined. If I'm doing the same with the lower href from the "a" class ="VFACy..." everything works fine. Seems like I can't reach the attribute of the first a class. But why?

This is my code for scraping all href in "MSM1fd" class

async function collectURLs(){
    let header = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36"
    };

    return unirest
        .get(URL)
        .headers(header)
            .then((response) => {
                let $ = cheerio.load(response.body);
                const images_results = [];

                $(".isrlc").each((i,el) => {
                    $(el).find("a").each(function(i, link){
                        console.log($(link).attr('href'), true);
                })
            })
        });
}

A result is for example looking like this:

undefined true  #seems to be the first href
https://tempsens.com/utility-pressure-gauge.html true #2nd href


问:
Basic question about using PowerShell to modify user assignments in SSRS
I have somple experience in PowerShell but I don't have experience in using it to automate SQL Server Reporting Service. Basically I want to assign a user a role to a particular report object in SSRS. I have found the following codes in

SSRS: How to assign multiple users a role to a report quickly?

It seems a good start for creating my script.

```<code>function Add-SSRSUserRole
(
    [string]$reportServerUrl,[string]$userGroup,[string]$requiredRole,[string]$folder,[bool]$inheritFromParent
)
{
    #Ensure we stop on errors
    $ErrorActionPreference = "Stop";
    #Connect to the SSRS webservice
    $ssrs = New-WebServiceProxy -Uri "$reportServerUrl" -UseDefaultCredential;
    $namespace = $ssrs.GetType().Namespace;
    $changesMade = $false;

    #Look for a matching policy
    $policies = $ssrs.GetPolicies($folder, [ref]$inheritFromParent);
    if ($policies.GroupUserName -contains $userGroup)
    {
        Write-Host "User/Group already exists. Using existing policy.";
        $policy = $policies | where {$_.GroupUserName -eq $userGroup} | Select -First 1 ;
    }
    else
    {
        #A policy for the User/Group needs to be created
        Write-Host "User/Group was not found. Creating new policy.";
        $policy = New-Object -TypeName ($namespace + '.Policy');
        $policy.GroupUserName = $userGroup;
        $policy.Roles = @();
        $policies += $policy;
        $changesMade = $true;
    }

    #Now we have the policy, look for a matching role
    $roles = $policy.Roles;
    if (($roles.Name -contains $requiredRole) -eq $false)
    {
        #A role for the policy needs to added
        Write-Host "Policy doesn't contain specified role. Adding.";
        $role = New-Object -TypeName ($namespace + '.Role');
        $role.Name = $requiredRole;
        $policy.Roles += $role;
        $changesMade = $true;
    }
    else
    {
        Write-Host "Policy already contains specified role. No changes required.";
    }

    #If changes were made...
    if ($changesMade)
    {
        #...save them to SSRS
        Write-Host "Saving changes to SSRS.";
        $ssrs.SetPolicies($folder, $policies);
    }
    Write-Host "Complete.";
}

[string]$url = "http://localhost/ReportServer/ReportService2006.asmx?wsdl";
Add-SSRSUserRole $url "Everyone" "Browser" "/MyReportFolder" $true;
Add-SSRSUserRole $url "Domain\User" "Browser" "/MyReportFolder" $true;
</code>```

Now I have two elementary questions:

Do I need any SSRS modules to be installed in my PowerShell in order to run the above script?

The sample code above assign a permission to a folder. What changes are required if I want to assign permissions to a report object directly instead?

Thanks for your response in advance,

Body:
I have somple experience in PowerShell but I don't have experience in using it to automate SQL Server Reporting Service. Basically I want to assign a user a role to a particular report object in SSRS. I have found the following codes in

SSRS: How to assign multiple users a role to a report quickly?

It seems a good start for creating my script.

function Add-SSRSUserRole
(
    [string]$reportServerUrl,[string]$userGroup,[string]$requiredRole,[string]$folder,[bool]$inheritFromParent
)
{
    #Ensure we stop on errors
    $ErrorActionPreference = "Stop";
    #Connect to the SSRS webservice
    $ssrs = New-WebServiceProxy -Uri "$reportServerUrl" -UseDefaultCredential;
    $namespace = $ssrs.GetType().Namespace;
    $changesMade = $false;

    #Look for a matching policy
    $policies = $ssrs.GetPolicies($folder, [ref]$inheritFromParent);
    if ($policies.GroupUserName -contains $userGroup)
    {
        Write-Host "User/Group already exists. Using existing policy.";
        $policy = $policies | where {$_.GroupUserName -eq $userGroup} | Select -First 1 ;
    }
    else
    {
        #A policy for the User/Group needs to be created
        Write-Host "User/Group was not found. Creating new policy.";
        $policy = New-Object -TypeName ($namespace + '.Policy');
        $policy.GroupUserName = $userGroup;
        $policy.Roles = @();
        $policies += $policy;
        $changesMade = $true;
    }

    #Now we have the policy, look for a matching role
    $roles = $policy.Roles;
    if (($roles.Name -contains $requiredRole) -eq $false)
    {
        #A role for the policy needs to added
        Write-Host "Policy doesn't contain specified role. Adding.";
        $role = New-Object -TypeName ($namespace + '.Role');
        $role.Name = $requiredRole;
        $policy.Roles += $role;
        $changesMade = $true;
    }
    else
    {
        Write-Host "Policy already contains specified role. No changes required.";
    }

    #If changes were made...
    if ($changesMade)
    {
        #...save them to SSRS
        Write-Host "Saving changes to SSRS.";
        $ssrs.SetPolicies($folder, $policies);
    }
    Write-Host "Complete.";
}

[string]$url = "http://localhost/ReportServer/ReportService2006.asmx?wsdl";
Add-SSRSUserRole $url "Everyone" "Browser" "/MyReportFolder" $true;
Add-SSRSUserRole $url "Domain\User" "Browser" "/MyReportFolder" $true;

Now I have two elementary questions:

Do I need any SSRS modules to be installed in my PowerShell in order to run the above script?

The sample code above assign a permission to a folder. What changes are required if I want to assign permissions to a report object directly instead?

Thanks for your response in advance,


问:
Playwright - Azure AD - OAuth 2.0 authentication issues in executing tests
Have this below playwright node.js script for login page UI test. The site is Azure AD OAuth 2 enabled (with MFA - authenticator enabled).

```<code>import { test, expect } from '@playwright/test';
import { generateToken } from 'authenticator';

test('test', async ({ page }) => {
test.setTimeout(50000);
await page.goto('https://prod-site.com/'); // This URL is Azure AD MFA enabled and hence
// should redirect to MFA page but not happening in Azure DevOps pipeline
// Expecting the URL  https://login.microsoftonline.com/ may be ? but I don't want this
//as playwright should automatically  redirect (happens locally in the machine)
//But fails in Azure DevOps pipeline:
//await page.goto('https://login.microsoftonline.com/');
await page.getByPlaceholder('Email, phone, or Skype').fill('user@prod-site.com');
await page.getByRole('button', { name: 'Next' }).click();
await page.locator('#i0118').fill('password');
await page.getByRole('button', { name: 'Sign in' }).click();
await page.getByPlaceholder('Code').fill(generateToken('code'));
await page.getByRole('button', { name: 'Verify' }).click();
await page.getByRole('button', { name: 'Yes' }).click();
await page.getByRole('heading', { name: 'Welcome to prod-site' }).click();
});
</code>```

The above code works fine in the local machine but fails in the Azure DevOps pipeline with the following error

locator.fill: Target closed: waiting for getByPlaceholder('Email, phone, or Skype')

Could you please unblock from this issue? What am I missing?

Body:
Have this below playwright node.js script for login page UI test. The site is Azure AD OAuth 2 enabled (with MFA - authenticator enabled).

import { test, expect } from '@playwright/test';
import { generateToken } from 'authenticator';

test('test', async ({ page }) => {
test.setTimeout(50000);
await page.goto('https://prod-site.com/'); // This URL is Azure AD MFA enabled and hence
// should redirect to MFA page but not happening in Azure DevOps pipeline
// Expecting the URL  https://login.microsoftonline.com/ may be ? but I don't want this
//as playwright should automatically  redirect (happens locally in the machine)
//But fails in Azure DevOps pipeline:
//await page.goto('https://login.microsoftonline.com/');
await page.getByPlaceholder('Email, phone, or Skype').fill('user@prod-site.com');
await page.getByRole('button', { name: 'Next' }).click();
await page.locator('#i0118').fill('password');
await page.getByRole('button', { name: 'Sign in' }).click();
await page.getByPlaceholder('Code').fill(generateToken('code'));
await page.getByRole('button', { name: 'Verify' }).click();
await page.getByRole('button', { name: 'Yes' }).click();
await page.getByRole('heading', { name: 'Welcome to prod-site' }).click();
});

The above code works fine in the local machine but fails in the Azure DevOps pipeline with the following error

locator.fill: Target closed: waiting for getByPlaceholder('Email, phone, or Skype')

Could you please unblock from this issue? What am I missing?


问:
why can't I do any GUI on PythonAnywhere?
While running the following shell command  (via  pyhtonanywhere bash):

```<code>cv2.imshow('Mask',mask)
</code>```

I get the error message:

```<code>qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/teki/.virtualenvs/bup/lib/python3.9/site-packages/cv2/qt/plugins" ev
en though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
</code>```

As suggested in this forum (see example) I unistall opencv-python and installed then opencv-python-headless, message raised the gollowing error message:

```<code>pythonanywhete cv2.error: OpenCV(4.6.0) /io/opencv/modules/highgui/src/window.cpp:1267: error: (-2:Unspecified error) The function is not implemented. R ebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re -run cmake or configure script in function 'cvShowImage'
</code>```

Comments on this forum suggest to uninstall opencv-python-headless and to install opencv-python...which brings me back to my initial problem.

Any tip on this problem would be highly appreciated.

PS- in case it helps, here's the full script:

```<code># import required libraries
import cv2
import numpy as np

# read input image
img = cv2.imread('car.jpg')

# Convert BGR to HSV
hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)

# define range of blue color in HSV
lower_yellow = np.array([15,50,180])
upper_yellow = np.array([40,255,255])

# Create a mask. Threshold the HSV image to get only yellow colors
mask = cv2.inRange(hsv, lower_yellow, upper_yellow)

# Bitwise-AND mask and original image
result = cv2.bitwise_and(img,img, mask= mask)

# display the mask and masked image
cv2.imshow('Mask',mask) #my script runs well till this line.
cv2.waitKey(0)
cv2.imshow('Masked Image',result)
cv2.waitKey(0)
cv2.destroyAllWindows()
</code>```

Body:
While running the following shell command  (via  pyhtonanywhere bash):

cv2.imshow('Mask',mask)

I get the error message:

qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/teki/.virtualenvs/bup/lib/python3.9/site-packages/cv2/qt/plugins" ev
en though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

As suggested in this forum (see example) I unistall opencv-python and installed then opencv-python-headless, message raised the gollowing error message:

pythonanywhete cv2.error: OpenCV(4.6.0) /io/opencv/modules/highgui/src/window.cpp:1267: error: (-2:Unspecified error) The function is not implemented. R ebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re -run cmake or configure script in function 'cvShowImage'

Comments on this forum suggest to uninstall opencv-python-headless and to install opencv-python...which brings me back to my initial problem.

Any tip on this problem would be highly appreciated.

PS- in case it helps, here's the full script:

# import required libraries
import cv2
import numpy as np

# read input image
img = cv2.imread('car.jpg')

# Convert BGR to HSV
hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)

# define range of blue color in HSV
lower_yellow = np.array([15,50,180])
upper_yellow = np.array([40,255,255])

# Create a mask. Threshold the HSV image to get only yellow colors
mask = cv2.inRange(hsv, lower_yellow, upper_yellow)

# Bitwise-AND mask and original image
result = cv2.bitwise_and(img,img, mask= mask)

# display the mask and masked image
cv2.imshow('Mask',mask) #my script runs well till this line.
cv2.waitKey(0)
cv2.imshow('Masked Image',result)
cv2.waitKey(0)
cv2.destroyAllWindows()


问:
SavedStateHandle not passed to constructor after Fragment recreation
I'm trying the new Saved State module but without result, at the moment. This is the OnCreate of my Fragment:

```<code>@Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        AppCompatActivity activity = (AppCompatActivity) requireActivity();
        viewModel = new SavedStateViewModelFactory(requireActivity().getApplication(), requireActivity()).create(QueryViewModel.class);
        //The following is code for debugging purposes
        List<SingleNote> list = viewModel.getState().get(KEY);
        Log.i("ONCREATE", "ONCREATE");
        if (list != null) {
            Log.i("NUMBER OF ELEMENTS", String.valueOf(list.size()));
        }
    }
</code>```

and this is my ViewModel class:

```<code>public class QueryViewModel extends ViewModel {

    private SavedStateHandle state = new SavedStateHandle();

    public QueryViewModel(SavedStateHandle savedStateHandle) {
        state = savedStateHandle;
    }

    public SavedStateHandle getState() {
        return state;
    }

</code>```

I save a List<> of Serializable object inside the SavedStatehandle and it works. The problem came when I start a new activity with StartActivity (it is an Activity of my app, not an external one) because when I return back the SavedStateHandle is empty.

Any suggest? I have added the correct dependencies and I've already tried the ViewModelProvider constructor.

Body:
I'm trying the new Saved State module but without result, at the moment. This is the OnCreate of my Fragment:

@Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        AppCompatActivity activity = (AppCompatActivity) requireActivity();
        viewModel = new SavedStateViewModelFactory(requireActivity().getApplication(), requireActivity()).create(QueryViewModel.class);
        //The following is code for debugging purposes
        List<SingleNote> list = viewModel.getState().get(KEY);
        Log.i("ONCREATE", "ONCREATE");
        if (list != null) {
            Log.i("NUMBER OF ELEMENTS", String.valueOf(list.size()));
        }
    }

and this is my ViewModel class:

public class QueryViewModel extends ViewModel {

    private SavedStateHandle state = new SavedStateHandle();

    public QueryViewModel(SavedStateHandle savedStateHandle) {
        state = savedStateHandle;
    }

    public SavedStateHandle getState() {
        return state;
    }

I save a List<> of Serializable object inside the SavedStatehandle and it works. The problem came when I start a new activity with StartActivity (it is an Activity of my app, not an external one) because when I return back the SavedStateHandle is empty.

Any suggest? I have added the correct dependencies and I've already tried the ViewModelProvider constructor.


问:
ssh update issue on Ubuntu
I want to update my ssh version, on Ubuntu. But when i execute les following commands, the system does not allow me to update because it seems i have the last version 8.9p1, but when i ask about the version actuall installed, it dsplays a different version 8.2p1.

So it seems there are 2 versions on my system(Or maybe not !!). But i how can i use the 8.9p1, in my commands ?

```<code>~$ ssh -V
OpenSSH_8.2p1, OpenSSL 3.0.2 15 Mar 2022

~$ sudo apt-get install openssh-client
Reading package lists... Done
Building the dependency tree... Done
Reading status information... Done
openssh-client is already the latest version (1:8.9p1-3).
The following packages were installed automatically and are no longer needed:
  libflashrom1 libftdi1-2
Please use "sudo apt autoremove" to remove them.
0 updated, 0 newly installed, 0 to be removed and 9 not updated.
~$

~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:    22.04
Codename:   jammy
~$
</code>```

Title: ssh update issue on Ubuntu

Body:
I want to update my ssh version, on Ubuntu. But when i execute les following commands, the system does not allow me to update because it seems i have the last version 8.9p1, but when i ask about the version actuall installed, it dsplays a different version 8.2p1.

So it seems there are 2 versions on my system(Or maybe not !!). But i how can i use the 8.9p1, in my commands ?

~$ ssh -V
OpenSSH_8.2p1, OpenSSL 3.0.2 15 Mar 2022

~$ sudo apt-get install openssh-client
Reading package lists... Done
Building the dependency tree... Done
Reading status information... Done
openssh-client is already the latest version (1:8.9p1-3).
The following packages were installed automatically and are no longer needed:
  libflashrom1 libftdi1-2
Please use "sudo apt autoremove" to remove them.
0 updated, 0 newly installed, 0 to be removed and 9 not updated.
~$

~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:    22.04
Codename:   jammy
~$


问:
Why doesn't blitting work with animation of a scatter plot in matplotlib?
I am trying to create an animation containing a fixed sphere and a trajectory on the surface of the sphere, with a trail of the trajectory containing the last "windowSize" points in the trajectory.

Now, for the purposes of the code I will show here, I won't have an actual such trajectory, but rather just some random points changing each frame.

I am using matplotlib.animation.FuncAnimation. When I use the option blit=False, the animation works as expected. However, I would like to use blit=True to optimize performance.

When I do that, though, what happens is that nothing seems to happen in the animation, except that when I rotate the figure, then it shows an updated version of the figure (some number of frames ahead) and then freezes again.

The code below is based on this similar question.

Let me show the code I am using

```<code>import numpy as np
from matplotlib import pyplot as plt
import matplotlib.animation
import pandas as pd

Np = 5000
windowSize = 1000

m = np.random.rand(Np, 3)

df = pd.DataFrame({ "x" : m[0:Np,0], "y" : m[0:Np,1], "z" : m[0:Np,2]})

def init_graph():
    u, v = np.mgrid[0:2*np.pi:50j, 0:np.pi:50j]
    x = np.cos(u)*np.sin(v)
    y = np.sin(u)*np.sin(v)
    z = np.cos(v)
    ax.plot_surface(x, y, z, color="bisque", alpha=0.3)
    return graph,

def update_graph(num):
    if (num<windowSize):
        graph._offsets3d = (df.x[0:num], df.y[0:num], df.z[0:num])
    else:
        graph._offsets3d = (df.x[(num-windowSize):num], df.y[(num-windowSize):num], df.z[(num-windowSize):num])

    title.set_text('3D Test, time={}'.format(num))
    return graph,

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.set_box_aspect((1,1,1))
title = ax.set_title('3D Test')

graph = ax.scatter(0, 0, 0)

ani = matplotlib.animation.FuncAnimation(fig, update_graph, frames=Np, init_func=init_graph, interval=200, blit=True, repeat=False)

plt.show()
</code>```

m is an Np by 3 matrix, and each row represents a 3d point (in my real use case, each row is a point in a trajectory on the sphere surface, but for this demo I created m as random numbers).

I create a variable graph that contains a scatter plot, which I believe is an Artist. This is what I return from both the init_func and the updating func which are passed to FuncAnimation (as per the docs).

From what I read, you return an iterable of the Artists which will be updated in the animation. Thus I return a tuple of one element, graph,.

Now, in update_graph, the updating function for the animation, I am updating the scatter plot using graph._offsets3d, which I read in another question here on StackOverflow. I am not totally sure if this is the way to do it and I didn't find much information in the docs about whether to use this or one of the setting methods on the scatter plot.

Why doesn't blitting work with scatter plots?

Body:
I am trying to create an animation containing a fixed sphere and a trajectory on the surface of the sphere, with a trail of the trajectory containing the last "windowSize" points in the trajectory.

Now, for the purposes of the code I will show here, I won't have an actual such trajectory, but rather just some random points changing each frame.

I am using matplotlib.animation.FuncAnimation. When I use the option blit=False, the animation works as expected. However, I would like to use blit=True to optimize performance.

When I do that, though, what happens is that nothing seems to happen in the animation, except that when I rotate the figure, then it shows an updated version of the figure (some number of frames ahead) and then freezes again.

The code below is based on this similar question.

Let me show the code I am using

import numpy as np
from matplotlib import pyplot as plt
import matplotlib.animation
import pandas as pd

Np = 5000
windowSize = 1000

m = np.random.rand(Np, 3)

df = pd.DataFrame({ "x" : m[0:Np,0], "y" : m[0:Np,1], "z" : m[0:Np,2]})

def init_graph():
    u, v = np.mgrid[0:2*np.pi:50j, 0:np.pi:50j]
    x = np.cos(u)*np.sin(v)
    y = np.sin(u)*np.sin(v)
    z = np.cos(v)
    ax.plot_surface(x, y, z, color="bisque", alpha=0.3)
    return graph,

def update_graph(num):
    if (num<windowSize):
        graph._offsets3d = (df.x[0:num], df.y[0:num], df.z[0:num])
    else:
        graph._offsets3d = (df.x[(num-windowSize):num], df.y[(num-windowSize):num], df.z[(num-windowSize):num])

    title.set_text('3D Test, time={}'.format(num))
    return graph,

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.set_box_aspect((1,1,1))
title = ax.set_title('3D Test')

graph = ax.scatter(0, 0, 0)

ani = matplotlib.animation.FuncAnimation(fig, update_graph, frames=Np, init_func=init_graph, interval=200, blit=True, repeat=False)

plt.show()

m is an Np by 3 matrix, and each row represents a 3d point (in my real use case, each row is a point in a trajectory on the sphere surface, but for this demo I created m as random numbers).

I create a variable graph that contains a scatter plot, which I believe is an Artist. This is what I return from both the init_func and the updating func which are passed to FuncAnimation (as per the docs).

From what I read, you return an iterable of the Artists which will be updated in the animation. Thus I return a tuple of one element, graph,.

Now, in update_graph, the updating function for the animation, I am updating the scatter plot using graph._offsets3d, which I read in another question here on StackOverflow. I am not totally sure if this is the way to do it and I didn't find much information in the docs about whether to use this or one of the setting methods on the scatter plot.

Why doesn't blitting work with scatter plots?


问:
How to use getPoints(n) on a CubicBezierCurve3 using pythreejs?
I'm learning pythreejs in order to make some bezier stuff. I don't find examples for bezier curve drawing. Therefore I try to convert that threejs example  :

```<code>const curve = new THREE.CubicBezierCurve3(
    new THREE.Vector3( -10, 0, 0 ),
    new THREE.Vector3( -5, 15, 0 ),
    new THREE.Vector3( 20, 15, 0 ),
    new THREE.Vector3( 10, 0, 0 )
);

const points = curve.getPoints( 50 );
</code>```

I wrote :

```<code>from IPython.display import display
from pythreejs import *
poles = ([0.3, 0.6, 0.715], [0.313, 0.329, 0.0], [0.313, 0.329, 0.0], [0.64, 0.33, 0.213])
colour = [u'#00ff00']
geometry = Geometry(vertices=poles, colors=colour)
c1 = CubicBezierCurve3(geometry=geometry)
points = c1.getPoints(50)

</code>```

I then get an error : "AttributeError: 'CubicBezierCurve' object has no attribute 'getPoints'
It seems that method is not existing.

Could you please tell me if there is a (pythreejs) way to get points, or tesselate the c1 curve ?

Body:
I'm learning pythreejs in order to make some bezier stuff. I don't find examples for bezier curve drawing. Therefore I try to convert that threejs example  :

const curve = new THREE.CubicBezierCurve3(
    new THREE.Vector3( -10, 0, 0 ),
    new THREE.Vector3( -5, 15, 0 ),
    new THREE.Vector3( 20, 15, 0 ),
    new THREE.Vector3( 10, 0, 0 )
);

const points = curve.getPoints( 50 );

I wrote :

from IPython.display import display
from pythreejs import *
poles = ([0.3, 0.6, 0.715], [0.313, 0.329, 0.0], [0.313, 0.329, 0.0], [0.64, 0.33, 0.213])
colour = [u'#00ff00']
geometry = Geometry(vertices=poles, colors=colour)
c1 = CubicBezierCurve3(geometry=geometry)
points = c1.getPoints(50)

I then get an error : "AttributeError: 'CubicBezierCurve' object has no attribute 'getPoints'
It seems that method is not existing.

Could you please tell me if there is a (pythreejs) way to get points, or tesselate the c1 curve ?


问:
Migrating date fields (from Oracle) using AWS DMS brings wrong data
I am trying to migrate data from Oracle source to AWS S3 using AWS DMS service and I observed a discrepancy in the data being fetched for DATE datatype fields.

Example:

`Data at source looks like '0015-08-15T00:00:00.000+0000'

and for the same key the Data in S3 look like '0015-08-17T00:00:00.000+0000'`

The point to notice here is that the actual date is coming wrong i.e. 17 in place of 15.

Though I tried the "transformation rules" at the DMS replication task creation stage and tried converting the data to DATE type or TIMESTAMP type but no luck. Is there any way this issue can be resolved/handled?


问:
Convert modal view to fullscreen view
I have a modal view controller A presented at the top of the view controllers hierarchy.

Is it possible to make it fullscreen temporarily when a user presses a button? And then go back to standard modal look when used presses another button?

To clarify, I'm not talking about modalPresentationStyle = .fullScreen BEFORE A is presented, I need to present A in a standard way and then stretch it to be fullscreen when needed.

Although if I write pseudo code it would be something like this:

```<code>class A: UIViewController {
    @objc func goFullScreen(sender: UIButton) {
        // pseudo code:
        // modalPresentationStyle = .fullScreen
        // go fullscreen, block `drag-to-dismiss` gesture, remove `cornerRadius`, set `self.view.frame = UIScreen.main.bounds`
    }

    @objc func cancelFullScreen(sender: UIButton) {
        // pseudo code:
        // modalPresentationStyle = .pageSheet
        // return to the standard look of a modal view controller
    }
}

</code>```

I found UIAdaptivePresentationControllerDelegate.presentationControllerShouldDismiss method that intercepts drag to close gesture, but I don't see any way to go fullscreen.

Picture of what I am talking about:

ps. I know I can make a custom container view controller with a custom transition delegate but I'd like to know if it's possible to implement such behaviour with system classes because I basically need just to flip modalPresentationStyle property with some interpolation animation...

Also on the right I hide/show some UI elements, but still it's the same view controller

Title: Convert modal view to fullscreen view

Body:
I have a modal view controller A presented at the top of the view controllers hierarchy.

Is it possible to make it fullscreen temporarily when a user presses a button? And then go back to standard modal look when used presses another button?

To clarify, I'm not talking about modalPresentationStyle = .fullScreen BEFORE A is presented, I need to present A in a standard way and then stretch it to be fullscreen when needed.

Although if I write pseudo code it would be something like this:

class A: UIViewController {
    @objc func goFullScreen(sender: UIButton) {
        // pseudo code:
        // modalPresentationStyle = .fullScreen
        // go fullscreen, block `drag-to-dismiss` gesture, remove `cornerRadius`, set `self.view.frame = UIScreen.main.bounds`
    }

    @objc func cancelFullScreen(sender: UIButton) {
        // pseudo code:
        // modalPresentationStyle = .pageSheet
        // return to the standard look of a modal view controller
    }
}

I found UIAdaptivePresentationControllerDelegate.presentationControllerShouldDismiss method that intercepts drag to close gesture, but I don't see any way to go fullscreen.

Picture of what I am talking about:

ps. I know I can make a custom container view controller with a custom transition delegate but I'd like to know if it's possible to implement such behaviour with system classes because I basically need just to flip modalPresentationStyle property with some interpolation animation...

Also on the right I hide/show some UI elements, but still it's the same view controller


问:
Python 'less then' comparison operator yielding non-correct result
I have a list of values, let them be

```<code>a_list_sort = [2, 3, 4, 4.1, 5, 5.05, 2.1, 3.05, 7, 2.2, 3.2]
</code>```

My goal is to get a list present_a with 'unique' values from a_list_sort, and by 'unique' I mean following:
If the n-th value from a_list_sort is close to one of the values already present in present_a, it is not 'unique', otherwise it is and it is added to present_a.

I tried this code:

```<code>angle_th = 0.1
present_a = [a_list_sort[0]] #  Because the first value in a_list_sort is 'unique' a priori
present_a_idxs = [] #  List of indexes
for a_idx in range(1, len(a_list_sort)):
    if np.any(np.abs(np.asarray(present_a) - a_list_sort[a_idx]) < angle_th):  #  Is not 'unique'
        pass
    else:
        present_a.append(a_list_sort[a_idx])
        present_a_ind.append(a_idx)
</code>```

For

```<code>angle_th = 0.1
a_list_sort = [2, 3, 4, 4.1, 5, 5.05, 2.1, 3.05, 7, 2.2, 3.2]
</code>```

it strangely yields

```<code>>>> present_a
[2, 3, 4, 5, 2.1, 7, 2.2, 3.2]
</code>```

while I expect

```<code>>>> present_a
[2, 3, 4, 4.1, 5, 2.1, 7, 2.2, 3.2]
</code>```

because 4.1 is not close enough (with threshold = 0.1). Note that element 2.1 is somehow processed correctly.

I really have no idea what why is this happening. Am I missing something obvious?

Body:
I have a list of values, let them be

a_list_sort = [2, 3, 4, 4.1, 5, 5.05, 2.1, 3.05, 7, 2.2, 3.2]

My goal is to get a list present_a with 'unique' values from a_list_sort, and by 'unique' I mean following:
If the n-th value from a_list_sort is close to one of the values already present in present_a, it is not 'unique', otherwise it is and it is added to present_a.

I tried this code:

angle_th = 0.1
present_a = [a_list_sort[0]] #  Because the first value in a_list_sort is 'unique' a priori
present_a_idxs = [] #  List of indexes
for a_idx in range(1, len(a_list_sort)):
    if np.any(np.abs(np.asarray(present_a) - a_list_sort[a_idx]) < angle_th):  #  Is not 'unique'
        pass
    else:
        present_a.append(a_list_sort[a_idx])
        present_a_ind.append(a_idx)

For

angle_th = 0.1
a_list_sort = [2, 3, 4, 4.1, 5, 5.05, 2.1, 3.05, 7, 2.2, 3.2]

it strangely yields

>>> present_a
[2, 3, 4, 5, 2.1, 7, 2.2, 3.2]

while I expect

>>> present_a
[2, 3, 4, 4.1, 5, 2.1, 7, 2.2, 3.2]

because 4.1 is not close enough (with threshold = 0.1). Note that element 2.1 is somehow processed correctly.

I really have no idea what why is this happening. Am I missing something obvious?


问:
What would be the easiest solution to convert table to specific format
I have a table in excel like this

ID EW
PARC ID
POW ID
WOJ ID

1.1.1
NAMEa1
NAMEp2
NAMEw3

1.1.2
NAMEa1
NAMEp2
NAMEw3

1.1.3
NAMEa1
NAMEp2
NAMEw3

1.2.1
NAMEa4
NAMEp2
NAMEw3

1.2.2
NAMEa4
NAMEp2
NAMEw3

1.3.3
NAMEa5
NAMEp3
NAMEw3

What would be the best way to convert it to format like this :

WOJ ID NAMEw3

POW ID
NAMEp2

PARC ID
NAMEa1

ID EW
1.1.1
1.1.2
1.1.3

PARC ID
NAMEa4

ID EW
1.2.1
1.2.2

POW ID
NAMEp3

PARC ID
NAMEa5

ID EW
1.3.3

I was trying to do it with pivot table but with no results.

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


问:
I couldn't able to login since i encountered this error
I am new to the firebase database, so I'm struggling right now.  This is the error that I encountered:

FireSharp.Exceptions.FirebaseException: Request responded with status code=BadRequest, response={

"error" : "Invalid path: Invalid token in path"

}

at FireSharp.FirebaseClient.<>c.<.ctor>b__3_0(HttpStatusCode statusCode, String body)
at FireSharp.FirebaseClient.HandleIfErrorResponse(HttpStatusCode statusCode, String content, Action`2 errorHandler)
at FireSharp.FirebaseClient.Get(String path)
at WRS2big_Web.LandingPage.Account.btnLogin_Click(Object sender, EventArgs e)

These are my codes:

```<code>public void btnLogin_Click(object sender, EventArgs e)
{
    try
    {
        // RETRIEVE DATA FROM ADMIN TBL
        string email = txt_email.Text;
        string pass = txt_password.Text;

        FirebaseResponse response;
        response = twoBigDB.Get("ADMIN/" + txt_email.Text);
        Session["email"] = email;
        Session["pass"] = pass;
        Response.Redirect("/Admin/AdminIndex.aspx");

    }
    catch (Exception ex)
    {
        Response.Write("```" + ex.ToString() + "```");
    }
}
</code>```

Body:
I am new to the firebase database, so I'm struggling right now.  This is the error that I encountered:

FireSharp.Exceptions.FirebaseException: Request responded with status code=BadRequest, response={

"error" : "Invalid path: Invalid token in path"

}

at FireSharp.FirebaseClient.<>c.<.ctor>b__3_0(HttpStatusCode statusCode, String body)
at FireSharp.FirebaseClient.HandleIfErrorResponse(HttpStatusCode statusCode, String content, Action`2 errorHandler)
at FireSharp.FirebaseClient.Get(String path)
at WRS2big_Web.LandingPage.Account.btnLogin_Click(Object sender, EventArgs e)

These are my codes:

public void btnLogin_Click(object sender, EventArgs e)
{
    try
    {
        // RETRIEVE DATA FROM ADMIN TBL
        string email = txt_email.Text;
        string pass = txt_password.Text;

        FirebaseResponse response;
        response = twoBigDB.Get("ADMIN/" + txt_email.Text);
        Session["email"] = email;
        Session["pass"] = pass;
        Response.Redirect("/Admin/AdminIndex.aspx");

    }
    catch (Exception ex)
    {
        Response.Write("
" + ex.ToString() + "
");
    }
}


问:
How to get selected value using @Html.DropDownList & pass it into the partial view in ASP.NET Web Application?
I am creating ASP.NET web application to see patient data. There is dropdown of Doctor's list.
According to Doctor patient list should shown.
I used partial view for to show patient data, @Html.DropDownList for Dropdown.
I want the selected Doctor ID to pass into the partial view.

I tried some logic it works for var id = 1 but after changing dropdown value partial view no updating.
Please can anyone suggest some changes or new logic.

PatientController.cs

```<code>using HospitalManagement.Models;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Windows.Forms;

namespace HospitalManagement.Controllers
{
    public class PatientController : Controller
    {
        private PatientDbContext db = new PatientDbContext();
        private DoctorDbContext db1 = new DoctorDbContext();

        public ActionResult Data()
        {
            ViewBag.Doctors = db1.doctors.ToList();
            ViewBag.Patients = db.patients.ToList();

            ViewModel mymodel = new ViewModel();
            mymodel.Doctors = db1.doctors.ToList();
            mymodel.Patients = db.patients.ToList();
            return View(mymodel);
        }

    }
}
</code>```

Data.cshtml

```<code>@{
    ViewBag.Title = "Data";
    List<HospitalManagement.Models.Doctor> doctors = ViewBag.Doctors;
    List<HospitalManagement.Models.Patient> patients = ViewBag.Patients;
}

<h2>Patient's Data</h2>
@Html.DropDownList("DoctorsList", new SelectList(doctors, "doctor_id", "doctor_name"),
    new { @class = "btn btn-light dropdown-toggle mt-3 mb-3" })

@{var id = 1;}
@Html.Partial("PatientList", patients.Where(x => x.doctor_id == id))

<script>
    $('#DoctorsList').change(function () {
        id = $('#DoctorsList option:selected').val();
    })
    $(document).ready(function () {
        console.log("ready!");
    });
</script>

</code>```

PatientList.cshtml <-- partial view

```<code>@model IEnumerable<HospitalManagement.Models.Patient>

@{
    ViewBag.Title = "Patient Data";
}

<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.patient_id)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.patient_name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.date_of_registration)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.doctor_id)
        </th>
        <th></th>
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.patient_id)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.patient_name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.date_of_registration)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.doctor_id)
            </td>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id = item.patient_id }, new { @class = "btn btn-primary" }) |
                @Html.ActionLink("Delete", "Delete", new { id = item.patient_id }, new { @class = "btn btn-primary" })
            </td>
        </tr>
    }

</table>

<div>
    <a class="btn btn-primary" href="/dashboard/index">Back to the list</a>
</div>

</code>```

Body:
I am creating ASP.NET web application to see patient data. There is dropdown of Doctor's list.
According to Doctor patient list should shown.
I used partial view for to show patient data, @Html.DropDownList for Dropdown.
I want the selected Doctor ID to pass into the partial view.

I tried some logic it works for var id = 1 but after changing dropdown value partial view no updating.
Please can anyone suggest some changes or new logic.

PatientController.cs

using HospitalManagement.Models;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Windows.Forms;

namespace HospitalManagement.Controllers
{
    public class PatientController : Controller
    {
        private PatientDbContext db = new PatientDbContext();
        private DoctorDbContext db1 = new DoctorDbContext();

        public ActionResult Data()
        {
            ViewBag.Doctors = db1.doctors.ToList();
            ViewBag.Patients = db.patients.ToList();

            ViewModel mymodel = new ViewModel();
            mymodel.Doctors = db1.doctors.ToList();
            mymodel.Patients = db.patients.ToList();
            return View(mymodel);
        }

    }
}

Data.cshtml

@{
    ViewBag.Title = "Data";
    List<HospitalManagement.Models.Doctor> doctors = ViewBag.Doctors;
    List<HospitalManagement.Models.Patient> patients = ViewBag.Patients;
}

Patient's Data

@Html.DropDownList("DoctorsList", new SelectList(doctors, "doctor_id", "doctor_name"),
    new { @class = "btn btn-light dropdown-toggle mt-3 mb-3" })

@{var id = 1;}
@Html.Partial("PatientList", patients.Where(x => x.doctor_id == id))

PatientList.cshtml <-- partial view

@model IEnumerable<HospitalManagement.Models.Patient>

@{
    ViewBag.Title = "Patient Data";
}

            @Html.DisplayNameFor(model => model.patient_id)

            @Html.DisplayNameFor(model => model.patient_name)

            @Html.DisplayNameFor(model => model.date_of_registration)

            @Html.DisplayNameFor(model => model.doctor_id)

    @foreach (var item in Model)
    {

                @Html.DisplayFor(modelItem => item.patient_id)

                @Html.DisplayFor(modelItem => item.patient_name)

                @Html.DisplayFor(modelItem => item.date_of_registration)

                @Html.DisplayFor(modelItem => item.doctor_id)

                @Html.ActionLink("Edit", "Edit", new { id = item.patient_id }, new { @class = "btn btn-primary" }) |
                @Html.ActionLink("Delete", "Delete", new { id = item.patient_id }, new { @class = "btn btn-primary" })

    }

    Back to the list


问:
Is there a way to perform react-hook-form validation without showing errors?
I want to be able to validate the entire form and get the validation result, but I want to do it 'silently'(i.e without making my fields go red). I know that formContext.trigger exists, but that doesn't seem to have a softer setting. I don't want to show errors to the user, I just want to check if what they have got so far is valid. Is this possible with react hook form?

Context:

I'm using 'onChange' mode for my form

I need to do this because as a user fills my form in, which is for a pricing page, I want to send requests to get the pricing information which changes based on the form data. I don't want to send a pricing request if the form isn't valid, but I don't want to trigger full validation and make the fields go red when the user hasn't done anything wrong, they're just filling the form out in order.