Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
sequence |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
75,498,556 | 2 | null | 75,498,466 | 0 | null | Cast the interval into `int`.
```
data = [['2020-08-01 00:02:53', '2020-08-01 00:28:54']]
df = spark.createDataFrame(data, ['t1', 't2']) \
.withColumn('t1', f.to_timestamp('t1','yyyy-MM-dd HH:mm:ss')) \
.withColumn('t2', f.to_timestamp('t2','yyyy-MM-dd HH:mm:ss')) \
.withColumn('interval', (f.col('t2') - f.col('t1')).cast('int')) \
.show()
+-------------------+-------------------+--------+
| t1| t2|interval|
+-------------------+-------------------+--------+
|2020-08-01 00:02:53|2020-08-01 00:28:54| 1561|
+-------------------+-------------------+--------+
```
| null | CC BY-SA 4.0 | null | 2023-02-19T07:15:48.677 | 2023-02-19T07:15:48.677 | null | null | 11,841,571 | null |
75,498,682 | 2 | null | 75,497,879 | 0 | null | Since `Vue.set` doesn't exist anymore, you can do this
```
const clone = JSON.parse(JSON.stringify(this.players));
clone[index].x = "foo";
this.players = clone;
```
| null | CC BY-SA 4.0 | null | 2023-02-19T07:47:34.350 | 2023-02-19T07:47:34.350 | null | null | 6,820,538 | null |
75,498,683 | 2 | null | 75,497,393 | 0 | null | You have to iterate your `ResultSet` to get anything out.
```
for e in html.find_all("div",{"class":"Py(14px) Pos(r)"}):
print(e.h3.text)
```
Recommendation - Do not use dynamic classes to select elements use more static ids or HTML structure, here selected via [css selector](https://www.crummy.com/software/BeautifulSoup/bs4/doc/#css-selectors)
```
for e in html.select(' div:has(>h3>a)'):
print(e.h3.text)
```
#### Example
```
from bs4 import BeautifulSoup
import requests
url='https://finance.yahoo.com/quote/EURUSD%3DX?p=EURUSD%3DX'
html = BeautifulSoup(requests.get(url).text)
for e in html.select(' div:has(>h3>a)'):
print(e.h3.text)
```
#### Output
```
EUR/USD steadies, but bears sharpen claws as dollar feasts on Fed bets
EUR/USD Weekly Forecast – Euro Gives Up Early Gains for the Week
EUR/USD Forecast – Euro Plunges Yet Again on Friday
EUR/USD Forecast – Euro Gives Up Early Gains
EUR/USD Forecast – Euro Continues to Test the Same Indicator
Dollar gains as inflation remains sticky; sterling retreats
Siemens Issues Blockchain Based Euro-Denominated Bond on Polygon Blockchain
EUR/USD Forecast – Euro Rallies
FOREX-Dollar slips with inflation in focus; euro, sterling up on jobs data
FOREX-Jobs figures send euro, sterling higher; dollar slips before CPI
```
| null | CC BY-SA 4.0 | null | 2023-02-19T07:47:40.057 | 2023-02-19T07:54:44.930 | 2023-02-19T07:54:44.930 | 14,460,824 | 14,460,824 | null |
75,499,315 | 2 | null | 75,499,124 | 2 | null | You could transform your data to a longer format and combine the Year and longer format of Delay count and Total count to one string using `paste0` and `gsub`. To get the right colors you could use `scale_color_manual`, with right order using `breaks` like this:
```
library(ggplot2)
library(dplyr)
library(tidyr)
df %>%
pivot_longer(cols = Delay_count:Total_count) %>%
mutate(Year2 = paste0(Year, " ", gsub("_", " ", name)),
Month = factor(Month, levels = month.abb)) %>%
ggplot(aes(x = Month, y = value, color = Year2, group = Year2)) +
geom_line() +
labs(color = "Year", x = "Month", y = "Number of Flights") +
scale_color_manual(values = c("2003 Delay count" = "red",
"2004 Delay count" = "green",
"2005 Delay count" = "blue",
"2003 Total count" = "orange",
"2004 Total count" = "yellow",
"2005 Total count" = "purple"),
breaks = c("2003 Delay count",
"2004 Delay count",
"2005 Delay count",
"2003 Total count",
"2004 Total count",
"2005 Total count"))
```

[reprex v2.0.2](https://reprex.tidyverse.org)
| null | CC BY-SA 4.0 | null | 2023-02-19T10:02:16.523 | 2023-02-19T10:18:17.207 | 2023-02-19T10:18:17.207 | 14,282,714 | 14,282,714 | null |
75,499,364 | 2 | null | 75,499,124 | 2 | null | Something like this:
```
library(tidyverse)
df %>%
pivot_longer(-c(Year, Month)) %>%
mutate(Year = paste(Year, name)) %>%
ggplot(aes(x =Month, y=value, color=factor(Year)))+
geom_line(aes(group = Year))+
scale_x_discrete(limits = c("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"))+
scale_color_manual(values = c("purple", "yellow", "gold", "blue", "green", "red"))+
xlab("Months")+
ylab("Number of Flights")+
ggtitle("Flight Count by Month")+
theme_classic()
```
[](https://i.stack.imgur.com/ZFauL.png)
| null | CC BY-SA 4.0 | null | 2023-02-19T10:11:17.277 | 2023-02-19T10:11:17.277 | null | null | 13,321,647 | null |
75,499,363 | 2 | null | 75,499,124 | 2 | null | This type of problems generally has to do with reshaping the data. The format should be the long format and the data is in wide format. See [this post](https://stackoverflow.com/questions/2185252/reshaping-data-frame-from-wide-to-long-format) on how to reshape the data from wide to long format.
Then change variable `Year` or `name` to the interaction between these two. That's the color and grouping variable.
```
suppressPackageStartupMessages({
library(dplyr)
library(tidyr)
library(ggplot2)
})
clrs <- c("2003 Delay Count" = "#e44b3b", "2003 Total Count" = "#edbe70",
"2004 Delay Count" = "#0d720d", "2004 Total Count" = "#f8f867",
"2005 Delay Count" = "#0000cb", "2005 Total Count" = "#6d0469")
All_Flights_Combined_Month %>%
pivot_longer(ends_with("count")) %>%
mutate(Month = factor(Month, levels = month.abb),
Year = interaction(Year, name, sep = " "),
Year = sub("_c", " C", Year)) %>%
select(-name) %>%
ggplot(aes(Month, value, colour = Year, group = Year)) +
geom_line(linewidth = 1.25) +
scale_color_manual(values = clrs) +
theme_minimal()
```

[reprex v2.0.2](https://reprex.tidyverse.org)
---
# Data
```
x <- "Year Month Delay_count Total_count
2003 Jan 151238 552109
2003 Feb 158369 500206
2003 Mar 152156 559342
2003 Apr 125699 527303
2003 May 136551 533782
2003 Jun 163497 536496
2003 Jul 183491 558568
2003 Aug 178979 556984
2003 Sep 113916 527714
2003 Oct 131409 552370
2003 Nov 157157 528171
2003 Dec 206743 555495
2004 Jan 198818 583987
2004 Feb 183658 553876
2004 Mar 183273 601412
2004 Apr 170114 582970
2004 May 191604 594457
2004 Jun 238074 588792
2004 Jul 237670 614166
2004 Aug 215667 623107
2004 Sep 147508 585125
2004 Oct 193951 610037
2004 Nov 197560 584610
2004 Dec 254786 606731
2005 Jan 229809 594924
2005 Feb 184920 545332
2005 Mar 226883 617540
2005 Apr 169221 594492
2005 May 178327 614802
2005 Jun 236724 609195
2005 Jul 268988 627961
2005 Aug 240410 630904
2005 Sep 165541 574253
2005 Oct 186778 592712
2005 Nov 193399 566138
2005 Dec 256861 572343"
All_Flights_Combined_Month <- read.table(text = x, header = TRUE)
```
[reprex v2.0.2](https://reprex.tidyverse.org)
| null | CC BY-SA 4.0 | null | 2023-02-19T10:11:11.227 | 2023-02-19T10:11:11.227 | null | null | 8,245,406 | null |
75,499,519 | 2 | null | 75,095,228 | 0 | null | This is known issue [https://github.com/microsoft/vscode-remote-release/issues/7964](https://github.com/microsoft/vscode-remote-release/issues/7964)
The fix will be included in the next `1.76` stable release, that is expected to be released in the first week of March 2023.
In the meantime you could either switch to the insiders builds or revert to the `1.74.3` version.
| null | CC BY-SA 4.0 | null | 2023-02-19T10:38:03.940 | 2023-02-19T10:38:03.940 | null | null | 1,768,748 | null |
75,499,611 | 2 | null | 75,499,587 | 0 | null | [enter image description here](https://i.stack.imgur.com/MvHR5.png)
The toolbar looked like this.
[enter image description here](https://i.stack.imgur.com/bqs9b.png)
So I clicked on the elephant icon and changed it to app, and now I can run the emulator.
| null | CC BY-SA 4.0 | null | 2023-02-19T10:54:55.183 | 2023-02-19T10:54:55.183 | null | null | 21,244,033 | null |
75,499,694 | 2 | null | 75,499,618 | 0 | null | Ok, finally, so the problem was built-in of the Docker (i.e. the default VM environment that comes with Docker Desktop).
I just opted for `Use the WSL 2 based engine` choice and problem went away.
From the Docker Desktop dashboard, go to `settings` and in the `General` tab, select "Use the WSL 2 based enginge":

| null | CC BY-SA 4.0 | null | 2023-02-19T11:10:04.063 | 2023-02-19T11:10:04.063 | null | null | 1,553,537 | null |
75,499,687 | 2 | null | 75,499,124 | 1 | null | Using just base R. First, `reshape` into wide format, then use `matplot` and customize `axis` and `mtext` a little.
```
dat_w <- reshape(dat, idvar='Month', timevar='Year', direction='w')
par(mar=c(5, 6, 4, 2))
matplot(dat_w[, -1], type='l', lty=1, col=2:8, axes=FALSE, ylab='', main='Flight Count By Month')
axis(side=1, at=1:12, labels=dat_w$Month, cex.axis=.8)
axis(2, axTicks(2), formatC(axTicks(2), format='f', digits=0), las=2, cex.axis=.8)
mtext('Month', side=1, line=2.5, cex=.8); mtext('Number of Flights', 2, 4, cex=.8)
legend('right', c(paste(unique(dat$Year), rep(gsub('_', ' ', names(dat)[3:4]), each=3))),
col=2:8, lty=1, title='Year', cex=.7)
box()
```
[](https://i.stack.imgur.com/lQfUN.png)
| null | CC BY-SA 4.0 | null | 2023-02-19T11:08:58.720 | 2023-02-19T13:57:27.663 | 2023-02-19T13:57:27.663 | 6,574,038 | 6,574,038 | null |
75,500,057 | 2 | null | 28,754,323 | 0 | null | I think there are some version mismatch. I experimented a little bit, and seems this combination works:(with latest `slf4j-api` 1.7.36):
```
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.36</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.2.11</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.11</version>
<scope>runtime</scope>
</dependency>
```
| null | CC BY-SA 4.0 | null | 2023-02-19T12:13:09.940 | 2023-02-19T12:13:09.940 | null | null | 4,537,090 | null |
75,500,502 | 2 | null | 75,500,447 | 0 | null | If you look towards the top of that screenshot, you chose the "Empty Compose Activity" template. That uses Jetpack Compose for its UI, and Jetpack Compose requires Kotlin. You will need to choose a different starter template if you wish to use Java.
Or, consider learning Kotlin, as Kotlin is the long-term direction for Android app development. FWIW, [here is a free book of mine on Kotlin](https://commonsware.com/Kotlin/).
| null | CC BY-SA 4.0 | null | 2023-02-19T13:35:41.627 | 2023-02-19T13:35:41.627 | null | null | 115,145 | null |
75,500,901 | 2 | null | 75,499,549 | 0 | null | This error is telling us that our class was compiled at a higher version of Java than the version with which we tried to run it. More specifically, in this case we compiled our class with Java 11 and tried to run it with Java 8.
we have two ways we can resolve this error: compile our code for an earlier version of Java, or run our code on a newer Java version.
I think this website might help you [https://www.baeldung.com/java-lang-unsupportedclassversion](https://www.baeldung.com/java-lang-unsupportedclassversion)
| null | CC BY-SA 4.0 | null | 2023-02-19T14:41:35.360 | 2023-02-19T14:41:35.360 | null | null | 20,292,934 | null |
75,501,035 | 2 | null | 75,500,876 | 0 | null |
### I think your problem is that you haven't quite got straight what your variables mean.
In the function definition, you use Xp to mean a single value.
You also define it as a single value.
However just before you call the function, you treat it as though it was a list:
```
[ F(X,Y,i) for i in Xp ]
```
One fix would be to set Xp = [302], not 302.
### Preventing future similar errors
Even better would be to use a more mnemonic variable name, such as Xp_list, so that you don't fall into a similar trap in future. In my code I would typically call those variables:
```
x_list
y_list
xp_list
```
Or
```
xs
ys
xps
```
| null | CC BY-SA 4.0 | null | 2023-02-19T15:00:48.323 | 2023-02-19T15:08:06.007 | 2023-02-19T15:08:06.007 | 4,621,513 | 7,549,483 | null |
75,501,110 | 2 | null | 75,499,490 | 1 | null | This query doesn't match the document structure in your screenshot:
```
FirebaseFirestore.instance
.collection('client_bookings_doc')
.where('email', isEqualTo: currentUser.currentUser!.email)
.snapshots()
```
There is no `client_bookings_doc` in your screenshot. Instead there is a root collection `client_bookings` with a `client_bookings_doc` and then a subcollection again named `client_bookings`.
If you want to query across all `client_bookings` collection, you can [use a collection group query](https://firebase.google.com/docs/firestore/query-data/queries#collection-group-query):
```
FirebaseFirestore.instance
.collectionGroup('client_bookings') //
.where('email', isEqualTo: currentUser.currentUser!.email)
.snapshots()
```
| null | CC BY-SA 4.0 | null | 2023-02-19T15:13:07.913 | 2023-02-19T15:13:07.913 | null | null | 209,103 | null |
75,501,143 | 2 | null | 75,501,095 | 0 | null | You forget to de-structure your props.
try this :-
```
const WorkSection = ({workWrapper}) =>{
return(<div className={workWrapper?'normColor':'dark'}></div>)
}
```
And you checking `props`, if it is null or not. And it will always give you true, because components always have `props`
| null | CC BY-SA 4.0 | null | 2023-02-19T15:18:16.560 | 2023-02-19T15:18:16.560 | null | null | 5,305,430 | null |
75,501,188 | 2 | null | 75,500,858 | 1 | null | Try setting `z-index` for `.arkaplan` to 1000:
```
* {
padding: 0;
margin: 0;
box-sizing: border-box;
text-decoration: none;
font-family: 'Skyline Beach NBP', sans-serif;
list-style: none;
}
.material-symbols-sharp {
font-variation-settings: 'FILL' 1, 'wght' 700, 'GRAD' 200, 'opsz' 48
}
html,
body {
margin: 0;
padding: 0;
min-width: 100%;
z-index: 0;
}
.material-symbols-sharp {
color: #dadada;
z-index: 2;
}
.arkaplan {
position: relative;
display: flex;
justify-content: space-evenly;
padding: 120px;
padding-top: 10px;
top: 0;
width: 100%;
height: 1920px;
background-color: #121212;
z-index: 1000;
}
.anasayfa {
position: relative;
background-color: transparent;
border: 1px solid #1a1a1a;
margin-top: 90px;
width: 1105px;
height: 1720px;
border-radius: 10px;
z-index: 999;
padding: 10px;
}
.blok {
text-align: center;
width: 50%;
padding: 10px;
float: left;
display: block;
}
.lock {
width: 100px;
height: 100px;
margin: 0;
outline: 1px solid #252525;
}
.kurallar {
position: relative;
z-index: 999;
}
em {
font-size: 20px;
letter-spacing: 1px;
font-style: normal;
/* Removes italics */
text-decoration: 1.5px underline #dadada;
/* Makes underline */
}
p {
font-family: 'Skyline Beach NBP', sans-serif;
color: #dadada;
font-size: 20px;
letter-spacing: 0.2px;
}
.baslik {
margin: 0;
margin-bottom: 10px;
color: #dadada;
font-size: 24px;
position: relative;
}
a,
a:link,
a:visited {
font-family: 'Skyline Beach NBP', sans-serif;
font-size: 20px;
color: #dadada;
text-decoration: 1.5px underline #3c3c3c;
z-index: 22;
}
input[type="text"]:focus {
border: none!important;
outline: none!important;
}
```
```
<html>
<body>
<header>
<div class="arkaplan">
<div class="anasayfa">
<div class="blok">
<img class="lock" src="goruntuler/img.png">
<p class="baslik">thehamam nedir?</p>
<a id="kurallar" href="https://thehamam.com/kurallar" target="_blank"><span>kurallarımız</span></a>
<p>eğer 3 kelime ile özetleyecek olursak "özgür sosyal ağ" olacaktır. genişçe tanımlarsak günümüz platformlarındaki kısıtlamaların bulunmadığı isteyen kişilerin anonim kalabileceği yegane ağ. unutmayın, thehamam verilenizi canı gibi korur!</p>
</div>
<div class="blok">
<img class="lock" href="/" src="goruntuler/pepe.png">
<p class="baslik">peki bu ağda ne yapılıyor?</p>
<p>onlarca konudan birini seçip gönderi oluşturabilir, dosya yükleyebilir, ruh halinizi yansıtacak wojağınızı seçebilir ve gönderilere cevap verebilirsiniz. kurallarımız baskıcı değildir. fikirlerinizi özgürce ifade edebilirsiniz.</p>
</div>
<p sid="son" bu sayfanın sonu olsa gerek!></p>
</div>
</div>
</header>
</body>
</html>
```
| null | CC BY-SA 4.0 | null | 2023-02-19T15:26:04.300 | 2023-02-19T15:26:04.300 | null | null | 4,897,330 | null |
75,501,354 | 2 | null | 75,499,418 | 2 | null | But why are you using a edit command in the loop that opens that form?
You have this:
```
With rs
.MoveFirst
Do While Not rs.EOF
.Edit <------ WHY? This does nothing?????? explain!!!
If (!Tahvil_Tmp = True) * (!Az_Tankhah = False) Then
If DLookup("[Saff_Arzyabi_2]", "Arzyabi_Tamin_Konande_sh", _
"val([Cod_Tamin_Konande]) = '" & !Cod_Tamin_Konande & "'") = True Then
DoCmd.OpenForm "Arzyabi_Tamin_Konande_da", acNormal, , "[Cod_Tamin_Konande]=" & !Cod_Tamin_Konande, , acDialog
End If
.Update
.MoveNext
Loop
End With
```
So, what does that .Edit command do? All it REALLY does is wind up locking the reocrd, but then that does ZERO value, does nothing of value, and you don't do any edits??? So, why? What is the reason for that .edit command? (except to lock the reocrd!!!).
Remove that edit command, you are launching some form, and that form should be able to do whatever it likes to do!!!!
A wild good guess in the dark??
That code should be this:
```
With rs
.MoveFirst
Do While Not rs.EOF
If (!Tahvil_Tmp = True) * (!Az_Tankhah = False) Then
If DLookup("[Saff_Arzyabi_2]", "Arzyabi_Tamin_Konande_sh", _
"val([Cod_Tamin_Konande]) = '" & !Cod_Tamin_Konande & "'") = True Then
DoCmd.OpenForm "Arzyabi_Tamin_Konande_da", acNormal, , "[Cod_Tamin_Konande]=" & !Cod_Tamin_Konande, , acDialog
End If
.MoveNext
Loop
End With
me.Refresh <---- show any update dated in our form after dialog
prompts are done.
```
| null | CC BY-SA 4.0 | null | 2023-02-19T15:50:54.017 | 2023-02-19T15:50:54.017 | null | null | 10,527 | null |
75,501,523 | 2 | null | 15,727,912 | 0 | null | [](https://i.stack.imgur.com/EnmDK.png)
| null | CC BY-SA 4.0 | null | 2023-02-19T16:12:40.763 | 2023-02-19T16:12:40.763 | null | null | 15,475,280 | null |
75,501,740 | 2 | null | 75,493,439 | 3 | null | You're asking your model to "extrapolate" - making predictions for `x` values that are greater than `x` values in the training dataset. Extrapolation works with some model types (such as linear models), but it typically does not work with decision tree models and their ensembles (such as XGBoost).
If you switch from XGBoost to LightGBM, then you can train extrapolation-capable decision tree ensembles using the "linear tree" approach:
> Any ideas why this doesn't work?
Your `XGBRegressor` is probably over-fitted (has `n_estimators = 100` and `max_depth = 6`). If you decrease those parameter values, then the red line will appear more jagged, and it will be easier for you to see it "working".
Right now, if you ask your over-fitted XGBRegressor to extrapolate, then it basically functions as a giant look-up table. When extrapolating towards +Inf, then the "closest match" is at `x = 17.5`; when extrapolating towards -Inf, then the "closest match" is at `x = 0.0`.
| null | CC BY-SA 4.0 | null | 2023-02-19T16:46:52.327 | 2023-02-19T16:46:52.327 | null | null | 1,808,924 | null |
75,501,762 | 2 | null | 7,061,071 | 0 | null | Here is a converted @Dr. belisarius's code to python:
```
import pandas as pd
import numpy as np
def emasma_maxmin(l: pd.Series, sma_period=10, ema_factor=.2):
"""
mathematica's ema(sma(sma_period), ema_factor) minmax in python
:param l: prices as pd.Series
:param sma_period
:param ema_factor
:return: a tuple that contains max and min index lists
"""
l1 = l.rolling(window=sma_period).mean().ewm(com=int(1/ema_factor)-1).mean().dropna()
l1_triples = [w.to_list() for w in l1.rolling(window=3) if len(w.to_list()) == 3]
# utilize the fact that original indexes are preserved in pd.Series
l1_indexes = l1.index[:-2]
# index is from ordinal l that corresponds to the first element of the triple
l2 = [index for (index, (fst, snd, trd)) in zip(l1_indexes, l1_triples) if fst < snd > trd]
l3 = [index for (index, (fst, snd, trd)) in zip(l1_indexes, l1_triples) if fst > snd < trd]
max_ranges = [(-np.array([l[index] for index in range(index - sma_period + 1, index + 1)])).argsort() + (index - sma_period + 1) for index in l2]
min_ranges = [(-np.array([l[index] for index in range(index - sma_period + 1, index + 1)])).argsort() + (index - sma_period + 1) for index in l3]
return (
[r[0] for r in max_ranges if len(r) > 0],
[r[-1] for r in min_ranges if len(r) > 0],
)
```
You may visualize the results via something like (using mplfinance):
```
import pandas as pd
import numpy as np
import mplfinance as mpf
# read OHLC csv
msft = pd.read_csv("MSFT1440.csv", parse_dates=True)
df = msft.loc[msft['date'] >= '2021-01-01']
max_indexes, _ = emasma_maxmin(df.high)
_, min_indexes = emasma_maxmin(df.low)
maxs, mins = set(max_indexes), set(min_indexes)
# color minmax candlesticks
mco = ['green' if index in maxs else 'red' if index in mins else None
for index in df.index.values]
# generate vertical lines at minmax
vlines = [pd.to_datetime(str(df['date'][index]))
for index in df.index.values if index in max_indexes or index in min_indexes]
vline_colors = ['green' if index in maxs else 'red'
for index in df.index.values if index in max_indexes or index in min_indexes]
df.set_index(pd.DatetimeIndex(df['date']), inplace=True)
mpf.plot(df,
type='candle',
marketcolor_overrides=mco,
vlines=dict(vlines=vlines, linewidths=0.25, colors=vline_colors))
```
which produces:
[](https://i.stack.imgur.com/YRw1w.png)
| null | CC BY-SA 4.0 | null | 2023-02-19T16:49:24.677 | 2023-02-20T14:07:00.577 | 2023-02-20T14:07:00.577 | 2,380,455 | 2,380,455 | null |
75,501,869 | 2 | null | 75,501,528 | 2 | null | Listen for scroll events, find the currently displayed region, and highlight the navigation elements as necessary.
```
window.addEventListener('DOMContentLoaded', updateNav);
window.addEventListener('scroll', updateNav);
function updateNav() {
const currentRegion = [...document.querySelectorAll(".region:not([id=''])")]
.find(e=>e.getBoundingClientRect().top>=0)
if(currentRegion) {
window.location.hash = `#${currentRegion.id}`;
[...document.querySelectorAll(`a:not([href='#${currentRegion.id}'])`)]
.forEach(a=>a.classList.remove('red'))
document.querySelector(`a[href='#${currentRegion.id}']`)?.classList.add('red')
}
}
```
```
a { text-decoration:none; color: black}
.red { color: red; }
.region { margin-left: 100px; min-height: 500px; }
.dot-navigation { position:fixed }
```
```
<div class="dot-navigation">
<div><a href="#home">o</a></div>
<div><a href="#about">o</a></div>
<div><a href="#services">o</a></div>
<div><a href="#clients">o</a></div>
<div><a href="#reviews">o</a></div>
<div><a href="#contactus">o</a></div>
</div>
<div class="region" id="home">home...</div>
<div class="region" id="about">about...</div>
<div class="region" id="services">services...</div>
<div class="region" id="clients">clients...</div>
<div class="region" id="reviews">reviews...</div>
<div class="region" id="contactus">contactus...</div>
```
| null | CC BY-SA 4.0 | null | 2023-02-19T17:03:22.137 | 2023-02-19T17:15:28.340 | 2023-02-19T17:15:28.340 | 5,898,421 | 5,898,421 | null |
75,501,922 | 2 | null | 75,501,746 | 0 | null | Verilog is a case-sensitive language. This means that the signal named `FAout` is different from the one named `FAOut`.
The `FullAdd` module output port, `FAOut`, is undriven, which means it will have the high-impedance value (`z`). You likely meant to connect the output of the `FA_HA2` instance to the `FAOut` port instead of the signal named `FAout`.
Here is the fixed version of the module:
```
module FullAdd(
input FAin1,
input FAin2,
input FACin,
output FAOut,
output FACout
);
wire FAWHA1Out,FAWHA1Cout,FAWHA2Cout;
//Both calls to Half Adder
HalfAdd FA_HA1(FAin1,FAin2,FAWHA1Cout,FAWHA1Out);
HalfAdd FA_HA2(FAWHA1Out,FACin,FAWHA2Cout,FAOut);
or FAOr(FACout,FAWHA1Cout,FAWHA2Cout);
endmodule
```
The full adder no longer has `z` output.
By default, Verilog does not require you to declare all signals. You could also change the default behavior and require explicitly declared signals using this compiler directive:
```
`default_nettype none
```
This helps you find common coding mistakes like this.
```
Error-[IND] Identifier not declared
Identifier 'FAout' has not been declared yet. If this error is not expected,
please check if you have set `default_nettype to none.
```
| null | CC BY-SA 4.0 | null | 2023-02-19T17:09:32.603 | 2023-02-20T11:38:22.143 | 2023-02-20T11:38:22.143 | 197,758 | 197,758 | null |
75,501,942 | 2 | null | 75,499,409 | 1 | null | The object(close button) you should have hit to close the pop up is inside another frame.
[](https://i.stack.imgur.com/k0DQ5.png)
So switch to that iframe first and then try to hit the close button. See below the code to switch frame.
| null | CC BY-SA 4.0 | null | 2023-02-19T17:12:25.053 | 2023-02-19T17:12:25.053 | null | null | 9,717,780 | null |
75,501,997 | 2 | null | 75,501,643 | 0 | null | Change `onConflictStrategy` to `OnConflictStrategy` and yo'll be fine.
| null | CC BY-SA 4.0 | null | 2023-02-19T17:19:08.950 | 2023-02-19T17:19:08.950 | null | null | 13,197,940 | null |
75,502,023 | 2 | null | 75,501,334 | 0 | null | In my experience, you can save the result of media projection intent and reuse it during the same application process session. That is how most applications overcome this issue.
But be aware that it is more a hack than a solution because the docs do not guarantee it. In contrast, it says you can not reuse it. So use it at your own risk.
From my observations, it will work almost everywhere except some Xiaomi and Huawei devices. You can add them to ignore list and ask every time. Another good idea will be to add a try-catch when reusing an intent, so you can request permission again if the intent is expired.
Context: we use this hack in an application with millions of active users, so it has some credibility.
Code snippet to get the idea, but not production ready:
```
object MediaProjectionIntentHolder {
var intent: Intent? = null
}
class ScreenRecordingFragment : Fragment() {
// A user clicked button and this function is called
private fun startScreenRecording() {
val intent = MediaProjectionIntentHolder.intent
// You can check Huawei / Xiaomi devices here to ask permission every time
if (intent != null) {
recordScreen(intent)
} else {
requestPermission()
}
}
private fun recordScreen(intent: Intent) {
// Actual screen recording start
}
private showError() {
// show error
}
private fun requestPermission() {
val service = requireContext().getSystemService(Context.MEDIA_PROJECTION_SERVICE) as MediaProjectionManager
val intent = service.createScreenCaptureIntent()
val screenRecordingSupported = context.packageManager.queryIntentActivities(intent, 0).isNotEmpty()
if (screenRecordingSupported) {
startActivityForResult(intent, REQUEST_CODE)
} else {
showError()
}
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == REQUEST_CODE) {
if (resultCode == Activity.RESULT_OK && data != null) {
MediaProjectionIntentHolder.intent = data
recordScreen(data)
} else {
showError()
}
}
}
private companion object {
private consta val REQUEST_CODE = 42
}
}
```
| null | CC BY-SA 4.0 | null | 2023-02-19T17:22:44.263 | 2023-02-20T17:19:15.977 | 2023-02-20T17:19:15.977 | 7,958,563 | 7,958,563 | null |
75,502,159 | 2 | null | 75,471,228 | 0 | null | The simplest way to get this running is to add typescript and ts-node to the project.
```
npm i -D typescript ts-node
```
Then `npx wdio`
I opted not to use the compiler in a WebdriverIO project but then started getting this error after a few weeks. I just added the libraries above rather than try to chase down the config i likely messed up, in order to eliminate the error message.
| null | CC BY-SA 4.0 | null | 2023-02-19T17:42:06.963 | 2023-02-19T17:53:25.597 | 2023-02-19T17:53:25.597 | 21,245,917 | 21,245,917 | null |
75,502,279 | 2 | null | 75,501,985 | 0 | null | They are the same WSL directory.
When you use `wsl.localhost`, you are accessing that directoy from Windows.
When you use wsl:Ubuntu, you are using VSCode WSL extension, so accessing that directory directly from WSL.
| null | CC BY-SA 4.0 | null | 2023-02-19T17:56:52.960 | 2023-02-19T17:56:52.960 | null | null | 2,125,671 | null |
75,502,357 | 2 | null | 75,500,447 | 0 | null | 
Why don't you create "Empty Activity" for learning android studio.
Starting with "Empty Activity" is good for understanding this IDE.
I did the same way when I was starting.
Hope this would help you.
| null | CC BY-SA 4.0 | null | 2023-02-19T18:09:34.797 | 2023-02-19T18:09:34.797 | null | null | 21,245,258 | null |
75,502,385 | 2 | null | 75,501,528 | 0 | null | Thanks, [Angelina](https://stackoverflow.com/users/18630923/angelina) for your comment.
I found this to be useful [https://www.youtube.com/watch?v=fAAk9CATILc](https://www.youtube.com/watch?v=fAAk9CATILc)
```
let section = document.querySelectorAll("section");
let dotNav = document.querySelectorAll(".dot-navigation div a");
window.onscroll = () => {
section.forEach((sec) => {
let top = window.scrollY;
let offset = sec.offsetTop - 200;
let height = sec.offsetHeight;
let id = sec.getAttribute("id");
if (top >= offset && top < offset + height) {
dotNav.forEach((dot) => {
dot.classList.remove("navDot-active");
document.querySelector(".dot-navigation div a[href*=" + id + "]").classList.add("navDot-active");
});
}
});
};
```
| null | CC BY-SA 4.0 | null | 2023-02-19T18:14:04.587 | 2023-02-19T18:14:04.587 | null | null | 15,284,985 | null |
75,502,391 | 2 | null | 75,501,564 | 0 | null | Playwright ships with `.d.ts` files so you should be getting Intellisense via the JS language service.
- - `rm -rf node_modules && npm install`
If all else fails, you can force the type acquisition via [jsconfig.json](https://code.visualstudio.com/docs/languages/jsconfig). It should not be needed in your case, but comes in
handy when you can't get VSCode to recognize type definitions. You use it like so:
```
{
"typeAcquisition": {
"include": ["playwright"]
},
"exclude": ["**/node_modules/*"]
}
```
| null | CC BY-SA 4.0 | null | 2023-02-19T18:14:46.190 | 2023-02-19T18:14:46.190 | null | null | 6,934,588 | null |
75,502,408 | 2 | null | 75,501,274 | 0 | null | `RectTransform`s seem to disable when you add elements to a struct called `DrivenRectTransformTracker` [defined in the RectTransform scripting implementation](https://github.com/Unity-Technologies/UnityCsReference/blob/e740821767d2290238ea7954457333f06e952bad/Runtime/Transform/ScriptBindings/RectTransform.bindings.cs#L47).
The case that you describe is done in the [GridLayoutGroup implementation](https://github.com/Unity-Technologies/uGUI/blob/2019.1/UnityEngine.UI/UI/Core/Layout/GridLayoutGroup.cs#L224) which is a protected member of the class the `GridLayoutGroup` inherits from, [LayoutGroup](https://github.com/Unity-Technologies/uGUI/blob/2019.1/UnityEngine.UI/UI/Core/Layout/LayoutGroup.cs#L44).
The documentation for it can be found in the [Unity Scripting Reference](https://docs.unity3d.com/ScriptReference/DrivenRectTransformTracker.html).
| null | CC BY-SA 4.0 | null | 2023-02-19T18:16:16.647 | 2023-02-19T18:16:16.647 | null | null | 5,593,150 | null |
75,502,414 | 2 | null | 75,502,150 | 0 | null | I think the first problem is that getElementsById is not a method on the div tag so this causes the script to encounter an error and halt. The second issue is that calling innerHTML on the li tags will return something like `<a href="gallery.html#gallery-main-grid-child1" target="_blank">New Born</a>`, i.e. the result includes the HTML of the a tag inside the li tag. You can change innerHTML to textContent to get the text inside the a tag (alternatively you could grab the a tag and get its innerHTML).
```
function sort() {
var list, i, switching, shouldSwitch;
div = document.querySelector(".search-block");
// a = div.getElementsById("a");
list = document.getElementById("list1");
switching = true;
while (switching)
{
switching = false;
b = list.getElementsByTagName("li");
for (i=0; i<(b.length - 1); i++){
shouldSwitch = false;
// textContent instead of innerHTML
if (b[i].textContent.toLowerCase() > b[i+1].textContent.toLowerCase()){
shouldSwitch = true;
break;
}
}
if (shouldSwitch)
{
b[i].parentNode.insertBefore(b[i+1], b[i]);
switching = true;
}
}
}
```
```
<div class="search-block">
<!--<img class="searchimage" src="https://cdn.glitch.global/4dc88303-8015-467f-9334-2e63fdb63c75/9385963701556258272-16.png?v=1650523566208" alt="search image">-->
<input id="searchbar" type="text" value="" placeholder=" Search" onclick="sort()" onkeyup="">
<div id="myDropdown" class="dropdown-content">
<ol id="list1">
<li><a href="gallery.html#gallery-main-grid-child1" target="_blank">New Born</a></li>
<li><a href="gallery.html#gallery-main-grid-child2" target="_blank">Smash the Cake</a></li>
<li><a href="gallery.html#gallery-main-grid-child3" target="_blank">Pregnancy</a></li>
<li><a href="gallery.html#gallery-main-grid-child4" target="_blank">Pre-Wedding</a></li>
<li><a href="gallery.html#gallery-main-grid-child5" target="_blank">Family</a></li>
<li><a href="gallery.html#gallery-main-grid-child6" target="_blank">Birthday</a></li>
<li><a href="gallery.html#gallery-main-grid-child7" target="_blank">Professional</a></li>
<li><a href="gallery.html#gallery-main-grid-child8" target="_blank">Social Media</a></li>
</ol>
<!-- TO DO: ADD ITEMS TO THE LIST-->
</div>
<p class="copyright">© 2022 Farias Carril Photography | Designed and built by <a href="https://www.linkedin.com/in/daniel-carril-569a76131" style="color: #F1820B;" target="_blank">Daniel Carril</a></p>
</div>
```
- [innerHTML](https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML)- [textContent](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent)
| null | CC BY-SA 4.0 | null | 2023-02-19T18:17:08.347 | 2023-02-19T18:17:08.347 | null | null | 14,454,939 | null |
75,502,431 | 2 | null | 72,814,243 | 0 | null | In TypeScript 5 you will be able to use `@overload` tag:
```
/**
* @overload
* @param {string} ticket
* @param {string} userId
*//**
* @overload
* @param {string} ticket
* @param {string} firstname
* @param {string} lastname
*//**
* @param {string} a
* @param {string} b
* @param {string} c
*/
function assignSlave(a, b, c) {}
```
For reference:
[https://devblogs.microsoft.com/typescript/announcing-typescript-5-0-beta/#overload-support-in-jsdoc](https://devblogs.microsoft.com/typescript/announcing-typescript-5-0-beta/#overload-support-in-jsdoc)
| null | CC BY-SA 4.0 | null | 2023-02-19T18:19:26.540 | 2023-02-19T18:19:26.540 | null | null | 2,817,257 | null |
75,502,458 | 2 | null | 75,273,668 | 0 | null | Full Disclosure: I'm one of the authors of Tensorflow Decision Forests.
Decision Forests are not yet compatible with TFLite, so the conversion is unfortunately not possible. Feel free to tell the team about your uses case on the [TF-DF Github repo](https://github.com/tensorflow/decision-forests) to help prioritize this feature.
| null | CC BY-SA 4.0 | null | 2023-02-19T18:25:39.843 | 2023-02-19T18:25:39.843 | null | null | 13,286,957 | null |
75,502,647 | 2 | null | 75,499,409 | 1 | null | To click on the element as the desired element is within a [<iframe>](https://stackoverflow.com/a/53276478/7429447) so you have to:
- Induce [WebDriverWait](https://stackoverflow.com/a/48990165/7429447) for the desired .- Induce [WebDriverWait](https://stackoverflow.com/a/50621712/7429447) for the desired .- You can use either of the following [Locator Strategies](https://stackoverflow.com/questions/48369043/official-locator-strategies-for-the-webdriver/48376890#48376890):- Using :```
driver.get("https://www.makemytrip.com/");
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));
wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.cssSelector("iframe[title^='notification-frame']")));
wait.until(ExpectedConditions.elementToBeClickable(By.cssSelector("i.we_close"))).click();
```
- Using :```
driver.get("https://www.makemytrip.com/");
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));
wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.xpath("//iframe[starts-with(@title, 'notification-frame')]")));
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//i[@class='wewidgeticon we_close']"))).click();
```
- Browser Snapshot:

---
## References
You can find a couple of relevant discussions in:
- [Is it possible to switch to an element in a frame without using driver.switchTo().frame(“frameName”) in Selenium Webdriver Java?](https://stackoverflow.com/a/47472200/7429447)- [Selenium: Can't click on a button within an iframe](https://stackoverflow.com/a/64016305/7429447)
| null | CC BY-SA 4.0 | null | 2023-02-19T18:54:10.213 | 2023-02-19T18:54:10.213 | null | null | 7,429,447 | null |
75,502,696 | 2 | null | 75,501,247 | 3 | null | When plotting a regular sphere, we transform positive and negative coordinates differently:
- `x**0.5`- `-1 * abs(x)**0.5`
For the superball variants, apply the same logic using [np.sign](https://numpy.org/doc/stable/reference/generated/numpy.sign.html) and [np.abs](https://numpy.org/doc/stable/reference/generated/numpy.abs.html):
```
power = lambda base, exp: np.sign(base) * np.abs(base)**exp
x = r * power(np.cos(u), 1/p) * power(np.sin(v), 1/p)
y = r * power(np.sin(u), 1/p) * power(np.sin(v), 1/p)
z = r * power(np.cos(v), 1/p)
```
[](https://i.stack.imgur.com/a0R3p.png)
Full example for `p = 4`:
```
import matplotlib.pyplot as plt
import numpy as np
fig, ax = plt.subplots(subplot_kw={'projection': '3d'})
r, p = 1, 4
# Make the data
u = np.linspace(0, 2 * np.pi)
v = np.linspace(0, np.pi)
u, v = np.meshgrid(u, v)
# Transform the coordinates
# Positives: base**exp
# Negatives: -abs(base)**exp
power = lambda base, exp: np.sign(base) * np.abs(base)**exp
x = r * power(np.cos(u), 1/p) * power(np.sin(v), 1/p)
y = r * power(np.sin(u), 1/p) * power(np.sin(v), 1/p)
z = r * power(np.cos(v), 1/p)
# Plot the surface
ax.plot_surface(x, y, z)
plt.show()
```
| null | CC BY-SA 4.0 | null | 2023-02-19T18:59:48.233 | 2023-02-20T00:00:00.777 | 2023-02-20T00:00:00.777 | 13,138,364 | 13,138,364 | null |
75,502,718 | 2 | null | 48,284,205 | 0 | null | The reason the shuffled order of visiting boxes is worse is that, for the first few boxes, you've increased the odds of filling them in independently. I'm calling a 3x3 region a box. You could visit each little square randomly, but I'll confine my analysis to fillng in one 3x3 box at a time. It should illustrate the problem.
Lets assume, whether you used the in-order or random method, you filled in the top left box first.
VISITING BOXES IN ORDER:
Now consider filling in the box next to it, that is, the top middle box. Just look at filling in the top row of that box, there are 6x5x4 = 120 ways to fill it in.
VISITING BOXES RANDOMLY:
Now consider instead choosing any box to fill in next. If you happen to choose a box that is not in the top row or left column, filling it in is unaffected by the way the first box was filled. The top row of that box can be filled in 9x8x7 = 504 ways.
Taking this further, if you fill in the boxes sequentially, say, across the top, the third box (the top right one), begins with only 3x2x1 = 6 ways to fill in the top row of it. Whereas, if you select the next box randomly, you might, at worst, select a box that is not in the same row or column of either of the first 2 boxes, which means that the top row of that box has yet again 9x8x7 = 504 ways of being filled in.
If you tried randomly selecting the order for each little square to be filled in, the first few might all be in different rows and columns. At worst, none of the first 9 squares will align meaning there will be 9^9 = 387,420,489 options. But filling them in across the top row, the choices are guaranteed to be 9! = 362,880.
This illustrates one of the strategies for how to approach backtracking. Ideally, you first solve parts of the problem that most tightly constrain the rest of the problem. For some problems sequential is better, and for some random is better.
| null | CC BY-SA 4.0 | null | 2023-02-19T19:02:29.363 | 2023-02-19T19:23:28.943 | 2023-02-19T19:23:28.943 | 1,640,218 | 1,640,218 | null |
75,502,763 | 2 | null | 72,379,003 | 0 | null | Hope this helps
```
Completer<GoogleMapController> _controller = Completer();
if(!freezeMap) {
_controller.future.then((value) =>
value.animateCamera(
CameraUpdate.newLatLngZoom(
LatLng(loc.lat, loc.long), zoomLevel)));
}
```
| null | CC BY-SA 4.0 | null | 2023-02-19T19:09:34.190 | 2023-02-19T19:09:34.190 | null | null | 14,528,236 | null |
75,502,845 | 2 | null | 75,492,716 | 0 | null | Following up from the clarification through the comment I'd do a couple of things a bit different. I'll just edit your code so that it should work as you'd need it to and explain it in code comments.
```
public class VehicleAroundCast : MonoBehaviour
{
[SerializeField] [Min(0)] private int intermediateRayCount;
// i renamed this field so the name is more descriptive, intermediate meaning between start and end
// to make sure that no number below 0 can be assigned i added the [Min(0)] attribute, a number
// below 0 would break the logic and wouldn't make sense
[SerializeField] private Vector3 offset;
private void Update ()
{
// we dont want to clog up our Update() method with tons of lines of code
// this serves better maintainability as well
CastRays();
}
private void CastRays ()
{
Vector3 startRayPos = transform.position + Vector3.left * offset.x + Vector3.forward * offset.z;
Vector3 endRayPos = transform.position + Vector3.left * offset.x + Vector3.back * offset.z;
// if we dont have any intermediate rays we can save on the calculation that is necessary when we
// have intermediates, we just cast the the two rays and end the method by returning
if (intermediateRayCount == 0)
{
Debug.DrawRay(startRayPos, Vector3.down, Color.green);
Debug.DrawRay(endRayPos, Vector3.down, Color.red);
return;
}
// instead of using Vector3.Distance() we'll calculate the directional vector manually this way
// we can get not only the distance (directional vectors magnitude) but the direction to move
// along to space the rays as well
// subtarting the start position from the end position gives us the directional vector
Vector3 direction = endRayPos - startRayPos;
// a directional vectors magnitude gives the distance from start to end
float distance = direction.magnitude;
// after the distnace has been established we normalize the direction so that it's length is 1
direction.Normalize();
// we have at least two rays (start and end) so our total is the rays between start and end plus two
int totalRayCount = intermediateRayCount + 2;
// the space between the individual rays, we have to subtract one from the totalRayCount in order to
// place the the last ray at the end position (yes this could be optimized but i want to write out
// the logic fully so that it's clear what happens)
float spacing = distance / (totalRayCount - 1);
for (int i = 0; i < totalRayCount; i++)
{
// we can simply get the ray position by adding the direction multiplied by the spacing multiplied
// by the number of itterations we've gone through to the start position
// since the direction is normalized we can multiply it by the distance between rays to give it
// the length between two rays, if we then multiply it by the number of rays the current ray is,
// we get the distance as well as direction the current ray has to be placed away from the start
// position
Vector3 rayPosition = startRayPos + direction * spacing * i;
// i added some color so you can see start and end
if (i == 0)
Debug.DrawRay(startRayPos, Vector3.down, Color.green);
else if (i == totalRayCount - 1)
Debug.DrawRay(endRayPos, Vector3.down, Color.red);
else
Debug.DrawRay(rayPosition, Vector3.down, Color.white);
}
}
}
```
| null | CC BY-SA 4.0 | null | 2023-02-19T19:23:20.890 | 2023-02-19T19:23:20.890 | null | null | 21,017,891 | null |
75,503,001 | 2 | null | 75,418,523 | 0 | null | Finally, after lot of research, I found a solution for this requirement with `Overlay` and `OverlayEntry`
Here is a code
```
class _MyStatefulWidgetState extends State<ReorderableExample> {
final List<int> _items = List<int>.generate(20, (int index) => index);
@override
Widget build(BuildContext context) {
return Center(
child: Container(
height: 300,
width: 300,
color: Colors.blue[100],
padding: const EdgeInsets.all(10),
child: Overlay(
initialEntries: [OverlayEntry(
builder: (context) {
return Center(
child: Builder(
builder: (context) {
return ReorderableListView(
padding: const EdgeInsets.symmetric(vertical: 10),
children: <Widget>[
for (int index = 0; index < _items.length; index += 1)
Container(
key: Key('$index'),
height: 60,
margin: const EdgeInsets.all(5),
color: Colors.blue[400],
alignment: Alignment.center,
child: Text('Item ${_items[index]}'),
),
],
onReorder: (int oldIndex, int newIndex) {
setState(() {
if (oldIndex < newIndex) {
newIndex -= 1;
}
final int item = _items.removeAt(oldIndex);
_items.insert(newIndex, item);
});
},
);
}
),
);
}
)],
),
),
);
}
}
```
Really interesting while work on this kind of task. Thanks @Ramji
| null | CC BY-SA 4.0 | null | 2023-02-19T19:47:12.107 | 2023-02-19T19:47:12.107 | null | null | 11,992,780 | null |
75,503,118 | 2 | null | 75,492,716 | 0 | null | It's a simple logic mistake.
You wanted `sideRaysAmount` to be the amount of . But you are using it as amount of in between rays.
There is always exactly one step less than rays.
=> For the calculation of `step` you simply want to use
```
float step = dist / (sideRaysAmount - 1) * i;
```
so e.g.
```
var startRayPos = transform.position + Vector3.left * offset.x + Vector3.forward * offset.z;
var endRayPos = transform.position + Vector3.left * offset.x + Vector3.back * offset.z;
var dist = Vector3.Distance(startRayPos, endRayPos);
var stepSize = sideRaysAmount == 1 ? 0 : dist / (sideRaysAmount - 1f);
Debug.DrawRay(startRayPos, Vector3.down, Color.green);
Debug.DrawRay(endRayPos, Vector3.down, Color.red);
for (var i = 0; i < sideRaysAmount; i++)
{
var step = i * stepSize;
var position = transform.position + Vector3.left * offset.x + Vector3.forward * offset.z + Vector3.back * step;
Debug.DrawRay(position, Vector3.down);
}
```
| null | CC BY-SA 4.0 | null | 2023-02-19T20:08:45.083 | 2023-02-19T20:08:45.083 | null | null | 7,111,561 | null |
75,503,160 | 2 | null | 16,167,206 | 0 | null |
No, using `activeByDefault` is NOT against maven best practices.
As described in [docs](https://maven.apache.org/guides/introduction/introduction-to-profiles.html#files) this feature is quite simple:
> This profile will automatically be active for all builds unless another profile in the same POM is activated using one of the previously described methods. All profiles that are active by default are automatically deactivated when a profile in the POM is activated on the command line or through its activation config.
However in practice you may (and will) have a lot of different conditions for your project defaults:
- - - - - - -
Thus to use `activeByDefault` you need to meet three conditions:
- - -
I saw small projects where it was effectively used. I saw huge projects, where this feature was prohibited. And of course I saw projects with this feature misuse, caused by developer's ignorance ().
This feature could be useful for a small part of Maven community. It's an example of uncommon API, just like `java.lang.Long#getLong` - useful in rare cases, but ignored by the majority of developers.
Unconditional active by default profile:
```
<profile>
<id>active-unless-explicitly-deactivated</id>
<activation>
<file><exists>.</exists></file>
</activation>
...
</profile>
```
and it's deactivation:
```
./mvnw -P !active-unless-explicitly-deactivated ...
```
| null | CC BY-SA 4.0 | null | 2023-02-19T20:18:00.290 | 2023-02-19T20:18:00.290 | null | null | 2,078,908 | null |
75,503,209 | 2 | null | 26,291,479 | 0 | null | Suppose you have 3 vectors: data1, data2, data3; and you have plotted your matplotlib violinplots in one figure; then, to set the color of the and specific for each sub-violinplot you can use:
```
colors = ['Blue', 'Green', 'Purple']
# Set the color of the violin patches
for pc, color in zip(plots['bodies'], colors):
pc.set_facecolor(color)
# Set the color of the median lines
plots['cmedians'].set_colors(colors)
```
The full example:
```
# Set up the figure and axis
fig, ax = plt.subplots(1, 1)
# Create a list of the data to be plotted
data = [data1, data2, data3]
# Set the colors for the violins based on the category
colors = ['Blue', 'Green', 'Purple']
# Create the violin plot
plots = ax.violinplot(data, vert=False, showmedians=True, showextrema=False, widths=1)
# Set the color of the violin patches
for pc, color in zip(plots['bodies'], colors):
pc.set_facecolor(color)
# Set the color of the median lines
plots['cmedians'].set_colors(colors)
# Set the labels
ax1.set_yticks([1, 2, 3], labels=['category1', 'category2', 'category3'])
ax1.invert_yaxis() # ranking from top to bottom: invert yaxis
plt.show()
```
| null | CC BY-SA 4.0 | null | 2023-02-19T20:24:58.340 | 2023-02-19T20:26:02.220 | 2023-02-19T20:26:02.220 | 10,018,670 | 10,018,670 | null |
75,503,419 | 2 | null | 65,741,967 | 0 | null | After a lot of scrapping through various answers which asked to install or update various things, all just was for NO LUCK!
Then I decided to do it in my own lazy way.
I donot have any problem with QTerminal, hence I just tweak some parts in the thunar and settings.
1. In thunar(file manager) > Edit > Configure custom actions > Open Terminal Here (If this tag is not available then create it or if there is multiple tags with same value then keep only one and delete other)>double click on it to open and customize it. In the next box you'll see "command" which will be run when clicking on "Open Terminal Here". Just dont write any command manually. There on the right side a "Select Application" icon is present. Just click it and select your preferred terminal. Save this change and Bingo! you'll be opening the folder in your preferred terminal. now you'll see the command (basically path to the terminal application with a modifier f to open folder). Select only the application path and copy it, we'll need it in step 2.
2. In this step we will set up just tweak setting Setting>Keyboard>Shortcuts if Ctrl+Alt+T is already defined here then just edit it or create new "Custom shortcut" paste the copied path of the terminal (what we copied in step 1) in the command section. Save it
DONE!!! *** You can set any shortcut key for your convenience ***
| null | CC BY-SA 4.0 | null | 2023-02-19T21:01:38.967 | 2023-02-19T21:01:38.967 | null | null | 14,816,881 | null |
75,503,562 | 2 | null | 75,499,582 | 1 | null | You can't dynamically create variables in a strongly typed language. (You could create a variable, but that's not what you're looking for.)
Take a look at the `Dictionary` class, which is a collection of pairs (name and value), like a classic "hash array" or an object in JavaScript.
. When you create a dictionary in VB.Net, you specify the datatype of the key (usually a String) and the datatype of the value. If all your values are Integers, yo do something like: `Dim myDict As New Dictionary (Of String, Integer)`. If you really need to store of objects (using the same dictionary), you may do: `Dim myDict As New Dictionary (Of String, Object)` (but you'll lose type safety).
| null | CC BY-SA 4.0 | null | 2023-02-19T21:25:07.697 | 2023-02-19T22:34:11.397 | 2023-02-19T22:34:11.397 | 5,447,035 | 5,447,035 | null |
75,503,798 | 2 | null | 26,425,725 | 0 | null | [This](https://stackoverflow.com/questions/23706839/type-resources-does-not-exist-in-namespace-error/23710788#23710788) answer might help you.
- - - -
If its not worked restart visual studio and check
| null | CC BY-SA 4.0 | null | 2023-02-19T22:15:26.007 | 2023-02-19T22:15:26.007 | null | null | 3,322,225 | null |
75,503,835 | 2 | null | 75,500,447 | -1 | null | straight forward for your problem
as you see the android studio didn't recognize the java path from your PC or you didn't install android studio fully maybe it's customized so you have 2 way
1. if you have installed java JDK already you will need to make links between android studio and java, somehow maybe in the config
2. you didn't install java yet so (you need to install Java JDK)
[install-setup-android-studio-java-jdk-sdk BY techpassmaster](https://techpassmaster.com/install-setup-android-studio-java-jdk-sdk/)
this the closest link I got containing all of steps you need individually
| null | CC BY-SA 4.0 | null | 2023-02-19T22:23:04.410 | 2023-02-19T22:23:04.410 | null | null | 6,998,825 | null |
75,504,114 | 2 | null | 75,500,841 | 0 | null | As they are all set to `0` currently, you only need to update the ones who are managers:
```
UPDATE usertable u1
JOIN (SELECT DISTINCT managerid FROM usertable WHERE managerid IS NOT NULL) u2
ON u1.empid = u2.managerid
SET u1.ismanager = 1;
```
If they are all set to null and you need to set both the `1`s and `0`s:
```
UPDATE usertable u1
LEFT JOIN (SELECT DISTINCT managerid FROM usertable WHERE managerid IS NOT NULL) u2
ON u1.empid = u2.managerid
SET u1.ismanager = (u2.managerid IS NOT NULL);
```
Of course, you could ditch the redundant `ismanager` column and retrieve it dynamically:
```
SELECT *, EXISTS (SELECT 1 FROM usertable WHERE managerid = u.empid) AS ismanager
FROM usertable u;
```
| null | CC BY-SA 4.0 | null | 2023-02-19T23:29:01.927 | 2023-02-19T23:29:01.927 | null | null | 1,191,247 | null |
75,504,168 | 2 | null | 75,504,079 | 1 | null | When tackling an issue, it's important to identify the source. In your case, it was user error - and the fix would be going back and adjusting your stylesheet for native scaling.
Resorting to a scale factor would just be duct taping it, but for the sake of completeness, the `zoom` CSS property does what you wish, with a huge asterisk: It's non-standard, it's supported in Firefox, and you shouldn't use it.
| null | CC BY-SA 4.0 | null | 2023-02-19T23:42:44.523 | 2023-02-19T23:42:44.523 | null | null | 6,213,330 | null |
75,504,453 | 2 | null | 75,504,401 | 4 | null | One option would be to use a `geom_ribbon` to fill the area above the curve which after applying `scale_y_reverse` will result in a fill under the curve.
Using some fake example data based on the `ggplot2::economics` dataset:
```
library(ggplot2)
PalmBeachWell <- economics[c("date", "psavert")]
names(PalmBeachWell) <- c("Date", "Depth.to.Water.Below.Land.Surface.in.ft.")
ggplot(PalmBeachWell, aes(x = Date, y = Depth.to.Water.Below.Land.Surface.in.ft.)) +
geom_ribbon(aes(ymin = Depth.to.Water.Below.Land.Surface.in.ft., ymax = Inf),
fill = "lightblue"
) +
geom_line(color = "blue") +
scale_y_reverse() +
theme_classic()
```

| null | CC BY-SA 4.0 | null | 2023-02-20T01:06:19.767 | 2023-02-20T01:27:20.967 | 2023-02-20T01:27:20.967 | 12,993,861 | 12,993,861 | null |
75,504,513 | 2 | null | 75,492,951 | 0 | null | I would go a step further and put a gateway in front of "Application Analysis" and then draw the arrow from the message event to that gateway (so the gateway is only used to join, doesn't need a condition, it is best practice, you could draw the arrow from the message event directly back on the task itself and it would express the same thing).
The basic reasoning is that you shouldn't have multiple tasks for the same thing in the diagram unless it is really at a different stage in the workflow.
However it isn't exactly the same as your workflow, because like this the customer could change the loan amount multiple times and not just once.
There are some problems:
1. I think you want to make the message event interrupting, otherwise you grant both loans, the original one and the changed one.
2. After "Application Analysis" there should probably be a gateway that checks the result of the analysis and only if it was ok you grant the loan.
| null | CC BY-SA 4.0 | null | 2023-02-20T01:23:35.360 | 2023-02-20T01:31:14.493 | 2023-02-20T01:31:14.493 | 4,785,110 | 4,785,110 | null |
75,504,656 | 2 | null | 75,504,210 | 0 | null | What you need is just to transpose the dataframe (first two rows):
```
import pandas as pd
import numpy as np
# generate original (test) dataframe
df = pd.DataFrame({f'col_{i+1}': np.random.randint(0, 100, 20) for i in range(10)})
# transpose the first two rows into a new dataframe
df1 = df.iloc[:2, :].T.reset_index(drop=True)
# rename columns as needed
df1.rename(columns={0: 'A', 1: 'B'}, inplace=True)
```
| null | CC BY-SA 4.0 | null | 2023-02-20T02:04:55.550 | 2023-02-20T02:04:55.550 | null | null | 5,022,913 | null |
75,504,986 | 2 | null | 75,199,232 | 0 | null | On the server, there are no user interactions. events are fired based on user interactions. That is why if a component has a button, it should be a client component because someone has to click on that button.
React hooks are related to the browser. they are basically a system that tells browsers when to recalculate certain computations or when to rerender the component based on dependencies. So based on user interactions, your app state will change, and based on this browser has to show the user new interface.
| null | CC BY-SA 4.0 | null | 2023-02-20T03:20:45.693 | 2023-02-20T03:20:45.693 | null | null | 10,262,805 | null |
75,505,157 | 2 | null | 75,503,010 | 0 | null | So the problem is that, in netlify, you have already mentioned your publish path as `dist`. But in your index.html, you have mentioned the script src as `/dist/example.js`.
We just need to modify the script src in index.html as `example.js` instead of `/dist/example.js` since we are already inside `dist` folder.
index.html
```
<script src="example.js"></script>
```
| null | CC BY-SA 4.0 | null | 2023-02-20T03:59:15.193 | 2023-02-20T03:59:15.193 | null | null | 3,183,454 | null |
75,505,219 | 2 | null | 59,479,139 | 0 | null | In my case, inverting screen colours would also switch VSCode colour theme back to . I could alter these defaults by going to `Settings` (`⌘,` on mac) -> `Workbench` -> `Appearance` and changing the option under `Preferred High Contrast Light Colour Theme` to what I wanted.
| null | CC BY-SA 4.0 | null | 2023-02-20T04:15:29.240 | 2023-02-20T04:15:29.240 | null | null | 10,397,596 | null |
75,505,222 | 2 | null | 10,315,952 | 0 | null | The method ScriptErrorsSuppressed referenced above is not supported in the webBrowser control in .Net 6 and higher.
```
webBrowser1.ScriptErrorsSuppressed = true;
```
we need to build a handler and override the default script error window.
| null | CC BY-SA 4.0 | null | 2023-02-20T04:15:41.343 | 2023-02-24T15:00:56.133 | 2023-02-24T15:00:56.133 | 7,325,599 | 2,407,372 | null |
75,505,268 | 2 | null | 75,504,153 | 0 | null | In your service class in update method you are calling the save method.
```
@Override
public void update(UpdateBrandRequest updateBrandRequest) {
// jparepository brand tanıdığı için hep brand nesnesi lazım.
Brand brand = this.modelMapperService.forRequest().map(updateBrandRequest, Brand.class);
this.brandRepository.save(brand); // updaterequest içinde id olduğu için buradaki save, update işlemi yapar.
}
```
But before that for put mapping you need to send the Id for which you are trying to update and you have to use setters method to set the new values for that perticular record.
below I can show u the example from my code:
```
@Override
public Candy updateCandy(Candy candy, int candyId) throws CandyShopServiceException {
// TODO Auto-generated method stub
Candy candy1 = candyRepository.findById(candyId)
.orElseThrow(() -> new CandyNotFoundException("Candy by this Id not found"));
candy1.setCandyName(candy.getCandyName());
candy1.setCandyStock(candy.getCandyStock());
return candyRepository.save(candy1);
}
```
In the above code I am passing the Candy object and perticular candy Id from the postman as a put mapping and from that Id I'm looking for the perticular candy and using setter method to set the value of new candy by replacing existing candy record.
Feel free to comment if you have any doubt in this.
| null | CC BY-SA 4.0 | null | 2023-02-20T04:25:23.930 | 2023-02-20T04:25:23.930 | null | null | 21,201,506 | null |
75,505,424 | 2 | null | 67,248,426 | 2 | null | From onwards, there is a new modifier for called `.scrollBounceBehavior` that can be used to prevent ScrollView from bouncing when the content is smalled than the screen.
Example:
```
struct ContentView: View {
var body: some View {
ScrollView {
Rectangle()
.fill(Color.blue)
.frame(height: 300)
.padding()
}
.scrollBounceBehavior(.basedOnSize)
}
}
```
| null | CC BY-SA 4.0 | null | 2023-02-20T04:59:15.223 | 2023-02-20T04:59:15.223 | null | null | 9,389,429 | null |
75,505,451 | 2 | null | 9,340,800 | 0 | null | The Transitland APIs can answer your question. For example, try using the Transitland v2 REST API stops endpoint like this:
```
https://transit.land/api/v2/rest/stops?lat=xxx&lon=xxx&radius=1000&apikey=xxx
```
More information on the endpoint parameters and response at [https://www.transit.land/documentation/rest-api/stops](https://www.transit.land/documentation/rest-api/stops)
| null | CC BY-SA 4.0 | null | 2023-02-20T05:05:42.533 | 2023-02-20T05:05:42.533 | null | null | 40,956 | null |
75,505,532 | 2 | null | 75,505,392 | 2 | null | If you declare a variable with `var`, you can redeclare a variable with `var` as many times as you like, but it will error if you redeclare with `let` or `const`. With `let` and `const`, you can only declare a variable one.
What you probably meant to do is reassign the variable, which you can do as many times as you want with `var` or `let`, just don't add `var` or `let` again.
### Redeclaring
```
// valid, but not advised
var cube = (num) => num * num * num;
var cube = (num) => num * num * num;
```
```
// invalid
var cube = (num) => num * num * num;
let cube = (num) => num * num * num;
```
```
// invalid
var cube = (num) => num * num * num;
const cube = (num) => num * num * num;
```
### Reassigning
```
// valid
var cube = (num) => num * num * num;
cube = (num) => num * num * num;
```
```
// valid
let cube = (num) => num * num * num;
cube = (num) => num * num * num;
```
```
// invalid - can't change a const
const cube = (num) => num * num * num;
cube = (num) => num * num * num;
```
| null | CC BY-SA 4.0 | null | 2023-02-20T05:22:01.410 | 2023-02-20T05:22:01.410 | null | null | 12,101,554 | null |
75,505,555 | 2 | null | 75,497,587 | 0 | null | This should work:
```
<controls:DataGrid>
<controls:DataGrid.Resources>
<Color x:Key="DataGridRowSelectedBackgroundColor">Transparent</Color>
<Color x:Key="DataGridRowSelectedHoveredUnfocusedBackgroundColor">Transparent</Color>
<Color x:Key="DataGridRowSelectedUnfocusedBackgroundColor">Transparent</Color>
<!--
This one is better not being just "Transparent".
This way you won't lose visual effects for hovered selected rows.
-->
<StaticResource
x:Key="DataGridRowSelectedHoveredBackgroundColor"
ResourceKey="SystemListLowColor" />
</controls:DataGrid.Resources>
</controls:DataGrid>
```
You can find the colors in the GitHub [repo](https://github.com/CommunityToolkit/WindowsCommunityToolkit/blob/main/Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/DataGrid/DataGrid.xaml).
| null | CC BY-SA 4.0 | null | 2023-02-20T05:27:41.363 | 2023-02-20T05:27:41.363 | null | null | 2,411,960 | null |
75,505,663 | 2 | null | 75,486,462 | 0 | null | I Think SDK is not in your system But you can download SDK from android official site for Android, mac or Linux.
Here is the link : [https://developer.android.com/studio/releases/platform-tools](https://developer.android.com/studio/releases/platform-tools)
And paste the SDK here :
| null | CC BY-SA 4.0 | null | 2023-02-20T05:48:42.283 | 2023-02-20T05:48:42.283 | null | null | 21,231,507 | null |
75,506,024 | 2 | null | 71,687,585 | 0 | null | ```
1)Provide valid Secret key
2)Provide valid Publisable key
3)Update flutterstripe pacakge
4)provide valid currency code to create stripe account country
ex :- stripe account create india to inr etc..
5)Right Way to implemet
- Main.dart to main method run app to implemet
ex :--
Stripe.publishableKey = "your publishable key ";
- create controller / method
code:-
Map<String, dynamic>? paymentIntentData;
Future<void> makePayment({amount}) async {
try {
paymentIntentData =
await createPaymentIntent(amount: amount, currency: 'INR');
if (paymentIntentData != null) {
await Stripe.instance.initPaymentSheet(
paymentSheetParameters: SetupPaymentSheetParameters(
// applePay: true,
googlePay: const PaymentSheetGooglePay(merchantCountryCode: 'INR'),
merchantDisplayName: "PGA",
customerId: paymentIntentData!['customer'],
paymentIntentClientSecret: paymentIntentData!['client_secret'],
customerEphemeralKeySecret: paymentIntentData!['ephemeralkey'],
));
}
displayPaymentSheet();
} catch (err) {
logger.e(err);
}
}
void displayPaymentSheet() async {
try {
await Stripe.instance.presentPaymentSheet();
Get.snackbar("PaymentInfo", "Payment Successfully");
} on Exception catch (e) {
if (e is StripeException) {
logger.e(e, "Error From Stripe");
} else {
logger.e(e, "Unforeseen error");
}
} catch (e) {
logger.e("exeption === $e");
}
}
var id = "";
createPaymentIntent({amount, currency}) async {
try {
Map<String, dynamic> body = {
'amount': calculateAmount(amount: amount),
'currency': currency,
'payment_method_types[]': 'card'
};
var response = await http.post(
Uri.parse('https://api.stripe.com/v1/payment_intents'),
headers: {
'Authorization':
'Bearer YourSecretKey',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: body,
);
if (response.statusCode == 200) {
var decode = jsonDecode(response.body);
logger.e(decode);
id = decode['id'];
return decode;
}
} catch (e) {
logger.e(e, "error charging user");
}
}
calculateAmount({amount}) {
logger.e(amount.round());
final a = (int.parse(amount.toString())) * 100;
logger.e(a.toString());
update();
return a.toString();
}
6) How to Access Stripe payment :-
ex :- any button click
ontap : (){
makePayment(
amount: "200")
}
```
| null | CC BY-SA 4.0 | null | 2023-02-20T06:46:00.140 | 2023-02-20T10:22:44.883 | 2023-02-20T10:22:44.883 | 21,177,483 | 21,177,483 | null |
75,506,059 | 2 | null | 75,505,641 | 0 | null | As per the design, it seems like you have to use CustomPainter. If you have mentioned image in svg format, you can use [fluttershapmaker](https://fluttershapemaker.com/) to get the CustomPainter code, just you have to add svg image there and you will get code.
| null | CC BY-SA 4.0 | null | 2023-02-20T06:50:12.927 | 2023-02-20T06:50:12.927 | null | null | 19,994,489 | null |
75,506,162 | 2 | null | 47,493,325 | 0 | null |
1. Allow Inbound rule for 4200 in your PC/Laptop
> Open your windows defender firewall on your windows system and crate a new inbound rule with TCP port 4200, then select your connection type and set rule name and description.
1. Get your local machine's IP
> Just open your command prompt in your local machine, and run the following command
```
ipconfig
```
1. Make sure your local machine and your mobile connected
> You can view localhost:4200 on your mobile, only if both devices are connected within the same network. So make sure your connection.
1. Start your Angular application
> Start your angular application with the following command
```
ng s --host <YOUR_IP>
```
1. Open your web app
> Now you can open your web app at "http://<YOUR_IP:4200>" on both local system and your mobile.
for detailed reference check this shorts video: [How to open localhost:4200 in mobile](https://youtube.com/shorts/hSdAUnOci7o?feature=share)
| null | CC BY-SA 4.0 | null | 2023-02-20T07:04:23.887 | 2023-02-20T07:04:54.200 | 2023-02-20T07:04:54.200 | 18,279,721 | 18,279,721 | null |
75,506,389 | 2 | null | 75,506,300 | 1 | null | Just remove `height: 100vh;` from your `.opWrapper` selector:
```
.opWrapper{
width: 100%;
margin: 0 auto;
background-color: #232A4E;
}
```
The reason is that your are setting height to be the height of the view port.
You can find a working example here: [https://codesandbox.io/s/thirsty-wind-1ci7ei?file=/src/styles.css](https://codesandbox.io/s/thirsty-wind-1ci7ei?file=/src/styles.css)
| null | CC BY-SA 4.0 | null | 2023-02-20T07:31:04.850 | 2023-02-20T07:31:04.850 | null | null | 5,948,056 | null |
75,506,459 | 2 | null | 40,694,554 | -1 | null | you should increase free space in drive C and empty temp folder
| null | CC BY-SA 4.0 | null | 2023-02-20T07:39:55.583 | 2023-02-20T12:44:50.310 | 2023-02-20T12:44:50.310 | 15,425,199 | 15,425,199 | null |
75,506,592 | 2 | null | 28,576,636 | 0 | null | I want to extend a little answer because few people had the same question about preventing the default behavior of child elements when dragged.
The basis of the code is not mine - I just added another event listener inside the first function because I had the same issue as people commenting that when dragging elements like an anchor with images they were fired after releasing a mouse button.
```
function clickAndDrag(selector, scroll_speed = 3, classOnEvent = 'grabbed_elem') {
const slider = document.querySelector(selector);
let isDown = false;
let startX;
let scrollLeft;
slider.addEventListener('mousedown', (e) => {
e.preventDefault();
isDown = true;
slider.classList.add(classOnEvent);
startX = e.pageX - slider.offsetLeft;
scrollLeft = slider.scrollLeft;
// prevent default child behavior
document.body.addEventListener('click', function( event ){
if (slider.contains(event.target)) {
event.preventDefault();
}
});
});
slider.addEventListener('mouseleave', () => {
isDown = false;
slider.classList.remove(classOnEvent);
});
slider.addEventListener('mouseup', () => {
isDown = false;
slider.classList.remove(classOnEvent);
});
slider.addEventListener('mousemove', (e) => {
if(!isDown) return;
e.preventDefault();
const x = e.pageX - slider.offsetLeft;
const walk = (x - startX) * scroll_speed; //scroll-fast
slider.scrollLeft = scrollLeft - walk;
});
}
// usage
clickAndDrag('.yourSelector');
```
| null | CC BY-SA 4.0 | null | 2023-02-20T07:55:35.807 | 2023-02-20T07:55:35.807 | null | null | 2,760,717 | null |
75,506,612 | 2 | null | 57,933,593 | 0 | null | I went through all the answers and nothing really solved the issue I have been having, so I came up with this solution for those that need to support iOS < 16.
```
ScrollView([]) {
YourContentView()
}
```
Scroll view accepts the first argument as an axis set. If you provide an empty set, that is - just an empty collection, the scroll will be disabled.
This approach comes in handy if you have a view model, in which you can encapsulate this behaviour and change it in runtime.
| null | CC BY-SA 4.0 | null | 2023-02-20T07:57:30.943 | 2023-02-20T07:57:30.943 | null | null | 12,601,558 | null |
75,506,772 | 2 | null | 7,558,497 | 0 | null | idea22 on windows10 system, recent projects on the path `C:\Users\****\AppData\Roaming\JetBrains\IntelliJIdea2022.3\options\recentProjects.xml`, I delete all the `<entry><\entry>` labels
| null | CC BY-SA 4.0 | null | 2023-02-20T08:18:31.827 | 2023-02-20T08:18:31.827 | null | null | 9,807,005 | null |
75,506,794 | 2 | null | 75,298,274 | 0 | null | As [lorem ipsum](https://stackoverflow.com/users/12738750/lorem-ipsum) pointed out, NavigationLink with destination and label fixes this issue.
| null | CC BY-SA 4.0 | null | 2023-02-20T08:21:15.680 | 2023-02-20T08:21:15.680 | null | null | 6,403,505 | null |
75,507,053 | 2 | null | 36,804,534 | 0 | null | You just mispronounced the left point in your presentation
```
enter code here
public Mat GetPerspective(List<Point> corners, Mat sub)
{
//Pretty sure these four lines are the problem
double top = System.Math.Sqrt(System.Math.Pow(corners[0].x - corners[1].x, 2) + System.Math.Pow(corners[0].y - corners[1].y, 2));
double right = System.Math.Sqrt(System.Math.Pow(corners[1].x - corners[2].x, 2) + System.Math.Pow(corners[1].y - corners[2].y, 2));
double bottom = System.Math.Sqrt(System.Math.Pow(corners[2].x - corners[3].x, 2) + System.Math.Pow(corners[2].y - corners[3].y, 2));
double left = System.Math.Sqrt(System.Math.Pow(corners[3].x - corners[0].x, 2) + System.Math.Pow(corners[3].y - corners[0].y, 2));
Mat quad = Mat.zeros(new Size(System.Math.Max(top, bottom), System.Math.Max(left, right)), CvType.CV_8UC3);
List<Point> result_points = new List<Point>();
result_points.Add(new Point(0, 0));
result_points.Add(new Point(quad.cols(), 0));
result_points.Add(new Point(quad.cols(), quad.rows()));
result_points.Add(new Point(0, quad.rows()));
Mat cornerPts = OpenCVForUnity.UtilsModule.Converters.vector_Point2f_to_Mat(corners);
Mat resultPts = OpenCVForUnity.UtilsModule.Converters.vector_Point2f_to_Mat(result_points);
Mat transformation = Imgproc.getPerspectiveTransform(cornerPts, resultPts);
Imgproc.warpPerspective(sub, quad, transformation, quad.size());
return quad;
}
```
[enter image description here](https://i.stack.imgur.com/ZcQRf.png)
| null | CC BY-SA 4.0 | null | 2023-02-20T08:51:04.163 | 2023-02-20T08:55:09.100 | 2023-02-20T08:55:09.100 | 21,249,219 | 21,249,219 | null |
75,507,106 | 2 | null | 75,506,911 | 0 | null | I got same problem but my emulator is working fine. Use Android 9.0 and Pixel 3 API 28. The dialog box "attach a debugger or esc to cancel" occurs but the emulator works, you need to cancel this dialog box.
--->> use android 9.0 and pixel 3 api 28 emulator
| null | CC BY-SA 4.0 | null | 2023-02-20T08:55:18.530 | 2023-02-20T08:55:18.530 | null | null | 21,225,430 | null |
75,507,120 | 2 | null | 74,682,906 | 0 | null | At the end, I found out that I didn't install Data Provider for SAP and RFCs.
1. Install BizTalk adapters
2. SAP Logon (or other Data Provider for SAP) must be installed.
3. Must install RFCs to SAP before you query in the Import Data task. See tutorial
4. Follow this tutorial to import your data
| null | CC BY-SA 4.0 | null | 2023-02-20T08:56:16.353 | 2023-02-20T08:56:16.353 | null | null | 20,287,823 | null |
75,507,637 | 2 | null | 75,506,619 | 1 | null | Format for a date value is YYYY-MM-DD
```
<input type="date" value="2023-02-01">
```
| null | CC BY-SA 4.0 | null | 2023-02-20T09:47:06.360 | 2023-02-20T09:47:06.360 | null | null | 5,444,802 | null |
75,507,953 | 2 | null | 75,507,805 | 0 | null | Use a `Box` to put elements on top of another.
Something like:
```
Box(
contentAlignment = Alignment.Center
){
Image(
//...
)
Button(
onClick = {},
modifier = Modifier.align(Alignment.BottomCenter).padding(bottom = xx.dp)
){
Text("Connect Wallet")
}
}
```
[](https://i.stack.imgur.com/aqiLx.png)
| null | CC BY-SA 4.0 | null | 2023-02-20T10:17:04.180 | 2023-02-20T10:17:04.180 | null | null | 2,016,562 | null |
75,507,958 | 2 | null | 11,924,736 | 0 | null | Just delete module_info.java file and the referenced libraries are accessible instantly
| null | CC BY-SA 4.0 | null | 2023-02-20T10:17:33.150 | 2023-02-20T10:17:33.150 | null | null | 16,423,599 | null |
75,507,983 | 2 | null | 75,504,611 | 0 | null | The way I fixed this was removing the ability to have the same file duplicated in the same Dropzone.
:
Every time a new file is added to the dropzone, it will loop through all files currently in queue and compare the new file against the current index. It will check against the name, size and last modified date. If all 3 match, it will remove (not queue) the file the user tried to add.
```
init: function () {
this.on("addedfile", function(file) {
if (this.files.length) {
var _i, _len;
for (_i = 0, _len = this.files.length; _i < _len - 1; _i++){
if(this.files[_i].name === file.name && this.files[_i].size === file.size && this.files[_i].lastModifiedDate.toString() === file.lastModifiedDate.toString()){
this.removeFile(file);
}
}
}
});
};
```
| null | CC BY-SA 4.0 | null | 2023-02-20T10:20:19.747 | 2023-02-20T10:20:19.747 | null | null | 16,050,562 | null |
75,508,212 | 2 | null | 75,508,083 | 0 | null | Maybe another script is triggering the event.
try this
```
$("#generatebtn").click(function(e) {
e.stopPropagation();
e.preventDefault();
// your code
```
More information can be found here [What's the difference between event.stopPropagation and event.preventDefault?](https://stackoverflow.com/questions/5963669/whats-the-difference-between-event-stoppropagation-and-event-preventdefault)
| null | CC BY-SA 4.0 | null | 2023-02-20T10:42:23.997 | 2023-02-20T10:42:23.997 | null | null | 16,704,980 | null |
75,508,357 | 2 | null | 58,948,973 | 1 | null | You can simply change the sliders and step attributes.
This avoids unnecessary loops in the code!
-
> currentvalue = {"prefix": "Date: "}
Example:
> ```
sliders = [dict(
active=1,
currentvalue={"prefix": "Date: "},
pad={"t": 50},
steps=steps
)]
```
-
> label = dat['Date'][i]
Example:
> ```
step = dict(
method="restyle",
args=["visible", [False] * len(fig.data)],
label=dat['Date'][i]
)
```
Output image:
[Output image with dates](https://i.stack.imgur.com/ydRqg.png)
Full code:
```
# imports
import plotly.graph_objects as go
import pandas as pd
# sample data
dat=pd.DataFrame(dict(Date=['19/11/2012', '20/11/2012', '21/11/2012'],
A=[1,3,1],
B=[3,2,2],
C=[4,3,2],
D=[5,2,2],))
# Create figure
fig = go.Figure()
# Add traces, one for each slider step
for step in np.arange(len(dat['Date'])):
fig.add_trace(
go.Scatter(
visible=False,
line=dict(color="#00CED1", width=6),
name=" = " + str(step),
x=['A','B','C','D'],
y=dat.iloc[step,1::]))
# Make 10th trace visible
# Create and add slider
steps = []
for i in range(len(fig.data)):
step = dict(
method="restyle",
args=["visible", [False] * len(fig.data)],
label=dat['Date'][i]
)
step["args"][1][i] = True # Toggle i'th trace to "visible"
steps.append(step)
sliders = [dict(
active=1,
currentvalue={"prefix": "Date: "},
pad={"t": 50},
steps=steps
)]
fig.update_layout(
sliders=sliders
)
fig.show()
```
| null | CC BY-SA 4.0 | null | 2023-02-20T10:56:18.587 | 2023-02-20T10:56:18.587 | null | null | 18,475,283 | null |
75,508,588 | 2 | null | 75,492,075 | 0 | null | To add both images and text to a label, you have to also pass the `compound` argument. It specifies which side the image is drawn to the text.
Syntax-
```
tkinter.Label(image = img, compound = LEFT, text = "Hello World!")
```
This will add your image to the left of your text.
| null | CC BY-SA 4.0 | null | 2023-02-20T11:18:57.143 | 2023-02-20T11:18:57.143 | null | null | 21,158,396 | null |
75,508,774 | 2 | null | 75,506,022 | 0 | null | Don't know why this happening, but you can fix this issue by setting canvas color in `MaterialApp`'s `ThemeData` like this,
```
MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
useMaterial3: true,
canvasColor: Colors.white,///here
),
),
```
There must be some issue with `colorScheme` in `ThemeData`
You can also use this,
```
ThemeData(
useMaterial3: true,
// canvasColor: Colors.white,
colorScheme: ColorScheme.highContrastLight(),
),
```
| null | CC BY-SA 4.0 | null | 2023-02-20T11:37:23.840 | 2023-02-20T11:52:54.117 | 2023-02-20T11:52:54.117 | 17,213,269 | 17,213,269 | null |
75,508,900 | 2 | null | 75,508,178 | 1 | null | Konsole is quite smart, it has integrated many things. In this case, when hovering curses over some text it is showing you the color of that text, so YELLOW shows a yellow box.
> What kind of function is that? How is it named, configured, where is it part of?
You would have to browse KDE konsole source code for that.
| null | CC BY-SA 4.0 | null | 2023-02-20T11:48:21.607 | 2023-02-20T11:48:21.607 | null | null | 9,072,753 | null |
75,508,963 | 2 | null | 75,474,042 | 0 | null | I have reproduced issue from my side and below are steps i followed,
- In Http action, calling authentication url with method type post.- Passing username, password and grant_type in body in json format. Kindly note that in your case, pass client id and client secret and the content type which your request will accept. In my case i have user name and password and expected content type is json.
- Next taken another HTTP action, which will used to get data by passing token obtained from previous action.
- Logic app able to get token from authentication url and able to get data using bearer toke.


Second Http action output:

Refer the [SO](https://stackoverflow.com/questions/74404772/invoking-http-oauth-2-0-from-logicapp-standard) which is similar to your case and it may help you to solve issue.
| null | CC BY-SA 4.0 | null | 2023-02-20T11:56:50.983 | 2023-02-20T11:56:50.983 | null | null | 20,336,887 | null |
75,509,022 | 2 | null | 75,506,619 | 0 | null | I have an asp.net core web application and this is what I have in my `index.cshtml`
```
<div>
<label>date:</label>
<input type="date" id="ngaydk" />
<input type="date" id="ngaydk2" />
<input type="date" id="mydate" />
@Html.TextBox("date1", DateTime.Now.ToString("yyyy-MM-dd"), new { type = "date" })
</div>
<script>
document.getElementById("mydate").valueAsDate = new Date();
console.info(document.getElementById("mydate").value);
</script>
@section Scripts{
<script>
$(function () {
console.info("value is :" + $("#ngaydk2").val());
$("#ngaydk2").val('@DateTime.Now.ToString("yyyy-MM-dd")');
console.info("value is :" + $("#ngaydk2").val());
});
</script>
}
```
[](https://i.stack.imgur.com/MCVjB.png)
| null | CC BY-SA 4.0 | null | 2023-02-20T12:03:11.490 | 2023-02-20T12:42:08.603 | 2023-02-20T12:42:08.603 | 14,574,199 | 14,574,199 | null |
75,509,250 | 2 | null | 75,504,951 | 0 | null | there is no need that your frontend app (spa) knows any thing about tls or domain or IP your server has
you have environment variable
```
//development
baseUrl:'localhost:5001'
//production
// enviroment.prod.ts
baseUrl:'/api/'
```
when your in production build for it
simply do not use certificate for developement
| null | CC BY-SA 4.0 | null | 2023-02-20T12:23:52.600 | 2023-02-20T12:23:52.600 | null | null | 5,613,695 | null |
75,509,286 | 2 | null | 75,508,771 | 1 | null | You cannot subset the displayed columns when using `seqrplot` unless you want to find representatives of the truncated sequences. However, you can compute and retrieve the representatives of the complete sequences and then plot the truncated representatives. I illustrate below using the `biofam` data of TraMineR.
```
library(TraMineR)
## biofam data: sequences in columns 10 to 25
data(biofam)
biofam.lab <- c("Parent", "Left", "Married", "Left+Marr",
"Child", "Left+Child", "Left+Marr+Child", "Divorced")
biofam.seq <- seqdef(biofam, 10:25, labels=biofam.lab)
## LCS distances
biofam.lcs <- seqdist(biofam.seq, method="LCS")
## Representative set using the neighborhood density criterion
biofam.rep <- seqrep(biofam.seq, diss=biofam.lcs, criterion="density")
plot(biofam.rep[,6:13])
```
If you have groups, you must compute the representatives separately for each group and then arrange the plots manually using `layout` for example.
| null | CC BY-SA 4.0 | null | 2023-02-20T12:28:09.430 | 2023-02-20T12:28:09.430 | null | null | 1,586,731 | null |
75,509,709 | 2 | null | 75,509,655 | 1 | null | Try to set the crossAxisAligment to CrossAxisAligment.end inside your Row.
```
Row(
crossAxisAlignment: CrossAxisAlignment.end,
```
| null | CC BY-SA 4.0 | null | 2023-02-20T13:14:49.660 | 2023-02-20T13:14:49.660 | null | null | 5,812,524 | null |
75,509,739 | 2 | null | 75,509,655 | 0 | null | Try this code please.
```
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: TextField(
controller: _textController,
keyboardType: TextInputType.multiline,
minLines: 1,
maxLines: 20,
decoration: InputDecoration(
hintText: "Message...",
border: InputBorder.none,
),
),
),
FloatingActionButton(
mini: true,
elevation: 0,
onPressed: () {},
child: const Icon(
Icons.send,
color: Colors.white,
),
)
```
| null | CC BY-SA 4.0 | null | 2023-02-20T13:17:04.617 | 2023-02-20T13:17:04.617 | null | null | 13,985,644 | null |
75,509,736 | 2 | null | 75,481,660 | 0 | null | You should use [scrollable text control](https://learn.microsoft.com/en-us/windows/win32/msi/scrollabletext-control) for this puropse.
Should be something like that + you might use properties from [previous dialogs](https://stackoverflow.com/questions/56602336/wix-set-property-from-previous-dialog) or [custom action](https://stackoverflow.com/questions/7388795/using-a-wix-custom-action-to-set-a-propertys-value) for you dialog.
```
<Control Id="Title" Type="ScrollableText">
<Text> SOMECUSTOMPROPERTY </Text>
</Control>
```
[Here's](https://www.firegiant.com/wix/tutorial/user-interface-revisited/a-single-dialog/) a doc about dialogs in general.
| null | CC BY-SA 4.0 | null | 2023-02-20T13:16:45.660 | 2023-02-20T13:16:45.660 | null | null | 8,307,966 | null |
75,509,918 | 2 | null | 75,509,292 | 0 | null | Many style and semantic issues here.
- `float`- `<br>`- `<p>``<br>`-
## To the issue itself
A translation paragraph for paragraph IMHO is tabular data and as such a table should be used:
```
.verse img {
height: 1em;
}
table {
width: 100%;
}
td {
width: 50%;
padding: 1em;
}
```
```
<h1>PSALM 1</h1>
<table>
<tr>
<td>Beatus vir qui non abiit in consilio imporium, et in via peccatorum non stetit, et in cathedra pestilentiae non sedit.</td>
<td>Blessed is he who does not walk in the counsel of the wicked, nor stand in the way of sinners, nor sit in the seat of scorners.</td>
</tr>
<tr>
<td>sed in lege Domini voluntas ejus, et in lege ejus meditabitur die ac nocte.</td>
<td>But his delight is in the law of the <img src="/images/THE LORD.png">, and on His law he meditates day and night.</td>
</tr>
<tr>
<td>Et erit tamquam lignum quod plantatum est secus decursus aquarum, quod fructum suum dabit in tempore suo: et folium ejus non defluet; et omnia quaecumque faciet prosperabuntur.</td>
<td>He will be like a tree planted near good waters; he will bring good fruit in his season, and everything he does will prosper</td>
</tr>
<tr>
<td>Non sic impii, non sic; sed tamquam pulvis quem projicit ventus a facie terrae.</td>
<td>Not so with the wicked! Not so... they are like chaff that the wind blows away.</td>
</tr>
<tr>
<td>Ideo non resurgent impii in judicio, neque peccatores in concilio justorum:</td>
<td>Therefore, the wicked will not stand in judgement, nor in the company of the just.</td>
</tr>
<tr>
<td>quoniam novit Dominus viam justorum, et inter imporium peribit.</td>
<td>For the <img src="/images/THE LORD.png"/> watches over the way of the just, but the way of the wicked leads to destruction.</td>
</tr>
</table>
```
A visual alternative is the usage of CSS-Grid. However IMHO this would be semantically incorrect, especially for screen-readers:
```
.verse img {
height: 1em;
}
section {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 2em;
}
```
```
<h1>PSALM 1</h1>
<section>
<p data-lang="latin">
Beatus vir qui non abiit in consilio imporium, et in via peccatorum non stetit, et in cathedra pestilentiae non sedit.
</p>
<p data-lang="english">
Blessed is he who does not walk in the counsel of the wicked, nor stand in the way of sinners, nor sit in the seat of scorners.
</p>
<p data-lang="latin">
sed in lege Domini voluntas ejus, et in lege ejus meditabitur die ac nocte.
</p>
<p data-lang="english">
But his delight is in the law of the <img src="/images/THE LORD.png">, and on His law he meditates day and night.
</p>
<p data-lang="latin">
Et erit tamquam lignum quod plantatum est secus decursus aquarum, quod fructum suum dabit in tempore suo: et folium ejus non defluet;
et omnia quaecumque faciet prosperabuntur.
</p>
<p data-lang="english">
He will be like a tree planted near good waters; he will bring good fruit in his season, and everything he does will prosper
</p>
<p data-lang="latin">
Non sic impii, non sic; sed tamquam pulvis quem projicit ventus a facie terrae.
</p>
<p data-lang="english">
Not so with the wicked! Not so... they are like chaff that the wind blows away.
</p>
<p data-lang="latin">
Ideo non resurgent impii in judicio, neque peccatores in concilio justorum:
</p>
<p data-lang="english">
Therefore, the wicked will not stand in judgement, nor in the company of the just.
</p>
<p data-lang="latin">
quoniam novit Dominus viam justorum, et inter imporium peribit.
</p>
<p data-lang="english">
For the <img src="/images/THE LORD.png"/> watches over the way of the just, but the way of the wicked leads to destruction.
</p>
</section>
```
| null | CC BY-SA 4.0 | null | 2023-02-20T13:33:54.900 | 2023-02-20T13:41:26.467 | 2023-02-20T13:41:26.467 | 14,072,420 | 14,072,420 | null |
75,510,078 | 2 | null | 75,508,553 | 1 | null |
If you are willing to store your data in columns, then you may benefit from COUNTIFS to get your desired output:
> [COUNTIFS function](https://support.microsoft.com/en-us/office/countifs-function-dda3dc6e-f74e-4aee-88bc-aa8c2a866842)
[](https://i.stack.imgur.com/PHdQy.png)
Yellow rows are the values that in the other list.
I've created a Conditional Formatting rule based on this formula in List 1:
```
=COUNTIFS($E$6:$E$14;$A6;$F$6:$F$14;$B6;$G$6:$G$14;$C6)=0
```
Similar in List 2:
```
=COUNTIFS($A$6:$A$14;$E6;$B$6:$B$14;$F6;$C$6:$C$14;$G6)=0
```
| null | CC BY-SA 4.0 | null | 2023-02-20T13:49:40.280 | 2023-02-20T13:49:40.280 | null | null | 9,199,828 | null |
75,510,235 | 2 | null | 75,507,796 | 0 | null | the error message tells you what the problem is and how to fix it
> Cannot deserialize the current JSON object ... because the type
requires a JSON array ... to deserialize correctly. To fix this error
either change the JSON to a JSON array ... or change the deserialized
type so that it is a normal .NET type
instead of this
```
var objResponse1 = JsonConvert.DeserializeObject<List<TrackOrderModel>>(result)
```
do this
```
var objResponse1 = JsonConvert.DeserializeObject<Root>(result)
```
| null | CC BY-SA 4.0 | null | 2023-02-20T14:04:38.550 | 2023-02-20T14:04:38.550 | null | null | 1,338 | null |
75,510,633 | 2 | null | 75,424,574 | 1 | null | If you try to select the radio button, you should use the following code :
```
WebElement rvbtn = driver.findElement(By.name("inputValue"));
rvbtn.click();
```
You used the attribute instead of the attribute inside your selector.
| null | CC BY-SA 4.0 | null | 2023-02-20T14:36:36.313 | 2023-02-20T14:36:36.313 | null | null | 15,790,813 | null |
75,510,728 | 2 | null | 75,509,888 | 3 | null | You can rely on both pseudo element with a skew transformation. Each pseudo element will define half the element shape.
```
body {
background-color: #f3ece5;
}
.categories-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 25px;
padding: 40px;
}
.categories-grid .single-category {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
padding: 20px 0;
border-top: 1px solid #e2d2c2;
position: relative;
z-index: 0;
overflow:hidden;
}
.categories-grid .single-category:before,
.categories-grid .single-category:after {
content:"";
position: absolute;
z-index: -1;
width: 50%;
height: 100%;
background: #fff;
border: solid #e2d2c2;
}
.categories-grid .single-category:before {
top:0;
left:0;
transform: skewY(8deg);
transform-origin: right;
border-width: 0 0 1px 1px;
}
.categories-grid .single-category:after {
top:0;
right:0;
transform: skewY(-8deg);
transform-origin: left;
border-width: 0 1px 1px 0;
}
```
```
<section class="categories">
<div class="container">
<div class="categories-grid">
<div class="single-category">
<img src="https://via.placeholder.com/200x140" alt="image" />
<h3>Title</h3>
<div class="link">
<a href="#">somewhere</a>
</div>
</div>
<div class="single-category">
<img src="https://via.placeholder.com/200x140" alt="image" />
<h3>Title</h3>
<div class="link">
<a href="#">somewhere</a>
</div>
</div>
<div class="single-category">
<img src="https://via.placeholder.com/200x140" alt="image" />
<h3>Title</h3>
<div class="link">
<a href="#">somewhere</a>
</div>
</div>
</div>
</div>
</section>
```
| null | CC BY-SA 4.0 | null | 2023-02-20T14:45:31.100 | 2023-02-20T14:45:31.100 | null | null | 8,620,333 | null |
75,510,787 | 2 | null | 75,510,081 | 0 | null | You're trying to read the name property of undefined (in the `PostDetailComponent`, code row 24, `name: this.user.name`), because when you declare your component, the field `user` is not defined. That's why it tries to read the `name` field of the user object.
You have a few ways to fix it:
1. Add the optional chaining operator to the reading of the name property. You will have the next code on the 24th row: name: this.user?.name,.
2. You can mock the user object in your tests. In the spec file on the 34th row mock the class field: component.user = {} as User;. Then when your component tries to read the name property, you will have an empty object, but not undefined and you will have no errors.
| null | CC BY-SA 4.0 | null | 2023-02-20T14:52:12.647 | 2023-02-20T14:52:12.647 | null | null | 11,399,021 | null |
75,511,235 | 2 | null | 75,506,521 | 0 | null | Use Joints to create connections between physical objects.
Each physical object ceases to depend on the hierarchy.
If you do not need physics, then you can make objects kinematic or remove physics altogether.
| null | CC BY-SA 4.0 | null | 2023-02-20T15:32:45.307 | 2023-02-20T15:32:45.307 | null | null | 17,844,730 | null |
75,511,355 | 2 | null | 11,378,249 | 0 | null |
## A view with a spiral .. 2023
It's very easy to draw a spiral mathematically and there are plenty of examples around.
[https://github.com/mabdulsubhan/UIBezierPath-Spiral/blob/master/UIBezierPath%2BSpiral.swift](https://github.com/mabdulsubhan/UIBezierPath-Spiral/blob/master/UIBezierPath%2BSpiral.swift)
Put it in a view in the obvious way:
```
class Example: UIView {
private lazy var spiral: CAShapeLayer = {
let s = CAShapeLayer()
s.strokeColor = UIColor.systemPurple.cgColor
s.fillColor = UIColor.clear.cgColor
s.lineWidth = 12.0
s.lineCap = .round
layer.addSublayer(s)
return s
}()
private lazy var sp: CGPath = {
let s = UIBezierPath.getSpiralPath(
center: bounds.centerOfCGRect(),
startRadius: 0,
spacePerLoop: 4,
startTheta: 0,
endTheta: CGFloat.pi * 2 * 5,
thetaStep: 10.radians)
return s.cgPath
}()
override func layoutSubviews() {
super.layoutSubviews()
clipsToBounds = true
spiral.path = sp
}
}
```
| null | CC BY-SA 4.0 | null | 2023-02-20T15:42:50.060 | 2023-02-20T15:42:50.060 | null | null | 294,884 | null |
75,511,438 | 2 | null | 75,510,789 | 0 | null | Select the tablix control and then set the `RepeatRowHeaders` property to `True`.
[](https://i.stack.imgur.com/AUnUP.png)
---
Update after looking at RDL
---
I cannot work out why your report is not working (limited time to investigate). However, I removed the matrix control and just created it from scratch, I did not do anything else and, other that a bit of formatting that I didn't replicate, it works as expected.
This GIF shows you your version on the left vs the version I edited on the right
[](https://i.stack.imgur.com/kktog.gif)
I can't share the revised version directly so if you can provide a dropbox folder that I can update, I can send you the revised RDL back. If not I'll send it from my personal account later somehow.
| null | CC BY-SA 4.0 | null | 2023-02-20T15:50:09.997 | 2023-02-22T14:15:59.097 | 2023-02-22T14:15:59.097 | 1,775,389 | 1,775,389 | null |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.