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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
75,464,086 | 2 | null | 75,463,987 | 0 | null | You can give `crossAxisAlignment` to your column:
```
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Colors.blue,
padding:
EdgeInsets.symmetric(horizontal: 30, vertical: 15),
),
onPressed: (() {}),
child: Text(
'Projects',
style: TextStyle(
fontSize: 20.0,
),
),
),
SizedBox(
height: 50.0,
),
],
```
If this doesn't work, you can also do this:
```
Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Expanded(child: Container()),
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Colors.blue,
padding: EdgeInsets.symmetric(horizontal: 30, vertical: 15),
),
onPressed: (() {}),
child: Text(
'Projects',
style: TextStyle(
fontSize: 20.0,
),
),
),
],
),
SizedBox(
height: 50.0,
),
],
```
| null | CC BY-SA 4.0 | null | 2023-02-15T18:32:57.447 | 2023-02-15T18:32:57.447 | null | null | 8,414,124 | null |
75,464,242 | 2 | null | 75,463,987 | 0 | null | It depends on the widget tree, how its aligned. Your `Padding` widget may be wrapped inside some widget which is center aligned. So assuming that your `Padding` widget alignment is not affected by any parent widget. Here is solution to this.
There are multiple approaches for that. For example,
1. You can add crossAxisAlignment: CrossAxisAlignment.end, in Column attributes.
2. You can wrap your ElevatedButton inside a Row and add the mainAxisAlignment: MainAxisAlignment.end, attributes.
3. You can use Align class to make it work.
Just like this, here i have used both `Column` and `Row` alignments for the sake of demonstration. But you can use whatever suits best to your situation.
```
Padding(
padding: const EdgeInsets.all(10.0),
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Colors.blue,
padding:
EdgeInsets.symmetric(horizontal: 30, vertical: 15),
),
onPressed: (() {}),
child: Text(
'Projects',
style: TextStyle(
fontSize: 20.0,
),
),
),
SizedBox(
height: 50.0,
),
],
),
],
),
),
),
```
| null | CC BY-SA 4.0 | null | 2023-02-15T18:50:26.700 | 2023-02-15T18:50:26.700 | null | null | 9,987,650 | null |
75,464,217 | 2 | null | 75,462,032 | 0 | null |
# Using the <track> element
The [<track> element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/track) is the native way to provide captions etc. for media.
We can use it to parse [WebVTT](https://www.w3.org/TR/webvtt1/) files. The parsed [TextTrackCue](https://developer.mozilla.org/en-US/docs/Web/API/TextTrackCue)s can be accessed via [HTMLTrackElement.track](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTrackElement):
```
const trackElement = document.createElement("track");
trackElement.src = getVttUrl();
// `track` now contains all cues
const track = trackElement.track;
function getVttUrl() {
// Some external resources are disallowed in StackOverflow snippets.
// Here I'm blobifying the VTT-file's content:
const vtt = `WEBVTT
00:00:00.000 --> 00:00:00.999 line:80%
Hildy!
00:00:01.000 --> 00:00:01.499 line:80%
How are you?
00:00:01.500 --> 00:00:02.999 line:80%
Tell me, is the lord of the universe in?
00:00:03.000 --> 00:00:04.299 line:80%
Yes, he's in - in a bad humor
00:00:04.300 --> 00:00:06.000 line:80%
Somebody must've stolen the crown jewels
`;
const vttBlob = new Blob([vtt], { type: "text/vtt" });
return URL.createObjectURL(vttBlob);
}
```
## With the cuechange event
We can add the `<track>` element to a media element, so that it activates the correct cues accordingly.
Setting a [TextTrack](https://developer.mozilla.org/en-US/docs/Web/API/TextTrack)'s [mode property](https://developer.mozilla.org/en-US/docs/Web/API/TextTrack/mode) to "`hidden`" hides it, but it can still be used programmatically. We can add a listener for its [cuechange event](https://developer.mozilla.org/en-US/docs/Web/API/TextTrack/cuechange_event):
```
const video = document.querySelector("video");
const captions = document.getElementById("captions");
const trackElement = document.createElement("track");
trackElement.src = getVttUrl();
video.append(trackElement);
const track = trackElement.track;
track.mode = "hidden";
track.addEventListener("cuechange", () => {
captions.replaceChildren(...Array.from(track.activeCues).map(cue => cue.getCueAsHTML()));
});
function getVttUrl() {
const vtt = `WEBVTT
00:00:00.000 --> 00:00:00.999 line:80%
Hildy!
00:00:01.000 --> 00:00:01.499 line:80%
How are you?
00:00:01.500 --> 00:00:02.999 line:80%
Tell me, is the lord of the universe in?
00:00:03.000 --> 00:00:04.299 line:80%
Yes, he's in - in a bad humor
00:00:04.300 --> 00:00:06.000 line:80%
Somebody must've stolen the crown jewels
`;
const vttBlob = new Blob([vtt], { type: "text/vtt" });
return URL.createObjectURL(vttBlob);
}
```
```
<head><base href="https://interactive-examples.mdn.mozilla.net"></head>
<body>
<video controls width=320 src="/media/cc0-videos/friday.mp4"></video>
<p id="captions"></p>
</body>
```
## With the media's timeupdate event
I also tried the video's [timeupdate event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/timeupdate_event), since their rate of fire depends on the browser's implementation:
```
const video = document.querySelector("video");
const captions = document.getElementById("captions");
const trackElement = document.createElement("track");
trackElement.src = getVttUrl();
video.append(trackElement);
const track = trackElement.track;
track.mode = "hidden";
video.addEventListener("timeupdate", () => {
captions.replaceChildren(...Array.from(track.activeCues).map(cue => cue.getCueAsHTML()));
});
function getVttUrl() {
const vtt = `WEBVTT
00:00:00.000 --> 00:00:00.999 line:80%
Hildy!
00:00:01.000 --> 00:00:01.499 line:80%
How are you?
00:00:01.500 --> 00:00:02.999 line:80%
Tell me, is the lord of the universe in?
00:00:03.000 --> 00:00:04.299 line:80%
Yes, he's in - in a bad humor
00:00:04.300 --> 00:00:06.000 line:80%
Somebody must've stolen the crown jewels
`;
const vttBlob = new Blob([vtt], { type: "text/vtt" });
return URL.createObjectURL(vttBlob);
}
```
```
<head><base href="https://interactive-examples.mdn.mozilla.net"></head>
<body>
<video controls width=320 src="/media/cc0-videos/friday.mp4"></video>
<p id="captions"></p>
</body>
```
: Keep the `<track>` element added to the media, so that [activeCues](https://developer.mozilla.org/en-US/docs/Web/API/TextTrack/activeCues) is still kept live!
## With requestAnimationFrame()
Technically, using the [requestAnimationFrame() function](https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame) should provide the most up-to-date captions possible, since it fires before frame:
```
const video = document.querySelector("video");
const captions = document.getElementById("captions");
const trackElement = document.createElement("track");
trackElement.src = getVttUrl();
video.append(trackElement);
const track = trackElement.track;
track.mode = "hidden";
track.cues; // Accessing `cues` fixes a "not iterable" error (on Chrome)
requestAnimationFrame(function captionsCallback() {
updateCaptions();
requestAnimationFrame(captionsCallback);
});
function updateCaptions() {
captions.replaceChildren(...Array.from(track.activeCues).map(cue => cue.getCueAsHTML()));
}
function getVttUrl() {
const vtt = `WEBVTT
00:00:00.000 --> 00:00:00.999 line:80%
Hildy!
00:00:01.000 --> 00:00:01.499 line:80%
How are you?
00:00:01.500 --> 00:00:02.999 line:80%
Tell me, is the lord of the universe in?
00:00:03.000 --> 00:00:04.299 line:80%
Yes, he's in - in a bad humor
00:00:04.300 --> 00:00:06.000 line:80%
Somebody must've stolen the crown jewels
`;
const vttBlob = new Blob([vtt], { type: "text/vtt" });
return URL.createObjectURL(vttBlob);
}
```
```
<head><base href="https://interactive-examples.mdn.mozilla.net"></head>
<body>
<video controls width=320 src="/media/cc0-videos/friday.mp4"></video>
<p id="captions"></p>
</body>
```
We can decouple it from `TextTrack`'s `activeCues` by implementing a custom "activeness evaluation" using [HTMLMediaElement.currentTime](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/currentTime). This may be "even more" live:
```
const video = document.querySelector("video");
const captions = document.getElementById("captions");
const trackElement = document.createElement("track");
trackElement.src = getVttUrl();
video.append(trackElement);
const track = trackElement.track;
track.mode = "hidden";
track.cues; // Accessing `cues` fixes a "not iterable" error (on Chrome)
requestAnimationFrame(function captionsCallback() {
updateCaptions();
requestAnimationFrame(captionsCallback);
});
function updateCaptions() {
const activeCues = Array.from(track.cues).filter(cue => {
// Check according to:
// https://developer.mozilla.org/en-US/docs/Web/API/WebVTT_API#cue_timings (see "Non-overlapping cue timing examples")
return cue.startTime <= video.currentTime && cue.endTime > video.currentTime;
});
captions.replaceChildren(...activeCues.map(cue => cue.getCueAsHTML()));
}
function getVttUrl() {
const vtt = `WEBVTT
00:00:00.000 --> 00:00:00.999 line:80%
Hildy!
00:00:01.000 --> 00:00:01.499 line:80%
How are you?
00:00:01.500 --> 00:00:02.999 line:80%
Tell me, is the lord of the universe in?
00:00:03.000 --> 00:00:04.299 line:80%
Yes, he's in - in a bad humor
00:00:04.300 --> 00:00:06.000 line:80%
Somebody must've stolen the crown jewels
`;
const vttBlob = new Blob([vtt], { type: "text/vtt" });
return URL.createObjectURL(vttBlob);
}
```
```
<head><base href="https://interactive-examples.mdn.mozilla.net"></head>
<body>
<video controls width=320 src="/media/cc0-videos/friday.mp4"></video>
<p id="captions"></p>
</body>
```
---
# Comparing the methods
Here you can try the methods from above yourself:
```
const video = document.querySelector("video");
const trackElement = document.createElement("track");
trackElement.src = getVttUrl();
video.append(trackElement);
const track = trackElement.track;
track.mode = "hidden";
(function captionsCuechange() {
const captions = document.getElementById("cap-cuechange");
track.addEventListener("cuechange", () => {
captions.replaceChildren(...Array.from(track.activeCues).map(cue => cue.getCueAsHTML()));
});
})();
(function captionsTimeupdate() {
const captions = document.getElementById("cap-timeupdate");
video.addEventListener("timeupdate", () => {
captions.replaceChildren(...Array.from(track.activeCues).map(cue => cue.getCueAsHTML()));
});
})();
(function captionsRequestAnimationFrame() {
const captions = document.getElementById("cap-frame");
track.cues; // Accessing `cues` fixes a "not iterable" error (on Chrome)
requestAnimationFrame(function captionsCallback() {
updateCaptions();
requestAnimationFrame(captionsCallback);
});
function updateCaptions() {
const cuesAsHTML = Array.from(track.activeCues).map(cue => cue.getCueAsHTML());
captions.replaceChildren(...cuesAsHTML);
}
})();
(function captionsRequestAnimationFrameAndCurrentTime() {
const captions = document.getElementById("cap-frame-current");
track.cues; // Accessing `cues` fixes a "not iterable" error (on Chrome)
requestAnimationFrame(function captionsCallback() {
updateCaptions();
requestAnimationFrame(captionsCallback);
});
function updateCaptions() {
const activeCues = Array.from(track.cues).filter(cue => {
return cue.startTime <= video.currentTime && cue.endTime > video.currentTime;
});
const cuesAsHTML = activeCues.map(cue => cue.getCueAsHTML());
captions.replaceChildren(...cuesAsHTML);
}
})();
function getVttUrl() {
const vtt = `WEBVTT
00:00:00.000 --> 00:00:00.999 line:80%
Hildy!
00:00:01.000 --> 00:00:01.499 line:80%
How are you?
00:00:01.500 --> 00:00:02.999 line:80%
Tell me, is the lord of the universe in?
00:00:03.000 --> 00:00:04.299 line:80%
Yes, he's in - in a bad humor
00:00:04.300 --> 00:00:06.000 line:80%
Somebody must've stolen the crown jewels
`;
const vttBlob = new Blob([vtt], { type: "text/vtt" });
return URL.createObjectURL(vttBlob);
}
```
```
.caption {min-height: 1lh}
```
```
<head><base href="https://interactive-examples.mdn.mozilla.net"></head>
<body>
<video controls width=320 src="/media/cc0-videos/friday.mp4"></video>
<div>
<p>On <code>cuechange</code>:</p>
<p id="cap-cuechange" class="caption"></p>
</div>
<div>
<p>On <code>timeupdate</code>:</p>
<p id="cap-timeupdate" class="caption"></p>
</div>
<div>
<p>With <code>requestAnimationFrame()</code>:</p>
<p id="cap-frame" class="caption"></p>
</div>
<div>
<p>With <code>requestAnimationFrame()</code> and <code>currentTime</code>:</p>
<p id="cap-frame-current" class="caption"></p>
</div>
</body>
```
Also try scrubbing the timeline and see how the captions react!
: You may want to try the custom activeness check with the other events as well.
| null | CC BY-SA 4.0 | null | 2023-02-15T18:47:51.973 | 2023-02-15T18:56:53.360 | 2023-02-15T18:56:53.360 | 13,561,410 | 13,561,410 | null |
75,464,282 | 2 | null | 75,464,160 | 0 | null | Use the [ClipRRect](https://api.flutter.dev/flutter/widgets/ClipRRect-class.html).
```
ClipRRect(
borderRadius: BorderRadius.circular(12),
child: _tToImage(t)
),
```
| null | CC BY-SA 4.0 | null | 2023-02-15T18:53:26.603 | 2023-02-15T18:53:26.603 | null | null | 18,504,621 | null |
75,464,403 | 2 | null | 5,743,027 | 0 | null | it's 2023 there might be other answers out there but here is one that is sure to work
```
//the path where your text/paint will be drawn across
Path path = new Path();
path.addArc(mEventsRect, fStartAngle, fSweepAngle);//add this if you want your path to be drawn across the arc of your sector
//if you are using a text get the width
float textWidth = mTextPaint.measureText("text");
//this is the y co-ordinate your text will start from
int hOffset = 100;
//this is the x co-ordinate your text will start from
int vOffset = 100;
//we will be using the matrix to rotate the bunds of our current path
Matrix matrix = new Matrix();
//we will use this to get the bounds of our current path
RectF bounds = new RectF();
path.computeBounds(bounds,true);
//we are using the matrix to rotate the bound (with is the bound of the path) by 90 degrees
matrix.setRotate(90,bounds.centerX(),bounds.centerY());
the we transform the points in the path using the matrix
path.transform(matrix);
//you can now draw the text on the path
canvas.drawTextOnPath("text", path, hOffset, vOffset , mBgPaints);
```
| null | CC BY-SA 4.0 | null | 2023-02-15T19:06:08.803 | 2023-02-15T19:06:08.803 | null | null | 11,779,243 | null |
75,464,586 | 2 | null | 75,464,109 | 0 | null | Try something like this:
```
drop table #test
SELECT 1 YEAR, 100 DVALUE, 2 PERSON
INTO #TEST
UNION ALL
SELECT 2 YEAR, 100 DVALUE, 2 PERSON
UNION ALL
SELECT 3 YEAR, 150 DVALUE, 2 PERSON
UNION ALL
SELECT 4 YEAR, 100 DVALUE, 2 PERSON
UNION ALL
SELECT 5 YEAR, 100 DVALUE, 2 PERSON
select person, dvalue, MIN(year) AS startyear, max(year) AS endyear
from (
select count(case when prevvalue <> dvalue then 1 end) over(partition by person order by year) as cnt
, *
from (
select *
, LAG(DValue) OVER(PARTITION BY Person ORDER BY Year) AS prevValue
from #TEST
) x
) x
group by person, dvalue, cnt
order by person, MIN(year)
```
It's a very standard LAG / COUNT technique which finds "groups" of same values as previous ones. After you have that, it's easy to GROUP BY and get the edges
| null | CC BY-SA 4.0 | null | 2023-02-15T19:27:27.043 | 2023-02-15T21:03:51.773 | 2023-02-15T21:03:51.773 | 13,061,224 | 13,061,224 | null |
75,464,641 | 2 | null | 75,459,674 | 1 | null | I faced the same problem while making the git graph, I solved it using `sleep <TIME IN SECONDS>` (suggestion take sleep time >0.5s).
, but I think that `git` shell commands are running so fast as compared to `git graph`, that they make it override the graph. (Again this is just my theory, but the solution works)
I hope this helps ✌️
| null | CC BY-SA 4.0 | null | 2023-02-15T19:32:30.763 | 2023-02-15T19:32:30.763 | null | null | 19,533,760 | null |
75,465,378 | 2 | null | 61,787,101 | 0 | null | . It will copy your folder and all your files into your or folder, depending on which process you are trying to run. Be sure to change the folder name to your own...
```
<ItemGroup>
<Content Include="MySubFolder\*">
<CopyToPublishDirectory>always</CopyToPublishDirectory>
</Content>
</ItemGroup>
```
| null | CC BY-SA 4.0 | null | 2023-02-15T20:58:04.923 | 2023-02-15T21:06:13.417 | 2023-02-15T21:06:13.417 | 5,555,938 | 5,555,938 | null |
75,465,407 | 2 | null | 75,463,579 | 0 | null | ```
.active, .btn :hover {
fill: #FB9DA0;
}
```
This rule selects the `button` elements in the markup, but you need to set the `fill` value of the `rect` elements inside the buttons’ `svg` elements. Try this instead.
```
.active svg rect, .btn svg rect:hover {
fill: #FB9DA0;
}
```
| null | CC BY-SA 4.0 | null | 2023-02-15T21:03:04.930 | 2023-02-15T21:03:04.930 | null | null | 20,771,004 | null |
75,465,655 | 2 | null | 71,227,342 | 1 | null | kindly use the following steps:
1. close the code editor.
2. go to the folder and change the name to lowercase.
3. restart the code editor and run npm start again.
| null | CC BY-SA 4.0 | null | 2023-02-15T21:34:09.683 | 2023-02-21T17:01:56.587 | 2023-02-21T17:01:56.587 | 21,157,729 | 19,643,026 | null |
75,465,735 | 2 | null | 75,465,153 | 0 | null | When you execute a query against the Firebase Database, there will potentially be multiple results. So the snapshot contains a list of those results. Even if there is only a single result, the snapshot will contain a list of one result.
Your `onDataChange` needs to handle this list by looping over the children of the snapshot it gets.
```
reference.orderByChild("userName").equalTo(userEmail).addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot snapshot) {
for (DataSnapshot userSnapshot: snapshot.getChildren()) { //
String value = userSnapshot.child("userRole").getValue(String.class); //
if ("Flood Victim".equals(value)) { //
startActivity(new Intent(LoginActivity.this, HomeActivity.class));
finish();
} else if ("Rescuer".equals(value)) { //
startActivity(new Intent(LoginActivity.this, homeRescuer.class));
finish();
} else {
startActivity(new Intent(LoginActivity.this, homeFv.class));
finish();
}
}
}
@Override
public void onCancelled(@NonNull DatabaseError error) {
throw error.toException(); // never ignore errors
}
});
```
| null | CC BY-SA 4.0 | null | 2023-02-15T21:47:13.153 | 2023-02-15T21:47:13.153 | null | null | 209,103 | null |
75,466,079 | 2 | null | 48,045,696 | 4 | null | In 2023 with `react-native version 0.71.2`, the following code seems to work better than the older answers.
```
// 1. Define a function outside the component:
const onViewableItemsChanged = (info) => {
console.log(info);
};
// 2. create a reference to the function (above)
const viewabilityConfigCallbackPairs = useRef([
{ onViewableItemsChanged },
]);
<FlatList
data={this.state.cardData}
horizontal={true}
pagingEnabled={true}
showsHorizontalScrollIndicator={false}
viewabilityConfig={{viewAreaCoveragePercentThreshold: 50}}
// remove the following statement
// onViewableItemsChanged={(info) =>console.log(info)}
// 3. add the following statement, instead of the one above
viewabilityConfigCallbackPairs={viewabilityConfigCallbackPairs.current}
renderItem={({item}) =>
<View style={{width: width, borderColor: 'white', borderWidth: 20,}}>
<Text>Dogs and Cats</Text>
</View>
}
/>
```
Source: [https://github.com/facebook/react-native/issues/30171#issuecomment-820833606](https://github.com/facebook/react-native/issues/30171#issuecomment-820833606)
| null | CC BY-SA 4.0 | null | 2023-02-15T22:39:55.323 | 2023-02-17T00:41:48.783 | 2023-02-17T00:41:48.783 | 4,101,437 | 4,101,437 | null |
75,466,083 | 2 | null | 75,465,221 | 0 | null | It seems that VS Code will always the default-defined terminal profiles to the final list of profile definitions and that you can't stop it from doing that.
What you can do is just redefine them either to `null`, or set those fields to nothing.
For default profiles that use the `"path"` field, it will not show a profile option with `"path"` set to an empty array, or a path to something that doesn't exist.
For default profiles that support and use the `"source"` field instead of the `"path"` field, set the `"source"` field to `null`.
You can find the list of default terminal profile definitions in the default settings JSON file (use the `Preferences: Open Default Settings (JSON)`, and then use the editor search feature to search `terminal.integrated.profiles.`). Then just copy and paste it into your user or workspace settings.json file and adjust the values as described above.
Here's an example for my own Windows machine:
```
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": null
},
"Command Prompt": {
"path": [],
"icon": "terminal-cmd"
},
"Git Bash": {
"source": null
},
"Ubuntu-20.04 (WSL)": {
"path": []
},
}
```
The other way to do it is this:
```
"terminal.integrated.profiles.windows": {
"PowerShell": null,
"Command Prompt": null,
"Git Bash": null,
"Ubuntu-20.04 (WSL)": null,
"JavaScript Debug Terminal": null,
}
```
| null | CC BY-SA 4.0 | null | 2023-02-15T22:40:27.360 | 2023-02-16T05:33:15.657 | 2023-02-16T05:33:15.657 | 11,107,541 | 11,107,541 | null |
75,466,546 | 2 | null | 75,466,493 | 0 | null | Combine the sum using `UNION`, and add empty columns to make it the same number of columns.
```
SELECT rd, dte, vs, venu, h_a, res, g_f, g_a, g_d, pts
FROM yourTable
UNION ALL
SELECT '', '', '', '', '', '', SUM(g_f), SUM(g_a), SUM(g_d), SUM(pts)
FROM yourTable
```
| null | CC BY-SA 4.0 | null | 2023-02-15T23:59:49.233 | 2023-02-15T23:59:49.233 | null | null | 1,491,895 | null |
75,466,778 | 2 | null | 64,692,600 | 2 | null | There is a problem with the accepted answer: The question was for , but the proposed solution was to change it to
, the flow used is called in which a is sent from microsoft after the success login (302 redirect) and the this code is exchanged for a new access_token (microsoft internal apis).
, in which sometimes there is no a programmable backend server serving the web files (idnex.html, js, css) able to receive the code and exchange it for an access_token. The flow used is called in which ID tokens or from microsoft after the success login (302 redirect)
> Note: Implicit grant flow is being deprecated in some IAM platforms
If you are developing a with pure react, angular,vue, etc with java, c#, php, etc or hybrids like nuxt, next, etc and you need the you should follow these steps:
## Step 1
Register your app as [admin](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/walkthrough-register-app-azure-active-directory) or a simple user
[https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade](https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade)
[](https://i.stack.imgur.com/t2ABT.png)
## Step 2
add a web platform type SPA with the redirect to your spa
[](https://i.stack.imgur.com/TYE22.png)
## Step 3
Check the access token checkbox
[](https://i.stack.imgur.com/fL9u4.png)
## Step 4
In this step, you should be able to obtain the classic values (google, facebook, microsoft, etc) for this kind of login: clientid, clientsecret, reduirect_uri, tenant, etc
[](https://i.stack.imgur.com/ztiI5.png)
[](https://i.stack.imgur.com/g30wB.png)
## Step 5
At the spa source code layer, change the to in your authorize url
```
https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize?
client_id=6731de76-14a6-49ae-97bc-6eba6914391e
&response_type=token
&redirect_uri=http%3A%2F%2Flocalhost%2Fmyapp%2F
&scope=openid
&response_mode=query
```
## Miscellaneous
If everything works, all of your final users will be prompted with something like this at the login step:
[](https://i.stack.imgur.com/iR6v0.png)
> Yes, this is another "Azure feature". Anyway who told you to use Microsoft tools ??
To avoid that, with the admin help, [approve it](https://www.codetwo.com/kb/resolving-need-admin-approval-error/) or follow these [infinite steps](https://learn.microsoft.com/en-us/azure/active-directory/develop/mark-app-as-publisher-verified) to mark your app as verified
## References:
- [https://developer.okta.com/blog/2018/04/10/oauth-authorization-code-grant-type](https://developer.okta.com/blog/2018/04/10/oauth-authorization-code-grant-type)- [https://developer.okta.com/blog/2018/05/24/what-is-the-oauth2-implicit-grant-type](https://developer.okta.com/blog/2018/05/24/what-is-the-oauth2-implicit-grant-type)- [https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-implicit-grant-flow](https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-implicit-grant-flow)- [https://learn.microsoft.com/en-us/power-apps/developer/data-platform/walkthrough-register-app-azure-active-directory](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/walkthrough-register-app-azure-active-directory)
| null | CC BY-SA 4.0 | null | 2023-02-16T00:40:59.097 | 2023-02-20T21:08:04.873 | 2023-02-20T21:08:04.873 | 3,957,754 | 3,957,754 | null |
75,466,794 | 2 | null | 6,942,150 | 0 | null | This is how I use the folder browser dialog. This code solves the selected folder issue, and also selects the folder from the clipboard or the registry (if any), and if the folder is deleted it goes up throw parents until selecting an existing folder. This makes using the dialog very comfortable:
```
Dim FldrBr As New FolderBrowserDialog With {
.RootFolder = Environment.SpecialFolder.Desktop,
.Description = "Chose a flder",
.ShowNewFolderButton = False
}
Dim x = Clipboard.GetText()
Dim lastDir = GetSetting("Mp4Joiner", "SrcFolder", "Path", "")
Try
If x = "" Then
x = lastDir
ElseIf File.Exists(x) Then
x = Path.GetDirectoryName(x)
ElseIf Not Directory.Exists(x) Then
x = lastDir
End If
Catch
x = lastDir
End Try
Do
If x = "" OrElse Directory.GetDirectoryRoot(x) = x OrElse Directory.Exists(x) Then
Exit Do
End If
x = Path.GetDirectoryName(x)
Loop
FldrBr.SelectedPath = x
Dim th As New Threading.Thread(
Sub()
Threading.Thread.Sleep(300)
SendKeys.SendWait("{TAB}{TAB}{RIGHT}")
End Sub)
th.Start()
If FldrBr.ShowDialog(Me) = Windows.Forms.DialogResult.OK Then
SaveSetting("Mp4Joiner", "SrcFolder", "Path", FldrBr.SelectedPath)
' ........
End If
```
| null | CC BY-SA 4.0 | null | 2023-02-16T00:45:30.487 | 2023-02-16T00:45:30.487 | null | null | 21,223,146 | null |
75,466,850 | 2 | null | 18,459,583 | 0 | null | if the field is `text`, change it to `longtext` e.g.
```
change_column :your_table, :your_column, :longtext
```
| null | CC BY-SA 4.0 | null | 2023-02-16T01:00:00.023 | 2023-02-16T01:00:00.023 | null | null | 445,908 | null |
75,467,024 | 2 | null | 2,682,144 | 0 | null | From a post, I get this:
```
from scipy.stats import pearsonr
def reg_coef(x,y,label=None,color=None, **kwargs):
ax = plt.gca()
r,p = pearsonr(x,y)
if p < 0.01:
sig_level = '***'
elif p < 0.05:
sig_level = '**'
elif p < 0.05:
sig_level = '*'
else:
sig_level = ''
ax.annotate('r = {:.2f} {}'.format(r, sig_level), xy=(0.5,0.5), xycoords='axes fraction', ha='center')
ax.texts[0].set_size(16)
ax.set_axis_off()
# Create the plot
g = sns.PairGrid(data=X1, vars=columns, hue=None)
g.map_upper(reg_coef)
g = g.map_lower(sns.regplot, scatter_kws={"edgecolor": "white"})
g = g.map_diag(sns.histplot, kde=True)
plt.show()
```
[enter image description here](https://i.stack.imgur.com/ppNPh.png)
| null | CC BY-SA 4.0 | null | 2023-02-16T01:36:10.473 | 2023-02-16T01:36:10.473 | null | null | 14,265,021 | null |
75,467,047 | 2 | null | 75,462,176 | 2 | null | I think that there could be two problems you are facing and I cannot comment so I have to answer just to try to help(Sorry if not useful). I believe that it may not be the schema but I would need you to upload your sql for the table to see it. It seems that it may be column not the table but the problem may be with
```
@Column(name = "module_name")
private String moduleName;
```
If you look at your sql if you have quotes in postgres you may have to escape them in your java code for it to work properly. Which would make it
```
@Column(name = "\"module_name\"")
private String moduleName;
```
Once again sorry if it isn't helpful But can't comment yet so really hopeful that this will help. When I had schema naming issue it wouldn't even say column doesn't exist but the table as a whole would be missing.
| null | CC BY-SA 4.0 | null | 2023-02-16T01:41:57.343 | 2023-02-16T14:23:00.443 | 2023-02-16T14:23:00.443 | 10,771,586 | 10,771,586 | null |
75,467,300 | 2 | null | 51,107,319 | 0 | null | type this in shell:
py -m pip install -U pygame --user
user is your cmd user.
| null | CC BY-SA 4.0 | null | 2023-02-16T02:37:49.920 | 2023-02-16T02:37:49.920 | null | null | 21,094,774 | null |
75,467,360 | 2 | null | 75,466,766 | 0 | null | Use table for input. Minus 1 is a node with no child. The table could be rows in a csv file.
[](https://i.stack.imgur.com/Rajk1.gif)
After some thinking I realize you can build the tree from an array of numbers. You first create all the nodes in a list NODES with the values. Then you link the list into the binary tree.
```
class Program
{
static void Main(string[] args)
{
int[] data = { 3, 7, 6, 2, 4, 9, 1, 4, 8, 2 };
Node root = Node.BuildTree(data);
}
}
public class Node
{
int value { get; set; }
Node left { get; set; }
Node right { get; set; }
static List<Node> nodes { get; set; }
public static Node BuildTree(int[] input)
{
nodes = new List<Node>();
foreach(int i in input)
{
Node node = new Node();
node.left = null;
node.right = null;
node.value = i;
nodes.Add(node);
}
Node root = nodes[0];
int start = 0;
int row = 0;
while(start < nodes.Count)
{
int end = row + start;
for (int i = start; i < Math.Min(end + 1, nodes.Count); i++)
{
int col = i - start;
int leftChild = (end + 1 + col) < nodes.Count ? end + 1 + col : -1;
int rightChild = (end + 2 + col) < nodes.Count ? end + 2 + col : -1;
Console.WriteLine("row = {0}, col = {1}, left = {2}, right = {3}, start = {4}, end = {5}", row, col, leftChild, rightChild,start, end);
nodes[i].left = (leftChild == -1) ? null : nodes[leftChild];
nodes[i].right = (rightChild == -1) ? null : nodes[rightChild];
}
start = end + 1;
row++;
}
return root;
}
}
```
| null | CC BY-SA 4.0 | null | 2023-02-16T02:50:54.950 | 2023-02-16T05:15:09.937 | 2023-02-16T05:15:09.937 | 5,015,238 | 5,015,238 | null |
75,467,568 | 2 | null | 75,467,316 | 0 | null | The problem is with the dependencies of the "php8.1-intl" package. Specifically, it requires version 8.1.2-1ubuntu2.10 of the "php8.1-common" package, but the version that is currently available is 8.1.14-1+ubuntu18.04.1+deb.sury.org+1, which is causing a conflict.
try:
1. sudo apt update
2. sudo apt-get check
3. sudo apt-get install -f
4. sudo dpkg --configure -a
5.`sudo apt-get install php8.1-common=8.1.2-1ubuntu2.10`
6.`sudo apt-get install php8.1-intl`
You may need to remove the conflicting package(s) and installing the required packages again. But be careful when removing packages as it may cause other dependencies to break.
| null | CC BY-SA 4.0 | null | 2023-02-16T03:28:46.423 | 2023-02-16T03:28:46.423 | null | null | 20,526,798 | null |
75,467,690 | 2 | null | 75,466,766 | 0 | null | Structure of Graph.txt (Number of node, Weight of node, left number node, right number node):
```
(1,3,2,3)
(2,7,4,5)
(3,6,5,6)
(4,2,7,8)
(5,4,8,9)
(6,9,9,10)
(7,1,,)
(8,4,,)
(9,8,,)
(10,2,,)
```
Code:
```
public class Node
{
public int Id { get; set; }
public int Weight { get; set; }
public string LeftId { get; set; }
public string RightId { get; set; }
public Node Left { get; set; }
public Node Right { get; set; }
}
internal class Program
{
static void Main(string[] args)
{
var graphDefinition = File.ReadAllText("Graph.txt");
var regex = new Regex(@"\((?<Id>\d*),(?<Weight>\d*),(?<Left>\d*),(?<Right>\d*)\)");
var nodes = new List<Node>();
foreach (Match match in regex.Matches(graphDefinition))
{
nodes.Add(new Node
{
Id = int.Parse(match.Groups["Id"].Value),
Weight = int.Parse(match.Groups["Weight"].Value),
LeftId = match.Groups["Left"].Value,
RightId = match.Groups["Right"].Value
});
}
if (!nodes.Any())
return;
foreach (var node in nodes)
{
if (!string.IsNullOrEmpty(node.LeftId))
node.Left = nodes.FirstOrDefault(p => p.Id == int.Parse(node.LeftId));
if (!string.IsNullOrEmpty(node.RightId))
node.Right = nodes.FirstOrDefault(p => p.Id == int.Parse(node.RightId));
}
var root = nodes.First();
Depth(root, 0);
Console.WriteLine($"result calculation: {CalculatedMax}");
}
private static int CalculatedMax = int.MinValue;
private static void Depth(Node node, int currentSum)
{
if (node.Left == null && node.Right == null)
{
CalculatedMax = Math.Max(CalculatedMax, currentSum + node.Weight);
return;
}
Depth(node.Left, currentSum + node.Weight);
Depth(node.Right, currentSum + node.Weight);
}
}
```
| null | CC BY-SA 4.0 | null | 2023-02-16T03:51:41.997 | 2023-02-16T03:51:41.997 | null | null | 6,690,823 | null |
75,467,780 | 2 | null | 75,462,722 | 0 | null | You need to fire a request to update the data on the server (BlogApi).
`mutate()` will update the data on the client side, but not on the server. You're updating the data locally, then the data revalidates (refetches), which replaces the local data with the server data, undoing your updates.
Add the appropriate request (probably `POST`) to your code. You can add it immediately before `mutateRepliesPage()`, or you can include it as part of the function passed to `mutate`'s second argument like in this [example](https://swr.vercel.app/docs/mutation#mutate-based-on-current-data).
| null | CC BY-SA 4.0 | null | 2023-02-16T04:12:02.867 | 2023-02-16T04:12:02.867 | null | null | 1,909,499 | null |
75,467,826 | 2 | null | 48,045,696 | 0 | null | Try using `viewabilityConfigCallbackPairs` instead of `onViewableItemsChanged`.
```
import React, {useRef} from 'react';
const App = () => {
// The name of the function must be onViewableItemsChanged.
const onViewableItemsChanged = ({viewableItems}) => {
console.log(viewableItems);
// Your code here.
};
const viewabilityConfigCallbackPairs = useRef([{onViewableItemsChanged}]);
return (
<View style={styles.root}>
<FlatList
data={data}
renderItem={renderItem}
keyExtractor={item => item.id}
viewabilityConfigCallbackPairs={
viewabilityConfigCallbackPairs.current
}
/>
</View>
);
}
```
| null | CC BY-SA 4.0 | null | 2023-02-16T04:19:29.470 | 2023-02-16T04:19:29.470 | null | null | 19,476,877 | null |
75,467,926 | 2 | null | 75,467,583 | 0 | null | If you're getting a 404 error on all files in the public folder of your Laravel site, it's likely that the issue is related to the server configuration or permissions. Here are some things you can try to resolve the issue:
1. Check the file permissions: Make sure the files in the public folder have the correct file permissions. The web server needs to have read access to the files in order to serve them. You can use the chmod command to change the file permissions.
2. Check the server configuration: Verify that the server configuration is set up correctly to serve the files in the public folder. Check the web server's configuration file, such as Apache's httpd.conf or Nginx's nginx.conf, to ensure that the document root is set to the correct directory.
3. Check the .htaccess file: If you're using an .htaccess file to configure the server, make sure it's set up correctly. Make sure that the RewriteBase directive is set to the correct path.
4. Check the file paths in your code: Double-check that the file paths in your code are correct. If the file paths are incorrect, the server will not be able to find the files it needs to serve.
5. Check for any server errors: Check the server logs for any error messages. These logs can often provide useful information about what's causing the issue.
Please be more clarified and detailed when next time you ask a question. That would be more helpful.
| null | CC BY-SA 4.0 | null | 2023-02-16T04:41:46.520 | 2023-02-16T04:41:46.520 | null | null | 12,384,471 | null |
75,468,099 | 2 | null | 75,467,683 | 0 | null | You can solve this issue using `word-break: break-word;` style property.
Try following style
```
h1 {
color: #fff;
font-size: 100px;
line-height: 75px;
margin: 0;
font-family: 'Coolvetica';
font-weight: 400;
word-break: break-word;
img {
width: 46px;
margin-left: 20px;
opacity: 0;
height: auto;
animation: rotateIn 1s linear both;
animation-delay: 1.4s;
}
}
```
| null | CC BY-SA 4.0 | null | 2023-02-16T05:15:25.937 | 2023-02-16T05:15:25.937 | null | null | 5,695,193 | null |
75,468,128 | 2 | null | 51,523,466 | 0 | null | All I know is that by now, flash is dead. There is still [ruffle](https://ruffle.rs) though. And to work properly, ruffle at the moment currently can only support ActionScript 3.
| null | CC BY-SA 4.0 | null | 2023-02-16T05:19:53.973 | 2023-02-16T05:19:53.973 | null | null | 20,412,425 | null |
75,468,131 | 2 | null | 75,467,970 | -2 | null | So, you’re going to get a lot of questions.
The main one being - why would anybody want to do this like this?
I’m having a hard time thinking up a scenario where anyone would want to start with your input and end up with your output.
Your data types for column 3 and column 10 are mismatched, which may add another wrinkle for you.
But try this - edited to account for good ideas from Dale K.
```
WITH LiamsCte
As (
Select
ROW_NUMBER() OVER (Order By Column2) as MyRowNumber,
Column1,
Column2,
Column3,
Column4,
Column5,
Column6,
Column7,
Column8,
Column9,
Column10
)
Select column1, column2, column3, column4, column5, column6, column7
From LiamsCte
Order by MyRowNumber
Union All
Select column8, column9, column10, null, null, null, null
From LiamsCte
Order by MyRowNumber
```
It may throw you an error about data types in which case you need to google how to convert column3 (the one that is a money data type) to `nvarchar(50)`.
| null | CC BY-SA 4.0 | null | 2023-02-16T05:20:26.783 | 2023-02-16T06:07:09.940 | 2023-02-16T06:07:09.940 | 12,586,612 | 12,586,612 | null |
75,468,197 | 2 | null | 75,446,496 | 0 | null | The issue was that the API should be added outside the column.
| null | CC BY-SA 4.0 | null | 2023-02-16T05:32:06.003 | 2023-02-16T05:32:06.003 | null | null | 21,210,487 | null |
75,468,326 | 2 | null | 75,467,970 | 0 | null | For getting match your desired format output you can try this query:
> Note: This query is based on your given data and expected output.
```
SELECT Column1, Column2, Column3, Column4, Column5, Column6, Column7
FROM InvoicesDemo2
WHERE Column1 = 'H'
UNION ALL
SELECT 'D' as Column1,
Column9 as Column2,
Column10 as Column3,
NULL as Column4,
NULL as Column5,
NULL as Column6,
NULL as Column7
FROM InvoicesDemo2
WHERE Column1 = 'H'
ORDER BY Column2, Column1;
```
| null | CC BY-SA 4.0 | null | 2023-02-16T05:51:12.070 | 2023-02-16T05:51:12.070 | null | null | 14,870,617 | null |
75,468,484 | 2 | null | 75,468,004 | 0 | null | Based on your schematic illustration, your `React web application` front end will never be able to reach your backend. Your front end executes on a client side in their browsers/mobiles. This means that the only way to reach backend is through . So your backend can't be in a private subnet behind an internal load balancer.
You have to re-architect your application. Both frontend and backund accessible from the internet, for your front end to be able to query the backend.
| null | CC BY-SA 4.0 | null | 2023-02-16T06:15:09.577 | 2023-02-16T06:15:09.577 | null | null | 248,823 | null |
75,468,499 | 2 | null | 75,467,970 | 0 | null | You need to union all, ordering by row number and row type e.g.
```
with cte as (
select Column1, Column2, Column3, Column4, Column5, Column6, Column7
, row_number () over (order by Column2, Column3) RowNumber,
, 0 RowOrder
from MyTable
union all
select Column8, Column9, Column10, null, null, null, null
, row_number () over (order by Column2, Column3) RowNumber
, 1 RowOrder
from MyTable
)
select Column1, Column2, Column3, Column4, Column5, Column6, Column7
from cte
order by RowNumber asc, RowOrder asc;
```
Note: I am assuming that `order by Column2, Column3` gives the correct, unique, order of the rows.
| null | CC BY-SA 4.0 | null | 2023-02-16T06:17:02.893 | 2023-02-16T06:17:02.893 | null | null | 1,127,428 | null |
75,468,581 | 2 | null | 75,468,208 | -1 | null | Refer this video
Use stackview and it will make your life easy, i have center aligned the stackview. You can give constrains as per your need.
[](https://i.stack.imgur.com/FTJ0y.gif)
| null | CC BY-SA 4.0 | null | 2023-02-16T06:29:10.467 | 2023-02-16T06:29:10.467 | null | null | 13,133,233 | null |
75,468,606 | 2 | null | 75,467,924 | 0 | null | I'm not sure what you want to do with the card image, but the below is an example of using a `tk.Canvas` to display the blank card with a text overlay.
Since the title and the description header are only one line, they are positioned by their absolute centers. The description is positioned by the top-left, so it will always start in the same spot, regardless of the amount of text it contains.
If you have any questions, ask them.
```
import tkinter as tk
from tkinter import EventType as tke
from PIL import Image, ImageTk, ImageGrab
from dataclasses import dataclass
@dataclass
class Card(tk.Canvas):
master :tk.Widget
blankname :str
width :int
height :int
title :str
subtitle :str
description:str
def __post_init__(self):
tk.Canvas.__init__(self, self.master, width=self.width, height=self.height, highlightthickness=0)
hw = self.width//2
self.img_id = self.create_image(hw, self.height//2, image=self.blankname, tags=self.blankname)
self.ttl_id = self.create_text(hw, 62 , width=300, font=('Ariel', 22, 'bold'), text=self.title)
self.sub_id = self.create_text(hw, 340, width=300, font=('Ariel', 18), text=self.subtitle, justify=tk.CENTER)
self.dsc_id = self.create_text(50, 360, width=300, font=('Ariel', 14), text=self.description, justify=tk.CENTER, anchor=tk.NW)
#https://stackoverflow.com/a/38645917/10292330
#this grabs a screenshot of the card at the exact position and size for the card
def save(self, *args):
root = self.nametowidget(self.winfo_toplevel())
x=root.winfo_rootx()+self.winfo_x()
y=root.winfo_rooty()+self.winfo_y()
x1=x+self.winfo_width()
y1=y+self.winfo_height()
ImageGrab.grab().crop((x,y,x1,y1)).save(f'{self.title}.png')
class App(tk.Tk):
def __init__(self):
tk.Tk.__init__(self)
self.geometry('392x560')
#must be loaded before we start making cards, as-well-as any other blanks
self.blank = ImageTk.PhotoImage(Image.open('blank.png'), name='blank')
#base kwargs for ALL cards that use THIS blank
blank_kwargs = {'blankname':'blank', 'width':self.blank.width(), 'height':self.blank.height()}
#symbiotic link data
sym_link_desc = (
"Activate while over an ally to buff them "
"or activate while over an opponent to defuff them. "
"The links you create are destroyed when you receive damage from a non-ally."
)
sym_link_kwargs = {
**blank_kwargs,
'title':'Symbiotic Link',
'subtitle':'Linkstrider',
'description':sym_link_desc
}
#symbiotic sustain data ~
#whoops @ "while while" ~ you get the point
#I left it cause I'm not remaking the image
sym_sustain_desc = (
"Activate while while linked to an enemy "
"to leech their health for a short duration. "
"The leeching ends if you are hit in it's duration."
)
sym_sustain_kwargs = {
**blank_kwargs,
'title':'Symbiotic Sustain',
'subtitle':'Linkstrider',
'description':sym_sustain_desc
}
#card
self.card = Card(self, **sym_link_kwargs)
self.card.pack()
#press space to save
self.bind('<space>', self.card.save)
if __name__ == '__main__':
App().mainloop()
```
[](https://i.stack.imgur.com/8fWIo.png)
[](https://i.stack.imgur.com/ccIH6.png)
1. tk.Canvas
2. tk.Canvas.create_image
3. tk.Canvas.create_text
4. tkinter docs main page
| null | CC BY-SA 4.0 | null | 2023-02-16T06:32:48.643 | 2023-02-16T07:39:38.647 | 2023-02-16T07:39:38.647 | 10,292,330 | 10,292,330 | null |
75,468,885 | 2 | null | 75,467,583 | 0 | null | I need see you nginx conf, or reference my conf:
```
location / {
try_files $uri $uri/ /index.php$is_args$query_string;
}
server {
listen 80;
server_name test.com;
index index.html index.htm index.php;
root D:/wwwroot/test/public;
autoindex on;
#301_START
#301_END
#HTTP_TO_HTTPS_START
#HTTP_TO_HTTPS_END
#SSL_START
#SSL_END
#REWRITE_START
location / {
try_files $uri $uri/ /index.php$is_args$query_string;
}
#REWRITE_END
#PHP_START
include php/php-8.1.conf;
#PHP_END
#PHPMYADMIN_START
#PHPMYADMIN_END
#DENY_FILES_START
location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
{
return 403;
}
#DENY_FILES_END
location ~ .+\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 1d;
error_log off;
access_log off;
}
location ~ .+\.(js|css)$
{
expires 1h;
error_log off;
access_log off;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
access_log logs/test.com.access.log;
error_log logs/test.com.error.log;
}
```
| null | CC BY-SA 4.0 | null | 2023-02-16T07:10:20.480 | 2023-02-16T07:10:20.480 | null | null | 13,883,561 | null |
75,469,371 | 2 | null | 75,456,664 | 0 | null | This FIXME_VAR_TYPE does not exist currently.
> The type or namespace name 'FIXME_VAR_TYPE'
as the error says...
So here's how you can fix it:
On you seem to be trying to use the fields as .
This is how it should look like
```
string text = "PUT TEXT HERE" : line 9
private string currentToolTipText = "" : line 10
```
you're using [Event.current.mousePosition](https://docs.unity3d.com/ScriptReference/Event-mousePosition.html) that is a [Vector2](https://docs.unity3d.com/ScriptReference/Vector2.html) that has two components (X and Y).
This is how it should look like:
```
float x = Event.current.mousePosition.x : line 36
float y = Event.current.mousePosition.y : line 37
```
| null | CC BY-SA 4.0 | null | 2023-02-16T08:07:19.123 | 2023-02-16T08:07:19.123 | null | null | 9,744,084 | null |
75,469,381 | 2 | null | 75,448,465 | 0 | null | I found the answer. I should [override set the cell-type](https://docs.sheetjs.com/docs/api/utilities/#value-override) myself, but as it's not a general format, it's different. ([example of the default one](https://github.com/SheetJS/sheetjs/blob/github/bits/10_ssf.js#L126))
1. Get the cell type. After making the real excel file (without issue) you can use:
```
var XLSX = require("xlsx");
var wb = XLSX.readFile("export.xlsx", {cellNF: true})
var ws = wb.Sheets[wb.SheetNames[0]]
console.log(ws["A1"].z)
```
And you will see the type. In my case, it's `'#,##0.00\\ "€";[Red]\\-#,##0.00\\ "€"'`.
1. For each <td>, you should add the given format everything as :
```
<td data-v="100" data-t="n" data-z='#,##0.00\ "€";[Red]\-#,##0.00\ "€"'><p>100,00€</p></td>
```
- `data-v``€`- `data-n`- `data-z`
1. Use same code to export the content, and everything will works.
| null | CC BY-SA 4.0 | null | 2023-02-16T08:08:24.743 | 2023-02-16T08:08:24.743 | null | null | 10,952,503 | null |
75,469,434 | 2 | null | 54,217,157 | 0 | null | DV gets the language from your browser.
The configuration classic home only works for answers
| null | CC BY-SA 4.0 | null | 2023-02-16T08:13:12.623 | 2023-02-16T08:13:12.623 | null | null | 21,225,153 | null |
75,469,774 | 2 | null | 75,460,472 | 0 | null | Similar to what @Gilad Waisel suggested. I think the most simplest ways would be just to extend the TextBox class and enter your desired validation into the TexhChangeEvent:
```
public class TextBoxDecimal : TextBox
{
readonly string CurrentSeperator;
public TextBoxDecimal()
{
CultureInfo cultureInfo = CultureInfo.CurrentCulture;
CurrentSeperator = cultureInfo.NumberFormat.CurrencyDecimalSeparator;
}
protected override void OnTextInput(TextCompositionEventArgs e)
{
if (double.TryParse(e.Text, out var value))
base.OnTextInput(e);
else if (e.Text == CurrentSeperator && !Text.Any(x => x == CurrentSeperator[0]))
base.OnTextInput(e);
}
}
```
This is not conflicting with MVVM however does operate ONLY on the UI side.
| null | CC BY-SA 4.0 | null | 2023-02-16T08:50:58.130 | 2023-02-16T08:50:58.130 | null | null | 7,109,905 | null |
75,470,096 | 2 | null | 75,466,641 | 0 | null |
1. Sort your data by columns B, C.
2. Do a VLOOKUP
3. The first line with a new Invoice Number also holds the invoice_amount, therefore the VLOOKUP returns what you need.
[](https://i.stack.imgur.com/0ByoQ.png)
| null | CC BY-SA 4.0 | null | 2023-02-16T09:20:30.300 | 2023-02-16T09:20:30.300 | null | null | 17,017,616 | null |
75,470,225 | 2 | null | 75,116,523 | 0 | null | The problem is really simple. Nextjs does not want you to change or add files to your public folder after deploy. Its also no vercel issue. You can try it local if you make an build and use next start. It will also not work. Its an security thing that next only allowes to access files in public that are existing on build time. Nextjs wants you to use cdn's for dynamic files instead. What we do is using an other folder called files/assets or uploads. And change our nginx or apache proxy config so nginx or apache delivers the files in that folder. If we dont have the possibility we create an asset api endpoint which delivers files from said folder.
| null | CC BY-SA 4.0 | null | 2023-02-16T09:29:59.333 | 2023-02-16T09:29:59.333 | null | null | 16,215,707 | null |
75,470,370 | 2 | null | 75,466,641 | 0 | null | What's wrong with this approach: instead of looking for that one cell which contains the value you're looking for, just sum everything together: if a cell is not filled in, the value is zero and it does not impact the sum anyway.
As a result, you get something like in the following sheet:
[](https://i.stack.imgur.com/U4DcL.png)
The used formula is `=SUMIF(A$2:A$16,D2,B$2:B$16)`.
| null | CC BY-SA 4.0 | null | 2023-02-16T09:40:00.170 | 2023-02-16T09:40:00.170 | null | null | 4,279,155 | null |
75,470,492 | 2 | null | 52,009,351 | -1 | null | We faced this issue using Java, Cucumber, Maven, Serenity, and IntelliJ. After trying everything the solution was so easy:
Just run IntelliJ as administrator.
| null | CC BY-SA 4.0 | null | 2023-02-16T09:51:44.827 | 2023-02-16T15:11:18.523 | 2023-02-16T15:11:18.523 | 4,294,399 | 10,455,669 | null |
75,470,516 | 2 | null | 75,470,449 | 0 | null | You need to add a custom callback function which creates an underline of the label.
For that you need to add `afterBody` callback :
```
callbacks: {
afterBody: function(tooltipItems) {
return '_________';
}
}
```
For effect of underline you can also set CSS for that :
```
.chartjs-tooltip:after {
content: '';
display: block;
border-bottom: 1px solid blue;
}
```
| null | CC BY-SA 4.0 | null | 2023-02-16T09:53:45.660 | 2023-02-16T09:53:45.660 | null | null | 14,870,617 | null |
75,470,745 | 2 | null | 75,457,298 | 0 | null | I have made changes into code & issue has been resolved. Please find below code.
```
from sys import path
path.append('\\Program Files\\Microsoft.NET\\ADOMD.NET\\160')
from pyadomd import Pyadomd
from flask import Flask, jsonify
# Create a Flask app
app = Flask(__name__)
# Define an API endpoint
@app.route('/alpino')
def alpino():
# Connect to Power BI and execute query
conn_str = 'Provider=MSOLAP;User [email protected];Data Source=powerbi://api.powerbi.com/v1.0/myorg/Power BI Model [Test];initial catalog=PBI_Model_20230121;Password=Alexw#2023;Persist Security Info=True;Impersonation Level=Impersonate;'
query = 'EVALUATE ROW("ProjectRowCount",COUNTROWS(Project) )'
with Pyadomd(conn_str) as conn:
with conn.cursor().execute(query) as cur:
data = cur.fetchall()
column_names = [column[0] for column in cur.description]
# Convert query result to a list of dictionaries
result = [dict(zip(column_names, row)) for row in data]
# Convert the list of dictionaries to a JSON string
json_result = jsonify(result)
return json_result
if __name__ == '__main__':
app.run()
```
[Json Output]
: [https://i.stack.imgur.com/YYbzy.png](https://i.stack.imgur.com/YYbzy.png)
This code defines a Flask API endpoint that connects to a Power BI data source and executes a query. Here's a step-by-step breakdown of the code:
-
> from sys import path
path.append('\Program Files\Microsoft.NET\ADOMD.NET\160')
> from pyadomd import Pyadomd
from flask import Flask, jsonify
-
> app = Flask(name)
-
> @app.route('/alpino')
-
> def alpino():
-
> with Pyadomd(conn_str) as conn:
with conn.cursor().execute(query) as cur:
data = cur.fetchall()
-
> column_names = [column[0] for column in cur.description]
-
> result = [dict(zip(column_names, row)) for row in data]
-
> json_result = jsonify(result)
-
> return json_result
In summary, this code sets up a Flask API endpoint that connects to a Power BI data source and returns the result of a query in JSON format. It uses the library to connect to the data source, and the library to define the API endpoint and return the JSON response.
#Stay Healthy #Stay Safe
Hope your query got resolved. If you have any query, Feel free to contact us.
|| Jay Hind Jay Bharat ||
| null | CC BY-SA 4.0 | null | 2023-02-16T10:13:32.403 | 2023-02-16T10:13:32.403 | null | null | 21,217,672 | null |
75,470,882 | 2 | null | 75,470,391 | 0 | null | try this code
```
let question = "Pick a number ";
let answer =Number(prompt(question));
while (answer < 10){
answer = Number(prompt(question));
}
```
Here I am storing the input value from the prompt to the variable named answer
while-loop will keep calling the prompt until the value of the answer is greater than or equal to 10
Hope this solves your problem
| null | CC BY-SA 4.0 | null | 2023-02-16T10:26:10.890 | 2023-02-16T10:32:52.547 | 2023-02-16T10:32:52.547 | 21,178,253 | 21,178,253 | null |
75,470,901 | 2 | null | 75,470,391 | 0 | null |
# First of all thanks for responding, and here I think I can answer.
```
let question = Number(prompt("Please pick a number"));
while (question < 10){
question = Number(prompt("Please pick a number"))
}
```
1. I made a variable equal to a number value for my string "Please pick a number."
2. In the while loop, it is self explanatory, the part that was confusing me earlier was not knowing what to write within the curly brackets. When I wrote question by itself, the computer froze.
3. Then after asking my teacher, she said to add another prompt.
4. So we added question = Number(prompt("Please pick a number")).
5. This repeated the loop and asked the same string while converting it to a number which allowed it to be checked again to see if the value is less than 10.
Thank you for helping me with my question.
| null | CC BY-SA 4.0 | null | 2023-02-16T10:27:16.463 | 2023-02-16T10:27:16.463 | null | null | 21,201,793 | null |
75,471,174 | 2 | null | 75,470,481 | -1 | null | You have following problems:
- - `EOF``feof``EOF`
```
fptr = fopen("integers.txt", "wb"); // <<< open with binary mode "wb"
...
fptr = fopen("integers.txt", "rb"); // <<< open with binary mode "rb"
printf("\nNumbers:\n");
int count = 0;
while (1)
{
num = getw(fptr);
if (feof(fptr)) // end of file reached => stop the loop
break;
printf("%d\n", num);
count++;
}
```
:
The [documentation of getw](https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/getw?view=msvc-170) concerning the return value is pretty misleading, especially the part seems wrong to me. `getw` can read -1 values (0xffffffff) without problems.
| null | CC BY-SA 4.0 | null | 2023-02-16T10:49:08.313 | 2023-02-16T11:02:25.640 | 2023-02-16T11:02:25.640 | 898,348 | 898,348 | null |
75,471,259 | 2 | null | 75,470,602 | 0 | null | With seaborn, you can use `sns.histplot(..., multiple='fill')`.
Here is an example starting from the titanic dataset:
```
from matplotlib import pyplot as plt
from matplotlib.ticker import PercentFormatter
import seaborn as sns
import numpy as np
titanic = sns.load_dataset('titanic')
ax = sns.histplot(data=titanic, x='age', hue='alive', multiple='fill', bins=np.arange(0, 91, 10), palette='spring')
for bars in ax.containers:
heights = [b.get_height() for b in bars]
labels = [f'{h * 100:.1f}%' if h > 0.001 else '' for h in heights]
ax.bar_label(bars, labels=labels, label_type='center')
ax.yaxis.set_major_formatter(PercentFormatter(1))
ax.set_ylabel('Percentage of age group')
plt.tight_layout()
plt.show()
```
[](https://i.stack.imgur.com/SDpMq.png)
| null | CC BY-SA 4.0 | null | 2023-02-16T10:56:51.997 | 2023-02-16T10:56:51.997 | null | null | 12,046,409 | null |
75,471,451 | 2 | null | 75,433,987 | 1 | null | Ok I figured this one out you have to add ValidIssuers where you specify host.docker.internal and localhost so then authentication can see them
So I added KeyckloakSettings class which takes configuration:
```
namespace SMS.OrderApi.Settings
{
public class KeycloakSettings
{
public string DockerRelamUrl { get; }
public string AppRelamUrl { get; }
public KeycloakSettings(IConfiguration config)
{
DockerRelamUrl = config.GetValue<string>("KeyCloak:DockerRelamUrl");
AppRelamUrl = config.GetValue<string>("KeyCloak:AppRelamUrl");
}
}
}
```
Added settings to the config
```
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"KeyCloak": {
"DockerRelamUrl": "http://host.docker.internal:8080/realms/sms",
"AppRelamUrl": "http://localhost:8080/realms/sms"
}
}
```
Then added new array of TokenValidationParameters.ValidIssuers to the JwtBearer in Program.cs
```
var builder = WebApplication.CreateBuilder(args);
var config = builder.Configuration;
builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var _keycloakSettings = new KeycloakSettings(config);
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(JwtBearerDefaults.AuthenticationScheme, o =>
{
o.Authority = _keycloakSettings.DockerRelamUrl;
o.TokenValidationParameters = new TokenValidationParameters
{
ValidateAudience = false
};
o.RequireHttpsMetadata = false;
o.TokenValidationParameters.ValidIssuers = new[]
{
_keycloakSettings.DockerRelamUrl,
_keycloakSettings.AppRelamUrl,
};
});
var app = builder.Build();
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.UseAuthentication();
app.UseAuthorization();
app.MapControllers();
app.Run();
```
| null | CC BY-SA 4.0 | null | 2023-02-16T11:14:05.323 | 2023-02-20T14:50:49.390 | 2023-02-20T14:50:49.390 | 10,871,073 | 21,202,483 | null |
75,471,489 | 2 | null | 75,462,017 | 0 | null | Assuming the second image is the schema (better to post as text not image!), there is a typo in the REFERENCES clauses of the house and head CREATE statements. Read them carefully and critically. It will not fail on the CREATE, only when trying to insert into either of the tables.
| null | CC BY-SA 4.0 | null | 2023-02-16T11:17:33.877 | 2023-02-16T16:13:23.610 | 2023-02-16T16:13:23.610 | 5,577,076 | 5,577,076 | null |
75,471,717 | 2 | null | 16,819,845 | 0 | null | The article in the other answer is dead so I don't know what the answer was. My app which runs in iOS WKWebView crashes when user choose "Take Photo". Adding `accept="application/octet-stream"` helps
```
<input type="file" accept="application/octet-stream" />
```
Or in our case, the input is created dynamically by Javascript:
```
txt.accept = mime; // mime is application/octet-stream
```
User is not presented with option menu and instead the file picker shows up immediately.
| null | CC BY-SA 4.0 | null | 2023-02-16T11:37:54.813 | 2023-02-16T11:37:54.813 | null | null | 653,457 | null |
75,472,181 | 2 | null | 14,953,132 | 0 | null | Here's what worked for me:
Step 1: Open up a Run window and type "mmc"
Step 2: Click File > Add/Remove Snap In
Step 3: Add > Certificates, Click OK
Step 4: Choose "Computer Account", then "Local Computer" and proceed.
Step 5: Hit OK
Step 6: Right click the Certificates folder on: Console Root > Certificates (Local Computer) > Personal > Certificates
Step 7: Select All Tasks > Import (Please note that the "Local Machine" is selected on the next window)
Step 8: Browse your .pfx file
Step 9: Then go to the IIS and create https binding
| null | CC BY-SA 4.0 | null | 2023-02-16T12:20:20.893 | 2023-02-16T12:20:20.893 | null | null | 2,503,592 | null |
75,472,213 | 2 | null | 75,463,233 | 0 | null | You can use the filter "woocommerce_login_redirect", which will redirect the user after successful login.
Follow the code below:
```
add_filter( 'woocommerce_login_redirect', 'my_login_redirect' );
function my_login_redirect( $redirect_to ) {
$redirect_to = 'http://www.example.com/my-account/';
return $redirect_to;
}
```
Hope this will help!
| null | CC BY-SA 4.0 | null | 2023-02-16T12:22:50.833 | 2023-02-16T12:22:50.833 | null | null | 4,395,404 | null |
75,472,324 | 2 | null | 75,208,849 | 0 | null | It's not an error.
If you want to remove the warning in GradleExeption, just remove it and replace it with RuntimeException.
| null | CC BY-SA 4.0 | null | 2023-02-16T12:32:26.903 | 2023-02-16T12:32:26.903 | null | null | 19,475,437 | null |
75,472,419 | 2 | null | 75,472,255 | 1 | null | Just remove FittedBox as below code, It will work
```
return Container(
width: double.infinity,
color: Colors.red,
child: FloatingActionButton.extended(
onPressed: () {},
label: const Text('My button'),
icon: const Icon(Icons.add),
),
),
```
| null | CC BY-SA 4.0 | null | 2023-02-16T12:40:06.733 | 2023-02-16T12:46:53.863 | 2023-02-16T12:46:53.863 | 20,774,099 | 20,774,099 | null |
75,472,522 | 2 | null | 75,472,287 | 1 | null | `1e-3` (and anything else with exponent) is a [double literal](https://en.cppreference.com/w/cpp/language/floating_literal). Thus, the result of `test1 * (1e-3)` is a `double` by the [implicit conversion rules](https://en.cppreference.com/w/c/language/conversion#Usual_arithmetic_conversions).
Using `%d` you tell [__android_log_print](https://developer.android.com/ndk/reference/group/logging#group___logging_1gac60e52c9711c53803ad9af639083afd5) that you are going to provide an `int`, but then you provide a `double`. That's Undefined Behaviour.
You probably want to do simply `test1 / 1000`, without getting into floating point territory. If you do want floats, use `%f` as specifier instead of `%d`.
| null | CC BY-SA 4.0 | null | 2023-02-16T12:48:24.507 | 2023-02-16T12:48:24.507 | null | null | 7,976,805 | null |
75,472,640 | 2 | null | 75,470,198 | 2 | null | I encountered the same issue today. Apparently it is caused by the newest version of esquery (1.4.1).
To fix this simply use an older version of esquery. You can do this via:
```
npm install --save-dev [email protected]
```
Be sure to not update or remove the ^ from "esquery": "^1.4.0" in package.json afterwards.
| null | CC BY-SA 4.0 | null | 2023-02-16T12:57:52.680 | 2023-02-16T12:57:52.680 | null | null | 16,607,250 | null |
75,472,661 | 2 | null | 75,472,545 | 0 | null | You are not passing data-address to i2cget. See man page.
```
i2cget -y 1 0x2d 0x02
```
| null | CC BY-SA 4.0 | null | 2023-02-16T12:59:57.267 | 2023-02-16T12:59:57.267 | null | null | 9,072,753 | null |
75,472,679 | 2 | null | 75,468,828 | 0 | null | It is not related to ag-grid. All you need is to add different CSS rule for links inside a selected row, to override link color (and also, probably, `:hover`, `:active`, `:focus` states).
```
.ag-row-selected A {
color: while;
}
```
| null | CC BY-SA 4.0 | null | 2023-02-16T13:02:11.303 | 2023-02-16T13:02:11.303 | null | null | 3,519,246 | null |
75,472,861 | 2 | null | 75,472,165 | 1 | null | You are trying to construct a circle with Bezier handles. And it seems you are not calculating the values but guessing and trying. This will be at least very hard if not impossible to solve. Try to add an arc instead of a curve.
Possible implementation:
```
struct customShape: Shape {
var xAxis : CGFloat
var radius: CGFloat = 40
var animatableData: CGFloat{
get { return xAxis}
set { xAxis = newValue}
}
func path(in rect: CGRect) -> Path {
return Path { path in
path.move(to: CGPoint(x: 0, y: 0))
// add a line to the starting point of the circle
path.addLine(to: CGPoint(x: xAxis - radius, y: 0))
// add the arc with the centerpoint of (xAxis,0) and 180°
path.addArc(center: .init(x: xAxis, y: 0), radius: radius, startAngle: .init(degrees: 180), endAngle: .init(degrees: 0), clockwise: true)
// complete the rectangle
path.addLine(to: .init(x: rect.size.width, y: 0))
path.addLine(to: CGPoint(x: rect.width, y: rect.height))
path.addLine(to: CGPoint(x: 0, y: rect.height))
path.closeSubpath()
}
}
}
```

| null | CC BY-SA 4.0 | null | 2023-02-16T13:17:56.317 | 2023-02-16T13:24:02.973 | 2023-02-16T13:24:02.973 | 6,950,415 | 6,950,415 | null |
75,472,952 | 2 | null | 75,470,198 | 2 | null | It's an `esquery` bug. Here is the relevant issue: [https://github.com/estools/esquery/issues/135](https://github.com/estools/esquery/issues/135)
If you are using yarn you can resolve a previous version of the problematic package (`esquery`) by putting this into `packge.json`. This will ignore the problematic version from one of the deps and use this explicit version.
```
"resolutions": {
"esquery": "1.4.0"
},
```
If you are using npm you can replace `resolutions` with `overrides`: [https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides](https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides)
How resolution works: [https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/#toc-how-to-use-it](https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/#toc-how-to-use-it)
| null | CC BY-SA 4.0 | null | 2023-02-16T13:25:59.900 | 2023-02-16T13:25:59.900 | null | null | 11,266,179 | null |
75,473,029 | 2 | null | 18,744,164 | 0 | null | the best way to do this even if you will add more items to parent is this
```
.parent {
display:flex;
flex-wrap: wrap;
justify-content: space-between;
}
```
and just add `::after` this this parent
```
.parent::after {
content: "";
flex-basis: 30% /* give it the same width of your child or item; */
}
```
and you fix it now, even if you added more child or items it will not overflow
| null | CC BY-SA 4.0 | null | 2023-02-16T13:32:41.580 | 2023-02-16T15:57:35.810 | 2023-02-16T15:57:35.810 | 7,785,700 | 7,785,700 | null |
75,473,194 | 2 | null | 75,460,472 | 0 | null |
```
decimal _MyValidNumber;
string _MyNumber;
public string MyNumber
{
get
{
return _MyNumber;
}
set
{
if (decimal.TryParse(value, out decimal result))
{
_MyValidNumber = result;
_MyNumber = value;
}
else
{
_MyNumber = "";
}
NotifyPropertyChanged(nameof(_MyNumber));
}
}
```
| null | CC BY-SA 4.0 | null | 2023-02-16T13:48:43.057 | 2023-02-16T13:55:36.913 | 2023-02-16T13:55:36.913 | 6,607,713 | 6,607,713 | null |
75,473,213 | 2 | null | 73,348,732 | 0 | null | Just had exactly same problem.
It was because the [useEffect](https://beta.reactjs.org/reference/react/useEffect#useeffect) hook was missing a dependency:
```
useEffect(() => {
// Some code
});
```
I just added `[]` and it got solved:
```
useEffect(() => {
// Some code
}, []);
```
| null | CC BY-SA 4.0 | null | 2023-02-16T13:50:18.207 | 2023-02-21T19:32:18.873 | 2023-02-21T19:32:18.873 | 13,138,364 | 10,997,805 | null |
75,473,384 | 2 | null | 75,408,540 | 0 | null | While I have no experience with SoftMotion CNC libraries, looking through the [documentation](https://content.helpme-codesys.com/en/libs/SM3_CNC/4.11.0.0/SM_CNC_POUs/SoftMotion-CNC/SoftMotion-Function-Blocks/SMC_Interpolator.html#smc-interpolator) the `dOverride` input argument seems to be promissing:
> ... The scheduled velocity of the particular objects will get scaled by dOverride; thus the scheduled velocity can be increased resp. reduced in online mode...
| null | CC BY-SA 4.0 | null | 2023-02-16T14:04:16.653 | 2023-02-16T14:04:16.653 | null | null | 11,427,841 | null |
75,473,843 | 2 | null | 75,471,938 | 0 | null | Field names are unique in Firestore, so you can't have (for example) two `receiver` fields.
What you have is a single field that is an array of values. I'd typically call that `receivers` (plural) to indicate that it's a multi-value field, and you'd write that from your code with:
```
final data = {
"sent_requests" : {
...
"receivers" : [args.uid],
...
}
};
```
This the `receivers` field to an array with just the value or `args.uid`. If you want to merge the `args.uid` with any existing values in the database already, you can use an [array-union operator](https://firebase.google.com/docs/firestore/manage-data/add-data#update_elements_in_an_array):
```
final data = {
"sent_requests" : {
...
"receivers" : FieldValue.arrayUnion([args.uid]),
...
}
};
```
Now the `args.uid` value will be added to the `receivers` array, unless it's already in there.
| null | CC BY-SA 4.0 | null | 2023-02-16T14:40:55.757 | 2023-02-16T14:40:55.757 | null | null | 209,103 | null |
75,474,113 | 2 | null | 74,818,160 | 0 | null | My current workaround is `y = np.sqrt(height) / 100 * 2.2`, which seems to work well at least for `height` from 5 to 25. If using `subplots_adjust(bottom=)`, a constant adjustment factor seems to work, like `y -= .04`. I've opened an [Issue](https://github.com/matplotlib/matplotlib/issues/25231).
```
width = 10
height = 20
y = np.sqrt(height) / 100 * 2.2
fig, _ = plt.subplots(23, 1, figsize=(width, height))
fig.supxlabel("supxlabel", y=y)
```
[](https://i.stack.imgur.com/7Dg0a.png)
| null | CC BY-SA 4.0 | null | 2023-02-16T15:01:38.770 | 2023-02-16T15:01:38.770 | null | null | 10,133,797 | null |
75,474,811 | 2 | null | 75,467,317 | 0 | null | You can't run anchor on Windows. Try installing WSL (windows subsystem for linux).
Go to the left corner of visual studio, press on remote connection, and try running the command again. The Solana BPF compiler doesn't work on Windows and Anchor uses that under the hood.
| null | CC BY-SA 4.0 | null | 2023-02-16T15:56:26.857 | 2023-02-28T19:43:08.403 | 2023-02-28T19:43:08.403 | 1,404,270 | 20,120,520 | null |
75,474,959 | 2 | null | 75,473,119 | 1 | null | Aliases are used on associations, I think.
If I define the object inside the package, I get this:
```
@startuml
allowmixing
skinparam backgroundcolor transparent
!theme vibrant
frame "workflow" {
package "batch" as p {
object "Foo" as bar {
+ x
}
}
object "Foo" as baz {
+ x
}
}
@enduml
```

| null | CC BY-SA 4.0 | null | 2023-02-16T16:07:59.280 | 2023-02-16T16:07:59.280 | null | null | 1,168,342 | null |
75,474,963 | 2 | null | 75,472,434 | 0 | null | The issue with your script is that the dataframe was not properly sorted in descending order by the "count" column.
That's why when the Opel arc was drawn last, it covered up the other arcs and making it appear as if there was only one color in the chart.
Here is the modified script with the data table sorted properly, I am not sure if it what you wanted:
```
d3 = pd.DataFrame({
'make': ['MERCEDES-BENZ', 'FORD', 'SKODA', 'TOYOTA', 'VOLKSWAGEN', 'OPEL'],
'count': [8637, 9405, 10617, 10903, 11178, 11672],
'value': [21.0283, 22.0488, 26.6724, 24.2498, 25.4069, 28.5445],
'value_int': [21, 22, 26, 24, 25, 28]
})
# Sort the data table by the "count" column in descending order
d3 = d3.sort_values('count', ascending=False)
p1 = alt.Chart(d3).encode(
theta=alt.Theta('value:Q', stack=True),
radius=alt.Radius('count', scale=alt.Scale(zero=True, rangeMin=20)),
color=alt.Color('make:N', legend=alt.Legend(orient='top'))
).properties(
height=600
)
p11 = p1.mark_arc()
st.altair_chart(p11)
```
[](https://i.stack.imgur.com/xxu41.png)
| null | CC BY-SA 4.0 | null | 2023-02-16T16:08:22.740 | 2023-02-16T16:08:22.740 | null | null | 2,186,559 | null |
75,475,160 | 2 | null | 75,469,856 | 1 | null | thks to krOoze, i find a way to solve my problem, since idk if it is the best solution.
the only thing i do is put the step "calculate the color" from vertex shader into frag shader.
here's my code:
```
//vertex shader
#version 450
layout(binding=0)uniform UniformBufferObject{
mat4 model;
mat4 view;
mat4 proj;
}ubo;
layout(location=0)in vec2 inPosition;
layout(location=1)in vec3 inColor;
layout(location=2)in vec2 inUV;
layout(location=0)out vec2 outPosition;
void main(){
gl_Position=ubo.proj*ubo.view*ubo.model*vec4(inPosition,0.,1.);
outPosition=inPosition;
}
//frag shader
#version 450
layout(location=0)in vec2 outPosition;
layout(location=0)out vec4 outColor;
vec3 red={1.f,0.f,0.f};
vec3 blue={0.f,0.f,1.f};
vec3 green={0.f,1.f,0.f};
vec3 white={1.f,1.f,1.f};
float translate(float i){
return i+.5;
}
float helpfunc(int x){
return mix(mix(blue[x],green[x],translate(outPosition.y)),mix(white[x],red[x],translate(outPosition.y)),translate(outPosition.x));
}
void main(){
outColor=vec4(helpfunc(0),helpfunc(1),helpfunc(2),1.);
}
```
and here is my outcome :

| null | CC BY-SA 4.0 | null | 2023-02-16T16:22:37.970 | 2023-02-25T19:56:13.390 | 2023-02-25T19:56:13.390 | 11,910,702 | 21,225,249 | null |
75,475,252 | 2 | null | 16,593,222 | 0 | null | I tried this code:
```
$('.form_contact')
.each(function(){
$(this).data('serialized', $(this).serialize())})
.on('change input', function(){
$(this)
.find('button:reset, button:submit')
.attr('disabled', $(this).serialize() == $(this).data('serialized'));})
.find('button:reset, button:submit')
.attr('disabled', true);
```
And it works perfectly on text input and textarea and select.
But when I upload a picture for example with the following input:
```
<input type="file" name="thumbnail" id="thumbnail" class="thumbnail-input__input" onchange="preview()" accept=".png,.jpg,.jpeg,.webp" data-file- input>
```
The image appears and everything is fine, but the buttons do not become active and remain disabled, does anyone have any idea what can be done to make it work?
| null | CC BY-SA 4.0 | null | 2023-02-16T16:30:55.073 | 2023-02-16T16:30:55.073 | null | null | 14,729,282 | null |
75,475,359 | 2 | null | 75,315,272 | 0 | null | This is a known issue and they're working on it:
[https://community.anaconda.cloud/t/anaconda-navigator-not-installed-packages-bug/50292/3](https://community.anaconda.cloud/t/anaconda-navigator-not-installed-packages-bug/50292/3)
Near term solution is to roll back to conda 22.9.
| null | CC BY-SA 4.0 | null | 2023-02-16T16:40:19.287 | 2023-02-16T16:40:19.287 | null | null | 1,356,703 | null |
75,475,493 | 2 | null | 75,467,970 | 0 | null | This is just dreadfully awful and something that really should not be done this way. I would really work hard to find a solution to fix the source data so isn't so absurd. But sometimes that just isn't possible.
Here is one way to deal with this. First I added a ROW_NUMBER so we can number each row from the original data. We need that in order for the final sort. This works with the sample data that you posted. I would be careful here as the datatypes seem to be a little suspect. And I would [avoid using the money datatype](https://www.red-gate.com/hub/product-learning/sql-prompt/avoid-use-money-smallmoney-datatypes) if at all possible.
```
with MergedData as
(
select h.Column1
, h.Column2
, h.Column3
, h.Column4
, h.Column5
, h.Column6
, h.Column7
, RowNum = ROW_NUMBER() over(order by Column1)
from InvoicesDemo2 h
union all
select d.Column8
, d.Column9
, d.Column10
, null
, null
, null
, null
, RowNum = ROW_NUMBER() over(order by Column1)
from InvoicesDemo2 d
)
select md.Column1
, md.Column2
, md.Column3
, md.Column4
, md.Column5
, md.Column6
, md.Column7
from MergedData md
order by md.RowNum
, md.Column1 desc
```
| null | CC BY-SA 4.0 | null | 2023-02-16T16:52:34.650 | 2023-02-16T16:52:34.650 | null | null | 3,813,116 | null |
75,475,612 | 2 | null | 75,475,433 | -1 | null | This is made using a document generator, and there are lots of them out there.
The specific one in your image example seem to be [Read the docs](https://readthedocs.org/).
You can look up "documentation generator" or "static documentation generator" for more examples.
| null | CC BY-SA 4.0 | null | 2023-02-16T17:04:02.153 | 2023-02-16T17:04:02.153 | null | null | 9,948,193 | null |
75,476,052 | 2 | null | 47,416,827 | 1 | null | An "easier" solution, using the new-ish attribute ([http://www.graphviz.org/docs/attrs/TBbalance/](http://www.graphviz.org/docs/attrs/TBbalance/)). TBbalance does just what you want.
```
digraph nfa {
TBbalance=min
A -> B
B -> C
C -> D
D -> E
A -> F
F -> E
}
```
Giving:
[](https://i.stack.imgur.com/B9MiG.png)
| null | CC BY-SA 4.0 | null | 2023-02-16T17:41:52.190 | 2023-02-16T17:41:52.190 | null | null | 12,317,235 | null |
75,476,702 | 2 | null | 73,041,587 | 0 | null | I went through this problem
The cause of the problem was that I had the files in extension Example.rar
Then instead of extracting the files by decompressing them
I dragged it through a program window through
instead of extracting it naturally
I was using a system at the time ubuntu And I want to access the files through a program "vs code"
The program I was using is called "Archive Manager"
The Archive Manager in Ubuntu is a utility program that allows users to manage compressed archives, such as ZIP, TAR, RAR, GZIP, and BZIP
Solve the problem if you go through the same experience as me
Unzip the files normally
Then try to make sure the files are working
| null | CC BY-SA 4.0 | null | 2023-02-16T18:50:53.873 | 2023-02-16T18:50:53.873 | null | null | 21,201,023 | null |
75,476,817 | 2 | null | 75,475,800 | 3 | null | If you are looking for a numerical result, you probably want to look at lambdify, which converts the symbolic polynomial to a numerical function for faster evaluation...
```
f = lambdify(coefficient_list, polynomial)
result = f(*coefficient_values)
```
| null | CC BY-SA 4.0 | null | 2023-02-16T19:03:04.097 | 2023-02-16T19:03:04.097 | null | null | 2,329,968 | null |
75,476,990 | 2 | null | 75,470,198 | 0 | null | Thank you for your answers. After I asked my question here, I reinstalled the vue cli project, but this time I did it by installing the default settings. I had installed it using airnb settings in the previous installation. This is how I solved the problem.
| null | CC BY-SA 4.0 | null | 2023-02-16T19:21:48.673 | 2023-02-16T19:21:48.673 | null | null | 18,203,054 | null |
75,477,250 | 2 | null | 71,677,095 | 0 | null | This happens when code-runner extension is installed in vs code.
Disable code-runner extension and reload the vs code.
| null | CC BY-SA 4.0 | null | 2023-02-16T19:52:38.313 | 2023-02-16T19:52:38.313 | null | null | 13,064,176 | null |
75,477,300 | 2 | null | 75,460,414 | 0 | null | You might want to try a different version of Java rather than the one that Weka comes with, to rule out that this is the culprit:
- From [adoptium.net](https://adoptium.net/temurin/releases/) download a ZIP file (not MSI!) of Java 11 and unzip it somewhere, e.g., on your Desktop (by using the ZIP file you don't have to be admin to make use of it).- Determine the absolute path to the executable `java.exe` that you just extracted, e.g.:```
C:\Users\MyUser\Desktop\jdk-11.0.18+10\bin\java.exe
```
- Determine the absolute path the `weka.jar` of your Weka installation, e.g.:```
C:\Program Files\Weka-3-8-6\weka.jar
```
- Open a Windows command-prompt.- Run the following command to start up Weka, using the paths that you just determined (use around the paths to account for potential spaces in the paths):```
"JAVAEXE_PATH" -jar "WEKAJAR_PATH"
```
Which translates to this using the above mentioned paths:```
"C:\Users\MyUser\Desktop\jdk-11.0.18+10\bin\java.exe" -jar "C:\Program Files\Weka-3-8-6\weka.jar"
```
If it is no longer slow, then the Zulu Java that comes with Weka is likely to be the culprit.
If not, you will have to check whether other programs, like an anti-virus, might cause the slowdown.
| null | CC BY-SA 4.0 | null | 2023-02-16T19:57:39.857 | 2023-02-16T19:57:39.857 | null | null | 4,698,227 | null |
75,477,607 | 2 | null | 25,963,607 | 0 | null | I just want to expand on Heinz’s code above. The code above introduces additional parameters to generate the test signal which is something that I have struggled with as well. After doing some in depth study I realized that these additional parameters are not needed and an explanation without them might make things clearer. The main simplification to keep in mind is this: the (Discrete) Fourier transform takes whatever number of points (elements of a data array) you give it and maps them to zero to 2 * pi. If N is the number of points, then you see 2 * pi / N throughout the calculations. The remainder of the explanation is in the Matlab code below.
```
function val = gauss(x, sigma, xc)
exponent = ((x-xc).^2)./(2*sigma);
val = (exp(-exponent));
endfunction
% Shift a Signal in the Frequency Domain.
% Number of points in the signal:
N = 128;
% Create a sample point array. It must be 0 to N-1 in steps of 1.
n=linspace(0,N-1,128);
% Generate a signal from the sample points.
g=gauss(n,20,30);
% The Fourier transform simply maps whatever number of points you give it
% to 0 to 2*pi. It does not take into consideration signal sampling rate or any other
% external parameters. Whatever set of points you give it, it maps them to the unit circle.
% Remember that a Fourier transform provides positive and negative frequency components centered
% about the zero frequency, called the DC offset. For a real signal the negative frequency components
% are the complex conjugate of the positive frequencies. This is called conjugate symmetric.
% Generate the frequency index.
m = linspace(-N/2, (N/2 – 1), N);
% For N = 128, m will be -64 to 63.
% In the following 2*pi / N will appear everywhere and often that number will appear as a constant
% such as w = 2*pi / N.
% Let S be the number of data points to shift the signal. Given the external parameters that were used
% to generate the signal you can back out what a point shift means, but the (Discrete) Fourier transform
% doesn’t care. It works on points, samples, or whatever you might call them.
S = 10;
% S = 10 means a 10 point shift.
% To introduce the shift in the frequency domain multiply the Fourier transform of the signal by
% exp(-i*(2*pi / N)*S* m) . It might help to remember that exp(i*f) = cos(f) + i * sin(f) .
% Fourier transform the signal.
fg = fft(g);
% Shift the signal in the frequency domain.
fh = fg .* exp(-i*(2*pi / N)*S* m);
% Inverse transform to see the signal back in the special domain. Note that we have to take the real
% part because even though the imaginary part will be very very small, the result will still be
% a complex number and it will confuse the graphing package.
h=real( ifft(fh) );
plot(n,g)
hold on
plot(n,h)
```
[](https://i.stack.imgur.com/K0KVE.png)
| null | CC BY-SA 4.0 | null | 2023-02-16T20:29:49.837 | 2023-02-16T20:29:49.837 | null | null | 5,386,097 | null |
75,477,721 | 2 | null | 75,477,671 | 1 | null | With this particular data set you just do:
```
df %>%
ggplot(aes(factor(word, c("hamster", "dog", "cat", "fish", "eagle")), val)) +
facet_wrap(part, scales = "free_x") +
labs(x = "word") +
geom_point()
```
[](https://i.stack.imgur.com/NjIda.png)
Though a more general solution for this setup would be to make the x axis numeric and apply all the values of "word" as labels to the axis:
```
ggplot(df, aes(seq_along(word), val)) +
facet_wrap(part, scales = "free_x") +
scale_x_continuous("word", breaks = seq(nrow(df)), labels = df$word,
expand = c(0.3, 0)) +
geom_point()
```
[](https://i.stack.imgur.com/JKL6l.png)
| null | CC BY-SA 4.0 | null | 2023-02-16T20:42:31.130 | 2023-02-16T20:49:05.870 | 2023-02-16T20:49:05.870 | 12,500,315 | 12,500,315 | null |
75,478,537 | 2 | null | 75,468,976 | 0 | null | Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side. If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution. Read more about that in the [Considerations for server-side Automation of Office](https://support.microsoft.com/en-us/topic/considerations-for-server-side-automation-of-office-48bcfe93-8a89-47f1-0bce-017433ad79e2) article.
Instead, consider using any components designed for the server-side execution and that don't required Office on the system.
| null | CC BY-SA 4.0 | null | 2023-02-16T22:27:41.703 | 2023-02-16T22:27:41.703 | null | null | 1,603,351 | null |
75,478,631 | 2 | null | 75,478,091 | 0 | null | I don't know if the +200 at the end of the formula is supposed to be included in the limit or not so just adjust the formula accordingly
```
=ROUND(IF(G13*F13+200>=H13,H13,F13*G13+200),-2)
```
Multiply the quantity and the weight and add 200.
If the result is equal to or greater than the limit, set the result to the limit.
Otherwise use the results of the quantity * weight + 200
And then round it according to your initial formula
| null | CC BY-SA 4.0 | null | 2023-02-16T22:42:25.500 | 2023-02-16T22:42:25.500 | null | null | 1,727,575 | null |
75,478,636 | 2 | null | 75,478,328 | 0 | null | To put it shortly, the error means one of the items you're trying to call isn't an array. Try adding each item in the equation seperately, so you can see what the issue is. Ex: `AlphaI = alpha[i]`, etc.
Only add/multiply at the end.
Hope this helps!
| null | CC BY-SA 4.0 | null | 2023-02-16T22:42:56.757 | 2023-02-16T22:42:56.757 | null | null | 20,171,610 | null |
75,478,954 | 2 | null | 75,478,328 | 2 | null | I believe that this should give you what you were looking for.
Here is the expression:
```
import sympy as sp
import numpy as np
x = np.array([[0.466,0,0,0,0,-0.466,0,0,0,0,0.466,0,0,0,0,0.590], [0.377,0,0,0,0,-0.377,0,0,0,0,0.377,0,0,0,0,0.755], [0.18,0,0,0,0,-0.18,0,0,0,0,0.18,0,0,0,0,0.949]])
t = np.array([-1, -1, 1]) # not sure what this was for?
y = _ ### define y
a = _ ### define alpha
m = _ ### define m
# define the sympy symbols
m_sym = sp.Symbol("m")
i, j = sp.symbols("i j", cls=sp.Idx)
a_sym = sp.IndexedBase("a")
x_sym = sp.MatrixSymbol("x", x.shape[0], x.shape[1])
y_sym = sp.IndexedBase("y")
# define the expression
expr = sp.Sum(a_sym[i], (i, 0, m_sym)) - 0.5 * sp.Sum(
sp.Sum(
a_sym[i] * a_sym[j] * y_sym[i] * y_sym[j] *
sp.DotProduct(x_sym[i, :], x_sym[j, :]),
(i, 1, m_sym),
),
(j, 1, m_sym),
)
```
Then if we print the expression, we get:
```
>>> sp.pprint(expr)
m m m
___ ___ ___
╲ ╲ ╲
╲ ╲ ╲
╱ a[i] - 0.5⋅ ╱ ╱ a[i]⋅a[j]⋅y[i]⋅y[j]⋅x[i:i + 1, :]⋅x[j:j + 1, :]
╱ ╱ ╱
‾‾‾ ‾‾‾ ‾‾‾
i = 1 j = 1 i = 1
```
You can then turn this expression into a function and evaluate it using `sp.lambdify`. I don't have your variables for evaluation, so I'm just going to fill it with the dummy variables that I created above.
```
func = sp.lambdify((a_sym, x_sym, y_sym, m), expr)
func(a, x, y, m) # will produce your answer
```
| null | CC BY-SA 4.0 | null | 2023-02-16T23:32:19.463 | 2023-02-16T23:37:35.800 | 2023-02-16T23:37:35.800 | 15,481,857 | 15,481,857 | null |
75,479,023 | 2 | null | 75,470,929 | 0 | null | My opinion on this is that your code has some logic that needs mocking, but that logic is implicit and not currently mockable. I would refactor the code as follows:
```
// settings.js
// Check whether we are on a production environment or not
export const isProd = () => !(IS_TEST_ENV || _DEV_)
// target.js
// Reversed order of URLs as the boolean expression returns true if we are in production
const urlPrefix = isProd() ? 'https://zzz/cms/media/' : 'https://xxx/cms/media/';
// target.test.js
// Mock out isProd() to return true, as by default it will be false
jest.mock('../settings', () => {
isProd: () => true
})
// Run test to ensure we are getting the right URL
```
The upside to this approach is that you have a single canonical source of whether you're in production or not, which is useful if you wind up needing to make that check in multiple places. You also only need to mock out or update one method if you want to change this behaviour in the future.
| null | CC BY-SA 4.0 | null | 2023-02-16T23:45:33.127 | 2023-02-16T23:45:33.127 | null | null | 1,857,909 | null |
75,479,453 | 2 | null | 75,479,432 | 0 | null | With chart.js v4, the chart configuration has changed slightly, so accessing the default colors require a different approach. Instead of looking for the borderColor attribute, you can just access the backgroundColor attribute of the dataset object to get the default colors that were assigned to each dataset.
Best of luck.
| null | CC BY-SA 4.0 | null | 2023-02-17T01:27:21.490 | 2023-02-17T01:27:21.490 | null | null | 21,196,207 | null |
75,479,598 | 2 | null | 75,460,414 | 0 | null | i think i found something :v
```
> java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @32464a14
java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
weka.core.WekaPackageClassLoaderManager.injectClasses(WekaPackageClassLoaderManager.java:792)
weka.core.WekaPackageClassLoaderManager.injectAllClassesInFromStream(WekaPackageClassLoaderManager.java:690)
weka.core.WekaPackageClassLoaderManager.injectMTJCoreClasses(WekaPackageClassLoaderManager.java:118)
weka.core.WekaPackageManager.<clinit>(WekaPackageManager.java:255)
weka.core.ResourceUtils.readProperties(ResourceUtils.java:241)
weka.core.ResourceUtils.readProperties(ResourceUtils.java:184)
weka.core.Utils.readProperties(Utils.java:183)
weka.core.logging.Logger.<clinit>(Logger.java:50)
weka.gui.GUIChooserApp.main(GUIChooserApp.java:1660)
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.base/java.lang.reflect.Method.invoke(Method.java:568)
weka.gui.SplashWindow.invokeMain(SplashWindow.java:306)
weka.gui.GUIChooser.main(GUIChooser.java:92)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
at weka.core.WekaPackageClassLoaderManager.injectClasses(WekaPackageClassLoaderManager.java:792)
at weka.core.WekaPackageClassLoaderManager.injectAllClassesInFromStream(WekaPackageClassLoaderManager.java:690)
at weka.core.WekaPackageClassLoaderManager.injectMTJCoreClasses(WekaPackageClassLoaderManager.java:118)
at weka.core.WekaPackageManager.<clinit>(WekaPackageManager.java:255)
at weka.core.ResourceUtils.readProperties(ResourceUtils.java:241)
at weka.core.ResourceUtils.readProperties(ResourceUtils.java:184)
at weka.core.Utils.readProperties(Utils.java:183)
at weka.core.logging.Logger.<clinit>(Logger.java:50)
at weka.gui.GUIChooserApp.main(GUIChooserApp.java:1660)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at weka.gui.SplashWindow.invokeMain(SplashWindow.java:306)
at weka.gui.GUIChooser.main(GUIChooser.java:92)
WARNING: A terminally deprecated method in java.lang.System has been called
WARNING: System::setSecurityManager has been called by weka.gui.GUIChooserApp (file:/C:/Users/Kenzn2/Downloads/Compressed/stable-3-8/weka/weka.jar)
WARNING: Please consider reporting this to the maintainers of weka.gui.GUIChooserApp
WARNING: System::setSecurityManager will be removed in a future release
```
[enter image description here](https://i.stack.imgur.com/uPCLE.png)
| null | CC BY-SA 4.0 | null | 2023-02-17T01:59:50.613 | 2023-02-17T01:59:50.613 | null | null | 15,608,614 | null |
75,479,786 | 2 | null | 68,683,703 | 0 | null | Try adding these to your webserver_config.py
```
AUTH_USER_REGISTRATION = True
AUTH_USER_REGISTRATION_ROLE = 'User' # Or any role that you want as default
```
| null | CC BY-SA 4.0 | null | 2023-02-17T02:39:31.157 | 2023-02-17T02:39:31.157 | null | null | 1,214,321 | null |
75,479,805 | 2 | null | 75,460,890 | 0 | null | Make another costume for each letter. When the user gets it wrong, send a broadcast to the particular letter sprite. Change the costume of the sprite.
| null | CC BY-SA 4.0 | null | 2023-02-17T02:42:28.847 | 2023-02-17T02:42:28.847 | null | null | 19,544,722 | null |
75,480,064 | 2 | null | 75,479,939 | 0 | null | In pure SQL, a cumulative sum would be sufficient...
```
SELECT
*,
SUM(
CASE WHEN [event label] = 'Rehire' THEN 1 ELSE 0 END
)
OVER (
PARTITION BY user_id
ORDER BY row_id
)
AS Result
FROM
t1
```
| null | CC BY-SA 4.0 | null | 2023-02-17T03:42:29.987 | 2023-02-17T03:42:29.987 | null | null | 53,341 | null |
75,480,449 | 2 | null | 75,480,140 | 0 | null | I think you may be trying to build the image.
If so, try:
```
docker build --tag=mysqlmbtamasterimg --file=./Dockerfile .
```
Don't omit that final space then period at the end of the command.
| null | CC BY-SA 4.0 | null | 2023-02-17T05:08:19.670 | 2023-02-17T05:08:19.670 | null | null | 609,290 | null |
75,480,478 | 2 | null | 75,480,335 | 0 | null | There is a typing mistake in your code. You're exporting the function as `getOrderByTable` from your custom hook useOrder but you're importing it as `getOrdersByTable` instead of `getOrderByTable` in your OrdersHistory component.
If you want to rename your function, you can do it as below
```
const { getOrderByTable as getOrdersByTable } = useOrder();
```
| null | CC BY-SA 4.0 | null | 2023-02-17T05:14:30.807 | 2023-02-17T05:14:30.807 | null | null | 10,498,256 | null |
75,480,491 | 2 | null | 75,480,441 | 0 | null | You can use the Python Imaging Library (Pillow) to add text with a different angle to an image. Here's an example code snippet to print "Hello World" at 120 degrees angle in an image:
```
from PIL import Image, ImageDraw, ImageFont
import math
# Open the image
image = Image.open("your_image.png")
# Create a new transparent image with the same size as the original image
overlay = Image.new('RGBA', image.size, (255, 255, 255, 0))
# Get a drawing context
draw = ImageDraw.Draw(overlay)
# Set the font and text
font = ImageFont.truetype('arial.ttf', 36)
text = "Hello World"
# Calculate the position and rotation of the text
angle = 120
radians = math.radians(angle)
width, height = draw.textsize(text, font)
x = (image.width - width) / 2
y = (image.height - height) / 2
cx, cy = x + width / 2, y + height / 2
x, y = x - cx, y - cy
x, y = x * math.cos(radians) - y * math.sin(radians), x * math.sin(radians) + y * math.cos(radians)
x, y = x + cx, y + cy
# Draw the text on the transparent image
draw.text((x, y), text, font=font, fill=(255, 255, 255, 255))
# Paste the transparent image on the original image with a given alpha value
alpha = 0.5
image = Image.alpha_composite(image, overlay)
# Save the image
image.save("output.png")
```
In this code, we first open the original image and create a new transparent image with the same size as the original image. Then, we get a drawing context for the transparent image, set the font and text, and calculate the position and rotation of the text based on the angle. Finally, we draw the text on the transparent image, paste the transparent image on the original image with a given alpha value, and save the output image.
| null | CC BY-SA 4.0 | null | 2023-02-17T05:17:41.067 | 2023-02-17T05:17:41.067 | null | null | 11,004,559 | null |
75,480,512 | 2 | null | 75,480,406 | 1 | null | One possibility would be to store the inputs and outputs somewhere, and then include them in subsequent inputs. This is very rudimentary but you could do something like the following:
```
inputs, outputs = [], []
while True:
prompt = input("Enter input (or 'quit' to exit):")
if prompt == 'quit':
break
if len(inputs) > 0:
inputs.append(prompt)
last_input, last_output = inputs[-1], outputs[-1]
prompt = f"{prompt} (based on my previous question: {last_input}, and your previous answer {last_output}"
else:
inputs.append(prompt)
response = openai.Completion.create(
model="text-davinci-003",
prompt=prompt,
max_tokens=200,
temperature=0,
)
output = response.choices[0].text
outputs.append(output)
print(output)
```
This program would be able to recall the last input and output, and provide that information along with the current prompt. You could include more lines of input and output depending on how much "memory" you want your program to have, and there is also a text limit (`max_tokens`), so you may need to adjust the wording so that the entire prompt makes sense.
And to avoid an infinite loop, we can have a condition to exit the while loop.
| null | CC BY-SA 4.0 | null | 2023-02-17T05:21:07.243 | 2023-02-17T15:02:56.277 | 2023-02-17T15:02:56.277 | 5,327,068 | 5,327,068 | null |
75,480,569 | 2 | null | 75,480,412 | 1 | null | ```
const res=[] //to save result
platforms.forEach(platform=>{ //go through platforms
platform.bankAccounts.forEach(bank=>{ //go through platform bank account
// to get lendingPlatform
const lendPlatform=platforms.find(p=>p.id==bank.lendingPlatformId);
//add the balance and compare
if((lendPlatform.bankAccounts[0].balance+bank.balance)==0)
res.push(true) // if combined balance is zero
else
res.push(false)
})})
console.log(res)
```
| null | CC BY-SA 4.0 | null | 2023-02-17T05:29:40.000 | 2023-02-17T05:29:40.000 | null | null | 16,512,168 | 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.