Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
sequence |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
74,500,295 | 2 | null | 74,500,254 | 0 | null | It seems you trying to load an asset in `/assets/assets/music/` folder.
My guess is that you want to load an asset in `/assets/music/` folder and it's a simple mistake.
To fix that:
```
// Replace the relative path of your asset below:
// assets/music/music1.mp3 -> music/music1.mp3
await player.setSource(AssetSource('music/music1.mp3'));
```
| null | CC BY-SA 4.0 | null | 2022-11-19T13:10:24.263 | 2022-11-19T13:10:24.263 | null | null | 11,550,065 | null |
74,500,303 | 2 | null | 74,500,254 | 0 | null | Firstly, create a `assets` directory on the root of your project , then create `music` folder.
Try to play with
```
await player.setSource(AssetSource('music/music1.mp3'));
```
| null | CC BY-SA 4.0 | null | 2022-11-19T13:11:16.047 | 2022-11-19T14:44:34.363 | 2022-11-19T14:44:34.363 | 10,157,127 | 10,157,127 | null |
74,500,320 | 2 | null | 74,500,214 | 0 | null | Ok I found a solution just add this ip address in your white list[](https://i.stack.imgur.com/ccjAa.png)
| null | CC BY-SA 4.0 | null | 2022-11-19T13:12:25.107 | 2022-11-19T13:12:25.107 | null | null | 14,913,529 | null |
74,500,356 | 2 | null | 74,499,671 | 0 | null | It looks like you aren't connected to any Jupyter servers, so the cells are actually waiting to be run. Please see [Visual Studio Docs](https://code.visualstudio.com/docs/datascience/jupyter-notebooks#_setting-up-your-environment) on how to set up:
>
### Setting up your environment
To work with Python in Jupyter Notebooks, you must activate an Anaconda environment in VS Code, or another Python environment in which you've installed the Jupyter package. To select an environment, use the Python: Select Interpreter command from the Command Palette (Ctrl+Shift+P).Once the appropriate environment is activated, you can create and open a Jupyter Notebook, connect to a remote Jupyter server for running code cells, and export a Jupyter Notebook as a Python file.
Once a cell is ran properly, there should be a green tick under the cell like below: [](https://i.stack.imgur.com/rI8mw.png)
| null | CC BY-SA 4.0 | null | 2022-11-19T13:16:09.427 | 2022-11-19T13:16:09.427 | null | null | 16,795,175 | null |
74,500,620 | 2 | null | 74,500,254 | 0 | null | Just remove assets from your audio source like this:
```
await player.setSource(AssetSource('music/music1.mp3'));
```
| null | CC BY-SA 4.0 | null | 2022-11-19T13:53:58.520 | 2022-11-19T13:53:58.520 | null | null | 5,263,456 | null |
74,500,694 | 2 | null | 74,500,631 | 3 | null | idk if this is what you are looking for, but here is an example:
```
.line {
border-top : 1px solid #000;
position : relative;
width : 100px
}
.line:after {
content : "";
position : absolute;
border-right : 1px solid #000;
height : 10px;
right : 0;
bottom : 0;
}
.line:before {
content : "";
position : absolute;
border-top : 1px solid #000;
height : 10px;
width : 100px;
right : -100%;
bottom : 110%;
}
```
```
<br>
<div class="line">
</div>
```
| null | CC BY-SA 4.0 | null | 2022-11-19T14:06:34.470 | 2022-11-19T14:11:24.513 | 2022-11-19T14:11:24.513 | 10,669,010 | 14,248,251 | null |
74,500,800 | 2 | null | 74,500,631 | 1 | null | I liked the challenge, so I tried to implement that, here is the result, it's not perfect, but it will help you get started.
```
.container {
background-color: #01383a;
width: 600px;
height: 140px;
overflow: hidden;
display: flex;
align-items: center;
}
.line {
height: 10px;
width: 1px;
background: #4fa445;
position: relative;
margin-left: 50%;
box-shadow: 4px 4px 0 rgba(79, 164, 69, 0.5);
}
.line:before,
.line:after {
content: "";
display: block;
height: 1px;
width: 304px;
background: #4fa445;
position: absolute;
box-shadow: 4px 4px 0 rgba(79, 164, 69, 0.5);
}
.line:before {
right: 0;
bottom: 0;
}
```
```
<div class="container">
<div class="line"></div>
</div>
```
| null | CC BY-SA 4.0 | null | 2022-11-19T14:18:34.367 | 2022-11-19T14:24:55.367 | 2022-11-19T14:24:55.367 | 3,367,974 | 3,367,974 | null |
74,500,829 | 2 | null | 74,500,736 | 1 | null | You are giving double spacing for case 1 which is causing the issue.
Instead of there being 18 spaces, there's 36 making the rows and columns un-even.
Use this instead
```
case 1:
printf(" ");
break;
```
| null | CC BY-SA 4.0 | null | 2022-11-19T14:24:06.080 | 2022-11-19T14:24:06.080 | null | null | 15,035,853 | null |
74,500,993 | 2 | null | 74,500,631 | 2 | null | I made it using a grid... So you can adjust dimentions easilly.
And there is a place for your title, so it will follow the lines responsively.
```
body{
background-color: #01383A;
}
.myHeader {
width: 100%;
display: grid;
grid-template-columns: 30% 6px 1fr; /* Adjust horizontal dimentions here - particularly for the title */
grid-template-rows: 2.5em 6px 10px 6px; /* Adjust vertical dimentions here */
grid-auto-flow: column;
}
.title {
grid-column: 1;
grid-row: 1;
text-align: right;
padding-right: 10px;
font-size: 2em;
color: #ffffff;
}
.lines-part-a {
grid-column: 1;
grid-row: 2 / 4;
border-bottom: 1px solid #358341;
border-right: 1px solid #358341;
}
.lines-part-b {
grid-column: 2 / 5;
grid-row: 2 / 4;
border-top: 1px solid #358341;
}
.lines-part-c {
grid-column: 1 / 3;
grid-row: 3 / 5;
border-bottom: 1px solid #10512A;
border-right: 1px solid #10512A;
}
.lines-part-d {
grid-column: 3 / 5;
grid-row: 3 / 5;
border-top: 1px solid #10512A;
}
```
```
<div class="myHeader">
<div class="title">Take order</div>
<div class="lines-part-a"></div>
<div class="lines-part-b"></div>
<div class="lines-part-c"></div>
<div class="lines-part-d"></div>
</div>
```
And here is a tiny variant... with some border-radiuses and dashes on each sides.
Just to demonstrate how fun a grid can be... ;)
[](https://i.stack.imgur.com/vI29J.png)
```
body{
background-color: #01383A;
}
.myHeader {
width: 100%;
display: grid;
grid-template-columns: 100px 20% 4px 1fr 100px;
grid-template-rows: 2.5em 4px 10px 4px;
grid-auto-flow: column;
}
.title {
grid-column: 1 / 3;
grid-row: 1;
text-align: right;
padding-right: 10px;
font-size: 2em;
color: #ffffff;
}
.lines-dashed-a {
grid-column: 1;
grid-row: 3 / 4;
border-bottom: 1px dashed #358341;
}
.lines-part-a {
grid-column: 2 / 3;
grid-row: 3 / 4;
border-bottom: 1px solid #358341;
border-right: 1px solid #358341;
border-radius: 0 0 4px 0;
}
.lines-part-b {
grid-column: 3 / 5;
grid-row: 2 / 3;
border-top: 1px solid #358341;
border-left: 1px solid #358341;
border-radius: 6px 0 0 0;
margin-left: -1px;
}
.lines-dashed-b {
grid-column: 5;
grid-row: 2 / 3;
border-top: 1px dashed #358341;
}
.lines-dashed-c {
grid-column: 1;
grid-row: 4 / 5;
border-bottom: 1px dashed #10512A;
}
.lines-part-c {
grid-column: 2 / 4;
grid-row: 4 / 5;
border-bottom: 1px solid #10512A;
border-right: 1px solid #10512A;
border-radius: 0 0 6px 0;
}
.lines-part-d {
grid-column: 4 / 5;
grid-row: 3 / 4;
border-top: 1px solid #10512A;
border-left: 1px solid #10512A;
border-radius: 4px 0 0 0;
margin-left: -1px;
}
.lines-dashed-d {
grid-column: 5;
grid-row: 3 / 4;
border-top: 1px dashed #10512A;
}
```
```
<div class="myHeader">
<div class="title">Take order</div>
<div class="lines-dashed-a"></div>
<div class="lines-part-a"></div>
<div class="lines-part-b"></div>
<div class="lines-dashed-b"></div>
<div class="lines-dashed-c"></div>
<div class="lines-part-c"></div>
<div class="lines-part-d"></div>
<div class="lines-dashed-d"></div>
</div>
```
| null | CC BY-SA 4.0 | null | 2022-11-19T14:46:50.730 | 2022-11-19T16:01:18.153 | 2022-11-19T16:01:18.153 | 2,159,528 | 2,159,528 | null |
74,501,426 | 2 | null | 74,495,889 | 0 | null | You can't create a with SUMMARIZE, since calculated tables don't recalculate on filter changes. So you first have to bring all the dates into one column to be able to filter on them. This is done by your dataset.
```
Unpivoted Dataset =
UNION (
SELECTCOLUMNS (
'Dataset',
"Client", 'Dataset'[Client],
"Product", 'Dataset'[Product],
"Type", "RequestDate",
"Date", 'Dataset'[RequestDate]
),
SELECTCOLUMNS (
'Dataset',
"Client", 'Dataset'[Client],
"Product", 'Dataset'[Product],
"Type", "DemoDate",
"Date", 'Dataset'[DemoDate]
),
SELECTCOLUMNS (
'Dataset',
"Client", 'Dataset'[Client],
"Product", 'Dataset'[Product],
"Type", "OrderDate",
"Date", 'Dataset'[OrderDate]
),
SELECTCOLUMNS (
'Dataset',
"Client", 'Dataset'[Client],
"Product", 'Dataset'[Product],
"Type", "ShppedDate",
"Date", 'Dataset'[ShppedDate]
),
SELECTCOLUMNS (
'Dataset',
"Client", 'Dataset'[Client],
"Product", 'Dataset'[Product],
"Type", "DeliveryDate",
"Date", 'Dataset'[DeliveryDate]
)
)
```
Next you need a Date table for your slicer with
```
Date = CALENDARAUTO()
```
Then you create a relation between the Date columns.
Finally you have to define measures for each count:
```
RequestsNum =
CALCULATE(
COUNT('Unpivoted Dataset'[Date]),
'Unpivoted Dataset'[Type] = "RequestDate"
)
DemosNum =
CALCULATE(
COUNT('Unpivoted Dataset'[Date]),
'Unpivoted Dataset'[Type] = "DemoDate"
)
OrdersNum =
CALCULATE(
COUNT('Unpivoted Dataset'[Date]),
'Unpivoted Dataset'[Type] = "OrderDate"
)
ShppedNum =
CALCULATE(
COUNT('Unpivoted Dataset'[Date]),
'Unpivoted Dataset'[Type] = "ShppedDate"
)
DeliveryNum =
CALCULATE(
COUNT('Unpivoted Dataset'[Date]),
'Unpivoted Dataset'[Type] = "DeliveryDate"
)
```
Putting everything together on a report page you get
[](https://i.stack.imgur.com/cnh1X.png)
or
[](https://i.stack.imgur.com/Gj1zr.png)
| null | CC BY-SA 4.0 | null | 2022-11-19T15:46:47.953 | 2022-11-19T15:46:47.953 | null | null | 7,108,589 | null |
74,501,480 | 2 | null | 74,501,423 | 1 | null | My best guess is that this is because you use a separate call t `DateTime.now()` for each countdown timer. If multiple `CountdownLabelState` widgets are rendered at slightly different times (as rendering each widget takes some time), they'll have slightly different `now` values.
If that is a problem for your use-case, consider have a single `now` value in the state of a parent widget - and passing that into each `CountdownLabelState` widget.
| null | CC BY-SA 4.0 | null | 2022-11-19T15:54:41.513 | 2022-11-19T15:54:41.513 | null | null | 209,103 | null |
74,501,538 | 2 | null | 74,498,955 | 2 | null | The between `Student` and `Course` means that for each (object) of `Student` there may or not be one or more to instances of `Course`. Formally, a link is defined in UML to be a tuple that identifies the objects at each end.
"Traversing" the association means to find for a `Student` all the `Course` with which the student is linked. How it is done is not specified, but there are two popular ways to implement this:
- `Student`- `Student``Course``Student``Course`
: traversing is related to the UML concept of . A navigable association from `Student` to `Course`, means that it's easy to traverse the association in this direction. Navigability can be unidirectional (e.g. if there is no efficient way for a course to find the linked students).
| null | CC BY-SA 4.0 | null | 2022-11-19T16:01:58.973 | 2022-11-19T22:55:18.433 | 2022-11-19T22:55:18.433 | 3,723,423 | 3,723,423 | null |
74,501,661 | 2 | null | 74,501,186 | 0 | null | Try adding a seState({}); inside your function.
| null | CC BY-SA 4.0 | null | 2022-11-19T16:19:03.777 | 2022-11-19T16:19:03.777 | null | null | 13,647,795 | null |
74,501,943 | 2 | null | 74,490,813 | 0 | null | try:
```
=QUERY({REDUCE({"","","","","","","","",""},
FILTER(L5:L, L5:L<>""), LAMBDA(a, b,
{a; IFERROR(INDIRECT(b&"!G1:O"), {"","","","","","","","",""})}))},
"where not Col8 is null", )
```
where L5:L is your:
[](https://i.stack.imgur.com/bgAAP.png)
see: [https://stackoverflow.com/a/74483215/5632629](https://stackoverflow.com/a/74483215/5632629)
---
## UPDATE:
```
=QUERY({REDUCE({""\""\""\""\""\""\""\""\""};
FILTER(SHEETSNAME(); REGEXMATCH(SHEETSNAME(); "sin")); LAMBDA(a; b;
{a; IFERROR(INDIRECT(b&"!G1:O"); {""\""\""\""\""\""\""\""\""})}))};
"where not Col8 is null"; )
```
[](https://i.stack.imgur.com/TOkxb.png)
| null | CC BY-SA 4.0 | null | 2022-11-19T17:00:40.300 | 2022-11-24T03:34:58.470 | 2022-11-24T03:34:58.470 | 5,632,629 | 5,632,629 | null |
74,502,035 | 2 | null | 74,501,339 | 1 | null | I noticed and fixed a number of things in your code:
1. start() is being called with the current value of vm.minutes, so it is going to start from that value and not 5. I changed it to use self.initialTime which means it's currently not using the value passed in. You need to decide if start() really wants to take a value and how to use it.
2. reset() wasn't being called. I call it from start().
3. Pause was only pausing the screen update. I changed it to keep track of the start time of the pause and to compute the amount of time paused so that it could accurately update the displayed time.
4. I made the Pause/Resume button one button with conditional values for title and color based upon vm.active.
---
Here is the updated code:
```
extension TimerView {
final class ViewModel: ObservableObject {
@Published var isActive = false
@Published var showingAlert = false
@Published var time: String = "5:00"
@Published var minutes: Float = 5.0 {
didSet {
self.time = "\(Int(minutes)):00"
}
}
var initialTime = 0
var endDate = Date()
var pauseDate = Date()
var pauseInterval = 0.0
// Start the timer with the given amount of minutes
func start(minutes: Float) {
self.initialTime = 5
self.reset()
self.endDate = Date()
self.endDate = Calendar.current.date(byAdding: .minute, value: self.initialTime, to: endDate)!
self.isActive = true
}
// Reset the timer
func reset() {
self.isActive = false
self.pauseInterval = 0.0
self.minutes = Float(initialTime)
self.time = "\(Int(minutes)):00"
}
func pause() {
if self.isActive {
pauseDate = Date()
} else {
// keep track of the total time we're paused
pauseInterval += Date().timeIntervalSince(pauseDate)
}
self.isActive.toggle()
}
// Show updates of the timer
func updateCountdown(){
guard isActive else { return }
// Gets the current date and makes the time difference calculation
let now = Date()
let diff = endDate.timeIntervalSince1970 + self.pauseInterval - now.timeIntervalSince1970
// Checks that the countdown is not <= 0
if diff <= 0 {
self.isActive = false
self.time = "0:00"
self.showingAlert = true
return
}
// Turns the time difference calculation into sensible data and formats it
let date = Date(timeIntervalSince1970: diff)
let calendar = Calendar.current
let minutes = calendar.component(.minute, from: date)
let seconds = calendar.component(.second, from: date)
// Updates the time string with the formatted time
//self.minutes = Float(minutes)
self.time = String(format:"%d:%02d", minutes, seconds)
}
}
}
struct TimerView: View {
@ObservedObject var vm = ViewModel()
let timer = Timer.publish(every: 0.1, on: .main, in: .common).autoconnect()
let width: Double = 250
var body: some View {
VStack {
Text("Timer: \(vm.time)")
.font(.system(size: 50, weight: .medium, design: .rounded))
.alert("Timer done!", isPresented: $vm.showingAlert) {
Button("Continue", role: .cancel) {
}
}
.padding()
HStack(spacing:50) {
Button("Start") {
vm.start(minutes: Float(vm.minutes))
}
.padding()
.background((Color(red: 184/255, green: 243/255, blue: 255/255)))
.foregroundColor(.black)
.cornerRadius(10)
.font(Font.system(size: UIFontMetrics.default.scaledValue(for: 16)))
//.disabled(vm.isActive)
Button(vm.isActive ? "Pause" : "Resume") {
vm.pause()
//vm.isActive = false
//self.timer.upstream.connect().cancel()
}
.padding()
.foregroundColor(.black)
.background(vm.isActive ? .red : .green)
.cornerRadius(10)
.font(Font.system(size: UIFontMetrics.default.scaledValue(for: 16)))
}
.frame(width: width)
}
.onReceive(timer) { _ in
vm.updateCountdown()
}
}
}
```
| null | CC BY-SA 4.0 | null | 2022-11-19T17:13:25.567 | 2022-11-19T17:13:25.567 | null | null | 1,630,618 | null |
74,502,294 | 2 | null | 74,502,066 | 1 | null | ```
const newarray = response.map((item) => {
return item.data.blah.param_1;
});
```
This sould work for your problem. If there is sub arrays u can use forEach like this
```
const newarray = [];
response.forEach((item) => {
item.data.blah.forEach((subItem) => {
newarray.push(subItem.param_1);
});
});
console.log(newarray);
```
| null | CC BY-SA 4.0 | null | 2022-11-19T17:49:46.360 | 2022-11-19T17:57:14.223 | 2022-11-19T17:57:14.223 | 6,677,999 | 6,677,999 | null |
74,502,491 | 2 | null | 74,502,431 | 0 | null | You forgot to pass an initial value for `curr` -
```
return yourData.reduce(function(curr, x) {
(curr[x[key]] = curr[x[key]] || []).push(x);
return curr;
}, {});
```
If you don't, then the first element of `yourData` will be used as the initial value.
| null | CC BY-SA 4.0 | null | 2022-11-19T18:17:03.547 | 2022-11-19T18:17:03.547 | null | null | 18,244,921 | null |
74,502,651 | 2 | null | 64,997,553 | 0 | null | Recently, I ran into the same problem twice after updating VS Code. When I tried to run a cell in a Jupyter notebook, it said I need to install a python extension (even though I had it installed). But I just went to the python extension and switched the version. That's it, it worked for me like that.
[](https://i.stack.imgur.com/Af8zh.png)
| null | CC BY-SA 4.0 | null | 2022-11-19T18:35:11.747 | 2022-11-19T18:35:11.747 | null | null | 8,861,411 | null |
74,502,948 | 2 | null | 69,655,692 | 0 | null | This started working for me after I installed [the latest .NET SDK](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-7.0.100-windows-x64-installer?journey=vs-code) and then restarted my PC.
| null | CC BY-SA 4.0 | null | 2022-11-19T19:17:30.477 | 2022-11-19T19:17:30.477 | null | null | 9,411,326 | null |
74,502,950 | 2 | null | 74,502,905 | 0 | null | It will take some frame to get data. Instead of providing hard-coded `itemCount: 10`,
provide
```
ListView.builder(
itemCount: _content.length,
```
To get 10 items use `_content.length>=10?10:_content.length`.
Also using `FutureBuilder` will be good choice.
| null | CC BY-SA 4.0 | null | 2022-11-19T19:17:35.223 | 2022-11-20T05:36:30.010 | 2022-11-20T05:36:30.010 | 10,157,127 | 10,157,127 | null |
74,503,887 | 2 | null | 14,218,307 | 2 | null | Okay, it seems there are a lot of answers here. Some maybe better than others. Incase someone was desperate enough to scroll down here, here's my two cents:
If you really want to style your dropdown, don't use `<select>`. `div` with a regular `<ul>` inside it will be a lot more flexible. However, if you really insist on using select because you just want the most minimal dropdown, here's mine:
```
select {
appearance: none;
background: white;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16px' height='16px' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6.1018 8C5.02785 8 4.45387 9.2649 5.16108 10.0731L10.6829 16.3838C11.3801 17.1806 12.6197 17.1806 13.3169 16.3838L18.8388 10.0731C19.5459 9.2649 18.972 8 17.898 8H6.1018Z' fill='%23212121'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 0.5rem center;
border-radius: 2px;
padding: 0.25rem 2rem 0.25rem 0.75rem;
}
```
```
<select>
<option value="bottom-right">Bottom right</option>
<option value="bottom-left">Bottom left</option>
<option value="top-right">Top right</option>
<option value="top-left">Top left</option>
</select>
```
So the key part is finding a caret svg that you can URL convert into a string. I could enhance it a little, maybe rotate the caret somehow, but really - I'm just happy it isn't god-ugly.
| null | CC BY-SA 4.0 | null | 2022-11-19T21:26:20.213 | 2022-11-19T21:26:20.213 | null | null | 5,253,279 | null |
74,504,225 | 2 | null | 30,044,369 | 0 | null | As the ts is monthly, so the yearly lag is divided into 12. The first figure is just a portion of the total ACF (i.e., for 1.5 years approx.). To have ACF for the full ts, use `acf(ts_object, lag.max = the max length of your ts_object)`. E.g., if you have 15 years monthly data, then set `lag.max = 12*15`.
| null | CC BY-SA 4.0 | null | 2022-11-19T22:23:58.420 | 2022-11-19T22:23:58.420 | null | null | 13,684,360 | null |
74,504,262 | 2 | null | 46,854,417 | 0 | null | I agree that explicit recursion is the simplest way to write this but using fix is confusing to all but very sophisticated programmers. Thus:
```
f :: Int
f =
f' 1 0
where
f' k tot
| tot >= (2.99 / 4.0) = k - 1
| otherwise = f' (k + 1) (tot + term)
where
term = 1.0 / fromIntegral (k * k + 2 * k)
```
Using the higher order function until may be seen as closer to the C++ code. Thus
```
fh :: Int
fh =
fk - 1
where
(fk, ft) = until ((>= (2.99 / 4.0)) . snd) fh' (1, 0)
fh' (k, tot) = (k + 1, tot + term)
where
term = 1.0 / fromIntegral (k * k + 2 * k)
```
Also the break in the C++ code is superfluous as that code can be written as
```
long double term(int k) { return 1.0/(k*k+2.0*k); }
int main() {
long double total = 0.0;
int k;
for (k=1;total<2.99/4.0;k++) {
total += term(k);
}
std::cout << k - 1 << std::endl;
return 0;
}
```
Finally wrt why computing the terms up to 150,000,000 doesn't give you a result greater than 0.7499999936264 this in inherent to floating point arithmetic. Adding a very small term to a relatively large total doesn't change the total:
```
λ> term k = 1.0 / fromIntegral (k * k + 2 * k)
λ> term 150000000
4.444444385185186e-17
λ> (2.99 / 4.0) + it == (2.99 / 4.0)
True
```
To avoid this you have to add the terms in reverse order, from the smallest to the largest.
| null | CC BY-SA 4.0 | null | 2022-11-19T22:28:46.510 | 2022-11-19T22:28:46.510 | null | null | 893,982 | null |
74,504,440 | 2 | null | 69,114,800 | 1 | null | It is officially supported as a community nuxt 3 module: [https://tailwindcss.nuxt.dev/](https://tailwindcss.nuxt.dev/)
You can find this module listed here: [https://nuxt.com/modules](https://nuxt.com/modules)
All that is required is:
```
yarn add --dev @nuxtjs/tailwindcss
// OR
npm install --save-dev @nuxtjs/tailwindcss
```
nuxt.config.ts
```
export default defineNuxtConfig({
modules: ['@nuxtjs/tailwindcss']
})
```
Thats is all, you do not need to configure `content` in `tailwind.config.js` as the module already comes pre-configured to handle `components`, `pages`, `layouts` etc...
| null | CC BY-SA 4.0 | null | 2022-11-19T23:07:08.417 | 2022-11-26T15:09:56.553 | 2022-11-26T15:09:56.553 | 1,356,141 | 1,356,141 | null |
74,504,835 | 2 | null | 74,504,737 | 0 | null | Actually the Firebase SDK for Flutter ( and I'm assuming that for Android/IOS) doesn't have any pre-built methods to get a `List` of all collections in the firestore database.
But, as I know you can get them with a cloud function written as example with `Node.js`, refer to [this](https://googleapis.dev/nodejs/firestore/latest/Firestore.html#listCollections) and [this](https://github.com/firebase/flutterfire/issues/7715).
if you're willing to write a cloud function to achieve this on your flutter project, then it's fine.
However, I can think about a practical solution, if that interest's you:
-
| null | CC BY-SA 4.0 | null | 2022-11-20T00:33:23.957 | 2022-11-20T00:33:23.957 | null | null | 18,670,641 | null |
74,505,438 | 2 | null | 74,505,385 | 0 | null | a better approach for this is that the conversation of the `Map<String, dynamic>` to an `Event` class object, should be done using a `factory` constructor of the `Event` class, and setting a default value for each property so if something goes null, your app won't crash, it will have a default value and work fine, like this:
add this to your `Event` class:
```
factory Event.fromMap(Map<String, dynamic>? map) {
return Event(
eid: map?["eid"] ?? "defaultValue,"
title: map?["title"] ?? "defaultValue",
location: map?["location"] ?? "defaultValue",
start: map?["start"] ?? "defaultValue,"
end: map?["ends"] ?? "defaultValue,"
instructor: map?["instructor"] ?? "defaultValue,"
image: map?["image"] ?? "defaultValue,"
description: map?["description"] ?? "defaultValue",
);
}
```
then instead of implementing your methods, save yourself from the boilerplate code by using the:
```
Event event = Event.fromMap(snapshot.data() as Map<String, dynamic>);
_events.add(event);
```
| null | CC BY-SA 4.0 | null | 2022-11-20T03:30:09.447 | 2022-11-20T07:15:00.000 | 2022-11-20T07:15:00.000 | 18,670,641 | 18,670,641 | null |
74,505,516 | 2 | null | 74,505,419 | 2 | null | The problem is that `fontBoundingBoxAscent` is not enabled in Firefox by default and requires the user to turn it on in `about:config` under `dom.textMetrics.fontBoundingBox.enabled`.
| null | CC BY-SA 4.0 | null | 2022-11-20T03:53:21.537 | 2022-11-20T03:53:21.537 | null | null | 5,774,952 | null |
74,505,741 | 2 | null | 28,750,108 | 0 | null | Swift 5 Answer!
If you try connecting both collectionViews to the same view controller Xcode will throw an error "Outlets cannot connect to repeating content"
Solution:
Head to Storyboard
1. Connect the first collectionView via outlet, set the delegate/dataSource in viewDidLoad and then add a tag to the second collectionView by heading to the attributes inspector in storyboard and change the value from 0 to 1
2. Select the secondCollectionView and go to the connections inspector and select delegate and drag the connection to the UIViewController and the same for the dataSource.
3. Simply check which collectionView is passing through. func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
if collectionView == collectionView.viewWithTag(1) {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "secondCollectionView", for: indexPath)
return cell
}
else {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "firstCollectionView", for: indexPath) as! HomeMainCollectionViewCell
cell.configureCell()
return cell}
}
| null | CC BY-SA 4.0 | null | 2022-11-20T04:49:50.887 | 2022-11-22T07:32:16.180 | 2022-11-22T07:32:16.180 | 17,463,670 | 17,463,670 | null |
74,505,875 | 2 | null | 66,753,122 | 0 | null | You can also use "tensorlearn" package in python for example using tensor-train (TT) SVD algorithm.
[https://github.com/rmsolgi/TensorLearn/tree/main/Tensor-Train%20Decomposition](https://github.com/rmsolgi/TensorLearn/tree/main/Tensor-Train%20Decomposition)
```
import numpy as np
import tensorlearn as tl
#lets generate an arbitrary array
tensor = np.arange(0,1000)
#reshaping it into a higher (3) dimensional tensor
tensor = np.reshape(tensor,(10,20,5))
epsilon=0.05
#decompose the tensor to its factors
tt_factors=tl.auto_rank_tt(tensor, epsilon) #epsilon is the error bound
#tt_factors is a list of three arrays which are the tt-cores
#rebuild (estimating) the tensor using the factors again as tensor_hat
tensor_hat=tl.tt_to_tensor(tt_factors)
#lets see the error
error_tensor=tensor-tensor_hat
error=tl.tensor_frobenius_norm(error_tensor)/tl.tensor_frobenius_norm(tensor)
print('error (%)= ',error*100) #which is less than epsilon
# one usage of tensor decomposition is data compression
# So, lets calculate the compression ratio
data_compression_ratio=tl.tt_compression_ratio(tt_factors)
#data saving
data_saving=1-(1/data_compression_ratio)
print('data_saving (%): ', data_saving*100)
```
| null | CC BY-SA 4.0 | null | 2022-11-20T05:21:56.137 | 2022-11-20T05:21:56.137 | null | null | 20,552,330 | null |
74,506,169 | 2 | null | 64,119,762 | 0 | null | Your nyquist is would be greater than the sampling rate. Try redcuing the number of filter band from default 6 to maybe 3 or 4. You can also reduce your fmin to say 50.
The sampling rate you have choosen is too small. Keep it around 44100, which is the standard. It should work fine then
| null | CC BY-SA 4.0 | null | 2022-11-20T06:41:28.577 | 2022-11-20T06:41:28.577 | null | null | 17,651,088 | null |
74,506,167 | 2 | null | 69,709,251 | 0 | null |
1. Open and clear the log: %AppData%\Local\JetBrains\PyCharmCE2022.1\log\idea.log (in PyCharm click Help > Show Log in Explorer).
2. Try to create VirtualEnv via PyCharm, you will see the "Failed to create Venv..." message
3. Open the log and look for errors In my case it was unable to import some modules because the threading module was not found (ie: ModuleNotFoundError: No module named 'threading'). My python3.10 was broken, maybe I have some problems with my PATH variable.
4. I was missing the modules threading, logging, and weakref, so I just copied them to %AppData%\Local\Programs\Python\Python310\Lib\ (from site-packages folder, in my case)
5. Enjoy creating as many VENV's as you needed. If you still have an error in PyCharm then repeat steps 2, 3, and 4 until you fix all errors about missing modules or other.
| null | CC BY-SA 4.0 | null | 2022-11-20T06:41:20.487 | 2022-11-23T20:47:11.547 | 2022-11-23T20:47:11.547 | 13,376,511 | 18,763,952 | null |
74,506,259 | 2 | null | 74,505,669 | 0 | null | This should give you a new pandas dataframe with the yearly mean. Note that the if statement has a subtract by 1 on the timestep to account for no December column for 2022.
```
new_df = pd.DataFrame() #create empty pandas dataframe
time_step = 12 #years
for i in np.arange(0, len(df.columns), time_step):
new_header = df.columns[i][-2:]
if new_header == str(22): #If the year is 2022
sliced_for_mean = df.iloc[:, i:i+time_step-1] #take one off from the last step (no December column)
new_df[new_header] = sliced_for_mean.mean(axis=1) #means for each row appended to new_df
else: #else do this
sliced_for_mean = df.iloc[:, i:i+time_step] #sliced df to calculate mean for year
new_df[new_header] = sliced_for_mean.mean(axis=1) #means for each row appended to new_df
print(new_df)
```
| null | CC BY-SA 4.0 | null | 2022-11-20T07:06:36.367 | 2022-11-20T07:06:36.367 | null | null | 16,644,344 | null |
74,506,287 | 2 | null | 74,506,237 | 0 | null | You are getting `null` value for `start` and `end`, you need to define a default value for them like other variable:
```
factory Event.fromMap(Map<String, dynamic>? map) {
return Event(
eid: map?['eid'] ?? 'undefined',
title: map?['title'] ?? 'undefined',
location: map?['location'] ?? 'undefined',
start: map?['starts'] ?? Timestamp(0, 0),//<--- add this
end: map?['ends'] ?? Timestamp(0, 0),//<--- add this
instructor: map?['instructor'] ?? 'undefined',
image: map?['image'] ?? 'undefined',
description: map?['description'] ?? 'undefined'
);
}
```
| null | CC BY-SA 4.0 | null | 2022-11-20T07:16:08.540 | 2022-11-20T07:16:08.540 | null | null | 10,306,997 | null |
74,506,289 | 2 | null | 74,506,237 | 0 | null | ```
start: map?['starts'],
end: map?['ends'],
```
What you are doing here is setting the start/end arguments to the map from firestore, but if the document doesn't have that field, you have no fallback and it returns `null`.
Do one of either:
1. Add a fallback value to the arguments, e.g. the current timestamp or some other:
```
start: map?['starts'] ?? Timestamp.now(),
end: map?['ends'] ?? Timestamp.now(),
```
1. Make the Timestamp nullable, if you expect things might be null there:
```
class Event {
// ...
Timestamp? start;
Timestamp? end;
```
| null | CC BY-SA 4.0 | null | 2022-11-20T07:16:51.380 | 2022-11-20T07:16:51.380 | null | null | 280,143 | null |
74,506,318 | 2 | null | 74,506,237 | 0 | null | This is because you are not giving a default value (the same way you are doing for all other variables):
`?? 'undefined'`
One possible solution is to allow for `null` values... just add `?` for both variables definitions, like this:
```
class Event {
String eid;
String title;
String location;
Timestamp? start; // *** change 1
Timestamp? end; // *** change 2
String instructor;
String image;
String description;
```
Let me know if this does not work.
| null | CC BY-SA 4.0 | null | 2022-11-20T07:23:02.330 | 2022-11-20T07:23:02.330 | null | null | 14,728,030 | null |
74,506,529 | 2 | null | 74,156,679 | 2 | null | The correct syntax is
```
[](https://shields.io/)
```
```
[](https://stackoverflow.com/users/12299287/cryptocode)
```
[](https://stackoverflow.com/users/12299287/cryptocode)
| null | CC BY-SA 4.0 | null | 2022-11-20T08:05:33.767 | 2022-11-20T08:05:33.767 | null | null | 12,299,287 | null |
74,507,026 | 2 | null | 74,506,831 | 0 | null | Without knowing how exactly the data of your file looks.
Here is a quick example of how to read the contents until there is no more data available and then add it to a ListBox.
This is just an example / a suggestion
```
// Use StringBuilder to store data from binary file.
StringBuilder buffer = new StringBuilder();
// Create a FileStream object to get the files contents.
using (var stream = new FileStream(
"file.bin",
FileMode.Open,
FileAccess.Read,
FileShare.Read))
{
// Pass stream to a BinaryReader.
using (var reader = new BinaryReader(stream)) {
// Do as long as there is any data.
while (reader.PeekChar() > -1) {
// Add char data to StringBuilder.
buffer.Append(reader.ReadChar());
}
}
}
// Your ListBox.
ListBox lbTest = new ListBox();
// I don't how your data looks so you will have to
// change it probably.
// I am splitting the string stored in the StringBuilder
// by the NewLine character/string to get individual lines.
string[] lines = buffer.ToString().Split(
new string[] { Environment.NewLine },
StringSplitOptions.None
);
// Iterate through your lines of text and create the
// items which you want to add.
for (int i = 0; i < lines.Length; i++) {
string[] items = new string[2] {
"some string",
"one more string"
};
ListViewItem item = new ListViewItem(items);
lbTest.Items.Add(item);
}
```
| null | CC BY-SA 4.0 | null | 2022-11-20T09:42:46.820 | 2022-11-20T09:42:46.820 | null | null | 13,523,921 | null |
74,507,171 | 2 | null | 74,507,125 | 2 | null | Wrap both the `Row`s and the `Text` widget, children of the first `Row` widget, with the `Expanded` widget and set the `mainAxisAlignmnet` of the right `Row` to `MainAxisAlignment.end`.
```
Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Row(
children: [
Container(
width: 45,
height: 45,
color: Colors.red,
),
],
),
),
const Expanded(
child: Text(
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
textAlign: TextAlign.center,
),
),
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
width: 45,
height: 45,
color: Colors.purple,
),
Container(
width: 45,
height: 45,
color: Colors.green,
),
],
),
),
],
),
)
```
Output:
 
---
If either of the sides will have more widget's then you can use the `Wrap` widget instead of the inner `Row` widgets which will wrap the overflowing items to the next line.
```
Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Wrap(
children: [
Container(
width: 45,
height: 45,
color: Colors.red,
),
],
),
),
const Expanded(
child: Text(
"Ex qui tempor dolore ex aliquip ex consectetur proident excepteur eu. Velit non sint laboris sit. Ut minim proident irure non ullamco deserunt qui. Quis eu tempor consequat amet irure consequat irure elit. Culpa id in laboris reprehenderit veniam voluptate tempor minim eu reprehenderit sit.",
textAlign: TextAlign.center,
),
),
Expanded(
child: Wrap(
alignment: WrapAlignment.end,
children: [
Container(
width: 45,
height: 45,
color: Colors.purple,
),
Container(
width: 45,
height: 45,
color: Colors.green,
),
Container(
width: 45,
height: 45,
color: Colors.orange,
),
Container(
width: 45,
height: 45,
color: Colors.red,
),
],
),
),
],
),
)
```
Output:

| null | CC BY-SA 4.0 | null | 2022-11-20T10:05:49.910 | 2022-11-21T01:34:27.467 | 2022-11-21T01:34:27.467 | 5,882,307 | 5,882,307 | null |
74,507,189 | 2 | null | 74,507,125 | 1 | null | If you don't have other widget width you can use `stack` widget:
```
Stack(
alignment: Alignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Container(
width: 45,
height: 45,
color: Colors.red,
),
],
),
Row(
children: [
Container(
width: 45,
height: 45,
color: Colors.purple,
),
Container(
width: 45,
height: 45,
color: Colors.green,
),
],
)
],
),
Text(
"Hello",
textAlign: TextAlign.center,
),
],
),
```
If your text is long, I recommend @OMiShah answer and wrap your text with `expanded` widget.
[](https://i.stack.imgur.com/oKNrC.png)
| null | CC BY-SA 4.0 | null | 2022-11-20T10:08:52.240 | 2022-11-20T10:26:39.697 | 2022-11-20T10:26:39.697 | 10,306,997 | 10,306,997 | null |
74,507,226 | 2 | null | 74,500,254 | 0 | null | Hello guys the solutions here are useful , so the main problem that I had was in the path so after correction it loaded the asset in a normal way,
but instead of just loading the asset you want it to play obviously and that's guaranteed by using :
```
**final player = AudioPlayer();**
**await player.play(AssetSource('music/music1.mp3'));**
```
| null | CC BY-SA 4.0 | null | 2022-11-20T10:13:38.317 | 2022-11-20T10:13:38.317 | null | null | 20,339,266 | null |
74,507,246 | 2 | null | 74,507,125 | 0 | null | try the following, I made it with the `Stack` widget:
[](https://i.stack.imgur.com/Oum3P.png)
```
Center(
child: Stack(
alignment: Alignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Container(
width: 45,
height: 45,
color: Colors.red,
),
],
),
Row(
children: [
Container(
width: 45,
height: 45,
color: Colors.purple,
),
Container(
width: 45,
height: 45,
color: Colors.green,
),
],
)
],
),
Text(
"Hello",
textAlign: TextAlign.center,
),
],
),
);
```
| null | CC BY-SA 4.0 | null | 2022-11-20T10:16:53.403 | 2022-11-20T10:16:53.403 | null | null | 18,670,641 | null |
74,508,037 | 2 | null | 74,505,669 | 0 | null | [melt](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.melt.html) month columns to a single column "month", and extract year value from month. Then aggregate by year:
```
df = pd.DataFrame(data=[
["M", "21-30", None, None, 15000, 21000, 22500, 21800, None, None, None],
["M", "31-40", 18000, 19200, 19000, None, None, 21800, 21500, 22300, 22000],
["M", "41-50", 22200, None, 15000, 21000, 22500, 21800, None, None, 22000],
], columns=["gender", "age_group", "Nov-20", "Dec-20", "Mar-21", "Apr-21", "May-21", "Jun-21", "Jan-22", "Feb-22", "Mar-22"])
df = df.fillna(0)
df = df.melt(id_vars=["gender", "age_group"], value_vars=df.drop(["gender", "age_group"], axis=1).columns, var_name="month", value_name="value")
df["year"] = df["month"].str.split("-").str[1]
df = df.groupby(["gender", "age_group", "year"]).agg(avg=("value", np.mean)).reset_index()
[Out]
gender age_group year avg
0 M 21-30 20 0.000000
1 M 21-30 21 20075.000000
2 M 21-30 22 0.000000
3 M 31-40 20 18600.000000
4 M 31-40 21 10200.000000
5 M 31-40 22 21933.333333
6 M 41-50 20 11100.000000
7 M 41-50 21 20075.000000
8 M 41-50 22 7333.333333
```
| null | CC BY-SA 4.0 | null | 2022-11-20T12:20:34.110 | 2022-11-20T12:20:34.110 | null | null | 2,847,330 | null |
74,508,250 | 2 | null | 53,357,839 | 1 | null | i have created a small library (imojify) to deal with that issue
```
from imojify import imojify
from matplotlib import pyplot as plt
from matplotlib.offsetbox import OffsetImage,AnnotationBbox
def offset_image(cords, emoji, ax):
img = plt.imread(imojify.get_img_path(emoji))
im = OffsetImage(img, zoom=0.08)
im.image.axes = ax
ab = AnnotationBbox(im, (cords[0], cords[1]), frameon=False, pad=0)
ax.add_artist(ab)
emjis = ['', '', '', '','', '', '']
values =[30, 50, 15, 29, 15, 50, 12]
fig, ax = plt.subplots(figsize=(12,8))
ax.bar(range(len(emjis)), values, width=0.5,align="center")
ax.set_xticks(range(len(emjis)))
ax.set_xticklabels([])
ax.tick_params(axis='x', which='major', pad=26)
ax.set_ylim((0, ax.get_ylim()[1]+10))
for i, e in enumerate(emjis):
offset_image([i,values[i]+5], e, ax)
```
the library contains images for all emojis,
`imojify.get_img_path(emoji)` simply returns the path of the emoji image then you can use OffsetImage to add these images as labels
| null | CC BY-SA 4.0 | null | 2022-11-20T12:53:32.633 | 2022-11-21T06:12:49.120 | 2022-11-21T06:12:49.120 | 20,554,644 | 20,554,644 | null |
74,508,258 | 2 | null | 74,471,453 | 0 | null | I looked at the code of class `javax.swing.JLabel` and also performed some experiments and discovered that when the text of the `JLabel` starts with `<html>`, a client property – named – is set and the property value has type `javax.swing.text.View`.
Note that if the `JLabel` text does start with `<html>` then there is no [client] property.
`View` has method `getPreferredSpan` which returns the width of the entire text (of the `JLabel`) and the height of a single line (depending on the parameter used when calling the method – see below code).
Assuming the total width you wish to assign is arbitrary (in the code in your question I believe that the width is 200), you can calculate how many lines will be required. From there you can calculate the required height.
I still haven't discovered why the calculated number of lines is 2 smaller than the required number so I added 2 to the calculated value.
Also note that I set the preferred size of the `JLabel`, rather than the (i.e. `JFrame`) and also call method `pack` so that the size will suit the `JLabel` preferred size.
```
import java.awt.Dimension;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.text.View;
public class Test {
public static void main(String[] args) {
EventQueue.invokeLater(() -> {
String text = "<html>It is a long established fact that a reader will be distracted " +
"by the readable content of a page when looking at its layout. The " +
"point of using Lorem Ipsum is that it has a more-or-less normal " +
"distribution of letters, as opposed to using 'Content here, content " +
"here', making it look like readable English. Many desktop publishing " +
"packages and web page editors now use Lorem Ipsum as their default " +
"model text, and a search for 'lorem ipsum' will uncover many web " +
"sites still in their infancy. Various versions have evolved over the " +
"years, sometimes by accident, sometimes on purpose (injected humour " +
"and the like).";
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel label = new JLabel(text);
View view = (View) label.getClientProperty("html");
float textWidth = view.getPreferredSpan(View.X_AXIS);
float charHeight = view.getPreferredSpan(View.Y_AXIS);
double lines = Math.ceil(textWidth / 200) + 2;
double height = lines * charHeight;
label.setPreferredSize(new Dimension(200, (int) Math.ceil(height)));
frame.add(label);
frame.pack();
frame.setLocationByPlatform(true);
frame.setVisible(true);
});
}
}
```
| null | CC BY-SA 4.0 | null | 2022-11-20T12:54:58.937 | 2022-11-20T12:54:58.937 | null | null | 2,164,365 | null |
74,508,321 | 2 | null | 70,463,054 | 1 | null | I also had the same issue. I was able to get the providers object inside `getServerSideProps` but it was not passing down as it should be inside the page. So it has to do with how my `_app.tsx` was configured to receive the `pageProps`.
I was following along a tutorial and below was how my app was configured to receive page props which was the problem:
```
function MyApp({ Component, pageProps:{ session, pageProps} }: AppProps) {
console.log(session);
return (
<SessionProvider session={session}>
<Component {...pageProps} />
</SessionProvider>
)
}
export default MyApp
```
I changed the app function to below which actually made sure my pages are receiving the `pageProps` without any problem:
```
function MyApp({ Component, pageProps }: AppProps) {
return (
<SessionProvider session={pageProps.session}>
<Component {...pageProps} />
</SessionProvider>
)
}
export default MyApp
```
| null | CC BY-SA 4.0 | null | 2022-11-20T13:03:42.013 | 2022-11-20T13:03:42.013 | null | null | 13,817,041 | null |
74,508,685 | 2 | null | 74,508,510 | 0 | null | First, from the data screen cap, it looks like the "country" column in your first dataset "df_GDP" is set as index. Reset it using "reset_index()". Then merge on multiple columns like `left_on=["countries","year"]` and `right_on=["country","year"]`. And since you want to retain all records from your main dataframe "df_biofuel_prod", so it should be "left" join:
```
combined_df = df_biofuel_prod.merge(df_GDP.reset_index(), left_on=["countries","year"], right_on=["country","year"], how="left")
```
Full example with dummy data:
```
df_GDP = pd.DataFrame(data=[["USA",2001,400],["USA",2002,450],["CAN",2001,150],["CAN",2002,170]], columns=["country","year","rgdpe"]).set_index("country")
df_biofuel_prod = pd.DataFrame(data=[["USA",400,2001],["USA",450,2003],["CAN",150,2001],["CAN",170,2003]], columns=["countries","Value","year"])
combined_df = df_biofuel_prod.merge(df_GDP.reset_index(), left_on=["countries","year"], right_on=["country","year"], how="left")
[Out]:
countries Value year country rgdpe
0 USA 400 2001 USA 400.0
1 USA 450 2003 NaN NaN
2 CAN 150 2001 CAN 150.0
3 CAN 170 2003 NaN NaN
```
You see "NaN" where matching data is not available in "df_GDP".
| null | CC BY-SA 4.0 | null | 2022-11-20T13:51:01.860 | 2022-11-20T13:51:01.860 | null | null | 2,847,330 | null |
74,508,767 | 2 | null | 74,499,590 | 1 | null | There is just a small error with:
```
x=sale['年紀'],sale['單位售價']
```
Rather than selecting the columns you want, this creates a tuple of the columns, hence the end of the error message `... does not match number of samples=2`
One way to create a new `pd.DataFrame` with your selected columns:
```
x=sale[['年紀', '單位售價']]
```
| null | CC BY-SA 4.0 | null | 2022-11-20T14:01:36.327 | 2022-11-20T14:01:36.327 | null | null | 1,409,374 | null |
74,509,194 | 2 | null | 74,508,861 | 3 | null | One way to do it is using `gruopby`. For example, you can group by `Column 1` and apply a function that returns the list of unique values for each group (i.e. each code).
```
import numpy as np
import pandas as pd
df = pd.DataFrame({
'col1': 'A A A A B B C C C D E E E E E'.split(' '),
'col2': ['Accrington', 'Acle', 'Suffolk', 'Hampshire', 'Lincolnshire',
'Derbyshire', 'Aldershot', 'Alford', 'Cumbria', 'Hampshire', 'Bath',
'Alston', 'Greater Manchester', 'Northumberland', 'Cumbria'],
})
def get_towns(town_list):
return ', '.join(np.unique(town_list))
df.groupby('col1')['col2'].apply(get_towns)
```
And the result is:
```
col1
A Accrington, Acle, Hampshire, Suffolk
B Derbyshire, Lincolnshire
C Aldershot, Alford, Cumbria
D Hampshire
E Alston, Bath, Cumbria, Greater Manchester, Nor...
Name: col2, dtype: object
```
the last line contains also `Cumbria`, differently from you expected results as this value appears also with the code `E`. I guess that was a typo in your question...
| null | CC BY-SA 4.0 | null | 2022-11-20T14:59:08.100 | 2022-11-20T15:07:02.123 | 2022-11-20T15:07:02.123 | 7,678,074 | 7,678,074 | null |
74,509,346 | 2 | null | 74,508,861 | 2 | null | Another option is to use `.groupby` with [aggregate](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.groupby.DataFrameGroupBy.aggregate.html) because conceptually, this is not a pivoting operation but, well, an aggregation (concatenation) of values. This solution is quite similar to Luca Clissa's answer, but it uses the pandas api instead of numpy.
```
>>> df.groupby("col1").col2.agg(list)
col1
A [Accrington, Acle, Suffolk, Hampshire]
B [Lincolnshire, Derbyshire]
C [Aldershot, Alford, Cumbria]
D [Hampshire]
E [Bath, Alston, Greater Manchester, Northumberl...
Name: col2, dtype: object
```
That gives you cells of lists; if you need strings, add a `.str.join(", ")`:
```
>>> df.groupby("col1").col2.agg(list).str.join(", ")
col1
A Accrington, Acle, Suffolk, Hampshire
B Lincolnshire, Derbyshire
C Aldershot, Alford, Cumbria
D Hampshire
E Bath, Alston, Greater Manchester, Northumberla...
Name: col2, dtype: object
```
If you want `col1` as a normal column instead of an index, add a `.reset_index()` at the end.
| null | CC BY-SA 4.0 | null | 2022-11-20T15:16:57.953 | 2022-11-20T15:16:57.953 | null | null | 15,873,043 | null |
74,509,731 | 2 | null | 74,488,983 | 1 | null | If you know that the lines are horizontal or vertical you can filter them out by combining erode and dilate (the [docs](https://docs.opencv.org/4.x/dd/dd7/tutorial_morph_lines_detection.html) describe how it works).
After seperating horizontal and vertical lines, you can filter them by size. At the end you can fill all remaining closed contours and again use erode/delete to exract the larger shapes.
This is more reliable than using Hough Line Transform and gives you more control over what exactly is extracted.
Here is a demo:
```
import numpy as np
import cv2 as cv
min_length = 29
max_length = 150
# erode and dilate with rectangular kernel of given dimensions
def erode_dilate(image, dim):
kernel = cv.getStructuringElement(cv.MORPH_RECT, dim)
result = cv.erode(image, kernel)
result = cv.dilate(result, kernel)
return result
# get contours and filter by max_size
def filter_contours(image, max_size):
contours, _ = cv.findContours(image, cv.RETR_TREE, cv.CHAIN_APPROX_SIMPLE)
dims = [(cnt, cv.boundingRect(cnt)) for cnt in contours]
contours = [cnt for cnt, (x, y, w, h) in dims if w <= max_size and h <= max_size]
return contours
# read image and get inverted threshold mask
img = cv.imread('test_img.jpg')
img_gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
ret, thres = cv.threshold(img_gray, 250, 255, cv.THRESH_BINARY_INV)
# extract horizontal lines
thres_h = erode_dilate(thres, (min_length, 1))
cv.imshow("horizontal", thres_h)
# extract vertical lines
thres_v = erode_dilate(thres, (1, min_length))
cv.imshow("vertical", thres_v)
# filter lines by max_length and draw them back to res
res = np.zeros_like(thres)
cntrs_h = filter_contours(thres_h, max_length)
cv.drawContours(res, cntrs_h, -1, 255, cv.FILLED)
cntrs_v = filter_contours(thres_v, max_length)
cv.drawContours(res, cntrs_v, -1, 255, cv.FILLED)
cv.imshow("filtered horizontal + vertical", res)
# fill remaining shapes
cntrs = filter_contours(res, max_length)
for c in cntrs:
cv.drawContours(res, [c], -1, 255, cv.FILLED)
cv.imshow("filled", res)
# extract larger shapes
res = erode_dilate(res, (min_length, min_length))
cv.imshow("squares", res)
# draw contours of detected shapes on original image
cntrs = filter_contours(res, max_length)
cv.drawContours(img, cntrs, -1, (0, 0, 255), 2)
cv.imshow("output", img)
cv.waitKey(-1)
cv.destroyAllWindows()
```
Output:
[](https://i.stack.imgur.com/xYBuL.png)
| null | CC BY-SA 4.0 | null | 2022-11-20T16:08:51.623 | 2022-11-20T22:15:08.777 | 2022-11-20T22:15:08.777 | 18,667,225 | 18,667,225 | null |
74,509,870 | 2 | null | 74,509,543 | 1 | null |
I guess you want the para and image both visible on the phone screen. So you can do that using flex property of CSS
Here is the example:
```
<html>
<head>
<title>Example</title>
<style>
.image img{
width:500px;
padding: 20px;
}
.content{
width: 500px;
padding: 20px;
}
.row{
display: flex;
}
@media (max-width:760px){
.row{
flex-direction: column;
}
}
</style>
</head>
<body>
<div class="row">
<div class="col content">
<h1>Some Heading</h1>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Maxime, id praesentium nesciunt vitae libero pariatur. Nam earum reiciendis error autem porro dicta officiis ullam. Alias, minima! Laborum natus maiores rem!</p>
</div>
<div class="col image">
<img src="https://images.unsplash.com/photo-1661961112835-ca6f5811d2af?ixlib=rb-4.0.3&ixid=MnwxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1172&q=80" alt="image">
</div>
</div>
</body>
</html>
```
| null | CC BY-SA 4.0 | null | 2022-11-20T16:25:27.157 | 2022-11-20T16:25:27.157 | null | null | 17,417,451 | null |
74,510,304 | 2 | null | 74,509,213 | 0 | null | In the OP code, the following lines get into infinite loop.
```
while (elementos <= tamanho - jogada || str2 == NULL);
```
Few potential issues to look at:
- - `elementos <= tamanho - jogada``jopada++`
| null | CC BY-SA 4.0 | null | 2022-11-20T17:19:54.570 | 2022-11-20T17:19:54.570 | null | null | 12,098,405 | null |
74,510,437 | 2 | null | 74,510,313 | 1 | null | you dont close your pasta label
`<label class="in-line" for="pasta"><input id="pasta" type="checkbox" name="type-of-food" value="Pasta">Pasta`
This might cause the break.
```
body {
width: 100%;
height: 100vh;
margin: 0;
font-family: Tahoma;
background-color: #1d3557;
font-size: 16px;
color: white;
}
h1, p {
margin: 1em auto;
text-align: center;
}
form {
width: 60vw;
min-width: 300px;
max-width: 500px;
margin: 0 auto;
/* background-color: #F7DBA7; */
}
label {
display: block;
}
.in-line {
display: inline-block;
margin: 0 5px 0 0;
}
input:not([type="radio"]):not([type="checkbox"]):not([type="submit"]), textarea, select {
width: 100%;
margin: 5px 0 10px 0;
min-height: 2em;
background-color: #457b9d;
border: 1px solid #1d3557;
color: white;
}
fieldset {
border: 0;
border-bottom: 2px solid #e63946;
margin: auto;
}
.submit {
display: block;
width: 60%;
height: 2em;
margin: 1em auto;
background-color: #457b9d;
border-color: #1d3557;
font-size: 1.1rem;
color: white;
font-family: tahoma;
}
::placeholder {
color: white;
}
fieldset:first-of-type {
border-top: 2px solid #e63946
}
.text-size {
font-size: 0.9em;
}
input[type="checkbox"] {
vertical-align: middle;
position: relative;
bottom: 1px;
}
```
And html
```
<!DOCTYPE html>
<html lang="en">
<head>
<title>Customer Survey</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1 id="title">Byens Pizza House Customer Survey</h1>
<p id="description">We are happy that you chose us! Please answer these short questions and help us improve for you!</p>
<!-- SURVEY -->
<form id="survey-form" method="post" action="">
<!-- NAME/EMAIL/GUESTS -->
<fieldset>
<label id="name-label" for="name-label">Your name: <input id="name" name="name-label" type="text" placeholder="James Smith" required></label>
<label id="email-label" for="email-label">Email: <input id="email" name="email-label" type="email" placeholder="[email protected]" required></label>
<label id="number-label" for="number-label">Number of guests: <input id="number" name="number-label" type="number" min="1" max="20" placeholder="2" required></label>
</fieldset>
<!-- TYPE OF FOOD -->
<fieldset>
Type of food you ordered:
<label for="type-of-food" class="text-size">
<label class="in-line" for="pizza"><input id="pizza" type="checkbox" name="type-of-food" value="Pizza" checked>Pizza</label>
<label class="in-line" for="burgers"><input id="burgers" type="checkbox" name="type-of-food" value="Burgers">Burgers</label>
<label class="in-line" for="pasta"><input id="pasta" type="checkbox" name="type-of-food" value="Pasta">Pasta</label>
<label class="in-line" for="seafood"><input id="seafood" type="checkbox" name="type-of-food" value="Seafood">Seafood</label>
<label class="in-line" for="sandwiches"><input id="sandwiches" type="checkbox" name="type-of-food" value="Sandwiches">Sandwiches</label>
<label class="in-line" for="salads"><input id="salads" type="checkbox" name="type-of-food" value="Salads">Salads</label>
<label class="in-line" for="desserts"><input id="desserts" type="checkbox" name="type-of-food" value="Desserts">Desserts</label>
<label class="in-line" for="beverage"><input id="beverage" type="checkbox" name="type-of-food" value="Beverage">Beverage</label>
</label>
</fieldset>
<!-- DELI/PICKUP/INSIDE -->
<fieldset>
Delivery method:
<label for="delivery" class="text-size"><input id="delivery" type="radio" name="delivery-method" value="delivery" checked> Delivery</label>
<label for="pickup" class="text-size"><input id="pickup" type="radio" name="delivery-method" value="pickup"> Pickup</label>
<label for="inside" class="text-size"><input id="inside" type="radio" name="delivery-method" value="inside"> Inside</label>
</fieldset>
<!-- COMMENT/REFERRER/RATE -->
<fieldset>
<label for="comment">Any thoughts?: <textarea id="comment" name="comment" rows="3" cols="30" placeholder="I liked spicy menu and choice of beverage..."></textarea></label>
<label for="referrer">How did you hear about us?
<select id="referrer" name="referrer">
<option value="">(select one)</option>
<option value="1">Social Media</option>
<option value="2">From a friend</option>
<option value="3">Leaflet</option>
<option value="4">Other</option>
</select>
</label>
<label for="satisfaction">Are you satisfied with our service?
<select id="dropdown" name="satisfaction">
<option value="">(select one)</option>
<option value="1">I am very satisfied!</option>
<option value="2">Service was ok.</option>
<option value="3">Not satisfied nor dissatisfied.</option>
<option value="4">I am dissatisfied.</option>
<option value="5">Sevice was terrible.</option>
</select>
</label>
</fieldset>
<label><input id="submit" type="submit" value="Submit" class="submit"></label>
</form>
</body>
</html>
```
| null | CC BY-SA 4.0 | null | 2022-11-20T17:38:12.080 | 2022-11-20T17:40:38.050 | 2022-11-20T17:40:38.050 | 1,606,853 | 1,606,853 | null |
74,510,498 | 2 | null | 74,509,213 | 1 | null | It is unclear what your code does, but there are some problems:
- the `do` / `while` loop is an error prone construction. It is less confusing to use a `for (;;)` (aka for ever) loop and make explicit tests to break from it, such as `if (scanf("%d %d", &casa, &elementos) != 2) break;`- the second part of the test `while (elementos <= tamanho - jogada || str2 == NULL);` is moot: `str2` is an array, it cannot be `NULL`. If you want to test for an empty string, use `str2[0] == '\0'` instead.- `str2` is not properly constructed: the only place where it gets modified is: `str2[i] = tabuleiro[i];` but `tabuleiro[i]` is set to `0` just before this statement, so part of `str2` is uninitialized and the only elements that get modified are null bytes.
| null | CC BY-SA 4.0 | null | 2022-11-20T17:47:49.287 | 2022-11-20T17:47:49.287 | null | null | 4,593,267 | null |
74,511,120 | 2 | null | 74,510,916 | 2 | null | First of all for debugging purposes you should use test id `ca-app-pub-3940256099942544/6300978111`, and second I think you should remove `< >` in id
| null | CC BY-SA 4.0 | null | 2022-11-20T19:09:49.293 | 2022-11-20T19:09:49.293 | null | null | 12,247,578 | null |
74,511,158 | 2 | null | 74,510,735 | 0 | null | You're selecting age_group, Education and Clm_Amt from a sub-select. OK so far. The problem is that the sub-select doesn't include Education or Clm_Amt.
```
SELECT age_group, EDUCATION, SUM(CLM_AMT)
FROM(
SELECT Education, Clm_Amt,
CASE
WHEN AGE <20 THEN '<20'
WHEN AGE BETWEEN 20 AND 29 THEN '20-30'
WHEN AGE BETWEEN 30 AND 39 THEN '30-40'
WHEN AGE BETWEEN 40 AND 49 THEN '40-50'
WHEN AGE BETWEEN 50 AND 60 THEN '50-60'
WHEN AGE > 60 THEN '>60'
END age_group
FROM Car.Claim)
group by age_group, Education
```
You need the `group by` clause to tell it when to show the total Clm_Amt - for each uniqueu value of age_group + Education. All totals like this are called aggregates, and include things like Max, Min, Avg, and you need to specify in them in the `group by` clause.
In fact, if you have an aggregate in the select clause, anything which isn't an aggregate must be in the group by: the order of them specifies which is the major grouping (in this case age_group) and the order of minor groupings (if any). if you had `group by Education, age_group`, then it would age_groups for each education level rather than education for each age group.
| null | CC BY-SA 4.0 | null | 2022-11-20T19:14:05.883 | 2022-11-20T19:14:05.883 | null | null | 3,014,322 | null |
74,511,301 | 2 | null | 74,505,079 | 0 | null | Somehow I have messed up basic.dart . After dicarding all the changes all back to normal.
| null | CC BY-SA 4.0 | null | 2022-11-20T19:33:50.820 | 2022-11-20T19:33:50.820 | null | null | 19,323,505 | null |
74,511,423 | 2 | null | 74,511,378 | 1 | null | If you know you're indexing the array from index 25 on, you could add 25 to the result:
```
argmax = close[25:].argmax() + 25
```
But if you're using an arbitrary slice of your array, another way to do this would be to create a similar array of indices, then slice that the same way:
```
indices = np.arange(len(close))
# some complicated slicing
sliced = close[2:-7:4]
# apply the same slicing:
sliced_indices = indices[2:-7:4]
# now, get the index in the original array of the argmax from the subset
argmax = sliced_indices[sliced.argmax()]
```
| null | CC BY-SA 4.0 | null | 2022-11-20T19:49:08.873 | 2022-11-20T19:49:08.873 | null | null | 3,888,719 | null |
74,512,040 | 2 | null | 74,511,677 | 0 | null | With your VsCode open press ctrl+shitf+x then will open a side bar like this.
in the text box look for "live server", it will be the first one like in the image.
[](https://i.stack.imgur.com/U6T9y.png)
| null | CC BY-SA 4.0 | null | 2022-11-20T21:11:09.463 | 2022-11-20T21:11:09.463 | null | null | 17,047,930 | null |
74,512,113 | 2 | null | 74,510,882 | 0 | null | The issue is that you are using the `SelectedIndex` and using that for the FK. `SelectedIndex` is just the position in the list of items that was selected, so 0,1,2,3,4,... The values in your drop down likely have different ID values, and you may even have them sorted by name etc. so the IDs might be 4,1,2,5,3 for example. Selecting the first item in the list might be Blood ID 4, but it's `SelectedIndex` would be 0 which doesn't correspond to any Blood record.
When you populate your Comboboxes based on the lookup tables you need to bind both the Text, and the Value of each item. Value being the Key for that record, I.e. BloodTypeId. Then I believe the `SelectedValue` should give you that bound Value amount, otherwise you might need to cast `SelectedItem` as a `SelectListItem` and get it's `Value`:
```
// try this...
tb.Blood_Id = Convert.ToInt32(dpdBlood.SelectedValue);
// or this...
var selectedItem = (SelectListItem)dpdBlood.SelectedItem;
tb.Blood_Id = Convert.ToInt32(selectedItem.Value);
```
This should be done for drop-downs. Otherwise you will get situations where the values you select don't get saved to the same record (where the index <> the ID) or errors where index doesn't match any ID.
| null | CC BY-SA 4.0 | null | 2022-11-20T21:22:06.023 | 2022-11-20T21:22:06.023 | null | null | 423,497 | null |
74,512,135 | 2 | null | 25,726,973 | 0 | null | It is possible to set a filter predicate for all nodes of a treeview hierarchy. Below I am providing an extension method you can call to set the filter function like this: `myTreeView.Filter(FilterPredicate);`. Of course in the filter predicate you need to distinguish between the different types of treeview nodes of your hierarchical data model.
Your predicate could look like this:
```
private bool FilterPredicate(object node) {
if (node is Students) {
return true; // always show nodes of level 0
}
else if (node is Student) {
return (node as Student).Name.StartsWith(_searchText);
}
return true;
}
```
Here is the extension method on TreeViewItem to set the filter on all TreeViewItems of the hierarchy recursively:
```
public static class TreeViewExtensions {
/// <summary>
/// Applies a search filter to all items of a TreeView recursively
/// </summary>
public static void Filter(this TreeView self, Predicate<object> predicate)
{
ICollectionView view = CollectionViewSource.GetDefaultView(self.ItemsSource);
if (view == null)
return;
view.Filter = predicate;
foreach (var obj in self.Items) {
var item = self.ItemContainerGenerator.ContainerFromItem(obj) as TreeViewItem;
FilterRecursively(self, item, predicate);
}
}
private static void FilterRecursively(TreeView tree, TreeViewItem item, Predicate<object> predicate)
{
ICollectionView view = CollectionViewSource.GetDefaultView(item.ItemsSource);
if (view == null)
return;
view.Filter = predicate;
foreach (var obj in item.Items) {
var childItem = tree.ItemContainerGenerator.ContainerFromItem(obj) as TreeViewItem;
FilterRecursively(tree, childItem, predicate);
}
}
}
```
| null | CC BY-SA 4.0 | null | 2022-11-20T21:26:25.537 | 2022-11-20T21:26:25.537 | null | null | 241,740 | null |
74,512,227 | 2 | null | 74,462,124 | 0 | null | First you have to decide if you want to take top-down or bottom-up approach. I'm thinking top-down is easier to grasp and (probably) more performant.
Either way this is a little more complex than a one liner. You'll need to do recursion; neither LDAP now Powershell's internal implementation return a parent's ancestry or a child's descendants.
There IS Get-AdGroupMember -Recursive but that will list only the (leaf) members of a group (anything that's not a container) and its descendant groups; it will NOT list any containers. So you can use that to get all the PCs in a set of groups. You can't however use it to get a group hierarchy.
You can use Get-AdGroupMember for a top down approach, grab all the objectClass=computer objects in there, then for each objectClass=group in the result set, feed that list into Get-AdGroupMember again (and maintain a list of the group names) until there are no longer any groups in the resultset.
You can also use Get-AdPrincipalGroupMembership for a bottom up approach and then trace membership paths upwards while listing any "inode" group names you find along the way. Here too the list of results (that will always be groups, obviously) will need to be fed into Get-AdPrincipalGroupMembership again until the result set is empty.
Do be aware that there may well be distinct traces for each computer object to an ancestor group, either intentional or not, so for each PC object you need to provide for multiple results.
| null | CC BY-SA 4.0 | null | 2022-11-20T21:40:29.467 | 2022-11-20T21:41:29.540 | 2022-11-20T21:41:29.540 | 20,551,048 | 20,551,048 | null |
74,512,415 | 2 | null | 69,099,751 | 0 | null | I found that Frank's code is still not working as await inside forEach will behave not as expected. You have to replace forEach with for loop.
After digging into it for a few days, I found the following code is working.
```
useEffect(() => {
const q = query(collection(db, "products"), where("active", "==", true));
const unsub = onSnapshot(q, async (querySnapshot) => {
const products = {};
for (const productDoc of querySnapshot.docs) {
products[productDoc.id] = productDoc.data();
const priceSnap = await getDocs(collection(productDoc.ref, "prices"));
for (const price of priceSnap.docs) {
products[productDoc.id].price = {
priceId: price.id,
priceData: price.data(),
};
}
}
setProducts(products);
});
return () => unsub();
}, []);
```
| null | CC BY-SA 4.0 | null | 2022-11-20T22:12:13.883 | 2022-11-21T01:33:27.577 | 2022-11-21T01:33:27.577 | 2,227,743 | 20,065,451 | null |
74,512,637 | 2 | null | 8,708,945 | 0 | null | Quick solution: Set `position: relative;` on the container element and set `position: absolute;` on child elements in that container element, with the necessary `top`, `left`, `bottom`, `right`-adjusting parameters:
```
.top-left {
position: absolute;
top: 2px;
left: 2px;
}
.bottom-right {
position: absolute;
bottom: 2px;
right: 2px;
}
.container {
position: relative;
text-align: center;
color: white;
float:left;color: white;
text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
```
```
<div class="container" style="">
<img src="https://www.wikipedia.org/portal/wikipedia.org/assets/img/[email protected]" width="100">
<div class="top-left">Wikipedia</div>
<div class="bottom-right">Everyone's Encyclopedia</div>
</div>
```
Center it directly in the middle with the following CSS...
```
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
```
| null | CC BY-SA 4.0 | null | 2022-11-20T22:49:22.083 | 2022-11-20T22:49:22.083 | null | null | 2,430,549 | null |
74,512,871 | 2 | null | 74,507,125 | 2 | null | I wrote a specific code that might suit your case, here is the result first:

basically, the idea of it is to get the width of both rows in corners, then search for the `max` within between them, then set the `Text()` width to the screen width size, minus that max multiplied by two, this ensures that it will be exactly in the center and not overlapping the widgets:
```
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:get/get.dart';
import 'controllers/controller.dart';
import 'dart:math' as math;
double firstRowWidth = 0;
double secondRowWidth = 0;
double max = 0;
class TestPage extends StatefulWidget {
TestPage({super.key});
@override
State<TestPage> createState() => _TestPageState();
}
class _TestPageState extends State<TestPage> {
final testController = Get.put(TestController());
@override
void initState() {
SchedulerBinding.instance.addPersistentFrameCallback((timeStamp) {
SchedulerBinding.instance.addPostFrameCallback((_) {
setState(() {
max = math.max(secondRowWidth, firstRowWidth);
});
});
});
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Stack(
alignment: Alignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
row2(),
row1(),
],
),
Positioned(
width: MediaQuery.of(context).size.width - (max * 2),
child: Text(
"Hello" * 20,
textAlign: TextAlign.center,
),
),
],
),
),
);
}
}
class row1 extends StatelessWidget {
const row1({super.key});
@override
Widget build(BuildContext context) {
SchedulerBinding.instance.addPostFrameCallback((_) {
firstRowWidth = context.size!.width;
});
return Row(
children: [
Container(
width: 45,
height: 45,
color: Colors.purple,
),
Container(
width: 45,
height: 45,
color: Colors.green,
),
],
);
}
}
class row2 extends StatelessWidget {
const row2({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
SchedulerBinding.instance.addPostFrameCallback((_) {
secondRowWidth = context.size!.width;
});
return Row(
children: [
Container(
width: 45,
height: 45,
color: Colors.red,
),
],
);
}
}
```
Hope this helps !
| null | CC BY-SA 4.0 | null | 2022-11-20T23:35:28.280 | 2022-11-20T23:35:28.280 | null | null | 18,670,641 | null |
74,512,912 | 2 | null | 74,438,234 | 0 | null | I found that I needed to delete the resources from the Resources.resx file, then I was able to just delete the files from the resources folder and it wouldn't say it couldn't find it anymore because there was no reason to find it!
| null | CC BY-SA 4.0 | null | 2022-11-20T23:46:18.407 | 2022-11-20T23:46:18.407 | null | null | 18,054,055 | null |
74,513,325 | 2 | null | 74,513,251 | 1 | null | The description is the description from the `head` of [your website](https://github.com/Nazchanel/eshaniyer.tech).
> `<meta property="og:description" content="This is the website that hosts Eshan Iyer’s portfolio and resume as well as many projects that he has created.">`
The image is not the favicon as I thought but another meta tag:
> `<meta name="twitter:image" content="http://graphics8.nytimes.com/images/2012/02/19/us/19whitney-span/19whitney-span-articleLarge.jpg">`
See [https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/summary-card-with-large-image](https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/summary-card-with-large-image)
To show it, you need to modify/customize the head file for the minimal theme, either in [head.html](https://github.com/jekyll/minima/blob/master/_includes/head.html) or in [custom-head.html](https://github.com/jekyll/minima/blob/master/_includes/custom-head.html).
I'd try head.html first:
```
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="twitter:image" content="https://avatars.githubusercontent.com/u/86535168?v=4">
...
</head>
```
| null | CC BY-SA 4.0 | null | 2022-11-21T01:26:53.813 | 2022-11-21T01:26:53.813 | null | null | 3,842,598 | null |
74,513,354 | 2 | null | 74,513,309 | 1 | null | > calculateCGPA ob[totalSubjectSem];
It's GCC extension called and not valid C++ (because `totalSubjectSem` is not `const`). Use `std::vector<calculateCGPA>` instead.
> for(int i = 1; i <= totalSubjectSem; i++) {
Indices start from 0 and going to `array_length - 1`. On last iteration you reading out of array bounds and program is crashing.
| null | CC BY-SA 4.0 | null | 2022-11-21T01:34:26.257 | 2022-11-21T01:34:26.257 | null | null | 5,647,513 | null |
74,513,353 | 2 | null | 74,513,309 | 2 | null | Take note that in C++ 0 is the first element, and n-1 is the last element. By looping to n, you cause a buffer overflow, hence resulting an error.
A solution would be as follows
```
void calculateCGPA::getGPA() {
cout << "Enter the the name of the subject: ";
cin >> subjectName;
cout << "Enter the credit hour:";
cin >> credithour;
cout << "Enter the grade: ";
cin >> grade;
}
int main () {
for (year=0; year<4; year++) {
for (sem=0; sem<2; sem++) {
cout << "Enter total subject you take in Year " << year << " Semester " << sem <<": ";
cin >> totalSubjectSem;
calculateCGPA ob[totalSubjectSem];
for(int i = 0; i < totalSubjectSem; i++) {
cout << "Subject " << i << ": \n";
ob[i].getGPA();
}
}
}
}
```
| null | CC BY-SA 4.0 | null | 2022-11-21T01:34:19.103 | 2022-11-21T01:59:15.170 | 2022-11-21T01:59:15.170 | 6,752,050 | 16,232,205 | null |
74,513,383 | 2 | null | 25,626,254 | 1 | null | I know this is very old but I got this working by adding the following to the exported UTI portion of Info.plist:
```
<key>UTTypeIconFiles</key>
<array>
<string>Icon64.png</string>
</array>
```
I happen to try this first with a 64x64px image and it worked. I didn't try other sizes.
`UTTypeSize64IconFile` and `UTTypeSize320IconFile` don't seem to be used.
My tests were while running my iOS app on an iPhone simulator and real iPhone both using iOS 16.1 but I'm sure it works with earlier versions - just not sure how far back.
With the use of `UTTypeIconFiles` I at least see my app's icon in the Files app when I come across a file from my app with this UTI.
| null | CC BY-SA 4.0 | null | 2022-11-21T01:39:22.977 | 2022-11-21T01:39:22.977 | null | null | 20,287,183 | null |
74,513,583 | 2 | null | 27,773,226 | 0 | null | Very late to this party, however there's another way to accomplish this using [html entities](https://www.w3schools.com/charsets/ref_html_entities_c.asp).
Using an entity rather than the normal charater-mark will essentially escape whatever and when rendered will not become a hyperlink.
For example, if I wanted a url to be in plaintext(meaning i dont want it to look like `code` , which for most cases would work just fine), but i had a usecase where I wanted part of the url to be bold, so:
`.Rmd`
```
Hyperlinked
: https://sub-domain-**env**.domain.com/path/to/collection
Non-Hyperlinked
: https://sub-domain-**env**.domain.com/path/to/collection
```
[](https://i.stack.imgur.com/0CL5S.png)
| null | CC BY-SA 4.0 | null | 2022-11-21T02:23:20.110 | 2022-11-21T02:23:20.110 | null | null | 5,133,721 | null |
74,513,709 | 2 | null | 74,513,232 | 1 | null | Solved it by using parameter "CommLinks".
So, the update script is
```
Add-OdbcDsn -Name SQL -Platform "32-bit" -DriverName "Microsoft Access Driver (*.mdb)" -DsnType "User" -SetPropertyValue @("Servername=SQLServer", "UserID=SQLUser", "CommLinks=SharedMemory,TCPIP{dobroadcast=no}")
```
| null | CC BY-SA 4.0 | null | 2022-11-21T02:48:27.130 | 2022-11-21T02:48:27.130 | null | null | 3,804,477 | null |
74,513,860 | 2 | null | 74,456,204 | 0 | null | I've changed your css a little bit, and add two more items into your flexbox. Maybe this is your intended layout? Hope this help!
```
#cards {
display: flex;
justify-content: center;
gap: 1rem;
flex-wrap: wrap;
}
#cards>* {
display: flex;
flex-direction: column;
margin-inline: auto;
padding-block: 10px;
}
.image {}
.top {
padding-block: 10px;
font-size: clamp(2em, 2vw, 4em);
}
.comp {
color: #6CACE4;
font-size: 14px;
font-weight: 200;
margin-bottom: 20px;
text-align: left;
padding-block: 10px;
}
.exp {
line-height: 24px;
color: #C4C4C4;
font-size: 16px;
font-weight: 200;
text-align: left;
}
.img {
width: 100%;
height: auto;
max-width: 100%;
object-fit: cover;
}
```
```
<div id="cards">
<div class="mbhs">
<div class="image">
<img src="https://picsum.photos/300/100" alt="MBHS" class="img">
</div>
<div class="top">
Title
</div>
<div class="exp">
Example text here
</div>
<div class="comp">
Example text
</div>
</div>
<div class="ominous">
<div class="image">
<img src="https://picsum.photos/300/100" alt="Ominous" class="img">
</div>
<div class="top">
Title
</div>
<div class="exp">
Example text here
</div>
<div class="comp">
Example text
</div>
</div>
<div class="mbhs">
<div class="image">
<img src="https://picsum.photos/300/100" alt="MBHS" class="img">
</div>
<div class="top">
Title
</div>
<div class="exp">
Example text here
</div>
<div class="comp">
Example text
</div>
</div>
<div class="mbhs">
<div class="image">
<img src="https://picsum.photos/300/100" alt="MBHS" class="img">
</div>
<div class="top">
Title
</div>
<div class="exp">
Example text here
</div>
<div class="comp">
Example text
</div>
</div>
</div>
```
| null | CC BY-SA 4.0 | null | 2022-11-21T03:15:42.863 | 2022-11-21T03:15:42.863 | null | null | 10,031,834 | null |
74,513,909 | 2 | null | 74,513,873 | 2 | null | you can wrap the image widget with a `Column`, to set widgets ordered vertically, I did it for the Row to show the button with a `MainAxisAlignment.spaceBetween` to space them
Give it a try this:
```
import 'package:flutter/material.dart';
import 'package:get/get_core/src/get_main.dart';
import 'package:get/get_navigation/get_navigation.dart';
import 'Reminder/ui/home_reminder.dart';
import 'Reminder/ui/widgets/button.dart';
void main() {
// debugPaintSizeEnabled = true;
runApp(const HomePage());
}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(
title: const Text('Medicine Reminder App'),
),
body: Column(
children: [
Stack(
children: [
Image.asset(
'images/MenuImg.jpg',
width: 600,
height: 200,
fit: BoxFit.cover,
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
ElevatedButton(
child: Text('btn 1'),
onPressed: () {},
),
ElevatedButton(
child: Text('btn 2'),
onPressed: () {},
),
ElevatedButton(
child: Text('btn 3'),
onPressed: () {},
),
],
),
],
),
),
);
}
}
```
| null | CC BY-SA 4.0 | null | 2022-11-21T03:25:00.410 | 2022-11-21T03:25:00.410 | null | null | 18,670,641 | null |
74,513,950 | 2 | null | 74,513,873 | 3 | null | Just change the `Stack` with Column or Listiw
```
body: Column(
children: [
Image.asset(
'images/MenuImg.jpg',
width: 600,
height: 200,
fit: BoxFit.cover,
),
/// your button is here:
Row(
children:[
ElevetedButton(),// btn 1
ElevetedButton(),// btn 2
...
],
),
```
| null | CC BY-SA 4.0 | null | 2022-11-21T03:32:45.917 | 2022-11-21T03:32:45.917 | null | null | 12,838,877 | null |
74,513,939 | 2 | null | 74,513,873 | 2 | null | You need to use the widget `Column` in the body argument of your `Scaffold` widget to have the possibility to add multiple widgets in a column view on your screen.
You can find a fully working example at this [zaap.run link](https://zapp.run/edit/flutter-zf6060ef706?entry=lib/main.dart&file=lib/main.dart).
You can also find the code without any preview here:
```
import 'package:flutter/material.dart';
void main() {
// debugPaintSizeEnabled = true;
runApp(const HomePage());
}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(
title: const Text('Medicine Reminder App'),
),
body: Column(children: [
Stack(
children: [
Image.network(
'https://i.imgur.com/9ZOaH1m.jpeg',
width: 600,
height: 200,
fit: BoxFit.cover,
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
TextButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(Colors.black)),
onPressed: () {},
child: Text("Button1"),
),
TextButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(Colors.black)),
onPressed: () {},
child: Text("Button2"),
),
TextButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(Colors.black)),
onPressed: () {},
child: Text("Button3"),
),
],
)
]),
),
);
}
}
```
| null | CC BY-SA 4.0 | null | 2022-11-21T03:30:53.737 | 2022-11-21T03:30:53.737 | null | null | 11,550,065 | null |
74,514,098 | 2 | null | 8,246,308 | 0 | null | I had my select into a grid. Thanks to the grid properties i can tell how width it should take between the row.
```
<Grid item xs={8}>
<div>
<label> Some label </label>
<Select className="comboStyle">
...
</Select>
</div>
</Grid>
```
And make sure that you set max-width to your "select" css
```
.comboStyle {
max-width: 100%
}
```
In this way it can't grow from the width assigned from the grid container
BTW: I'm using Material UI Components, but pretty sure you can find a solution with pure html
| null | CC BY-SA 4.0 | null | 2022-11-21T03:59:35.827 | 2022-11-21T03:59:35.827 | null | null | 9,976,474 | null |
74,514,109 | 2 | null | 19,812,988 | 1 | null | ```
var keywords = allWords.GroupBy(w => w.keyword);
foreach (var itm in keywords)
{
var list = itm.ToList();
//list returns all of the original properties/values objects from allwords.
//itm.key returns w.keyword
}
```
| null | CC BY-SA 4.0 | null | 2022-11-21T04:01:50.813 | 2022-11-21T04:01:50.813 | null | null | 5,100,141 | null |
74,514,117 | 2 | null | 74,503,601 | 1 | null | If I understand you correctly, maybe something like this ?
```
Sub test()
Dim splitVals As Variant
Set sh1 = ThisWorkbook.Sheets(1)
Set sh2 = ThisWorkbook.Sheets(2)
colcount = 6 'change if not the same with the actual table
lrow1 = sh1.Range("A65356").End(xlUp).Row
For j = 2 To lrow1
Set oFill = sh2.Range("A65356").End(xlUp).Offset(1, 0)
With sh1.Cells(j, 2)
If InStr(.Value, Chr(10)) Then
cnt = Len(.Text) - Len(Replace(.Text, Chr(10), "")) + 1
Set oFill = oFill.Resize(cnt, 1)
End If
End With
For i = 1 To colcount
With sh1.Cells(j, i)
If InStr(.Value, Chr(10)) Then
splitVals = Application.Transpose(Split(.Value, Chr(10)))
Else
splitVals = .Value
End If
End With
oFill.Offset(0, i - 1).Value = splitVals
Next i
Next j
End Sub
```
The code has two loop. The first, loop to each row in column A, the second, loop to each column of the table.
At the first loop, it check if the looped cell offset(j,2) has a line break then it set the oFill (the target cell to be filled) to resize as much as the rows needed.
At the second loop, it check if the looped cell has a line break then it get the value of the looped cell with split function as splitVals variable. If no line break, the splitVals value is the same with the looped cell. Then finally it put the splitVals to the oFill range. Do the same with the rest of the column.
Please be noticed, the code assumes that if in column B there are N names, then the rest of the column (same row) value is either with N lines or blank.
---
After from VBasic2008 help to my code, please change this line:
`lrow1 = sh1.Range("A65356").End(xlUp).Row`
`Set oFill = sh2.Range("A65356").End(xlUp).Offset(1, 0)`
into something like this :
`lrow1 = sh1.Range("A" & rows.count).End(xlUp).Row`
`Set oFill = sh2.Range("A" & rows.count).End(xlUp).Offset(1, 0)`
| null | CC BY-SA 4.0 | null | 2022-11-21T04:03:48.510 | 2022-11-21T06:06:21.557 | 2022-11-21T06:06:21.557 | 7,756,251 | 7,756,251 | null |
74,514,312 | 2 | null | 74,512,990 | 0 | null | So from my understanding, you want a result set that includes the top `Id` value for each `CrmId`. You were on the right track, but you needed to apply the `OrderByDescending()` withing each group and then pick just the latest (first) from within the ordered group members.
I believe the following should give you what you are looking for:
```
var perAnalystReport = await _context.Tats
.ProjectTo<PerAnalystReportDto>(_mapper.ConfigurationProvider)
.GroupBy(x => x.CrmId )
.Select(g => g.OrderByDescending(x => x.Id).First())
.ToListAsync();
```
Or perhaps with slightly better performance:
```
var perAnalystReport = await _context.Tats
.GroupBy(x => x.CrmId )
.Select(g => g.OrderByDescending(x => x.Id).First())
.ProjectTo<PerAnalystReportDto>(_mapper.ConfigurationProvider)
.ToListAsync();
```
The latter avoids building PerAnalystReportDto objects for records being excluded.
For the limited sample data provided, it should yield just the Id = 2 record for the CrmdId = 1 group.
| null | CC BY-SA 4.0 | null | 2022-11-21T04:42:55.350 | 2022-11-21T04:50:00.987 | 2022-11-21T04:50:00.987 | 12,637,193 | 12,637,193 | null |
74,514,421 | 2 | null | 66,650,149 | 0 | null | Just to clarify @Michal's answer, starting from 9.3 you can use dark mode along with pdi basically.
Since I have to switched to light mode to indicate the right position, there is a step by step for blind touching like me.
Preferences -> Second tab (Look & Feel) -> Use look of OS (3rd row from bottom)
[](https://i.stack.imgur.com/0Khr1.png)
| null | CC BY-SA 4.0 | null | 2022-11-21T04:57:44.263 | 2023-03-04T12:55:35.970 | 2023-03-04T12:55:35.970 | 3,789,481 | 3,789,481 | null |
74,514,503 | 2 | null | 49,931,480 | 0 | null | In my case, i missed to include the moment.js
| null | CC BY-SA 4.0 | null | 2022-11-21T05:13:45.717 | 2022-11-21T05:13:45.717 | null | null | 3,880,516 | null |
74,514,577 | 2 | null | 53,920,405 | 1 | null | import your image and try this command
```
import YourImage from "../filepath"
export const RecommendItem = styled.div`
background: url(${YourImage?.src});
`;
```
| null | CC BY-SA 4.0 | null | 2022-11-21T05:24:47.393 | 2022-11-21T05:24:47.393 | null | null | 9,825,931 | null |
74,514,744 | 2 | null | 74,512,341 | 0 | null | Welcome to stackoverflow.
You are knitting it into R Markdown document. Have a look at the code chunk, which contains this code. I think currently it looks like
```
{r}
barplot(t1,
legend = TRUE,
main="Commitment to Conserving Water vs. Age of Voice
and Familiarity of Imagery",
xlab = "Voice - Familiarity Level",
ylab = "Number of Participants",
ylim = c(0,40),
beside = TRUE)
```
Change the first line only.
```
{r fig.width=7}
barplot(t1,
legend = TRUE,
main="Commitment to Conserving Water vs. Age of Voice
and Familiarity of Imagery",
xlab = "Voice - Familiarity Level",
ylab = "Number of Participants",
ylim = c(0,40),
beside = TRUE)
```
You can experiment with different fig.width number to see how it looks like in the final document.
| null | CC BY-SA 4.0 | null | 2022-11-21T05:50:26.490 | 2022-11-21T05:50:26.490 | null | null | 12,806,202 | null |
74,514,737 | 2 | null | 74,512,341 | 1 | null | As already stated in comments, just play around with `fig.width=`, `fig.height=` chunk parameters. I chose a 6:4 ratio because it's standard in some journals.
```
---
output: pdf_document
---
```{r, echo=FALSE, fig.width=7, fig.height=4.67}
## simulate some data
set.seed(580509)
t1 <- replicate(10, runif(5, 0, 40)) |> `dimnames<-`(list(1:5, outer(c('AV', 'CV'), 0:4, paste)))
## plot
barplot(t1,
legend=TRUE,
main="Commitment to Conserving Water vs. Age of Voice
and Familiarity of Imagery",
xlab="Voice - Familiarity Level",
ylab="Number of Participants",
ylim=c(0, 40),
beside=TRUE)
```
```
[](https://i.stack.imgur.com/kjQ8O.png)
To change font size of "x-axis" you want to use the `cex.names=` argument. This is also possible for the legend; using the `args.legend=` argument you may specify all arguments of the `?legend` function.
```
## sim. data
set.seed(580509)
t1 <- replicate(10, runif(5, 0, 40)) |> `dimnames<-`(list(1:5, outer(c('AV', 'CV'), 0:4, paste)))
barplot(t1, legend=TRUE, ylim=c(0, 40), beside=TRUE,
cex.names=.8,
args.legend=list(x='topleft', cex=.8, title='levels')
)
```
[](https://i.stack.imgur.com/9e4ru.png)
Study the help `?barplot` carefully; it is really a powerful function, great your lecturer teaches it! It is IMO superior to `ggplot`, because it is able to directly process matrices, looks more professional, and is more intuitive.
| null | CC BY-SA 4.0 | null | 2022-11-21T05:49:17.307 | 2022-11-21T05:49:17.307 | null | null | 6,574,038 | null |
74,515,575 | 2 | null | 27,773,226 | 0 | null | The easiest and most localized way to do this is to "backslash-escape" the sign:
```
I don't want this\@to-be-a-link.com, and now it isn't.
```
This also works with weblinks:
```
Not a link: https\://posit.co
```
The autolink feature can also be completely disabled by turning off the `autolink_bare_uris` extension:
```
---
title: "Doc title"
output:
html_document:
md_extensions: -autolink_bare_uris
---
I don't want [email protected], and now it isn't.
```
URLs must then be wrapped in angular brackets to get a link: `<https://posit.co>`.
See also the "HTML document" section in the [R Markdown Cookbook](https://bookdown.org/yihui/rmarkdown/html-document.html).
| null | CC BY-SA 4.0 | null | 2022-11-21T07:35:19.757 | 2022-11-21T07:35:19.757 | null | null | 2,425,163 | null |
74,515,780 | 2 | null | 74,514,576 | 1 | null | Because ggplot's `aes()` is using lazy evaluation you need to force evaluation in each iteration of the loop (otherwise all plots will be the same on the last position of `i`).
One way to do this is by wrapping the righthand side of the assignment in `local()` and use `i <- i`:
The `labs(x = ...)` seemed not to be correct so I rewrote it as:
`x = names(data)[i]`, please check if that works for you.
```
plot_lst <- vector("list", length = Howmany) #' an empty list
for (i in 1:Howmany) {
plot_lst[[i]] <- local({
i <- i
ggplot(data=data, aes(x=data[, c(i)], y=data$gender)) +
geom_point(aes(size = 5)) +
scale_color_discrete(name = "dependent_variable") +
labs(
title = (paste("Logistic Regression Fitting Model", i)),
x = names(data)[i],
y = "gender")
})
}
```
Below is one example using the iris data set. If we print `plot_lst` we can see three different plots.
I assume the function `multiplot` is from the scatter package, which is not working with the latest R version, so I can't reproduce if this is working correctly.
```
Howmany <- readline(prompt="Specify the number of the independent variables: ")
Howmany <- as.numeric(Howmany)
plot_lst <- vector("list", length = Howmany) #' an empty list
for ( i in 1:Howmany){
plot_lst[[i]] <- local({
i <- i
ggplot(data = iris,
aes(x = iris[, c(i)],
y = iris$Species)) +
geom_point(aes(size = 5)) +
scale_color_discrete(name = "dependent_variable") +
labs(
title = paste("Logistic Regression Fitting Model", i),
x = names(data)[i],
y = "species"
)
})
}
plot_lst
```
| null | CC BY-SA 4.0 | null | 2022-11-21T08:00:20.493 | 2022-11-22T06:29:47.057 | 2022-11-22T06:29:47.057 | 9,349,302 | 9,349,302 | null |
74,516,437 | 2 | null | 74,491,174 | 1 | null | For the device which android version is lower than 12.0, you can use the following code to make the image full full the splash screen.
1. Delete the old splash image in the Resources/Splash folder.
2. Put your image in it and set it's build action as MauiSplashScreen
3. Create a xml file in the Platforms\Android\Resources\drawable\maui_splash.xml
```
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:opacity="opaque">
<item>
<bitmap
android:src="@drawable/splash" //the splash is your image's name
android:dither="true"
android:gravity="fill"/>
</item>
</layer-list>
```
And then, your image will show in the full splash screen.
For the device which android version is lower than(or =) 12.0, the android system changed the api about the splash screen. The resource code about is the `FrameLayout` contains a `ImageView` and we can't set the `ImageView` `layout_width` and `layout_height`. For more information, you can check the answer in [this link](https://stackoverflow.com/a/70346451/17455524).
| null | CC BY-SA 4.0 | null | 2022-11-21T09:04:41.187 | 2022-11-21T09:04:41.187 | null | null | 17,455,524 | null |
74,516,650 | 2 | null | 74,516,482 | 5 | null | Just use a `Canvas` and draw 2 circles and 1 line.
```
Canvas(Modifier.fillMaxSize()){
val radius = 64f //radius of circles
val strokeWidth = 20f
val lineHeight = 300f
val centerFirstCircle = Offset(100f, 100f)
drawCircle(
color = Color.Red,
radius = radius,
center = centerFirstCircle,
style = Stroke(width = strokeWidth)
)
//calculate the start and end of the vertical line
val xLine = centerFirstCircle.x
val yLine = centerFirstCircle.y + radius + strokeWidth/2
drawLine(
color = Red,
start = Offset(xLine, yLine),
end = Offset(xLine , yLine + lineHeight),
strokeWidth = strokeWidth
)
//calculate the center of the second circle
val centerSecondCircle = Offset( centerFirstCircle.x,
centerFirstCircle.y + (radius*2) + lineHeight + (strokeWidth/2 *2) )
drawCircle(
color = Color.Red,
radius = radius,
center = centerSecondCircle,
style = Stroke(width = strokeWidth)
)
}
```
[](https://i.stack.imgur.com/zPPyB.png)
| null | CC BY-SA 4.0 | null | 2022-11-21T09:21:42.210 | 2022-11-21T09:21:42.210 | null | null | 2,016,562 | null |
74,516,911 | 2 | null | 74,168,389 | 0 | null | I am definitely not an expert but using Joel's advice ... you can download a geojson from here:
[https://data.opendatasoft.com/explore/dataset/georef-canada-province%40public/export/?disjunctive.prov_name_en](https://data.opendatasoft.com/explore/dataset/georef-canada-province%40public/export/?disjunctive.prov_name_en)
Because I downloaded it I then had to open it rather than reference a url like most of the examples so
```
can_prov_file = 'C:/PyProjects/georef-canada-province.geojson'
with open(can_prov_file) as f:
var_geojson = geojson.load(f)
data_geojson = alt.InlineData(values=var_geojson, format=alt.DataFormat(property='features',type='json'))
# chart object
provinces = alt.Chart(data_geojson).mark_geoshape(
).encode(
color="properties.prov_name_en:O"
).project(
type='identity', reflectY=True
)
```
Worked for me. Best of luck.
| null | CC BY-SA 4.0 | null | 2022-11-21T09:42:50.343 | 2022-11-21T09:42:50.343 | null | null | 14,085,339 | null |
74,516,945 | 2 | null | 74,516,915 | 0 | null | You can use `join` with generator comprehension for extract `name`s to joined strings:
```
movies['genres'] = movies['genres'].apply(lambda x: ','.join(y['name'] for y in x))
```
Or:
```
movies['genres'] = [','.join(y['name'] for y in x) for x in movies['genres']]
```
If possible some `name` keys not exist use:
```
movies['genres'] = movies['genres'].apply(lambda x: ','.join(y['name'] for y in x if 'name' in y))
```
| null | CC BY-SA 4.0 | null | 2022-11-21T09:45:36.493 | 2022-11-21T09:51:49.453 | 2022-11-21T09:51:49.453 | 2,901,002 | 2,901,002 | null |
74,517,072 | 2 | null | 74,504,933 | 0 | null | Run this in your project root directory terminal
| null | CC BY-SA 4.0 | null | 2022-11-21T09:54:53.267 | 2022-11-21T09:54:53.267 | null | null | 14,990,516 | null |
74,517,275 | 2 | null | 19,981,634 | 1 | null | In my case this line on produced that error when i tried to do on my project:
```
-Xbootclasspath/a:lombok.jar
```
Solution for me: i deleted that line.
| null | CC BY-SA 4.0 | null | 2022-11-21T10:12:17.660 | 2022-11-21T10:12:17.660 | null | null | 11,374,561 | null |
74,517,551 | 2 | null | 74,508,070 | 0 | null | This happens because you are deleting the message the image is sent in. Discord sees the relevant message is gone and removes the file from its servers to save space.
You need to save the image either locally or in memory then upload it to either discord's CDN or a third party CDN and refer to it in your embed.
| null | CC BY-SA 4.0 | null | 2022-11-21T10:35:34.657 | 2022-11-21T10:35:34.657 | null | null | 17,493,215 | null |
74,517,601 | 2 | null | 28,313,372 | 0 | null | For me deleting npm and npm-cache folder from AppData works
| null | CC BY-SA 4.0 | null | 2022-11-21T10:39:33.697 | 2022-11-21T10:39:33.697 | null | null | 10,704,546 | null |
74,518,018 | 2 | null | 74,471,373 | 0 | null | android:id="@+id/map1" is in line 17, which was the fragment id. I just simply changed map1 into map_one and the error is gone. Hopefully, no one has to face this...
| null | CC BY-SA 4.0 | null | 2022-11-21T11:12:14.437 | 2022-11-21T11:12:14.437 | null | null | 12,637,592 | null |
74,518,293 | 2 | null | 74,512,738 | 0 | null | Please make clear statement what the problem you have is.
What i found is the line you are showing in the code:
[audioplayers WrappedPlayer](https://github.com/bluefireteam/audioplayers/blob/782fc9dff24a2ab9681496fd7c4c8fed451eac35/packages/audioplayers_android/android/src/main/kotlin/xyz/luan/audioplayers/player/WrappedPlayer.kt#L271)
It has message `// TODO(luan) expose this as a stream` so it seems like there is work to be done.
If you precisely express your problem community will help
| null | CC BY-SA 4.0 | null | 2022-11-21T11:36:35.623 | 2022-11-21T11:36:35.623 | null | null | 15,106,600 | null |
74,518,312 | 2 | null | 74,518,256 | 1 | null | note: GPU 0 is your iGPU, the gpu part of your cpu (that uses the system memory as "video ram" btw.). The actual dedicated graphics card is used 33% in that screenshot.
The "Desktop Window Manager" usage can go to 100% sometimes, afaik this is a Windows bug. Please try to turn off the hardware sheduling here:
[](https://i.stack.imgur.com/512TU.png)
On win11, this is hidden behind an "advanced settings" button (hyperlink text button)
Then restart and see if the GPU usage is now lower.
| null | CC BY-SA 4.0 | null | 2022-11-21T11:38:51.707 | 2022-11-21T11:38:51.707 | null | null | 5,967,872 | null |
74,518,404 | 2 | null | 74,517,133 | 0 | null | The arrow folder icon indicates that this folder is a symbolic link.
If you cannot enter it, the link is broken and points to an invalid location.
You can check the link target in your local clone:
```
readlink sign-me-up
```
Make sure that the output is a valid path within your repository.
| null | CC BY-SA 4.0 | null | 2022-11-21T11:46:00.937 | 2022-11-21T11:53:06.013 | 2022-11-21T11:53:06.013 | 3,018,229 | 3,018,229 | null |
74,518,763 | 2 | null | 43,478,057 | 0 | null | Your doing it wrong this is how you get it
databasereference reference = FirebaseDatabase.getInstance().getReference("books")
if you have a child on that then just add
.child( "like fuser.getUid() something like this" )
once that's done then add a Listener for it, now go to onDataChange add your code like this
String userName = snapshot.child("Data Name").getValue().toString();
| null | CC BY-SA 4.0 | null | 2022-11-21T12:16:27.883 | 2022-11-21T12:16:27.883 | null | null | 14,921,706 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.