Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
sequence |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
75,615,983 | 2 | null | 75,539,433 | 0 | null | I tried to reproduce the issue by cloning your code to my environment
and I was getting the same error:
![enter image description here](https://i.imgur.com/lvlZR1g.png)
I have degraded the version of `Microsoft.Extensions.Http` from to and it worked fine for me.
![enter image description here](https://i.imgur.com/w4BJADm.png)
```
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.1.3" />
</ItemGroup>
```
| null | CC BY-SA 4.0 | null | 2023-03-02T13:19:16.627 | 2023-03-02T13:19:16.627 | null | null | 19,991,670 | null |
75,616,205 | 2 | null | 75,611,320 | 0 | null | As I understand it from your post and comment, you have a "report form" with these requirements:
- `Home`-
---
To make it stay on top of the home form, use the `this` reference so that the home form is the `Owner` of the report form.
```
public partial class HomeForm : Form
{
public HomeForm()
{
InitializeComponent();
buttonReport.Click += onClickReport;
}
private void onClickReport(object sender, EventArgs e)
{
using (var report = new ReportForm())
{
// Use `this` to make Home form the parent
// so that child windows will be on top.
report.ShowDialog(this);
}
}
}
```
---
To run animations on the report form, use async tasks for non-UI long running work, updating the UI thread in between the long running tasks.
[](https://i.stack.imgur.com/oT1zR.png)
```
public partial class ReportForm : Form
{
public ReportForm()
{
InitializeComponent();
pictureBox.Visible = false;
StartPosition = FormStartPosition.CenterParent;
FormBorderStyle = FormBorderStyle.None;
}
protected async override void OnVisibleChanged(EventArgs e)
{
base.OnVisibleChanged(e);
if (Visible)
{
labelProgress.Text = "Retrieving employee records...";
progressBar.Value = 5;
await Task.Delay(1000);
labelProgress.Text = "Analyzing sales...";
progressBar.Value = 25;
await Task.Delay(1000);
labelProgress.Text = "Updating employee commissions...";
progressBar.Value = 50;
await Task.Delay(1000);
labelProgress.Text = "Initializing print job...";
progressBar.Value = 75;
await Task.Delay(1000);
labelProgress.Text = "Success!";
progressBar.Value = 100;
await Task.Delay(1000);
viewReport();
}
}
.
.
.
}
```
---
When the report is loaded, adjust the window parameters of the report form in its class.
```
private void viewReport()
{
string imagePath = Path.Combine(
AppDomain.CurrentDomain.BaseDirectory,
"Images",
"template.png"
);
pictureBox.Image = Image.FromFile( imagePath );
Size = new Size(pictureBox.Image.Width + 10, pictureBox.Image.Height + 50);
progressBar.Visible = false;
pictureBox.Visible = true;
FormBorderStyle= FormBorderStyle.Sizable;
}
```
[](https://i.stack.imgur.com/2Relx.png)
[Venngage.com](https://venngage.com/templates/reports/employee-daily-activity-report-c453f126-bc4c-407d-abbc-165ed2b3f109)
| null | CC BY-SA 4.0 | null | 2023-03-02T13:39:14.850 | 2023-03-02T13:48:43.383 | 2023-03-02T13:48:43.383 | 5,438,626 | 5,438,626 | null |
75,616,453 | 2 | null | 75,609,214 | 0 | null | Bumhan Yu's comment below my question is a solution, a great thanks to him
| null | CC BY-SA 4.0 | null | 2023-03-02T13:59:01.487 | 2023-03-02T13:59:01.487 | null | null | 21,314,709 | null |
75,617,221 | 2 | null | 75,613,380 | 0 | null | Both `springdoc-openapi-starter-webmvc-ui` and `springdoc-openapi-starter-webmvc-api` are required in the classpath for Swagger to work in Spring boot 3 (Web Starter). Probably you might need to remove `springdoc-openapi-core - 1.1.49`. Also not sure if will cause any trouble.
```
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
<version>2.0.2</version>
</dependency>
```
| null | CC BY-SA 4.0 | null | 2023-03-02T15:00:38.190 | 2023-03-02T15:00:38.190 | null | null | 2,353,403 | null |
75,617,342 | 2 | null | 75,610,406 | 0 | null | The question is honestly confusing. But based on your desired output I am going to assume that you want to pivot your dataframe so that the channels are columns and the dates are the index.
If for each channel, each date appears only once, this should work:
```
df.set_index(['Channel', 'Date'])['Spend'].unstack('Channel')
```
If that was not the case, and for example you wanted to add all the spends in the same channel and date, I would do something like this:
```
df.groupby(['Channel', 'Date'])['Spend'].sum().unstack('Channel')
```
| null | CC BY-SA 4.0 | null | 2023-03-02T15:08:53.790 | 2023-03-02T15:08:53.790 | null | null | 19,749,937 | null |
75,618,097 | 2 | null | 75,613,514 | 0 | null | In addition to [@Droid](https://stackoverflow.com/users/4105440/droid) answer, note that you can directly set the `zorder` of the legend to a high value (to be drawn over the plots) with `plt.legend().set_zorder(X)` (or `.set(zorder=X)`). The default legend `zorder` is `5`.
| null | CC BY-SA 4.0 | null | 2023-03-02T16:15:42.217 | 2023-03-02T16:15:42.217 | null | null | 11,080,037 | null |
75,618,437 | 2 | null | 58,454,406 | 0 | null | With windows 11, this is now possible by using the following methods (copied from Win11Forms.pas mentioned below):
```
uses
Winapi.Dwmapi, VCL.Dialogs, System.SysUtils;
const
DWMWCP_DEFAULT = 0; // Let the system decide whether or not to round window corners (default)
DWMWCP_DONOTROUND = 1; // Never round window corners
DWMWCP_ROUND = 2; // Round the corners if appropriate
DWMWCP_ROUNDSMALL = 3; // Round the corners if appropriate, with a small radius
DWMWA_WINDOW_CORNER_PREFERENCE = 33; // WINDOW_CORNER_PREFERENCE controls the policy that rounds top-level window corners
var
CornerPreference: Cardinal; // set to 0..3 from DWMWCP consts above
Winapi.Dwmapi.DwmSetWindowAttribute(Handle, DWMWA_WINDOW_CORNER_PREFERENCE, @CornerPreference, sizeof(CornerPreference));
```
There are two projects available on GitHub that perform this in two different ways. [https://github.com/checkdigits/rounded_corners](https://github.com/checkdigits/rounded_corners) gives you a function where you pass a handle (it just wraps the function above) and [https://github.com/marcocantu/DelphiSessions/tree/master/Win11_Delphi11/Win11Round](https://github.com/marcocantu/DelphiSessions/tree/master/Win11_Delphi11/Win11Round) contains a unit "Win11Forms" that adds functionality to the vcl.forms TForm class to set a default and allows for overriding the default.
| null | CC BY-SA 4.0 | null | 2023-03-02T16:45:05.833 | 2023-03-02T16:45:05.833 | null | null | 9,217 | null |
75,618,451 | 2 | null | 40,861,231 | 0 | null | Set the H5 formula to this:
```
=MID(ADDRESS(ROW(H5),COLUMN(H5)-COLUMN($H5)+1),2,LEN(ADDRESS(ROW(H5),COLUMN(H5)-COLUMN($H5)+1))-3)
```
Then extend this formula across the remaining columns.
This takes the row and column of the current cell, generates the address in the format `$H$5`, and extracts the H from it. But it offsets all the columns relative to column H, so H becomes A, I becomes B, etc.
Some of the other solutions are fine if you just want A-Z but this works for more than 26 columns, giving you AA in the 27th, if that's what you want.
| null | CC BY-SA 4.0 | null | 2023-03-02T16:46:45.223 | 2023-03-02T16:46:45.223 | null | null | 385,695 | null |
75,618,531 | 2 | null | 75,613,514 | 0 | null | The lines and legend all have the same zorder. So, they are rendered in the order which the code is written. The way to get the right effect is to set the zorder for the `ax1` higher (say 1). But this will push the `pH` line behind and makes is invisible. So, next turn frame off for `ax2`, so that you can see the line. Then turn on the frame for `ax2`. This will give you the required effect and keep the pH line behind the legend.
Now, to merge the two legends, get the legend handles and the labels using `get_legend_handles_labels()`, then add the handles and labels and create a combined legend.
The updated code is given below. Hope this helps...
```
fig, ax1 = plt.subplots()
ax1.set_xlabel('Tiempo (horas)')
ax1.set_ylabel('Concentración (mg/L)')
ax1.plot(t,NH4,'m-',label='NH4')
ax1.plot(t,NO2,'b--',label='NO2')
ax1.plot(t,NO3,'g-',label='NO3')
ax1.plot(t,OD,'c+',label='OD')
plt.grid(axis='both')
ax2 = ax1.twinx()
ax2.set_ylabel('pH',color='red')
ax2.plot(t,pH,'r',label='pH')
ax2.tick_params(axis='y', labelcolor='red')
# Get the handles and labels for ax1 and ax2
h1, l1 = ax1.get_legend_handles_labels()
h2, l2 = ax2.get_legend_handles_labels()
# Create legend by adding the columns
legend=ax1.legend(h1+h2, l1+l2,loc='upper center', mode='expand', ncol=len(ax1.lines)+1)
ax1.set_zorder(1) # make it on top
ax1.set_frame_on(False) # make it transparent
ax2.set_frame_on(True) # make sure there is any background
plt.show()
```
[](https://i.stack.imgur.com/vtTlj.png)
| null | CC BY-SA 4.0 | null | 2023-03-02T16:53:21.640 | 2023-03-02T16:53:21.640 | null | null | 16,404,872 | null |
75,618,604 | 2 | null | 75,616,950 | 0 | null | To have different colors for different series in an 'xrange' type plot in Highcharts R, you can set the color parameter in the hc_add_series() function for each series. In this example, each series is shifted by one unit in the y-axis, so they are not on the same line. The color parameter is set to a different color for each series. Let me know if it helped in your case!
```
library(highcharter)
# Create a data frame with three series
df <- data.frame(start = c(-10, -20, -30), end = c(10, 20, 30), y = rep(1, 3))
# Create a color vector with three colors
colors <- c("#FF0000", "#00FF00", "#0000FF")
highchart() %>%
hc_plotOptions(xrange = list(grouping = FALSE, colorByPoint = TRUE),
enableMouseTracking = TRUE,
column = list(dataLabels = list(enabled = TRUE))) %>%
hc_add_series(df[1, ], "xrange", color = colors[1], hcaes(x = start, x2 = end, y = y), name = "Series 1") %>%
hc_add_series(df[2, ], "xrange", color = colors[2], hcaes(x = start, x2 = end, y = y + 1), name = "Series 2") %>%
hc_add_series(df[3, ], "xrange", color = colors[3], hcaes(x = start, x2 = end, y = y + 2), name = "Series 3") %>%
hc_xAxis(min = -100, max = 100, title = FALSE, plotLines = list(list(value = 0)))
```
| null | CC BY-SA 4.0 | null | 2023-03-02T17:00:06.087 | 2023-03-02T17:00:06.087 | null | null | 9,996,535 | null |
75,618,717 | 2 | null | 51,328,951 | 0 | null | As an amateur. I could not get a better answer on this same question.
And after doing some research , [Here](https://github.com/ThabsheerAbdulla/WPF_Nested_ScrollViewer) is my way of doing it.
It simply uses a Bubbled Routing Event: TouchMove.
Both the scrollviewer will scroll as given by panningmode.
But as user scrolls the inner scrollviewer, outer scrollviewer waits for the TouchMove Event and when the event reaches the outer scrollviewer, it checks the source and if the event is generated from inner scrollviewer, it will process and scrolls the outer scrollviewer.
| null | CC BY-SA 4.0 | null | 2023-03-02T17:10:36.300 | 2023-03-02T17:10:36.300 | null | null | 21,320,720 | null |
75,619,014 | 2 | null | 75,618,692 | 0 | null | The view gets redrawn each time the value of `isAnimationActive` changes. To overcome this you could always display the `ScrollView` and overlay the selected card on top:
```
struct TestView: View {
@State private var items = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
@State private var isAnimationActive = false
@State private var selectedItem = ""
@Namespace private var animation
var body: some View {
VStack {
Spacer()
ScrollView(.horizontal, showsIndicators: false) {
HStack {
ForEach(items, id: \.self) { item in
ZStack {
RoundedRectangle(cornerRadius: 30, style: .continuous)
.fill(Color.red)
.matchedGeometryEffect(id: "card\(item.description)", in: animation)
.frame(width: 250, height: 250)
Text(item.description)
.foregroundColor(.white)
.matchedGeometryEffect(id: "text\(item.description)", in: animation)
}
.onTapGesture {
withAnimation(.easeOut(duration: 0.3)) {
isAnimationActive = true
selectedItem = item.description
}
}
}
}
.padding(.leading, 20)
}
Spacer()
}
.overlay(content: overlay)
}
@ViewBuilder private func overlay() -> some View{
if isAnimationActive {
VStack {
ZStack {
Color(uiColor: .systemBackground)
RoundedRectangle(cornerRadius: 30, style: .continuous)
.fill(Color.red)
.matchedGeometryEffect(id: "card\(selectedItem.description)", in: animation)
.frame(width: 300, height: 400)
Text(selectedItem)
.foregroundColor(.white)
.matchedGeometryEffect(id: "text\(selectedItem.description)", in: animation)
}
.transition(.offset(x: 1, y: 1))
.onTapGesture {
withAnimation(.easeOut(duration: 0.3)) {
isAnimationActive = false
}
}
}
}
}
}
```
| null | CC BY-SA 4.0 | null | 2023-03-02T17:40:19.917 | 2023-03-02T17:40:19.917 | null | null | 7,948,372 | null |
75,619,232 | 2 | null | 75,618,692 | 0 | null | Instead of removing the `ScrollView` from the view hierarchy, use the `opacity` modifier to hide the `ScrollView` when there is a selection.
Keeping the `ScrollView` always present means you have to use set the `isSource` of the selected item's `matchedGeometryEffect` to false in the `ScrollView`. Otherwise, SwiftUI can get confused.
Result:
[](https://i.stack.imgur.com/iFiS3.gif)
Also, let's clean up your data model. It's not clear why you have separate properties `selectedItem` and `isAnimationActive`. Unless there's a good reason, it's better to have one optional property.
Code:
```
typealias CardId = Int
struct ContentView: View {
@State private var cards: [CardId] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
@State private var selection: CardId? = nil
@Namespace private var namespace
var body: some View {
ZStack {
ScrollView(.horizontal, showsIndicators: false) {
HStack {
ForEach(cards, id: \.self) { id in
cardView(
for: id,
isSource: selection != id
)
.frame(width: 250, height: 250)
.onTapGesture {
withAnimation(.easeOut(duration: 0.3)) {
selection = id
}
}
}
}
.padding(.leading, 20)
}
.opacity(selection == nil ? 1 : 0)
if let selection {
ZStack {
cardView(
for: selection,
isSource: true
)
.frame(width: 300, height: 400)
.transition(.offset(x: 1, y: 1))
.onTapGesture {
withAnimation(.easeOut(duration: 0.3)) {
self.selection = nil
}
}
}
}
}
}
func cardView(for id: CardId, isSource: Bool) -> some View {
RoundedRectangle(cornerRadius: 30, style: .continuous)
.fill(Color.red)
.shadow(radius: 2, y: 1)
.overlay {
Text("\(id)")
.foregroundColor(.white)
.font(.largeTitle)
}
.matchedGeometryEffect(id: id, in: namespace,isSource: isSource)
}
}
```
| null | CC BY-SA 4.0 | null | 2023-03-02T18:00:04.167 | 2023-03-02T18:00:04.167 | null | null | 77,567 | null |
75,619,298 | 2 | null | 75,619,051 | 0 | null | The main issue is that if you have an x axis with discrete levels, you need to force the series into groups to allow `geom_smooth` to consider the x axis as a continuum.
Another issue is that your data don't really lend themselves to a `loess`, so here is an `lm` instead:
```
df_algaeconsump %>%
ggplot(aes(`Light treatment`, Feeding,
colour = factor(Group), group = factor(Group),
fill = after_scale(color))) +
stat_smooth(formula = y ~ x, method = "lm", alpha = 0.1) +
geom_point() +
labs(x = "Light Treatment",
y = "Algae consumption",
color = 'Group') +
scale_color_brewer(palette = 'Set1') +
theme_bw()
```
[](https://i.stack.imgur.com/t2u0l.jpg)
If you try a `loess` with default settings, you will get two overfit curves, a bunch of warnings and no standard error ribbons:
```
df_algaeconsump %>%
ggplot(aes(`Light treatment`, Feeding,
colour = factor(Group), group = factor(Group),
fill = after_scale(color))) +
stat_smooth(formula = y ~ x, method = "loess") +
geom_point() +
labs(x = "Light Treatment",
y = "Algae consumption",
color = 'Group') +
scale_color_brewer(palette = 'Set1') +
theme_bw()
```
[](https://i.stack.imgur.com/E4zR0.jpg)
| null | CC BY-SA 4.0 | null | 2023-03-02T18:06:58.950 | 2023-03-02T18:10:19.893 | 2023-03-02T18:10:19.893 | 12,500,315 | 12,500,315 | null |
75,619,379 | 2 | null | 39,444,060 | 0 | null | ```
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorWhite"
tools:context="RegisterUserActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:background="@drawable/shape_rect01"
android:padding="10dp">
<ImageButton
android:id="@+id/backBtn"
android:layout_width="30dp"
android:layout_height="30dp"
android:background="@null"
android:src="@drawable/ic_back_white" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:fontFamily="@font/ubuntu_medium"
android:text="Register User"
android:textColor="@color/white"
android:textSize="20sp" />
<ImageButton
android:id="@+id/gpsBtn"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentEnd="true"
android:background="@null"
android:src="@drawable/ic_gps_white" />
</RelativeLayout>
<ImageView
android:id="@+id/iconIv"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="60dp"
android:layout_marginBottom="20dp"
android:background="@drawable/shape_circle01"
android:padding="5dp"
android:src="@drawable/ic_key_white" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/iconIv"
android:layout_margin="10dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp">
<com.blogspot.atifsoftwares.circularimageview.CircularImageView
android:id="@+id/profileIv"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerHorizontal="true"
android:src="@drawable/ic_person_gray"
app:c_border="true"
app:c_border_color="@color/colorPrimary"
app:c_border_width="2dp" />
<EditText
android:id="@+id/nameEt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/profileIv"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="5dp"
android:background="@drawable/shape_rect02"
android:drawableStart="@drawable/ic_person_gray"
android:drawablePadding="15dp"
android:fontFamily="@font/ubuntu_medium"
android:hint="Full Name"
android:inputType="textPersonName|textCapWords"
android:padding="10dp"
android:textAllCaps="false"
android:textColor="@color/black" />
<EditText
android:id="@+id/phoneEt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/nameEt"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="5dp"
android:background="@drawable/shape_rect02"
android:drawableStart="@drawable/ic_phone_gray"
android:drawablePadding="15dp"
android:fontFamily="@font/ubuntu_medium"
android:hint="Phone Number"
android:inputType="phone"
android:padding="10dp"
android:textAllCaps="false"
android:textColor="@color/black" />
<LinearLayout
android:id="@+id/addressLl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/phoneEt"
android:layout_margin="5dp"
android:orientation="horizontal">
<EditText
android:id="@+id/countryEt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="5dp"
android:layout_weight="1"
android:background="@drawable/shape_rect02"
android:drawableStart="@drawable/ic_location_gray"
android:drawablePadding="2dp"
android:fontFamily="@font/ubuntu_medium"
android:hint="Country"
android:inputType="textPostalAddress"
android:padding="10dp"
android:textAllCaps="false"
android:textColor="@color/black" />
<EditText
android:id="@+id/stateEt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="5dp"
android:layout_weight="1"
android:background="@drawable/shape_rect02"
android:drawableStart="@drawable/ic_location_gray"
android:drawablePadding="2dp"
android:fontFamily="@font/ubuntu_medium"
android:hint="State"
android:inputType="textPostalAddress"
android:padding="10dp"
android:textAllCaps="false"
android:textColor="@color/black" />
<EditText
android:id="@+id/cityEt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="5dp"
android:layout_weight="1"
android:background="@drawable/shape_rect02"
android:drawableStart="@drawable/ic_location_gray"
android:drawablePadding="2dp"
android:fontFamily="@font/ubuntu_medium"
android:hint="City"
android:inputType="textPostalAddress"
android:padding="10dp"
android:textAllCaps="false"
android:textColor="@color/black" />
</LinearLayout>
<EditText
android:id="@+id/addressEt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/addressLl"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="5dp"
android:layout_weight="1"
android:background="@drawable/shape_rect02"
android:drawableStart="@drawable/ic_location_gray"
android:drawablePadding="15dp"
android:fontFamily="@font/ubuntu_medium"
android:hint="Complete Address"
android:inputType="textPostalAddress|textMultiLine"
android:padding="10dp"
android:textAllCaps="false"
android:textColor="@color/black" />
<EditText
android:id="@+id/emailEt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/addressEt"
android:layout_margin="5dp"
android:background="@drawable/shape_rect02"
android:drawableStart="@drawable/ic_mail_gray"
android:drawablePadding="15dp"
android:fontFamily="@font/ubuntu_medium"
android:hint="Email"
android:inputType="textEmailAddress"
android:padding="10dp"
android:textAllCaps="false"
android:textColor="@color/black" />
<EditText
android:id="@+id/passwordEt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/emailEt"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="5dp"
android:background="@drawable/shape_rect02"
android:drawableStart="@drawable/ic_lock_gray"
android:drawablePadding="15dp"
android:fontFamily="@font/ubuntu_medium"
android:hint="Password"
android:inputType="textPassword"
android:padding="10dp"
android:textAllCaps="false"
android:textColor="@color/black" />
<EditText
android:id="@+id/cPasswordEt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/passwordEt"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="5dp"
android:background="@drawable/shape_rect02"
android:drawableStart="@drawable/ic_lock_gray"
android:drawablePadding="15dp"
android:fontFamily="@font/ubuntu_medium"
android:hint="Confirm Password"
android:inputType="textPassword"
android:padding="10dp"
android:textAllCaps="false"
android:textColor="@color/black" />
<Button
android:id="@+id/registerBtn"
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/cPasswordEt"
android:layout_centerHorizontal="true"
android:fontFamily="@font/ubuntu_medium"
android:minWidth="120dp"
android:text="Register"
android:textAllCaps="false"
android:background="@drawable/shape_button"
android:layout_marginTop="10dp"
/>
</RelativeLayout>
</ScrollView>
<TextView
android:id="@+id/registerSellerTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="15dp"
android:fontFamily="@font/ubuntu_medium"
android:text="@string/registerSeller"
android:textColor="@color/black"
android:textSize="17sp" />
</RelativeLayout>
```
| null | CC BY-SA 4.0 | null | 2023-03-02T18:16:02.067 | 2023-03-02T18:16:02.067 | null | null | 20,904,628 | null |
75,619,770 | 2 | null | 75,617,201 | 1 | null | The [StringIndexOutOfBoundsException](https://docs.oracle.com/javase/7/docs/api/java/lang/StringIndexOutOfBoundsException.html) is an unchecked exception that occurs when an attempt is made to access the character of a string at an index which is either negative or greater than the length of the string.
> Thrown by String methods to indicate that an index is either negative or greater than the size of the string. For some methods such as the charAt method, this exception also is thrown when the index is equal to the size of the string.
So something somewhere is trying to access a character at an index that is either negative or greater than the length of the string.
If we look at the stacktrace we can see that the exception is thrown from the `Color.parseColor` method:
```
// TIP: Length of 0 means an empty string!
java.lang.StringIndexOutOfBoundsException: length=0; index=0
at java.lang.String.charAt(Native Method)
at android.graphics.Color.parseColor(Color.java:1384)
// The stack trace is guiding us to line 33!
at com.example.wallpaperapp.Adapter.colortoneAdapter.onBindViewHolder(colortoneAdapter.kt:33)
at com.example.wallpaperapp.Adapter.colortoneAdapter.onBindViewHolder(colortoneAdapter.kt:15)
at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7065)
at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7107)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline (RecyclerView.java:6012)
```
Therefore, `Color.parseColor` is getting an empty (`""`) String as an argument, We can see color is coming from a collection named `ListTheColorTone`:
```
override fun onBindViewHolder(holder: bomViewHolder, position: Int) {
val color=ListTheColorTone[position].color // <= This returns an empty String
holder.cardBlack.setCardBackgroundColor(Color.parseColor(color!!)) // <= This is the line where the exception is thrown
}
```
### What does this mean to us?
The `ListTheColorTone` collection is perhaps missing an element at the `position` that is passed. Or some other logic in your application is incorrect. As @Zabuzard advised, try printing the value of `position` (or perhaps the contents of the collection) to understand what's going wrong:
```
override fun onBindViewHolder(holder: bomViewHolder, position: Int) {
val color=ListTheColorTone[position].color // <= This returns an empty string
println("position: $position")
println("ListTheColorTone: ${ListTheColorTone.toList()}")
println("color: $color")
holder.cardBlack.setCardBackgroundColor(Color.parseColor(color!!)) // <= This is the line where the exception is thrown
}
```
Or even better, try adding a breakpoint at the line where the exception is thrown and check the value of `position` and `ListTheColorTone.size`. Here are some resources to get you started:
- [Tutorial: Debug your first Kotlin application](https://www.jetbrains.com/help/idea/debug-your-first-kotlin-application.html)- [Android - Debug with breakpoints](https://developer.android.com/codelabs/basic-android-kotlin-training-debugging-with-breakpoints#0)
| null | CC BY-SA 4.0 | null | 2023-03-02T18:58:50.730 | 2023-03-02T19:04:11.727 | 2023-03-02T19:04:11.727 | 5,037,430 | 5,037,430 | null |
75,619,826 | 2 | null | 75,611,835 | 1 | null | Below is the code. You need to use lag and sum function to achieve the results:
```
drop table if exists #a
drop table if exists #b
CREATE TABLE #a (
Business_Date DATE,
Sales float,
Budget float
);
INSERT INTO #a VALUES
('2023-03-01', 100, 150),
('2023-03-02', 200, 190),
('2023-03-03', 0, 180)
--- Find prevous value of Difference_Budget and prev value of day of Business_Date and subtract it from total days in month
select *,(case when day(Business_Date) = 1 then 0 else lag(Difference_Budget,1) over (order by Business_Date) end ) as New_Budget_previous_day,
isnull(day(dateadd(day,-1,dateadd(month,1,DATEFROMPARTS(year(Business_Date),month(Business_Date),1)))) - day(lag(Business_Date,1) over (order by Business_Date)),0) as total_No_Days
into #b
from
(
select * ,
abs(case when sales = 0 then 0 else budget - sales end) as Difference_Budget
from #a
)as a
--Calculating Running_total_remaining_days by using sum function and then adding its value to budget
select *,sum(remaining_days) over (partition by year(Business_Date),month(Business_Date)
order by Business_Date
rows between unbounded preceding and current row
) as Running_total_remaining_days,
budget + sum(remaining_days) over (partition by year(Business_Date),month(Business_Date)
order by Business_Date
rows between unbounded preceding and current row
) as New_budget
from
(
select * , cast(case when total_No_Days = 0 then 0 else New_Budget_previous_day/total_No_Days end as decimal(3,2)) as remaining_days
from #b
) as a
```
[](https://i.stack.imgur.com/cUi64.png)
| null | CC BY-SA 4.0 | null | 2023-03-02T19:05:06.850 | 2023-03-02T19:05:06.850 | null | null | 4,054,314 | null |
75,620,146 | 2 | null | 75,564,096 | 0 | null | You are confusing the state of a widget with the , which handles keyboard input: a widget will receive keyboard events and eventually handle them.
A widget (specifically, an element of a widget) can be selected and still not having focus; consider having two text areas: you may only type in one of them, which is the one that is currently , but that doesn't prevent the other to have some of its text . Note that there is the exception of QLineEdit which, by default, the text when it loses focus.
The same goes for item views: the view could be focused and not having any item selected, or it can have selected items and still not being focused, because another widget (or window) currently is.
Note that a "focus hint" is an expected behavior of a GUI in a desktop environment: it allows the user to immediately see which widget is the currently focused one, so that they know that they can directly use the keyboard to interact with it instead of having to click it (or focus it using tab keys).
Imagine having a UI with text fields: the user has to know what is the focused one at first glance, without having to click it or wait for the blinking cursor to appear (meaning that they have to check fields for that).
So, a well designed UI should, among other things, show a visible focus hint, not only for text inputs, but even for item views, because that's important for keyboard navigation (eg. using the arrow keys to items). While keyboard navigation is much less common nowadays (common people were not used to it even before touch interfaces), that should never be underestimated.
Still, if you want to go on with that, it possible, and the solution is quite simple: use a [QProxyStyle](https://doc.qt.io/qt-5/qproxystyle.html).
All Qt item views inherit from QFrame (QListWidget » QListView » QAbstractItemView » QAbstractScrollArea » QFrame), which draws its frame using the QStyle [drawControl()](https://doc.qt.io/qt-5/qstyle.html#drawControl) function with the `CE_ShapedFrame` control type. If we override that function, get that type and the widget is a QAbstractItemView, we can just override the [state](https://doc.qt.io/qt-5/qstyleoption.html#state-var) of the related [QStyleOptionFrame](https://doc.qt.io/qt-5/qstyleoptionframe.html) style option ignoring the `State_HasFocus` state:
```
class Proxy(QProxyStyle):
def drawControl(self, ctl, opt, qp, widget=None):
if (
ctl == self.CE_ShapedFrame
and isinstance(widget, QAbstractItemView)
and opt.state & self.State_HasFocus
):
opt.state &= ~self.State_HasFocus
super().drawControl(ctl, opt, qp, widget)
app = QApplication(sys.argv)
app.setStyle(Proxy())
# ...
```
| null | CC BY-SA 4.0 | null | 2023-03-02T19:45:31.233 | 2023-03-02T19:45:31.233 | null | null | 2,001,654 | null |
75,620,252 | 2 | null | 75,209,018 | 0 | null | Try to use full path to file (os.path.abspath)
| null | CC BY-SA 4.0 | null | 2023-03-02T19:57:03.060 | 2023-03-02T19:57:03.060 | null | null | 10,196,020 | null |
75,620,431 | 2 | null | 75,619,644 | 1 | null | A little lack of context here, but it seems like the white vertical lines you observe actually come from the spaces between all the plotted gray `axvlines`.
> Maybe it is somehow connected to the low alpha value, since setting alpha to 1 removes these lines?
Setting the color to a lighter gray (e.g `color="lightgray"`) with an alpha value of 1 might do the trick then. See [the list of matplotlib named colors](https://matplotlib.org/stable/gallery/color/named_colors.html)
| null | CC BY-SA 4.0 | null | 2023-03-02T20:20:05.060 | 2023-03-02T20:20:05.060 | null | null | 11,080,037 | null |
75,620,717 | 2 | null | 75,616,950 | 0 | null | Do you mean something like this?
```
# Create a data frame with three series
df <- data.frame(start = c(-10, -0, 20), end = c(0, 20, 30), y = rep(1, 3))
# Create a color vector with three colors
colors <- c("#FF0000", "#00FF00", "#0000FF")
highchart() %>%
hc_plotOptions(xrange = list(grouping = FALSE, colorByPoint = FALSE),
enableMouseTracking = TRUE,
column = list(dataLabels = list(enabled = TRUE))) %>%
hc_add_series(df[1, ], "xrange", color = colors[1], hcaes(x = start, x2 = end, y = y), name = "Series 1") %>%
hc_add_series(df[2, ], "xrange", color = colors[2], hcaes(x = start, x2 = end, y = y), name = "Series 2") %>%
hc_add_series(df[3, ], "xrange", color = colors[3], hcaes(x = start, x2 = end, y = y), name = "Series 3") %>%
hc_xAxis(min = -100, max = 100, title = FALSE, plotLines = list(list(value = 0)))
```
| null | CC BY-SA 4.0 | null | 2023-03-02T20:54:30.503 | 2023-03-02T20:54:30.503 | null | null | 9,996,535 | null |
75,621,167 | 2 | null | 75,620,714 | 2 | null | > I need to make the C5 returns 1 (True). And return False only if * is in the A cell.
If this is your goal, then your title is a [XY problem](https://xyproblem.info/). The easiest way to do this is using [REGEXMATCH](https://support.google.com/docs/answer/3098292?hl=en).
```
=NOT(REGEXMATCH(A2,"\*"))
```
This formula will return FALSE if `*` appears anywhere in cell A2 and TRUE otherwise. If you want to return 0 and 1 instead, use any of these:
```
=--NOT(REGEXMATCH(A2,"\*"))
=1*NOT(REGEXMATCH(A2,"\*"))
=0+NOT(REGEXMATCH(A2,"\*"))
=N(NOT(REGEXMATCH(A2,"\*")))
```
| null | CC BY-SA 4.0 | null | 2023-03-02T21:51:59.237 | 2023-03-02T21:51:59.237 | null | null | 17,887,301 | null |
75,621,299 | 2 | null | 27,326,924 | 0 | null |
## The exact answer for 2023:
## Vertical example:
```
var scroll: UIScrollView
var tall: UIView // some tall view, imagine a few screen heights.
```
1. Fix the size of scroll with top/right/bottom/left constraints to it's superview.
2. Make tall a subview of scroll.
3. Believe it or not, for tall set bottom, top and width EQUAL to its superview (ie, scroll).
That's all there is to it.
---
Don't forget to, obviously, inherently set the height of the `tall`. (For example, if it is 10 labels, obviously hook those up so that `tall` height is set by those, or whatever it is you're doing in `tall`. Don't forget to `translatesAutoresizingMaskIntoConstraints = false` of course.
| null | CC BY-SA 4.0 | null | 2023-03-02T22:10:51.617 | 2023-03-02T22:10:51.617 | null | null | 294,884 | null |
75,621,406 | 2 | null | 72,008,241 | 0 | null | This example from `std::ranges::lower_bound` ([link](https://en.cppreference.com/w/cpp/algorithm/ranges/lower_bound)) is more helpful
```
std::vector data = { 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5 };
auto lower = ranges::lower_bound(data, 4);
auto upper = ranges::upper_bound(data, 4);
ranges::copy(lower, upper, std::ostream_iterator<int>(std::cout, " "));
std::cout << '\n'; // 4 4 4 4
```
| null | CC BY-SA 4.0 | null | 2023-03-02T22:26:37.933 | 2023-03-02T22:26:37.933 | null | null | 11,998,382 | null |
75,621,438 | 2 | null | 75,538,803 | 0 | null | This was a firewall issue. The company firewall was blocking the request.
| null | CC BY-SA 4.0 | null | 2023-03-02T22:31:48.043 | 2023-03-02T22:31:48.043 | null | null | 11,322,910 | null |
75,621,731 | 2 | null | 75,621,543 | 0 | null | I found the answer to my question.
I had to allow options in IIS manager:
[](https://i.stack.imgur.com/K4FqL.png)
| null | CC BY-SA 4.0 | null | 2023-03-02T23:16:16.007 | 2023-03-03T00:13:19.577 | 2023-03-03T00:13:19.577 | 283,366 | 11,322,910 | null |
75,622,115 | 2 | null | 46,342,763 | 0 | null | 5 years later and I'm having the same issue with Firefox 110.0.1 (64-bit) for macOS, w/ only the `@react-devtools` extension.
| null | CC BY-SA 4.0 | null | 2023-03-03T00:26:45.923 | 2023-03-03T00:26:45.923 | null | null | 1,159,167 | null |
75,622,279 | 2 | null | 23,193,614 | 0 | null | If you are using macOs turnoff or Pause Private Relay
goto iCloud setting then you will see Private Relay
that solved my issue
[](https://i.stack.imgur.com/tAPy8.png)
| null | CC BY-SA 4.0 | null | 2023-03-03T00:58:19.423 | 2023-03-03T00:58:19.423 | null | null | 1,925,560 | null |
75,622,546 | 2 | null | 75,621,422 | 0 | null | Suggest to have the following changes:
- `Variable``StringVar``DoubleVar`- `value``Radiobutton``(<item>, price)`
Then you can get the name and price of the selected item easily inside `clicked()`:
```
...
amount = Variable()
amount.set(0)
...
for fruit, price, in FRUITS:
Radiobutton(fruit_frame, text = fruit, variable = amount, value = (fruit, price)).grid(row = 0 + a, column = 0, columnspan = 3, sticky = W)
a += 1
for vegie, price, in VEGIES:
Radiobutton(veg_frame, text = vegie, variable = amount, value = (vegie, price)).grid(row = 0 + b, column = 1, columnspan = 3, sticky = W)
b += 1
for meat, price, in MEATS:
Radiobutton(meat_frame, text = meat, variable = amount, value = (meat, price)).grid(row = 0 + c, column = 2, columnspan = 3, sticky = W)
c += 1
def clicked(selected):
global total
item, value = selected
total += value
total_val = "{:.2f}".format(total)
my_label = Label(root, text = "Total: $" + str(total_val))
my_label.grid(row = 4, column = 1 )
global y
y += 1
global fruit
global w
item_num = Label(reciept_frame, text = str(y) + "). " + item + ": " + str(value))
item_num.grid(row = 5 + w, column = 1, sticky = W)
w += 1
...
```
| null | CC BY-SA 4.0 | null | 2023-03-03T02:02:01.747 | 2023-03-03T02:02:01.747 | null | null | 5,317,403 | null |
75,622,570 | 2 | null | 74,435,996 | 0 | null | just to add here, if you're getting it outside of a smart contracts, you can consider APIs like Covalent. they have a balances endpoint that allows you to get all ERC20 tokens of an address
| null | CC BY-SA 4.0 | null | 2023-03-03T02:05:55.177 | 2023-03-03T02:05:55.177 | null | null | 20,916,405 | null |
75,622,716 | 2 | null | 75,454,487 | 0 | null | The extreme number of negative plots are definitely the issue although I don't understand why (only an issue in chrome). I needed these negative plots to be able to transition back out into full view.
My workaround was to remove the negative path commands during the transition. Still keep the entire path with negative plots on a seperate data attribute to be used on the next transition, ie zoom out or add new plot. Just had ensure that the d attribute had the negative path commands omitted.
| null | CC BY-SA 4.0 | null | 2023-03-03T02:42:21.487 | 2023-03-03T02:42:21.487 | null | null | 2,872,887 | null |
75,622,763 | 2 | null | 74,435,996 | 0 | null | I assume that you tested on mainnet.
If so, the reason is that `0xC943c5320B9c18C153d1e2d12cC3074bebfb31A2` is not a token/contract.
To avoid this case, you need to use try/catch.
```
...
for (uint i=0; i<len; i++) {
try IERC20(tokenAddresses[i]).balanceOf(walletAddress) returns (uint256 balance) {
balances[i] = balance;
} catch {}
}
...
```
P.S: Those two addresses in your `TOKENS` array are tokens/contracts on only BSC chain
| null | CC BY-SA 4.0 | null | 2023-03-03T02:52:36.583 | 2023-03-03T02:52:36.583 | null | null | 13,770,838 | null |
75,623,316 | 2 | null | 75,623,235 | 2 | null | You need to skip the header row. As the error message says, the string "Value" is not a number; it's apparently the title of the temperature column in your csv file (the fact that it's a "ValueError" is just a coincidence). Replace line 12 with `continue`. Also, you might rather use the `csv` module for this (read [this tutorial](https://www.geeksforgeeks.org/load-csv-data-into-list-and-dictionary-using-python/)).
Try this:
```
with open(filename) as file:
for row, line in enumerate(file):
if row == 0:
continue
line = line.strip("\n")
year, temp = line.split(",")
list_temp.append(float(temp))
```
: See solution from @imxitiz it's a bit cleaner
| null | CC BY-SA 4.0 | null | 2023-03-03T04:56:33.040 | 2023-03-03T06:28:06.747 | 2023-03-03T06:28:06.747 | 21,293,703 | 21,293,703 | null |
75,623,344 | 2 | null | 75,432,098 | 0 | null | I am working on Virtual Sever (HPC Cloud) located in a different area so I can connect with a web address.
Firstly, I transfer my `40GB` `zip` file to the HPC Server where I have almost `1.5TB` of space, still, I cannot extract the .zip file and got an error message `"No Space Left"`. I have also checked `inodes`, process,es and everything is ok
FYI: My HPC root directory is only `100GB` so I cannot copy the dataset into the root directory
Give all permission to .zip file and extract it
My trash bin has been highly occupied, It takes 10 hours to empty it. Then, I extracted it again
The type of hard disk in HPC Sever is `NFS` - based does not allow the extraction of large zip files so I made a virtual partition in my `1.5TB` hard disk with `ext4` format and mount it with root. Afterward, I extracted the `.zip` file and it works for me.
| null | CC BY-SA 4.0 | null | 2023-03-03T05:03:29.990 | 2023-03-03T07:36:15.097 | 2023-03-03T07:36:15.097 | 4,420,797 | 4,420,797 | null |
75,623,526 | 2 | null | 73,220,580 | 0 | null | Hi I had the same issue in my M1 Mac; if changing the node version does not help(it did not help me), check your package.json file. Make use that you have "^" before your bycrypt dependency.
| null | CC BY-SA 4.0 | null | 2023-03-03T05:39:58.227 | 2023-03-03T05:39:58.227 | null | null | 14,178,504 | null |
75,623,591 | 2 | null | 75,623,151 | 1 | null | I am not sure this is what you're asking, but, I tried to recreate your images using QML. The second image I used a tiled SVG image as a base, then, on top I use a LinearGradient but I set the opacity so I can see the base partially:
```
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Qt5Compat.GraphicalEffects
Page {
id: page
ColumnLayout {
Frame {
Layout.preferredWidth: 500
Layout.preferredHeight: 300
LinearGradient {
anchors.fill: parent
start: Qt.point(0, 0)
end: Qt.point(width, 0)
gradient: Gradient {
GradientStop { position: 0.0; color: "yellow" }
GradientStop { position: 1.0; color: "purple" }
}
}
}
Frame {
Layout.preferredWidth: 300
Layout.preferredHeight: 300
padding: 0
Image {
anchors.fill: parent
source: "squares.svg"
fillMode: Image.Tile
}
LinearGradient {
anchors.fill: parent
start: Qt.point(0, height)
end: Qt.point(0, 0)
gradient: Gradient {
GradientStop { position: 0.0; color: "white" }
GradientStop { position: 1.0; color: "blue" }
}
opacity: 0.5
}
}
}
}
// squares.svg
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
<rect x="0" y="0" width="16" height="16" fill="#ccc"/>
<rect x="16" y="0" width="16" height="16" fill="#eee"/>
<rect x="0" y="16" width="16" height="16" fill="#eee"/>
<rect x="16" y="16" width="16" height="16" fill="#ccc"/>
</svg>
```
You can [Try it Online!](https://stephenquan.github.io/qmlonline/?zcode=AAAGEnictVTfb9MwEH7PX3EyL0NCibeqPIR1D1QbIIFEBRLPxrkmFo7Pc5xl1dT/HTvttKQtXYfgFFm583c/7O9LVG3JeVj4Ravkr0SN3HROxjvSzW78s1hR6wfh6ZxqK3z6wQlbKSn09XKJMiC+ihLhIYFgqsjBBrd35qTb2mzqbPej3ThR48CPtgGl1uESncPihyp8lcOU86Owj6jKyucw2cUpg8KFQQuFxu/0iiaMrMg16VJpHSd2AbYHarxwofgiNCRl/Bl/A/z1HgpNMcB0cfCDuHI7TQ5H5or2uP3Nk4UHsNQor8jkwFP+DiRpcjmwFWpNHYP1y2qcD2vY1lmNh2qMI0/e+m9Y3GPnRBatKAplynDwUfhT/aS3oZ3GKbVOYjh7c9sGRJM2dyXbQ8USX6gIuL5Z+l1p/MON9Af6X3Kr+pt5TnOHdfmP9dZVyh+UytESI7n91O0JYotGVkjlV3GE6VElrpN1kmQZDNhMLsMC97U2zYxV3ts8y7quS7tJSq7MLjjnWSQd7hR27+l+xjhwmFyEh10lly780iAGGaz6tf+iZ+z8LdvSsXmPVM7YKyklywZpceuUPEQc5W3aRcDL8rb9nk98HDSe/eo3QaWZQA==)
| null | CC BY-SA 4.0 | null | 2023-03-03T05:52:11.363 | 2023-03-03T05:52:11.363 | null | null | 881,441 | null |
75,623,627 | 2 | null | 75,623,547 | 0 | null | Given that you have the plots already created and only want to include the PNG images, you can use the figure directive.
```
::: {#fig-myplot layout-ncol=2}
![a](fig1.png)
![b](fig2.png)
![c](fig3.png)
![d](fig4.png)
Myplot
:::
```
More details at [https://quarto.org/docs/authoring/figures.html](https://quarto.org/docs/authoring/figures.html).
| null | CC BY-SA 4.0 | null | 2023-03-03T05:59:01.273 | 2023-03-03T05:59:01.273 | null | null | 1,802,726 | null |
75,623,682 | 2 | null | 75,622,795 | 0 | null | in the time appointment time please check whether you are using varchar,text, or timestamp if you are using varchar or text then it will work fine. But if using timestamp maybe that is the problem check it and update.
| null | CC BY-SA 4.0 | null | 2023-03-03T06:06:25.457 | 2023-03-03T06:06:25.457 | null | null | 19,546,649 | null |
75,623,700 | 2 | null | 8,463,209 | 0 | null | The answer from @dennisobrien is useful, but I couldn't get it to work. I ended up with these modified versions, which do work for me (using `WTForms==2.2.1`):
```
from wtforms.validators import DataRequired, Optional
class RequiredIf:
"""
Validator which makes a field required if another field is set and has a
truthy value.
Sources:
- https://wtforms.readthedocs.io/en/2.3.x/validators/
- http://stackoverflow.com/questions/8463209/how-to-make-a-field-conditionally-optional-in-wtforms
"""
field_flags = ("requiredif",)
def __init__(self, other_field_name, message=None):
self.other_field_name = other_field_name
self.message = message
def __call__(self, form, field):
other_field = form[self.other_field_name]
if other_field is None:
raise Exception('no field named "%s" in form' % self.other_field_name)
if bool(other_field.data):
DataRequired(self.message).__call__(form, field)
else:
Optional(self.message).__call__(form, field)
class OptionalIf:
"""
Validator which makes a field optional if another field is set and has a falsy value.
See sources from RequiredIf
"""
field_flags = ("optionalif",)
def __init__(self, other_field_name, message=None):
self.other_field_name = other_field_name
self.message = message
def __call__(self, form, field):
other_field = form[self.other_field_name]
if other_field is None:
raise Exception('no field named "%s" in form' % self.other_field_name)
if bool(other_field.data):
Optional(self.message).__call__(form, field)
else:
DataRequired(self.message).__call__(form, field)
```
| null | CC BY-SA 4.0 | null | 2023-03-03T06:10:14.153 | 2023-03-03T06:10:14.153 | null | null | 3,761,310 | null |
75,623,740 | 2 | null | 75,623,235 | 1 | null | This problem is because of those header row of CSV file as @Noah points out. Here's other solution to solve this problem:
```
with open(filename) as file:
next(file)
for line in file:
year, temp = line.split(",")
list_temp.append(float(temp))
```
Skipping the first line by doing [next(file)](https://docs.python.org/3/library/functions.html#next) would solve that problem. Which is considered [better for large file](https://stackoverflow.com/a/9578638/12446721).
solve all these problem.
Also, `float()` function automatically removes any leading or trailing white space characters (such as spaces, tabs, and newlines) before attempting the conversion. So, no need to do, `strip()`. [float() documentation](https://docs.python.org/3/library/functions.html#float)
| null | CC BY-SA 4.0 | null | 2023-03-03T06:16:19.457 | 2023-03-03T06:16:19.457 | null | null | 12,446,721 | null |
75,623,911 | 2 | null | 66,269,005 | 0 | null | If you want to make George's code reusable, you can do so by creating 2 modifiers and applying them to the view you want to have the animation. Here is the solution:
```
struct ContentView: View {
@State private var scrollViewHeight: CGFloat = 0
@State private var proportion: CGFloat = 0
@State private var proportionName: String = "scroll"
var body: some View {
VStack {
ScrollView {
VStack {
ForEach(0 ..< 100) { index in
Text("Item: \(index + 1)")
}
}
.frame(maxWidth: .infinity)
.modifier(
ScrollReadVStackModifier(
scrollViewHeight: $scrollViewHeight,
proportion: $proportion,
proportionName: proportionName
)
)
}
.modifier(
ScrollReadScrollViewModifier(
scrollViewHeight: $scrollViewHeight,
proportionName: proportionName
)
)
ProgressView(value: proportion, total: 1)
.padding(.horizontal)
}
}
}
```
```
struct ScrollReadVStackModifier: ViewModifier {
@Binding var scrollViewHeight: CGFloat
@Binding var proportion: CGFloat
var proportionName: String
func body(content: Content) -> some View {
content
.background(
GeometryReader { geo in
let scrollLength = geo.size.height - scrollViewHeight
let rawProportion = -geo.frame(in: .named(proportionName)).minY / scrollLength
let proportion = min(max(rawProportion, 0), 1)
Color.clear
.preference(
key: ScrollProportion.self,
value: proportion
)
.onPreferenceChange(ScrollProportion.self) { proportion in
self.proportion = proportion
}
}
)
}
}
struct ScrollReadScrollViewModifier: ViewModifier {
@Binding var scrollViewHeight: CGFloat
var proportionName: String
func body(content: Content) -> some View {
content
.background(
GeometryReader { geo in
Color.clear.onAppear {
scrollViewHeight = geo.size.height
}
}
)
.coordinateSpace(name: proportionName)
}
}
struct ScrollProportion: PreferenceKey {
static let defaultValue: CGFloat = 0
static func reduce(value: inout CGFloat, nextValue: () -> CGFloat) {
value = nextValue()
}
}
```
| null | CC BY-SA 4.0 | null | 2023-03-03T06:41:39.953 | 2023-03-03T06:41:39.953 | null | null | 7,492,329 | null |
75,624,001 | 2 | null | 75,623,721 | 0 | null | When you have the same formula that you copy down multiple rows, sorting that formula behaves in a similar way-- it's effectively the same relative formula whether sorted or copied.
Your underlying goal becomes sorting the hard data, and ignoring whether the formulas are also sorted out of convenience, knowing that they'll behave the same way in the same cells whether sorted or not.
In your case, it appears that columns A and C either need to hold a hard copy of the original data, or if they must contain a reference, then the remote data that they reference must be sorted instead.
| null | CC BY-SA 4.0 | null | 2023-03-03T06:55:02.750 | 2023-03-03T06:55:02.750 | null | null | 1,031,887 | null |
75,624,068 | 2 | null | 75,614,572 | 1 | null | My timegrid view is working now with the 24 hour format. I was wrongly setting the eventTimeFormat (as this is just for events). What worked for me was slotLabelFormat. Show you the solution :)
```
header: false,
plugins: ["dayGrid", "list", "timeGrid", "interaction", "moment", "moment-timezone"],
defaultView: 'timeGridWeek',
firstDay: 1,
minTime: '00:00:00',
maxTime: '21:00:00',
slotLabelFormat: { hour: 'numeric', minute: '2-digit', hour12: false }
```
| null | CC BY-SA 4.0 | null | 2023-03-03T07:04:24.893 | 2023-03-03T07:07:28.940 | 2023-03-03T07:07:28.940 | 21,196,522 | 21,196,522 | null |
75,624,181 | 2 | null | 27,713,747 | 0 | null |
I tried multiple ways to override default back button by appending and removing view controllers from navigation stack.
But below solution worked only.
```
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.navigationBar.topItem?.backBarButtonItem = UIBarButtonItem(title: " ", style: .plain, target: nil, action: #selector(popToRoot))
}
@objc func popToRoot() {
self.navigationController?.popToRootViewController(animated: true)
}
```
| null | CC BY-SA 4.0 | null | 2023-03-03T07:19:30.157 | 2023-03-03T07:19:30.157 | null | null | 10,118,612 | null |
75,624,495 | 2 | null | 60,691,124 | 0 | null | I had the same issue I resolved it.
please open IIS Server and select Application pools and check particular name and status. if status stopped go to started. then you will go to check your post man.
IIS Server => Application pools => Status => started
[](https://i.stack.imgur.com/od653.png)
| null | CC BY-SA 4.0 | null | 2023-03-03T07:56:47.243 | 2023-03-03T07:56:47.243 | null | null | 7,615,236 | null |
75,624,505 | 2 | null | 75,622,795 | 0 | null | You have specified your `appointment_time` parameter as `i` when binding your parameters. So, `14:30:00` becomes `14`. Change the `types` string in your bind call:
```
$stmt->bind_param('ssss', $name, $email, $date, $time);
```
| null | CC BY-SA 4.0 | null | 2023-03-03T07:57:50.247 | 2023-03-03T07:57:50.247 | null | null | 1,191,247 | null |
75,624,541 | 2 | null | 75,621,364 | 0 | null | > but it came out with the axes inverted
Simply switch the `bar()` parameters to
```
eixo.bar(familias, indice)
```
As expected, you will have the families along the X axis and the "number of times each family appears" along the Y axis.
> and also with the elements too close together
This is due to the short width set for the figure: `plt.figure(figsize=(5,4))`. Try increasing the first value until you reach the desired look.
You might also want to play with the `xticks` labels rotation if you don't want the string names to be overlapping.
```
eixo.set_xticklabels(familias, rotation=90)
```
Here is the type of figure you can obtain (using randomly generated values)
```
# [...]
fig = plt.figure(figsize=(10,4)) # Increase figure width
eixo = fig.add_axes([0,0,1,1])
eixo.bar(familias, indice) # Invert families and indice
eixo.set_title('Lotes por famílias', fontsize=15, pad=10)
eixo.set_xlabel('Famílias',fontsize=15)
eixo.set_ylabel('Lotes', fontsize=15)
eixo.set_xticklabels(familias, rotation=90) # Display the xticks labels vertically
```
[](https://i.stack.imgur.com/SnilX.png)
| null | CC BY-SA 4.0 | null | 2023-03-03T08:02:01.260 | 2023-03-03T08:28:35.747 | 2023-03-03T08:28:35.747 | 11,080,037 | 11,080,037 | null |
75,624,614 | 2 | null | 75,610,216 | 0 | null | In Vuetify 3, which is where [its github repo's master](https://github.com/vuetifyjs/vuetify) points at, all SASS/SCSS variables are now exposed through a single file located in `vuetify/_settings`.
You can import it like this in your component's style tag:
```
<style scoped lang="scss">
@use 'vuetify/settings' as v;
@media #{map-get(v.$display-breakpoints, 'xs')} {
p {
font-size: 0.75em;
}
}
</style>
```
| null | CC BY-SA 4.0 | null | 2023-03-03T08:12:07.217 | 2023-03-03T08:12:07.217 | null | null | 1,071,518 | null |
75,624,663 | 2 | null | 75,624,526 | 2 | null | You can set `legend.margin` to have a negative left-hand side margin.
```
library(tidyverse)
ggplot(mtcars, aes(wt, qsec)) +
geom_point(
aes(
size = mpg
)) +
labs(x = "", y = "", title = 'This is title', subtitle = 'This is subtitle') +
guides(size = guide_legend(nrow = 1)) +
theme(
panel.border = element_blank(),
legend.position = 'top',
legend.justification = 'left',
legend.margin = margin(c(0, -1, 0, 0)),
plot.title = element_text(size = 18),
)
```
![](https://i.imgur.com/vCk8KKh.png)
[reprex v2.0.2](https://reprex.tidyverse.org)
| null | CC BY-SA 4.0 | null | 2023-03-03T08:18:07.560 | 2023-03-03T08:18:07.560 | null | null | 16,647,496 | null |
75,624,688 | 2 | null | 75,561,759 | 0 | null | You must pass `font_properties` as a dictionary. Try `ScaleBar(<other parameters>, font_properties={"size": 18})`
| null | CC BY-SA 4.0 | null | 2023-03-03T08:21:24.443 | 2023-03-03T08:21:24.443 | null | null | 13,988,380 | null |
75,624,743 | 2 | null | 75,621,364 | 0 | null | Thank you for providing your code. I see a couple of issues that may be causing your bar graph to have inverted axes and elements that are too close together.
Firstly, it looks like you're currently plotting the familias series on the y-axis of the graph, rather than the count of each family. In order to get the count of each family, you can use the value_counts() method to count the occurrences of each family in the familias series, like this:
familia_counts = familias.value_counts()
You can then use familia_counts to plot the count of each family on the y-axis of the graph.
Secondly, the range() function in Python generates a sequence of numbers starting from 0 and going up to (but not including) the length of the familias series. This means that the indice variable will contain the values 0, 1, 2, ..., len(familias) - 1. However, these indices will be spaced evenly along the x-axis of the graph, which may not correspond to the actual families in your data. To fix this, you can use the unique() method to get a list of the unique families in the familias series, and then use np.arange() to generate an evenly-spaced sequence of indices that correspond to the families, like this:
```
familia_names = familias.unique()
indice = np.arange(len(familia_names))
```
Finally, you can adjust the bar width and spacing between the bars using the width and align parameters of the bar() method. For example, you can set width=0.8 to make the bars wider, and align='center' to center the bars over their corresponding x-axis ticks.
Putting it all together, here's an updated version of your code that should create a bar graph with the correct axes and spacing:
```
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
ornitologia = pd.read_excel('C:/Users/mjoao/OneDrive/Documentos/Coleção_MNRJ/Ornitologia/ornitologia.xlsx')
familias = ornitologia['FAMÍLIA']
familia_counts = familias.value_counts()
familia_names = familias.unique()
indice = np.arange(len(familia_names))
fig = plt.figure(figsize=(5,4))
eixo = fig.add_axes([0,0,1,1])
eixo.bar(indice, familia_counts, width=0.8, align='center')
eixo.set_xticks(indice)
eixo.set_xticklabels(familia_names, rotation=90)
eixo.set_title('Lotes por famílias', fontsize=15, pad=10)
eixo.set_xlabel('Famílias',fontsize=15)
eixo.set_ylabel('Lotes', fontsize=15)
plt.show()
```
I hope this helps! Let me know if you have any further questions or if there's anything else I can do to assist you.
| null | CC BY-SA 4.0 | null | 2023-03-03T08:27:54.330 | 2023-03-03T08:27:54.330 | null | null | 18,596,081 | null |
75,624,930 | 2 | null | 72,364,343 | 0 | null | It may be caused because you have some empty function(function with no body) in your code, search and erase it, your issue will be solved
| null | CC BY-SA 4.0 | null | 2023-03-03T08:48:08.120 | 2023-03-03T08:48:08.120 | null | null | 12,204,990 | null |
75,625,023 | 2 | null | 75,603,546 | 1 | null | As I am a new stackoverflow contributor, I cannot post images yet unfortunately.
To make an idea of what my image is about, it looks like this [one](https://answers.opencv.org/upfiles/14019666614662045.png)
(image n°5: - Fill holes + opening morphological operations to remove small noise blobs)
I found a solution of my problem using first contour detection and filling with opencv, and then skimage "morphology.remove_small_holes" function enabled me to fill holes at the boundary of image. Here is the code:
```
# fill holes
contour, hier = cv2.findContours(ddwi.astype(np.uint8), cv2.RETR_CCOMP, cv2.CHAIN_APPROX_TC89_KCOS)
for cnt in contour:
cv2.drawContours(ddwi, [cnt], 0, 255, -1)
# remove residual small holes at the boundary of image
from skimage import morphology
ddwi = morphology.remove_small_holes(ddwi.astype(np.uint8))
ddwi = 255 * ddwi.astype(np.uint8)
```
| null | CC BY-SA 4.0 | null | 2023-03-03T08:58:23.913 | 2023-03-03T08:58:23.913 | null | null | 21,311,325 | null |
75,625,191 | 2 | null | 75,324,342 | 1 | null | And the end I found out I could use `EventContent` like this:
```
eventContent: function(info) {
const title = info.event.title;
const nomeUtente = info.event.extendedProps.nomeUtente;
if (nomeUtente){
return {
html: title + " - " + nomeUtente
}
}
}
```
And I had the result I wanted: [](https://i.stack.imgur.com/WhXZT.png)
| null | CC BY-SA 4.0 | null | 2023-03-03T09:17:27.873 | 2023-03-03T09:17:27.873 | null | null | 21,133,686 | null |
75,625,203 | 2 | null | 75,625,105 | 1 | null | The drawing is a little unclear I think.
If you read the actual answer, you'll notice that there are two options for the final grouping:
```
A'BD
or
BCD
```
BCD is the grouping in red in your answer, while A'BD is the grouping:
[](https://i.stack.imgur.com/N6P0z.png)
So there are two options for grouping that lone 1, and the answer considers both of them. It just doesn't both of them.
---
The giveaway is that a single cell needs 4 terms to specify it -- that `1` on its own would be `A'BCD`. However there aren't any elements with 4 terms in the answer, which means that the answer must have grouped it with another cell.
| null | CC BY-SA 4.0 | null | 2023-03-03T09:19:03.017 | 2023-03-03T09:19:03.017 | null | null | 1,086,121 | null |
75,625,231 | 2 | null | 30,655,939 | 0 | null | Make sure your parent is a coordinator layout, otherwise setExpanded will not work.
| null | CC BY-SA 4.0 | null | 2023-03-03T09:21:53.787 | 2023-03-03T09:21:53.787 | null | null | 10,319,730 | null |
75,625,200 | 2 | null | 73,387,906 | 0 | null | My colleague accidentally found that could click button for change open with in the file properties dialog to call up the open with dialog, so I thought of the method of simulating clicking.
![](https://i.stack.imgur.com/LIvfU.png)
My friend find that Bandizip is also implemented in this way by intercepting its message.
![](https://i.stack.imgur.com/TP1Iw.png)
![](https://i.stack.imgur.com/svtzA.png)
It was verified after the test on the slow-motion virtual machine. The file properties dialog flashed, and then the open with dialog popped up.
The following is my implementation code for using C# to simulate clicking.
```
[DllImport("shell32.dll")]
static extern bool SHObjectProperties(IntPtr hWnd, int shopObjectType,
[MarshalAs(UnmanagedType.LPWStr)] string pszObjectName,
[MarshalAs(UnmanagedType.LPWStr)] string pszPropertyPage);
[DllImport("user32.dll")]
static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, IntPtr lParam);
delegate bool EnumWindowsProc(IntPtr hWnd, IntPtr lParam);
[DllImport("kernel32.dll")]
static extern uint GetCurrentProcessId();
[DllImport("user32.dll")]
static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
[DllImport("user32.dll", CharSet = CharSet.Auto)]
static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);
[DllImport("user32.dll", CharSet = CharSet.Auto)]
static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);
[DllImport("User32.dll")]
static extern int SetForegroundWindow(IntPtr point);
[DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr hWnd, int cmdShow);
[DllImport("user32.dll")]
static extern bool IsWindowVisible(IntPtr hWnd);
[DllImport("user32.dll")]
static extern bool IsWindowEnabled(IntPtr hWnd);
[DllImport("user32.dll")]
static extern int GetWindowLong(IntPtr hWnd, int nIndex);
[DllImport("user32.dll")]
static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
[DllImport("user32.dll")]
static extern bool SetLayeredWindowAttributes(IntPtr hwnd, uint crKey, byte bAlpha, uint dwFlags);
[DllImport("user32.dll")]
static extern IntPtr GetDlgItem(IntPtr hDlg, int nIDDlgItem);
[DllImport("user32.dll", CharSet = CharSet.Auto)]
static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);
[DllImport("user32.dll")]
static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, uint dwExtraInfo);
const string CLASSNANE_DIALOG = "#32770";
const int SHOP_FILEPATH = 0x2;
const int MAX_PATH = 260;
const int GWL_EXSTYLE = -20;
const int WS_EX_LAYERED = 0x80000;
const int LWA_ALPHA = 0x2;
const int ID_APPLY = 0x3021;
const int WM_CLOSE = 0x010;
const int VK_LMENU = 0xA4;
const int VK_C = 0x43;
const int KEYEVENTF_KEYUP = 0x2;
public static void ShowOpenWithDialog(string extension)
{
string fileName = Guid.NewGuid().ToString() + extension;
string filePath = Path.Combine(Path.GetTempPath(), fileName);
File.WriteAllText(filePath, string.Empty);
bool found = false;
uint currentId = GetCurrentProcessId();
bool func(IntPtr hWnd, IntPtr lparam)
{
GetWindowThreadProcessId(hWnd, out uint id);
if(id == currentId)
{
var sb = new StringBuilder(MAX_PATH);
if(GetClassName(hWnd, sb, sb.Capacity) != 0 && sb.ToString() == CLASSNANE_DIALOG)
{
if(GetWindowText(hWnd, sb, sb.Capacity) != 0 && sb.ToString().Contains(fileName))
{
found = true;
while(IsWindowVisible(hWnd)) ShowWindow(hWnd, 0);
SetWindowLong(hWnd, GWL_EXSTYLE, GetWindowLong(hWnd, GWL_EXSTYLE) ^ WS_EX_LAYERED);
SetLayeredWindowAttributes(hWnd, 0, 0, LWA_ALPHA);
Task.Run(() =>
{
IntPtr applyHandle = GetDlgItem(hWnd, ID_APPLY);
while(!IsWindowEnabled(applyHandle)) Thread.Sleep(100);
SendMessage(hWnd, WM_CLOSE, 0, 0);
});
SetForegroundWindow(hWnd);
keybd_event(VK_LMENU, 0, 0, 0);
keybd_event(VK_C, 0, 0, 0);
keybd_event(VK_LMENU, 0, KEYEVENTF_KEYUP, 0);
keybd_event(VK_C, 0, KEYEVENTF_KEYUP, 0);
File.Delete(filePath);
}
}
}
return true;
}
Task.Run(() =>
{
while(!found)
{
EnumWindows(func, IntPtr.Zero);
Thread.Sleep(50);
}
});
SHObjectProperties(IntPtr.Zero, SHOP_FILEPATH, filePath, null);
}
```
Note that none of [the three ways I know of to open the file properties dialog](https://www.yuque.com/bluepointlilac/c-sharp/propertiesdialog) will get a window handle to the dialog. Bandizip uses `ShellExecuteEx`, and I use `SHObjectProperties`. Nor you can hide a window when calling `ShellExecuteEx` by setting the `nShow` property of the `SHELLEXECUTEINFO` parameter to `SW_HIDE`.
So you need to enumerate the window after opening the file Properties dialog, find it by process id, window class name, and title, and hide it by setting the window transparency to 0. Then send the ALT + C shortcut key to the Properties dialog to simulate clicking the Change button, wait a moment, and the open with dialog I want will be displayed.
The Apply button in the file properties dialog becomes enabled whether you click OK in the open with dialog or you click outside the scope of the dialog to lose focus and close it, so you can check to see if the open with dialog is closed by iterating through the enabled status of the Apply button and then closing the File Properties dialog. And do something you want to do.
| null | CC BY-SA 4.0 | null | 2023-03-03T09:18:26.570 | 2023-03-03T09:18:26.570 | null | null | 13,558,953 | null |
75,625,509 | 2 | null | 75,623,151 | 2 | null | From your question I assume you want to merge two images together with some sort of fading from one to the other?
I've used [OpacityMask](https://doc.qt.io/qt-6/qml-qt5compat-graphicaleffects-opacitymask.html) and [LinearGradient](https://doc.qt.io/qt-6/qml-qt5compat-graphicaleffects-lineargradient.html) which are both part of the [Qt 5 Compatibility API](https://doc.qt.io/qt-6/qtgraphicaleffects5-index.html). Depending on the Qt version you're using you can either use:
- [OpacityMask](https://doc.qt.io/qt-5/qml-qtgraphicaleffects-opacitymask.html)[LinearGradient](https://doc.qt.io/qt-5/qml-qtgraphicaleffects-lineargradient.html)- [OpacityMask](https://doc.qt.io/qt-6/qml-qt5compat-graphicaleffects-opacitymask.html)[LinearGradient](https://doc.qt.io/qt-6/qml-qt5compat-graphicaleffects-lineargradient.html)- [MultiEffect](https://doc-snapshots.qt.io/qt6-6.5/qml-qtquick-effects-multieffect.html)[Gradient](https://doc-snapshots.qt.io/qt6-6.5/qml-qtquick-gradient.html)
The example works as follows:
1. Create a LinearGradient that goes from black to transparent which is used as the mask.
2. Load two images (if you don't want to see the original you should hide them with visible: false).
3. Create two OpacityMask instances on top of each other which both have the same mask applied (bottom is using invert: true) and a different source image.
I would also suggest using custom [shaders](https://doc.qt.io/qt-6/qml-qtquick-shadereffect.html) in order to achieve that effect, because it will be quicker and not as redundant as drawing the `OpacityMask` twice.
---
I've added the mentioned `ShaderEffect` and the accompanying fragment shader. The result is a bit different to the `OpacityMask` solution, but this might also be due to the GLSL `mix()` function the example is using.
My example is using Qt 6.4.0 you can get the complete source from [here](https://github.com/iam-peter/stackoverflow/tree/main/questions/75623151).
[](https://i.stack.imgur.com/Xje8G.png)
```
import QtQuick
import Qt5Compat.GraphicalEffects
Window {
id: root
width: 640
height: 940
visible: true
title: qsTr("Hello World")
readonly property int _width: 200
readonly property int _height: 300
LinearGradient {
id: mask
width: root._width
height: root._height
start: Qt.point(0, 0)
end: Qt.point(0, root._height)
visible: false
gradient: Gradient {
GradientStop { position: 0.0; color: "black" }
GradientStop { position: 1.0; color: "transparent" }
}
}
Grid {
columns: 3
spacing: 20
Image {
id: imgSourceTop
source: "https://picsum.photos/id/54/%1/%2".arg(root._width).arg(root._height)
smooth: true
}
Image {
id: imgSourceBottom
source: "https://picsum.photos/id/93/%1/%2".arg(root._width).arg(root._height)
smooth: true
}
Item {
width: root._width
height: root._height
OpacityMask {
anchors.fill: parent
source: imgSourceTop
maskSource: mask
}
OpacityMask {
anchors.fill: parent
source: imgSourceBottom
maskSource: mask
invert: true
}
}
LinearGradient {
id: gradientSourceTop
width: root._width
height: root._height
start: Qt.point(0, 0)
end: Qt.point(root._width, 0)
gradient: Gradient {
GradientStop { position: 0.0; color: "#1E9600" }
GradientStop { position: 0.5; color: "#FFF200" }
GradientStop { position: 1.0; color: "#FF0000" }
}
}
LinearGradient {
id: gradientSourceBottom
width: root._width
height: root._height
start: Qt.point(0, 0)
end: Qt.point(root._width, 0)
gradient: Gradient {
GradientStop { position: 0.0; color: "#833ab4" }
GradientStop { position: 0.5; color: "#fd1d1d" }
GradientStop { position: 1.0; color: "#fcb045" }
}
}
Item {
width: root._width
height: root._height
OpacityMask {
anchors.fill: parent
source: gradientSourceTop
maskSource: mask
}
OpacityMask {
anchors.fill: parent
source: gradientSourceBottom
maskSource: mask
invert: true
}
}
Image {
id: shaderSourceTop
source: "https://picsum.photos/id/54/%1/%2".arg(root._width).arg(root._height)
smooth: true
}
Image {
id: shaderSourceBottom
source: "https://picsum.photos/id/93/%1/%2".arg(root._width).arg(root._height)
smooth: true
}
ShaderEffect {
width: root._width
height: root._height
property variant sourceTop: shaderSourceTop
property variant sourceBottom: shaderSourceBottom
fragmentShader: "shaders/blend.frag.qsb"
}
}
}
```
---
```
#version 440
layout(location = 0) in vec2 qt_TexCoord0;
layout(location = 0) out vec4 fragColor;
layout(binding = 1) uniform sampler2D sourceTop;
layout(binding = 2) uniform sampler2D sourceBottom;
layout(std140, binding = 0) uniform buf {
mat4 qt_Matrix;
float qt_Opacity;
};
void main()
{
vec4 top = texture(sourceTop, qt_TexCoord0);
vec4 bottom = texture(sourceBottom, qt_TexCoord0);
fragColor = mix(top, bottom, qt_TexCoord0.y);
}
```
| null | CC BY-SA 4.0 | null | 2023-03-03T09:50:10.457 | 2023-03-03T10:42:24.803 | 2023-03-03T10:42:24.803 | 525,038 | 525,038 | null |
75,625,723 | 2 | null | 75,618,795 | 0 | null | You can create your own Windows Media Player, but I don't know if you are using a winforms program or a Wpf program.
This is an official example from Microsoft, it uses [WPF](https://learn.microsoft.com/en-us/dotnet/desktop/wpf/graphics-multimedia/how-to-control-a-mediaelement-play-pause-stop-volume-and-speed?redirectedfrom=MSDN&view=netframeworkdesktop-4.8) show.
You can obtain the video time and modify it according to your needs.
Here's an example of how I get the time and format it:
```
var ti = this.mediaelement.Position.TotalMilliseconds;
TimeSpan timeSpan = TimeSpan.FromMilliseconds(ti);
string formattedTime = timeSpan.ToString(@"hh\:mm\:ss\.fff");
TextBox.Text = formattedTime;
```
[](https://i.stack.imgur.com/X4YvP.png)
| null | CC BY-SA 4.0 | null | 2023-03-03T10:11:41.797 | 2023-03-03T10:11:41.797 | null | null | 16,764,901 | null |
75,625,827 | 2 | null | 75,593,468 | 0 | null | > For text fields ,in any automation framework/library always use
"value" property compared to textcontent or other properties for reliable results.
For [playwright](https://playwright.dev/docs/api/class-locator) , I would use the below syntax for fetching text value:
```
await page.locator('inputLocator').inputValue();
```
Reference: [https://playwright.dev/docs/api/class-locator#locator-input-value](https://playwright.dev/docs/api/class-locator#locator-input-value)
| null | CC BY-SA 4.0 | null | 2023-03-03T10:21:38.163 | 2023-03-03T10:21:38.163 | null | null | 1,831,456 | null |
75,625,851 | 2 | null | 75,554,967 | 0 | null | Here is the code that solved my issue:
```
//HTML
<table>
<thead><tr><td>
<div class="header-space"> </div>
</td></tr></thead>
<tbody><tr><td>
<div class="content">...</div>
</td></tr></tbody>
<tfoot><tr><td>
<div class="footer-space"> </div>
</td></tr></tfoot>
</table>
<div class="header">...</div>
<div class="footer">...</div>
// CSS
.header, .header-space,
.footer, .footer-space {
height: 100px;
}
.header {
position: fixed;
top: 0;
}
.footer {
position: fixed;
bottom: 0;
}
```
| null | CC BY-SA 4.0 | null | 2023-03-03T10:23:39.737 | 2023-03-03T10:23:39.737 | null | null | 14,277,637 | null |
75,625,897 | 2 | null | 30,964,920 | 0 | null | I was facing the same issue. I added C:\spark\spark-3.3.2-bin-hadoop3\bin inside path under System Variable. It worked for me.
[enter image description here](https://i.stack.imgur.com/PzYRb.jpg)
| null | CC BY-SA 4.0 | null | 2023-03-03T10:29:07.200 | 2023-03-03T10:29:07.200 | null | null | 4,844,418 | null |
75,626,330 | 2 | null | 75,624,824 | 0 | null | `ModalBottomSheet` is buggy for some time now, i've stopped using it until some fixes come.
Maybe your problem is related to theses unwanted behaviors.
See the issues: [https://issuetracker.google.com/issues/268380384](https://issuetracker.google.com/issues/268380384)
Hope it helps.
| null | CC BY-SA 4.0 | null | 2023-03-03T11:09:58.307 | 2023-03-03T11:09:58.307 | null | null | 8,331,852 | null |
75,626,672 | 2 | null | 75,623,290 | 0 | null | Click in error details and read the info.
The trouble could be in the credentials -> Client ID for Web application -> Authorised redirect URI .
| null | CC BY-SA 4.0 | null | 2023-03-03T11:44:54.707 | 2023-03-03T11:44:54.707 | null | null | 2,842,722 | null |
75,626,833 | 2 | null | 75,626,314 | 0 | null | If you provide your full code, It would be much easier to solve this, but a few solutions may be:
1. Add these to your button's CSS:
```
margin: 0;
outline: 0;
```
1. Set the padding of the button's parent to 0.
2. Set a temporary background-color for both the parent and button to see what caused the padding.
3. Use your browser's DevTools by pressing F12 and hover over your button's code to see how much space it has occupied. Edit the CSS directly from there to see live (but temporary) changes.
4. Sometimes the font-size of the parent can cause extra spacing. Set it to 0 to check if it was it.
### Sum up
Play with the DevTools and the properties `padding`, `margin`, `font-size` of both the button and its parent.
| null | CC BY-SA 4.0 | null | 2023-03-03T12:04:02.763 | 2023-03-03T12:04:02.763 | null | null | 11,041,841 | null |
75,627,096 | 2 | null | 75,627,045 | 0 | null | You can use the following SQL query to calculate the general average of the latest grades for each subject for each student:
```
SELECT s.Id, s.Name, g.Subject, AVG(g.Grade) AS Average
FROM Students s
JOIN Grades g ON s.Id = g.Student
JOIN (
SELECT Student, Subject, MAX(Date) AS LatestDate
FROM Grades
GROUP BY Student, Subject
) latest_grades ON g.Student = latest_grades.Student
AND g.Subject = latest_grades.Subject
AND g.Date = latest_grades.LatestDate
GROUP BY s.Id, s.Name, g.Subject;
```
This query joins the Students and Grades tables based on the foreign key relationship. It then joins with a subquery that selects the latest grade for each student-subject pair based on the maximum date. Finally, it calculates the average of the latest grades for each subject for each student using the AVG aggregate function, and groups the results by student and subject.
| null | CC BY-SA 4.0 | null | 2023-03-03T12:29:52.233 | 2023-03-03T12:29:52.233 | null | null | 4,165,839 | null |
75,627,142 | 2 | null | 75,627,045 | 0 | null | use the MAX() function to get the most recent grade for each subject. You can then calculate the average of these grades using the AVG() function.
Here is an example:
```
SELECT Students.Name, AVG(Grades.Grade)
FROM Students
JOIN (
SELECT Student, Subject, MAX(Date) AS LatestDate
FROM Grades
GROUP BY Student, Subject
) AS LatestGrades ON Students.Id = LatestGrades.Student
JOIN Grades ON LatestGrades.Student = Grades.Student
AND LatestGrades.Subject = Grades.Subject
AND LatestGrades.LatestDate = Grades.Date
GROUP BY Students.Name
```
| null | CC BY-SA 4.0 | null | 2023-03-03T12:34:26.197 | 2023-03-03T14:40:23.317 | 2023-03-03T14:40:23.317 | 1,954,048 | 1,954,048 | null |
75,627,167 | 2 | null | 75,626,725 | 2 | null | If what you really want is a layout that will always fill at least 100% of the viewport and the main content stretches to fill whatever space is available while the footer is at the bottom of the content, then you should use grid like so:
# Edited so the footer always sticks at the bottom of the viewport
```
* {
padding: 0;
box-sizing: border-box;
}
body {
margin: 0;
}
#app {
height: 100vh;
display: grid;
grid-template-rows: 1fr max-content;
}
header {
padding: 1rem 2rem;
background-color: black;
color: white;
margin: -1rem -2rem 2rem;
}
main {
padding: 1rem 2rem;
overflow-y: auto;
}
footer {
padding: 1rem 2rem;
background-color: black;
color: white;
}
```
```
<div id="app">
<main>
<header>header will only be as big as its content and scroll away with the content.</header>
<h1>main will stretch to fill the remaining space in the middle</h1>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Asperiores laudantium quas reprehenderit nulla. Dignissimos autem nam cupiditate repellat, magni, esse culpa aperiam iste incidunt asperiores, assumenda modi porro blanditiis laboriosam!</p>
<p>Similique recusandae ad ex ipsa, deserunt dolor molestias eveniet at? Nostrum aspernatur corporis incidunt adipisci id consequuntur, praesentium eveniet veniam aut illum doloribus quibusdam eos molestiae nesciunt! Soluta, autem qui.</p>
<p>Molestiae vitae dignissimos pariatur rerum repudiandae dolores sequi libero voluptas, quidem, provident, adipisci ipsam similique itaque. Alias, suscipit laborum beatae provident accusantium sunt nulla minus cupiditate ratione, commodi adipisci praesentium.</p>
<p>Magni, a quos facilis ad quas nobis reprehenderit magnam maiores id, necessitatibus molestiae repellat, error dolores earum ex officiis totam debitis. Omnis doloremque, suscipit aliquid distinctio itaque iusto voluptas obcaecati.</p>
<p>Quasi eos ea illum modi eum quidem maxime aperiam accusamus aliquid nam, nobis aut, esse labore voluptates non nihil molestiae earum laborum repudiandae necessitatibus deleniti obcaecati? Asperiores, aliquid laboriosam. Libero.</p>
<p>Provident laboriosam enim eaque quo? Aliquam, nesciunt eveniet amet beatae accusantium placeat ullam. Ipsum, nihil culpa inventore libero architecto tempore voluptas, totam pariatur similique quas expedita sint molestias vitae dicta.</p>
<p>Eos fugiat quod obcaecati, possimus, excepturi ducimus recusandae quisquam mollitia sit doloremque nihil ipsum adipisci inventore sint quasi aperiam neque quidem quos? Dolorum, doloremque iusto et quod corporis error nihil.</p>
<p>Incidunt, provident vel id suscipit quasi ut quae eligendi accusamus, minus iusto vitae excepturi enim, modi possimus? Dolorum molestiae quis maiores, delectus similique hic nulla quasi molestias. Eligendi, eos ipsa.</p>
<p>Labore, facere! Eligendi rerum natus alias optio dolorum facilis maiores ad tempora? Ratione doloribus laboriosam dolor repudiandae obcaecati qui cumque ducimus eos, odit debitis nesciunt illum repellendus quisquam iusto voluptatum!</p>
<p>Accusantium quidem aliquam, aut veniam corrupti, quas temporibus, consequatur ullam blanditiis provident fugiat quibusdam. Sint aliquam esse vero corporis amet praesentium adipisci sit, quisquam perferendis ducimus repudiandae autem dolores eius.</p>
</main>
<footer>footer will only be as big as its content and always stay at the bottom.</footer>
</div>
```
| null | CC BY-SA 4.0 | null | 2023-03-03T12:37:51.763 | 2023-03-03T14:58:25.520 | 2023-03-03T14:58:25.520 | 3,577,849 | 3,577,849 | null |
75,627,330 | 2 | null | 28,587,234 | 0 | null | I hade same on Android Studio Electric Eel Patch 1
> Android Studio Update: Some conflicts found in installation area
but with . I just deleted that file and updated successfully.
| null | CC BY-SA 4.0 | null | 2023-03-03T12:53:05.643 | 2023-03-03T12:53:05.643 | null | null | 5,750,389 | null |
75,627,347 | 2 | null | 75,627,095 | 0 | null | In VS Code they are called Guides. Just open the settings and search for them. I assume you want either Indentation Guides or Bracket Pair guides:
[](https://i.stack.imgur.com/dpRoo.png)
| null | CC BY-SA 4.0 | null | 2023-03-03T12:54:43.747 | 2023-03-03T12:54:43.747 | null | null | 6,618,289 | null |
75,627,436 | 2 | null | 75,627,388 | 1 | null | Usually the element is ready before `useEffect` is called. However, in certain situations (conditional rendering for example), the element is not ready, and the `ref` is not set immediately. The problem with your approach is the setting the `ref.current` with a new value, doesn't cause a re-render, so the `useEffect` might not be called when you want it. In your case, something else causes a re-render (probably the state used for the conditional render), and so you avoid this problem.
You can use `useState` instead of a `useRef` because components also accept a function as a `ref`. That would cause the component to re-render when the state updates with the ref:
```
const [ref, setRef] = useState()
useEffect(() => {
if (ref) observer.current.observe(ref);
return () => {
observer.current.disconnect();
}
}, [ref])
return (
<ComponentWithDelayedRef ref={setRef} />
)
```
Another variation on the function as a ref idea, is to create a callback to observe the element, and pass it as the ref:
```
useEffect(() => () => {
observer.current.disconnect();
}, [])
const observe = useCallback(el => {
observer.current.observe(ref)
}, []);
return (
<ComponentWithDelayedRef ref={observe} />
)
```
| null | CC BY-SA 4.0 | null | 2023-03-03T13:04:18.523 | 2023-03-03T14:19:12.830 | 2023-03-03T14:19:12.830 | 5,157,454 | 5,157,454 | null |
75,627,425 | 2 | null | 75,624,497 | 0 | null | Tried your code and found there are some changes needed.
The input JSON you are passing through PowerAutomate must enclosed within square braces e.g., . Please [refer](https://learn.microsoft.com/en-us/connectors/documentdb/#execute-stored-procedure-%28v2%29) .
1. Need to remove var parsedItem = JSON.parse(item); code from Cosmos DB stored procedure. As PowerAutomate's Execute-stored-procedure-(v2) accepts JSON as parameter for stored procedure.
2. Inside else condition you have used userData which is not declared/defined anywhere in the stored procedure. I have replaced it with marketingData and worked for me.
Below are reference screenshots.
[Input for Execute-stored-procedure-(v2)](https://i.imgur.com/JhZutt6.png)
[Flow success](https://i.imgur.com/cynhZKs.png)
(I tried updating a single field in sample data with the modified code)
```
function UpsertItemInCollection(parsedItem) {
var collection = getContext().getCollection();
var queryToCheckExist = "SELECT * FROM c where c.id = " + "'" + parsedItem.id + "'";
var isAccepted = collection.queryDocuments(
collection.getSelfLink(),
queryToCheckExist,
function (err, dbItem, options) {
if (err) throw err;
if (dbItem.length < 1) {
collection.createDocument(collection.getSelfLink(), parsedItem, options, handleCreateOrUpdate);
}
else{
var itemToUpdate = dbItem[0];
itemToUpdate.name = parsedItem.name;
itemToUpdate.marketingData.eventName = parsedItem.marketingData.eventName;
collection.replaceDocument(itemToUpdate._self, itemToUpdate, options, handleCreateOrUpdate);
// getContext().getResponse().setBody(dbItem[0]);
}
});
function handleCreateOrUpdate(err, item, options) {
if (err) throw err;
getContext().getResponse().setBody(item);
}
if (!isAccepted) throw new Error('Sone thing went wrong while sp execution.');
}
```
```
[{
"id": "706cd7c6-db8b-41f9-aea2-0e0c7e8eb009",
"name": "updatedName53",
"categoryId": "4",
"price": 45.99,
"tags": [
"tan",
"new",
"crisp"
],
"marketingData": {
"eventName": "eventName53"
}
}]
```
While running the stored procedure in Cosmos DB data explorer, you can pass the json as Custom parameter but without square braces.
[Input params of stored procedure](https://i.imgur.com/sKHJbnA.png)
[Executed stored procedure successfully](https://i.imgur.com/8hiIuyp.png)
| null | CC BY-SA 4.0 | null | 2023-03-03T13:03:32.100 | 2023-03-03T13:03:32.100 | null | null | 20,891,279 | null |
75,627,607 | 2 | null | 75,627,168 | 3 | null | You are calling ggsave with arguments by position rather by name; you have the plot in the first position; but the first position would be a file name ...
the easiest thing you can do so that your code runs is to be explicit
```
ggsave(plot=gpl,filename = "pulse.png", dpi=300)
```
| null | CC BY-SA 4.0 | null | 2023-03-03T13:20:59.340 | 2023-03-03T13:20:59.340 | null | null | 11,726,436 | null |
75,627,673 | 2 | null | 75,622,669 | 0 | null | Yes that works. However it only makes sense when the dataypes for the individual edges are identical, which seems to be the case here, as you add a new edge for each transaction.
| null | CC BY-SA 4.0 | null | 2023-03-03T13:26:43.603 | 2023-03-03T13:26:43.603 | null | null | 14,600,336 | null |
75,627,675 | 2 | null | 75,616,977 | 0 | null | Remove the parentheses around the parameters. They are redundant and may confuse the SQL parser.
| null | CC BY-SA 4.0 | null | 2023-03-03T13:26:56.440 | 2023-03-03T13:26:56.440 | null | null | 721,855 | null |
75,628,002 | 2 | null | 75,617,555 | 0 | null | An easy way to respond to system theme change is use .
```
<Entry BackgroundColor="{AppThemeBinding Light=Green, Dark=Yellow}"/>
```
or you may use Style:
```
<Style TargetType="Entry" x:Key="EntryStyle">
<Setter Property="BackgroundColor"
Value="{AppThemeBinding Light={StaticResource LightNavigationBarColor}, Dark={StaticResource DarkNavigationBarColor}}" />
</Style>
```
For more info, you could refer to [Respond to system theme changes](https://learn.microsoft.com/en-us/dotnet/maui/user-interface/system-theme-changes?view=net-maui-7.0)
| null | CC BY-SA 4.0 | null | 2023-03-03T13:57:54.577 | 2023-03-03T13:57:54.577 | null | null | 20,118,901 | null |
75,628,026 | 2 | null | 75,623,151 | 0 | null | > Thx, but I want to draw with Gradient, second my Image with different
color in horizontal not single color.
You are talking about a horizontal gradient with more then two `GradientStop`?
The image is only there for showing the transparency. Have a look at the [Rectangle gradient property documentation](https://doc.qt.io/qt-6/qml-qtquick-rectangle.html#gradient-prop), it is actually all mentioned there. If you use Qt 5.11 and below you need to use the `rotation` property to turn the gradient horizontal as shown in the documentation linked above.
Since Qt 5.12 the `Gradient` as an [orientation](https://doc.qt.io/qt-6/qml-qtquick-gradient.html#orientation-prop) property which can be used to simply change its orientation.
[](https://i.stack.imgur.com/SI9PQ.png)
```
Row {
spacing: 20
Image {
width: 240; height: 240
fillMode: Image.Tile
source: "qrc:/images/checkers.png"
Rectangle {
anchors.fill: parent
gradient: Gradient {
orientation: Gradient.Horizontal
GradientStop { position: 0.0; color: "blue" }
GradientStop { position: 0.5; color: "maroon" }
GradientStop { position: 1.0; color: "transparent" }
}
}
}
Image {
width: 240; height: 240
fillMode: Image.Tile
source: "qrc:/images/checkers.png"
Rectangle {
anchors.fill: parent
gradient: Gradient {
orientation: Gradient.Vertical // default
GradientStop { position: 0.0; color: "blue" }
GradientStop { position: 0.5; color: "maroon" }
GradientStop { position: 1.0; color: "transparent" }
}
}
}
}
```
| null | CC BY-SA 4.0 | null | 2023-03-03T13:59:23.750 | 2023-03-03T16:53:56.287 | 2023-03-03T16:53:56.287 | 525,038 | 525,038 | null |
75,628,074 | 2 | null | 75,627,749 | 0 | null | Reading the input file repeatedly to align each line with a line number is rather inelegant and inefficient. See also [Counting lines or enumerating line numbers so I can loop over them - why is this an anti-pattern?](https://stackoverflow.com/questions/65538947/counting-lines-or-enumerating-line-numbers-so-i-can-loop-over-them-why-is-this)
Instead, I would refactor the Awk command to output pairs of values, and then simply loop over those.
```
awk 'NR==FNR { z[NR] = $1; next }
FNR==1 { print z[++n], FILENAME; nextfile }' zeropoints.txt /path/*.fits |
while read -r zp file; do
echo \
astmkcatalog "$file" --ids --ra --dec --magnitude --sn \
--zeropoint="$zp" --brightness --clumpbrightness \
--brightnessnoriver --riverave --rivernum --clumpscat
done
```
(I left in an `echo` so it doesn't really do anything, just print the command it would execute. If it looks correct, take out the `echo` line.)
I don't believe this will solve your problem, as such; but at least it should hopefully steer you in the right direction.
If the input file contains DOS line endings, run `dos2unix` on it, or add `sub(/\r/, "");` to the Awk script.
| null | CC BY-SA 4.0 | null | 2023-03-03T14:03:58.653 | 2023-03-03T14:03:58.653 | null | null | 874,188 | null |
75,628,301 | 2 | null | 57,053,728 | 0 | null | For the users of Vuetify 3:
Install:
```
npm install @fortawesome/fontawesome-free -D
npm install @mdi/font
```
main.ts:
```
enter code here
import "vuetify/styles";
import { createVuetify, type ThemeDefinition } from "vuetify";
import * as components from "vuetify/components";
import * as directives from "vuetify/directives";
import { fa } from "vuetify/iconsets/fa";
import { aliases, mdi } from "vuetify/lib/iconsets/mdi";
// make sure to also import the coresponding css
import "@mdi/font/css/materialdesignicons.css"; // Ensure you are using css-loader
import "@fortawesome/fontawesome-free/css/all.css"; // Ensure your project is capable of handling css files
const vuetify = createVuetify({
theme: {
defaultTheme: "dark",
},
icons: {
defaultSet: "mdi",
aliases,
sets: {
mdi,
fa,
},
},
components,
directives,
});
app.use(vuetify);
```
Credit: [https://www.the-koi.com/projects/setting-up-vue-3-with-vuetify-icons-and-themes/](https://www.the-koi.com/projects/setting-up-vue-3-with-vuetify-icons-and-themes/)
| null | CC BY-SA 4.0 | null | 2023-03-03T14:25:59.237 | 2023-03-03T14:25:59.237 | null | null | 12,545,664 | null |
75,628,505 | 2 | null | 63,066,518 | 0 | null | also had this problem on last versions (VSCode 1.76 with integrated JS debugging, Angular 14).
Unable to make the "Launch Chrome against localhost" work, I received a simple error with no stacktrace "Could not attach to main target".
After days I finally found the reason, the powershell execution policy.
Changing it from AllSigned to RemoteSigned resolved everything.
```
Get-ExecutionPolicy
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
```
Hope this helps
| null | CC BY-SA 4.0 | null | 2023-03-03T14:45:04.653 | 2023-03-03T14:45:04.653 | null | null | 1,425,759 | null |
75,628,617 | 2 | null | 53,406,548 | 0 | null | this.context worked for me instead of context.
| null | CC BY-SA 4.0 | null | 2023-03-03T14:57:11.890 | 2023-03-03T14:57:11.890 | null | null | 14,197,208 | null |
75,628,713 | 2 | null | 75,628,182 | 0 | null | If you want to add a new document to `ALL_invoice` with the data that you marked, that'd be:
```
const copyQuoteProduct = firebase.firestore().collection('ALL_quote').where("quote_hashid", "==", "9hgr9Myhc70CUalKnT1u");
const allInvoiceRef = firebase.firestore().collection('ALL_invoice');
await copyQuoteProduct.get().then(function(querySnapshot) {
querySnapshot.docs.map(function(doc) {
allInvoiceRef.add({ tmp_ff: doc.data().tmp_ff });
})
});
```
---
If `quote_hashid` is always the same value as the document ID, you don't need the query or loop, and can simplify the above to:
```
const copyQuoteProduct = firebase.firestore().collection('ALL_quote').doc("9hgr9Myhc70CUalKnT1u");
const allInvoiceRef = firebase.firestore().collection('ALL_invoice');
await copyQuoteProduct.get().then(function(doc) {
allInvoiceRef.add(allInvoiceRef, { tmp_ff: doc.data().tmp_ff });
});
```
| null | CC BY-SA 4.0 | null | 2023-03-03T15:04:42.137 | 2023-03-03T15:04:42.137 | null | null | 209,103 | null |
75,628,731 | 2 | null | 75,627,045 | 0 | null | Assuming a reasonable schema definition (, and ), you want something like this:
```
SELECT s.ID, s.Name, s.[Group], s.Location, AVG(g.Grade)
FROM
(
SELECT Student, Subject, Grade
,row_number() over (partition by student, subject order by [ID] desc) rn
FROM Grades
) g
INNER JOIN Students s ON s.Id = g.Student
WHERE rn = 1
GROUP BY s.ID, s.Name, s.[Group], s.Location
```
This uses a to partition and then number rows per student/subject based on the date, so you can then limit to only the first row within each partition and take the average from there. It should tend to perform better than solution which need to JOIN to a projection selecting by the `MAX(date)`.
Note I said "reasonable schema" at the beginning of the answer. There is a concern based on the image (which again: it gets squished in the view and is nearly unreadable — ) that multiple grades for a subject are stored in the same column as comma-separated data. This is what we call an schema. Storing comma-separated data in a single column is considered a schema design: something that needs to be fixed.
Another important thing to understand is the use of the `Date` column, which was not shown in the question. . There is as insert order, table order, or disk order, and there are a number of things that can cause a database to reshuffle records on disk or return rows in a different order,
Therefore, you have a way to define "last grade" in terms of . Even a sequentially assigned ID would be enough, but we need . Otherwise, What is it that makes `History(7)` be last rather than `History(5)`?
| null | CC BY-SA 4.0 | null | 2023-03-03T15:06:31.100 | 2023-03-03T15:45:06.613 | 2023-03-03T15:45:06.613 | 3,043 | 3,043 | null |
75,628,928 | 2 | null | 75,626,725 | -1 | null | So the final solution that worked for me was :
```
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'lato';
}
body,html, #app {
min-height: 100vh;
max-width: 100vw;
}
#wrapper {
min-height: 100vh;
height: auto;
max-width: 100vw;
padding-bottom: 120px;
}
footer {
height: 120px;
width: 100%;
background-color: pink;
position: fixed;
bottom: 0;
display: grid;
grid-template-rows: 1fr 2fr;
#lien-express {
display: flex;
.lien-express-1 {
@include flex-lien-express;
background-color: $DBLUE;
}
.lien-express-2 {
@include flex-lien-express;
background-color: $MGREY;
}
}
}
```
The calc don't take under account an auto height. So when i was trying to calculate with calc i could not calculate with an unknown variable. But i could create a parent that was doing the job of the calc by applying a padding, at put the element inside it.
| null | CC BY-SA 4.0 | null | 2023-03-03T15:22:58.330 | 2023-03-03T15:34:15.723 | 2023-03-03T15:34:15.723 | 21,188,051 | 21,188,051 | null |
75,629,005 | 2 | null | 10,690,094 | 0 | null | Solution (hack):
```
# histtype=step returns a single patch, open polygon
n,bins,patches=pylab.hist(data, weights, histtype='step', cumulative=True)
# just delete the last point
patches[0].set_xy(patches[0].get_xy()[:-1])
```
---
[edit](https://stackoverflow.com/revisions/10690094/2)[cumulative histogram has last point at y=0](https://stackoverflow.com/questions/10690094/cumulative-histogram-has-last-point-at-y-0)[Zer0](https://stackoverflow.com/users/761090/eudoxos)
| null | CC BY-SA 4.0 | null | 2023-03-03T15:29:26.143 | 2023-03-03T15:29:26.143 | null | null | 5,446,749 | null |
75,629,203 | 2 | null | 75,627,045 | 0 | null | I think you have to create a new table first that has the LatestGrades and then create the JOIN. Looks like You don’t even need the subj column in the final output, just an avg score across all subjects for every student.
```
WITH
Newtable AS
(SELECT id, subject,grade, MAX(date) as LatestDate
FROM Grades
GROUP BY student, subject)
SELECT Students.id, students.name, AVG (newtable.grade) AS Avggrade
FROM (Newtable FULLJOIN Grades
ON Newtable.id=Grades.id)
FULL JOIN Students ON students.id=grades.id
```
| null | CC BY-SA 4.0 | null | 2023-03-03T15:48:45.423 | 2023-03-03T18:03:24.973 | 2023-03-03T18:03:24.973 | 874,188 | 21,324,060 | null |
75,629,327 | 2 | null | 75,628,973 | 2 | null | I agree with the comment by LarsTech. That said, yes I believe I do "know why this is happening and how to fix it". Unless you change it in the form designer, the default value for `lvwPayroll.View` is probably `LargeIcon`. What you are seeing is likely a rendering of 7 (one for each `Item`) that have an image, but have a very long title that's being squashed into the narrow width of the icon's rectangle.
---
Try setting the `View` property to `List`.
```
lvwPayroll.View = View.List;
lvwPayroll.Items.Add("Total Number of Salaried Employees: " + salariedEmployees);
lvwPayroll.Items.Add("Total Annual Pay for Salaried Employees");
//ADD MORE
lvwPayroll.Items.Add("---------------------------------------------");
lvwPayroll.Items.Add("Total Number of Waged Employees: " + wagedEmployees);
lvwPayroll.Items.Add("Total Annual Pay for Waged Employees");
//ADD MORE
lvwPayroll.Items.Add("---------------------------------------------");
lvwPayroll.Items.Add("---------------------------------------------");
```
[](https://i.stack.imgur.com/eD2f3.png)
| null | CC BY-SA 4.0 | null | 2023-03-03T16:01:13.063 | 2023-03-03T16:32:43.363 | 2023-03-03T16:32:43.363 | 5,438,626 | 5,438,626 | null |
75,629,369 | 2 | null | 75,628,795 | 0 | null | I don't know if it will be useful, but this is a pretty straight-forward algorithm I've just coded. It is not math-based, you will definitely find counter-examples that won't work I'm afraid.
```
private static void GetPeeks(List<int> points)
{
var acc = ForwardIncrease(points);
var dec = BackwardIncrease(points);
var mul = new List<int>();
for (int i = 0; i < acc.Count; i++)
{
mul.Add(acc[i] * dec[i]);
}
//in mul, greatest values are the peaks (minima and maxima)
}
private static List<int> ForwardIncrease(List<int> points)
{
var result = new List<int>();
var previous = points[0];
var cumul = 0;
foreach (var point in points)
{
var diff = point - previous;
if (diff >= 0 && cumul >= 0)
{
cumul += diff;
}
else if (diff <= 0 && cumul <= 0)
{
cumul += diff;
}
else
{
cumul = diff;
}
result.Add(cumul);
previous = point;
}
return result;
}
private static List<int> BackwardIncrease(List<int> points)
{
var result = new List<int>();
var previous = points[points.Count - 1];
var cumul = 0;
for (int i = points.Count - 1; i >= 0; i--)
{
var point = points[i];
var diff = point - previous;
if (diff >= 0 && cumul >= 0)
{
cumul += diff;
}
else if (diff <= 0 && cumul <= 0)
{
cumul += diff;
}
else
{
cumul = diff;
}
result.Insert(0, cumul);
previous = point;
}
return result;
}
```
| null | CC BY-SA 4.0 | null | 2023-03-03T16:05:00.920 | 2023-03-03T16:27:14.500 | 2023-03-03T16:27:14.500 | 10,753,712 | 10,753,712 | null |
75,629,465 | 2 | null | 75,628,817 | 1 | null | Taipy does not directly change your GUI with this set of specific assignments (`.append()`, `.drop()`). You must use a regular ‘equals’ assignment to see changes in real time (`state.xxx = yyy`). Your code will look like this:
```
from taipy.gui import Gui
import pandas as pd
a_list = [1,2,3]
data = pd.DataFrame({"x":[1,2,3], "y":[2,1,3]})
md = """
<|Update|button|on_action=update|>
# My list
<|{a_list}|>
# My data
<|{data}|table|width=fit-content|>
"""
def update(state):
state.a_list += [4]
temp = state.data
temp["y"] = [10, 4, 3]
state.data = temp
Gui(md).run()
```
| null | CC BY-SA 4.0 | null | 2023-03-03T16:14:37.660 | 2023-03-03T16:14:37.660 | null | null | 19,480,077 | null |
75,629,752 | 2 | null | 75,428,169 | 0 | null | You have to specify the entire backend api url while using fetch .if u try to fetch data using `/api/user/login` it will append in your front end url like `https://your_frontend_url/api/user/login` which is not a valid backend api url
```
const API_URL = "" //your api url deployed in heroku goes here
const response = await fetch(`${API_URL}/api/user/login`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ email, password })
}).then(r => console.log(r))
```
> If you are using heroku for free heroku has stopped their free tier last year, so verify that your api is working or go for alternatives like [render.com](https://render.com/), [railway.app](https://railway.app/) or [cyclic.sh](https://www.cyclic.sh/)
| null | CC BY-SA 4.0 | null | 2023-03-03T16:44:40.553 | 2023-03-03T16:44:40.553 | null | null | 16,038,633 | null |
75,629,758 | 2 | null | 73,331,312 | 0 | null |
> I found the problem. After `const trContent=` I used the 1st key. But actually, I must use the 2nd key.
![enter image description here](https://i.stack.imgur.com/8Pn4r.png)
| null | CC BY-SA 4.0 | null | 2023-03-03T16:45:07.237 | 2023-03-03T16:45:07.237 | null | null | 2,756,409 | null |
75,629,981 | 2 | null | 75,629,605 | 0 | null | Try using the margin:auto; instead of position:absolute; like this:
```
body {
margin: 0;
background: #CDE7ED;
}
.heading1{
position: absolute;
width: 449px;
height: 80px;
top: 56px;
font-family: 'Montserrat';
font-style: normal;
font-weight: 500;
font-size: 30px;
line-height: 40px;
/* or 133% */
text-align: center;
background: #FFFFFF;
color: #0B2B5B;
}
#navbar{
position: relative;
height: 196px;
top: 0px;
display: flex;
justify-content: center;
background: #FFFFFF;
}
.iki{
height: 32px;
margin-top: 20px;
font-family: 'Montserrat';
font-style: normal;
font-weight: 500;
font-size: 24px;
line-height: 32px;
text-align: center;
color: #0B2B5B;
}
.uc{
height: 32px;
margin-bottom: 20px;
font-family: 'Montserrat';
font-style: normal;
font-weight: 500;
font-size: 20px;
line-height: 32px;
/* identical to box height, or 160% */
text-align: center;
color: #0B2B5B;
}
.box{
width: 782px;
height: 380px;
margin: auto;
background: #FFFFFF;
box-shadow: 0px 2px 4px rgba(11, 43, 91, 0.1);
border-radius: 4px;
}
.box-header{
width: 782px;
height: 64px;
left: 249px;
top: 334px;
background: #FFFFFF;
border-radius: 4px 4px 0px 0px;
display: flex;
}
.b1{
width: 40px;
background: #25A575;
}
.b11{
height: 100%;
font-weight: 500;
font-size: 26px;
display: flex;
align-items: center;
justify-content: center;
color: #FFFFFF;
}
.new{
padding-left: 20px;
font-family: 'Montserrat';
font-style: normal;
font-weight: 500;
font-size: 20px;
display: flex;
align-items: center;
font-feature-settings: 'pnum' on, 'lnum' on;
color: #3A719B;
background-color: white;
}
.box-body{
width: 295px;
height: 16px;
left: 24px;
top: 0px;
font-family: 'Montserrat';
font-style: normal;
font-weight: 400;
font-size: 16px;
line-height: 16px;
/* identical to box height, or 100% */
display: flex;
align-items: center;
color: #3A719B;
}
.line{
position: absolute;
left: 0%;
right: 0%;
top: 100%;
bottom: 0%;
border: 1px solid #3A719B;
}
.disflex {
display: flex;
}
.form_inp {
padding: 60px;
}
.disflex .input-container, .full-input-container {
width: 50%;
border-bottom: 1.5px solid steelblue;
margin: 0 30px 30px 0;
}
.disflex .input-container input, .full-input-container input {
border: 0;
}
.full-input-container {
width: 100% !important;
margin: 0 0 30px 0 !important;
}
.btn {
margin: 0 0 50px 0;
width: 100%;
border-radius: 50px;
padding: 10px;
background-color: midnightblue;
color: white;
}
```
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<script src="https://use.fontawesome.com/your-embed-code.js"></script> <!-- TODO: Place your Font Awesome embed code -->
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700;800&family=Oswald:wght@200;300;400&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://kit.fontawesome.com/0b27183842.css" crossorigin="anonymous">
<title>Document</title>
</head>
<body>
<script src="app.js"></script>
<header class="header">
<div class="container">
<nav id="navbar">
<h1 class="heading1">Patient Referral Form Hayes Valley Health San Francisco </h1>
</nav>
</div>
</header>
<h2 class="iki">Referral Patients</h2>
<h3 class="uc">You can add up to five patients at a time</h3>
<div class="box">
<div class="box-header">
<div class="b1">
<div class="b11">
1
</div>
</div>
<div class="new">
New Referral
</div>
</div>
<form action="/action_page.php">
<div class="form_inp">
<div class="disflex">
<div class="input-container">
<i class="fa fa-user icon"></i>
<input class="input-field" type="text" placeholder="Username" name="usrnm">
</div>
<div class="input-container">
<i class="fa fa-user icon"></i>
<input class="input-field" type="text" placeholder="Username" name="usrnm">
</div>
</div>
<div class="disflex">
<div class="input-container">
<i class="fa fa-envelope icon"></i>
<input class="input-field" type="text" placeholder="Email" name="email">
</div>
<div class="input-container">
<i class="fa fa-envelope icon"></i>
<input class="input-field" type="text" placeholder="Email" name="email">
</div>
</div>
<div class="disflex">
<div class="input-container">
<i class="fa fa-key icon"></i>
<input class="input-field" type="password" placeholder="Password" name="psw">
</div>
<div class="input-container">
<i class="fa fa-envelope icon"></i>
<input class="input-field" type="text" placeholder="Email" name="email">
</div>
</div>
<div class="full-input-container">
<input class="input-field" type="text" placeholder="Email" name="email">
</div>
<div class="full-input-container">
<input class="input-field" type="text" placeholder="Email" name="email">
</div>
</div>
<button type="submit" class="btn">SEND REFERRALS</button>
</form>
</div>
</body>
</html>
```
| null | CC BY-SA 4.0 | null | 2023-03-03T17:06:55.717 | 2023-03-04T06:58:16.230 | 2023-03-04T06:58:16.230 | 8,782,141 | 8,782,141 | null |
75,630,930 | 2 | null | 43,491,421 | 0 | null | The recyclerview is first laid out to a fixed height if it is wrapped lets say by a ConstraintLayout. Once that occurs it is going to use its own mechanism to recycle rows as you scroll. If you set it not to scroll, well it will do just that and remain recycling rows, so you might only see a few.
The recyclerview needs to be in a container which gives it room to expand without any constraints. So for instance this solution worked for me having my recyclerview wrapped in a RelativeLayout in the middle of a ConstraintLayout.
p.s. If you just copy a solution without understanding how and why, then you are simply hacking.
```
<ScrollView...>
<ConstraintLayout...>
...
<RelativeLayout
android:id="@+id/inventory_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/inventory_title">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/my_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true" />
</RelativeLayout>
...
</ConstraintLayout>
</ScrollView>
```
| null | CC BY-SA 4.0 | null | 2023-03-03T19:01:16.833 | 2023-03-03T19:07:03.547 | 2023-03-03T19:07:03.547 | 2,184,088 | 2,184,088 | null |
75,631,080 | 2 | null | 48,225,854 | 0 | null | You can use `plot(...,legend.mar = 0)`.
| null | CC BY-SA 4.0 | null | 2023-03-03T19:19:06.360 | 2023-03-03T19:19:06.360 | null | null | 20,736,205 | null |
75,631,067 | 2 | null | 31,254,523 | 0 | null | If you don't mind using PHP, here are two functions that work together to create multiple footnotes. These do about what Andie2302 suggests but do most of the work for you.
You can hover over the footnote number to pop up a tooltip with the footnote text. You can click the footnote to jump to the original reference.
To create a footnote, insert the following where you want the original reference:
```
<?php footnote("Your footnote text") ?>
```
Put the following at the bottom of the page (before the closing body tag):
```
<?php PrintFootnotes(); ?>
```
Here are the functions. Put this at the top of your document:
```
<?php
function footnote($footnote){
global $Footnotes, $FootnoteCount;
$FootnoteCount++;
$Footnotes[$FootnoteCount] = "$footnote";
print "<a name='$FootnoteCount' title=\"$footnote\" style='font-size: smaller;'><sup>$FootnoteCount</sup></a>";
}
function PrintFootnotes(){
global $Footnotes, $FootnoteCount;
print "—————————<br>";
print "<table>";
for($i = 1;$i < $FootnoteCount + 1;$i++){
print "<tr><td style='vertical-align: top; font-size: smaller;'><sup>$i</sup></td><td><a href='#$i' style='color: black;
text-decoration: none; font-size: smaller;'>$Footnotes[$i]</a></td></tr>";
}
print "</table>";
}
?>
```
Your page name extension must be .php, not .html (the server will render the HTML code normally). You can use .phtml if your server supports it. Otherwise, all you have to do is add the functions and the other code as explained above.
For details on how the functions work, go to:
[https://vocademy.net/textbooks/WebDatabase/Footnotes/PageSetup.php?CourseDirectory=WebDatabase&Page=3&FileName=PHPFootnotes](https://vocademy.net/textbooks/WebDatabase/Footnotes/PageSetup.php?CourseDirectory=WebDatabase&Page=3&FileName=PHPFootnotes)
These functions use about the minimum code required to make them work. You may want to add more formatting, etc. For example, you may want to add brackets around your reference numbers. Modify the print line in the first footnote function as follows to do that:
```
print "<a name='$FootnoteCount' title=\"$footnote\" style='font-size: smaller;'><sup>[$FootnoteCount]</sup></a>";
```
| null | CC BY-SA 4.0 | null | 2023-03-03T19:18:05.523 | 2023-03-03T20:05:32.383 | 2023-03-03T20:05:32.383 | 21,161,663 | 21,161,663 | null |
75,631,112 | 2 | null | 26,525,255 | 0 | null | DJV's recommendation seems like it was correct at the time, but has been depreciated. Try this instead:
```
ggplot(a, aes(x=name, y=count, color=location, shape=type)) +
geom_point(size=7) +
guides(shape="none")
```
I used it for color, so I appreciate the tip. (below)
```
ggplot(a, aes(x=name, y=count, color=location, shape=type)) +
geom_point(size=7) +
guides(col="none")
```
| null | CC BY-SA 4.0 | null | 2023-03-03T19:22:51.380 | 2023-03-03T19:22:51.380 | null | null | 13,112,683 | null |
75,631,266 | 2 | null | 75,631,124 | -1 | null | You need to pass valid token id in order to connect to API.
| null | CC BY-SA 4.0 | null | 2023-03-03T19:40:57.983 | 2023-03-03T19:40:57.983 | null | null | 13,597,511 | null |
75,631,306 | 2 | null | 75,631,290 | 1 | null | You should remove the "+" and replace by "," in your ggplot formula list :
```
library(ggparty)
#> Loading required package: ggplot2
#> Loading required package: partykit
#> Loading required package: grid
#> Loading required package: libcoin
#> Loading required package: mvtnorm
sp_o <- partysplit(1L, index = 1:3)
n1 <-
partynode(id = 1L,
split = sp_o,
kids = lapply(2L:4L, partynode))
t2 <- party(
n1,
data = WeatherPlay,
fitted = data.frame(
"(fitted)" = fitted_node(n1, data = WeatherPlay),
"(response)" = WeatherPlay$play,
check.names = FALSE
),
terms = terms(play ~ ., data = WeatherPlay)
)
ggparty(t2) +
geom_edge() +
geom_edge_label() +
geom_node_splitvar() +
# pass list to gglist containing all ggplot components we want to plot for each
# (default: terminal) node
geom_node_plot(gglist = list(
geom_bar(aes(x = "", fill = play),
position = position_fill()),
xlab("play") ,
scale_fill_manual(values = c("lightblue", "blue"))
))
```
| null | CC BY-SA 4.0 | null | 2023-03-03T19:47:24.190 | 2023-03-03T19:47:24.190 | null | null | 8,214,946 | null |
75,631,527 | 2 | null | 75,629,413 | 1 | null | I have adjusted your code a bit as I wasn't sure if I was allowed to change both tables at the same time or if you might place certain things in between those tables so I made an extra sub to make it shorter(ish). This will make sure it only affects the cells it had prior to the resize (since you're only resizing the rows, the columns remain the same)
```
Sub clearRowsAfterResizing()
Dim Tbl_2 As ListObject
Dim Tbl_1 As ListObject
Dim Tbl_3 As ListObject
Dim ws As Worksheet
Set ws = ActiveWorkbook.Worksheets("Test2")
Set Tbl_1 = ws.ListObjects("TableQuery")
Set Tbl_2 = ws.ListObjects("Table2")
Set Tbl_3 = ws.ListObjects("Table3")
changeSize Tbl_2, Tbl_1, ws
changeSize Tbl_3, Tbl_1, ws
End Sub
Sub changeSize(tblAdjust As ListObject, tblChanged As ListObject, ws As Worksheet)
Dim lRow As Long, dif As Long, sCol As Long, lCol As Long
lRow = tblAdjust.Range.Rows(tblAdjust.Range.Rows.Count).Row
dif = tblAdjust.Range.Rows.Count - tblChanged.Range.Rows.Count
If tblAdjust.Range.Rows.Count <> tblChanged.Range.Rows.Count Then
tblAdjust.Resize tblAdjust.Range.Resize(tblChanged.Range.Rows.Count)
If dif > 0 Then
sCol = tblAdjust.Range.Columns(1).Column
lCol = tblAdjust.Range.Columns(tblAdjust.Range.Columns.Count).Column
With ws
.Range(.Cells(lRow - dif + 1, sCol), .Cells(lRow, lCol)).Clear
End With
End If
End If
End Sub
```
Hope this helps, if you have any questions feel free to ask :)
| null | CC BY-SA 4.0 | null | 2023-03-03T20:16:35.393 | 2023-03-03T20:16:35.393 | null | null | 19,353,309 | null |
75,631,601 | 2 | null | 75,626,053 | 0 | null | If I understand correctly you have a factor that has 0 occurrences at one level.?
If so a workaround might be to just remove that specific level before plotting the variables
```
#Create factor variable with 0 occurrences of one level
dta <- data.frame(
group <- as.factor(sample(c(1, 2, 3, 4), 50, replace = TRUE))
)
dta$group <- factor(dta$group, levels = c('1', '2', '3', '4', '5'))
#Drop the level with 0 occurrences
dta$group <- factor(dta$group)
```
| null | CC BY-SA 4.0 | null | 2023-03-03T20:27:36.460 | 2023-03-03T20:27:36.460 | null | null | 17,579,093 | null |