Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
sequence |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
74,774,258 | 2 | null | 74,773,870 | 0 | null | You can do that by specifying the area of the divs. Check the snippet bellow.
```
.your_main_class {
display: grid;
grid-template-columns: repeat(12, 1fr);
grid-template-rows: repeat(3, 1fr);
}
.image{
grid-area: 1 / 1 / 3 / 6;
background: red;
}
.pagination{
grid-area: 3 / 1 / 4 / 6;
background: blue;
}
.content{
grid-area: 1 / 6 / 4 / 13;
background: black;
}
```
```
<div class="your_main_class">
<div class="image"> </div>
<div class="pagination"> </div>
<div class="content"> </div>
</div>
```
| null | CC BY-SA 4.0 | null | 2022-12-12T16:29:23.897 | 2022-12-12T16:29:23.897 | null | null | 16,642,812 | null |
74,774,265 | 2 | null | 74,757,506 | 1 | null | Returning to answer my own question here. After doing some more testing based on helpful comments I received from @mosc9575 and @bigreddot, I determined that the size of my dataset is the reason for Bokeh failing to display the map. I used a single point first, and then a small slice of my dataframe - and the map displayed just fine.
I hope this is helpful to someone else at some point!
Thanks to everyone who assisted.
| null | CC BY-SA 4.0 | null | 2022-12-12T16:29:49.690 | 2022-12-12T16:29:49.690 | null | null | 14,034,486 | null |
74,774,318 | 2 | null | 74,773,782 | 1 | null |
## The Condition
The condition:
```
while {1 == [string equal $result Completed]} {
```
could be written more shortly as:
```
while {$result eq "Completed"} {
```
That is, it means "do the body while `$result` is equal to the literal string `Completed`.
## The Body
The body of the loop calls `$mode run` (what exactly that does isn't described here). Then it gets the result by calling `$mode getRunResult` and extracts the first word of the list, and assigns it to the variable `result`. The final step of the loop is to use `switch` to print a message whenever `$result` is either `Error` or `SolverFailure` (it also has clauses for `Completed` and `StopCritera`, but that's empty so nothing happens).
## The Overall Effect
The loop calls `$mode run` until the first word of the result of `$mode getRunResult` after that run is not `Completed`.
`$mode` is a handle returned by `pw::Application begin ExtrusionSolver $block`, and `$mode end` is called after the loop terminates, presumably to clean things up.
| null | CC BY-SA 4.0 | null | 2022-12-12T16:34:38.797 | 2022-12-12T16:34:38.797 | null | null | 301,832 | null |
74,774,925 | 2 | null | 74,720,677 | 0 | null | [](https://i.stack.imgur.com/LgYZb.png)
I find solution , when i update glibc to version 2.29
serial0 from ttyS0 to ttyAMA0 , so i change
[](https://i.stack.imgur.com/7k8LG.png)
and it work!
| null | CC BY-SA 4.0 | null | 2022-12-12T17:22:42.623 | 2022-12-16T12:45:35.300 | 2022-12-16T12:45:35.300 | 5,601,169 | 9,092,386 | null |
74,774,931 | 2 | null | 30,128,863 | 0 | null | I'm posting this answer in case it will help someone who, like me, missed an important clue as to the cause of the phantom breakpoint behavior. In my case, it was "user error" --mine. The root cause was a forgotten "debugger;" statement in a JavaScript file that was itself generated from TypeScript. I had removed the debugger; statement from TypeScript locally, run and tested without issue from localhost. But I had pushed the version with the statement to remote and it built and released to our dev site with the statement present. The dev site build excludes the TypeScript source files. When the debugger statement was hit, Chrome tried to load the .ts source and displayed "Could not load content..." I just assumed it was at a breakpoint (I'd set many during testing). And when I saw "No breakpoint" I assumed Chrome was experiencing the issue addressed in this thread. If I'd bothered to look in the Call Stack trace, I would have seen the source code line in the .ts file and pretty quickly figured it out. Here's a screenshot:
[](https://i.stack.imgur.com/Tn43F.png)
| null | CC BY-SA 4.0 | null | 2022-12-12T17:23:01.580 | 2022-12-12T17:23:01.580 | null | null | 5,850,062 | null |
74,775,088 | 2 | null | 26,080,929 | 0 | null | In Xcode 14 I clicked "Clean" command which had popped up in the 3rd row from the top and that fixed it.
| null | CC BY-SA 4.0 | null | 2022-12-12T17:34:55.377 | 2022-12-12T17:34:55.377 | null | null | 746,100 | null |
74,775,258 | 2 | null | 74,774,962 | 2 | null | You have enough information to solve it:
```
Sum of series = a + a*r + a*(r^2) ... + a*(r^(n-1))
= a*((r^n)-1)/(r-1)
= a*((last element * r) - 1)/(r-1)
```
Given the sum of series, `a`, and the last element, you can use the above equation to find the value of `r`.
Plugging in values for the given example:
```
50 = 1 * ((15*r)-1) / (r-1)
50r - 50 = 15r - 1
35r = 49
r = 1.4
```
Then, using `sum of series = a*((r^n)-1)/(r-1)`:
```
50 = 1*((1.4^n)-1)(1.4-1)
21 = 1.4^n
n = log(21)/log(1.4) = 9.04
```
You can approximate `n` and recalculate `r` if `n` isn't an integer.
| null | CC BY-SA 4.0 | null | 2022-12-12T17:48:44.747 | 2022-12-12T17:48:44.747 | null | null | 9,350,720 | null |
74,775,400 | 2 | null | 74,753,659 | 0 | null | Try passing a string that's really just a floating-point number to the Python `float()` function:
```
f1 = float('0.1')
print(f1)
```
It works.
Try passing a string that's not just a floating-point number, but is instead some sort of array or list representation with multiple numbers separated by other punctuation:
```
f2 = float('[0.1, 0.2]')
print(f2)
```
You'll get the same error as you're asking about. That string, `'[0.1, 0.2]'` is not a representation of a floating-point number that `float()` can read.
You should look for a function that can read a string like `'[0.1, 0.2]'`. Can you see the code that wrote the `Vectorized data.csv` file? (Did you write that code, or that file?)
You'll want to use some function that does the reverse of whatever wrote that column of the file.
| null | CC BY-SA 4.0 | null | 2022-12-12T17:59:54.257 | 2022-12-12T17:59:54.257 | null | null | 130,288 | null |
74,775,644 | 2 | null | 74,774,962 | 2 | null | We have to reconstruct geometric progesssion, i.e. obtain `a, q, m` (here `^` means ):
```
a, a * q, a * q^2, ..., a * q^(m - 1)
```
if we know `first, last, total`:
```
first = a # first item
last = a * q^(m - 1) # last item
total = a * (q^m - 1) / (q - 1) # sum
```
Solving these equation we can find
```
a = first
q = (total - first) / (total - last)
m = log(last / a) / log(q)
```
if you want to get of items `n`, note that `n == m + 1`
Code:
```
import math
...
def Solve(first, last, total):
a = first
q = (total - first) / (total - last)
n = math.log(last / a) / math.log(q) + 1
return (a, q, n);
```
[Fiddle](https://www.mycompiler.io/view/LdlN965pnM5)
If you put your data (`1`, `15`, `50`) you'll get the solution
```
a = 1
q = 1.4
n = 9.04836151801382 # not integer
```
since `n` is not an integer you, probably want to adjust; let `last == 15` be exact, when `total` can vary. In this case `q = (last / first) ^ (1 / (n - 1))` and `total = first * (q ^ n - 1) / (q - 1)`
```
a = 1
q = 1.402850552006674
n = 9
total = 49.752 # now n is integer, but total <> 50
```
| null | CC BY-SA 4.0 | null | 2022-12-12T18:21:45.213 | 2022-12-12T19:38:47.973 | 2022-12-12T19:38:47.973 | 2,319,407 | 2,319,407 | null |
74,775,869 | 2 | null | 74,775,824 | 1 | null | Try add
```
else
{
btnRemoveToCart.Visible = true;
}
```
| null | CC BY-SA 4.0 | null | 2022-12-12T18:43:58.867 | 2022-12-12T18:43:58.867 | null | null | 7,962,712 | null |
74,775,901 | 2 | null | 74,775,824 | 4 | null | It's not enough to set it to `false` if you don't want it to show. You also need to set it to `true` when you want to see it again. But you can write one line that does both:
```
btnRemoveToCart.Visible = (lbxCart.Items.Count > 0);
```
Now we also no longer need the `if()` check.
| null | CC BY-SA 4.0 | null | 2022-12-12T18:45:55.537 | 2022-12-12T18:45:55.537 | null | null | 3,043 | null |
74,776,005 | 2 | null | 70,177,626 | 0 | null | Have you applied high pass filter of 0.5 Hz already? Consider doing that first, then try cleanline with tweaked parameters (the ones that give the best outcome) followed by ICA.
| null | CC BY-SA 4.0 | null | 2022-12-12T18:55:37.337 | 2022-12-12T18:55:37.337 | null | null | 1,158,578 | null |
74,776,024 | 2 | null | 25,587,713 | 0 | null | I have solved this problem with using these codes
```
private let profileAvatarImageView: UIImageView = {
let imageView = UIImageView()
imageView.clipsToBounds = true
imageView.layer.masksToBounds = true
imageView.layer.cornerRadius = imageView.frame.width/2
imageView.translatesAutoresizingMaskIntoConstraints = false
imageView.image = UIImage(systemName: "person")
imageView.backgroundColor = .black
imageView.layer.borderWidth = 2.0
imageView.layer.borderColor = UIColor.black.cgColor
return imageView
}()
```
| null | CC BY-SA 4.0 | null | 2022-12-12T18:57:42.173 | 2022-12-12T18:57:42.173 | null | null | 19,995,427 | null |
74,776,061 | 2 | null | 74,592,572 | 1 | null | As discussed [here](https://github.com/jfree/jfreechart/discussions/327), one way to get the desired axis markings is to add a [SymbolAxis](https://www.jfree.org/jfreechart/javadoc/org/jfree/chart/axis/SymbolAxis.html) on the right, as illustrated [here](https://stackoverflow.com/a/13466183/230513) and below. In addition,
- The axis/plot overlap may reflect the use of `RectangleInsets` in `setAxisOffset()`, omitted below; a third domain marker is shown instead.- Tick mark position support is provided by [DataAxis](https://www.jfree.org/jfreechart/javadoc/org/jfree/chart/axis/DateAxis.html) and `DateTickMarkPosition`.- Instead of padding titles with spaces, use `setPadding()`, seen [here](https://stackoverflow.com/q/38484591/230513) and below.- Adjust the chart's overall size as shown [here](https://stackoverflow.com/a/10277372/230513).- In a Swing context, construct and manipulate GUI objects on the [event dispatch thread](https://docs.oracle.com/javase/tutorial/uiswing/concurrency/initial.html).
[](https://i.stack.imgur.com/HHQ3T.png)
```
import java.awt.BasicStroke;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.Stroke;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Locale;
import javax.swing.JFrame;
import javax.swing.JPanel;
import org.jfree.chart.ChartColor;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.annotations.XYLineAnnotation;
import org.jfree.chart.axis.AxisLocation;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.axis.SymbolAxis;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.plot.ValueMarker;
import org.jfree.chart.plot.XYPlot;
import org.jfree.chart.renderer.xy.XYItemRenderer;
import org.jfree.chart.title.TextTitle;
import org.jfree.data.xy.XYSeries;
import org.jfree.data.xy.XYSeriesCollection;
import org.jfree.chart.ui.HorizontalAlignment;
import org.jfree.chart.ui.Layer;
import org.jfree.chart.ui.RectangleEdge;
/**
* @see https://stackoverflow.com/q/74592572/230513
* @see https://github.com/jfree/jfreechart/discussions/327
*/
public class GitHub327 {
public static void main(String[] args) {
EventQueue.invokeLater(() -> {
PlotWindow pw = new PlotWindow();
pw.setLocationRelativeTo(null);
pw.setVisible(true);
});
}
private static class PlotWindow extends JFrame {
final double t_init = 0;
final double step = 0.1;
final double t_fin = 10;
int lengthValues;
double[] yValues;
double[] xValues;
//params
double Fmax = 5;
double Tau = 3;
double alpha = 3;
double deltaX;
public PlotWindow() {
super("Test JFreechart");
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLocationRelativeTo(null);
// x y values
this.lengthValues = (int) ((this.t_fin - t_init) / this.step) + 1;
this.setTimeValues();
this.computeDeltaX();
this.setForceValues();
this.add(createChartPanel(), BorderLayout.CENTER);
this.pack();
}
private void setTimeValues() {
this.xValues = new double[this.lengthValues];
for (int i = 0; i < this.lengthValues; ++i) {
this.xValues[i] = this.t_init + i * this.step;
}
}
private void computeDeltaX() {
this.deltaX = Math.sqrt(-this.Tau * Math.log(this.alpha / (1 + this.alpha)));
}
private void setForceValues() {
this.yValues = new double[lengthValues];
for (int i = 0; i < lengthValues; ++i) {
double A = this.Fmax * (1 + 1 / this.alpha);
double B = 1 - Math.exp(-Math.pow(this.xValues[i] - this.deltaX, 2) / this.Tau);
this.yValues[i] = A * B - this.Fmax / this.alpha;
}
}
private XYSeriesCollection createDataset() {
boolean autoSort = false;
boolean allowDuplicateXValues = false;
XYSeriesCollection dataset = new XYSeriesCollection();
XYSeries series1 = new XYSeries("", autoSort, allowDuplicateXValues);
for (int i = 0; i < lengthValues; ++i) {
series1.add(this.xValues[i], this.yValues[i]);
}
dataset.addSeries(series1);
var series2 = new XYSeries("S");
dataset.addSeries(series2);
return dataset;
}
private JPanel createChartPanel() {
String chartTitle = "Wetting balance curve";
String xAxisLabel = "X";
String yAxisLabel = "Y";
XYSeriesCollection dataset = createDataset();
JFreeChart chart = ChartFactory.createXYLineChart(chartTitle,
xAxisLabel, yAxisLabel, dataset, PlotOrientation.VERTICAL, false, true, false);
XYPlot plot = chart.getXYPlot();
//title
TextTitle tt = new TextTitle();
tt.setText("C:\\MENISCO ST60\\Mesures\\22-5912-100.PM1");
tt.setPaint(Color.BLUE);
tt.setFont(new Font("SansSerif", Font.PLAIN, 12));
tt.setPadding(8, 8, 8, 8);
chart.setTitle(tt);
// norm subtitle
TextTitle normtt = new TextTitle("Norme : J-STD-002E");
normtt.setFont(new Font("SansSerif", Font.BOLD, 12));
normtt.setPosition(RectangleEdge.BOTTOM);
normtt.setPaint(Color.BLACK);
normtt.setHorizontalAlignment(HorizontalAlignment.LEFT);
normtt.setPadding(0, 16, 8, 0);
chart.addSubtitle(normtt);
// fmoy subtitle
TextTitle fmoytt = new TextTitle("Force moyenne à 0.900 S: 0.25mN");
fmoytt.setFont(new Font("SansSerif", Font.PLAIN, 10));
fmoytt.setPosition(RectangleEdge.BOTTOM);
fmoytt.setPaint(Color.BLUE);
fmoytt.setHorizontalAlignment(HorizontalAlignment.LEFT);
fmoytt.setPadding(0, 16, 2, 0);
chart.addSubtitle(fmoytt);
// axis
//domain axis
plot.getDomainAxis().setLowerMargin(0.0);
plot.getDomainAxis().setUpperMargin(0.0);
NumberAxis domain = (NumberAxis) plot.getDomainAxis();
NumberFormat formatterd = DecimalFormat.getInstance();
formatterd.setMinimumFractionDigits(0);
domain.setNumberFormatOverride(formatterd);
domain.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
domain.setTickMarksVisible(false);
//domain.setAxisLineVisible(false);
//range axis
plot.getRangeAxis().setLabelAngle(Math.PI / 2);
NumberAxis range = (NumberAxis) plot.getRangeAxis();
NumberFormat formatter = DecimalFormat.getInstance(Locale.ENGLISH);
formatter.setMinimumFractionDigits(2);
range.setNumberFormatOverride(formatter);
plot.getRangeAxis().setAxisLineStroke(new BasicStroke(1.5f));
plot.getRangeAxis().setAxisLinePaint(Color.BLUE);
plot.getRangeAxis().setTickMarksVisible(true);
plot.getRangeAxis().setTickMarkPaint(Color.BLACK);
plot.getRangeAxis().setTickMarkStroke(new BasicStroke(1.5f));
float lg = plot.getRangeAxis().getTickMarkOutsideLength();
plot.getRangeAxis().setTickMarkInsideLength(lg);
plot.getRangeAxis().setRange(-3, 6);
// background;gridline;outline
//plot.setAxisOffset(new RectangleInsets(0, 0, 0, 0));
plot.setDomainGridlinePaint(Color.DARK_GRAY);
plot.setRangeGridlinePaint(Color.DARK_GRAY);
plot.setBackgroundPaint(Color.white);
plot.setOutlineStroke(plot.getDomainGridlineStroke()); //dashed outline
plot.setOutlinePaint(Color.DARK_GRAY);
XYItemRenderer renderer = plot.getRenderer();
renderer.setSeriesPaint(0, ChartColor.VERY_DARK_GREEN); // set green color to the xyline
// vertical lines
ValueMarker marker0 = new ValueMarker(0.2, Color.MAGENTA, new BasicStroke(1.5f)); // position is the value on the axis
ValueMarker marker1 = new ValueMarker(1, Color.MAGENTA, new BasicStroke(1.5f));
ValueMarker marker2 = new ValueMarker(4, Color.GREEN, new BasicStroke(1.5f)); // position is the value on the axis
plot.addDomainMarker(marker0, Layer.FOREGROUND);
plot.addDomainMarker(marker1, Layer.FOREGROUND);
plot.addDomainMarker(marker2, Layer.FOREGROUND);
var marker3 = new ValueMarker(10, Color.GREEN, new BasicStroke(1.5f));
plot.addDomainMarker(marker3, Layer.FOREGROUND);
//horizontal lines
XYLineAnnotation line = new XYLineAnnotation(0, 4, 10, 4, new BasicStroke(2.0f), Color.green);
plot.addAnnotation(line);
XYLineAnnotation line0 = new XYLineAnnotation(0, 0, 10, 0, new BasicStroke(1.0f), Color.BLUE);
plot.addAnnotation(line0);
//dashed horizontal line
float[] dash = {10.0f, 3.0f, 3.0f};
Stroke dashed = new BasicStroke(1.0f, BasicStroke.CAP_BUTT,
BasicStroke.JOIN_MITER, 10.0f, dash, 0.0f);
XYLineAnnotation line1 = new XYLineAnnotation(0, -1, 10, -1, dashed, Color.MAGENTA);
plot.addAnnotation(line1);
//right side axis
String[] syms = new String[]{"", "", "", "t(s)", "", "", "", "4.0", "", ""};
var range2 = new SymbolAxis("", syms);
range2.setGridBandsVisible(false);
plot.setRangeAxis(1, range2);
plot.setRangeAxisLocation(1, AxisLocation.BOTTOM_OR_RIGHT);
plot.mapDatasetToRangeAxis(1, 0);
return new ChartPanel(chart) {
@Override
public Dimension getPreferredSize() {
return new Dimension(640, 480);
}
};
}
}
}
```
| null | CC BY-SA 4.0 | null | 2022-12-12T19:01:25.243 | 2022-12-12T19:01:25.243 | null | null | 230,513 | null |
74,776,614 | 2 | null | 26,591,960 | 0 | null | You can use pseudo-class `:has(child)`
so:
```
.name:has(.input-name:focus-visible) {
background:#f00;
}
```
| null | CC BY-SA 4.0 | null | 2022-12-12T19:52:58.203 | 2022-12-12T19:52:58.203 | null | null | 20,760,020 | null |
74,776,682 | 2 | null | 74,775,470 | 1 | null | Wrap your query within a subquery as the following:
```
Select ID ,Cat1 ,Cat2 ,Month ,[Order]
From
(
Select ID, Cat1 ,Cat2 ,Month ,[Order],
MAX([Order]) Over (Partition By [Cat1],[Cat2],[Month]) As max_ord
From table_name
) T
Where [order] = max_ord
Order By ID
```
Or, you could give it a try with CTE:
```
With CTE As
(
Select ID, Cat1 ,Cat2 ,Month ,[Order],
MAX([Order]) Over (Partition By [Cat1],[Cat2],[Month]) As max_ord
From table_name
)
Select ID ,Cat1 ,Cat2 ,Month ,[Order]
From CTE
Where [order] = max_ord
Order By ID
```
See [demo](https://dbfiddle.uk/xsvNdryR).
| null | CC BY-SA 4.0 | null | 2022-12-12T19:59:21.913 | 2022-12-12T19:59:21.913 | null | null | 12,705,912 | null |
74,776,692 | 2 | null | 74,776,587 | 2 | null | Try the ymd_hms function in the lubridate package.
```
output$datetime <- ymd_hms(paste(input$year, input$month, input$day,
input$HH, input$MM, input$SS, sep="-"))
```
You can enter 00 if you don't have seconds, for example ....
| null | CC BY-SA 4.0 | null | 2022-12-12T20:01:09.983 | 2022-12-12T22:40:52.140 | 2022-12-12T22:40:52.140 | 13,972,333 | 10,011,427 | null |
74,776,688 | 2 | null | 74,774,962 | 1 | null | You have to solve the following two equations for `r` and `n`:
```
a:= An / Ao = r^(n - 1)
```
and
```
s:= Sn / Ao = (r^n - 1) / (r - 1)
```
You can eliminate `n` by
```
s = (r a - 1) / (r - 1)
```
and solve for `r`. Then `n` follows by `log(a) / log(r) + 1`.
---
In your case, from `s = 50` and `a = 15`, we obtain `r = 7/5 = 1.4` and `n = 9.048...`
It makes sense to round `n` to `9`, but then `r^8 = 15` (`r ~ 1.40285`) and `r = 1.4` are not quite compatible.
| null | CC BY-SA 4.0 | null | 2022-12-12T20:00:28.920 | 2022-12-13T07:50:40.660 | 2022-12-13T07:50:40.660 | null | null | null |
74,776,701 | 2 | null | 74,776,587 | 0 | null | Base R does not have a class for just "time" (of day), `as.POSIXct` doesn't deal with "times", it deals with "date-times". The `lubridate::` package does give number-like HMS values, which may be relevant, but since each row has both date and time, it seems relevant to combine them instead of putting them into separate columns.
```
CPLF_data |>
transform(
StartTime = as.numeric(StartTime),
Date = as.numeric(Date)
) |>
transform(
DateTime = ISOdate(
2000 + Date %/% 10000, (Date %% 10000) %/% 100, Date %% 100,
StartTime %/% 10000, (StartTime %% 10000) %/% 100, StartTime %% 100)
)
# StartTime Date DateTime
# 1 93537 220703 2022-07-03 09:35:37
```
Note: I'm assuming that all years are 2-digits and at/after 2000. If this is not true, it's not difficult to work around it with some custom code. Also, over to you if you want to set the timezone of this timestamp by adding `tz="US/Mountain"` or whichever is more appropriate for the data.
---
Data
```
CPLF_data <- data.frame(StartTime = "93537", Date = "220703")
```
| null | CC BY-SA 4.0 | null | 2022-12-12T20:02:45.830 | 2022-12-12T20:02:45.830 | null | null | 3,358,272 | null |
74,776,860 | 2 | null | 74,776,587 | 2 | null | Use chron `times` class to get the times or if a character string is wanted use as.character on that. Use `as.Date` to get a `Date` class object. The `sub` puts colons between the parts of the time after which we can convert it to `times` class. The `sprintf` pads the date with 0 on the left if it is only 5 characters and otherwise leaves it as 6 characters and then we convert that to `Date` class.
```
library(chron)
time <- 93537
date <- 220703
tt <- times(sub("(..)(..)$", ":\\1:\\2", time))
tt
## [1] "09:35:37"
as.character(tt)
## [1] "09:35:37"
dd <- as.Date(sprintf("%06d", date), "%y%m%d")
dd
## [1] "2022-07-03"
as.character(dd)
## [1] "2022-07-03"
```
| null | CC BY-SA 4.0 | null | 2022-12-12T20:20:02.773 | 2022-12-12T22:14:11.847 | 2022-12-12T22:14:11.847 | 516,548 | 516,548 | null |
74,777,144 | 2 | null | 74,773,870 | 0 | null | Based on the response to a previous awnser here i have tried to make the changes that are being looked for.
From what i can gather you are describing 3 total elements Image, Pagination, Content
of these 3 total elements you would like
- - -
To do this we can still use grid we just need to specify different values for our template which I have done below. The key here is min-content
```
html body{
margin: 0px;
padding: 0px;
}
.your_main_class {
width: 100vw;
height: 100vh;
display: grid;
grid-template-columns: 50vw 50vw;
grid-template-rows: 1fr min-content;
grid-template-areas: "image cont"
"pagination cont";
}
div{
height: 100%;
width: 100%;
}
.image{
grid-area: image;
background: red;
}
.pagination{
grid-area: pagination;
background: blue;
}
.content{
grid-area: cont;
background: black;
}
```
```
<div class="your_main_class">
<div class="image"> Image </div>
<div class="pagination"> Pagination </div>
<div class="content"> content </div>
</div>
```
| null | CC BY-SA 4.0 | null | 2022-12-12T20:49:08.723 | 2022-12-12T20:49:08.723 | null | null | 19,156,156 | null |
74,777,437 | 2 | null | 74,748,817 | 0 | null | A sensitivity study reveals that the optimal solution is to maximize the temperature. The problem with the code in your question is the selection of `IMODE=9`. Use `IMODE=6` with less time points for a more reliable solution. The sequential optimization mode (9) is not as reliable as the simulataneous mode (6).
Here is a simulation at different temperatures with the temperature status off.
```
T.STATUS = 0
```
[](https://i.stack.imgur.com/KlF0r.png)
The simulation sensitivity study shows that there is an effect of temperature on the final objective. Using `T.STATUS=1` with different initial conditions also reveals that higher temperature gives a more optimal solution. The only effect of the initial condition is that it requires one or two steps to get up to the maximum allowable temperature.
[](https://i.stack.imgur.com/TZUzd.png)
```
import numpy as np
import matplotlib.pyplot as plt
from gekko import GEKKO
m = GEKKO()
nt = 101
m.time = np.linspace(0,100,nt)
# Parameters
T = m.MV(value=321,ub=338,lb=298)
T.STATUS = 1
T.DCOST = 0 #0.01
T.DMAX = 20
# Variables
CTG = m.Var(value=0.3226)
CDG = m.Var(value=0)
CMG = m.Var(value=0)
CE = m.Var(value=0)
CA = m.Var(value=1.9356)
CG = m.Var(value=0)
p = np.zeros(nt)
p[-1] = 1.0
final = m.Param(value=p)
# Intermediates
k1 = m.Intermediate(3.92e7*m.exp(-6614.83/T))
k2 = m.Intermediate(5.77e5*m.exp(-4997.98/T))
k3 = m.Intermediate(5.88e12*m.exp(-9993.96/T))
k4 = m.Intermediate(0.98e10*m.exp(-7366.64/T))
k5 = m.Intermediate(5.35e3*m.exp(-3231.18/T))
k6 = m.Intermediate(2.15e4*m.exp(-4824.87/T))
# Equations
m.Equation(CTG.dt()== -k1*CTG*CA + k2*CDG*CE)
m.Equation(CDG.dt()== k1*CTG*CA - k2*CDG*CE - k3*CDG*CA + k4*CMG*CE)
m.Equation(CMG.dt()== k3*CDG*CA - k4*CMG*CE - k5*CMG*CA + k6*CG*CE)
m.Equation(CE.dt()== k1*CTG*CA - k2*CDG*CE + k3*CDG*CA - k4*CMG*CE + k5*CMG*CA - k6*CG*CE)
m.Equation(CA.dt()== -CE.dt())
m.Equation(CG.dt()== k5*CMG*CA - k6*CG*CE)
# Objective Function
m.Maximize(CE*final)
m.options.IMODE=6
m.options.NODES=3
m.options.SOLVER=3
plt.figure()
m.options.TIME_SHIFT=0
for Ti in [300,305,310,315,320,325,330,335]:
T.value=Ti
m.solve(disp=False)
plt.subplot(2,1,1)
plt.plot(m.time,CE.value,lw=2,label=r'$C_E$ @ $T_0$='+str(Ti))
plt.subplot(2,1,2)
plt.plot(m.time,T.value,lw=2,label=r'$T$ @ $T_0$='+str(Ti))
print(Ti,'K Objective: ' + str(CE[-1]))
plt.ylabel('Value')
plt.legend(loc='best')
plt.xlabel('Time')
plt.show()
```
I would recommend that you feed in the optimal solution that comes from the publication as an initial guess to see if that improves the optimization result. There may be a difference in equations or objective function that gives the different results.
| null | CC BY-SA 4.0 | null | 2022-12-12T21:19:27.640 | 2022-12-12T21:19:27.640 | null | null | 2,366,941 | null |
74,778,309 | 2 | null | 67,739,782 | 0 | null | This is basically a PCA plot. The 73% means that the component of the PC(principal component) accounts for 73% of the total variation. The second PC accounts for 22.9% of the variation. So together they can explain 95.9 % variation in the dataset.
| null | CC BY-SA 4.0 | null | 2022-12-12T23:12:03.383 | 2022-12-12T23:12:03.383 | null | null | 20,460,322 | null |
74,778,943 | 2 | null | 28,684,598 | 0 | null | The easiest way to do it is with the `table_print` gem: [http://tableprintgem.com](http://tableprintgem.com)
For example, using the array from the other answer,
```
your_array = [
{date: "2014-12-01", from: "Ferdous", subject: "Homework this week"},
{date: "2014-12-01", from: "Dajana", subject: "Keep on coding! :)"},
{date: "2014-12-02", from: "Ariane", subject: "Re: Homework this week"},
]
tp your_array
```
you would get the following result:
```
DATE | FROM | SUBJECT
-----------|---------|-----------------------
2014-12-01 | Ferdous | Homework this week
2014-12-01 | Dajana | Keep on coding! :)
2014-12-02 | Ariane | Re: Homework this week
```
You can also specify the columns you want to include (as strings or symbols):
```
tp your_array, "subject", :from
```
This is very useful when your array is from an ActiveRecord query, and displaying every single column would make the output unreadable:
```
tp User.all, :full_name, :e-mail_address
```
You can even access related models:
```
tp User.all, :full_name, "posts.title"
```
| null | CC BY-SA 4.0 | null | 2022-12-13T01:01:39.643 | 2022-12-13T01:01:39.643 | null | null | 241,142 | null |
74,779,228 | 2 | null | 74,777,989 | 0 | null | I would try this format:
```
<div id="app">
<v-app>
<v-main>
<v-container class="grey lighten-5">
<v-row no-gutters>
<v-col cols="4" sm="4">
<v-card class="pa-2" outlined tile>
resuiltsd
</v-card>
</v-col>
</v-row>
<v-row no-gutters>
<v-col cols="4" sm="1">
<v-card class="pa-2" outlined tile>
One of
</v-card>
</v-col>
<v-col cols="4" sm="1">
<v-card class="pa-2" outlined tile>
One of
</v-card>
</v-col>
<v-col cols="4" sm="1">
<v-card class="pa-2" outlined tile>
One of
</v-card>
</v-col>
<v-col cols="4" sm="1">
<v-card class="pa-2" outlined tile>
One of
</v-card>
</v-col>
</v-row>
<v-row no-gutters>
<v-col cols="4" sm="1">
<v-card class="pa-2" outlined tile>
One of
</v-card>
</v-col>
<v-col cols="4" sm="1">
<v-card class="pa-2" outlined tile>
One of
</v-card>
</v-col>
<v-col cols="4" sm="1">
<v-card class="pa-2" outlined tile>
One of
</v-card>
</v-col>
<v-col cols="4" sm="1">
<v-card class="pa-2" outlined tile>
One of
</v-card>
</v-col>
</v-row>
<v-row no-gutters>
<v-col cols="4" sm="1">
<v-card class="pa-2" outlined tile>
One of
</v-card>
</v-col>
<v-col cols="4" sm="1">
<v-card class="pa-2" outlined tile>
One of
</v-card>
</v-col>
<v-col cols="4" sm="1">
<v-card class="pa-2" outlined tile>
One of
</v-card>
</v-col>
<v-col cols="4" sm="1">
<v-card class="pa-2" outlined tile>
One of
</v-card>
</v-col>
</v-row>
<v-row no-gutters>
<v-col cols="4" sm="1">
<v-card class="pa-2" outlined tile>
One of
</v-card>
</v-col>
<v-col cols="4" sm="1">
<v-card class="pa-2" outlined tile>
One of
</v-card>
</v-col>
<v-col cols="4" sm="1">
<v-card class="pa-2" outlined tile>
One of
</v-card>
</v-col>
<v-col cols="4" sm="1">
<v-card class="pa-2" outlined tile>
One of
</v-card>
</v-col>
</v-row>
<v-row no-gutters>
<v-col cols="4" sm="1">
<v-card class="pa-2" outlined tile>
One of
</v-card>
</v-col>
<v-col cols="4" sm="1">
<v-card class="pa-2" outlined tile>
One of
</v-card>
</v-col>
<v-col cols="4" sm="1">
<v-card class="pa-2" outlined tile>
One of
</v-card>
</v-col>
<v-col cols="4" sm="1">
<v-card class="pa-2" outlined tile>
One of
</v-card>
</v-col>
</v-row>
</v-container>
</v-main>
</v-app>
</div>
```
| null | CC BY-SA 4.0 | null | 2022-12-13T02:03:05.620 | 2022-12-14T00:47:52.580 | 2022-12-14T00:47:52.580 | 11,707,943 | 11,707,943 | null |
74,780,074 | 2 | null | 74,779,969 | -1 | null | Well, I finally figured it out. I thought to delete this post but others might get into the same issue so I decided not to. So here's how you make it works.
simply remove the "N?" from the query like so:
```
where j.Word = ?
```
also, make this adjustment to your setString statement:
```
stm.setString(1, "N" + searchStr);
```
and voila, that should be it. Thanks for reading my question.
| null | CC BY-SA 4.0 | null | 2022-12-13T04:45:42.860 | 2022-12-13T04:45:42.860 | null | null | 19,174,113 | null |
74,780,230 | 2 | null | 57,053,558 | 0 | null | If You installed everything well and good you have pip and Django set, try this one, in your terminal
```
python -m django startproject NameofProject
```
| null | CC BY-SA 4.0 | null | 2022-12-13T05:08:10.377 | 2022-12-13T05:08:10.377 | null | null | 20,762,806 | null |
74,780,345 | 2 | null | 74,291,380 | 2 | null | Not sure if this would solve the issue on different devices or component versions, but in my case I was able to solve it with `adjustPan` either
via AndroidManifest
```
android:windowSoftInputMode="adjustPan"
```
or programmatically
```
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN)
```
Same code produces this output with `adjustPan`:
[](https://i.stack.imgur.com/PlHR7.gif)
| null | CC BY-SA 4.0 | null | 2022-12-13T05:26:59.943 | 2022-12-13T05:26:59.943 | null | null | 19,023,745 | null |
74,780,383 | 2 | null | 71,591,971 | 1 | null | If you are using pyenv and on Mac M1, then try switching the python from `system` version to a version that is installed already (ex: `pyenv global 3.8.13`, considering 3.8.13 is another version). In order to check what versions installed use `pyenv versions`.
If you don't have another version, try installing a new one and switch to that new environment (ex: `pyenv install 3.8.13`). Then install using pip. Everything should work fine. thats what worked for me.
and make sure your pip and python are aliased to pip3 and python3 respective in the respective terminal configuration file.
| null | CC BY-SA 4.0 | null | 2022-12-13T05:33:10.603 | 2022-12-13T05:34:55.450 | 2022-12-13T05:34:55.450 | 6,041,416 | 6,041,416 | null |
74,780,406 | 2 | null | 55,180,909 | 0 | null | I had the same problem with lots of modules specially pytube . PyQt6 , It was all resolved when I changed my interpreter to python 3.11
| null | CC BY-SA 4.0 | null | 2022-12-13T05:36:53.667 | 2022-12-13T05:36:53.667 | null | null | 19,575,195 | null |
74,780,499 | 2 | null | 74,780,299 | 0 | null | Have you tried `headerStyle` property ? to adjust the height of the calendar header
```
TableCalendar(
headerStyle: HeaderStyle(
height: 50,
.........
```
| null | CC BY-SA 4.0 | null | 2022-12-13T05:52:38.733 | 2022-12-13T05:52:38.733 | null | null | 12,156,289 | null |
74,780,550 | 2 | null | 74,777,230 | 0 | null | > In the Data context class row, select the + (plus) sign
Here's the [tutorial](https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/adding-model?view=aspnetcore-7.0&tabs=visual-studio) which has steps and screenshot... You may follow it.
| null | CC BY-SA 4.0 | null | 2022-12-13T05:59:48.380 | 2022-12-13T05:59:48.380 | null | null | 14,574,199 | null |
74,780,567 | 2 | null | 74,722,611 | 1 | null | It is recommended not to use `v-if` and `v-for` directives together on the same element due to the syntax ambiguity.
As per your code, Computed property `parse` is used to check the length of an array. You can move the v-if to a `container` element (e.g. `ul`).
In template
```
<ul id="planOl" v-if="parse">
<Action v-for="action in store.plan">...</Action>
</ul>
```
Script
```
computed: {
parse() {
return store.plan.length > 0 ? true : false;
}
}
```
| null | CC BY-SA 4.0 | null | 2022-12-13T06:02:04.507 | 2022-12-13T06:02:04.507 | null | null | 4,116,300 | null |
74,780,617 | 2 | null | 42,966,889 | 0 | null | In my case, I was using Spring Framework 6.0.0 and JDK 11 as the same time. This is not supported according to [spring framework wiki](https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-Versions#jdk-version-range). After I degraded the spring framework version to 5.3.24, it solved.
You can check your spring framework version in this way.
[spring framework version](https://i.stack.imgur.com/BCudJ.jpg)
| null | CC BY-SA 4.0 | null | 2022-12-13T06:08:34.127 | 2022-12-13T06:08:34.127 | null | null | 20,763,082 | null |
74,781,426 | 2 | null | 74,459,167 | 1 | null | I can confirm that using a static variable in a transient class will cause this type of memory issue as static variables will not be destroyed with the transient class instance.
| null | CC BY-SA 4.0 | null | 2022-12-13T07:39:39.140 | 2022-12-13T07:39:39.140 | null | null | 4,292,950 | null |
74,781,717 | 2 | null | 74,781,489 | 2 | null | [The instructions](https://pkg.go.dev/golang.org/dl/go1.19) mention:
> ```
$ go install golang.org/dl/go1.19@latest
$ go1.19 download
```
And then use the go1.19 command as if it were your normal go command.
That means `go` still refer to your normal legacy Go (1.18)
You should use `go1.19` to test what you just installed.
---
That being said, as [commented](https://stackoverflow.com/questions/74781489/i-used-go-install-golang-org-dl-go1-19latest-next-my-goroot-has-been-modify?noredirect=1#comment131978701_74781489), if you goal is to just upgrade Go, using the [regular installer](https://go.dev/doc/install) is preferable.
| null | CC BY-SA 4.0 | null | 2022-12-13T08:08:34.937 | 2022-12-13T08:40:55.383 | 2022-12-13T08:40:55.383 | 6,309 | 6,309 | null |
74,782,066 | 2 | null | 19,339,578 | 0 | null | ```
.container > div:nth-child(3n),
.container > div:nth-child(3n-1) {
border-left: 4px solid white;
}
.container > div:nth-child(n + 4) {
border-top: 4px solid white
}
```
Explanation :
This is for a 3 x 3 cells grid
| null | CC BY-SA 4.0 | null | 2022-12-13T08:44:05.870 | 2022-12-13T08:44:05.870 | null | null | 19,973,487 | null |
74,782,216 | 2 | null | 72,804,575 | 1 | null | You can write the custom `UITextFeild`, in which the `intrinsicContentSize` will be overridden.
Example:
```
final class _UITextField: UITextField {
override var intrinsicContentSize: CGSize {
CGSize(width: UIView.noIntrinsicMetric, height: 56)
}
}
```
Then, you can write your own implementation of TextField, using `UIViewRepresentable` protocol and `UITextFieldDelegate`:
```
struct _TextField: UIViewRepresentable {
private let title: String?
@Binding var text: String
let textField = _UITextField()
init(
_ title: String?,
text: Binding<String>
) {
self.title = title
self._text = text
}
func makeCoordinator() -> _TextFieldCoordinator {
_TextFieldCoordinator(self)
}
func makeUIView(context: Context) -> _UITextField {
textField.placeholder = title
textField.delegate = context.coordinator
return textField
}
func updateUIView(_ uiView: _UITextField, context: Context) {}
}
final class _TextFieldCoordinator: NSObject, UITextFieldDelegate {
private let control: _TextField
init(_ control: _TextField) {
self.control = control
super.init()
control.textField.addTarget(self, action: #selector(textFieldEditingChanged), for: .editingChanged)
}
@objc private func textFieldEditingChanged(_ textField: UITextField) {
control.text = textField.text ?? ""
}
}
```
| null | CC BY-SA 4.0 | null | 2022-12-13T08:57:39.520 | 2022-12-13T08:59:22.363 | 2022-12-13T08:59:22.363 | 13,952,651 | 13,952,651 | null |
74,782,265 | 2 | null | 74,781,175 | 0 | null | maybe you can try this code below
```
import {useEffect,useStatus} from 'react'
const Index = ()=>{
const [type, setType] = useStatus(null)
return <form>
<input type="radio" name="type" value="type1" onChange={()=>setType('type1')} />
<input type="radio" name="type" value="type2" onChange={()=>setType('type2')}/>
<br />
{type=='type1' && <input type="text" name="type1input" />}
{type=='type2' && <input type="text" name="type1input" />}
</form>
}
export default Index;
```
| null | CC BY-SA 4.0 | null | 2022-12-13T09:01:37.097 | 2022-12-13T09:01:37.097 | null | null | 16,459,274 | null |
74,782,274 | 2 | null | 62,981,846 | 1 | null | you can use `x = list(x)` to convert the data from numpy.object to float
```
data5 = Us_corr3[['US GDP', 'US Unemployment']]
x = list(data5['US GDP'])
y = list(data5['US Unemployment'])
plt.scatter(x, y)
z = np.polyfit(x, y, 1)
p = np.poly1d(z)
plt.plot(x,p(x),"r--")
plt.show()
```
| null | CC BY-SA 4.0 | null | 2022-12-13T09:01:58.673 | 2022-12-13T09:01:58.673 | null | null | 17,055,802 | null |
74,783,457 | 2 | null | 74,783,229 | 3 | null | Welcome!
There are several different techniques to accomplish this task. One of them is using a combination of [TEXTJOIN()](https://support.microsoft.com/en-us/office/textjoin-function-357b449a-ec91-49d0-80c3-0e8fc845691c) and [IF()](https://support.microsoft.com/en-us/office/if-function-69aed7c9-4e8a-4755-a9bc-aa8bbff73be2) functions in [array formula](https://support.microsoft.com/en-us/office/guidelines-and-examples-of-array-formulas-7d94a64e-3ff3-4686-9372-ecfd5caa57c7):
`{=TEXTJOIN(",";1;IF(J3:J7=MAX(J3:J7);A3:A7;""))}`
| null | CC BY-SA 4.0 | null | 2022-12-13T10:35:47.367 | 2022-12-13T10:35:47.367 | null | null | 14,094,617 | null |
74,783,458 | 2 | null | 61,546,705 | 0 | null | I had the same problem, somewhere in your eventSource.onmessage, the code change MIME type value to `{'content-type': 'application/json'}`, you have to keep it with the value of `{'content-type':'text/event-stream'}`
| null | CC BY-SA 4.0 | null | 2022-12-13T10:35:51.973 | 2022-12-16T07:40:05.420 | 2022-12-16T07:40:05.420 | 2,963,422 | 12,978,351 | null |
74,783,513 | 2 | null | 74,775,236 | 0 | null | You can reduce the vertical spaces using the `lineHeight` property:
```
formatStyle(columns = 1:5, lineHeight='30%')
```
| null | CC BY-SA 4.0 | null | 2022-12-13T10:41:18.607 | 2022-12-13T10:41:18.607 | null | null | 14,137,004 | null |
74,783,605 | 2 | null | 74,782,922 | 1 | null | You cannot do that through the AWS portal as the portal has no insight into what applications you are running on your instance.
You must SSH into your instance, perhaps using `Systems Manager` and check is SQL is installed.
`mysql -V` will allow you to check if MySql is installed, other types of databases will have similar commands.
#### Update based on comment:
As you are installing from a preconfigured OS you can see whats included in the `instance details` tab from the EC2 Web Console.
[](https://i.stack.imgur.com/3ECsi.png)
Or you can run the following command from your CLI:
`aws ec2 describe-instances --instance-id <your instance id> --query 'Reservations[*].Instances[*].PlatformDetails'`
```
[
[
"Windows with SQL Server Standard"
]
]
```
| null | CC BY-SA 4.0 | null | 2022-12-13T10:48:06.287 | 2022-12-13T11:56:50.120 | 2022-12-13T11:56:50.120 | 7,909,676 | 7,909,676 | null |
74,784,096 | 2 | null | 74,782,929 | 0 | null | Try using `CopyMemory obj, longObj, LenB(longObj)` - no need for Call
| null | CC BY-SA 4.0 | null | 2022-12-13T11:25:53.717 | 2022-12-13T11:25:53.717 | null | null | 16,578,424 | null |
74,784,159 | 2 | null | 32,108,081 | -1 | null | I had faced the same issue.
I have shared the 'Image' folder in the Server. Now the image is getting displayed. I am not sure how much it helps for but it's more related this problem.
| null | CC BY-SA 4.0 | null | 2022-12-13T11:31:01.093 | 2022-12-13T11:31:01.093 | null | null | 12,139,850 | null |
74,784,203 | 2 | null | 74,722,611 | 1 | null |
1. To make the process easy, we can move the store.plan to a computed property to use inside the template and parse property.
2. Simply return store.plan.length from the computed property will do the job too instead of returning true and false based on condition.
3. If you want to use v-if just outside the Action component, you can use template to do this. No need for an extra element.
So, below changes can help fixing the issues-
```
<template>
<div class="planlist">
<ul id="planOl">
<template v-if="parse">
<Action
v-for="action in plan"
:key="action.act_id"
:action_id="action.act_id"
:actor="action.actor"
:color="action.color"
:size="action.size"
:lego_name="action.lego"
:pick_pos="action.pick"
:place_pos="action.place"
:blocked="action.blocked"
:status="action.status"
/>
</template>
</ul>
</div>
</template>
<script>
import Action from "../components/Action.vue";
import { store } from "../js/store.js";
export default {
name: "Plan",
components: {
Action,
},
computed: {
// A computed property to access the plan ()
plan() {
return store.plan;
},
parse() {
/**
* 1. The plan should be available (not null or empty or undefined)
* 2. The plan should be an array so length property can be applied
* 3. If its an array then it should have data (length in other words)
*/
return this.plan && Array.isArray(this.plan) && this.plan.length;
},
},
};
</script>
```
| null | CC BY-SA 4.0 | null | 2022-12-13T11:33:54.943 | 2022-12-13T11:33:54.943 | null | null | 11,834,856 | null |
74,784,326 | 2 | null | 74,768,563 | 0 | null | Firestore listeners by design are made such that you will always be delivered the document(s) relevant to the fetch or query and the updates as long as the lisenter remain active,which results in multiple read and call fo the function that results in adding up of field value with every refresh and update call.There is no mode to receive deltas only.
The first query snapshot contains added events for all existing documents that match the query. This is because you're getting a set of changes that bring your query snapshot current with the initial state of the query.So each time you refresh your page you are calling again the onSnapshot() method "from scratch" and therefore you get the logic added to in every next run.
```
db.collection("Admin").document("AI智能機器人").collection("Ai日獲利")
.getDocuments() { (snapshot, error) in
if let snapshot = snapshot {
if snapshot.documents.isEmpty {
// Handle the case where there are no documents
} else {
for document in snapshot.documents {
if(document?.data())
let quantity = document.data()["quantity"] as? Double {
self.totalVotes += quantity
cell.nowq8.text = "+"+String(format: "%.4f", self.totalVotes)+"%"
}
}
}
} else {
// Handle the error
}
}
```
Also do checkout these links for similar implementations:
- [Firestore document is read multiple times](https://stackoverflow.com/questions/74544937/firestore-document-is-read-multiple-times-after-a-single-update-in-firebase-emul)- [Updating same document twice](https://stackoverflow.com/questions/60945044/cloud-firestore-does-updating-the-same-document-twice-in-a-batch-count-as-a-sin)- [Add data to field once even after page refresh](https://stackoverflow.com/questions/64736912/firebase-firestore-add-data-to-field-once-even-after-page-refresh)
| null | CC BY-SA 4.0 | null | 2022-12-13T11:43:34.747 | 2022-12-14T13:12:28.117 | 2022-12-14T13:12:28.117 | 19,075,433 | 19,075,433 | null |
74,784,507 | 2 | null | 10,769,344 | 0 | null | To create a MySQL database using a SQL file, you can follow these steps:
1. Log in to your MySQL server using the mysql command-line tool and the appropriate credentials.
2. Use the CREATE DATABASE command to create a new database with the desired name:
```
CREATE DATABASE database_name;
```
1. Use the USE command to switch to the newly created database:
```
USE database_name;
```
1. Use the SOURCE command to import the SQL file into the database:
```
SOURCE path/to/sql/file;
```
1. The database will now be created and populated with the data from the SQL file. You can verify this by running some SQL queries against the database.
It's important to note that this process assumes that the SQL file contains valid SQL statements compatible with the version of MySQL you are using. If the SQL file contains any errors or unsupported statements, they will be displayed in the mysql command-line tool, and the import process will be interrupted.
| null | CC BY-SA 4.0 | null | 2022-12-13T11:56:53.433 | 2022-12-13T11:56:53.433 | null | null | 10,946,705 | null |
74,784,705 | 2 | null | 74,779,350 | 2 | null | Actually, it is quite simple. A signature might refer to parameters that are not owned by it. The meaning of the parameters is not affected by who owns them. So for the semantics, you just need to look at the `parameter` property.
I think there is only one way, how this happens: When you specialize a template and extend its signature.
[](https://i.stack.imgur.com/IDNYT.png)
`inheritedParameter` is a subset of `parameter`. Inherited parameters have the same meaning as parameters owned by the extendedSignature. Therefore it makes sense to combine them in one attribute.
PS: `parameter` should probably be derived by a union of its subsets. I suspect this is a bug in the specification. My tool says it is read only, but on the other hand doesn't update it correctly.
| null | CC BY-SA 4.0 | null | 2022-12-13T12:14:06.567 | 2022-12-13T12:14:06.567 | null | null | 9,430,250 | null |
74,784,880 | 2 | null | 74,777,989 | 0 | null | `v-app``id app`
If your provided code is inside the `App.vue` then try this-
```
<div id="app">
<v-app>
<div class="calculator">
<v-container>
<v-layout row>
<div class="display">10</div>
<v-flex>
<v-btn class="btn">c</v-btn>
<v-btn class="btn">+/-</v-btn>
<v-btn class="btn">%</v-btn>
<v-btn class="operator">÷</v-btn>
</v-flex>
<v-flex>
<div></div>
<v-btn class="btn">7</v-btn>
<v-btn class="btn">8</v-btn>
<v-btn class="btn">9</v-btn>
<v-btn class="operator">x</v-btn>
</v-flex>
<v-flex>
<div></div>
<v-btn class="btn">4</v-btn>
<v-btn class="btn">5</v-btn>
<v-btn class="btn">6</v-btn>
<v-btn class="operator">-</v-btn>
</v-flex>
<v-flex>
<div></div>
<v-btn class="btn">1</v-btn>
<v-btn class="btn">2</v-btn>
<v-btn class="btn">3</v-btn>
<v-btn class="operator">+</v-btn>
</v-flex>
<v-flex>
<div></div>
<v-btn class="btn zero">0</v-btn>
<v-btn class="btn">.</v-btn>
<v-btn class="operator">=</v-btn>
</v-flex>
</v-layout>
</v-container>
</div>
</v-app>
</div>
```
And if this code is inside any child component then make sure your `App.vue` is wrapped correctly.
```
<div id="app">
<v-app>
<ChildComponent />
</v-app>
</div>
```
If this works then you no longer needed custom styling to arrange your elements in a grid format. Vuetify will handle this using rows and column.
Use `v-flex` instead of `v-col`, as you are on Vuetify's 1st version.
| null | CC BY-SA 4.0 | null | 2022-12-13T12:29:38.910 | 2022-12-13T13:13:41.413 | 2022-12-13T13:13:41.413 | 11,834,856 | 11,834,856 | null |
74,785,160 | 2 | null | 74,784,772 | 1 | null | Create a new File in VScode something like "test.html"
Then type "!" into the file and press enter.
[](https://i.stack.imgur.com/N8D3s.png)
| null | CC BY-SA 4.0 | null | 2022-12-13T12:51:55.303 | 2022-12-13T12:51:55.303 | null | null | 19,264,289 | null |
74,785,286 | 2 | null | 51,381,604 | 0 | null | This is not a solution if Logcat doesn't even show up in View->Tool Windows!
But if it does: click it and it may show up at a different location than it used to be. Without recognizing I had shoved it to the top left where the project tab is shown. You can now click on the gear wheel on the tab and select move to bottom left (that is the default location).
This was the solution for my "logcat not showing".
| null | CC BY-SA 4.0 | null | 2022-12-13T13:00:51.760 | 2022-12-13T13:00:51.760 | null | null | 940,837 | null |
74,786,045 | 2 | null | 74,785,906 | 0 | null | I would recommend that you :
-
1. sort all numbers in ascending order,
-
1. extract the odd numbers to a second array and
-
1. reverse this new array. Manipulating two different orderings in a same array would prove much more complicated. On a side note, if you don't have a requirement not to, I'd recommend using the Arrays library's Arrays.sort() to simplify your code. It is very readable and has lower complexity of O(N log N).
| null | CC BY-SA 4.0 | null | 2022-12-13T14:01:59.733 | 2022-12-13T14:01:59.733 | null | null | 14,373,099 | null |
74,786,094 | 2 | null | 74,785,734 | 3 | null | To achieve your desired result you have to use a dummy table and then use LEFT join to generate this result -
```
SELECT age_group,
coalesce(count(*),0) as cnt
FROM (SELECT '0-18' age_grp
UNION ALL
SELECT '19-30'
UNION ALL
SELECT '31-35'
UNION ALL
SELECT '36-50'
UNION ALL
SELECT '50+'
) all_grp
LEFT JOIN (SELECT CASE WHEN age BETWEEN 0 AND 18 OR age IS NULL THEN '0-18'
WHEN age BETWEEN 19 AND 30 THEN '19-30'
WHEN age BETWEEN 31 AND 35 THEN '31-35'
WHEN age BETWEEN 36 AND 50 THEN '36-50'
WHEN age BETWEEN 51 AND 100 THEN '50+'
END AS age_group,
COUNT(*) AS count
FROM patient_registration
GROUP BY age_group
) d ON all_grp.age_grp = d.age_group;
```
| null | CC BY-SA 4.0 | null | 2022-12-13T14:05:42.307 | 2022-12-13T14:05:42.307 | null | null | 3,627,756 | null |
74,786,113 | 2 | null | 74,785,906 | 0 | null | What you can do is write a recursive function like so:
```
public static void printOddReversed(int[] array, int index) {
if (index == array.length)
return;
printOddReversed(array, index + 1);
if (array[index] % 2 != 0) {
System.out.print(array[index] + " ");
}
}
```
and then instead of the second loop, call it like so:
```
printOddReversed(arrayTwo, 0);
```
| null | CC BY-SA 4.0 | null | 2022-12-13T14:07:13.153 | 2022-12-13T15:59:22.720 | 2022-12-13T15:59:22.720 | 15,534,394 | 15,534,394 | null |
74,786,157 | 2 | null | 14,080,845 | 0 | null | If you want to open a TCP tunnel over WebSocket and Browser, as your restricted environment, and you just can access limited websites by a browser.
I think this tunnel tool I made can help you settle your issues down.
Cactus Tunnel: [https://github.com/jeffreytse/cactus-tunnel](https://github.com/jeffreytse/cactus-tunnel)
> A charming TCP tunnel over WebSocket and Browser.
For your convinience, below are the instructions of building SSH socks5 proxy tunnel via `cactus-tunnel`
1. Install tunnel tool
```
npm i -g cactus-tunnel
```
1. Run tunnel server
```
cactus-tunnel server
```
1. Run tunnel client in browser bridge mode
```
cactus-tunnel client -b ws://<your-tunnel-server>:7800 <your-ssh-server>:22
```
1. Create socks5 proxy in client side
```
ssh -p 7700 -D 1337 -q -C -N <username>@localhost
```
- `-p 7700``7700`- `-D 1337``1337`- `-q`- `-C`- `-N`
| null | CC BY-SA 4.0 | null | 2022-12-13T14:10:00.273 | 2022-12-13T14:10:00.273 | null | null | 12,029,031 | null |
74,786,195 | 2 | null | 74,785,906 | 0 | null | A simple way to do that is by using a special comparator:
```
if (a%2 == 0) {
if (b%2 == 0) {
return Integer.compare(a,b);
} else {
return -1;
}
} else {
if (b%2 == 0) {
return 1;
} else {
return Integer.compare(b, a);
}
}
```
UPDATE: Example
```
int[] arrayList = {959, 321, 658, 3, 506, 165, 560, 582, 199, 533, 178};
for (int i = 0; i < arrayList.length; i++) {
for (int j = i+1; j < arrayList.length; j++) {
if(compare(arrayList[i], arrayList[j]) > 0) {
int temporaryArray = arrayList[i];
arrayList[i] = arrayList[j];
arrayList[j] = temporaryArray;
}
}
}
System.out.println(Arrays.toString(arrayList));
```
...
```
private static int compare(int a, int b) {
if (a%2 == 0) {
if (b%2 == 0) {
return Integer.compare(a,b);
} else {
return -1;
}
} else {
if (b%2 == 0) {
return 1;
} else {
return Integer.compare(b, a);
}
}
}
```
| null | CC BY-SA 4.0 | null | 2022-12-13T14:12:35.143 | 2022-12-13T14:28:48.350 | 2022-12-13T14:28:48.350 | 7,036,419 | 7,036,419 | null |
74,786,267 | 2 | null | 74,786,108 | -2 | null | You don't need to scrape Wikipedia because they already have Client Library;
```
pip install Wikipedia
```
detailed documentation:
[https://wikipedia.readthedocs.io/en/latest/code.html#api](https://wikipedia.readthedocs.io/en/latest/code.html#api)
[](https://i.stack.imgur.com/CkWaA.png)
| null | CC BY-SA 4.0 | null | 2022-12-13T14:18:19.503 | 2022-12-13T15:16:57.680 | 2022-12-13T15:16:57.680 | 1,233,251 | 5,942,941 | null |
74,786,340 | 2 | null | 74,784,084 | 0 | null | Use [] instead of {} I mean :
```
[Route("api/[controller]")]
[ApiController]
[AllowAnonymous]
public class NameController
{
[HttpGet("get")]
public ActionResult Get(int index)
{
...
}
}
```
| null | CC BY-SA 4.0 | null | 2022-12-13T14:23:36.490 | 2022-12-13T14:52:37.463 | 2022-12-13T14:52:37.463 | 19,091,349 | 19,091,349 | null |
74,786,532 | 2 | null | 74,784,084 | 0 | null | Full example, since comments are already confusing ...
```
[ApiController]
[Route("api/[controller]")] // RouteAttribute needs to be on the class
public class MyController : ControllerBase // ControllerBase from Assembly Microsoft.AspNetCore.Mvc.Core version 6.0.0
{
[HttpGet("{id}")] // HttpGetAttribute for each route
public async Task<IActionResult> GetByIdAsync([FromRoute] int id)
{
// magic faery dust
}
}
```
example for GET: https://localhost:5001/api/mycontroller/42
| null | CC BY-SA 4.0 | null | 2022-12-13T14:40:03.567 | 2022-12-13T14:40:03.567 | null | null | 2,590,375 | null |
74,786,535 | 2 | null | 20,207,487 | 0 | null | The issue is that indicators are absolute positioned, so you could fix it by making the element ol.carousel-indicators relative positioned.
```
<ol class="carousel-indicators" style="position: relative;">
<li style="background-color: grey;" data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li style="background-color: grey;" data-target="#carousel-example-generic" data-slide-to="1"></li>
<li style="background-color: grey;" data-target="#carousel-example-generic" data-slide-to="2"></li>
</ol>
```
Now indicators are part of the flow, so you should push indicators code down after div#carousel-example-generic.
Here is a working example.
```
<div class="container">
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel" style="margin-bottom: 3rem;">
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img src="https://rotulosmatesanz.com/wp-content/uploads/2017/09/2000px-Google_G_Logo.svg_.png" alt="..." />
</div>
<div class="item">
<img src="https://rotulosmatesanz.com/wp-content/uploads/2017/09/2000px-Google_G_Logo.svg_.png" alt="..." />
</div>
<div class="item">
<img src="https://rotulosmatesanz.com/wp-content/uploads/2017/09/2000px-Google_G_Logo.svg_.png" alt="..." />
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
<!-- Indicators -->
<ol class="carousel-indicators" style="position: relative;">
<li style="background-color: grey;" data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li style="background-color: grey;" data-target="#carousel-example-generic" data-slide-to="1"></li>
<li style="background-color: grey;" data-target="#carousel-example-generic" data-slide-to="2"></li>
</ol>
</div>
<!--//container -->
```
I added some styling to make the change more apparent, like margin-bottom to div#carousel-example-generic, added background-color: grey to list items, and added some images from the web to get it to work.
That simple change should do the work.
The advantage of this approach versus the accepted answer, is that you don't have to guess how much margin to apply to push indicators down, because indicators are part of the flow and will move content around as needed.
[Result demo, made using Bootstrap 5 (I also pushed carousel captions out of the slideshow)](https://i.stack.imgur.com/Y8RS8.png)
| null | CC BY-SA 4.0 | null | 2022-12-13T14:40:19.293 | 2022-12-13T14:57:55.827 | 2022-12-13T14:57:55.827 | 14,973,455 | 14,973,455 | null |
74,786,768 | 2 | null | 74,785,409 | 0 | null | Maybe you could use a faster parser? The `html.parser` that you're using in your code is relatively slow compared to other parsers such as `html5lib` and `lxml`. You could try using one of these parsers instead and see if it improves your processing time.
You might also try a different scraping method. Instead of using `select_one`, you could try other methods such as `find` or `find_all`. These methods might be faster, but I'm not completely sure.
| null | CC BY-SA 4.0 | null | 2022-12-13T14:56:59.820 | 2022-12-13T14:56:59.820 | null | null | 9,277,891 | null |
74,787,217 | 2 | null | 29,980,387 | 0 | null | Although this has been answered years ago, still:
To make a circle around the text you can use padding like the previous answer.
```
span{
background: red;
padding: .5rem .85rem;
border-radius: 50%;
}
```
```
<span>i</span><span>m</span>
```
But as you can see, it won't circle all the letters . To make any letter have a circle background, you can use fixed height and width. And then use flexbox/grid/absolute-position to center the text, like this:
```
span{
width: 40px;
height: 40px;
display: inline-flex; /* you can also use 'grid' or just 'flex'*/
justify-content: center;
align-items: center;
background: red;
border-radius: 50%;
}
```
```
<span>i</span><span>m</span><span>A</span>
```
| null | CC BY-SA 4.0 | null | 2022-12-13T15:28:48.370 | 2022-12-13T15:28:48.370 | null | null | 16,801,529 | null |
74,787,318 | 2 | null | 74,784,373 | 0 | null | The best I could do is tweak GaussianBlur and HoughCircles to work for the one eqi-hist image you provided. Hope it is more general than it seems and will help you somehow.
```
blur = cv2.GaussianBlur(gray, (11, 11), 0)
circles = cv2.HoughCircles(blur, cv2.HOUGH_GRADIENT, 1, 20,
param1=180, param2=17, minRadius=2, maxRadius=50)
```
[](https://i.stack.imgur.com/vbtL4.png)
| null | CC BY-SA 4.0 | null | 2022-12-13T15:34:37.220 | 2022-12-13T15:34:37.220 | null | null | 1,722,023 | null |
74,787,365 | 2 | null | 19,575,604 | 0 | null | if you want to remove the space completely from a string value. you ca use
```
/g
```
```
var str="javasript is amazing when you crack it";
alert(str.replace(/ /g,"+"));
```
| null | CC BY-SA 4.0 | null | 2022-12-13T15:37:52.430 | 2022-12-13T15:37:52.430 | null | null | 15,684,769 | null |
74,787,957 | 2 | null | 13,537,483 | 0 | null |
## Improving @martineau's code after a decade
```
import turtle as t
Screen=t.Screen()
Canvas=Screen.getcanvas()
Width, Height = Canvas.winfo_width(), Canvas.winfo_height()
HalfWidth, HalfHeight = Width//2, Height//2
Background = t.Turtle()
Background.ht()
Background.speed(0)
def BackgroundColour(Colour:str="white"):
Background.clear() # Prevents accumulation of layers
Background.penup()
Background.goto(-HalfWidth,-HalfHeight)
Background.color(Colour)
Background.begin_fill()
Background.goto(HalfWidth,-HalfHeight)
Background.goto(HalfWidth,HalfHeight)
Background.goto(-HalfWidth,HalfHeight)
Background.goto(-HalfWidth,-HalfHeight)
Background.end_fill()
Background.penup()
Background.home()
BackgroundColour("orange")
Bob=t.Turtle()
Bob.circle(250)
Canvas.postscript(file="turtle.eps")
```
This depends on what a person is trying to accomplish but generally, having the option to select which turtle to use to draw your background to me is unnecessary and can overcomplicate things so what one can do instead is have one specific turtle (which I named `Background`) to just update the background when desired.
Plus, rather than directing the turtle object via magnitude and direction with `setheading()` and `forward()`, its cleaner (and maybe faster) to simply give the direct coordinates of where the turtle should go.
Also for any newcomers: Keeping all of the constants like `Canvas`, `Width`, and `Height` outside the `BackgroundColour()` function speeds up your code since your computer doesn't have to recalculate or refetch any values every time the function is called.
| null | CC BY-SA 4.0 | null | 2022-12-13T16:26:11.880 | 2022-12-13T16:26:11.880 | null | null | 14,122,473 | null |
74,788,122 | 2 | null | 74,785,734 | 2 | null | ```
SELECT age_groups.age_group,
COUNT(*) `count`
FROM (
SELECT 0 minimal, 18 maximal, '0-18' age_group
UNION ALL
SELECT 19, 30, '19-30'
UNION ALL
SELECT 31, 35, '31-35'
UNION ALL
SELECT 36, 50, '36-50'
UNION ALL
SELECT 51, 999, '50+'
) age_groups
LEFT JOIN patient_registration
ON patient_registration.age BETWEEN age_groups.minimal AND age_groups.maximal
GROUP BY 1;
```
The query will not count the rows where the age is invalid (negative, above 999) or is not set (is NULL).
Additionally you may have a table which contains a lot of ranges sets, and use it instead of synthetic table making the query dynamic.
| null | CC BY-SA 4.0 | null | 2022-12-13T16:38:37.817 | 2022-12-14T04:26:52.623 | 2022-12-14T04:26:52.623 | 10,138,734 | 10,138,734 | null |
74,788,130 | 2 | null | 13,769,808 | 0 | null |
1. Run vagrant global-status
2. Identify the vm id
3. Run vagrant destroy [vm id]
| null | CC BY-SA 4.0 | null | 2022-12-13T16:39:10.600 | 2022-12-18T11:50:56.960 | 2022-12-18T11:50:56.960 | 14,267,427 | 20,768,387 | null |
74,788,580 | 2 | null | 74,785,734 | 3 | null | This option might work for you. I returns all columns regardless of a count and each column IS the age-bracket in question.
```
SELECT
sum( case WHEN age BETWEEN 0 AND 18
OR age IS NULL THEN 1 else 0 end ) Age0_18,
sum( case WHEN age BETWEEN 19 AND 30 THEN 1 else 0 end ) Age19_30,
sum( case WHEN age BETWEEN 31 AND 35 THEN 1 else 0 end ) Age31_35,
sum( case WHEN age BETWEEN 36 AND 50 THEN 1 else 0 end ) Age36_50,
sum( case WHEN age > 50 THEN 1 else 0 end ) AgeOver50
FROM
patient_registration
```
Result would be
```
Age0_18 Age19_30 Age31_35 Age36_50 AgeOver50
0 192 83 223 222
```
| null | CC BY-SA 4.0 | null | 2022-12-13T17:15:47.147 | 2022-12-13T17:15:47.147 | null | null | 74,195 | null |
74,789,260 | 2 | null | 39,819,638 | 0 | null | I had same issue. After a lot of trial and error, I found fix here: [https://github.com/Quick/Quick/issues/402#issuecomment-149459840](https://github.com/Quick/Quick/issues/402#issuecomment-149459840). I had to delete derived data and regenerate project to get Quick as build scheme
| null | CC BY-SA 4.0 | null | 2022-12-13T18:13:51.433 | 2022-12-13T18:13:51.433 | null | null | 8,263,578 | null |
74,789,503 | 2 | null | 74,781,516 | 1 | null | This pretty much requires HTML formatting and you cannot embed HTML within Google Sheet cells. You can, however, use Apps Script to create a [Web App](https://developers.google.com/apps-script/guides/web) that displays your HTML which you can then copy/paste into Gmail.
For example, in your Apps Script project you can add an `index.html` file, use a `doGet()` function to render the index file and [deploy](https://developers.google.com/apps-script/guides/web#deploy_a_script_as_a_web_app) your web app. Something like this (taking some inspiration from Tanaike's [linked thread](https://stackoverflow.com/questions/3337914/how-can-i-make-a-link-from-a-td-table-cell)):
```
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<style>
#button {
background-color: #00abe3;
color: white;
font-size: 20px;
text-align: center;
line-height: 60px;
width: 200px
}
a {
text-decoration-color: white;
display: inline-block;
}
.container {
width: 200px;
height: 60px;
margin: auto;
position: absolute;
left: 50%;
top: 50%;
margin-left: -100px;
margin-top: -30px;
}
</style>
</head>
<body>
<div class="container">
<a href="https://google.com">
<div id="button">
PAY INVOICE
</div>
</a>
</div>
</body>
</html>
```
```
function doGet(){
return HtmlService.createHtmlOutputFromFile("index")
}
```
When you run the web app you will see your HTML. I just displayed the "button" in the center:
[](https://i.stack.imgur.com/eHfL8.png)
You can just copy and paste this into Gmail and it should keep the format. Alternatively you could create a function to show a [modal dialog](https://developers.google.com/apps-script/reference/base/ui#showmodaldialoguserinterface,-title) with the HTML after some action from the user. Something like this:
```
//Code.gs
function modalDialog() {
var html = HtmlService.createHtmlOutputFromFile('index')
.setWidth(200)
.setHeight(100);
SpreadsheetApp.getUi()
.showModalDialog(html, 'PAY');
}
```
[](https://i.stack.imgur.com/LinHa.png)
The dialog is shown on top of the Sheet interface and you should be able to copy it as well. Depending on your HTML, your result should look fine after pasting it in Gmail:
[](https://i.stack.imgur.com/ewZoK.png)
Now, you just asked for something to copy and paste, but I'm guessing that you're trying to email a table copied from Sheets with the full invoice, so you could consider using [templates](https://developers.google.com/apps-script/guides/html/templates). With this you could create an HTML template with [printing scriptlets](https://developers.google.com/apps-script/guides/html/templates#printing_scriptlets) and just automatically generate the table by pulling the data from your Sheet, then send it as an email with [sendMail()](https://developers.google.com/apps-script/reference/mail/mail-app#sendEmail(Object)). For instance, the button portion from index.html:
```
<div class="container">
<a href="<?=getURL()?>">
<div id="button">
PAY INVOICE
</div>
</a>
</div>
```
The scriptlet `<?=getURL()>` calls your server-side function `getURL()`, which you can use to return a URL saved in a cell on your Sheet:
```
//Code.gs
function getURL(){
var ss = SpreadsheetApp.getActiveSpreadsheet()
var sheet = ss.getActiveSheet()
var range = sheet.getRange("A1")
return range.getValue() //returns the URL in A1
}
```
Then you can have a function to build the template and send it through email as HTML, which would look just like the output from the `doGet()` above:
```
//Code.gs
function sendEmail(){
var html = HtmlService.createTemplateFromFile('index').evaluate().getContent()
MailApp.sendEmail({to:"[email protected]", subject:"Test", htmlBody:html})
}
```
This is just a basic sample. It would take some work to make a good template but I hope it gives you an idea of what you can do with Apps Script. There's a lot more to see in the documentation.
#### Sources:
- [Create and serve HTML](https://developers.google.com/apps-script/guides/html)- [Web Apps](https://developers.google.com/apps-script/guides/web)- [Templated HTML](https://developers.google.com/apps-script/guides/html/templates)- [Mail App](https://developers.google.com/apps-script/reference/mail/mail-app)
| null | CC BY-SA 4.0 | null | 2022-12-13T18:37:06.093 | 2022-12-13T18:37:06.093 | null | null | 12,306,687 | null |
74,789,670 | 2 | null | 24,367,927 | 0 | null | you can break the opening tag as much as you want, like
`<textarea id="COMMENTS"`
`name="COMMENTS"`
`rows="3"`
`>`
as long as the
`</textarea>`
does not have blank spaces to the left
| null | CC BY-SA 4.0 | null | 2022-12-13T18:55:07.923 | 2022-12-13T18:58:42.530 | 2022-12-13T18:58:42.530 | 6,125,980 | 6,125,980 | null |
74,790,250 | 2 | null | 10,245,575 | 0 | null | True crc64 is not possible with PHP because PHP's int is internally defined as a signed long, meaning it is only capable of values between -9,223,372,036,854,775,808 and a maximum value of 9,223,372,036,854,775,807, where crc64 returns an unsigned long. The answers here are somewhat misleading because of this. See [http://php.net/crc32](http://php.net/crc32) suggested by @deceze in his comment, but understand that crc64 on 64 bit PHP builds suffers the same problem as crc32 does on 32 bit PHP builds.
Because of this problem, PHP will overflow during the first part of the algortithim (), potentially setting up the rest to overflow as well, when for example normally wouldn't.
| null | CC BY-SA 4.0 | null | 2022-12-13T19:57:36.870 | 2022-12-13T20:04:44.383 | 2022-12-13T20:04:44.383 | 1,246,037 | 1,246,037 | null |
74,790,244 | 2 | null | 74,756,014 | -1 | null | Reproducing this chart is a bit more complicated but with the code you'll get the following figure:
[](https://i.stack.imgur.com/CCwBF.png)
Here's the full code:
```
\tikzset{every picture/.style={line width=0.75pt}}
\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1]
\draw (123.32,140.84) .. controls (123.32,95.09) and (160.41,58) ..
(206.16,58) .. controls (251.91,58) and (289,95.09) .. (289,140.84) ..
controls (289,186.59) and (251.91,223.68) .. (206.16,223.68) .. controls
(160.41,223.68) and (123.32,186.59) .. (123.32,140.84) -- cycle ;
\draw (289.5,29.34) -- (289.78,239.68) ;
\draw (215,32) -- (315,132) ;
\draw (206.16,140.84) -- (289,140.84) ;
\draw (265,82) -- (206.16,140.84) ;
\draw (236,141) -- (228.07,124.38) ;
\draw [shift={(226.78,121.68)}, rotate = 64.49] [fill={rgb, 255:red, 0;
green, 0; blue, 0 } ][line width=0.08] [draw opacity=0]
(8.93,-4.29) -- (0,0) -- (8.93,4.29) -- cycle ;
\draw (233.2,44.75) .. controls (255.43,27.74) and (277.96,28.93) ..
(288.78,44.68) ;
\draw [shift={(230.78,46.68)}, rotate = 320.44] [fill={rgb, 255:red, 0;
green, 0; blue, 0 } ][line width=0.08] [draw opacity=0] (8.93,-4.29)
-- (0,0) -- (8.93,4.29) -- cycle ;
\draw (259.45,82) .. controls (259.45,78.93) and (261.93,76.45) ..
(265,76.45) .. controls (268.07,76.45) and (270.55,78.93) ..
(270.55,82) .. controls (270.55,85.07) and (268.07,87.55) ..
(265,87.55) .. controls (261.93,87.55) and (259.45,85.07) ..
(259.45,82) -- cycle ;
\draw (283.45,140.84) .. controls (283.45,137.77) and (285.93,135.28)
.. (289,135.28) .. controls (292.07,135.28) and (294.55,137.77) ..
(294.55,140.84) .. controls (294.55,143.91) and (292.07,146.39) ..
(289,146.39) .. controls (285.93,146.39) and (283.45,143.91) ..
(283.45,140.84) -- cycle ;
\draw (243,140.4) node [anchor=north west][inner sep=0.75pt]{$r$};
\draw (218,98.4) node [anchor=north west][inner sep=0.75pt]{$r$};
\draw (298,134.4) node [anchor=north west][inner sep=0.75pt]{$M$};
\draw (271,63.4) node [anchor=north west][inner sep=0.75pt]{$N$};
\draw (245,11.4) node [anchor=north west][inner sep=0.75pt]{$\Delta\alpha $};
\draw (236.58,121.82) node [anchor=north west][inner sep=0.75pt]{$\Delta\alpha $};
\draw (268.55,92.86) node [anchor=north west][inner sep=0.75pt][rotate=-56.74]{$\Delta S$};
\end{tikzpicture}
```
| null | CC BY-SA 4.0 | null | 2022-12-13T19:56:44.873 | 2022-12-13T19:56:44.873 | null | null | 6,337,987 | null |
74,791,301 | 2 | null | 15,934,101 | 1 | null | I got this problem with this patch generated using `svn diff --git` (svn in version 1.14.1 (r1886195) running on Debian):
```
Index: bar.txt
===================================================================
diff --git a/bar.txt b/bar.txt
new file mode 100644
--- a/bar.txt (nonexistent)
+++ b/bar.txt (revision 6)
@@ -0,0 +1,1 @@
+foo
\ No newline at end of file
```
i.e. what this patch does is create a new file "bar.txt" with contents "foo"
it gives the error (git version 2.30.2 running on Debian):
```
error: git apply: bad git-diff - expected /dev/null on line 4
```
I had to change `a/bar.txt` to `/dev/null` on line 5:
```
Index: bar.txt
===================================================================
diff --git a/bar.txt b/bar.txt
new file mode 100644
--- /dev/null (nonexistent)
+++ b/bar.txt (revision 6)
@@ -0,0 +1,1 @@
+foo
\ No newline at end of file
```
And then it worked.
Here is a (hackish) Python fix:
```
def fix_patch_bad_new_file(patch_path):
inputfile = open(patch_path, "rb")
data = inputfile.read()
inputfile.close()
data = re.sub(b'(.*)---(.*)\(nonexistent\)(.*)',
b'\\1--- /dev/null\x09(nonexistent)\\3',
data)
data = re.sub(b'(.*)\\+\\+\\+(.*)\(nonexistent\)(.*)',
b'\\1+++ /dev/null\x09(nonexistent)\\3',
data)
file = open(patch_path, "wb")
file.write(data)
file.close()
```
| null | CC BY-SA 4.0 | null | 2022-12-13T21:54:29.610 | 2022-12-14T21:36:31.863 | 2022-12-14T21:36:31.863 | 4,669,135 | 4,669,135 | null |
74,791,401 | 2 | null | 39,432,960 | 0 | null | For me "Find and Replace" didn't work since those single quotes are not found by it.
I could only get rid of the single quotes by formatting affected cells/column as an integer numeric one.
| null | CC BY-SA 4.0 | null | 2022-12-13T22:08:24.250 | 2022-12-13T22:08:24.250 | null | null | 2,212,909 | null |
74,791,789 | 2 | null | 74,791,577 | 1 | null | You need to use two joins onto `persona_fisica`, one for the `partecipanti` and one for the `docenti`
See how the `persona_fisica` table has two relation arrows going from the same attribute (`id`) on your diagram? This is what tells you you will need two joins if you want to use both relations.
Something like this (I'm afraid my Italian isn't good enough to test it, I'm sorry):
```
SELECT
lezioni.id_docente,
presenze.*,
partecipanti.id,
partecipanti.id_persona_fisica,
pf1.id,
pf1.nome,
pf1.cognome,
docenti.id_persona_fisica,
docenti.materia,
pf2.id,
pf2.nome,
pf2.cognome
FROM presenze
JOIN partecipanti
ON presenze.id_partecipante = partecipanti.id
JOIN persona_fisica pf1
ON partecipanti.id_persona_fisica = pf1.id
JOIN lezioni
ON presenze.id_lezioni = lezioni.id
JOIN docenti
ON docenti.id = lezioni.id_docenti
JOIN persona_fisica pf2
ON docenti.id_persona_fisica = pf2.id
WHERE pf1.nome = 'Mario' AND pf1.cognome = 'Rossi'
AND pf2.nome = 'Andrea' AND pf2.cognome = 'Bianchi'
AND docenti.materia = 'Matematica';
```
| null | CC BY-SA 4.0 | null | 2022-12-13T22:58:30.143 | 2022-12-17T03:37:55.427 | 2022-12-17T03:37:55.427 | 888,472 | 7,317,748 | null |
74,792,374 | 2 | null | 74,784,802 | 2 | null | Inappropriate model. Minor adjustments to model yield a rough fit:
```
import numpy as np
from matplotlib import pyplot as plt
from scipy.optimize import curve_fit
xdata = np.array((
2834.486, 2834.968, 2835.45 , 2835.932, 2836.414, 2836.896, 2837.378, 2837.861,
2838.343, 2838.825, 2839.307, 2839.789, 2840.271, 2840.753, 2841.235, 2841.718,
2842.2 , 2842.682, 2843.164, 2843.646, 2844.128, 2844.61 , 2845.093, 2845.575,
2846.057, 2846.539, 2847.021, 2847.503, 2847.985, 2848.468, 2848.95 , 2849.432,
2849.914, 2850.396, 2850.878, 2851.36 , 2851.843, 2852.325, 2852.807, 2853.289,
2853.771, 2854.253, 2854.735, 2855.218, 2855.699, 2856.182, 2856.664, 2857.146,
2857.628, 2858.11 , 2858.592, 2859.074, 2859.557, 2860.039, 2860.521, 2861.003,
2861.485, 2861.967, 2862.449, 2862.932, 2863.414, 2863.896, 2864.378, 2864.86 ,
2865.342, 2865.824, 2866.307, 2866.789, 2867.271, 2867.753, 2868.235, 2868.717,
2869.199, 2869.682, 2870.164, 2870.646, 2871.128, 2871.61 , 2872.092, 2872.574,
2873.056, 2873.539, 2874.021, 2874.503, 2874.985, 2875.467, 2875.949, 2876.431,
2876.914, 2877.396, 2877.878, 2878.36 , 2878.842, 2879.324, 2879.806, 2880.289,
2880.771, 2881.253, 2881.735, 2882.217,
))
ydata = np.array((
0.5027119, 0.5155925, 0.5296563, 0.5450429, 0.5619112, 0.5804411, 0.6008373,
0.6233361, 0.6482099, 0.67577 , 0.7063611, 0.7403504, 0.7781109, 0.8200049,
0.8663718, 0.9175249, 0.9737514, 1.035319 , 1.102472 , 1.175419 , 1.254304 ,
1.339163 , 1.429889 , 1.526202 , 1.627649 , 1.733603 , 1.84322 , 1.955248 ,
2.067605 , 2.176702 , 2.276757 , 2.359875 , 2.417753 , 2.445059 , 2.441798 ,
2.41245 , 2.362954 , 2.298523 , 2.223243 , 2.14052 , 2.05336 , 1.964326 ,
1.87539 , 1.787885 , 1.702644 , 1.620191 , 1.540921 , 1.465193 , 1.393333 ,
1.325607 , 1.262171 , 1.203057 , 1.148185 , 1.097403 , 1.050529 , 1.007382 ,
0.9678 , 0.9316369, 0.8987471, 0.8689752, 0.8421496, 0.8180863, 0.7965991,
0.7775094, 0.76065 , 0.7458642, 0.732995 , 0.7218768, 0.7123291, 0.7041584,
0.6971676, 0.6911709, 0.6860058, 0.6815417, 0.6776828, 0.674363 , 0.6715436,
0.6692089, 0.6673671, 0.6660498, 0.6653103, 0.6652156, 0.6658351, 0.6672268,
0.6694273, 0.6724483, 0.676279 , 0.6808962, 0.686272 , 0.6923797, 0.699192 ,
0.7066767, 0.7147906, 0.7234787, 0.7326793, 0.7423348, 0.7524015, 0.7628553,
0.7736901, 0.7849081,
))
def gauss(x: np.ndarray, *args: float) -> np.ndarray:
a, b, c, d = args
return a*np.exp(-b*(x - c)**2) + d
popt, _ = curve_fit(
gauss, xdata, ydata,
p0=(1.7, 0.02, 2851, 0.7),
maxfev=100_000,
)
print(popt)
fit_y = gauss(xdata, *popt)
plt.scatter(xdata, ydata, label='data', s=5)
plt.plot(xdata, fit_y, '-', label='fit')
plt.legend()
plt.show()
```
```
[1.68927347e+00 2.10977276e-02 2.85117456e+03 6.81806648e-01]
```
To do any better, your model needs to change more.
[](https://i.stack.imgur.com/Vm8LQ.png)
| null | CC BY-SA 4.0 | null | 2022-12-14T00:29:31.820 | 2022-12-14T00:29:31.820 | null | null | 313,768 | null |
74,793,177 | 2 | null | 71,813,256 | 0 | null | As you tagged your question with `diagrammer`, one option is to use Mermaid.js.
### 1. Open Mermaid Live Editor
Mermaid allows even non-programmers to easily create detailed and diagrams through the Mermaid Live Editor.
### 2. Basic structure
In the section, enter:
```
flowchart LR
Chef --> Chef2
Chef2 --> Manager1 & Manager2 & Manager3
Manager1 --> employee1 & employee2
Manager2 --> employee3 & employee4 & employee5
Manager3 --> employee6 & employee7 & employee8
```
### 3. Review the basic graph
You will see a graph on the right-hand side of the editor (as below).
[](https://i.stack.imgur.com/cHAyz.png)
### 4. Modify to get the desired graph
Add wage label to each person, clear the </>code section, and enter the new code below:
```
flowchart LR
subgraph A["100,000"]
direction LR
Chef
end
subgraph B["50,000"]
direction LR
Chef2
end
subgraph C["25,000"]
direction LR
Manager1
end
subgraph D["90,000"]
direction LR
Manager2
end
subgraph E["5,000"]
direction LR
Manager3
end
subgraph F["25,000"]
direction LR
employee1
end
subgraph G["3,000"]
direction LR
employee2
end
subgraph H["20,000"]
direction LR
employee3
end
subgraph I["1,000"]
direction LR
employee4
end
subgraph J["10,000"]
direction LR
employee5
end
subgraph K["15,000"]
direction LR
employee6
end
subgraph L["5,000"]
direction LR
employee7
end
subgraph M["3,000"]
direction LR
employee8
end
Chef --> Chef2
Chef2 --> Manager1 & Manager2 & Manager3
Manager1 --> employee1 & employee2
Manager2 --> employee3 & employee4 & employee5
Manager3 --> employee6 & employee7 & employee8
```
You will see an updated graph on the right-hand side of the editor (as below).
[](https://i.stack.imgur.com/xSC3X.png)
### 5. Download the preferred graph
If you are happy with it, choose the preferred format and download the graph.
| null | CC BY-SA 4.0 | null | 2022-12-14T03:10:03.237 | 2022-12-14T04:32:10.553 | 2022-12-14T04:32:10.553 | 20,524,021 | 20,524,021 | null |
74,793,310 | 2 | null | 74,752,535 | 0 | null | I solved by changing Safari status bar color with theme-color meta in index.html.
```
<head>
<meta name="theme-color" content="#051829" />
</head>
```
| null | CC BY-SA 4.0 | null | 2022-12-14T03:35:09.343 | 2022-12-14T03:35:09.343 | null | null | 3,493,922 | null |
74,793,395 | 2 | null | 74,792,960 | 0 | null | Just add a Backspace at `flutter_lints:^2.0.0 line 67`
follow the # sign in the you need to align down to #
| null | CC BY-SA 4.0 | null | 2022-12-14T03:52:57.943 | 2022-12-14T03:52:57.943 | null | null | 8,480,069 | null |
74,793,574 | 2 | null | 74,791,224 | 1 | null | you enabled code review, try disabling it
[](https://i.stack.imgur.com/Adq3A.png)
| null | CC BY-SA 4.0 | null | 2022-12-14T04:26:46.880 | 2022-12-14T04:26:46.880 | null | null | 13,116,311 | null |
74,793,657 | 2 | null | 25,566,070 | 0 | null | In version IntelliJ IDEA 2022.3 (Community Edition)
Build #IC-223.7571.182, built on November 29, 2022
You can browse to:
-> -> -> ->
Uncheck "Show hard wrap and visual guides (configured in Code Style options)
Or optionally if you really don't want to browse this long, just search on top left search option as "Hard wrap" or "visual guides".
[](https://i.stack.imgur.com/lPOBf.png)
| null | CC BY-SA 4.0 | null | 2022-12-14T04:42:09.553 | 2022-12-14T04:42:09.553 | null | null | 18,470,755 | null |
74,794,223 | 2 | null | 26,315,925 | 0 | null | Starting from [Vim 8.2.3627](https://github.com/vim/vim/commit/cdf5fdb2948ecdd24c6a1e27ed33dfa847c2b3e4), [getwininfo()](https://vimhelp.org/builtin.txt.html#getwininfo%28%29)'s output has a `textoff` containing the
> number of columns occupied by any `'foldcolumn'`, `'signcolumn'` and line number in front of the text
therefore subtracting that to the `width` entry, e.g. computing
```
getwininfo(win_getid()).width - getwininfo(win_getid()).textoff
```
should give the desired result.
---
Before `textoff` was available, it seems to me that the followinig computation does cut it:
```
let textoff = max([&numberwidth, (&number ? len(line('$')) + 1 : (&relativenumber ? winfo.height + 1 : 0))])
\ + &foldcolumn
\ + (empty(sign_getplaced(bufname(), {'group': '*'})[0].signs) ? 0 : 2)
```
---
I made use of both solutions in [this plugin of mine](https://github.com/Aster89/vim-softwrap) for showing soft-wrapped lines.
| null | CC BY-SA 4.0 | null | 2022-12-14T06:13:00.940 | 2023-01-06T22:49:13.947 | 2023-01-06T22:49:13.947 | 5,825,294 | 5,825,294 | null |
74,794,472 | 2 | null | 74,791,413 | 0 | null | > I am trying to know how many documents I have before copying to the datalake.
There is no proper way to query and fond the no of document in collection from ADF.
And the `Lookup`, `Get metadata` activity which can be used to retrieve metadata from database or files are also not supported for `Cosmos DB MongoDB API`.
option in `Cosmos DB MongoDB API` is mainly used to filter the documents based on specific value or condition.
> Specifies selection filter using query operators. To return all documents in a collection.
The workaround can be possible by upserting data in same collection and get the data read from source.


set variable to get read rows from output of copy activity.


Then you can perform your copy activity to copy data from `Cosmos DB MongoDB API` to `data lake`.
| null | CC BY-SA 4.0 | null | 2022-12-14T06:43:32.537 | 2022-12-14T06:43:32.537 | null | null | 18,043,699 | null |
74,794,623 | 2 | null | 74,672,711 | 0 | null | I think the below documentation will help U
URL: [https://sequelize.org/docs/v6/advanced-association-concepts/eager-loading/](https://sequelize.org/docs/v6/advanced-association-concepts/eager-loading/)
```
Answer:
Posts.hasMany(Comments)
Comments.belongsTo(Posts)
Videos.hasMany(Comments)
Comments.belongsTo(Videos)
```
| null | CC BY-SA 4.0 | null | 2022-12-14T07:02:34.983 | 2022-12-14T07:02:34.983 | null | null | 19,773,067 | null |
74,794,857 | 2 | null | 74,794,734 | -1 | null | Try to update the Admin consent to Yes for profile, Read Basic profile.
Or Add read write delegate permission and grant admin consent for that as well.
| null | CC BY-SA 4.0 | null | 2022-12-14T07:29:30.143 | 2022-12-14T07:29:30.143 | null | null | 13,587,512 | null |
74,794,868 | 2 | null | 31,379,005 | 0 | null | For users using modern javascript libraries such as React JS, Please check the Fetch/XHR tab. I've attached a picture for you to look over.[](https://i.stack.imgur.com/SMLzH.png)
| null | CC BY-SA 4.0 | null | 2022-12-14T07:30:41.240 | 2022-12-14T07:30:41.240 | null | null | 483,248 | null |
74,795,110 | 2 | null | 71,361,931 | 0 | null | I was able to get `sparklyr` in colab, there's several articles/posts I read through but [this](https://grabngoinfo.com/install-pyspark-3-on-google-colab-the-easy-way/) was most helpful. I know it says `PySpark` but it works in R runtime as well.
```
# Download Java Virtual Machine (JVM)
system("apt-get install openjdk-8-jdk-headless -qq > /dev/null")
# Download Spark
system("wget -q https://dlcdn.apache.org/spark/spark-3.3.1/spark-3.3.1-bin-hadoop3.tgz")
# Unzip the file
system("tar xf spark-3.3.1-bin-hadoop3.tgz")
# setup the environment for spark
Sys.setenv(JAVA_HOME = "/usr/lib/jvm/java-8-openjdk-amd64")
Sys.setenv(SPARK_HOME = "/content/spark-3.3.1-bin-hadoop3")
install.packages("sparklyr")
install.packages("arrow") # optional but recommended for speed boosts
spark_install()
```
That should do it.
| null | CC BY-SA 4.0 | null | 2022-12-14T07:57:28.747 | 2022-12-14T07:57:28.747 | null | null | 14,007,050 | null |
74,795,212 | 2 | null | 57,343,517 | 0 | null | None of the solutions worked for me so in my `.eslintrc.js` file, I replaced the following line:
```
extends: "@react-native-community",
```
With:
```
extends: ["@react-native-community", "prettier"],
```
This is what my `.eslintrc.js` file looks like now:
```
module.exports = {
root: true,
extends: ["@react-native-community", "prettier"],
};
```
| null | CC BY-SA 4.0 | null | 2022-12-14T08:08:46.247 | 2022-12-14T08:08:46.247 | null | null | 1,276,636 | null |
74,795,251 | 2 | null | 74,794,818 | 0 | null | ok,seems you use it without problem.
I can try your SQL in my TDengine 3.0.2.0 then feedback to you
| null | CC BY-SA 4.0 | null | 2022-12-14T08:12:45.583 | 2022-12-14T08:12:45.583 | null | null | 16,508,354 | null |
74,795,633 | 2 | null | 74,795,189 | 0 | null | Try putting extra check and dispatch when slug becomes available
```
export const ProductListPage = (props) => {
const dispatch = useDispatch();
const { match } = props;
const slug = match?.params?.slug
useEffect(() => {
if (slug) {
dispatch(getProductsBySlug(slug));
}
}, [slug]);
return <Layout>Product List Page</Layout>;
};
```
Hope it helps
| null | CC BY-SA 4.0 | null | 2022-12-14T08:51:13.510 | 2022-12-14T08:51:13.510 | null | null | 2,122,822 | null |
74,795,676 | 2 | null | 27,229,617 | 0 | null | I faced the same problem when i was working with WSO2 micro-integrator when initializing the class mediator that implements "XmlRpcClientConfig" interface.I figured out that i should place the jar files for apache-xmlrpc client to the libs folder in WSO2 Micro integrator and it works fine.
| null | CC BY-SA 4.0 | null | 2022-12-14T08:54:02.947 | 2022-12-14T08:54:02.947 | null | null | 20,624,296 | null |
74,796,163 | 2 | null | 74,766,853 | 0 | null | As you might have any number of teams in a `teamsList` array. Hence, correct approach would be to add `haveAccess` property in each object and assign the `true/false` value against this property in each object.
Also, As `teamsList` is an array, you can access it's object properties by iterating it instead of direct access.
Your code should be like this
```
created() {
this.loadTeams().then((response) => {
this.teamsList = response.data;
this.teamsList.forEach(team => {
team.haveAccess = (team.teamName === 'admins') ? true : false
})
}).catch((error) => {
console.log(error);
});
}
```
| null | CC BY-SA 4.0 | null | 2022-12-14T09:36:37.597 | 2022-12-14T09:36:37.597 | null | null | 4,116,300 | null |
74,796,968 | 2 | null | 25,254,414 | -2 | null | below the code clear the tableview background color check attachment for example [enter image description here](https://i.stack.imgur.com/q8qHU.png)
```
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
tableView.backgroundColor = [UIColor clearColor];
}
```
| null | CC BY-SA 4.0 | null | 2022-12-14T10:42:28.553 | 2022-12-15T13:01:39.493 | 2022-12-15T13:01:39.493 | 1,839,439 | 20,773,896 | null |
74,796,995 | 2 | null | 74,796,457 | 3 | null | Seems it should be documented in a better way, but there is:
```
function exportDiagram "Export the diagram layer to file"
input String path "File path. Supported file formats are PNG and SVG.";
input Integer width := 400 "Width";
input Integer height := 400 "Height";
input Boolean trim := true "Remove unnecessary space around the image.";
input String modelToExport := "" "Model path. Empty means model active one.";
input Boolean evaluate := false "Evaluate default values of parameters.";
output Boolean result "true if successful";
end exportDiagram;
```
e.g., `exportDiagram("Test.png", modelToExport="Modelica.Mechanics.Rotational.Examples.CoupledClutches")`
In this specific case there are some rests of disabled parts, you can reduce it with the argument `evaluate=true` (not to be confused with other Evaluate-flags).
| null | CC BY-SA 4.0 | null | 2022-12-14T10:44:41.393 | 2022-12-14T10:44:41.393 | null | null | 5,603,247 | null |
74,797,057 | 2 | null | 28,173,239 | -1 | null | try this
```
CREATE PROCEDURE dbo.enc_sp
WITH ENCRYPTION
AS
--here is your query
```
based on
[this answer](https://sqljunkieshare.com/2012/03/07/decrypting-encrypted-stored-procedures-views-functions-in-sql-server-20052008-r2/)
| null | CC BY-SA 4.0 | null | 2022-12-14T10:49:54.987 | 2022-12-14T10:49:54.987 | null | null | 5,511,997 | null |
74,797,451 | 2 | null | 63,228,081 | 0 | null | Also you can use background color and .onTapGesture as in this code:
```
struct DisclosureGroupNew: View {
@State var show = false
@State var selectedCountry = ""
var body: some View {
VStack {
DisclosureGroup(isExpanded: $show) {
ScrollView {
LazyVStack(alignment: .leading, spacing: 15) {
ForEach(0...20, id: \.self) { index in
Text("Country \(index)")
.onTapGesture {
selectedCountry = "Country \(index)"
withAnimation {
show.toggle()
}
}
}
}
}
.padding(.top)
.frame(height: 150) // if you need a fixed size
} label: {
Text("Label")
}
.padding()
.background(Color.black.opacity(0.06).onTapGesture {
show.toggle()
})
.cornerRadius(12)
.padding()
Text("Selected country: \(selectedCountry)")
Spacer()
}
}}
```
| null | CC BY-SA 4.0 | null | 2022-12-14T11:18:18.910 | 2022-12-14T11:26:51.840 | 2022-12-14T11:26:51.840 | 13,947,736 | 13,947,736 | null |
74,797,567 | 2 | null | 74,752,963 | 0 | null | This item was resolved as follows by adding this item "start": "ng serve --host=127.0.0.1" in package.json. Now I'm trying to understand what happens to the error Unexpected 503 response from [http://127.0.0.1:4200/runtime.js.map](http://127.0.0.1:4200/runtime.js.map): connect ECONNREFUSED 127.0.0.1:4200
| null | CC BY-SA 4.0 | null | 2022-12-14T11:27:20.830 | 2022-12-14T11:27:20.830 | null | null | 12,107,189 | null |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.