Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
sequence |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
74,973,749 | 2 | null | 74,973,617 | 1 | null |
1. Duplicate your table
2. From the 1st table remove the 1st CAUSING RECORD
3. From the 2nd table remove the 2nd CAUSING RECORD
4. Append both tables as new
[](https://i.stack.imgur.com/AzMYV.png)
1. Remove duplicate rows
2. Group by TICKET and INVESTIGATION RECORD and aggregate CAUSING RECORD AS SUM of CAUSING RECORD.
[](https://i.stack.imgur.com/aNcFU.png)
1. Since the last row will lead to an error, edit the formula in the formula bar and change List.Sum([CAUSING RECORD]) to Text.Combine([CAUSING RECORD], ", ")
[](https://i.stack.imgur.com/VxdUQ.png)
The M-Code for the 3 involved tables is
Table1
```
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCvEONjAwNFLSUXIODjIwMAKxPP3CgCyYkLGRUqwOhkJjLAqNsSk0NMRQaGKCUGhqCtduClMIFzKzxKYQqB1doamFUmwsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [TICKET = _t, #"CAUSING RECORD" = _t, #"INVESTIGATION RECORD" = _t, #"CAUSING RECORD.1" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"TICKET", type text}, {"CAUSING RECORD", type text}, {"INVESTIGATION RECORD", type text}, {"CAUSING RECORD.1", type text}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"CAUSING RECORD.1"}),
#"Reordered Columns" = Table.ReorderColumns(#"Removed Columns",{"TICKET", "INVESTIGATION RECORD", "CAUSING RECORD"})
in
#"Reordered Columns"
```
Table2
```
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCvEONjAwNFLSUXIODjIwMAKxPP3CgCyYkLGRUqwOhkJjLAqNMRX6+3t6Yig0MUEoNDWFazeFKYQLmVliUwjUjq7Q1EIpNhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [TICKET = _t, #"CAUSING RECORD" = _t, #"INVESTIGATION RECORD" = _t, #"CAUSING RECORD.1" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"TICKET", type text}, {"CAUSING RECORD", type text}, {"INVESTIGATION RECORD", type text}, {"CAUSING RECORD.1", type text}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"CAUSING RECORD"}),
#"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"CAUSING RECORD.1", "CAUSING RECORD"}})
in
#"Renamed Columns"
```
Table3
```
let
Source = Table.Combine({Table1, Table2}),
#"Removed Duplicates" = Table.Distinct(Source),
#"Sorted Rows" = Table.Sort(
#"Removed Duplicates",{{"TICKET", Order.Ascending}}),
#"Grouped Rows" = Table.Group(
#"Sorted Rows",
{"TICKET", "INVESTIGATION RECORD"},
{
{"CAUSING RECORD", each Text.Combine([CAUSING RECORD], ", "), type nullable text}
}
)
in
#"Grouped Rows"
```
| null | CC BY-SA 4.0 | null | 2023-01-01T08:46:50.863 | 2023-01-01T08:46:50.863 | null | null | 7,108,589 | null |
74,973,754 | 2 | null | 74,961,611 | 0 | null | in this question both are coupled, hence there's only 1 to solve:
use 1st equation to write
```
A1=f(A2,dA2/dz)
```
and feed this expression into 2nd equation.
regroup
```
n1=1j*k1^4/k2^2*1/deff*.25
n2=1j*3*(k1-k2)
```
now the to solve is
```
y'=n1/y^2*exp(n2*z)
```
It can obviously be done in MATLAB, but for this particular in my opinion the does a better job.
Input the obtained of previous point into the solver available in this link
[https://www.wolframalpha.com/input?i=y%27%27+%2B+y+%3D+0](https://www.wolframalpha.com/input?i=y%27%27+%2B+y+%3D+0)
and solve
The general (symbolic) solutions for `A2` are
[](https://i.stack.imgur.com/QjDxF.jpg)
Note that I used `k1` instead of `n1` and `k2` instead of `n2` just in the Wolfram Solver.
Rewording ; the `k1` `k2` expressions of the general solutions are not the wave numbers `k1` `k2` of the equations in the question. Just replace accordingly.
Now get `A1` using expression in point 2.
I have spotted 2 possible errors in the MATLAB code posted in the question that shouldn't be ignored by the question originator:
In the far right side of the posted MATLAB code, the exponential expressions
both show
(2*k1-k2)(c^2))
there's this `(k1*(c^2))` dividing the exponent wheras in the question none of the exponentials show such denominator their respective exponents.
the `dk` or `delta k` expression in the exponentials of the question are obviously `k2-k1` or `k1-k2` , here there may be room for a sign ambiguity, that may shoot a wave solution onto the opposite direction, yet the point here is where
```
*exp(-1i*(2*k1-k2)*z)
```
should probably be
```
*exp(-1i*2*(k1-k2)*z)
```
or just
```
exp(-1i*(k1-k2)*z)
```
and yes, in MATLAB `(-1)^.5` can be either expressed with `1j` or `1i` but as written in the MATLAB code made available in the question, since only a chunk of code has been made available, it's fair to assume that no such `i=1j` has been done.
| null | CC BY-SA 4.0 | null | 2023-01-01T08:47:35.387 | 2023-01-01T15:13:54.737 | 2023-01-01T15:13:54.737 | 9,927,941 | 9,927,941 | null |
74,973,870 | 2 | null | 74,948,005 | 0 | null | Would you try this? Connect to pivot with hasMany then users from there. It will probably solve your problem this way.
```
$entityModels[0]->pivot->users;
```
| null | CC BY-SA 4.0 | null | 2023-01-01T09:24:47.917 | 2023-01-01T09:24:47.917 | null | null | 4,796,657 | null |
74,974,025 | 2 | null | 74,972,271 | 0 | null | Try the following code:
```
nav {
text-align: center;
color: white;
font-family: 'Courier New', Courier, monospace;
font-size: 10px;
position: absolute;
top: -1%;
left: 0;
right: 0;
}
/* ICONS */
.gg-home-alt {
/* This value will multiple the actual size */
--ggs: 1.5;
}
.gg-comment {
/* This value will multiple the actual size */
--ggs: 1.5;
}
.gg-games {
/* This value will multiple the actual size */
--ggs: 1.5;
}
/* END OF ICONS */
ul {
width: inherit;
display: inline-flex;
padding: 0;
justify-content: center;
align-items: center;
}
li {
padding-left: 15px;
padding-right: 15px;
list-style-type: none;
}
/* Anchor/hyperlink content */
a {
color: white;
font-family: 'Courier New', Courier, monospace;
font-size: 15px;
}
================================================================================================#mainSite {
text-align: center;
color: white;
font-family: 'Courier New', Courier, monospace;
font-size: 30px;
}
/* Text based/body content */
body {
margin: 0;
background: #67c3f9;
/*
background-image: url("https://68.media.tumblr.com/c5552d48c39cb834d0f5c249869d4737/tumblr_oiln82yPI91w0f40yo1_500.gif");
background-repeat: no-repeat;
background-size: cover;
background-position: 75%;
display: flex;
flex-direction: column;
min-height: 100vh;
*/
}
h1 {
text-align: center;
}
.title {
color: white;
font-family: 'Courier New', Courier, monospace;
font-size: 25px;
text-align: center;
position: absolute;
top: 25%;
margin-left: 40%;
margin-right: 40%;
}
footer {
width: 100%;
bottom: 0;
position: fixed;
font-size: 13px;
color: white;
left: 0;
height: 50px;
text-align: center;
font-family: 'Courier New', Courier, monospace;
}
/* Input content */
form {
display: flex;
justify-content: center;
}
form input {
background: none;
font-family: 'Courier New', Courier, monospace;
padding: 0px 17px;
height: 48px;
border: 3px solid white;
color: white;
border-radius: 3px;
outline: none;
width: 60%;
margin-top: 5px;
border-radius: 10px;
color: white;
position: absolute;
top: 55%;
text-align: center;
}
/* Games Page CSS */
#gTitle {
color: white;
font-family: 'Courier New', Courier, monospace;
font-size: 25px;
text-align: center;
position: absolute;
top: 15%;
margin-left: 30%;
margin-right: 30%;
}
.gamesTable {
position: absolute;
top: 50%;
padding: 5%;
text-align: center;
}
```
```
<link href="https://css.gg/home-alt.css" rel="stylesheet"/>
<link href="https://css.gg/comment.css" rel="stylesheet"/>
<link href="https://css.gg/games.css" rel="stylesheet"/>
<nav>
<ul>
<li>
<a href="g.html" class="navLinks"><i class="gg-games"></i></a>
</li>
<li>
<a href="https://discord.gg/jatF5KbCrT" class="navLinks"><i class="gg-comment"></i></a>
</li>
<li>
<a href="/index.html" class="navLinks"><i class="gg-home-alt"></i></a>
</li>
</ul>
</nav>
<body>
<!-- This is the main content of the website -->
<div class="title">
<h1>Plunge Proxy</h1>
</div>
<form>
<input id="search" placeholder="Enjoy the Internet!" />
</form>
```
| null | CC BY-SA 4.0 | null | 2023-01-01T10:04:58.837 | 2023-01-01T10:04:58.837 | null | null | 4,599,636 | null |
74,974,268 | 2 | null | 74,849,167 | 0 | null | As said in [API docs](https://quilljs.com/docs/api/#getselection) `.getSelection` will return `null` if editor has no focus. When you click on button that is not inside editor, you lose focus from editor.
However you can provide first argument, that will focus editor before getting selection range.
You just need to change your code to:
```
var range = this.quill.getSelection(true);
```
Editor will retain previous selection.
| null | CC BY-SA 4.0 | null | 2023-01-01T11:10:17.793 | 2023-01-01T11:10:17.793 | null | null | 14,142,036 | null |
74,974,371 | 2 | null | 74,971,330 | 0 | null | You might be able to achieve what you need by using [getBoundingClientRect()](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).
But, instead of checking whether just one div overlaps or collides with another, you would have a checkup of overlapping of any of the elements which are selected against all of the other elements within your container / artboard.
```
function isOverlapping(snapHolder, dragHolder) {
// let's loop through all of the draggables...
for(var i = 0; i < dragHolder.length; i++) {
// ... and check for collisions / overlaps with
// other elements within the artboard
for(var j = 0; j < snapHolder.length; j++) {
var dragged = dragHolder[i].getBoundingClientRect();
var snapped = snapHolder[j].getBoundingClientRect();
// is there an overlap?
if(
dragged.right > snapped.left &&
dragged.left < snapped.right &&
dragged.bottom > snapped.top &&
dragged.top < snapped.bottom
) {
// raise the flag
return true;
}
}
}
// all clear, nothing's overlapping, continue
return false;
}
```
`snapHolder` is a collection of `div` elements within the artboard, which have the class `snappable` (that is to say, they're not selected for dragging).
Similarly, `dragHolder` is a collection of `div` elements in the artboard, which are selected for draggin.
If I've understood your current code correctly, you would call this function within your `processDrag`, and within your `startDrag`. The function would check for any overlaps between the two collections.
Keep in mind that this might not be the most optimal solution - if there's a large number of elements within your artboard, the collision checking laggy. In case of x total elements inside the artboard, and y of them being selected for dragging, you're looking at:
```
(x - y) * y
```
checkups per cycle (as long as the dragging lasts). In the event of selecting half of the elements, this would become y checkups per cycle.
There are other solutions, relying on external jQuery libraries, as suggested in the following SO answers. Be mindful of the date, though:
- [Please recommend a JQuery plugin that handles collision detection for draggable elements](https://stackoverflow.com/questions/773717/please-recommend-a-jquery-plugin-that-handles-collision-detection-for-draggable)- [Restrict jQuery draggable items from overlapping/colliding with sibling elements](https://stackoverflow.com/questions/11452185/restrict-jquery-draggable-items-from-overlapping-colliding-with-sibling-elements)- [jQuery Dragging With Collision Detection](https://stackoverflow.com/questions/14627860/jquery-dragging-with-collision-detection)
| null | CC BY-SA 4.0 | null | 2023-01-01T11:34:23.917 | 2023-01-01T11:34:23.917 | null | null | 6,133,426 | null |
74,974,589 | 2 | null | 60,117,108 | 0 | null | Use `GetSupportFragmentManager()` instead of `GetFragmentManager();`
| null | CC BY-SA 4.0 | null | 2023-01-01T12:26:19.270 | 2023-01-01T12:47:32.543 | 2023-01-01T12:47:32.543 | 4,826,457 | 19,247,858 | null |
74,974,608 | 2 | null | 74,971,851 | 0 | null | you could use Excel built in `AutoFilter()` and `RemoveDuplicates()` functionalities
```
Sub ConditionalRowCopy()
With Workbooks("Bookcopy.xlsm").Worksheets("copy")
With .Range("D1", .Cells(.Rows.Count, 1).End(xlUp))
.AutoFilter Field:=3, Criteria1:=">06/01/2020"
If Application.Subtotal(103, .Resize(, 1)) > 1 Then
.SpecialCells(xlCellTypeVisible).Copy Destination:= Workbooks("Bookpaste.xlsm").Worksheets("paste").Range("A1")
With Workbooks("Bookpaste.xlsm").Worksheets("paste")
With .Range("D1", .Cells(.Rows.Count, 1).End(xlUp))
.RemoveDuplicates Columns:=Array(3, 4), Header:=xlNo
End With
End With
End If
End With
.AutoFilterMode = False
End With
End Sub
```
| null | CC BY-SA 4.0 | null | 2023-01-01T12:30:46.913 | 2023-01-01T12:30:46.913 | null | null | 3,598,756 | null |
74,974,695 | 2 | null | 74,974,652 | 1 | null | Add a `semiColon` i.e `;` after constructor or provide function body by adding `{}`
```
OnBoardingModel({
required this.image,
required this.title,
required this.body
}); // add this semicolon
```
or
```
OnBoardingModel({
required this.image,
required this.title,
required this.body
}){} // add the function body this way
```
| null | CC BY-SA 4.0 | null | 2023-01-01T12:50:57.987 | 2023-01-01T12:50:57.987 | null | null | 13,431,819 | null |
74,974,697 | 2 | null | 74,971,340 | 0 | null | you could use Excel built in `RemoveDuplicates()` functionality
```
Option Explicit
Sub ModChallenge()
Dim ws As Worksheet
For Each ws In Worksheets
With ws 'reference current worksheet
.Range("A2", .Cells(.Rows.Count, 1).End(xlUp)).Copy Destination:=.Range("I2") ' copy referenced worksheet column "A" cells from row 2 down to last not empty one and paste it from range I2 downwards
.Range("I2", .Cells(.Rows.Count, "I").End(xlUp)).RemoveDuplicates Columns:=Array(1), Header:=xlNo ' remove duplicates from pasted cells
End With
Next
End Sub
```
| null | CC BY-SA 4.0 | null | 2023-01-01T12:51:21.417 | 2023-01-01T12:51:21.417 | null | null | 3,598,756 | null |
74,974,713 | 2 | null | 74,973,617 | 0 | null | Once you join your two tables, you can Group by TICKET and INVESTIGATION RECORD.
Within the Table.Group function add a custom aggregation of the CAUSING RECORD columns, remove the duplicates, optionally sort, and combine them as a text string.
In the code below, it is the Table.Group function that is important; the rest is just setup and housekeeping.
```
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCvEONjAwNFLSUXIODjIwMDJSitXBEDXGKmpoiBA1NYWrNcUmamKiFBsLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [TICKET = _t, #"CAUSING RECORD" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"TICKET", type text}, {"CAUSING RECORD", type text}})
in
#"Changed Type"
```
[](https://i.stack.imgur.com/Hys0W.png)
```
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8vQLMzAwUtJRcg4OMjAwNlKK1cEQNMYiaGKCEDSFCZpZYhE0tVCKjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"INVESTIGATION RECORD" = _t, #"CAUSING RECORD" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"INVESTIGATION RECORD", type text}, {"CAUSING RECORD", type text}})
in
#"Changed Type"
```
[](https://i.stack.imgur.com/3kl0W.png)
```
let
//Combine the two tables
#"Append Columns" = Table.FromColumns(
Table.ToColumns(Ticket) & Table.ToColumns(Investigation),
type table[TICKET=text, CAUSING RECORD=text, INVESTIGATION RECORD=text, CAUSING RECORD2=text]),
//Group by TICKET, INVESTIGATION RECORD
#"Grouped Rows" = Table.Group(#"Append Columns", {"TICKET", "INVESTIGATION RECORD"}, {
{"CAUSING RECORDS", each
Text.Combine(
List.Sort(
List.Distinct(
List.Combine({[CAUSING RECORD],[CAUSING RECORD2]}))),
", "), type text}})
in
#"Grouped Rows"
```
[](https://i.stack.imgur.com/eZUIH.png)
| null | CC BY-SA 4.0 | null | 2023-01-01T12:54:49.217 | 2023-01-01T12:54:49.217 | null | null | 2,872,922 | null |
74,974,760 | 2 | null | 74,974,613 | 2 | null | You can get your result with a single line.
```
var data = File.ReadLines(docPath)
.Skip(1)
.Select(x => x.Split(new char[] {'\t'},StringSplitOptions.RemoveEmptyEntries))
.SelectMany(k => k);
```
First, we use File.ReadLines that enumerates the lines from the file creating a sequence that we can feed to the following commands. Then we Skip the first line from the sequence and on the remaining items we apply the Split operation getting another sequence of two or more values that we can add as single items to the IEnumerable assigned to the data variable. Of course a ToList will materialize the IEnumerable into the final processing data.
| null | CC BY-SA 4.0 | null | 2023-01-01T13:05:13.390 | 2023-01-01T13:05:13.390 | null | null | 1,197,518 | null |
74,974,883 | 2 | null | 32,979,585 | 0 | null | A squircle is `border-radius` or round corners, and you must draw the path by yourself.

The article from figma's blog and their implementation in Github.
[https://www.figma.com/blog/desperately-seeking-squircles/](https://www.figma.com/blog/desperately-seeking-squircles/)
[https://github.com/MartinRGB/Figma_Squircles_Approximation](https://github.com/MartinRGB/Figma_Squircles_Approximation)
| null | CC BY-SA 4.0 | null | 2023-01-01T13:30:52.753 | 2023-01-01T13:30:52.753 | null | null | 9,471,439 | null |
74,975,142 | 2 | null | 74,974,969 | 0 | null | You could use a linear gradient on the div from black to transparent to create a fake "blur border" effect.
```
body {
margin: 0;
}
header {
position: relative;
}
.video {
width: 100%;
}
.myDiv {
position: absolute;
z-index: 1;
background-image: linear-gradient(to top, #000 95%, rgba(0,0,0,0));
height: 50vw;
width: 100%;
top: 20vw;
}
```
```
<header>
<img class="video" src="https://i.stack.imgur.com/5ktg0.png" alt="This is the video">
<div class="myDiv"></div>
</header>
```
| null | CC BY-SA 4.0 | null | 2023-01-01T14:20:36.483 | 2023-01-01T14:20:36.483 | null | null | 5,127,494 | null |
74,975,281 | 2 | null | 74,975,133 | 1 | null | Service accounts don't need / use refresh tokens.
Refresh tokens are used for offline access by standard Oauth2 authorization. If the user is offline then the application can use the refresh tokens to get an new access token and make requests on behalf of the user.
With service accounts they are already preauthorized and have access to the data they have. A request should return an access token once that access token expires after an hour you just make a new authorization request to get a new access token.
Refresh tokens are unnecessary in the case of service accounts. When the access token expires just run your auth code again to get a new one. Its saving you a step.
| null | CC BY-SA 4.0 | null | 2023-01-01T14:49:51.247 | 2023-01-02T11:25:58.207 | 2023-01-02T11:25:58.207 | 1,841,839 | 1,841,839 | null |
74,975,505 | 2 | null | 74,974,681 | 1 | null | I rather think the firebase query works in ASCII order. In ASCII order, numbers appear before letters so starting at 'a letter string' and ending at 'a number string' is likely to cause you problems.
I don't see a '1' in your example of 'Series', you aren't trying to reference the '1' child in the 'Inventory' node are you?
| null | CC BY-SA 4.0 | null | 2023-01-01T15:34:05.933 | 2023-01-01T15:34:05.933 | null | null | 10,376,604 | null |
74,975,513 | 2 | null | 74,776,213 | 0 | null | I ran into this as well and don't see a solution with Xcode 14. I may have to investigate how to revert to Xcode 13 as I don't think I use any advanced iOS features and have older devices to test on.
| null | CC BY-SA 4.0 | null | 2023-01-01T15:34:36.363 | 2023-01-01T15:34:36.363 | null | null | 7,047,809 | null |
74,975,574 | 2 | null | 61,148,025 | 0 | null | ```
let imageView = UIImageView()
let int = Int.random(in: 1..<3)
override func viewDidLoad() {
super.viewDidLoad()
imageView.frame = CGRect(x: 20, y: 120, width: 353, height: 400)
imageView.image = UIImage(named: "card\(int)")
imageView.contentMode = .scaleAspectFit
imageView.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(imageView)
}
```
| null | CC BY-SA 4.0 | null | 2023-01-01T15:45:43.707 | 2023-01-05T16:30:24.633 | 2023-01-05T16:30:24.633 | 2,125,010 | 17,702,514 | null |
74,975,618 | 2 | null | 74,975,267 | 0 | null | Named aggregation does not allow extra parameter to be passed to your function. You can use numpy boardcasting:
```
attr_cols = ["s_num", "ip", "f_num", "direction"]
score_cols = df.columns[df.columns.str.match("algo_\d+_score")]
# Convert everything to numpy to prepare for broadcasting
score = df[score_cols].to_numpy()
threshold = np.array([0.1, 0.5])
# Raise `threshold` up 2 dimensions so that every value in `score` is
# broadcast against every value in `threshold`
mask = score > threshold[:, None, None]
# Assemble the result
row_index = pd.MultiIndex.from_frame(df[attr_cols])
col_index = pd.MultiIndex.from_product([threshold, score_cols], names=["threshold", "algo"])
result = (
pd.DataFrame(np.hstack(mask), index=row_index, columns=col_index)
.groupby(attr_cols)
.sum()
)
```
Result:
```
threshold 0.1 0.5
algo algo_1_score algo_2_score algo_1_score algo_2_score
s_num ip f_num direction
0.0 0.0 0.0 X 1 1 1 1
2.0 0.0 X 2 2 0 2
1.0 X 3 3 0 3
2.0 X 4 4 0 3
```
| null | CC BY-SA 4.0 | null | 2023-01-01T15:53:00.620 | 2023-01-01T15:53:00.620 | null | null | 2,538,939 | null |
74,975,809 | 2 | null | 61,325,314 | 0 | null | `ConfusionMatrixDisplay` offers more control and flexibility when visualizing a confusion matrix than `plot_confusion_matrix`. For more info:
[docs](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.ConfusionMatrixDisplay.html#sklearn.metrics.ConfusionMatrixDisplay.from_predictions)
```
from sklearn.metrics import ConfusionMatrixDisplay
y_true = [0,1,1,0,1]
y_pred = [0,1,0,1,0]
labels = ['Good','Bad'] # 0: Good and 1: Bad
disp = ConfusionMatrixDisplay.from_predictions(
y_true,
y_pred,
display_labels=labels,
cmap=plt.cm.Blues
)
fig = disp.figure_
fig.set_figwidth(10)
fig.set_figheight(10)
fig.suptitle('Plot of confusion matrix')
```
| null | CC BY-SA 4.0 | null | 2023-01-01T16:25:40.400 | 2023-01-01T16:25:40.400 | null | null | 20,748,105 | null |
74,975,824 | 2 | null | 74,975,227 | 0 | null | I'd recommend making 2 buttons/a tags:
```
body {
padding: 4em;
background-color: black;
}
.button {
position: relative;
}
.firstButton,
.secondButton {
position: absolute;
display: inline-block;
padding: 1em;
text-align: center;
color: white;
text-decoration: none;
border: 1px solid white;
}
.firstButton {
visibility: hidden;
}
.button:hover .firstButton {
transform: rotateZ(45deg);
background: #E83054;
visibility: visible;
}
.button:hover .secondButton {
transform: rotateZ(-45deg);
background: #21B6CD;
}
```
```
<div class="button">
<a class="firstButton" href="">Book Now</a>
<a class="secondButton" href="">Book Now</a>
</div>
```
| null | CC BY-SA 4.0 | null | 2023-01-01T16:27:49.467 | 2023-01-01T16:27:49.467 | null | null | 18,691,321 | null |
74,975,853 | 2 | null | 74,975,227 | 1 | null | You can use `::before` to apply this effect.
```
.wrapper{
height:300px;
background-color:gray;
}
.btn, .btn::before{
font-size:2rem;
color:white;
width:200px;
height:70px;
border:2px solid white;
transition:all 0.3s linear;
display:flex;
justify-content:center;
align-items:center;
}
.btn{
position:relative;
top:30%;
left:30%;
background-color:transparent;
}
.btn:hover {
background-color:#21b6cd;
transform: rotateZ(45deg);
border:none;
}
.btn::before {
content:"Book Now";
background-color:transparent;
position:absolute;
}
.btn:hover::before{
transform: rotateZ(-90deg);
background-color:#e72f54;
border:none;
}
```
```
<div class="wrapper">
<button class="btn">Book Now</button>
</div>
```
| null | CC BY-SA 4.0 | null | 2023-01-01T16:32:29.353 | 2023-01-01T16:42:17.637 | 2023-01-01T16:42:17.637 | 11,080,485 | 11,080,485 | null |
74,975,956 | 2 | null | 74,949,048 | 0 | null | `alphaShape`
`alphaShape` generates 2D or 3D .
This is the 1st surface
```
x=-5:1:5;y=-5:1:5;
[xx,yy]=meshgrid(x,y);
zz=[13.6 -8.2 -14.8 -6.6 1.4 0 -3.8 1.4 13.6 16.8 0
-8.2 -15.8 -7.9 2.2 3.8 0 0.6 7.3 10.1 0 -16.8
-14.8 -7.9 2.5 5.8 2.3 0 2.7 5.1 0 -10.1 -13.7
-6.6 2.2 5.9 3.0 -0.3 0 1.9 0 -5.1 -7.3 -1.4
1.4 3.8 2.3 -0.3 -0.9 0 0 -1.7 -2.7 -0.6 3.8
0 0 0 0 0 0 0 0 0 0 0
-3.8 0.6 2.7 1.7 0 0 0.9 0.3 -2.3 -3.8 -1.4
1.4 7.3 5.1 0 -1.7 0 0.3 -3.1 -5.8 -2.2 6.6
13.6 10.1 0 -5.1 -2.7 0 -2.3 -5.8 -2.5 7.9 14.8
16.8 0 -10.1 -7.3 -0.6 0 -3.8 -2.2 7.9 15.8 8.2
0 16.3 -13.6 -1.4 3.8 0 -1.4 6.6 14.8 8.2 -13.6];
figure(1)
sh1=mesh(xx,yy,zz)
```
[](https://i.stack.imgur.com/IF0yh.jpg)
And this is the 2nd surface
```
figure(2)
xb=-5:0.1:5;
yb=-5:0.1:5;
[xxb,yyb]=meshgrid(xb,yb);
zzb=interp2(xx,yy,zz,xxb,yyb,'cubic');
mesh(xxb,yyb,zzb)
```
[](https://i.stack.imgur.com/fpAak.jpg)
Now try `alphaShape` on the 1st surface
```
P1=[xx(:) yy(:) zz(:)];
shp1 = alphaShape(P1(:,1),P1(:,2),P1(:,3));
figure;
plot(shp1)
axis equal
```
voila : here is the contraption
[](https://i.stack.imgur.com/p1EZx.jpg)
and when attempting
```
A1=area(shp1)
```
bang :
```
Error using alphaShape/area
This method is only applicable to 2D alpha shapes.
```
One has to integrate adding up each flat surface.
The vertexs of each flat surface are available using the handle available from `mesh`
```
sh1=mesh(xx,yy,zz)
```
check the abridged properties
```
sh1 =
Surface with properties:
EdgeColor: 'flat'
LineStyle: '-'
FaceColor: [1 1 1]
FaceLighting: 'none'
FaceAlpha: 1
XData: [11×11 double]
YData: [11×11 double]
ZData: [11×11 double]
CData: [11×11 double]
```
click on `Show all properties` that shows up right after the abridged properties in to read all properties
```
AlignVertexCenters: off
AlphaData: 1
AlphaDataMapping: 'scaled'
AmbientStrength: 0.300000000000000
Annotation: [1×1 matlab.graphics.eventdata.Annotation]
BackFaceLighting: 'reverselit'
BeingDeleted: off
BusyAction: 'queue'
ButtonDownFcn: ''
CData: [11×11 double]
CDataMapping: 'scaled'
CDataMode: 'auto'
...
VertexNormals: [11×11×3 double]
VertexNormalsMode: 'auto'
Visible: on
XData: [11×11 double]
XDataMode: 'manual'
XDataSource: ''
YData: [11×11 double]
YDataMode: 'manual'
YDataSource: ''
ZData: [11×11 double]
ZDataSource: ''
```
In The there is a function called `surfarea`, thanks to Sky Santorius, that does exactly the task mentioned in point 2 which is what 石sh asks for.
`surfarea` is available in the following link :
[https://uk.mathworks.com/matlabcentral/fileexchange/62992-surface-area?s_tid=srchtitle_surface%20area_2](https://uk.mathworks.com/matlabcentral/fileexchange/62992-surface-area?s_tid=srchtitle_surface%20area_2)
Applying surfare to 1st surface
```
[A1,cell_areas_A1,centroid1]=surfarea(xx,yy,zz);
```
the resulting surface area is
```
A1 =
6.783763291711880e+02
```
and when calculating area of the interpolated 2nd surface
```
[A2,cell_areas_A2,centroid2]=surfarea(xxb,yyb,zzb);
```
the resulting surface area is
```
A2 =
6.504878453848488e+02
```
| null | CC BY-SA 4.0 | null | 2023-01-01T16:50:10.493 | 2023-01-01T16:50:10.493 | null | null | 9,927,941 | null |
74,976,056 | 2 | null | 74,668,385 | 8 | null |
## The Problem:
This is happening because you have a separate installation of Dart on your system. The Flutter SDK includes and manages it's own dart SDK, but you can use the dart SDK separately.
## Why it Matters
Flutter recommends that you use the dart SDK included with Flutter because Flutter manages it - It will automatically use and upgrade supported versions when using the `flutter upgrade` command on your terminal, and during initial install.
Flutter is noticing that you have a dart SDK install that did not come with the Flutter SDK. It's giving you a warning because of the possible differences in versions (and possibly other configurations) that could prevent an optimal flutter development experience.
## System Path
[Here's an explanation of path](https://stackoverflow.com/questions/25949636/why-use-path-and-what-is-it). You will probably need to set your path environment variables to get the whole fix.
[This link shows the official Apple guide to working with the terminal](https://support.apple.com/guide/terminal/use-environment-variables-apd382cc5fa-4f58-4449-b20a-41c53c006f8f/2.13/mac/13.0) environment variables (including path) but a quick google around should help you find any answers you can't find here.
The path resolves from "front" to "back" - meaning that if the executable in question occurs twice, it will grab the first one. Flutter doctor wants you to add the flutter dart path at the so that subsequent dart calls will resolve to the Flutter Dart SDK.
## The High-Level Solution
Unless you're doing dart development outside flutter, you don't need an additional dart SDK. Most of the time the Flutter dart SDK will work for cases besides flutter as well.
I would recommend removing your other dart install, and using the dart install that comes with flutter. This process will vary depending on how you installed the other dart SDK.
## TLDR/Quick Fix
based on what you provided, run this on your Zsh command-line:
`export PATH="/home/ankit/flutter/bin:$PATH"`
It will only work until you restart your computer.
| null | CC BY-SA 4.0 | null | 2023-01-01T17:05:46.747 | 2023-01-01T17:06:24.153 | 2023-01-01T17:06:24.153 | 20,905,996 | 20,905,996 | null |
74,976,079 | 2 | null | 66,889,235 | 0 | null | I have the same error what take me a lot of time to fix. And finally I found my reason that I meet a problem with duplicated extension in the same project. My one is "External Dependency Manager" what somehow installed already on Unity Package Manager, after I delete old Admob plugin and install new one what make install new "External Dependency Manager" without override or delete old one. That make Unity not work well.
So check and try to delete/uninstall "External Dependency Manager" in Unity Package Manager first then import new one will be fine. At least in my case
Hope this help
| null | CC BY-SA 4.0 | null | 2023-01-01T17:11:16.097 | 2023-01-01T17:11:16.097 | null | null | 713,101 | null |
74,976,156 | 2 | null | 74,976,124 | 0 | null | If your static files are loaded and when you make a change, you need to reset your browser cache. For this, you need to press the Ctrl + F5.
Sometimes you may need to run the project again, especially when you edit your settings.py file
| null | CC BY-SA 4.0 | null | 2023-01-01T17:22:01.873 | 2023-01-01T17:42:05.337 | 2023-01-01T17:42:05.337 | 20,835,376 | 20,835,376 | null |
74,976,200 | 2 | null | 74,972,474 | 0 | null | As you're using C#, have a look at [SMO](https://learn.microsoft.com/en-us/sql/relational-databases/server-management-objects-smo/sql-server-management-objects-smo-programming-guide?view=sql-server-ver16). Here's a demonstration via powershell (which is an expedient way for me to demonstrate):
```
$db_server = New-Object Microsoft.SqlServer.Management.SMO.Server .;
$db = $db_server.Databases['AdventureWorks2019'];
$tables = $db.Tables;
```
| null | CC BY-SA 4.0 | null | 2023-01-01T17:28:04.650 | 2023-01-01T17:28:04.650 | null | null | 568,209 | null |
74,976,497 | 2 | null | 74,922,652 | 0 | null | ```
//To set image literals into the array you can use the below variable array.
var imageLiteralArray = [
UIImage(imageLiteralResourceName: "card1"),
UIImage(imageLiteralResourceName: "card2")
]
//to assign array to image view you can use the below code
imageView.image = imageLiteralArray[1]
```
| null | CC BY-SA 4.0 | null | 2023-01-01T18:14:22.027 | 2023-01-01T18:14:22.027 | null | null | 17,702,514 | null |
74,976,531 | 2 | null | 74,976,518 | 0 | null | Should be:
```
CompletedPanel.propTypes = {
tour: PropTypes.object,
impossible: PropTypes.bool,
};
```
| null | CC BY-SA 4.0 | null | 2023-01-01T18:19:13.457 | 2023-01-01T18:19:13.457 | null | null | 5,089,567 | null |
74,976,591 | 2 | null | 74,976,416 | 1 | null | Exchange the colors in `.cta-button-menu:hover` set `background: #e72f54` and `.cta-button-menu:hover::before` set `background-color:#21B6CD`. And also change the degrees. Hope this works on your side
```
ul {
margin-top: 60px;
}
.cta-button-menu,
.cta-button-menu::before {
transition: all 0.3s linear !important;
width: 120px !important;
height: 50px !important;
display: inline-flex !important;
justify-content: center !important;
align-items: center !important;
}
.cta-button-menu:hover {
transform: rotateZ(45deg) !important;
background: #e72f54 !important;
color: white !important;
}
.cta-button-menu::before {
content: "Book Now" !important;
background-color: transparent !important;
position: absolute !important;
@include main-font($white, 16px !important, $font-bold !important);
}
.cta-button-menu:hover::before {
transform: rotateZ(-90deg) !important;
background-color: #21B6CD !important;
border: none !important;
}
```
```
<ul>
<li class="cta-button-menu"><a class="mega-menu-link" tabindex="0">Book Now</a></li>
</ul>
```
| null | CC BY-SA 4.0 | null | 2023-01-01T18:30:34.343 | 2023-01-01T20:25:30.677 | 2023-01-01T20:25:30.677 | 2,817,442 | 11,858,790 | null |
74,976,606 | 2 | null | 74,976,416 | 0 | null | You can achieve this using a `transform` and `transform-style`.
```
.cta-button-menu {
transform-style: preserve-3d;
}
.cta-button-menu:hover::before {
transform: rotateZ(90deg) translateZ(-1px);
}
```
[https://codepen.io/James0r/pen/GRBqjOb](https://codepen.io/James0r/pen/GRBqjOb)
Not supported in IE11.
| null | CC BY-SA 4.0 | null | 2023-01-01T18:33:13.223 | 2023-01-01T18:33:13.223 | null | null | 9,202,450 | null |
74,976,619 | 2 | null | 74,976,416 | 0 | null | @SinsiaM you got me thinking a bit on this and I just changed the following:
```
.cta-button-menu:hover {
transform:rotateZ(45deg) !important;
background-color:#e72f54 !important;
color: white !important;
}
.cta-button-menu:hover::before{
transform: rotateZ(270deg) !important;
background: #21B6CD !important;
z-index: 1;
border:none !important;
}
```
| null | CC BY-SA 4.0 | null | 2023-01-01T18:36:26.377 | 2023-01-01T18:36:26.377 | null | null | 13,276,923 | null |
74,976,887 | 2 | null | 74,976,574 | 1 | null | I think you need to map like below for the keys of an object
```
import { useEffect, useState } from "react";
import axios from "axios";
function App() {
const [posts, setPosts] = useState([]);
useEffect(() => {
axios
.get("https://economia.awesomeapi.com.br/json/last/USD-BRL")
.then((response) => {
console.log("ok");
console.log(response.data);
console.log(response.data.USDBRL);
console.log(response.data.USDBRL.bid);
console.log(response.data.USDBRL.create_date);
setPosts(response.data.USDBRL);
})
.catch(() => {
console.log("erro");
});
}, []);
return (
<>
{Object.keys(posts).map((keyName, i) => {
if (keyName === "bid") {
return (
<li className="travelcompany-input" key={i}>
<span className="input-label">
Bid: {posts["bid"]}
Create Date: {posts["create_date"]}
</span>
</li>
);
}
})}
</>
);
}
export default App;
```
and the result is like below
[](https://i.stack.imgur.com/GwCBa.jpg)
| null | CC BY-SA 4.0 | null | 2023-01-01T19:25:59.820 | 2023-01-01T20:00:32.733 | 2023-01-01T20:00:32.733 | 9,923,629 | 9,923,629 | null |
74,976,922 | 2 | null | 74,942,491 | 0 | null | Earlier in 2021, Google Cloud made it possible for CloudRun serverless vpc connector to use the [allow and target-tags](https://cloud.google.com/vpc/docs/configure-serverless-vpc-access#restrict-access) flags to create an ingress firewall rule. It allows targeting the traffic only to a specific resource with in VPC.
> Google doc states that a firewall rule is created to allow ingress from the connector's subnet to all destinations in the VPC network. This is against my company's security policy as we have other services in this VPC (VM's, GKE instances etc). So I need to restrict connector to be able to reach all destinations in VPC network. Is there a preferred way of achieving this?
Create a firewall rule and set the priority for this rule to be a lower value than the one you created in the previous step.
```
gcloud compute firewall-rules create RULE_NAME \
--allow=PROTOCOL \
--source-tags=VPC_CONNECTOR_NETWORK_TAG \
--direction=INGRESS \
--network=VPC_NETWORK \
--target-tags=RESOURCE_TAG \
--priority=PRIORITY
```
Hope it resolves your issue.
| null | CC BY-SA 4.0 | null | 2023-01-01T19:31:46.833 | 2023-01-01T22:48:18.663 | 2023-01-01T22:48:18.663 | 8,752,165 | 8,752,165 | null |
74,977,428 | 2 | null | 74,977,363 | 0 | null | You're on the right track! But you're fumbling a little with the usage of `display: flex;` and `position: absolute;`. `display: flex;` should be used on the parent to see the result on the child(ren), you're using it directly on the children (`.index_title` and `.index_description`).
For trying to position 2 elements together with `position: absolute;` I'd recommend wrapping them together, so you only have to position 1 element!
```
.index {
width: 400px;
height: 400px;
background-color: white;
float: left;
margin-right: 30px;
border-radius: 10px;
overflow: hidden;
position: relative;
color: white;
cursor: pointer;
}
.index_img {
width: 100%;
height: 100%;
z-index: -1;
}
.index_html {
background: url(web_image_html.jpeg) red;
background-position: center;
background-size: cover;
z-index: -1;
}
.index a {
color: #fff;
text-decoration: none;
}
.index_content {
width: 100%;
height: 80px;
position: absolute;
bottom: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: rgba(82, 81, 81, 0.56);
}
.index_title {
font-family: 'Roboto', sans-serif;
font-size: 30px;
color: #000;
}
.index_description {
font-family: 'Inter', sans-serif;
font-size: 18px;
}
.index_title,
.index_description {
width: 100%;
margin: 0;
text-align: center;
}
.index_html:hover {
animation: index-animate 3s ease-in-out;
}
@keyframes index-animate {
0% {
transform: scale(1);
}
100% {
transform: scale(1.3);
}
}
```
```
<div class="index">
<a href="">
<div class="index_img index_html"></div>
<div class="index_content">
<h2 class="index_title">HTML</h2>
<p class="index_description">Lorem ipsum dolor sit amet.</p>
</div>
</a>
</div>
```
| null | CC BY-SA 4.0 | null | 2023-01-01T21:12:59.207 | 2023-01-01T21:12:59.207 | null | null | 18,691,321 | null |
74,977,554 | 2 | null | 74,977,279 | 0 | null | This will require a little bit of JavaScript, but it can be put in your HTML document. The span tag can have a hover event call the JavaScript to change the image. Here is a simple example.
```
<img id="sampleImg">
<span id="span1" onmouseover="document.getElementById('sampleImg').src = 'image1.gif'"> Span 1</span>
<span id="span2" onmouseover="document.getElementById('sampleImg').src = 'image2.gif'">Span 2</span>
```
The image source paths will need changed to fit your needs, but otherwise this should be able to be implemented into your code. The onmouseover event in the span tag contains the JavaScript to change the given image's source.
I hope this solved your issue!
| null | CC BY-SA 4.0 | null | 2023-01-01T21:42:51.540 | 2023-01-01T21:42:51.540 | null | null | 20,907,129 | null |
74,977,929 | 2 | null | 70,736,960 | 0 | null | Your CSS is `scoped`: You have to remove `scoped` or use deep selectors.
```
<style>
.tabCourse .tabMenu .theme--light.v-tabs > .v-tabs-bar{
background-color: transparent !important;
}
</style>
```
or
```
<style scoped>
.tabCourse::v-deep .tabMenu .theme--light.v-tabs > .v-tabs-bar{
background-color: transparent !important;
}
</style>
```
See more: [https://vue-loader.vuejs.org/guide/scoped-css.html](https://vue-loader.vuejs.org/guide/scoped-css.html)
| null | CC BY-SA 4.0 | null | 2023-01-01T23:10:10.747 | 2023-01-02T06:54:36.697 | 2023-01-02T06:54:36.697 | 10,871,073 | 19,420,247 | null |
74,978,073 | 2 | null | 74,977,782 | 0 | null | Here's a worked example using `geomtextpath`:
```
library(geomtextpath)
x <- "https://raw.githubusercontent.com/karolo89/Raw_Data/main/Hurricane.csv"
hurricane <- read.csv(x)
ggplot(hurricane, aes(year, average, color = type)) +
geom_step(size=.8) +
geom_textline(aes(label = ifelse(type == "avg_h_15year",
"All Hurricanes",
"Major Hurricanes"), y = average + 1.2),
text_smoothing = 50, fontface = 2,
hjust = 0, linetype = 0, size = 7) +
annotate("text", x = 1900, y = 2.5, label = "Category 3 - 5", hjust = 0,
color = "#3b2d74") +
scale_x_continuous(breaks = seq(1860,2020,20)) +
scale_y_continuous(
limits = c(0,8.5),
breaks = seq(2,8,2),
expand = c(0,0)
) +
scale_color_manual(values = c("#735ad2", "#3b2d74"), guide = "none") +
labs(
y = " ",
x = " ",
title = "15-year average recorded Atlantic basin hurricanes, 1851-2019"
) +
theme_minimal()
```
[](https://i.stack.imgur.com/4easg.png)
| null | CC BY-SA 4.0 | null | 2023-01-01T23:46:48.607 | 2023-01-02T00:01:33.697 | 2023-01-02T00:01:33.697 | 12,500,315 | 12,500,315 | null |
74,978,464 | 2 | null | 69,856,439 | 1 | null | Yes so weird noone talking about this s. Normal column like 5x faster and smooth than lazy column. Problem is when loading data in normal column freezing screen like 2 second for 50 card but after 0 freezing or slowing etc.
| null | CC BY-SA 4.0 | null | 2023-01-02T01:45:54.563 | 2023-01-02T01:45:54.563 | null | null | 19,706,381 | null |
74,979,323 | 2 | null | 74,979,146 | 0 | null | You can solve this issue by applying `margin-top: 0` to `.project-tile` and applying `display: block` to `img`.
| null | CC BY-SA 4.0 | null | 2023-01-02T05:50:22.800 | 2023-01-02T05:50:22.800 | null | null | 5,270,231 | null |
74,979,450 | 2 | null | 74,979,063 | 0 | null | I'm not sure what result you expect, but - to me it looks as if you have to get rid of inner join in a subquery and it to a table in the query. Also, it is unclear whether `where` condition(s) in subquery should actually be moved out.
As of table alias: its purpose is to make query easier to read. Using alias which is just the same as table name (`from LIB_KSIAZKA LIB_KSIAZKA`) doesn't help at all.
I'd suggest something like this:
```
select
a.ksiazkaid as "id książki",
a.tytul as "tytuł",
a.imie as "imię autora",
a.nazwisko as "nazwisko autora",
a.gatunek as "gatunek",
a.ocena as "ocena" ,
--
(select count (e.egzemplarzid)
from lib_egzemplarz e
where e.ksiazkaid = a.ksiazkaid --> correlate subquery to "main" table
and e.status = 'DOSTĘPNA'
and e.ksiazkaid = :P3_ID --> should that be moved out ...
) as "liczba dostępnych egzemplarzy"
from lib_ksiazka a
-- where a.ksiazkaid = :P3_ID --> ... down here?
```
| null | CC BY-SA 4.0 | null | 2023-01-02T06:18:05.460 | 2023-01-02T06:18:05.460 | null | null | 9,097,906 | null |
74,979,568 | 2 | null | 74,979,211 | 0 | null | Turns out, it is possible to have Value Mappings that are regex-based - for this example, the random strings can be bucketed by a prefix, with a color assigned to each bucket. The random portion obeys the alphabet `[a-z0-9]`, for a total of 36 characters. I created 18 regex-based Value mappings, each covering random strings that start with one of two characters (this is only slightly tedious):

This is the result:

`Special``Empty``Transparent`
To create a regex value mapping, click the `Add a new mapping` button in the `Value mappings` dialog:

and then pick `Regex`

| null | CC BY-SA 4.0 | null | 2023-01-02T06:37:16.343 | 2023-01-02T06:37:16.343 | null | null | 8,916,171 | null |
74,979,716 | 2 | null | 74,979,673 | 0 | null | You can try this code as per your usage and implement this on your code.
```
package com.example.myapplication
import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Card
import androidx.compose.material.Text
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import com.example.myapplication.ui.theme.MyApplicationTheme
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
MyApplicationTheme {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier
.fillMaxWidth()
.fillMaxHeight()
.padding(20.dp)) {
Card(
elevation = 4.dp,
shape = RoundedCornerShape(20.dp)
) {
Column(modifier = Modifier.padding(10.dp)) {
Text("AB CDE", fontWeight = FontWeight.W700)
Text("+0 12345678")
Text("XYZ city.", color = Color.Gray)
}
}
Spacer(modifier = Modifier.height(30.dp))
Card(
elevation = 4.dp,
) {
Column(modifier = Modifier.padding(10.dp)) {
Text("AB CDE", fontWeight = FontWeight.W700)
Text("+0 12345678")
Text("XYZ city.", color = Color.Gray)
}
}
}
}
}
}
}
```
| null | CC BY-SA 4.0 | null | 2023-01-02T07:03:57.177 | 2023-01-02T07:03:57.177 | null | null | 5,496,625 | null |
74,979,850 | 2 | null | 74,977,363 | 0 | null | Remove overflow hidden from the below code
```
.index {
width: 400px;
height: 400px;
background-color: white;
float: left;
margin-right: 30px;
border-radius: 10px;
position: relative;
color: white;
cursor: pointer;
}
```
| null | CC BY-SA 4.0 | null | 2023-01-02T07:25:20.330 | 2023-01-02T07:25:20.330 | null | null | 12,241,962 | null |
74,979,885 | 2 | null | 74,979,302 | 2 | null | As @underdog pointed out in the comments, the problem was that there were other classes with the same name in another php file:

When I changed the name of my class, the `Global` prefix was no longer automatically added by VSCode.

| null | CC BY-SA 4.0 | null | 2023-01-02T07:30:12.797 | 2023-01-05T08:00:19.423 | 2023-01-05T08:00:19.423 | 1,974,224 | 14,906,678 | null |
74,980,158 | 2 | null | 74,979,898 | 2 | null | From the error messages in your screenshot we see that Dymola cannot resolve the paths starting with `Modelica.Units.SI`. They are correct in older Modelica library versions, but not in the current release 4.0.0.
The ExternalMedia library requires Modelica 3.2.3, but recent Dymola versions have Modelica 4.0.0 installed as default.
You have to install Modelica 3.2.3 as described in the appendix of the , section .
1. Get the zip file CompatibilityLibraries MSL 3.2.3.zip located in the extras directory of the Dymola installer
2. Extract the zip to the library folder of your Dymola installation, typically C:\Program Files\Dymola 2023x\Modelica\Library, but before you do that, read the next point.
3. This is not noted in the user manual, but the file Complex.mo and the folder ModelicaReference will be overwritten. I suggest to make a backup first, so you can easily revert.
4. Start Dymola and change the default Modelica library version under File > Options > Version.
5. The user manual also suggests to tick Force upgrade of models to this version, but I am not sure if it makes a difference in your case.
6. Restart Dymola, then load your libraries.
| null | CC BY-SA 4.0 | null | 2023-01-02T08:11:02.603 | 2023-01-09T08:25:37.377 | 2023-01-09T08:25:37.377 | 8,725,275 | 8,725,275 | null |
74,980,182 | 2 | null | 74,979,577 | 0 | null | First thing to know is that under most situations is that kubernetes pods run docker containers that are Linux based. This means that even if you are running your kubernetes node on a Windows machine it will be running in a Linux virtual machine. This means 2 things.
1. All paths used will need to use the Unix style
2. it will have no direct access to files on the host Windows machine
Next while you have requested a volume to be mounted into the pod at `/data/nodered` and defined both a physical volume and a physical volume claim (which I'm not sure will actually map to each other in this case) they will be in the Linux Virtual machine not the urgently Windows machine so will not have access to files on the host.
Even if you had managed to copy the file into the directory that is backing the volume mount in the pod the correct path to give to Node-RED would be something like `/data/nodered/test.txt` based on the volume mount
| null | CC BY-SA 4.0 | null | 2023-01-02T08:13:35.077 | 2023-01-02T08:13:35.077 | null | null | 504,554 | null |
74,980,263 | 2 | null | 74,980,209 | 0 | null | You can use `indicatorColor` to set it green.
```
TabBar(
indicatorColor: Colors.green, //this one , you can remove `getIndicatorAndLabelColor`
indicatorWeight: 4,
indicatorPadding:
const EdgeInsets.only(left: 15, right: 15, bottom: 10),
tabs: <Widget>[
```
| null | CC BY-SA 4.0 | null | 2023-01-02T08:25:05.130 | 2023-01-02T08:25:05.130 | null | null | 10,157,127 | null |
74,980,372 | 2 | null | 74,980,209 | 0 | null | thanks @Yeasin Sheikh , finally i found the solution
```
indicator: ShapeDecoration(
shape: UnderlineInputBorder(
borderSide: BorderSide(
color: Colors.green,
width: 3,
style: BorderStyle.solid),
),
),
```
| null | CC BY-SA 4.0 | null | 2023-01-02T08:40:53.870 | 2023-01-02T08:41:37.157 | 2023-01-02T08:41:37.157 | 16,717,287 | 16,717,287 | null |
74,980,400 | 2 | null | 74,980,325 | 1 | null | In your case, `reply_to_message` is None so you cannot extract user_id from it.
I assume you can write
```
user_id = CallbackQuery.message.reply_to_message.from_user.id if CallbackQuery.message.reply_to_message else None
```
to prevent the error from happening.
| null | CC BY-SA 4.0 | null | 2023-01-02T08:44:53.333 | 2023-01-02T08:44:53.333 | null | null | 4,845,935 | null |
74,980,584 | 2 | null | 74,980,539 | 0 | null | You cant test your touch screen using program.
Touch screen can be tested only touching your screen. App just sending request to OS to press point on the screen.
| null | CC BY-SA 4.0 | null | 2023-01-02T09:09:00.130 | 2023-01-02T09:09:00.130 | null | null | 19,445,228 | null |
74,980,595 | 2 | null | 66,746,771 | 0 | null | When you evoke authentication I hope you are aware that users can register and be members of Aws Cognito user pools. In this case you can adjust the authentication within your own model the way it's specified in the first answer above or maybe give Groups within Cogito Userpool the right access
ex: { allow:groups , groups:["Admin"] , operations:[create,read, delete, update]}
You can let all other Queries accessible to AWS Congnito Users and Groups as well the way you plan you amplify App. Don't forget to check the
"aws_appsync_authenticationType": "AMAZON_COGNITO_USER_POOLS"
| null | CC BY-SA 4.0 | null | 2023-01-02T09:11:33.707 | 2023-01-02T09:11:33.707 | null | null | 3,101,813 | null |
74,980,642 | 2 | null | 74,979,950 | 1 | null | Firstly I would create a class, 'Yourclass' with the name you want and append it to the head using javascript.
Example: (Changes the font and creates a class and a keyframe for shadows)
```
var style = document.createElement('style');
style.type = 'text/css';
var keyFrames = '\
body {\
font-family: Copperplate;\
}\
.shadows {\
animation: shadowmove 4s infinite;\
}\
\
@keyframes shadowmove {\
50% {box-shadow: 0px 0px 15px black;}\
}';
style.innerHTML = keyFrames.replace(/A_DYNAMIC_VALUE/g, "180deg");
document.getElementsByTagName('head')[0].appendChild(style);
```
See this: [Add CSS to <head> with JavaScript?](https://stackoverflow.com/questions/3922139/add-css-to-head-with-javascript)
Use a [querySelector](https://www.w3schools.com/jsref/met_element_queryselector.asp) or [getElementbyID](https://www.w3schools.com/jsref/met_document_getelementbyid.asp) to go through each id and then using the Parent Element I would get, well, the [parent Element](https://www.w3schools.com/jsref/prop_node_parentelement.asp). Then [append](https://www.w3schools.com/jsref/met_node_appendchild.asp) a [Child](https://www.w3schools.com/jsref/prop_element_children.asp) (in your case an image).
To that child [add the ClassName](https://www.w3schools.com/howto/howto_js_add_class.asp) 'Yourclass' to those elements and continue iterating through every ID you have.
hope you like this approach!
Comment anything you need and I’ll try to add some code (I’ve done some extensions that do similar things).
| null | CC BY-SA 4.0 | null | 2023-01-02T09:17:34.190 | 2023-01-03T10:39:27.413 | 2023-01-03T10:39:27.413 | 15,164,751 | 15,164,751 | null |
74,980,837 | 2 | null | 74,976,918 | 1 | null | I'd suggest that you `json_encode` the raw db query results rather than performing peculiar datetime manipulations within PHP - what does `The following line will be used to slice the chart` mean? The format held in the database looks perfectly fine to be used with Google Charts / DataTable - javascript will be able to cast the string values returned into usable `date` objects and also cast the temperature values as floats.
In a test (using own data to emulate) the JSON printed to the page is like this:
```
const json=[
{
"Temperatur_DPS310": "194",
"cur_datum": "2022-10-31 15:54:00"
},
{
"Temperatur_DPS310": "150",
"cur_datum": "2022-11-02 16:08:00"
},
{
"Temperatur_DPS310": "143",
"cur_datum": "2022-11-02 16:09:21"
},
{
"Temperatur_DPS310": "153",
"cur_datum": "2022-11-02 16:21:14"
} //.........etc ( temperatures as fictitious )
```
And the page that queries the db and renders the chart
```
<?php
#dbconn required
$sql='SELECT `cur_datum`, `Temperatur_DPS310` FROM `Outdoor`';
$res=$db->query( $sql );
$data=array();
while( $rs=$res->fetch_assoc() )$data[]=$rs;
$json=json_encode( $data, JSON_PRETTY_PRINT );
?>
<html>
<head>
<script src='https://www.gstatic.com/charts/loader.js'></script>
<script>
google.load('visualization', '1.0', {'packages':['corechart']});
google.setOnLoadCallback( drawChart );
<?php
printf('
const json=%s;
',$json
);
?>
function drawChart() {
// create the empty datatable and add two columns
let dataTbl = new google.visualization.DataTable();
dataTbl.addColumn('datetime', 'Time');
dataTbl.addColumn('number', 'Price (Euro)');
// recordset has two columns per record
// create each record as an array and let the dataTbl add them
Object.keys( json ).forEach(key=>{
let row=json[ key ];
let rs=[
new Date( row.cur_datum ),
parseFloat( row.Temperatur_DPS310 )
];
dataTbl.addRow( rs )
})
let options = {/* a mix of optios from the question */
title : 'AEX Stock: Nationale Nederlanden (NN)',
width : 1400,
height : 540,
legend : 'true',
curveType: 'function',
pointSize: 5,
vAxis: { title: 'Price (Euro)', maxValue: 21.50, minValue: 20.50 },
hAxis: { title: 'Time of day (Hours:Minutes)', format: 'HH:mm', gridlines: {count:9} },
tooltip: {isHtml: true}
};
var chart = new google.visualization.LineChart( document.getElementById('chart_div') );
chart.draw( dataTbl, options );
}
</script>
</head>
<body>
<div id='chart_div' style='width:1500; height:600'></div>
</body>
</html>
```
The above code, using own data, rendered the following chart:
[](https://i.stack.imgur.com/6sOZ0.jpg)
| null | CC BY-SA 4.0 | null | 2023-01-02T09:40:02.013 | 2023-01-02T09:40:02.013 | null | null | 3,603,681 | null |
74,981,288 | 2 | null | 74,975,713 | 0 | null | You need a datepicker, the answers to this question show several relatively simple solutions: [What's the cleanest, simplest-to-get running datepicker in Django?](https://stackoverflow.com/questions/3367091/whats-the-cleanest-simplest-to-get-running-datepicker-in-django)
| null | CC BY-SA 4.0 | null | 2023-01-02T10:29:34.653 | 2023-01-02T10:29:34.653 | null | null | 18,728,725 | null |
74,981,294 | 2 | null | 73,229,142 | 0 | null | In my case this is 100% working.
use shell_exec function to execute curl instead of curl_setopt
```
public static function download_image($url){
$token = "xxx";
shell_exec("cd upload && curl \
'".$url."' \
-H 'Authorization: Bearer ".$token."' > ".uniqid().".png");
}
```
Enjoy!
| null | CC BY-SA 4.0 | null | 2023-01-02T10:29:56.890 | 2023-01-02T10:29:56.890 | null | null | 7,648,010 | null |
74,981,506 | 2 | null | 74,920,318 | 0 | null | The reason why the rendering is called twice is related to the lifecycle of vue components. Vue will always render the component, when a reactive value changes. As you use a function inside a template, this will be called on each render cycle of the component.
In your example the `info.value` update will trigger a rerender. Also if using a function, vue needs to allways trigger a rerender if you change any reactive value.
That is also why you should not use functions inside the template. Whenever possible you should use computed properties and apply it inside the template. The advantage is, that vue will internally cache the value of the computed property and only update the component, if some of the values you use inside is updated.
You should make sure, you understand how the [vue lifecycle](https://vuejs.org/guide/essentials/lifecycle.html) works.
A better approach would be to use a computed property that is rendered inside your template. The following shows an example that might work for you.
```
const direction = ref('');
const pageParam = computed(() => {
try {
let url_string = null;
switch (direction.value) {
case 'next':
url_string = info.value.next;
break;
case 'previous':
url_string = info.value.previous;
break;
default:
return route.query.page;
}
const url = new URL(url_string);
return url.searchParams.get('page');
} catch (err) {
console.log(err);
return '1'; // you need to return the fallback page
}
});
```
Inside the template you use
```
<template>
<span class='current-page'>
{{ pageParam }}
</span>
</template>
```
| null | CC BY-SA 4.0 | null | 2023-01-02T10:51:53.227 | 2023-01-02T10:51:53.227 | null | null | 9,154,829 | null |
74,981,609 | 2 | null | 73,718,064 | 0 | null | i see the question is a little bit older now, so i don't know how relevant this still is for you.
but from first glance it seems you want your checkbox with the name CheckBox2 to not be checked, right?
in that case you just write down `false` in your expression. To show an empty box you also have to set a border in the border property. Otherwise there will be nothing to see.
if you want it to be checked if some other condition is met you write in your expression `SomeCondition == someValue`
Basically the expression is what you would write inside the brackets after an `if` in c#
if that is true your checkbox will be checked if not it won't.
| null | CC BY-SA 4.0 | null | 2023-01-02T11:03:33.897 | 2023-01-02T11:03:33.897 | null | null | 13,912,652 | null |
74,981,704 | 2 | null | 74,979,865 | 0 | null | As per [417 Expectation Failed](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/417) documentation:
> The HTTP `417 Expectation Failed` client error response code indicates that the expectation given in the request's [Expect](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expect) header could not be met.See the [Expect](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expect) header for more details.
It means that your server returns other [HTTP Status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) than [100](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/100) so either check your server logs to identify the reason or remove the Expect header from the [HTTP Header Manager](https://www.blazemeter.com/blog/http-header-manager) (or maybe apply it to the request where the header is needed, see JMeter User Manual chapter on [Scoping Rules](https://jmeter.apache.org/usermanual/test_plan.html#scoping_rules) for more details)
| null | CC BY-SA 4.0 | null | 2023-01-02T11:12:25.167 | 2023-01-02T11:12:25.167 | null | null | 2,897,748 | null |
74,981,787 | 2 | null | 74,981,428 | 1 | null | I recommend using this library for creating charts:
[https://github.com/PhilJay/MPAndroidChart](https://github.com/PhilJay/MPAndroidChart)
| null | CC BY-SA 4.0 | null | 2023-01-02T11:21:09.257 | 2023-01-02T11:21:09.257 | null | null | 6,151,355 | null |
74,981,876 | 2 | null | 74,949,841 | 0 | null | I wonder how often I see developers using `getElementById` or `querySelector` in vue components. You should make sure to use so called [template refs](https://vuejs.org/guide/essentials/template-refs.html).
You might try the following approach (which I didn’t test, but something like this should work).
```
<div>
<div ref="exam">
<h2>文本 Example</h2>
<p>example example example example example example</p>
</div>
<div ref="result"></div>
</div>
```
```
// inside script setup
import html2canvas from 'html2canvas'
const exam = ref<HTMLDivElement | null>(null);
const result = ref<HTMLDivElement | null>(null);
const cvs = ref<??? | undefined>();
const output = async () => {
if (!exam.value || !result.value) return;
// saving the cvs value in a ref variable
// to keep it available on rerenderings.
cvs.value = await html2canvas(exam.value)
}
// add a watcher that append the result
// in order to apply it every time the
// something changes because vue will
// empty the element each time you update something.
watch(
cvs,
(newCvs) => {
if (!newCvs || !result.value) return;
// clean the result element
result.value.innerHTML = '';
// append the new created cvs
result.value.append(newCvs);
},
{ flush: 'post' },
)
```
| null | CC BY-SA 4.0 | null | 2023-01-02T11:29:38.770 | 2023-01-04T12:09:42.767 | 2023-01-04T12:09:42.767 | 9,154,829 | 9,154,829 | null |
74,982,109 | 2 | null | 74,981,863 | 3 | null | The boxes around the legend keys reflect the `geom_ribbon`. To remove them you could add `show.legend=FALSE` to `geom_ribbon`.
Using some fake example data:
```
library(ggplot2)
df <- data.frame(
year = 2005:2020,
value = 1:16,
min_range = 1:16 - 1,
max_range = 1:16 + 1
)
base <- ggplot(df, aes(year, value, color = "median")) +
geom_line() +
scale_colour_manual(values = c(
"min" = "#878787", "q1" = "#B5B5B5", "median" = "#27408B",
"q3" = "#B5B5B5", "max" = "#878787"
))
```
First replicating your issue:
```
base +
geom_ribbon(aes(ymin = min_range, ymax = max_range), fill = "grey70", alpha = 0.1)
```

And second using `show.legend = FALSE`:
```
base +
geom_ribbon(aes(ymin = min_range, ymax = max_range), fill = "grey70", alpha = 0.1, show.legend = FALSE)
```

| null | CC BY-SA 4.0 | null | 2023-01-02T11:53:34.613 | 2023-01-02T11:53:34.613 | null | null | 12,993,861 | null |
74,982,130 | 2 | null | 74,981,863 | 3 | null | Another option is to move the color aesthetic only to geom_line
```
library(ggplot2)
p <- ggplot(iris, aes(Sepal.Length, Petal.Width, color = Species)) +
geom_smooth()
df_p <- layer_data(p)
#> `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## something similar to your plot
ggplot(df_p, aes(color = as.character(group))) +
geom_ribbon(aes(x = x, ymin = ymin, ymax = ymax)) +
geom_line(aes(x, y))
```

```
## change the location of your color aesthetic to geom_line only
## you need to add a grouping aesthetic into the ribbon call
ggplot(df_p) +
geom_ribbon(aes(x = x, ymin = ymin, ymax = ymax, group = as.character(group))) +
geom_line(aes(x, y, color = as.character(group)))
```

[reprex v2.0.2](https://reprex.tidyverse.org)
| null | CC BY-SA 4.0 | null | 2023-01-02T11:56:38.280 | 2023-01-02T11:56:38.280 | null | null | 7,941,188 | null |
74,982,137 | 2 | null | 74,982,092 | 0 | null | "One or more layouts are missing the layout_width or layout_height attributes" seems pretty intuitive, but if you still don't know how to fix that:
[](https://i.stack.imgur.com/Ez4DB.png)
press on "Code" and copy all of the XML layout, then update your question with the code
| null | CC BY-SA 4.0 | null | 2023-01-02T11:57:06.633 | 2023-01-02T11:57:06.633 | null | null | 15,749,574 | null |
74,982,192 | 2 | null | 18,061,040 | 0 | null | Window->Perspective->Reset Prespective will solve that
| null | CC BY-SA 4.0 | null | 2023-01-02T12:02:12.757 | 2023-01-02T12:02:12.757 | null | null | 20,363,766 | null |
74,982,251 | 2 | null | 74,981,867 | 0 | null | The problem is that you are calling both `Z` and `F` with only one input, in the function `J`.
Then, the first thing you do is try to interpret the input as a 2 valued array (`x1,x2`) but they don't exist, as you defined `x` as e.g. `1`, by doing `Z(1)`.
I wonder if instead of using `Z(1)` etc, you meant to do `z=Z(x)` and then use `z(1)`, inside `J`.
| null | CC BY-SA 4.0 | null | 2023-01-02T12:07:38.520 | 2023-01-02T12:07:38.520 | null | null | 1,485,872 | null |
74,982,392 | 2 | null | 74,945,452 | 0 | null | There's no issue in the code, everything looks good. The problem is in the payload, that you're sending.
```
{
"shippingInfo": {
" address": "tunisia", // address has white space in the key, remove it
"city": "tunisia",
"state": "tunisia",
"country": "tunisia",
"pincode": 7100,
"phoneNum": 11558899
}
}
```
This whitespace is causing validation errors. Once you remove it, there wont be any error
| null | CC BY-SA 4.0 | null | 2023-01-02T12:24:09.953 | 2023-01-02T12:24:09.953 | null | null | 14,821,287 | null |
74,982,641 | 2 | null | 9,863,278 | 0 | null | Schematic for H-bridge circuit using IRF7105 dual channel Mosfet
[](https://i.stack.imgur.com/AWevb.png)
Mosfet based H bridge, miniature size and good for up to 2 amps continuous current using 20V, The schematic is tested in Proteus simulation software and replicated.
| null | CC BY-SA 4.0 | null | 2023-01-02T12:50:26.460 | 2023-01-02T13:02:26.540 | 2023-01-02T13:02:26.540 | 4,826,457 | 5,999,226 | null |
74,982,803 | 2 | null | 74,982,717 | 0 | null | If you are using windows, it is selected windows build by default on VS Code. You can select device on top section for android studio and bottom corner for vs-code.
[](https://i.stack.imgur.com/orBqg.png)
and then run the app again.
Also you can use command on terminal like
```
flutter run -d c
```
this will run on chrome(I am using `c` to select chrome).
If you like to build on Windows, you need to install Desktop development with C++. Check [How to build release version of windows app?](https://stackoverflow.com/a/70988211/10157127)
| null | CC BY-SA 4.0 | null | 2023-01-02T13:07:31.980 | 2023-01-02T13:07:31.980 | null | null | 10,157,127 | null |
74,982,903 | 2 | null | 60,705,902 | 0 | null | Try `sns.reset_orig()` before plotting.
| null | CC BY-SA 4.0 | null | 2023-01-02T13:18:12.307 | 2023-01-02T18:59:16.907 | 2023-01-02T18:59:16.907 | 2,347,649 | 20,911,644 | null |
74,982,950 | 2 | null | 74,931,281 | 0 | null | I think I located the same tutorial that you are referring to.
At [this instance](https://youtu.be/ArSB4HtLj3c?t=415), you can see that the Content Creator marks his choice over the `React` bullet answering the question of
> Which framework would you like to use?
What the above does, is that it basically downloads the project with `React` pre-configured for you to use, hence the components folder, where all the react components are to be placed.
You could add `React` to your project after you have initiated it, but since its just a tutorial I would advise simply deleting the project and starting all over again.
| null | CC BY-SA 4.0 | null | 2023-01-02T13:22:27.720 | 2023-01-02T13:22:27.720 | null | null | 8,894,067 | null |
74,982,968 | 2 | null | 74,975,133 | 1 | null | Thanks to [@DalmTo](https://stackoverflow.com/users/1841839/daimto)'s hints, I solved the problem.
So the fix for the such problem was by not using the credentials out of google.CredentialsFromJSON() func will return the token source without refreshing the token in case of passing the service account to that function, which means that you can't refresh your token when it expires again later. Also, anticipating and re-authenticating to generate a new token didn't work for me (no clue why).
So I had to convert the JSON of the service account into JWT through this func instead
```
scopes := []string{"https://www.googleapis.com/auth/cloud-platform"}
tokenSource, err := google.JWTAccessTokenSourceWithScope(serviceAccountFileBytes, scopes...)
```
The reason that this one works, is because it creates the JWT token internally through the service_account's properties such as client email and client_id and private_key as GCP allows us to create our local JWT tokens and encode them.
| null | CC BY-SA 4.0 | null | 2023-01-02T13:24:03.213 | 2023-01-02T16:00:15.673 | 2023-01-02T16:00:15.673 | 10,978,850 | 10,978,850 | null |
74,983,049 | 2 | null | 74,982,456 | 0 | null | I have come to the conclution that for Microsoft Graph, it would be best to do the following:
1: Call the API, and recieve data.
2: Check the recieved data and check if it alright.
3: Overrite the data in the DB.
Thank you for the comments, they helped me come to my solution.
| null | CC BY-SA 4.0 | null | 2023-01-02T13:32:22.790 | 2023-01-02T13:32:22.790 | null | null | 20,700,359 | null |
74,983,082 | 2 | null | 74,851,351 | -1 | null | ```
from PIL import Image, ImageDraw
import requests
img = Image.new('RGBA', (500, 500), 'black')
canvas = ImageDraw.Draw(img)
logo = Image.open(requests.get('https://api-assets.clashofclans.com/badges/70/-1w_sJci3z0Z8XYk-PT9vDhgJzmgzrhdxPbKAUD298s.png', stream=True).raw)
img.paste(logo.convert('RGBA'), (0, 0), logo.convert('RGBA')) # (0, 0) is position
img.show()
```
| null | CC BY-SA 4.0 | null | 2023-01-02T13:35:42.053 | 2023-01-02T13:35:42.053 | null | null | 20,248,745 | null |
74,983,157 | 2 | null | 74,983,034 | 0 | null | Here is the sample code for it, You can also take some help from online codepen's [https://codepen.io/havardob/pen/dyKoOjX](https://codepen.io/havardob/pen/dyKoOjX)
```
.stepper{
height: 400px;
width: 1px;
border-right: 2px dashed black;
position: relative;
}
.stepper:before,
.stepper:after
{
content: "";
position: absolute;
width: 10px;
height: 10px;
right: -7px;
border-radius: 50%;
border: 1px solid black;
background: #fff;
}
.stepper:after{
top: 50px;
}
```
```
<div class="stepper">
</div>
```
| null | CC BY-SA 4.0 | null | 2023-01-02T13:43:36.863 | 2023-01-02T13:43:36.863 | null | null | 4,933,933 | null |
74,983,162 | 2 | null | 74,983,034 | 1 | null | Rough way of getting this done.
## HTML
```
<div class="timeline">
<div class="container left">
<div class="content">
<h2>2017</h2>
<p>Lorem ipsum..</p>
</div>
</div>
<div class="container right">
<div class="content">
<h2>2016</h2>
<p>Lorem ipsum..</p>
</div>
</div>
</div>
```
## CSS
```
* {
box-sizing: border-box;
}
/* Set a background color */
body {
background-color: #474e5d;
font-family: Helvetica, sans-serif;
}
/* The actual timeline (the vertical ruler) */
.timeline {
position: relative;
max-width: 1200px;
margin: 0 auto;
}
/* The actual timeline (the vertical ruler) */
.timeline::after {
content: '';
position: absolute;
width: 6px;
background-color: white;
top: 0;
bottom: 0;
left: 50%;
margin-left: -3px;
}
/* Container around content */
.container {
padding: 10px 40px;
position: relative;
background-color: inherit;
width: 50%;
}
/* The circles on the timeline */
.container::after {
content: '';
position: absolute;
width: 25px;
height: 25px;
right: -17px;
background-color: white;
border: 4px solid #FF9F55;
top: 15px;
border-radius: 50%;
z-index: 1;
}
/* Place the container to the left */
.left {
left: 0;
}
/* Place the container to the right */
.right {
left: 50%;
}
/* Add arrows to the left container (pointing right) */
.left::before {
content: " ";
height: 0;
position: absolute;
top: 22px;
width: 0;
z-index: 1;
right: 30px;
border: medium solid white;
border-width: 10px 0 10px 10px;
border-color: transparent transparent transparent white;
}
/* Add arrows to the right container (pointing left) */
.right::before {
content: " ";
height: 0;
position: absolute;
top: 22px;
width: 0;
z-index: 1;
left: 30px;
border: medium solid white;
border-width: 10px 10px 10px 0;
border-color: transparent white transparent transparent;
}
/* Fix the circle for containers on the right side */
.right::after {
left: -16px;
}
/* The actual content */
.content {
padding: 20px 30px;
background-color: white;
position: relative;
border-radius: 6px;
}
/* Media queries - Responsive timeline on screens less than 600px wide */
@media screen and (max-width: 600px) {
/* Place the timelime to the left */
.timeline::after {
left: 31px;
}
/* Full-width containers */
.container {
width: 100%;
padding-left: 70px;
padding-right: 25px;
}
/* Make sure that all arrows are pointing leftwards */
.container::before {
left: 60px;
border: medium solid white;
border-width: 10px 10px 10px 0;
border-color: transparent white transparent transparent;
}
/* Make sure all circles are at the same spot */
.left::after, .right::after {
left: 15px;
}
/* Make all right containers behave like the left ones */
.right {
left: 0%;
}
}
```
Output:
[](https://i.stack.imgur.com/0Xmkn.png)
| null | CC BY-SA 4.0 | null | 2023-01-02T13:44:08.050 | 2023-01-02T13:44:08.050 | null | null | 13,431,819 | null |
74,983,475 | 2 | null | 47,586,620 | 0 | null | In current Eclipse version there is a checkbox "Exclude test code" in Dependencies tab to exclude src/test sources.
| null | CC BY-SA 4.0 | null | 2023-01-02T14:16:14.363 | 2023-01-02T14:16:14.363 | null | null | 20,912,049 | null |
74,983,539 | 2 | null | 74,983,457 | 0 | null | Don't use `!` without checking null. While the snippet is large, follow these steps.
- Check null, and then perform operation the place you've used `!`. It will be like `if(result!=null)result.add(new FocusItemModel.fromJson(v));`- the `children` can be `children: _getAttrItemWidget(attrItem)??[]`- You aren't returning widgets from `_getAttrItemWidget` and others. It will be
```
List<Widget> _getAttrItemWidget(attrItem) { // no need to return null
List<Widget> attrItemList = [];
attrItem.list.forEach((item) {
....
print (item);
});
return attrItemList;
}
```
In short `!` or provide default value on null case.
Find more about [null-safety](https://dart.dev/null-safety/understanding-null-safety).
| null | CC BY-SA 4.0 | null | 2023-01-02T14:23:43.860 | 2023-01-02T14:23:43.860 | null | null | 10,157,127 | null |
74,984,408 | 2 | null | 74,983,570 | 0 | null | you can use the random number generation along with date functionalities(avoiding duplicates)
> Math.random() * new Date().getMilliseconds()
. check below
```
<ul className="flex">
{tracks.map((_, j) => {
return (
<li key={j} className="box">
{pair.map((active, i) => (
<div key={i} className="vertical flex">
<label
className="container"
htmlFor={Math.trunc(
Math.random() * new Date().getMilliseconds()
)}
>{`${i + 1}`}</label>
<input
id={Math.trunc(
Math.random() * new Date().getMilliseconds()
)}
name={j}
type="checkbox"
onChange={saveChecked}
/>
<span className="checkmark"></span>
</div>
))}
</li>
);
})}
</ul>
```
i have fixed this. Please checkout below mentioned link.
[https://codesandbox.io/s/unique-values-for-multi-dimentional-array-react-yzliem](https://codesandbox.io/s/unique-values-for-multi-dimentional-array-react-yzliem)
| null | CC BY-SA 4.0 | null | 2023-01-02T15:48:40.070 | 2023-01-02T15:48:40.070 | null | null | 9,389,615 | null |
74,984,449 | 2 | null | 74,983,570 | 0 | null | Some thing like this should do the work:
```
import React, { useState } from 'react';
function App() {
const tracks = new Array(4).fill(null);
const pair = [false, false];
const [activeBusses, setActiveBusses] = useState([[false, false],[false, false], [false, false], [false,false]]);
function saveChecked(e) {
const checked = e.currentTarget.checked;
const busIndex = e.currentTarget.id;
const trackIndex = e.currentTarget.name;
const updateActiveBuses = [...activeBusses];
updateActiveBuses[trackIndex][busIndex] = checked;
setActiveBusses(updateActiveBuses);
localStorage.setItem('activeBusses', JSON.stringify(updateActiveBuses));
}
return (
<main>
<h1>Track Send</h1>
<ul className="flex">
{tracks.map((_, j) => {
return (
<li key={j} className="box">
{pair.map((active, i) => (
<div key={i} className="vertical flex">
<label className="container" htmlFor={i}>{`${i + 1}`}</label>
<input
id={i}
name={j}
type="checkbox"
onChange={saveChecked}
/>
<span className="checkmark"></span>
</div>
))}
</li>
);
})}
</ul>
<h1>Bus Recieve</h1>
<ul className="flex">
<li className="vertical box">
{[null, null, null, null].map((_, j) => (
<div key={j} className="flex">
<label className="container" htmlFor={j}>{`${j + 1}`}</label>
<input id={j} type="checkbox" disabled checked={activeBusses[j][0] === true && activeBusses[j][1] === true}/>
<span className="checkmark"></span>
</div>
))}
</li>
</ul>
</main>
);
}
export default App;
```
| null | CC BY-SA 4.0 | null | 2023-01-02T15:52:37.063 | 2023-01-02T15:52:37.063 | null | null | 2,091,359 | null |
74,984,705 | 2 | null | 74,984,443 | 1 | null | Because the parent widget forces the child widget to be the same exact size.
From the docs:
> If a child wants a different size from its parent and the parent
doesn’t have enough information to align it, then the child’s size
might be ignored. Be specific when defining alignment.
You could also wrap the inner Container in a Center widget and it would also work.
See the examples here [https://docs.flutter.dev/development/ui/layout/constraints](https://docs.flutter.dev/development/ui/layout/constraints)
| null | CC BY-SA 4.0 | null | 2023-01-02T16:16:40.900 | 2023-01-02T16:16:40.900 | null | null | 5,812,524 | null |
74,984,790 | 2 | null | 74,983,108 | 0 | null | Whenever `paintEvent` is called the entire widget is redrawn.
To overcome this, when drawing anything new, also re-draw the previous item.
The short solution is to update `paintEvent`to draw the overlay and clear the new rectangle in the same call.
```
brush = QBrush(QColor(200, 200, 200, 128))
painter.setBrush(brush)
painter.drawRect(0, 0, self.width(), self.height())
painter.setCompositionMode(QPainter.CompositionMode_Clear)
```
Thanks to @musicamante for your support via the comments section.
Here is the full code:
```
import sys
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QBrush, QColor, QPainter, QPen
from PyQt5.QtWidgets import QApplication, QPushButton, QWidget, QDesktopWidget
class MainWidget(QWidget):
def __init__(self):
super().__init__()
# Set the window properties
self.setWindowTitle("Main Widget")
self.setGeometry(100, 100, 200, 200)
# Create a button
self.screenshotButton = QPushButton("Start", self)
self.screenshotButton.move(50, 50)
# Connect the button's clicked signal to the showTransparentWidget slot
self.screenshotButton.clicked.connect(self.openTransparentWidget)
def openTransparentWidget(self):
# Close the main widget
self.close()
# Create and show the transparent widget
self.transparentWidget = TransparentWidget()
self.transparentWidget.show()
class TransparentWidget(QWidget):
def __init__(self):
super().__init__()
# Get the screen dimensions
desktop = QDesktopWidget()
screenWidth = desktop.screenGeometry().width()
screenHeight = desktop.screenGeometry().height()
# Set the size of the widget to the screen dimensions
self.setGeometry(0, 0, screenWidth, screenHeight)
# Set the window flags to make the widget borderless and topmost
self.setWindowFlags(Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint)
# Set the window transparency
self.setAttribute(Qt.WA_TranslucentBackground)
# Initialize the starting and ending positions of the box to -1
self.startX = -1
self.startY = -1
self.endX = -1
self.endY = -1
#call the paintEvent to generate an overlay
self.update()
def mousePressEvent(self, event):
# Store the starting position of the mouse when it is clicked
# Set the flag to True
self.mouseClicked = True
self.startX = event.x()
self.startY = event.y()
print(self.startX, self.startY)
def mouseMoveEvent(self, event):
if self.mouseClicked:
# Store the current position of the mouse as it is being dragged
self.endX = event.x()
self.endY = event.y()
# Redraw the widget to update the box
self.update()
def mouseReleaseEvent(self, event):
# Set the flag to False
self.mouseClicked = False
def paintEvent(self, event):
# Create a QPainter object and set it up for drawing
painter = QPainter(self)
# Draw translucent overlay over the transparent widget
if self.startX == -1 and self.endX == -1:
brush = QBrush(QColor(200, 200, 200, 128))
painter.setBrush(brush)
painter.drawRect(0, 0, self.width(), self.height())
# Set the composition mode to clear
#painter.setCompositionMode(QPainter.CompositionMode_Clear)
# Draw the box if the starting and ending positions are valid
if self.startX != -1 and self.endX != -1:
# Calculate the top-left and bottom-right corners of the box
topLeftX = min(self.startX, self.endX)
topLeftY = min(self.startY, self.endY)
bottomRightX = max(self.startX, self.endX)
bottomRightY = max(self.startY, self.endY)
brush = QBrush(QColor(200, 200, 200, 128))
painter.setBrush(brush)
painter.drawRect(0, 0, self.width(), self.height())
painter.setCompositionMode(QPainter.CompositionMode_Clear)
pen = QPen(QColor(255 ,0, 0))
brush = QBrush(QColor(0, 0, 0, 0))
painter.setPen(pen)
painter.setBrush(brush)
# Draw the empty box
painter.drawRect(topLeftX, topLeftY, bottomRightX - topLeftX, bottomRightY - topLeftY)
app = QApplication(sys.argv)
mainWidget = MainWidget()
mainWidget.show()
sys.exit(app.exec_())
```
| null | CC BY-SA 4.0 | null | 2023-01-02T16:25:11.343 | 2023-01-02T16:25:11.343 | null | null | 6,215,527 | null |
74,985,117 | 2 | null | 74,984,244 | 1 | null | Add a 'LIMIT CLAUSE' to your query. It seems you have a very large result set.
| null | CC BY-SA 4.0 | null | 2023-01-02T17:00:20.397 | 2023-01-02T17:00:20.397 | null | null | 7,083,017 | null |
74,985,204 | 2 | null | 74,983,921 | 1 | null | There are a some , that I can identify at first glance :
1. Why is the Text bound to the class (gameScene) and not the instance (this). This is probably the main cause of the error. btw.: I would name classes in javascript pascal case, so class GameScene ... just to avoid confusion.
2. Where is the this.player set? I can't see it in the create function, where one would usually find it. The Text shouldn't be displayed since this.player is likely undefined. Check the browser console for errors
3. optional: setInterval I personally would always use the phaser builtin function this.time.addEvent, over core javascript other libraries, when possible. Checkout this official example for a nice alternative
, I would recommend:
1. attach the Text to the class instance , but rename it to something like this.playerInfoText to avoid naimg collisions
2. ensure the the player (this.player) is create in the create function of the scene, so that the x and y properties can be read and set correct
3. finally: check the browser console for other related errors
You should change the `Text` variable:
From this:
```
create(){
...
Text = this.add.text(this.player.x+50, this.player.y-50, { fontSize: '16px', fill: '#fff' });
Text.setText(0);
...
}
```
To this `Text`:
```
create(){
...
this.playerInfoText = this.add.text(this.player.x+50, this.player.y-50, { fontSize: '16px', fill: '#fff' });
this.playerInfoText.setText(0);
...
}
```
The reason why the counter throws an error is that the context ist not more correct. [details mdn article](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this)
delete this lines from the `preload`function:
```
gameScene.seconds = 0
this.interval = setInterval(counter, 1000);
```
and after the creation of the `this.player`and `this.playerInfoText`( as mentioned above) just add the counter creation and inline the function:
```
this.seconds = 0;
this.interval = setInterval(
() => { // <- this is a inline arrow function see mdn link for details
this.seconds = this.seconds + 1
this.playerInfoText.setText(this.seconds)
});
```
or using with the builtin `addEvent` function instead of `setInterval` (also in the `create` function):
```
this.seconds = 0;
this.interval = scene.time.addEvent({
delay: 1000,
callback: counter,
callbackScope: this,
loop: true
});
...
// some tweaks have to be done on the counter function, for this to work
function counter(){
this.seconds = this.seconds+1
this.playerInfoText.setText(this.seconds)
}
```
| null | CC BY-SA 4.0 | null | 2023-01-02T17:08:18.813 | 2023-01-09T11:28:22.680 | 2023-01-09T11:28:22.680 | 1,679,286 | 1,679,286 | null |
74,985,298 | 2 | null | 74,983,108 | 0 | null | UI drawing (at the low level) normally happens using a , which is eventually cleared in a specific area in which new painting is going to happen.
This means that you cannot rely on contents previously drawn in another paint event: even when requesting to update a specific region of the widget (ie: using [update(QRect)](https://doc.qt.io/qt-5/qwidget.html#update-2)), that region will be cleared from the buffer, and previous contents doesn't exist any more, and the buffer is also cleared anyway whenever the window is hidden and shown again, like after minimizing and restoring it, or after switching virtual desktop.
In your case, it means that the "background" rectangle will only be painted at start up (when the coordinates are -1), not after that.
The solution is to always draw all the contents, and eventually cut out the area using [setClipRegion()](https://doc.qt.io/qt-5/qpainter.html#setClipRegion).
```
class TransparentWidget(QWidget):
area = reference = None
def __init__(self):
super().__init__()
self.setWindowFlags(Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint)
self.setAttribute(Qt.WA_TranslucentBackground)
self.setMouseTracking(True)
screenArea = QRect()
for screen in QApplication.screens():
screenArea |= screen.geometry()
self.setGeometry(screenArea)
def mousePressEvent(self, event):
if event.button() != Qt.LeftButton:
return
pos = event.pos()
if self.area:
span = QRect(-5, -5, 10, 10)
if span.translated(self.area.topLeft()).contains(pos):
self.reference = self.area.setTopLeft
elif span.translated(self.area.topRight()).contains(pos):
self.reference = self.area.setTopRight
elif span.translated(self.area.bottomRight()).contains(pos):
self.reference = self.area.setBottomRight
elif span.translated(self.area.bottomLeft()).contains(pos):
self.reference = self.area.setBottomLeft
else:
self.reference = None
if not self.reference:
self.area = QRect(pos, QSize(1, 1))
self.reference = self.area.setBottomRight
self.update()
def mouseMoveEvent(self, event):
if self.reference:
self.reference(event.pos())
self.update()
elif self.area:
pos = event.pos()
span = QRect(-5, -5, 10, 10)
cursor = None
if span.translated(self.area.topLeft()).contains(pos):
cursor = Qt.SizeFDiagCursor
elif span.translated(self.area.topRight()).contains(pos):
cursor = Qt.SizeBDiagCursor
elif span.translated(self.area.bottomRight()).contains(pos):
cursor = Qt.SizeFDiagCursor
elif span.translated(self.area.bottomLeft()).contains(pos):
cursor = Qt.SizeBDiagCursor
if cursor is not None:
self.setCursor(cursor)
else:
self.unsetCursor()
def mouseReleaseEvent(self, event):
self.reference = None
if self.area is not None:
self.area = self.area.normalized()
self.update()
def paintEvent(self, event):
painter = QPainter(self)
if self.area is not None:
r = QRegion(self.rect())
r ^= QRegion(self.area.normalized().adjusted(1, 1, 0, 0))
painter.setClipRegion(r)
painter.fillRect(self.rect(), QColor(200, 200, 200, 128))
if self.area is not None:
painter.setPen(QColor(255 ,0, 0))
painter.drawRect(self.area.normalized())
```
Notes:
- [QScreen](https://doc.qt.io/qt-5/qscreen.html)- - [QRect.normalized()](https://doc.qt.io/qt-5/qrect.html#normalized)- `self.update()``__init__``update()`
| null | CC BY-SA 4.0 | null | 2023-01-02T17:19:38.350 | 2023-01-02T17:19:38.350 | null | null | 2,001,654 | null |
74,985,473 | 2 | null | 74,985,459 | 1 | null | We may use
```
library(dplyr)
df2 %>%
group_by(across(symbol:refseq)) %>%
summarise(across(everything(), ~ list(.)))
```
| null | CC BY-SA 4.0 | null | 2023-01-02T17:40:23.167 | 2023-01-02T17:40:23.167 | null | null | 3,732,271 | null |
74,985,476 | 2 | null | 25,689,238 | 1 | null | Some time has passed since this question was asked. With Matplotlib 3.6.2 it looks like this works:
```
plt.axhline(0, color='black', linewidth=.5)
plt.axvline(0, color='black', linewidth=.5)
```
and there are other options.
| null | CC BY-SA 4.0 | null | 2023-01-02T17:40:46.267 | 2023-01-02T17:40:46.267 | null | null | 945,534 | null |
74,985,788 | 2 | null | 74,787,662 | 1 | null | I spent some time during the holidays researching, debugging, and testing. I was able to find a solution to my problem. Several things:
- - -
It's worthy of note that by trying to debug my problem from a .NET 6 console app (launching another console app) was injecting a different kind of problem into my existing problem. Using my existing NUnit testing that calls the console app was what lead me to the discovery noted above.
Lesson learned: If trying to call a .exe in Linux from your .NET 6 application by starting a process, be sure to make the file executable before you try calling it with bash or another shell.
| null | CC BY-SA 4.0 | null | 2023-01-02T18:17:27.460 | 2023-01-02T18:17:27.460 | null | null | 13,185,906 | null |
74,986,030 | 2 | null | 74,984,934 | 0 | null | Based on the [CS0411](https://learn.microsoft.com/en-us/dotnet/csharp/misc/cs0411?f1url=%3FappId%3Droslyn%26k%3Dk(CS0411)) compiler error you're getting, it is failing because the compiler can't infer the type arguments of your `GetCache` method.
So update your mock `GetCache` setup call with your desired type arguments. For example:
```
_mockRediscacheProvider
.Setup(x=>x.GetCache<IDictionary<Guid,DataExportRequestModel>>(...);
```
| null | CC BY-SA 4.0 | null | 2023-01-02T18:50:30.180 | 2023-01-02T18:50:30.180 | null | null | 6,798,222 | null |
74,986,177 | 2 | null | 74,986,107 | 1 | null | I'd use an explicit join:
```
SELECT a.*
FROM wallpaper_tag as a
INNER JOIN wallpaper_tag as b
ON a.wallpaper = b.wallpaper
WHERE a.tag = 1 AND b.tag = 2
ORDER BY a.wallpaper
LIMIT 10000
```
I prefer this syntax as it makes it clearer what tables are joined and how they are joined.
| null | CC BY-SA 4.0 | null | 2023-01-02T19:09:30.693 | 2023-01-02T19:09:30.693 | null | null | 5,256,945 | null |
74,986,364 | 2 | null | 74,986,107 | 1 | null | If what you actually want is all the `wallpaper`s with `tag`s `1` and `2`, you can do it with aggregation:
```
SELECT wallpaper
FROM wallpaper_tag
WHERE tag IN (1, 2)
GROUP BY wallpaper
HAVING COUNT(DISTINCT tag) = 2
ORDER BY wallpaper
LIMIT 10000
```
If the combination of `wallpaper` and `tag` is unique, the `HAVING` clause may be simplified to just:
```
HAVING COUNT(*) = 2
```
| null | CC BY-SA 4.0 | null | 2023-01-02T19:33:41.147 | 2023-01-02T19:33:41.147 | null | null | 10,498,828 | null |
74,986,450 | 2 | null | 74,980,364 | 0 | null | Try something like
```
select t.* from fxdh t where t.vdate between to_date(‘2022-11-10’, ‘YYYY-MM-DD’) /* your reference date */ - 7 /* days */ and to_date(‘2022-11-10’, ‘YYYY-MM-DD) /* your reference date */ + 7 /* days */ and t.trad = ‘ASRI’ and t.ps = ‘S’ order by t.vdate asc
```
This would match the records (if any) within the window of plus or minus 7 days from the reference date (for ghe given trader).
…although from the screenshot looks like more SQL Server than Oracle rdbms to me.
| null | CC BY-SA 4.0 | null | 2023-01-02T19:46:11.183 | 2023-01-02T19:46:11.183 | null | null | 17,947,734 | null |
74,986,502 | 2 | null | 74,922,290 | 4 | null | Instead of using `Get.bottomSheet`, you can use a `Stack` widget and use it something like this:
```
Widget yourPhotoEditingWidget() {
bool onShadowButtonTapped = false;
return Stack(
children: [
Column(
children: [
yourDraggableWidget(),
Align(
alignment: Alignment.center,
child: MaterialButton(
color: Colors.orange,
onPressed: () {
onShadowButtonTapped = !onShadowButtonTapped;
setState(() {});
},
child: const Text(
'Shadow',
style: TextStyle(color: Colors.white),
),
),
),
],
),
if (onShadowButtonTapped)
Align(
alignment: Alignment.bottomCenter,
child: Container(
height: 150,
width: 300,
color: Colors.orange,
child: const Center(
child: Text(
'Your Widget',
style: TextStyle(color: Colors.white),
),
),
),
),
],
);
}
```
| null | CC BY-SA 4.0 | null | 2023-01-02T19:52:19.787 | 2023-01-05T01:46:02.217 | 2023-01-05T01:46:02.217 | 12,349,734 | 12,098,728 | null |
74,986,506 | 2 | null | 74,986,245 | 1 | null | To get the output as shown in the diagram you can try the following
```
Calculator(){
this.setSize(400, 400);
this.setTitle("this");
//create first panel with BorderLayout as layout
JPanel firstPanel=new JPanel(new BorderLayout());
//Create second Panel with GrdiLayout as layout
JPanel secondPanel= new JPanel(new GridLayout(2,2));
//add 4 Buttons to second Panel
for(Integer i=0;i<4;i++){
secondPanel.add(new JButton("Button"+i.toString()));
}
//Add wnorth,south,west,east buttons to first panel
firstPanel.add(new JButton("north"),BorderLayout.NORTH);
firstPanel.add(new JButton("south"),BorderLayout.SOUTH);
firstPanel.add(new JButton("west"),BorderLayout.WEST);
firstPanel.add(new JButton("east"),BorderLayout.EAST);
//add the second panel (containing 4 buttons) to first panel
firstPanel.add(secondPanel,BorderLayout.CENTER);
//add first panel to the frame
this.add(firstPanel);
}
```
In main
```
public static void main (String args[]){
new Calculator().setVisible(true);
}
```
Output:
[](https://i.stack.imgur.com/j1Vtq.png)
| null | CC BY-SA 4.0 | null | 2023-01-02T19:52:36.493 | 2023-01-02T19:57:41.543 | 2023-01-02T19:57:41.543 | 17,661,513 | 17,661,513 | null |
74,986,562 | 2 | null | 74,985,905 | 0 | null | The problem is you are using the destination path instead of the source path:
```
File = Dir(DEST_PATH & "*" & Branch_Code & "*.*")
```
Change it to
```
File = Dir(SRC_PATH & "*" & Branch_Code & "*.*")
```
| null | CC BY-SA 4.0 | null | 2023-01-02T20:01:07.177 | 2023-01-02T20:01:07.177 | null | null | 16,662,333 | null |
74,986,556 | 2 | null | 74,985,880 | 0 | null | That date selector is searching the whole document from the root rather than within `$(element).find(...)`, so it gathers all of the text and glues it together.
There's an extra level of hierarchy here that you may be ignoring. The site is laid out like this:
- - - - - - - - - - -
Given this, my suggestion would be to select all dates and all game lists and glue them together into an array of objects that represent days. For each day, collect all of its games into a subarray. Each game has a home team, an away team, and a time.
For example:
```
const axios = require("axios");
const cheerio = require("cheerio"); // 1.0.0-rc.12
require("util").inspect.defaultOptions.depth = null;
const url = "<Your URL>";
axios
.get(url)
.then(({data: html}) => {
const $ = cheerio.load(html);
const dates = [...$("#leaguesub-tab-1 .leaguesub-date")]
.map(e => $(e).text().trim());
const data = [...$("#leaguesub-tab-1 .leaguesub-list")].map((e, i) => ({
date: dates[i],
games: [...$(e).find("li")].map(e => ({
homeTeam: $(e).find(".title-right").text().trim(),
awayTeam: $(e).find(".title-left").text().trim(),
scoreOrTime: $(e).find(".time").text().trim(),
}))
}));
console.log(data);
})
.catch(err => console.error(err));
```
Output (truncated):
```
[
{
date: '28.01.2023 Saturday',
games: [
{
homeTeam: 'Apolonia Fier',
awayTeam: 'Flamurtari',
scoreOrTime: '12:00'
},
{
homeTeam: 'Besëlidhja Lezhë',
awayTeam: 'Korabi Peshkopi',
scoreOrTime: '12:00'
},
// ...
]
},
{
date: '05.02.2023 Sunday',
games: [
{
homeTeam: 'Skënderbeu Korçë',
awayTeam: 'Tërbuni Pukë',
scoreOrTime: '13:00'
},
{
homeTeam: 'Oriku',
awayTeam: 'Dinamo Tirana',
scoreOrTime: '13:00'
},
// ...
]
},
// ...
]
```
You could also key that outer array by date for easier lookups:
```
const byDate = Object.fromEntries(data.map(e => [e.date, e.games]));
// or: [e.date.split(" ")[0], e.games]
```
Which gives:
```
{
'28.01.2023 Saturday': [
{
homeTeam: 'Apolonia Fier',
awayTeam: 'Flamurtari',
scoreOrTime: '12:00'
},
{
homeTeam: 'Besëlidhja Lezhë',
awayTeam: 'Korabi Peshkopi',
scoreOrTime: '12:00'
},
// ...
],
'05.02.2023 Sunday': [
{
homeTeam: 'Skënderbeu Korçë',
awayTeam: 'Tërbuni Pukë',
scoreOrTime: '13:00'
},
{
homeTeam: 'Oriku',
awayTeam: 'Dinamo Tirana',
scoreOrTime: '13:00'
},
// ...
],
// ...
}
```
If you're set on your original flattened structure, that can be done as well:
```
const flattened = data.flatMap(e => e.games.map(f => ({date: e.date, ...f})));
```
Now the date is attached repeatedly to each game:
```
[
{
date: '28.01.2023 Saturday',
homeTeam: 'Apolonia Fier',
awayTeam: 'Flamurtari',
scoreOrTime: '12:00'
},
{
date: '28.01.2023 Saturday',
homeTeam: 'Besëlidhja Lezhë',
awayTeam: 'Korabi Peshkopi',
scoreOrTime: '12:00'
},
// ...
]
```
| null | CC BY-SA 4.0 | null | 2023-01-02T20:00:20.350 | 2023-01-02T20:34:52.953 | 2023-01-02T20:34:52.953 | 6,243,352 | 6,243,352 | null |
74,986,705 | 2 | null | 74,985,005 | 1 | null | As Jarmod also pointed out, the reason for the missing snapstart option was that the London AWS region does not have this capability. It started to work well when I moved the option to Frankfurt.
I hope this answer helps to prevent someone else from spending endless hours troubleshooting this. The snapstart documentation page does not mention the limited regional support of this capability.
btw, I found the root cause from the AWS CLI response when I tried to update the snapstart configuration for my lambda:
" SnapStart is not supported in eu-west-2."
| null | CC BY-SA 4.0 | null | 2023-01-02T20:19:45.960 | 2023-01-02T20:51:01.500 | 2023-01-02T20:51:01.500 | 20,913,025 | 20,913,025 | null |
74,986,713 | 2 | null | 74,986,254 | 0 | null | ```
WITH play_count AS (
SELECT
artist,
SUM(play_count) AS counts
FROM daily_listens
GROUP BY artist
)
SELECT *
FROM play_count
ORDER BY counts
LIMIT 5
```
| null | CC BY-SA 4.0 | null | 2023-01-02T20:21:33.063 | 2023-01-02T20:21:33.063 | null | null | 3,392,710 | null |
74,986,914 | 2 | null | 74,985,731 | 0 | null | Your app is trying to mongodb with localhost:27017.
For your app, localhost, is the container where the app is running.
To access the mingoDb container you must use the service name in your docker-compose.yaml.
In your case: mongodb.
So the connection to the db should be: mongodb:27017.
To access mongodb directly from your host macchine you use localhost:27018. In this case localhost refers to your hostsystem (your pc).
Your docker-compose is a bit obsolete. You can update it like so:
```
version: '3.9'
networks:
app-tier:
driver: bridge
services:
myapp: // this is a service name
image: 'chatapp'
networks:
- app-tier
ports:
- 8000:8000
depends_on:
- mongodb
mongodb: // this is the servicename to connect from the app container
image: 'mongo'
networks:
- app-tier
ports:
- 27018:27017
```
You can remove also allowempty password.
| null | CC BY-SA 4.0 | null | 2023-01-02T20:45:58.100 | 2023-01-02T23:30:05.080 | 2023-01-02T23:30:05.080 | 10,692,906 | 10,692,906 | null |
74,987,012 | 2 | null | 74,984,989 | 0 | null | Since you are counting the table rows to use that number for the `position` parameter in the `Add()` method of `ListRows` object, I suppose you want to add a new row at the bottom of the table
To add a new row at the bottom of a `ListObject` object, just omit the `position` parameter
```
Private Sub CommandButton1_Click()
Dim row As ListRow
Set row = ActiveWorkbook.Worksheets("Teste-Base de dados").ListObjects("Table1").ListRows.Add
row.Range(1) = ...
row.Range(2) = ...
...
End Sub
```
which you can also "reduce" to:
```
Private Sub CommandButton1_Click()
With ActiveWorkbook.Worksheets("Teste-Base de dados").ListObjects("Table1").ListRows.Add
.Range(1) = ...
.Range(2) = ...
End With
...
End Sub
```
While if you want to add the new row as the first one, then use `1` for the `position` parameter
```
Private Sub CommandButton1_Click()
Dim row As ListRow
Set row = ActiveWorkbook.Worksheets("Teste-Base de dados").ListObjects("Table1").ListRows.Add(1)
row.Range(1) = ...
row.Range(2) = ...
...
End Sub
```
or its "collapsed" twin
```
Private Sub CommandButton1_Click()
With ActiveWorkbook.Worksheets("Teste-Base de dados").ListObjects("Table1").ListRows.Add(1)
.Range(1) = ...
.Range(2) = ...
End With
...
End Sub
```
| null | CC BY-SA 4.0 | null | 2023-01-02T20:59:54.400 | 2023-01-02T21:13:32.910 | 2023-01-02T21:13:32.910 | 3,598,756 | 3,598,756 | null |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.