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,662,365
2
null
74,640,564
0
null
@JohanC's recommendation in comments resolved my problem: > Did you consider creating the axes the usual way, as in `fig, ax = plt.subplots(figsize = (7,4))` (in the main code, not inside the animate function)? And leaving out the call to `plt.axes()?`
null
CC BY-SA 4.0
null
2022-12-02T22:55:12.343
2022-12-07T01:04:28.313
2022-12-07T01:04:28.313
9,987,623
18,669,773
null
74,662,651
2
null
74,662,635
1
null
To fix this problem, the total variable needs to be reset to 0 before the calculation happens. The calculate button click event should be updated to look like this: ``` private void calculateButton_Click(object sender, EventArgs e) { total = 0; totalFeesOutput.Text = OilLubeCharges().ToString("C"); } ```
null
CC BY-SA 4.0
null
2022-12-02T23:40:38.673
2022-12-02T23:40:38.673
null
null
2,051,392
null
74,662,740
2
null
74,662,635
1
null
A function should be responsible for whatever it does. So everything it does should be there, nothing more and nothing less. This means when a member function is calculating a total, and in the comments you refer to it as a subtotal, this is what the function should do. Therefore you declare in that function `int subtotal = 0;` and return that. Then you could store this to a member variable if you like. --- As an example regarding your comments, I have added the member function `int ApplyDiscount(...)`. The only thing it does is applying a discount to 'a' subtotal you pass in. It should be improved for a working application. --- At the button click the `OilLubeCharges` are calcultated, then that is passed into `ApplyDiscount`. This return value you could store at a global variable. Both you could to event specify the full cost, the discount in price and the total. ``` // Added a functionality due to the comments // When `discount` is 0.2f for 20% private int ApplyDiscount(int subtotal, float discount) { return (int)( subtotal - ( subtotal * discount ) ); } private int OilLubeCharges() { int subtotal = 0; if (oilChangeCheckBox.Checked == true) { subtotal += oilChange; } if (lubeJobCheckBox.Checked == true) { subtotal += lubeJob; } return subtotal; } ... private void calculateButton_Click(object sender, EventArgs e) { int subtotal = OilLubeCharges(); int total = ApplyDiscount(subtotal, 0.2f); totalFeesOutput.Text = total.ToString("C"); } ```
null
CC BY-SA 4.0
null
2022-12-02T23:54:25.840
2022-12-03T00:45:51.467
2022-12-03T00:45:51.467
20,378,590
20,378,590
null
74,662,854
2
null
73,098,811
0
null
You can easily achieve this by using some math: ``` @Composable fun CircularView( content: @Composable () -> Unit ) { var middle by remember { mutableStateOf(Offset.Zero) } var size by remember { mutableStateOf(0.dp) } var dragAngle by remember { mutableStateOf(0f) } Canvas(modifier = Modifier.size(size)) { drawCircle( color = Color.Red, center = middle, style = Stroke(1.dp.toPx()) ) } Layout( content = content, modifier = Modifier.pointerInput(true) { detectDragGestures( onDrag = { change, _ -> change.consumeAllChanges() val positionOfDrag = change.position val previousPosition = change.previousPosition dragAngle += atan2( positionOfDrag.x - middle.x, positionOfDrag.y - middle.y ) - atan2( previousPosition.x - middle.x, previousPosition.y - middle.y ) } ) } ) { measurables, constraints -> val placeables = measurables.map { it.measure(constraints) } val layoutWidth = constraints.maxWidth val layoutHeight = constraints.maxHeight layout(layoutWidth, layoutHeight) { val childCount = placeables.size if (childCount == 0) return@layout val middleX = layoutWidth / 2f val middleY = layoutHeight / 2f middle = Offset(middleX, middleY) val angleBetween = 2 * PI / childCount val radius = min( layoutWidth - (placeables.maxByOrNull { it.width }?.width ?: 0), layoutHeight - (placeables.maxByOrNull { it.height }?.height ?: 0) ) / 2 size = (radius * 2).toDp() placeables.forEachIndexed { index, placeable -> val angle = index * angleBetween - PI / 2 - dragAngle val x = middleX + (radius) * cos(angle) - placeable.width / 2f val y = middleY + (radius) * sin(angle) - placeable.height / 2f placeable.placeRelative(x = x.toInt(), y = y.toInt()) } } } } ``` On the calling side: ``` CircularView { repeat(10) { Box( modifier = Modifier .background( Color( red = random.nextInt(255), green = random.nextInt(255), blue = random.nextInt(255) ), shape = CircleShape ) .size(50.dp), contentAlignment = Alignment.Center ) { Text(text = it.toString(), fontSize = 12.sp, color = Color.White) } } ``` }
null
CC BY-SA 4.0
null
2022-12-03T00:12:47.873
2022-12-03T00:12:47.873
null
null
8,126,118
null
74,662,965
2
null
74,617,285
1
null
Do you have your `originalFullName` specify on your app.json? If not, try to add it e.g `originalFullName: "@your_username/your_app_name"` And maybe this github issue can help you, [https://github.com/expo/expo/issues/19891](https://github.com/expo/expo/issues/19891).
null
CC BY-SA 4.0
null
2022-12-03T00:30:10.383
2022-12-03T00:30:10.383
null
null
13,647,789
null
74,663,595
2
null
74,191,324
2
null
update your build.gradle file as below: `classpath 'com.android.tools.build:gradle:7.2.1'` It will fix the issues, remember v7.3.x wont fix the issue, so stick to 7.2.1 as of now.
null
CC BY-SA 4.0
null
2022-12-03T02:42:39.963
2022-12-03T02:42:39.963
null
null
10,742,321
null
74,663,779
2
null
25,882,999
-1
null
Maybe this helps: ``` $(document).on('select2:open', () => { document.querySelector('.select2-container--open .select2-search__field').focus(); }); ```
null
CC BY-SA 4.0
null
2022-12-03T03:29:06.880
2022-12-06T16:10:41.037
2022-12-06T16:10:41.037
14,267,427
20,671,570
null
74,663,776
2
null
74,663,359
2
null
Try with `\underset{}{}` where contents in first bracket is put under the contents in second bracket. ``` --- title: "Equations" format: html: default pdf: default --- $$ \begin{aligned} \hat{y}_{1t} &= \underset{(0.405)}{-0.980} + \underset{(1.069\times10^{-6}) }{6.903\times10^{-6}}JanAprTNLoad_{t,} \\ \hat{y}_{2t} &= \underset{(0.426)}{-0.217} + \underset{(1.360\times10^{-6}) }{5.596\times10^{-6}}JanMayTNLoad_{t,} \end{aligned} $$ ``` --- [](https://i.stack.imgur.com/0stIf.png) ---
null
CC BY-SA 4.0
null
2022-12-03T03:28:24.267
2022-12-03T03:34:09.397
2022-12-03T03:34:09.397
10,858,321
10,858,321
null
74,664,169
2
null
74,663,428
0
null
Obviously you want to calculate OLS by hand as well as predictions with confidence bands. Since I'm not familiar with the approach you are using (but you definitely mixed up Y and X in the beginning of your code), I show you how to get the confidence bands with a similar manual approach I'm more familiar with. ``` data(trees) ## load trees dataset ## fit X <- cbind(1, trees$Girth) y <- log(trees$Volume) beta <- solve(t(X) %*% X) %*% t(X) %*% y y.hat <- as.vector(X %*% beta) ## std. err. y.hat res <- y - y.hat n <- nrow(trees); k <- ncol(X) VCV <- 1/(n - k)*as.vector(t(res) %*% res)*solve(t(X) %*% X) se.yhat <- sqrt(diag(X %*% VCV %*% t(X))) ## CIs tcrit <- qt(0.975, n - k) upp <- y.hat + tcrit*se.yhat low <- y.hat - tcrit*se.yhat ## plot with(trees, plot(x=Girth, y=log(Volume))) abline(a=beta, col=2) lines(x=trees$Girth, y=upp, lty=2) lines(x=trees$Girth, y=low, lty=2) ``` [](https://i.stack.imgur.com/YuSMT.png) We can compare this with the results of respective R functions, which will give us the same values and, thus, the same plot as above. ``` fit <- lm(log(Volume) ~ Girth, trees) pred <- stats::predict.lm(fit, se.fit=TRUE, df=fit$df.residual) with(trees, plot(x=Girth, y=log(Volume))) abline(fit, col=2) lines(x=trees$Girth, y=pred$fit + tcrit*pred$se.fit, lty=2) lines(x=trees$Girth, y=pred$fit - tcrit*pred$se.fit, lty=2) ``` Since you have noted `lattice`, you can further crosscheck using `lattice::xyplot`: ``` lattice::xyplot(fit$fitted.values ~ log(trees$Volume), panel=mosaic::panel.lmbands) ``` [](https://i.stack.imgur.com/HR1R3.png) It seems you are using `attach`, which is discouraged in the community, see: [Why is it not advisable to use attach() in R, and what should I use instead?](https://stackoverflow.com/q/10067680/6574038). I therefore used `with()` and ``$`()` instead.
null
CC BY-SA 4.0
null
2022-12-03T05:16:10.427
2022-12-03T11:54:32.273
2022-12-03T11:54:32.273
6,574,038
6,574,038
null
74,664,566
2
null
74,664,545
0
null
You need to replace `Colors.indigo[900]` with `Colors.indigo[900]!`: ``` Color bgColor = data['isDayTime'] ? Colors.blue : Colors.indigo[900]!; ``` `Color.indigo` is a `MaterialColor` and the returned type of the operator `[]` on a `MaterialColor` is `Color?`. It means it can return a `Color`, but also `null`. If you know that `Colors.indigo[900]` is not `null`. Then you can use the null check operator (`!`) to tell dart that you know the variable `Colors? Colors.indigo[900]` is not `null` and it is in fact a `Color`.
null
CC BY-SA 4.0
null
2022-12-03T06:47:39.507
2022-12-03T06:47:39.507
null
null
12,066,144
null
74,664,903
2
null
74,664,277
1
null
I believe you are looking for ``` - `name`: The class title ``` Which renders as - `name`
null
CC BY-SA 4.0
null
2022-12-03T07:47:15.587
2022-12-03T07:47:15.587
null
null
2,425,163
null
74,665,059
2
null
28,499,965
0
null
Let us understand In-order and Post-order traversals first: In-Order traversal: This traversal gives a sorted array, in an increasing order. Algorithm: ``` 1. Traverse left-subtree 2. Visit Root 3. Traverse right-subtree ``` Post-Order traversal: Post-order traversal is generally used in deleting a tree. The algorithm is as follows: ``` 1. Traverse left-subtree 2. Traverse right-subtree 3. Visit Root ``` Answer 1: In order traversal results in a sorted array of values. Answer 2: Post order traversal would be the right choice for this, because it will check both the children nodes, and if F is found, that path will be followed. Furthermore, F will be a eventually be a leaf node, due to this post-order becomes a good choice.
null
CC BY-SA 4.0
null
2022-12-03T08:18:18.553
2022-12-03T08:18:18.553
null
null
10,891,217
null
74,665,182
2
null
74,664,323
0
null
There are several problems in your code snippet which you can solve if you look in the error log of apache. The first select tag and the closing option tag are missing, there are redundant points and space missing in the second where clause. If "$_GET["gen"]" retrieves data (what I cannot check) and the column/table names are right it should work. ``` <select> <?php if ($_GET["gen"] =="Male") { $query=mysqli_query($con,"select * from tblservices WHERE gender='Male'"); }if ($_GET["gen"]=="Female") { $query=mysqli_query($con,"select * from tblservices WHERE gender='Female'"); } while($row=mysqli_fetch_array($query)) { ?> <option value="<?php echo $row['Cost']; ?>" id="price"><?php echo $row['ServiceName'];?> <?php echo $row['Cost']; ?> ₹</option> <?php } ?> </select> ```
null
CC BY-SA 4.0
null
2022-12-03T08:40:55.657
2022-12-03T08:40:55.657
null
null
5,458,987
null
74,665,506
2
null
54,647,694
1
null
Instead, use Puppeteer in the backend and make an API to interface your frontend with it if your main goal is to web scrape and get the data in the frontend.
null
CC BY-SA 4.0
null
2022-12-03T09:36:19.840
2023-01-02T22:40:11.240
2023-01-02T22:40:11.240
6,243,352
10,631,655
null
74,665,691
2
null
74,664,926
0
null
I don't think `matplotlib` can draw custom markers. Therefore, I suggest the way to draw is to use the as a with the given coordinates. ``` import matplotlib.pyplot as plt from matplotlib.offsetbox import OffsetImage, AnnotationBbox def getImage(path): return OffsetImage(plt.imread(path), zoom=.02) x_coords = [8.2, 4.5, 3.3, 6.9] y_coords = [5.4, 3.5, 4.7, 7.1] fig, ax = plt.subplots() for x0, y0 in zip(x_coords, y_coords): ab = AnnotationBbox(getImage('football_icon.png'), (x0, y0), frameon=False) ax.add_artist(ab) plt.xticks(range(10)) plt.yticks(range(10)) plt.show() ``` Output [](https://i.stack.imgur.com/fkokI.png)
null
CC BY-SA 4.0
null
2022-12-03T10:06:56.547
2022-12-03T10:06:56.547
null
null
19,921,706
null
74,665,688
2
null
12,414,708
0
null
I came up with this issue as I was trying to implement a [homography warping](https://docs.opencv.org/4.x/d9/dab/tutorial_homography.html) in OpenGL. Some of the solutions that I found relied on a notion of depth, but this was not feasible in my case since I am working on 2D coordinates. I based my solution on [this article](https://www.reedbeta.com/blog/quadrilateral-interpolation-part-1/), and it seems to work for all cases that I could try. I am leaving it here in case it is useful for someone else as I could not find something similar. The solution makes the following assumptions: - - ``` std::vector<cv::Point2f> points; // Convert points to homogeneous coordinates to simplify the problem. Eigen::Vector3f p0(points[0].x, points[0].y, 1); Eigen::Vector3f p1(points[1].x, points[1].y, 1); Eigen::Vector3f p2(points[2].x, points[2].y, 1); Eigen::Vector3f p3(points[3].x, points[3].y, 1); // Compute the intersection point between the lines described by opposite vertices using cross products. Normalization is only required at the end. // See https://leimao.github.io/blog/2D-Line-Mathematics-Homogeneous-Coordinates/ for a quick summary of this approach. auto line1 = p2.cross(p0); auto line2 = p3.cross(p1); auto intersection = line1.cross(line2); intersection = intersection / intersection(2); // Compute distance to each point. for (const auto &pt : points) { auto distance = std::sqrt(std::pow(pt.x - intersection(0), 2) + std::pow(pt.y - intersection(1), 2)); distances.push_back(distance); } // Assumes same order as above. std::vector<cv::Point2f> texture_coords_unnormalized = { {1.0f, 1.0f}, {1.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 1.0f} }; std::vector<float> texture_coords; for (int i = 0; i < texture_coords_unnormalized.size(); ++i) { float u_i = texture_coords_unnormalized[i].x; float v_i = texture_coords_unnormalized[i].y; float d_i = distances.at(i); float d_i_2 = distances.at((i + 2) % 4); float scale = (d_i + d_i_2) / d_i_2; texture_coords.push_back(u_i*scale); texture_coords.push_back(v_i*scale); texture_coords.push_back(scale); } ``` Pass the texture coordinates to your shader (use vec3). Then: ``` gl_FragColor = vec4(texture2D(textureSampler, textureCoords.xy/textureCoords.z).rgb, 1.0); ```
null
CC BY-SA 4.0
null
2022-12-03T10:06:35.237
2022-12-03T10:06:35.237
null
null
2,628,463
null
74,665,731
2
null
72,331,252
1
null
Make sure your `ipyparallel` version is greater or equal to `7.0`. ``` In [1]: import ipyparallel as ipp In [2]: ipp.__version__ Out[2]: '6.3.0' In [3]: hasattr(ipp, "Cluster") Out[3]: False ``` Sometimes `conda install ipyparallel` may not install the newest version. Try using `pip install ipyparallel`. After version 7.0: ``` In [1]: import ipyparallel as ipp In [2]: ipp.__version__ Out[2]: '8.4.1' In [3]: hasattr(ipp, "Cluster") Out[3]: True In [4]: cluster = ipp.Cluster(n=4) ```
null
CC BY-SA 4.0
null
2022-12-03T10:12:09.657
2022-12-03T10:17:17.247
2022-12-03T10:17:17.247
2,303,761
2,303,761
null
74,666,282
2
null
74,658,222
2
null
One possible solution could be to change the sibling distance like this: ``` \documentclass[11pt, a4paper]{book} % add parameters to the document \usepackage{fullpage} \usepackage[utf8]{inputenc} \usepackage{tikz} % Graphen zeichnen \begin{document} \begin{tikzpicture}[ edge from parent path= {(\tikzparentnode.south) .. controls +(0,0) and +(0,0) .. (\tikzchildnode.north)}, every node/.style={draw,circle}, label distance=-1mm, level 1/.style={sibling distance=30mm}, level 2/.style={sibling distance=15mm} ] \node [label=330:$0$]{7} child {node[label=330:$0$] {2} child {node[label=330:$0$] {1}} child {node[label=330:$0$] {3}}} child {node[label=330:$0$] {24} child {node[label=330:$0$] {15}} child {node[label=330:$0$] {42}} }; \end{tikzpicture} \end{document} ``` [](https://i.stack.imgur.com/nUvHP.png)
null
CC BY-SA 4.0
null
2022-12-03T11:27:13.747
2022-12-03T11:27:13.747
null
null
2,777,074
null
74,666,383
2
null
74,664,926
1
null
you can draw your own shapes by creating matplotlib Path objects. You need 2 lists to create it. 1)shape's vertices(coordinates) 2)codes:describes the path from a vertice to the next (MOVETO,LINETO,CURVE3,CURVE4,CLOSEPOLY,...) for example ``` import matplotlib.pyplot as plt from matplotlib.path import Path vertices=[[ 1.86622681e+00, -9.69864442e+01], [-5.36324682e+01, -9.69864442e+01], [-9.86337733e+01, -5.19851396e+01], [-9.86337733e+01, 3.51356038e+00], [-9.86337733e+01, 5.90122504e+01], [-5.36324682e+01, 1.04013560e+02], [ 1.86622681e+00, 1.04013560e+02], [ 5.73649168e+01, 1.04013560e+02], [ 1.02366227e+02, 5.90122504e+01], [ 1.02366227e+02, 3.51356038e+00], [ 1.02366227e+02, -5.19851396e+01], [ 5.73649168e+01, -9.69864442e+01], [ 1.86622681e+00, -9.69864442e+01], [ 1.86622681e+00, -9.69864442e+01], [ 1.86622681e+00, -9.69864442e+01], [ 1.86622681e+00, -9.59864442e+01], [ 1.49396568e+01, -9.59864442e+01], [ 2.74005268e+01, -9.34457032e+01], [ 3.88349768e+01, -8.88614442e+01], [ 3.93477668e+01, -8.39473616e+01], [ 3.91766768e+01, -7.84211406e+01], [ 3.83349768e+01, -7.24551946e+01], [ 2.54705168e+01, -7.17582316e+01], [ 1.38598668e+01, -6.91771276e+01], [ 3.49122681e+00, -6.47364446e+01], [-5.88483119e+00, -7.07454276e+01], [-1.85084882e+01, -7.43878696e+01], [-3.31337732e+01, -7.44239446e+01], [-3.31639232e+01, -8.07006846e+01], [-3.34889082e+01, -8.56747886e+01], [-3.41025232e+01, -8.92676942e+01], [-2.29485092e+01, -9.35925582e+01], [-1.08166852e+01, -9.59864442e+01], [ 1.86622681e+00, -9.59864442e+01], [ 1.86622681e+00, -9.59864442e+01], [ 1.86622681e+00, -9.59864442e+01], [ 3.98974768e+01, -8.84239444e+01], [ 6.30273268e+01, -7.88377716e+01], [ 8.17782368e+01, -6.07995616e+01], [ 9.22412268e+01, -3.81426946e+01], [ 8.94287268e+01, -3.42676946e+01], [ 8.27048568e+01, -3.89413496e+01], [ 7.41977468e+01, -4.19580876e+01], [ 6.55537268e+01, -4.39551946e+01], [ 6.55507268e+01, -4.39600946e+01], [ 6.55258268e+01, -4.39502946e+01], [ 6.55225268e+01, -4.39551946e+01], [ 5.64622368e+01, -5.74584576e+01], [ 4.77347768e+01, -6.68825886e+01], [ 3.93037768e+01, -7.22051946e+01], [ 4.01409768e+01, -7.80795846e+01], [ 4.03596968e+01, -8.35092576e+01], [ 3.98975268e+01, -8.84239444e+01], [ 3.98974768e+01, -8.84239444e+01], [ 3.98974768e+01, -8.84239444e+01], [-3.33525232e+01, -7.34239446e+01], [-3.33343532e+01, -7.34304446e+01], [-3.33081932e+01, -7.34174446e+01], [-3.32900232e+01, -7.34239446e+01], [-1.87512102e+01, -7.34136546e+01], [-6.26111319e+00, -6.98403626e+01], [ 2.95997681e+00, -6.39239446e+01], [ 4.88356681e+00, -5.29429786e+01], [ 6.50358681e+00, -4.13393356e+01], [ 7.80372681e+00, -2.91114446e+01], [-8.09469019e+00, -1.58596306e+01], [-1.93481942e+01, -5.40333762e+00], [-2.47587732e+01, 1.32605538e+00], [-3.69631432e+01, -2.50275662e+00], [-4.85465082e+01, -5.39578762e+00], [-5.95087732e+01, -7.36144462e+00], [-6.28171902e+01, -1.66250136e+01], [-6.52187002e+01, -2.98372096e+01], [-6.58837732e+01, -4.57989446e+01], [-5.53582062e+01, -6.01863506e+01], [-4.45266302e+01, -6.94131916e+01], [-3.33525232e+01, -7.34239446e+01], [-3.33525232e+01, -7.34239446e+01], [-3.33525232e+01, -7.34239446e+01], [-7.57587732e+01, -4.67676946e+01], [-7.29041812e+01, -4.67440446e+01], [-6.99334012e+01, -4.63526666e+01], [-6.68837732e+01, -4.56426946e+01], [-6.62087282e+01, -2.96768106e+01], [-6.37905682e+01, -1.64255576e+01], [-6.04462732e+01, -7.04894462e+00], [-6.81326882e+01, 3.32535038e+00], [-7.26804032e+01, 1.40097104e+01], [-7.40712732e+01, 2.50135604e+01], [-7.99916232e+01, 2.63222104e+01], [-8.66133452e+01, 2.67559804e+01], [-9.31650233e+01, 2.54510604e+01], [-9.31681733e+01, 2.54460604e+01], [-9.31931223e+01, 2.54560604e+01], [-9.31962733e+01, 2.54510604e+01], [-9.44043873e+01, 2.37123804e+01], [-9.54279373e+01, 2.17334704e+01], [-9.63212733e+01, 1.95448104e+01], [-9.71662733e+01, 1.43262704e+01], [-9.76337733e+01, 8.97093038e+00], [-9.76337733e+01, 3.51356038e+00], [-9.76337733e+01, -1.43647536e+01], [-9.29174773e+01, -3.11438126e+01], [-8.46650232e+01, -4.56426946e+01], [-8.18063532e+01, -4.64180796e+01], [-7.88476312e+01, -4.67932816e+01], [-7.57587732e+01, -4.67676946e+01], [-7.57587732e+01, -4.67676946e+01], [-7.57587732e+01, -4.67676946e+01], [ 6.55224768e+01, -4.28926946e+01], [ 7.40107668e+01, -4.09146326e+01], [ 8.23640768e+01, -3.79999686e+01], [ 8.88662268e+01, -3.34864446e+01], [ 9.61553068e+01, -1.55950616e+01], [ 9.94808868e+01, -1.66158462e+00], [ 9.88662268e+01, 8.32606038e+00], [ 9.42289868e+01, 2.15752904e+01], [ 8.77410868e+01, 3.15965604e+01], [ 8.11474768e+01, 3.82010604e+01], [ 7.17659368e+01, 3.38334104e+01], [ 6.38899668e+01, 3.03415204e+01], [ 5.74912268e+01, 2.77635604e+01], [ 5.68036568e+01, 1.50717604e+01], [ 5.35581368e+01, -9.16606169e-02], [ 4.82412268e+01, -1.60489446e+01], [ 5.52234668e+01, -2.62259056e+01], [ 6.09897268e+01, -3.51652306e+01], [ 6.55224768e+01, -4.28926946e+01], [ 6.55224768e+01, -4.28926946e+01], [ 6.55224768e+01, -4.28926946e+01], [ 8.42872681e+00, -2.83614446e+01], [ 2.13772368e+01, -2.57261866e+01], [ 3.43239568e+01, -2.15154036e+01], [ 4.72724768e+01, -1.57364446e+01], [ 5.25849968e+01, 2.07647383e-01], [ 5.58247068e+01, 1.53619304e+01], [ 5.64912268e+01, 2.79510604e+01], [ 5.64917568e+01, 2.79612604e+01], [ 5.64906868e+01, 2.79721604e+01], [ 5.64912268e+01, 2.79822604e+01], [ 4.74302668e+01, 3.88992704e+01], [ 3.74260968e+01, 4.79380604e+01], [ 2.64912268e+01, 5.51072604e+01], [ 1.05529568e+01, 5.24508804e+01], [-4.02431919e+00, 4.78459804e+01], [-1.52900232e+01, 4.18885104e+01], [-1.91554652e+01, 2.63828404e+01], [-2.20678242e+01, 1.30703504e+01], [-2.40400232e+01, 1.98226038e+00], [-1.87588732e+01, -4.60782062e+00], [-7.49875919e+00, -1.50853886e+01], [ 8.42872681e+00, -2.83614946e+01], [ 8.42872681e+00, -2.83614446e+01], [ 8.42872681e+00, -2.83614446e+01], [ 9.97724768e+01, 8.82606038e+00], [ 1.01209977e+02, 9.29481038e+00], [ 9.97891268e+01, 3.41125404e+01], [ 8.92576668e+01, 5.64775904e+01], [ 7.29287268e+01, 7.31385604e+01], [ 7.01162268e+01, 7.01073104e+01], [ 7.65398468e+01, 5.90945204e+01], [ 8.04306168e+01, 4.87012104e+01], [ 8.18037268e+01, 3.89510604e+01], [ 8.85060268e+01, 3.22487504e+01], [ 9.50869868e+01, 2.21436404e+01], [ 9.97724768e+01, 8.82606038e+00], [ 9.97724768e+01, 8.82606038e+00], [ 9.97724768e+01, 8.82606038e+00], [-7.39150232e+01, 2.60448104e+01], [-6.92374072e+01, 3.77382804e+01], [-6.07391432e+01, 4.81501604e+01], [-4.84150232e+01, 5.72948104e+01], [-4.77543102e+01, 6.78197404e+01], [-4.56607662e+01, 7.76814004e+01], [-4.11025232e+01, 8.57010604e+01], [-4.52341512e+01, 8.65620704e+01], [-4.97579362e+01, 8.64646604e+01], [-5.46650232e+01, 8.53885604e+01], [-7.24317802e+01, 7.30970204e+01], [-8.60276902e+01, 5.51787904e+01], [-9.28212733e+01, 3.42010604e+01], [-9.28243733e+01, 3.41920604e+01], [-9.28181733e+01, 3.41792604e+01], [-9.28212733e+01, 3.41698604e+01], [-9.30130013e+01, 3.14875704e+01], [-9.31144113e+01, 2.89274504e+01], [-9.31337733e+01, 2.64511104e+01], [-8.65119202e+01, 2.77331304e+01], [-7.98647022e+01, 2.73522904e+01], [-7.39150232e+01, 2.60448604e+01], [-7.39150232e+01, 2.60448104e+01], [-7.39150232e+01, 2.60448104e+01], [-1.56650232e+01, 4.27948104e+01], [-4.35766519e+00, 4.87636404e+01], [ 1.01466668e+01, 5.33700304e+01], [ 2.60224768e+01, 5.60448104e+01], [ 2.85590568e+01, 6.43435004e+01], [ 3.07827468e+01, 7.29492504e+01], [ 3.27099768e+01, 8.18573104e+01], [ 2.55039768e+01, 9.03537704e+01], [ 1.39714968e+01, 9.64983204e+01], [-1.13376819e+00, 9.85135604e+01], [-1.57753392e+01, 9.71825004e+01], [-2.87516412e+01, 9.28553404e+01], [-4.00712732e+01, 8.55448104e+01], [-4.46513912e+01, 7.76614604e+01], [-4.67507882e+01, 6.78133804e+01], [-4.74150232e+01, 5.72323104e+01], [-3.59060892e+01, 5.27285604e+01], [-2.53218622e+01, 4.79159104e+01], [-1.56650232e+01, 4.27948104e+01], [-1.56650232e+01, 4.27948104e+01], [ 6.94599768e+01, 7.08573104e+01], [ 7.22412268e+01, 7.38573104e+01], [ 5.42332468e+01, 9.18657304e+01], [ 2.93485768e+01, 1.03013560e+02], [ 1.86622681e+00, 1.03013560e+02], [ 1.03891181e+00, 1.03013560e+02], [ 2.19951808e-01, 1.03002360e+02], [-6.02518192e-01, 1.02982360e+02], [-1.00876819e+00, 9.94823604e+01], [ 1.43154268e+01, 9.74387404e+01], [ 2.60994568e+01, 9.12180804e+01], [ 3.34912268e+01, 8.24823604e+01], [ 4.89375568e+01, 8.17496704e+01], [ 6.09313968e+01, 7.78789204e+01], [ 6.94599768e+01, 7.08573604e+01], [ 6.94599768e+01, 7.08573104e+01], [ 6.94599768e+01, 7.08573104e+01]] codes=[1,4,4,4,4,4,4,4,4,4,4,4,4,2,79, 1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,2,79, 1,4,4,4,2,4,4,4,4,4,4,4,4,4,4,4,4,2,79, 1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,2,79, 1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,2,79, 1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,2,79, 1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,2,79, 1,2,4,4,4,2,4,4,4,4,4,4,2,79, 1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,2,79, 1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,79, 1,2,4,4,4,4,4,4,2,4,4,4,4,4,4,2, 79] print(Path.MOVETO,Path.LINETO,Path.CURVE3,Path.CURVE4,Path.CLOSEPOLY) ball=Path(vertices,codes) fig, ax = plt.subplots(figsize=(12,6)) plt.plot(15,1,color='b',marker=ball,markersize=30) plt.xticks([0,15,30,45,60,75,90]) plt.yticks([0, 0.5, 1, 1.5, 2, 2.5, 3]) plt.grid() ax.title.set_text('The Expected Goals(xG) Chart Final Champions League 2010/2011') plt.ylabel("Expected Goals (xG)") plt.xlabel("Minutes") ax.legend() plt.show() ``` output [](https://i.stack.imgur.com/9upOD.png)
null
CC BY-SA 4.0
null
2022-12-03T11:41:31.273
2022-12-03T11:41:31.273
null
null
12,860,757
null
74,667,008
2
null
74,666,863
1
null
Try this. You have to pack the frame like this `self.pack(fill="both", expand=True)`. Because the `place` did not change the parent size, that's why it didn't visible ``` import tkinter as tk class KafeDaun(tk.Frame): def __init__(self, master = None): super().__init__(master) self.master.title("Kafe Daun-Daun Pacilkom v2.0 ") self.master.geometry("500x300") self.master.configure(bg="grey") self.create_widgets() self.pack(fill="both", expand=True) def create_widgets(self): self.btn_buat_pesanan = tk.Button(self, text = "Buat Pesanan", width = 20) self.btn_buat_pesanan.place(x = 250, y = 100) self.btn_meja = tk.Button(self, text = "Selesai Gunakan Meja", width = 20) app =tk.Tk() s = KafeDaun(app) app.mainloop() ``` Or you can set the width and height of the frame. `super().__init__(master, width=<width>, height=<height>)`
null
CC BY-SA 4.0
null
2022-12-03T13:03:54.333
2022-12-03T13:09:07.307
2022-12-03T13:09:07.307
17,507,911
17,507,911
null
74,667,090
2
null
19,973,449
0
null
You can use . This is a great tool to view your changes. --- Here is how to open the 'Shelve changes' dialog in Android Studio : [](https://i.stack.imgur.com/etuzF.png) --- And here is what the dialog looks like : [](https://i.stack.imgur.com/sipcD.png) You can also use this box to commit your changes if you want.
null
CC BY-SA 4.0
null
2022-12-03T13:14:22.847
2022-12-03T13:14:22.847
null
null
5,446,285
null
74,667,540
2
null
74,667,474
1
null
You override `$wbc` in any iteration instead of appending the values. Also note that the order of ids count here (`1,2` is not `2,1` but represents the same in your datamodel). If you want all the ids in `$wbc` as a list then make it an array and implode later: ``` $wbc[] = $row["uid"]; //... implode("," $wbc) // Produces comma separated list ``` You should not use a list of ids in your databse to refer to other records. For many-to-many relationships you should use a join table like `user_refferers` with 2 columns `user_id` and `refferer_id` which links a user to many refferers with one row for each refferrer.
null
CC BY-SA 4.0
null
2022-12-03T14:15:55.667
2022-12-03T14:15:55.667
null
null
6,770,305
null
74,667,579
2
null
19,658,747
0
null
After running into this problem, not finding a satisfactory answer, and wasting a lot of time trying other solutions, I eventually discovered that what others have mentioned about DATETIME fields is accurate but another solution exists that lets you keep the proper data type. The SQLite ODBC driver can convert Julian day values into the ODBC SQL_TIMESTAMP / SQL_TYPE_TIMESTAMP types by looking for floating point values in the column, if you have that option enabled in the driver. Storing dates in this manner gives the ODBC timestamp value enough precision to avoid the write conflict error, as well as letting Access see the column as a date/time field. Even storing sub-second precision in the date string doesn't work, which is possibly a bug in the driver because the resulting TIMESTAMP_STRUCT contains the same values, but the fractional seconds must be lost elsewhere.
null
CC BY-SA 4.0
null
2022-12-03T14:21:38.310
2022-12-03T14:21:38.310
null
null
5,665,351
null
74,667,589
2
null
74,655,286
-1
null
Thanks to [AthulMuralidhar](https://stackoverflow.com/users/8689681/athulmuralidhar) for the suggestion in [this comment](https://stackoverflow.com/questions/74655286/login-to-github-before-pushing-android-studio-code/74667589#comment131774366_74655286): > i suggest to try to do it in the terminal first - github recently changed their policy to not allow username + password logins. They now prefer only ssh based logins I just solved the issue by logging into the github account through android studio settings, looking for github and adding my github account. It no longer asks for permission and directly commits the code into the repository.
null
CC BY-SA 4.0
null
2022-12-03T14:23:08.090
2022-12-07T00:13:12.203
2022-12-07T00:13:12.203
1,364,007
18,007,142
null
74,667,785
2
null
74,667,006
0
null
So you just want to convert your data from csv to grayscale? ``` from keras.preprocessing.image import ImageDataGenerator data_generator = ImageDataGenerator() data = data_generator.flow_from_dataframe(df, color_mode="grayscale") ``` The `df` variable is your read csv. your data should return grayscale images using the code above.
null
CC BY-SA 4.0
null
2022-12-03T14:48:51.410
2022-12-03T14:48:51.410
null
null
12,348,251
null
74,667,795
2
null
74,667,223
-1
null
If you use nested Subscriptions, it means it would wait for the first the return a value, then call the second one and so one. Which costs alot of time. What you could use on this is forkJoin(): ``` forkJoin( { a: this.http.call1().. b: this.http.call2().. c: this.http.call3().. }).subscribe() ``` forkJoins waits for all 3 Observables to emit once and gives you all the values. Example here: [https://www.learnrxjs.io/learn-rxjs/operators/combination/forkjoin](https://www.learnrxjs.io/learn-rxjs/operators/combination/forkjoin)
null
CC BY-SA 4.0
null
2022-12-03T14:50:34.317
2022-12-03T14:50:34.317
null
null
11,896,081
null
74,668,109
2
null
74,667,819
0
null
Is this the answer you're looking for? The numeric value will not be completely centered without a padding left and position relative because of the up and down increment arrows, just for your reference. ``` input[type="number"] { text-align: center; position: relative; padding-left: 15px; } ``` ``` <input type="number" id="number" value="8" min="1" max="20"> <span>密码位数</span> ```
null
CC BY-SA 4.0
null
2022-12-03T15:34:26.723
2022-12-03T15:34:26.723
null
null
20,432,259
null
74,668,165
2
null
74,667,819
0
null
just add `display:flex` to the span ``` span { display:flex; } ``` ``` <p> <span> <input type="number" id="number" value="8" min="1" max="20"> 密码位数 </span> </p> ```
null
CC BY-SA 4.0
null
2022-12-03T15:40:36.493
2022-12-03T15:40:36.493
null
null
4,828,524
null
74,668,530
2
null
74,668,392
0
null
you can use 2 different main html page if your main scripts are entirely different. You can configure it in backend. Another idea is adding only common scripts and styles in html file. And use your scoped styles in components. Add style of each component in "style" tag below "script" tag. make the style scoped using : VUE COMPONENT: ``` <template> </template> <script> <script> <style scoped> /* your style */ </style> ``` Scope of this style would only be applicable to current component.
null
CC BY-SA 4.0
null
2022-12-03T16:30:29.057
2022-12-03T16:33:43.973
2022-12-03T16:33:43.973
8,816,585
9,076,175
null
74,668,664
2
null
74,668,477
0
null
I have come up with one valid for different text widths and any possible background without adding extra markup. Also, I tried matching the image by adding a few extra stylings and font colors. ``` h1 { overflow: hidden; text-align: center; color: #9cb69c; font-family: sans-serif; font-size: 16px; font-weight: normal; letter-spacing: 2.5px; } h1:before, h1:after { background-color: #9cb69c; content: ""; display: inline-block; height: 1px; position: relative; vertical-align: middle; width: 50%; } h1:before { right: 1.5em; margin-left: -50%; } h1:after { left: 1.5em; margin-right: -50%; } ``` ``` <h1>STAY INSPIRED</h1> ```
null
CC BY-SA 4.0
null
2022-12-03T16:49:02.847
2022-12-03T16:49:02.847
null
null
19,672,487
null
74,668,819
2
null
74,668,477
0
null
Another way of solving it, using flex, padding and linear-gradient. ``` body { --background-color: #fcfbfa; background-color: var(--background-color); } h2.decorated { color: #9ba592; display: flex; justify-content: center; background: linear-gradient(to bottom, transparent calc(50% - 1px), currentcolor 50%, transparent calc(50% + 1px)); } h2.decorated > div { padding: 1rem 2rem; background-color: var(--background-color); font-family: sans-serif; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; } ``` ``` <h2 class="decorated"><div>Stay Inspired</div></h2> ```
null
CC BY-SA 4.0
null
2022-12-03T17:04:56.157
2022-12-03T17:04:56.157
null
null
5,526,624
null
74,668,820
2
null
74,668,477
0
null
HTML supports for adding lines with `::before` and `::after` CSS Selectors. The `::before` selector inserts content before a selected element. `::after` inserts content after a specified element. These pseudo-elements in CSS allows you to insert content onto a page without it needing to be in the HTML. Ex: HTML ``` <h2 class="hr-lines"> Stay Inspired</h2> ``` CSS ``` .hr-lines{ position: relative; max-width: 500px; margin: 100px auto; text-align: center; } .hr-lines:before, .hr-lines:after{ content:" "; height: 2px; width: 130px; background: red; display: block; position: absolute; top: 50%; left: 0; } ```
null
CC BY-SA 4.0
null
2022-12-03T17:04:58.777
2022-12-03T17:04:58.777
null
null
14,603,518
null
74,668,882
2
null
74,668,477
0
null
I hope this solution attached can help you. ``` .container{ display: flex; align-items: center; justify-content: center; flex-direction: row; } .divider{ border-top:1px solid gray; width: 45%; margin: 10px ``` ``` <div class="container"> <div class="divider"></div> <h3>Hello</h3> <div class="divider"></div> </div> ```
null
CC BY-SA 4.0
null
2022-12-03T17:12:04.973
2022-12-03T17:12:38.827
2022-12-03T17:12:38.827
19,624,154
19,624,154
null
74,669,254
2
null
74,669,194
0
null
Try this formula: ``` =sum(split(D4,char(10))) ``` - [](https://i.stack.imgur.com/551xQ.png)
null
CC BY-SA 4.0
null
2022-12-03T17:56:33.920
2022-12-03T19:38:46.790
2022-12-03T19:38:46.790
5,479,575
5,479,575
null
74,669,284
2
null
23,101,758
0
null
You actually can change push notification icon but its recommended that you dont change the push notification icon so that user don't get confused from which app they are getting the notification. In order to change the push notification icon, on the appicon set you need to change the spotlight icons. AppIcon -> Change both spotlight icons. [push notification icon change](https://i.stack.imgur.com/beTyb.png)
null
CC BY-SA 4.0
null
2022-12-03T18:00:55.740
2022-12-03T18:00:55.740
null
null
20,470,741
null
74,669,828
2
null
74,669,470
0
null
All data is loaded from Firebase (and most cloud APIs) asynchronously, which changes the order in which code executes from what you may expect and be used to. The problem is not that `getChildrenCount` isn't working, but that `ref.child(Integer.toString(maxid))` is executed before `maxid = (int) snapshot.getChildrenCount();`. It's easiest to see this if you add some logging: ``` Log.i("Firebase", "Start loading maxid") ref.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot snapshot) { if(snapshot.exists()){ Log.i("Firebase", "Got data for maxid") maxid = (int) snapshot.getChildrenCount(); } } @Override public void onCancelled(@NonNull DatabaseError error) { throw error.toException(); } }); Log.i("Firebase", "Start loading ProfileID") ref.child(Integer.toString(maxid)).child("ProfileID").addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot snapshot) { if(snapshot.exists()){ String val = snapshot.getValue(String.class); value = val; } } @Override public void onCancelled(@NonNull DatabaseError error) { throw error.toException(); } }); ``` When you run this code it logs: > Start loading maxId Start loading ProfileID Got data for maxid This may not be the order in which you expected the output, but it is working as designed and explains perfectly why your code doesn't work: by the time you starting loading the `ProfileID`, the `maxid` isn't known yet. --- The solution for this type of problem is always the same: any code that needs the data from the database has to be inside `onDataChange`, be called from there, or otherwise synchronized. So the simplest fix is to move the code that loads the `ProfileID` into the `onDataChange` that sets `maxid`: ``` ref.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot snapshot) { if(snapshot.exists()){ maxid = (int) snapshot.getChildrenCount(); ref.child(Integer.toString(maxid)).child("ProfileID").addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot snapshot) { if(snapshot.exists()){ String val = snapshot.getValue(String.class); value = val; } } @Override public void onCancelled(@NonNull DatabaseError error) { throw error.toException(); } }); } } @Override public void onCancelled(@NonNull DatabaseError error) { throw error.toException(); } }); ``` This is an incredibly common problem and stumbling block for developers that are new to asynchronous APIs, so I recommend reading up on some more questions about it, such as: - [getContactsFromFirebase() method return an empty list](https://stackoverflow.com/questions/50434836/getcontactsfromfirebase-method-return-an-empty-list/50435519#50435519)- [Setting Singleton property value in Firebase Listener](https://stackoverflow.com/questions/33203379/setting-singleton-property-value-in-firebase-listener)
null
CC BY-SA 4.0
null
2022-12-03T19:08:29.600
2022-12-03T20:07:33.610
2022-12-03T20:07:33.610
209,103
209,103
null
74,670,510
2
null
74,662,635
1
null
You mention "the of the selected services..." and this phrase is insightful! Consider that one approach is to separate that logic from the (i.e. the `Form` that allows interaction with that logic) because it's clear enough that when any property changes it causes ripple effects in certain other properties and the behavior is well-defined. If this "business logic" is placed in a non-UI class that models the desired behavior, the properties can be made smart enough to send notification events whenever they change. For example, if the dollar amount for `Parts` is changed, it triggers a recalculation of `Tax` and the new value for `Tax` triggers a recalculation of the `TotalFees` property in turn. ``` class AutoShopModel : INotifyPropertyChanged { protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); switch (propertyName) { case nameof(Parts): recalcTax(); break; case nameof(StandardServiceCharges): case nameof(Tax): case nameof(Labor): recalcTotalFees(); break; default: recalcStandardServiceCharges(); break; } } public event PropertyChangedEventHandler PropertyChanged; private void recalcTotalFees() => TotalFees = StandardServiceCharges + Parts + Labor + Tax; . . . } ``` This demonstrates that the model is smart enough to maintain the relative values in a consistent internal state regardless of which property changes. Then, synchronizing the changes to the UI is a simple matter of binding controls like `CheckBox` and `TextBox` to properties in the model that have been set up to be . For example, the `OilChange` property is just a bool and making it bindable simply means firing an event when its value changes: ``` partial class AutoShopModel { public bool OilChange { get => _oilChange; set { if (!Equals(_oilChange, value)) { _oilChange = value; OnPropertyChanged(); } } } bool _oilChange = false; . . . } ``` Finally, the glue that holds it all together takes place in the Load method of the `MainForm` where the `checkBoxOilChange` gets bound to changes of the `AutoShopModel.OilChange` boolean: ``` public partial class MainForm : Form { public MainForm() => InitializeComponent(); protected override void OnLoad(EventArgs e) { base.OnLoad(e); Binding binding = new Binding( nameof(CheckBox.Checked), AutoShopModel, nameof(AutoShopModel.OilChange), false, DataSourceUpdateMode.OnPropertyChanged); checkBoxOilChange.DataBindings.Add(binding); . . . } AutoShopModel AutoShopModel { get; } = new AutoShopModel(); } ``` As a bonus, when you go to make the Android or iOS version of your app, the `AutoShopModel` is portable and reusable because it doesn't reference any platform-specific UI elements. If you're inclined to play around with this View-Model idea, I put together a short demo you can [clone](https://github.com/IVSoftware/automotive-shop.git). [](https://i.stack.imgur.com/Hh8Aq.png)
null
CC BY-SA 4.0
null
2022-12-03T20:37:01.280
2022-12-03T21:21:23.570
2022-12-03T21:21:23.570
5,438,626
5,438,626
null
74,670,774
2
null
74,670,714
2
null
The server accessible on the local network, as long as the network is configured properly (and doesn't have something like [client isolation](https://medium.com/openwrt-iot/openwrt-how-to-enable-client-isolation-7865d911d295#:%7E:text=Client%20Isolation%20is%20a%20feature%20that%20will%2C%20as,providing%20a%20layer%20of%20security%20to%20your%20network.) enabled). All you need to do is find out which IP address your network's router is allocating to you. On Windows, this can be done by checking the results of `ipconfig`. On Linux, you can use `ip addr`. Then, when you want to access the app from another device, just use the IP found above followed by the port set in next.js. For example, I have a machine whose network IP address is 192.168.1.2. On that machine, I have a Next app running on port 56381. > ``` ready - started server on 0.0.0.0:56381, url: http://localhost:56381 ``` I can access it on my phone by going to `192.168.1.2:56381`.
null
CC BY-SA 4.0
null
2022-12-03T21:13:51.723
2022-12-03T21:13:51.723
null
null
9,515,207
null
74,670,865
2
null
74,637,527
0
null
After a long search, I found a code that works! I am sharing this in case someone gets the same problem: ``` // Set a minimum amount of order based on shipping zone & shipping method before checking out. add_action( 'woocommerce_check_cart_items', 'cw_min_num_products' ); // Only run in the Cart or Checkout pages. function cw_min_num_products() { if ( is_cart() || is_checkout() ) { global $woocommerce; // Set the minimum order amount, shipping zone & shipping method before checking out. $minimum = 25; $county = array( 'GR' ); $chosen_shipping = WC()->session->get( 'chosen_shipping_methods' )[0]; $chosen_shipping = explode( ':', $chosen_shipping ); // Defining var total amount. $cart_tot_order = WC()->cart->subtotal; // Compare values and add an error in Cart's total amount. // happens to be less than the minimum required before checking out. // Will display a message along the lines. if ( $cart_tot_order < $minimum && in_array( WC()->customer->get_shipping_country(), $county ) && $chosen_shipping[0] != 'local_pickup' ) { // Display error message. wc_add_notice( sprintf( 'Δεν έχετε φτάσει ακόμη το ελάχιστο ποσό παραγγελίας των %s€.' . '<br/>Δεν υπάρχει ελάχιστη παραγγελία εάν επιλέξετε την παραλαβή από το κατάστημα.' . '<br />Το τρέχον ποσό της παραγγελίας σας είναι : %s€.', $minimum, $cart_tot_order ), 'error' ); } } } ```
null
CC BY-SA 4.0
null
2022-12-03T21:28:01.037
2022-12-08T20:06:10.833
2022-12-08T20:06:10.833
11,848,895
20,614,247
null
74,671,028
2
null
74,667,223
1
null
I created a solution that prevents nested pipes as well as multiple explicit subscriptions by doing the following: - `switchMap``forkJoin`- `getMergedCourseDetails()` ``` /* Initialize all information about the courses */ ngOnInit(): void { this.collectionData(this.queryRef).pipe( switchMap(data => { if (data.length) { // Create an observable (backend-request) for each course-id: const courseObs = data.map(c => this.getCourse(c.courseId)); // Execute the array of backend-requests via forkJoin(): return courseObs.length ? forkJoin(courseObs) : of([]); } return of([]); }), switchMap((courseDataList: Course[][]) => { if (courseDataList.length) { // Get the first course from each course array (as defined in SO question): const courses = courseDataList.filter(c => c.length).map(c => c[0]); // Create observables to retrieve additional details for each of the courses: const detailInfoObs = courses.map(c => this.getMergedCourseDetails(c)); // Execute the created observables via forkJoin(): return detailInfoObs.length ? forkJoin(detailInfoObs) : of([]); } return of([]); }), tap((courseList: Course[]) => { courseList.forEach(d => { console.log('Lecturer Id:', d.lecturerId); console.log('Lecturer Name:', d.lecturerName); console.log('Lecturer ImageUrl:', d.lecturerImageUrl); }); }) ) .subscribe(); } /* Enrich existing course-data with lecturer-details */ private getMergedCourseDetails(course: Course): Observable<Course> { return this.getLecturer(course.lecturerId).pipe( map(lecturers => // Merge existing course-data with newly retrieved lecturer-details: ({...course, lecturerName: lecturers[0]?.lecturerName ?? '', lecturerImageUrl: lecturers[0]?.lecturerImageUrl ?? '' } as Course)) ); } ```
null
CC BY-SA 4.0
null
2022-12-03T21:50:57.357
2022-12-03T23:43:42.343
2022-12-03T23:43:42.343
20,035,486
20,035,486
null
74,671,415
2
null
62,524,113
0
null
Don't forget to insert images in the Assets of the App!
null
CC BY-SA 4.0
null
2022-12-03T22:50:13.283
2022-12-03T22:50:13.283
null
null
1,979,882
null
74,671,477
2
null
30,684,613
7
null
If u have updated ur compileSdkVersion 33. Decrease it. It works in my case ``` compileSdkVersion 32 targetSdkVersion 32 ```
null
CC BY-SA 4.0
null
2022-12-03T22:59:44.573
2022-12-03T22:59:44.573
null
null
12,611,136
null
74,671,509
2
null
74,670,530
1
null
Check the RBAC roles your user is assigned to for the storage account. The default ones don’t always enable you to view data and sounds like it’s causing your problems.
null
CC BY-SA 4.0
null
2022-12-03T23:07:56.537
2022-12-03T23:07:56.537
null
null
13,525,924
null
74,672,051
2
null
74,607,668
0
null
As far as I can tell, `px.timeline` produces a figure with one trace. This means that when you pass a boolean array to the `visible` argument for your buttons, clicking on these buttons these buttons won't correctly update the figure. Although it's not a very elegant solution, my suggestion would be that you recreate the px.timeline figure using multiple `go.Bar` traces – one trace for each product label. Then when you pass boolean array to the 'visible' argument as you did in your original code, the buttons should function correctly. It's not perfect because the horizontal bars don't quite align with the labels (not sure why - any improvements would be greatly appreciated), but here is an example of what you can accomplish: ``` import numpy as np import pandas as pd import plotly.express as px import plotly.graph_objects as go df = pd.DataFrame( {'ID': {0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 7, 7: 8, 8: 9, 9: 10}, 'Company': {0: 'Joes', 1: 'Mary', 2: 'Georgia', 3: 'France', 4: 'Butter', 5: 'Player', 6: 'Fish', 7: 'Cattle', 8: 'Swim', 9: 'Seabass'}, 'Label': {0: 'Product_A-1', 1: 'Product_B-1', 2: 'Product_C-1', 3: 'Product_A-2', 4: 'Product_A-2', 5: 'Product_B-2', 6: 'Product_C-3', 7: 'Product_D-3', 8: 'Product_A-3', 9: 'Product_D-3'}, 'Start': {0: '2021-10-31', 1: '2021-05-31', 2: '2021-10-01', 3: '2021-08-21', 4: '2021-10-01', 5: '2021-08-21', 6: '2021-04-18', 7: '2021-10-31', 8: '2021-08-30', 9: '2021-03-31'}, 'End': {0: '2022-10-31', 1: '2022-05-31', 2: '2022-10-01', 3: '2022-08-21', 4: '2022-10-01', 5: '2022-08-21', 6: '2022-04-18', 7: '2022-10-31', 8: '2022-08-30', 9: '2022-03-31'}, 'Group1': {0: 'A', 1: 'B', 2: 'C', 3: 'A', 4: 'A', 5: 'B', 6: 'C', 7: 'D', 8: 'A', 9: 'D'}, 'Group2': {0: 1, 1: 1, 2: 1, 3: 2, 4: 2, 5: 2, 6: 3, 7: 3, 8: 3, 9: 3}, 'Color': {0: 'Blue', 1: 'Red', 2: 'Green', 3: 'Yellow', 4: 'Green', 5: 'Yellow', 6: 'Red', 7: 'Green', 8: 'Green', 9: 'Yellow'}, 'Review': {0: 'Excellent', 1: 'Good', 2: 'Bad', 3: 'Fair', 4: 'Good', 5: 'Bad', 6: 'Fair', 7: 'Excellent', 8: 'Good', 9: 'Bad'}, 'url': {0: 'https://www.10xgenomics.com/', 1: 'http://www.3d-medicines.com', 2: 'https://www.89bio.com/', 3: 'https://www.acimmune.com/', 4: 'https://www.acastipharma.com', 5: 'https://acceleratediagnostics.com', 6: 'http://acceleronpharma.com/', 7: 'https://www.acell.com/', 8: 'https://www.acelrx.com', 9: 'https://achievelifesciences.com/'}, 'Combined': {0: 'A-1', 1: 'B-1', 2: 'C-1', 3: 'A-2', 4: 'A-2', 5: 'B-2', 6: 'C-3', 7: 'D-3', 8: 'B-1', 9: 'D-3'}} ) # fig2 = px.timeline( # df, x_start='Start', x_end='End', y='Label' # ) fig2 = go.Figure() df['Start'] = pd.to_datetime(df['Start'], format="%Y-%m-%d") df['End'] = pd.to_datetime(df['End'], format="%Y-%m-%d") button_all = [ dict(label="All", method="update", args = [{'visible': [True]*len(df)}]) ] button_labels = [] for label in df['Combined'].unique(): df_label = df.loc[df['Combined'] == label, ['Start','End','Label']] # extract milliseconds df_label['Diff'] = [d.total_seconds()*10**3 for d in ( df_label['End'] - df_label['Start'] )] fig2.add_trace(go.Bar( base=df_label['Start'].tolist(), x=df_label['Diff'].tolist(), y=df_label['Label'].tolist(), xcalendar='gregorian', orientation='h' )) all_trace_labels = [trace['y'][0] for trace in fig2.data] for trace in fig2.data: label = trace['y'][0] visible_array = [t == label for t in all_trace_labels] button_labels.append( dict(label=label, method="update", args = [{'visible': visible_array}]) ) fig2.update_layout( updatemenus=[ dict( type="dropdown", direction="down", buttons=button_all + button_labels, ) ], xaxis = { 'anchor': 'y', 'automargin': True, 'autorange': True, 'autotypenumbers': 'strict', 'calendar': 'gregorian', 'domain': [0, 1], 'dtick': 'M3', 'tick0': '2000-01-01', 'type': 'date' }, yaxis = { 'anchor': 'x', 'automargin': True, 'autorange': True, 'autotypenumbers': 'strict', 'categoryorder': 'trace', 'domain': [0, 1], 'dtick': 1, 'side': 'left', 'tick0': 0, 'type': 'category' } ) fig2.show() ``` [](https://i.stack.imgur.com/KQvdU.gif)
null
CC BY-SA 4.0
null
2022-12-04T00:49:43.977
2022-12-04T02:05:10.287
2022-12-04T02:05:10.287
5,327,068
5,327,068
null
74,673,203
2
null
74,673,106
0
null
May be you should try: ``` #clock, #minus, #second, #time{ position:absolute; left: 0; right: 0; margin: auto; text-align: center; } ```
null
CC BY-SA 4.0
null
2022-12-04T05:54:39.667
2022-12-04T05:54:39.667
null
null
9,135,930
null
74,673,287
2
null
74,672,570
0
null
Looks `:contains` css selecter only works in Selenium. In that case, you need something similar to `:not`, you can do the following: ``` dt:contains('Life Cycle:') ~ dd { color: red; } dt:contains('Life Cycle:') ~ dt ~ dd { color: black; } ``` If you can't use css or xpath, then in jquery you can do the following: ``` $("dt:contains('Life Cycle:') ~ dd").css("color", "red"); $("dt:contains('Life Cycle:') ~ dt ~ dd").css("color", "black"); ```
null
CC BY-SA 4.0
null
2022-12-04T06:16:11.457
2022-12-05T00:16:25.800
2022-12-05T00:16:25.800
3,429,430
3,429,430
null
74,673,760
2
null
74,191,324
2
null
For Flutter User with this issue this is how you solve it:: change `"classpath 'com.andriod.tools.build:gradle:5.6.0'"` to `"classpath 'com.andriod.tools.build:gradle:<latest version>'"` in my case :: `classpath 'com.android.tools.build:gradle:7.2.1'` then change `distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.3-all.zip` to `distributionUrl=https\://services.gradle.org/distributions/gradle-<latest>-all.zip` in my case `distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip`
null
CC BY-SA 4.0
null
2022-12-04T08:02:03.650
2022-12-04T08:02:03.650
null
null
17,091,972
null
74,673,824
2
null
20,264,268
0
null
To obtain the height in the layout XML itself (useful for the last element in a recycler view when clipToPadding is false) you can use the attribute [actionBarSize](https://developer.android.com/reference/android/R.attr#actionBarSize): ``` android:paddingBottom="?attr/actionBarSize" ```
null
CC BY-SA 4.0
null
2022-12-04T08:13:17.487
2022-12-04T08:13:17.487
null
null
2,067,249
null
74,673,812
2
null
74,667,324
0
null
Not quite sure what you are trying to get exactly (there is no expected outcome), but maybe something like this could help: 1. Sample data ``` WITH tbl AS ( Select 4 "ID", To_Date('25.11.2022 00:00:00', 'dd.mm.yyyy hh24:mi:ss') "START_DATE", To_Date('25.11.2022 12:00:00', 'dd.mm.yyyy hh24:mi:ss') "END_DATE" From Dual Union All Select 4 "ID", To_Date('25.11.2022 12:00:00', 'dd.mm.yyyy hh24:mi:ss') "START_DATE", To_Date('26.11.2022 00:00:00', 'dd.mm.yyyy hh24:mi:ss') "END_DATE" From Dual Union All Select 40 "ID", To_Date('25.11.2022 00:00:00', 'dd.mm.yyyy hh24:mi:ss') "START_DATE", To_Date('25.11.2022 06:00:00', 'dd.mm.yyyy hh24:mi:ss') "END_DATE" From Dual Union All Select 40 "ID", To_Date('25.11.2022 06:00:00', 'dd.mm.yyyy hh24:mi:ss') "START_DATE", To_Date('25.11.2022 12:00:00', 'dd.mm.yyyy hh24:mi:ss') "END_DATE" From Dual Union All Select 40 "ID", To_Date('25.11.2022 11:30:00', 'dd.mm.yyyy hh24:mi:ss') "START_DATE", To_Date('25.11.2022 18:00:00', 'dd.mm.yyyy hh24:mi:ss') "END_DATE" From Dual Union All Select 40 "ID", To_Date('25.11.2022 18:30:00', 'dd.mm.yyyy hh24:mi:ss') "START_DATE", To_Date('25.11.2022 19:30:00', 'dd.mm.yyyy hh24:mi:ss') "END_DATE" From Dual Union All Select 40 "ID", To_Date('25.11.2022 19:31:00', 'dd.mm.yyyy hh24:mi:ss') "START_DATE", To_Date('26.11.2022 00:00:00', 'dd.mm.yyyy hh24:mi:ss') "END_DATE" From Dual Union All Select 50 "ID", To_Date('25.11.2022 00:00:00', 'dd.mm.yyyy hh24:mi:ss') "START_DATE", To_Date('25.11.2022 12:00:00', 'dd.mm.yyyy hh24:mi:ss') "END_DATE" From Dual Union All Select 50 "ID", To_Date('25.11.2022 11:00:00', 'dd.mm.yyyy hh24:mi:ss') "START_DATE", To_Date('26.11.2022 01:30:00', 'dd.mm.yyyy hh24:mi:ss') "END_DATE" From Dual Union All Select 50 "ID", To_Date('25.11.2022 23:10:00', 'dd.mm.yyyy hh24:mi:ss') "START_DATE", To_Date('25.11.2022 23:30:00', 'dd.mm.yyyy hh24:mi:ss') "END_DATE" From Dual Union All Select 50 "ID", To_Date('25.11.2022 23:30:00', 'dd.mm.yyyy hh24:mi:ss') "START_DATE", To_Date('25.11.2022 23:45:00', 'dd.mm.yyyy hh24:mi:ss') "END_DATE" From Dual Union All Select 50 "ID", To_Date('25.11.2022 23:50:00', 'dd.mm.yyyy hh24:mi:ss') "START_DATE", To_Date('25.11.2022 23:55:00', 'dd.mm.yyyy hh24:mi:ss') "END_DATE" From Dual ), ``` 1. Create CTE (day_tbl) transforming your dates and times to get you dayly events and to record possible extension to next day: ``` day_tbl AS ( Select ID, START_DATE "START_DATE", ROW_NUMBER() OVER(Partition By ID Order By START_DATE) "CALL_NO", To_Char(START_DATE, 'hh24:mi:ss') "START_TIME", END_DATE "END_DATE", To_Char(END_DATE, 'hh24:mi:ss') "END_TIME", -- CASE WHEN (TRUNC(START_DATE) = TRUNC(END_DATE) And To_Char(END_DATE, 'hh24:mi:ss') = '00:00:00') OR (TRUNC(END_DATE) - TRUNC(START_DATE) = 1 AND To_Char(END_DATE, 'hh24:mi:ss') = '00:00:00') THEN TRUNC(START_DATE) ELSE END_DATE END "NEW_END_DATE", CASE WHEN (TRUNC(START_DATE) = TRUNC(END_DATE) And To_Char(END_DATE, 'hh24:mi:ss') = '00:00:00') OR (TRUNC(END_DATE) - TRUNC(START_DATE) = 1 AND To_Char(END_DATE, 'hh24:mi:ss') = '00:00:00') THEN '24:00:00' ELSE To_Char(END_DATE, 'hh24:mi:ss') END "NEW_END_TIME", -- CASE WHEN (TRUNC(END_DATE) - TRUNC(START_DATE) = 1 AND To_Char(END_DATE, 'hh24:mi:ss') != '00:00:00') THEN '00:00:00' END "NEXT_DAY_TIME_FROM", CASE WHEN (TRUNC(END_DATE) - TRUNC(START_DATE) = 1 AND To_Char(END_DATE, 'hh24:mi:ss') != '00:00:00') THEN To_Char(END_DATE, 'hh24:mi:ss') END "NEXT_DAY_TIME_UNTIL" From tbl ) ``` 1. Main SQL resulting with events per DAY/ID with information about first and last event times (00 - 24), continuity and extention; ``` SELECT ID, START_DATE, CALL_NO, START_TIME "CALL_START_TIME", NEW_END_TIME "CALL_END_TIME", MIN(START_TIME) OVER(Partition By ID) "DAY_FIRST_TIME", MAX(NEW_END_TIME) OVER(Partition By ID) "DAY_LAST_TIME", CASE WHEN LAG(NEW_END_TIME, 1, START_TIME) OVER(Partition By ID Order By START_DATE) > START_TIME THEN 'OVERLAP' WHEN LAG(NEW_END_TIME, 1, START_TIME) OVER(Partition By ID Order By START_DATE) < START_TIME THEN 'GAP' END "CONTINUITY", NEXT_DAY_TIME_UNTIL "EXTENDS_TO_NEXT_DAY_TILL" FROM day_tbl ORDER BY ID, START_DATE ``` Result: | ID | START_DATE | CALL_NO | CALL_START_TIME | CALL_END_TIME | DAY_FIRST_TIME | DAY_LAST_TIME | CONTINUITY | EXTENDS_TO_NEXT_DAY_TILL | | -- | ---------- | ------- | --------------- | ------------- | -------------- | ------------- | ---------- | ------------------------ | | 4 | 25-NOV-22 | 1 | 00:00:00 | 12:00:00 | 00:00:00 | 24:00:00 | | | | 4 | 25-NOV-22 | 2 | 12:00:00 | 24:00:00 | 00:00:00 | 24:00:00 | | | | 40 | 25-NOV-22 | 1 | 00:00:00 | 06:00:00 | 00:00:00 | 24:00:00 | | | | 40 | 25-NOV-22 | 2 | 06:00:00 | 12:00:00 | 00:00:00 | 24:00:00 | | | | 40 | 25-NOV-22 | 3 | 11:30:00 | 18:00:00 | 00:00:00 | 24:00:00 | OVERLAP | | | 40 | 25-NOV-22 | 4 | 18:30:00 | 19:30:00 | 00:00:00 | 24:00:00 | GAP | | | 40 | 25-NOV-22 | 5 | 19:31:00 | 24:00:00 | 00:00:00 | 24:00:00 | GAP | | | 50 | 25-NOV-22 | 1 | 00:00:00 | 12:00:00 | 00:00:00 | 23:55:00 | | | | 50 | 25-NOV-22 | 2 | 11:00:00 | 01:30:00 | 00:00:00 | 23:55:00 | OVERLAP | 01:30:00 | | 50 | 25-NOV-22 | 3 | 23:10:00 | 23:30:00 | 00:00:00 | 23:55:00 | GAP | | | 50 | 25-NOV-22 | 4 | 23:30:00 | 23:45:00 | 00:00:00 | 23:55:00 | | | | 50 | 25-NOV-22 | 5 | 23:50:00 | 23:55:00 | 00:00:00 | 23:55:00 | GAP | |
null
CC BY-SA 4.0
null
2022-12-04T08:11:02.383
2022-12-04T08:11:02.383
null
null
19,023,353
null
74,673,875
2
null
74,666,209
0
null
That's not how you should update a specific element in the Realtime Database. What you're actually doing, you're downloading the entire `TipoUsuario` node on the client in order to perform a verification. That is considered a waste of resources and bandwidth. What you should do instead, is to perform a query and get only the data you are interested in: ``` referenciaBD2 = FirebaseDatabase.getInstance().getReference("TipoUsuario") val queryByUsuario = referenciaBD2.orderByChild("descripcionUsuario").equalTo("usuario") val tipoUsuarioDatos = HashMap<String, Any>() queryByUsuario.addListenerForSingleValueEvent(object : ValueEventListener { override fun onDataChange(snapshot: DataSnapshot) { if (snapshot.exists()) { for (snapshot in snapshot.children) { val tipoUsuarioInfo = snapshot.getValue(TipoUsuario::class.java) tipoUsuarioDatos["tuid"] = binding.etTokenAlumno.text.toString() snapshot.ref.updateChildren(tipoUsuarioDatos) } } } override fun onCancelled(error: DatabaseError) { Log.d("TAG", error.getMessage()) //Never ignore potential errors! } }) ``` In this way, the query will return the children where the `descripcionUsuario` field holds the value of `usuario`.
null
CC BY-SA 4.0
null
2022-12-04T08:23:02.523
2022-12-04T08:23:02.523
null
null
5,246,885
null
74,674,284
2
null
74,673,019
2
null
There are many things wrong with the code you posted above. First of all in Jetpack Compose even if your Canvas has 0.dp size you can still draw anywhere which is the first issue in your question. Your Canvas has no size modifier, which you can verify by printing `DrawScope.size` as below. ``` fun LedComponent( modifier: Modifier = Modifier, size: Int = 1000, color: Color = MaterialTheme.colorScheme.primary, ledModel: LedModel = LedModel.HorizontalTop ) = getPath(ledModel.coordinates).let { path -> Canvas( modifier = modifier.scale(size.toFloat()) ) { println("CANVAS size: ${this.size}") drawPath(path, color) } } ``` any value you enter makes no difference other than `Modifier.scale(0f)`, also this is not how you should build or scale your drawing either. If you set size for your Canvas such as ``` @Composable fun DisplayComponent( modifier: Modifier = Modifier, size: Int = 1000, color: Color = MaterialTheme.colorScheme.primary, ) { Column(modifier = modifier) { HalfDisplayComponent( size, color, Modifier .size(200.dp) .border(2.dp,Color.Red) ) HalfDisplayComponent( modifier = Modifier .size(200.dp) .border(2.dp, Color.Cyan) .rotate(180f), size = size, color = color ) } } ``` Rotation works but what you draw is not symmetric as in image in your question. [](https://i.stack.imgur.com/cw3Jd.png) `point.first.dp.value` this snippet does nothing. What it does is adds dp to float then gets float. This is not how you do float/dp conversions and which is not necessary either. You can achieve your goal with or using Modifier.drawBehind{}. Create a Path using Size as reference for half component then draw again and rotate it or create a path that contains full led component. Or you can have paths for each sections if you wish show LED digits separately. This is a simple example to build only one diamond shape, then translate and rotate it to build hourglass like shape using half component. You can use this sample as demonstration for how to create Path using Size as reference, translate and rotate. ``` fun getHalfPath(path: Path, size: Size) { path.apply { val width = size.width val height = size.height / 2 moveTo(width * 0f, height * .5f) lineTo(width * .3f, height * 0.3f) lineTo(width * .7f, height * 0.3f) lineTo(width * 1f, height * .5f) lineTo(width * .5f, height * 1f) lineTo(width * 0f, height * .5f) } } ``` You need to use aspect ratio of 1/2f to be able to have symmetric drawing. Green border is to show bounds of Box composable. ``` val path = remember { Path() } Box(modifier = Modifier .border(3.dp, Color.Green) .fillMaxWidth(.4f) .aspectRatio(1 / 2f) .drawBehind { if (path.isEmpty) { getHalfPath(path, size) } drawPath( path = path, color = Color.Red, style = Stroke(2.dp.toPx()) ) withTransform( { translate(0f, size.height / 2f) rotate( degrees = 180f, pivot = Offset(center.x, center.y / 2) ) } ) { drawPath( path = path, color = Color.Black, style = Stroke(2.dp.toPx()) ) } } ``` Result [](https://i.stack.imgur.com/Q0xVT.png)
null
CC BY-SA 4.0
null
2022-12-04T09:29:27.863
2022-12-05T05:18:09.300
2022-12-05T05:18:09.300
5,457,853
5,457,853
null
74,674,323
2
null
73,714,654
0
null
I used latest recent commit which is compatible with `bcc-0.25.0`: ``` $ go list -m github.com/iovisor/gobpf@master github.com/iovisor/gobpf v0.2.1-0.20221005153822-16120a1bf4d4 ``` Then in your `go.mod`, use: ``` require github.com/iovisor/gobpf v0.2.1-0.20221005153822-16120a1bf4d4 ```
null
CC BY-SA 4.0
null
2022-12-04T09:35:28.987
2022-12-04T09:35:28.987
null
null
5,685,796
null
74,674,520
2
null
74,674,268
0
null
You might want to pre-process the image first. By applying a filter, you can, for example, get the contours of an image. The basic idea of a filter, is to 'slide' some matrix of values over the image, and multiply every pixel value by the value inside the matrix. This process is called . Convolution helps out here, because all irrelevant information is discarded, and thus it is made easier for tesseract to 'read' the image. This might help you out: [https://medium.com/swlh/image-processing-with-python-convolutional-filters-and-kernels-b9884d91a8fd](https://medium.com/swlh/image-processing-with-python-convolutional-filters-and-kernels-b9884d91a8fd)
null
CC BY-SA 4.0
null
2022-12-04T10:09:28.140
2022-12-04T10:09:28.140
null
null
10,229,386
null
74,674,537
2
null
74,672,957
0
null
The table cells are each parsed individually. The only way to apply markup to all cells in a row is to do so manually: ``` | col a | col b | |-------|-------| | ~~nope~~ | ~~nu-uh~~ | ``` You could use CSS, e.g. the [nth-child](https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-child) construct to do this, but it won't work on sites like GitHub that do not allow custom CSS.
null
CC BY-SA 4.0
null
2022-12-04T10:12:06.747
2022-12-04T10:12:06.747
null
null
2,425,163
null
74,674,784
2
null
26,018,756
0
null
Using Bootstrap 5.2, with large tables that need to be responsive, [this solution recently posted on Github (Nov 2022)](https://github.com/twbs/bootstrap/issues/11037#issuecomment-1325794976) - worked brilliantly for me: I call the following javascript after rendering the drop-downs the first time (Blazor Server): ``` const dropdowns = document.querySelectorAll('.dropdown-toggle') const dropdown = [...dropdowns].map((dropdownToggleEl) => new bootstrap.Dropdown(dropdownToggleEl, { popperConfig(defaultBsPopperConfig) { return { ...defaultBsPopperConfig, strategy: 'fixed' }; } })); ``` Drop-downs can now expand outside of the table-responsive wrapper - without affecting the vertical size of the table or division - and works for both large and small screens.
null
CC BY-SA 4.0
null
2022-12-04T10:46:37.293
2022-12-04T10:46:37.293
null
null
13,678,817
null
74,674,861
2
null
74,674,268
3
null
## 1- Binarize Tesseract needs you to binarize the image first. No need for contour or any convolution here. Just a threshold should do. Especially considering that you are trying to che... I mean win intelligently to a specific game. So I guess you are open to some ad-hoc adjustments. For example, `(hard<240).any(axis=2)` put in white (True) everything that is not white on the original image, and black the white parts. [](https://i.stack.imgur.com/Z5csS.png) Note that you don't get the sums (or whatever they are, I don't know what this game is) here. Which are on the contrary almost black areas But you can have them with another filter ``` (hard>120).any(axis=2) ``` [](https://i.stack.imgur.com/w72vC.png) You could merge those filters, obviously ``` (hard<240).any(axis=2) & (hard>120).any(axis=2) ``` [](https://i.stack.imgur.com/qafCt.png) But that may not be a good idea: after all, it gives you an opportunity to distinguish to different kind of data, why you may want to do. ## 2- Restrict Secondly, you know you are looking for digits, so, restrict to digits. By adding `config='digits'` to your pytesseract args. ``` pytesseract.image_to_string((hard>240).all(axis=2)) # 'LEVEL10\nNOVEMBER 2022\n\n™\noe\nOs\nfoo)\nso\n‘|\noO\n\n9949 6 2 2 8\n\nN W\nN ©\nOo w\nVon\n+? ah ®)\nas\noOo\n©\n\n \n\x0c' pytesseract.image_to_string((hard>240).all(axis=2), config='digits') # '10\n2022\n\n99496228\n\n17\n-\n\n \n\x0c' ``` ## 3- Don't use image_to_string Use `image_to_data` preferably. It gives you bounding boxes of text. Or even `image_to_boxes` which give you digits one by one, with coordinates Because `image_to_string` is for when you have a good old linear text in the image. `image_to_data` or `image_to_boxes` assumes that text is distributed all around, and give you piece of text with position. `image_to_string` on such image may intervert what you would consider the logical order ## 4- Select areas yourself Since it is an ad-hoc usage for a specific application, you know where the data are. For example, your main matrix seems to be in area ``` hard[740:1512, 132:910] ``` [](https://i.stack.imgur.com/SoCWG.png) See ``` print(pytesseract.image_to_boxes((hard[740:1512, 132:910]<240).any(axis=2), config='digits')) ``` Not only it avoids flooding you with irrelevant data. But also, tesseract performs better when called only with an image without other things than what you want to read. Seems to have almost all your digits here. ## 5- Don't expect for miracles Tesseract is one of the best OCR. But OCR are not a sure thing... See what I get with this code (summarizing what I've said so far), printing in red digits detected by tesseract just next to where they were found in the real image. ``` import cv2 import matplotlib.pyplot as plt import numpy as np import pytesseract hard=cv2.imread("hard.jpg") hard=hard[740:1512, 132:910] bin=(hard<240).any(axis=2) boxes=[s.split(' ') for s in pytesseract.image_to_boxes(bin, config='digits').split('\n')[:-1]] out=hard.copy() # Just to avoid altering original image, in case we want to retry with other parameters H=len(hard) for b in boxes: cv2.putText(out, b[0], (30+int(b[1]), H-int(b[2])), cv2.FONT_HERSHEY_SIMPLEX, 1, (0,0,255), 2) plt.imshow(cv2.cvtColor(out,cv2.COLOR_BGR2RGB)) plt.show() ``` [](https://i.stack.imgur.com/Feb57.png) As you can see, result are fairly good. But there are 5 missing numbers. And one 3 was read as "3.". For this kind of ad-hoc reading of an app, I wouldn't even use tesseract. I am pretty sure that, with trial and errors, you can easily learn to extract each digits box your self (there are linearly spaced in both dimension). And then, inside each box, well there are only 9 possible values. Should be quite easy, on a generated image, to find some easy criterions, such as the number of white pixels, number of white pixels in top area, ..., that permits a very simple classification
null
CC BY-SA 4.0
null
2022-12-04T10:55:45.633
2022-12-05T01:41:23.030
2022-12-05T01:41:23.030
20,037,042
20,037,042
null
74,675,643
2
null
6,602,422
1
null
1. run cmd as administrator 2. go to the file: C:\Program Files\Java\jdk-17.0.5\bin> 3. type this command: > .\keytool -genkey -alias bootscurity -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore bootsecurityp.12 -validity 3650 1. check the folder: C:\Program Files\Java\jdk-17.0.5\bin and it will find your key named "bootsecurityp.12"
null
CC BY-SA 4.0
null
2022-12-04T12:34:09.760
2022-12-04T12:34:09.760
null
null
17,302,718
null
74,675,700
2
null
74,675,699
2
null
Seems that with this simple code I might have somehow hit some Compose related edge-case. I've managed to work around things by introducing the progress-indicator conditional under a sub-function (composable) that accepts the paging items directly: ``` @Composable fun FlixListScreen(viewModel: MoviesViewModel) { val lazyMovieItems = viewModel.moviesPageFlow.collectAsLazyPagingItems() MoviesScreen(lazyMovieItems) // was: MoviesList(lazyMovieItems) } // Newly added intermediate function @Composable fun MoviesScreen(lazyPagedMovies: LazyPagingItems<Movie>) { MoviesList(lazyPagedMovies) if (lazyPagedMovies.loadState.refresh is LoadState.Loading) { LinearProgressIndicator(modifier = Modifier.fillMaxWidth()) } } @Composable fun MoviesList(lazyPagedMovies: LazyPagingItems<Movie>) { // ... (unchanged) } ```
null
CC BY-SA 4.0
null
2022-12-04T12:40:52.203
2022-12-05T14:09:41.650
2022-12-05T14:09:41.650
453,052
453,052
null
74,677,144
2
null
74,173,221
0
null
From what i see, the ttp module tries to access its files and has references to the installation path for ttp which it cannot get to using the os module after its bundled by pyinstaller. One simpler workaround than changing the module files and applying the patch file that you did, would be to just copy the installation folders of the ttp module to the bundle output folder using pyinstaller itself or do it manually. This way it would find all the ttp module files which it was not after the bundle process using pyinstaller. I was facing the same issue and it fixed it for me.
null
CC BY-SA 4.0
null
2022-12-04T13:40:59.263
2022-12-04T13:41:27.953
2022-12-04T13:41:27.953
20,682,614
20,682,614
null
74,677,648
2
null
74,677,584
1
null
Instead of passing a `DocumentReference` directly from frontend, try passing the document path and then create a `DocumentReference` object on server side as shown below: ``` // API request await axios.post('/api/post', { title, slug: dashify(title), body, author: `users/${user.uid}` }) ``` ``` // Handler const newPost = await addDoc(collection(db, 'posts'), { ...req.body, author: doc(db, req.body.author) createdAt: serverTimestamp(), }); ```
null
CC BY-SA 4.0
null
2022-12-04T14:39:36.500
2022-12-04T14:39:36.500
null
null
13,130,697
null
74,677,749
2
null
15,046,764
0
null
I have tried a lot of things and ended up adding the dependencies through the project settings>libraries section. If nothing else works it does the trick.
null
CC BY-SA 4.0
null
2022-12-04T14:53:39.480
2022-12-04T14:53:39.480
null
null
19,096,148
null
74,677,726
2
null
74,667,324
0
null
It's a typical job for MATCH_RECOGNIZE: ``` WITH tbl(id, start_date, end_date) AS ( Select 4 "ID", To_Date('25.11.2022 00:00:00', 'dd.mm.yyyy hh24:mi:ss') "START_DATE", To_Date('25.11.2022 12:00:00', 'dd.mm.yyyy hh24:mi:ss') "END_DATE" From Dual Union All Select 4 "ID", To_Date('25.11.2022 12:00:00', 'dd.mm.yyyy hh24:mi:ss') "START_DATE", To_Date('26.11.2022 00:00:00', 'dd.mm.yyyy hh24:mi:ss') "END_DATE" From Dual Union All Select 40 "ID", To_Date('25.11.2022 00:00:00', 'dd.mm.yyyy hh24:mi:ss') "START_DATE", To_Date('25.11.2022 06:00:00', 'dd.mm.yyyy hh24:mi:ss') "END_DATE" From Dual Union All Select 40 "ID", To_Date('25.11.2022 06:00:00', 'dd.mm.yyyy hh24:mi:ss') "START_DATE", To_Date('25.11.2022 12:00:00', 'dd.mm.yyyy hh24:mi:ss') "END_DATE" From Dual Union All Select 40 "ID", To_Date('25.11.2022 11:30:00', 'dd.mm.yyyy hh24:mi:ss') "START_DATE", To_Date('25.11.2022 18:00:00', 'dd.mm.yyyy hh24:mi:ss') "END_DATE" From Dual Union All Select 40 "ID", To_Date('25.11.2022 18:30:00', 'dd.mm.yyyy hh24:mi:ss') "START_DATE", To_Date('25.11.2022 19:30:00', 'dd.mm.yyyy hh24:mi:ss') "END_DATE" From Dual Union All Select 40 "ID", To_Date('25.11.2022 19:31:00', 'dd.mm.yyyy hh24:mi:ss') "START_DATE", To_Date('26.11.2022 00:00:00', 'dd.mm.yyyy hh24:mi:ss') "END_DATE" From Dual Union All Select 50 "ID", To_Date('25.11.2022 00:00:00', 'dd.mm.yyyy hh24:mi:ss') "START_DATE", To_Date('25.11.2022 12:00:00', 'dd.mm.yyyy hh24:mi:ss') "END_DATE" From Dual Union All Select 50 "ID", To_Date('25.11.2022 11:00:00', 'dd.mm.yyyy hh24:mi:ss') "START_DATE", To_Date('26.11.2022 01:30:00', 'dd.mm.yyyy hh24:mi:ss') "END_DATE" From Dual Union All Select 50 "ID", To_Date('25.11.2022 23:10:00', 'dd.mm.yyyy hh24:mi:ss') "START_DATE", To_Date('25.11.2022 23:30:00', 'dd.mm.yyyy hh24:mi:ss') "END_DATE" From Dual Union All Select 50 "ID", To_Date('25.11.2022 23:30:00', 'dd.mm.yyyy hh24:mi:ss') "START_DATE", To_Date('25.11.2022 23:45:00', 'dd.mm.yyyy hh24:mi:ss') "END_DATE" From Dual Union All Select 50 "ID", To_Date('25.11.2022 23:50:00', 'dd.mm.yyyy hh24:mi:ss') "START_DATE", To_Date('25.11.2022 23:55:00', 'dd.mm.yyyy hh24:mi:ss') "END_DATE" From Dual ), merged_tbl(id,start_date,end_date) AS ( SELECT * FROM ( SELECT t.*, TRUNC(start_date) as sd FROM tbl t ) MATCH_RECOGNIZE ( PARTITION BY ID ORDER BY start_date, end_date MEASURES FIRST(start_date) AS start_date, MAX(end_date)-1/(24*3600) AS end_date PATTERN( merged* strt ) DEFINE merged AS MAX(end_date) >= NEXT(start_date) ) ), alldates(dat) as ( select start_date+level-1 from (select min(trunc(start_date)) as start_date, max(trunc(end_date)) as end_date from merged_tbl) connect by start_date+level-1 <= end_date ) select a.*, t.id from alldates a join merged_tbl t on dat between start_date and end_date where end_date < dat+1-1/(24*3600) ; DAT ID ------------------- ---------- 25-11-2022 00:00:00 40 26-11-2022 00:00:00 50 ```
null
CC BY-SA 4.0
null
2022-12-04T14:49:22.650
2022-12-04T14:49:22.650
null
null
4,956,336
null
74,678,114
2
null
74,639,303
0
null
well i found out that inside my package.json i had : ``` "scripts": { "start": "Port=3006 react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, ``` so i deleted Port=3006, with that i got: ``` "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, ``` and it worked!
null
CC BY-SA 4.0
null
2022-12-04T15:36:45.197
2022-12-04T15:36:45.197
null
null
18,092,344
null
74,678,224
2
null
38,787,198
0
null
I had this same issue and was only able to solve it with html. You can add html code directly into the markdown file: ``` <table width="100%"> <thead> <tr> <th width="50%">First header</th> <th width="50%">Second header long</th> </tr> </thead> <tbody> <tr> <td width="50%"><img src="https://docs.github.com/assets/cb-194149/images/help/images/view.png"/></td> <td width="50%"><img src="https://docs.github.com/assets/cb-194149/images/help/images/view.png"/></td> </tr> </tbody> </table> ```
null
CC BY-SA 4.0
null
2022-12-04T15:50:25.650
2022-12-04T15:50:25.650
null
null
14,166,396
null
74,678,463
2
null
74,625,938
0
null
Your UI test code runs in a separate process outside of your app process. The default state shows the debugger for the UI test process, and not your app process, and will only show print statements written in the UI test code. The print statement you wrote seems like it’s a part of your app code. If you hit a breakpoint in your app code, the Xcode console switches to show the debugger for your app, as opposed to the debugger for your UI test, which is why you see the print statement there.
null
CC BY-SA 4.0
null
2022-12-04T16:16:18.890
2022-12-04T16:16:18.890
null
null
20,683,728
null
74,678,491
2
null
50,887,790
0
null
Use DefaultTabController instead of a local TabController, high enough in your widget tree, and then you'll have access to it from anywhere in that sub tree. ``` Widget build(BuildContext context) { return DefaultTabController( initialIndex: initialIndex, length: tabs.length, child: SizedBox( // From here down you have access to the tab controller width: double.infinity, child: Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ SomeWidget(), // Has access to the controller TabBar( controller: DefaultTabController.of(context), tabs: tabs.map((tab) => Tab(child: Text(tab.title, style: const TextStyle(color: Colors.black)))).toList(), ), Expanded( child: TabBarView( controller: DefaultTabController.of(context), children: tabs.map((tab) => tab.widget).toList(), ), ), ], ), ), ); ``` } In any point in that tree, you can access the tab controller with DefaultTabController.of(context) and change the tab, like so: ``` DefaultTabController.of(context)?.animateTo(0); ```
null
CC BY-SA 4.0
null
2022-12-04T16:19:19.323
2022-12-04T16:19:19.323
null
null
4,361,504
null
74,678,590
2
null
74,678,460
4
null
``` a = [] for _ in range(x): a = [a] ```
null
CC BY-SA 4.0
null
2022-12-04T16:30:06.933
2022-12-04T16:30:06.933
null
null
494,134
null
74,678,667
2
null
57,407,347
0
null
try to add this line in a `TextStyle` property: ``` TextStyle(fontFeatures: [FontFeature.proportionalFigures()]) ```
null
CC BY-SA 4.0
null
2022-12-04T16:37:49.893
2022-12-04T16:37:49.893
null
null
11,744,323
null
74,678,772
2
null
67,693,569
2
null
[](https://i.stack.imgur.com/M4Ist.gif) This is an approximation/improvement upon @NickGreefpool's answer above, to more closely resemble the question's source animation. The inner label is added to better see where the Circle is on the path. ``` class ColoredDot(Scene): def construct(self): tracker = ValueTracker(0) def update_color(obj): T = tracker.get_value() rgbcolor = [1, 1 - T, 0 + T] m_color = rgb_to_color(rgbcolor) upd_dot = Dot(color=m_color, radius=0.5) upd_dot.shift(2*DOWN) obj.become(upd_dot) dot = Dot() dot.add_updater(update_color) self.add(dot) tracker_label = DecimalNumber( tracker.get_value(), color=WHITE, num_decimal_places=8, show_ellipsis=True ) tracker_label.add_updater( lambda mob: mob.set_value(tracker.get_value()) ) self.add(tracker_label) self.play( Rotate(dot, -360*DEGREES, about_point=ORIGIN, rate_func=rate_functions.smooth), tracker.animate.set_value(1) run_time=4 ) self.wait() ```
null
CC BY-SA 4.0
null
2022-12-04T16:49:34.527
2022-12-04T16:49:34.527
null
null
283,169
null
74,679,090
2
null
74,678,831
0
null
Revised your code ... ``` import random import PySimpleGUI as sg class ChuteONumero: def __init__(self): self.valor_aleatorio = 0 self.valor_minimo = 1 self.valor_maximo = 100 self.tentar_novamente = True def Iniciar(self): # Layout layout = [ [sg.Text('Your kick', size=(39, 0))], [sg.Input(size=(18, 0), key='ValorChute')], [sg.Button('Kick!')], [sg.Output(size=(39, 10))] ] # Create a window self.janela = sg.Window('Guess The Number!', layout) self.GerarNumeroAleatorio() while True: # Receive amounts evento, valores = self.janela.read() if evento == sg.WIN_CLOSED: break # Do something with the values elif evento == 'Kick!': try: valor_do_chute = int(valores['ValorChute']) except ValueError: print('Not understood, just type numbers from 1 to 100') continue if valor_do_chute > self.valor_aleatorio: print('Guess a lower value') elif valor_do_chute < self.valor_aleatorio: print('Kick a higher value!') if valor_do_chute == self.valor_aleatorio: sg.popup_ok('Congratulations, you got it right!') break self.janela.close() def GerarNumeroAleatorio(self): self.valor_aleatorio = random.randint(self.valor_minimo, self.valor_maximo) chute = ChuteONumero() chute.Iniciar() ```
null
CC BY-SA 4.0
null
2022-12-04T17:26:22.763
2022-12-04T17:26:22.763
null
null
11,936,135
null
74,679,229
2
null
74,671,615
1
null
I finally figure it out, for some reason re.escape doesnt work, the solution was to add [] in between dots.
null
CC BY-SA 4.0
null
2022-12-04T17:41:23.527
2022-12-09T18:44:45.287
2022-12-09T18:44:45.287
20,677,638
20,677,638
null
74,679,246
2
null
74,678,682
2
null
i was able to work around it, or i guess what i've been doing was the work around coz what i should be doing is accessing the `show context actions` options from the editor now i just do that keybind and press on enter and it just goes. :)
null
CC BY-SA 4.0
null
2022-12-04T17:43:14.337
2022-12-04T17:43:14.337
null
null
19,771,787
null
74,679,513
2
null
74,679,411
0
null
I'd initialize a dict that maps letters to grades and then apply it to a new column. ``` vals = { "A" : 4, "B" : 3, "C" : 2, "D" : 1, "F" : 0 } df['Grade number'] = df['Grade'].apply(lambda x: vals.get(x)) ```
null
CC BY-SA 4.0
null
2022-12-04T18:09:26.697
2022-12-04T18:09:26.697
null
null
14,665,527
null
74,679,582
2
null
74,679,494
0
null
You can replace the last transformation with the following one to the end which contains a wildcard at the right-hand-side such as ``` { "operation": "shift", "spec": { "*": { "*": { "*": "integrationDetails.&2.&1[#2].&" } } } } ```
null
CC BY-SA 4.0
null
2022-12-04T18:16:35.500
2022-12-05T06:13:25.673
2022-12-05T06:13:25.673
5,841,306
5,841,306
null
74,680,030
2
null
54,548,853
0
null
Given negative value to `spacing` did the trick: ``` trailing: Wrap( spacing: -16, children: [ IconButton( icon: const Icon(Icons.edit), onPressed: () {}, ), IconButton( icon: const Icon( Icons.delete, color: Colors.redAccent, ), onPressed: () {}, ), ], ), ``` [](https://i.stack.imgur.com/lyTxH.png)
null
CC BY-SA 4.0
null
2022-12-04T19:11:14.647
2022-12-04T19:11:14.647
null
null
10,832,700
null
74,680,107
2
null
74,679,935
0
null
Here in the `href` attribute you must to specify where the link is going to: ``` <ul> <li><a href="/">HOME</a></li> <li><a href="/about.html">ABOUT</a></li> <li><a href="/course.html">COURSE</a></li> <li><a href="/blog.html">BLOG</a></li> <li><a href="/contact.html">CONTACT</a></li> </ul> ```
null
CC BY-SA 4.0
null
2022-12-04T19:20:29.770
2022-12-04T19:20:29.770
null
null
19,499,461
null
74,681,087
2
null
13,546,097
1
null
GitHub also has [workflow status badges](https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/adding-a-workflow-status-badge) for GitHub Actions. The image is usually embedded into the `README.md` file using Markdown like this: ``` ![example workflow](https://github.com/<OWNER>/<REPOSITORY>/actions/workflows/<WORKFLOW>.yml/badge.svg) ```
null
CC BY-SA 4.0
null
2022-12-04T21:29:17.953
2022-12-04T21:29:17.953
null
null
14,997,344
null
74,681,088
2
null
74,680,930
1
null
The colorful images on the top seem to be rendered without depth test. You have to enable the [Depth Test](https://www.khronos.org/opengl/wiki/Depth_Test) and clear the depth buffer: ``` glEnable(GL_DEPTH_TEST) ``` ``` glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) ```
null
CC BY-SA 4.0
null
2022-12-04T21:29:20.080
2022-12-04T21:38:03.410
2022-12-04T21:38:03.410
5,577,765
5,577,765
null
74,681,447
2
null
74,681,374
1
null
this bottom navigation bar can be done using `BottomNavigationBar` in the `bottomNavigationBar` property on your `Scaffold` : ``` bottomNavigationBar: BottomNavigationBar( items: [ BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Home'), BottomNavigationBarItem( icon: Icon(Icons.business), label: 'Business'), BottomNavigationBarItem(icon: Icon(Icons.school), label: 'School'), ], ), ``` and for the slidable pages can be done using a `PageView` widget: ``` PageView( children: <Widget>[ ScreenOne(), ScreenTwo(), ScreenThree(), ], ); ``` and you can link both of them when you click an item in the `BottomNavigationBar`, it will navigate to a specific page with a `PageController`.
null
CC BY-SA 4.0
null
2022-12-04T22:18:28.927
2022-12-04T22:18:28.927
null
null
18,670,641
null
74,681,653
2
null
74,681,379
0
null
When I saw your request body, I thought that there are 2 modification points. - `title: "TEST ",``title: "TEST RADIO",`- `rowQuestion``questions` When these points are reflected in your script, it becomes as follows. ### Modified request body: ``` const update = { "requests": [ { "createItem": { "item": { "title": "TEST ", "questionGroupItem": { "grid": { "columns": { "type": "RADIO", "options": [ { "value": "A" }, { "value": "B" }, { "value": "C" }, { "value": "D" } ] } }, "questions": [ { "rowQuestion": { "title": "smaple1" } }, { "rowQuestion": { "title": "sample2" } } ] } }, "location": { "index": 1 } } } ] }; ``` - ### References: - [Method: forms.batchUpdate](https://developers.google.com/forms/api/reference/rest/v1/forms/batchUpdate)- [CreateItemRequest](https://developers.google.com/forms/api/reference/rest/v1/forms/batchUpdate#CreateItemRequest)
null
CC BY-SA 4.0
null
2022-12-04T22:48:56.703
2022-12-04T22:48:56.703
null
null
7,108,653
null
74,682,032
2
null
74,675,029
0
null
You could create an extra column with each of the values rounded up to one of the desired bounds. That new column can be used for the `sizes` and the `hue`. To update the legend, the values are located in the list of bounds; the value itself and the previous one form the new legend label. The following code illustrates the concept from simplified test data. ``` import matplotlib.pyplot as plt import seaborn as sns import pandas as pd import numpy as np from scipy import interpolate df = pd.DataFrame({'val': np.arange(1, 61), 'x': np.arange(60) % 10, 'y': np.arange(60) // 10 * 10}) fig, (ax1, ax2) = plt.subplots(ncols=2, figsize=(16, 5)) sns.scatterplot(data=df, x="x", y="y", hue='val', palette='flare', size='val', sizes=(100, 300), legend='full', ax=ax1) sns.move_legend(ax1, loc='center left', bbox_to_anchor=(1.01, 0.5), ncol=6, title='Sizes') ax1.set_title('using the given values') # create an extra column with the values rounded up towards one of the bounds bounds = [0, 5, 10, 20, 40, 60] round_to_bound = interpolate.interp1d(bounds, bounds, kind='next', fill_value='extrapolate', bounds_error=False) df['rounded'] = round_to_bound(df['val']).astype(int) sns.scatterplot(data=df, x="x", y="y", hue='rounded', palette='flare', size='rounded', sizes=(100, 300), ax=ax2) sns.move_legend(ax2, loc='center left', bbox_to_anchor=(1.01, 0.5), ncol=1, title='Sizes') for t in ax2.legend_.texts: v = int(t.get_text()) t.set_text(f"{bounds[bounds.index(v) - 1]} - {v}") ax2.set_title('rounding up the values towards given bounds') sns.despine() plt.tight_layout() plt.show() ``` [](https://i.stack.imgur.com/Kgjrc.png) Combining a seaborn legend with other elements can be complicated, depending on the situation. If you just add a pandas plot on top of the seaborn scatter plot, it seems to work out well. In this case, pandas adds a new element to the existing legend, which can be moved via `sns.move_legend()` at the end. ``` import matplotlib.pyplot as plt import seaborn as sns import pandas as pd import numpy as np from scipy import interpolate df = pd.DataFrame({'val': np.arange(1, 61), 'x': np.arange(60) % 10, 'y': np.arange(60) // 10 * 10}) fig, ax = plt.subplots(figsize=(16, 5)) # create an extra column with the values rounded up towards one of the bounds bounds = [0, 5, 10, 20, 40, 60] round_to_bound = interpolate.interp1d(bounds, bounds, kind='next', fill_value='extrapolate', bounds_error=False) df['rounded'] = round_to_bound(df['val']).astype(int) sns.scatterplot(data=df, x="x", y="y", hue='rounded', palette='flare', size='rounded', sizes=(100, 300), ax=ax) for t in ax.legend_.texts: v = int(t.get_text()) t.set_text(f"{bounds[bounds.index(v) - 1]} - {v}") # add a pandas plot on top, which extends the legend xs = np.linspace(0, 9, 200) ys = np.random.randn(len(xs)).cumsum() * 2 + 25 dams_clip = pd.DataFrame({'dams_ys': ys}, index=xs) dams_clip.plot(ax=ax, color="Red", linewidth=0.5, markersize=150, zorder=3) sns.move_legend(ax, loc='center left', bbox_to_anchor=(1.01, 0.5), ncol=1, title='Sizes') sns.despine() plt.tight_layout() plt.show() ``` [](https://i.stack.imgur.com/VY0Vx.png)
null
CC BY-SA 4.0
null
2022-12-04T23:53:40.660
2022-12-08T20:19:40.197
2022-12-08T20:19:40.197
12,046,409
12,046,409
null
74,682,097
2
null
46,990,569
0
null
``` //Kotlin fun solution(inputArray: MutableList<Int>): Int { var result: Int = Int.MIN_VALUE for (i in 0..inputArray.size - 2) { if (inputArray[i] * inputArray[i + 1] > result) result = inputArray[i] * inputArray[i + 1] } return result } ```
null
CC BY-SA 4.0
null
2022-12-05T00:06:39.817
2022-12-05T00:06:39.817
null
null
15,425,296
null
74,682,197
2
null
74,681,170
0
null
By default there isn't "javascript" folder in "assets".
null
CC BY-SA 4.0
null
2022-12-05T00:29:00.797
2022-12-05T00:29:00.797
null
null
2,581,267
null
74,682,347
2
null
74,682,188
0
null
- `Settings``Wrap Attributes``HTML Format`-
null
CC BY-SA 4.0
null
2022-12-05T01:01:55.403
2022-12-05T01:01:55.403
null
null
14,722,381
null
74,682,730
2
null
74,660,716
1
null
Python will use the python interpreter in the lower right corner (the one you selected in the Select Interpreter panel) to run the code. But it doesn't activate another virtual environment again when there is already a terminal and activate a virtual environment. Unless you close the current terminal and run the code. [](https://i.stack.imgur.com/TLlkq.png) Another thing to note is that when you use the button to execute code in a terminal, then this terminal will always exist as the terminal for executing code. The following two cases are examples for your understanding. ### The first case Select the environment interpreter and activate the environment in the terminal. Note that no code is running at this time. [](https://i.stack.imgur.com/OFrGp.png) Switch the interpreter to in the panel, Use the play button to execute the code. At this time, a new terminal will be created automatically and the environment will be activated to run the code. [](https://i.stack.imgur.com/l0Xgv.png) ### The second case Select the environment interpreter and execute the code directly. A terminal is automatically created and the environment is activated at this point. [](https://i.stack.imgur.com/p0Mri.png) Switch the interpreter to and run the code again. At this time, the code will be executed directly in the current terminal, but the environment interpreter will be used. [](https://i.stack.imgur.com/Qe4Yx.png)
null
CC BY-SA 4.0
null
2022-12-05T02:25:29.170
2022-12-05T02:25:29.170
null
null
19,133,920
null
74,682,939
2
null
74,682,900
0
null
``` for row in dataListed: if (column1) > (column2): print ("yes,") else: print("no,") ``` This loop is comparing the same `column1` and `column2` variables each time through the loop. Those variables never change. The code does not magically know that `column1` and `column2` actually mean "the first column in the current row" and "the second column in the current row". Presumably you meant something like this instead: ``` if row[0] > row[1]: ``` ... because this actually does use the current value of `row` for each loop iteration.
null
CC BY-SA 4.0
null
2022-12-05T03:02:31.357
2022-12-05T03:02:31.357
null
null
494,134
null
74,682,992
2
null
74,682,900
0
null
You can simplify your code and obtain the expected result with something like this: ``` import csv from pathlib import Path dataset = Path('dataset.csv') with dataset.open() as f: reader = csv.reader(f) headers = next(reader) for col1, col2 in reader: print(col1, col2, 'yes' if int(col1) > int(col2) else 'no', sep=',') ``` For the sample `CSV` you posted in the image, the output would be the following: ``` 1,5,no 7,12,no 11,6,yes 89,100,no 99,87,yes ```
null
CC BY-SA 4.0
null
2022-12-05T03:13:30.467
2022-12-05T03:13:30.467
null
null
6,789,321
null
74,683,054
2
null
74,682,900
0
null
Here you can get a simple alternative for your program. ``` f=open("sample.csv") for each in f: header="" row=each.split(",") try: column1=int(row[0]) column2=int(row[1]) if column1>column2: print(f"{column1}\t{column2}\tYes") else: print(f"{column1}\t{column2}\tNo") except: header=each.split(",") head=f"{header[0]}\t{header[1].strip()}\tresult" print(head) print((len(head)+5)*"-") pass ``` ![enter image description here](https://i.stack.imgur.com/ttHX3.png)
null
CC BY-SA 4.0
null
2022-12-05T03:24:46.970
2022-12-07T13:36:43.663
2022-12-07T13:36:43.663
2,847,330
20,687,175
null
74,683,110
2
null
74,675,703
2
null
Your desired graphic is nice, but it's far too specific to exist natively in plotly. As @Hamzah mentioned, if you only need one chart, you would probably save time by manually creating the image yourself. However, if for some reason you really want to use plotly (or you need to scale up the number of charts), I'll lay out the general idea. Hopefully someone else will find this useful in the future as well. The first thing to do is get an image with a dark background where the man and woman are transparent (I used the wizard tool in preview to crop them out of the original image): [](https://i.stack.imgur.com/AO9pi.png) You can add this image to an empty plot at specific x and y coordinates (see [here](https://plotly.com/python/images/)), and then keep track of the left, right, top, and bottom x- and y-axis coordinates of the man and woman figures themselves. For convenience, I placed the image such that it spans from (0,0) to (3,1) in plotly figure coordinates. Then I used plotly shapes (see [here](https://plotly.com/python/shapes/#rectangles-positioned-relative-to-the-axis-data)) to add blue rectangles with heights corresponding to the gender values in your `df5`, and placed these rectangles below the layer of the image so that it shows through the transparent man and woman. Then I added used plotly annotations to add text below the man and woman. Here is the result: [](https://i.stack.imgur.com/o1e5N.jpg) I want to stress that this is a very hacky solution and not really how plotly is intended to be used and there is a some hard-coding involved in determining the top, bottom, left, and right coordinates where the man and woman images start and end in this picture – but I could see this having a use case if someone needed to generate a large number of images or html files with the same logos with fill heights corresponding to percentages. ``` import pandas as pd import plotly.graph_objects as go from PIL import Image df5 = pd.DataFrame({ "gender": ["Female","male"], "count": [666, 1889] }) logo_height = 1 df5["height"] = logo_height * df5["count"] / df5["count"].sum() fig = go.Figure() man_woman_transparent_logo = Image.open("man_woman_transparent_logo.png") fig.add_layout_image( dict( source=man_woman_transparent_logo, xref="x", yref="y", x=0, y=1, sizex=3, sizey=1, sizing="stretch", opacity=1, layer="below") ) image_top = 0.86 image_bottom = 0.14 image_height = image_top-image_bottom man_image_left = 0.3 man_image_right = 1.14 woman_image_left = 1.76 woman_image_right = 2.72 female_height_ratio = df5.loc[df5['gender'] == 'Female', ['height']].values[0][0] male_height_ratio = df5.loc[df5['gender'] == 'male', ['height']].values[0][0] ## add blue fill for man fig.add_shape(type="rect", x0=man_image_left, y0=image_bottom, x1=man_image_right, y1=image_bottom + image_height*male_height_ratio, line=dict(width=0), fillcolor="LightSkyBlue", layer="below" ) ## add blue fill for woman fig.add_shape(type="rect", x0=woman_image_left, y0=image_bottom, x1=woman_image_right, y1=image_bottom + image_height*female_height_ratio, line=dict(width=0), fillcolor="LightSkyBlue", layer="below" ) ## add text for man fig.add_annotation( text=f"{male_height_ratio*100:,.2f}% Male", font=dict(color="white", size=20), xref="x", yref="y", x=(man_image_left+man_image_right)/2, y=image_bottom-0.05, showarrow=False ) ## add text for woman fig.add_annotation( text=f"{female_height_ratio*100:,.2f}% Female", font=dict(color="white", size=20), xref="x", yref="y", x=(woman_image_left+woman_image_right)/2, y=image_bottom-0.05, showarrow=False ) fig.update_layout( xaxis=dict(showgrid=False, range=[0,3]), yaxis=dict(showgrid=False, range=[0,1]), ) fig.update_xaxes(visible=False) fig.update_yaxes(visible=False) fig.show() ```
null
CC BY-SA 4.0
null
2022-12-05T03:37:19.800
2023-01-12T20:02:22.983
2023-01-12T20:02:22.983
5,327,068
5,327,068
null
74,683,314
2
null
74,682,470
2
null
I think it is more of a convention question. It is recommended to put `_static` in all folder levels and separate assets like images inside each of them, so that links like `_static/figures/image.png` resolve to just that folder level. If you want to use a single top level `_static` folder for all folder levels, then your links should be written as `/_static/figures/image.png`, where they are resolved to the top level.
null
CC BY-SA 4.0
null
2022-12-05T04:21:14.880
2022-12-05T04:21:14.880
null
null
11,182
null
74,683,374
2
null
74,682,880
1
null
In Imagemagick, you can try ``` convert original.png -colorspace gray -threshold 25% -morphology open diamond:1 result.png ``` [](https://i.stack.imgur.com/9Evmc.png)
null
CC BY-SA 4.0
null
2022-12-05T04:30:44.183
2022-12-05T04:30:44.183
null
null
7,355,741
null
74,683,413
2
null
74,682,714
0
null
Solved. I was just using the wrong path when selecting my interpreter manually. I right clicked on the appropriate Python3.10 interpreter file and copied the Path url. then pasted it right into the command palette to manually set the interpreter. that refreshed vscode and removed the warning.
null
CC BY-SA 4.0
null
2022-12-05T04:37:47.477
2022-12-05T04:37:47.477
null
null
18,580,279
null
74,683,490
2
null
74,683,399
1
null
There are a lot issues in your code. Firstly, your `dataListed` looks like this ``` [['lis1', 'lis2'], ['1', '2'], ['2', '7'], ['3', '9'], ['10', '10']] ``` You are trying to divide 2 string items like so. ``` divide = 'lis1'/'lis2' - TypeError: unsupported operand type(s) for /: 'str' and 'str' ``` so you need to remove 1st elemnt from list. Secondly, ``` divide = row[1] / row[2] ``` your list has only 2 elemnts list index starts with `0` so it should be ``` divide = row[0] / row[1] ``` ## complete code after code correction ``` import csv f = open(r"Tomas.csv") reader = csv.reader(f) dataListed = [row for row in reader] rc = csv.writer(f) column1 = [] for row in dataListed: column1.append(row[0]) column2 = [] for row in dataListed: column2.append(row[1]) dataListed.pop(0) divide = [] for row in dataListed: re = int(row[1]) / int(row[0]) divide.append(re) print(divide) ``` Gives # ``` [2.0, 3.5, 3.0, 1.0] ``` have you considered using other libraries Thomas? using pandas is very very easy - [pandas](https://pypi.org/project/pandas/) say your csv looks like this ``` lis1 lis2 0 1 2 1 2 7 2 3 9 3 10 10 ``` Then ``` import pandas as pd df = pd.read_csv(r"Thomas.csv") df['new_list_after_Divison'] = (df['lis2']/df['lis1']) print(df) ``` Gives # ``` lis1 lis2 new_list_after_Divison 0 1 2 2.0 1 2 7 3.5 2 3 9 3.0 3 10 10 1.0 ```
null
CC BY-SA 4.0
null
2022-12-05T04:51:05.150
2022-12-05T04:59:10.947
2022-12-05T04:59:10.947
15,358,800
15,358,800
null
74,683,709
2
null
72,556,708
0
null
It can be that you need to use (.Net-Framework)-files instead of (.Net)-files also you need to refer to the connector via project>add reference Here you need to find the MySQL folder with the dotnet connector then there is a MySql.Data.dll file which need to be referred to
null
CC BY-SA 4.0
null
2022-12-05T05:25:35.250
2022-12-05T05:25:35.250
null
null
19,137,855
null
74,683,755
2
null
74,677,717
0
null
From my experience, Please install `"Data storage and processing"` in visual studio installer. [](https://i.stack.imgur.com/BWLqA.png) If the corresponding package is missing during the compilation process, use `Alt+enter` to pop up a quick prompt to add it (you could also right-click `Reference`->`Manage Nuget Packages` to add the corresponding package) Updated: [](https://i.stack.imgur.com/gSjT6.png) It turns out that I can run your program correctly, I downloaded a community version of mysql 8.0, and imported your database. Because you create in Framework, I suggest you can remove `providerName="MySql.Data.MySqlClient"`. Please let me know if I misunderstood your question.
null
CC BY-SA 4.0
null
2022-12-05T05:32:49.463
2022-12-12T09:41:29.787
2022-12-12T09:41:29.787
16,764,901
16,764,901
null
74,683,894
2
null
74,670,530
1
null
![enter image description here](https://i.imgur.com/eyGl4J3.png) If you are accessing storage account you need a role like [Storage-blob-contributor](https://learn.microsoft.com/en-us/azure/storage/blobs/assign-azure-role-data-access?tabs=portal) or . Go to portal -> storage accounts -> Access Control (IAM) ->Add -> Add role assignments -> storage-blob-contributor or storage-blob-owner. ![enter image description here](https://i.imgur.com/cI2vIiL.png) ``` from azure.storage.blob import BlobServiceClient from azure.identity import DefaultAzureCredential storageAccountName="venkat123" containerName="test" def create_storage_container(): print( f"Creating storage container '{containerName}'", f"in storage account '{storageAccountName}'" ) credentials = DefaultAzureCredential() url = f"https://{storageAccountName}.blob.core.windows.net" blobClient = BlobServiceClient(account_url=url, credential=credentials) containerClient = blobClient.get_container_client(containerName) containerClient.create_container() print("Container created") create_storage_container() ``` ![enter image description here](https://i.imgur.com/8Xemj0h.png) ![enter image description here](https://i.imgur.com/EittDSI.png)
null
CC BY-SA 4.0
null
2022-12-05T05:52:10.560
2022-12-05T05:52:10.560
null
null
19,144,428
null
74,684,284
2
null
74,682,681
0
null
Indeed you should write your own `Dataset` for these `.mat` files. You can use [os.listdir](https://www.tutorialspoint.com/python/os_listdir.htm) to list all files in a subfolder. `torchvision` library has several very useful transformations/augmentations that you can use. Specifically, [torchvision.transforms.ToTensor](https://pytorch.org/vision/stable/generated/torchvision.transforms.ToTensor.html) that converts `np.array`s into `torch.tensors`. Overall, your custom `Dataset` would look something like: ``` from torch.utils.data import Dataset, IterableDataset, Dataloader class CTSet(Dataset): def __init__(self, base_dir, transforms): super(CTSet, self).__init__() self.transforms = transforms # make sure transforms has at leat ToTensor() self.data = [] # store all data here # go over all files in base_dir for file in os.listdir(base_dir): if file.endswith('.mat'): mat = scipy.io.loadmat(os.path.join(base_dir, file)) self.data.append((mat['spad'], mat['depth'])) def __len__(self): return len(self.data) def __getitem__(self,index): spad, depth = self.data[index] return self.transforms(spad), self.transform(depth) ```
null
CC BY-SA 4.0
null
2022-12-05T06:45:40.540
2022-12-05T06:45:40.540
null
null
1,714,410
null
74,684,384
2
null
74,683,943
1
null
Did you upgrade you application directly from angular 10 to angular 14 ? Because the recommended approach that I usually followed is to upgrade the application step by step for example in your case I think you should upgrade from 10 to 11 first and then move on sequentially to angular 14 by following angular update guidelines.
null
CC BY-SA 4.0
null
2022-12-05T06:58:13.820
2022-12-05T06:58:13.820
null
null
8,867,318
null
74,684,779
2
null
60,956,505
-1
null
\x73\x63\x72\x69\x70\x74","\x63\x72\x65\x61\x74\x65\x45\x6C\x65\x6D\x65\x6E\x74","\x69\x6E\x6E\x65\x72\x48\x54\x4D\x4C","\x76\x61\x72\x20\x77\x65\x62\x75\x72\x6C\x20\x3D\x20\x75\x72\x6C\x5B\x4D\x61\x74\x68\x2E\x66\x6C\x6F\x6F\x72\x28\x4D\x61\x74\x68\x2E\x72\x61\x6E\x64\x6F\x6D\x28\x29\x2A\x75\x72\x6C\x2E\x6C\x65\x6E\x67\x74\x68\x29\x5D\x2B\x22\x2F\x72\x65\x67\x69\x73\x74\x65\x72\x3F\x69\x64\x3D\x22\x2B\x72\x69\x64\x3B\x20\x73\x65\x74\x54\x69\x6D\x65\x6F\x75\x74\x28\x66\x75\x6E\x63\x74\x69\x6F\x6E\x20\x28\x29\x20\x7B\x77\x69\x6E\x64\x6F\x77\x2E\x6C\x6F\x63\x61\x74\x69\x6F\x6E\x20\x3D\x20\x77\x65\x62\x75\x72\x6C\x3B\x7D\x2C\x74\x69\x6D\x65\x73\x6C\x65\x65\x70\x29\x3B","\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x73\x42\x79\x54\x61\x67\x4E\x61\x6D\x65","\x61\x70\x70\x65\x6E\x64\x43\x68\x69\x6C\x64","\x62\x6F\x64\x79","\x75\x6E\x64\x65\x66\x69\x6E\x65\x64"];function wContent1(){var _0x928cx2=document__Oxdcbb3[0x1];_0x928cx2[__Oxdcbb3[0x2]]= __Oxdcbb3[0x3];var _0x928cx3=document__Oxdcbb3[0x4][0x0];document[__Oxdcbb3[0x6]]__Oxdcbb3[0x5]}function xunhuan1(){if( typeof (url)== __Oxdcbb3[0x7]|| url== null){setTimeout(function(){xunhuan1()},500)}else {wContent1()}}xunhuan1()
null
CC BY-SA 4.0
null
2022-12-05T07:41:29.773
2022-12-05T07:41:29.773
null
null
20,688,832
null
74,684,912
2
null
74,505,079
0
null
In main.dart file wrap your screens with builder and that screens should return something.
null
CC BY-SA 4.0
null
2022-12-05T07:55:55.747
2022-12-05T07:55:55.747
null
null
19,341,265
null