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
list |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
73,847,727 | 2 | null | 73,845,040 | 1 | null | Start by adding for Date and Time only:
```
Date = DATEVALUE(FORMAT('Table'[Datetime], "YYYY-MM-DD"))
Time = TIMEVALUE(FORMAT('Table'[Datetime], "hh:mm"))
```
With this you create a new for consumption per day
```
Consumption per day =
SUMMARIZE(
'Table',
'Table'[Date],
"Avg. Consumption", AVERAGE('Table'[Consumption])
)
```
and consumption per day for a given time interval
```
Consumption per day and time interval =
CALCULATETABLE(
SUMMARIZE(
'Table',
'Table'[Date],
"Avg. Consumption", AVERAGE('Table'[Consumption])
),
'Table'[Time] >= TIMEVALUE("00:00"),
'Table'[Time] <= TIMEVALUE("01:00")
)
```
| null | CC BY-SA 4.0 | null | 2022-09-25T20:42:51.090 | 2022-09-25T20:42:51.090 | null | null | 7,108,589 | null |
73,848,053 | 2 | null | 25,747,499 | 0 | null | For anyone trying to count the minutes between two LocalTime objects, keep in mind that the result will be minus 1.
For example,
```
long countMins = MINUTES.between( LocalTime.of(8,00),LocalTime.of(9,59) );
System.out.println("countMins = " + countMins );
```
will give the Output: `countMins = 119` instead of 120
| null | CC BY-SA 4.0 | null | 2022-09-25T21:49:32.543 | 2022-09-25T21:49:32.543 | null | null | 8,032,275 | null |
73,848,626 | 2 | null | 73,848,371 | 1 | null | To restructure this you would first need to create some sort of datamodel that holds the different informations related to each topic you want to display.
## Disclaimer:
I´m not going to post a complete working example. So no need in asking for one. But I will try to point you in the correct direction.
---
First create an enum that defines all the different topics you want to display. I implemented only 2 cases and not all properties but the idea behind it should become clear.
```
enum Topic: CaseIterable, Identifiable{
// all the topics
case friendship, wealth
// to conform to Identifiable
var id: Topic { self }
// create the background gradient
var background: LinearGradient{
switch self{
case .friendship:
return LinearGradient(colors: [Color("ColorFriendshipLight"), Color("ColorFriendshipDark")], startPoint: .topLeading, endPoint: .bottomTrailing)
case .wealth:
return LinearGradient(colors: [Color("ColorWealthLight"), Color("ColorWealthDark")], startPoint: .topLeading, endPoint: .bottomTrailing)
}
}
// the image names
var imagename: String{
switch self{
case .friendship:
return "menu-icon-friendship"
case .wealth:
return "menu-icon-wealth"
}
}
// here you create the target view. If the views need to get properties set, you can give your enum cases assosiated values and add them during initialization
@ViewBuilder
var targetView: some View{
switch self{
case .friendship:
FriendshipListView()
case .wealth:
WealthListView()
}
}
}
```
and using a `LazyVGrid` the Views become pretty simple:
```
struct ContentView: View{
let columns = [GridItem(.flexible()), .init(.flexible())]
var body: some View{
NavigationView{
ScrollView{
LazyVGrid(columns: columns) {
// iterate over all topics
ForEach(Topic.allCases){ topic in
// create you reusable view and pass the data into it
CardView(topic: topic)
}
}
}
}
}
}
// this view will be reused for displayin the topics
struct CardView: View{
let topic: Topic
// Shadow Icons
private let radius = 7
private let xOffset = 6
private let yOffset = 6
var body: some View{
NavigationLink(destination: topic.targetView) {
VStack(alignment: .center) {
// I don´t think you need the geometry reader here but
// I don´t know how your view will look without it
GeometryReader { geo in
Image(topic.imagename)
.resizable()
.scaledToFit()
.frame(
width: geo.size.width,
height: geo.size.height)
.shadow(color: topic.shadowColor, radius: CGFloat(radius), x: CGFloat(xOffset), y: CGFloat(yOffset))
}
Text(topic.title)
.titleStyle()
}
.frame(maxWidth: .infinity, maxHeight: 110)
.padding(30)
.background(topic.background)
.cornerRadius(20)
}
}
}
```
| null | CC BY-SA 4.0 | null | 2022-09-26T00:16:11.817 | 2022-09-26T00:21:52.183 | 2022-09-26T00:21:52.183 | 6,950,415 | 6,950,415 | null |
73,849,160 | 2 | null | 71,880,198 | -1 | null | Just add:
mode: ‘no-cors’
before headers.
| null | CC BY-SA 4.0 | null | 2022-09-26T02:38:37.150 | 2022-09-26T02:38:37.150 | null | null | 4,282,752 | null |
73,849,313 | 2 | null | 73,233,258 | 0 | null | you could try to change the build setting in Widget extension
"Build Setting" -> search for "intent class" -> change the language to "Swift" and run again.
| null | CC BY-SA 4.0 | null | 2022-09-26T03:16:56.310 | 2022-09-26T03:16:56.310 | null | null | 604,355 | null |
73,849,541 | 2 | null | 73,848,940 | 1 | null | Since I already had some code, I will throw you a bone.
This would be simply incrementing a value held in a textbox on a form. I include a timer delay so you can watch the numbers change.
```
Dim x As Integer
Dim Start As Double
Me.tbxHours = Null
For x = 1 To 15
Me.tbxHours = Nz(Me.tbxHours, 0) + 1
Start = Timer
While Timer < Start + 0.1
DoEvents
Wend
Next
```
Now where you use that code and how you trigger it is for you to determine.
| null | CC BY-SA 4.0 | null | 2022-09-26T04:05:13.717 | 2022-09-26T04:05:13.717 | null | null | 7,607,190 | null |
73,849,609 | 2 | null | 73,812,971 | 0 | null |
```
=ARRAYFORMULA(LAMBDA(u, {UNIQUE(u),COUNTIF(u, "="&UNIQUE(u))})
(LAMBDA(t, IFS(t=FALSE,"Color",t=TRUE,"Black"))
(REGEXMATCH(trim(LAMBDA(f, FILTER(f,f<>""))(FLATTEN(L2:P))), "(?i)black"))))
```
[](https://i.stack.imgur.com/pE3gt.png)
## Demo
[](https://i.stack.imgur.com/CUAp9.gif)
| null | CC BY-SA 4.0 | null | 2022-09-26T04:21:32.853 | 2022-09-26T04:35:37.057 | 2022-09-26T04:35:37.057 | 19,529,694 | 19,529,694 | null |
73,849,714 | 2 | null | 64,997,553 | 1 | null | try `conda install -n base ipykernel --update-deps --force-reinstall`
| null | CC BY-SA 4.0 | null | 2022-09-26T04:47:46.023 | 2022-09-26T04:47:46.023 | null | null | 16,241,031 | null |
73,849,808 | 2 | null | 73,849,051 | 0 | null | share your reference image,
make your two price-para class into one and add below button tag.
| null | CC BY-SA 4.0 | null | 2022-09-26T05:08:23.857 | 2022-09-26T05:08:23.857 | null | null | 12,238,257 | null |
73,850,214 | 2 | null | 73,849,680 | 5 | null | It's a bit of a hack, but it takes care of all of the cases in the example dataset. Each number is converted to a subscript using a custom labeler to create an expression. The major trick is that subscripts at the end of an expression or before a close parenthesis don't need `*`, but inside they do.
```
library(stringr); library(scales) # pkg:metan must have attached pkg:ggplot2
make_subscripts <- function(x){
x <- str_replace_all(string = x,
pattern = "([0-9]+)(?=\\w)", #Internal numbers
replacement = "[\\1]*")
x <- str_replace_all(x,
pattern = "([0-9]+)(?=$|[)])", #End numbers
replacement = "[\\1]")
x <- str_replace_all(x,
pattern = "\\s", #Spaces
replacement = "~")
x
}
plot(corrl) +
scale_x_discrete(labels = \(x)parse(text = make_subscripts(x))) +
scale_y_discrete(position = "right",
labels = \(x)parse(text = make_subscripts(x)))
```
[](https://i.stack.imgur.com/5GSdH.png)
| null | CC BY-SA 4.0 | null | 2022-09-26T06:17:19.487 | 2022-09-28T03:41:39.277 | 2022-09-28T03:41:39.277 | 1,855,677 | 13,095,326 | null |
73,850,300 | 2 | null | 73,850,164 | 1 | null | You have to avoid indexing into a variable when it is `$null`.
For and older you could use an inline `if` statement like this:
```
$event = [xml]( if( $events ) { $events[0].ToXml() } else { '' } )
```
provides a simplified syntax using [ternary operator](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_operators?view=powershell-7.2#ternary-operator--if-true--if-false) `?`:
```
$event = [xml]( $events ? $events[0].ToXml() : '' )
```
In both cases we take advantage of the fact that `$null` evaluates to `$false` in a boolean context.
| null | CC BY-SA 4.0 | null | 2022-09-26T06:28:56.257 | 2022-09-26T06:28:56.257 | null | null | 7,571,258 | null |
73,850,746 | 2 | null | 73,850,241 | 0 | null | Two ways:
For Next:
```
Set rngAree = [Aree]
For Each cl In rngAree ' set Aree
If intPos = 0 Then
Session.FindById("wnd[0]/usr/ctxtIWERK-LOW").Text = cl.Value
Session.FindById("wnd[0]/usr/btn%_IWERK_%_APP_%-VALU_PUSH").press
Else
Session.FindById("wnd[1]/usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL_255-SLOW_I[1," & intPos & "]").Text = cl.Value
End If
intPos = intPos + 1
Next
```
If the number of values exceeds 8 rows I prefer to `.Copy` and `.Paste` with button
[](https://i.stack.imgur.com/E2H9w.png)
```
Session.FindById("wnd[1]/tbar[0]/btn[24]").press
```
| null | CC BY-SA 4.0 | null | 2022-09-26T07:23:01.830 | 2022-09-26T07:23:01.830 | null | null | 4,840,576 | null |
73,851,041 | 2 | null | 73,845,855 | 0 | null | There are some problems in the code:
- the test `if (i < n)` is not strict enough: you should stop storing characters to the destination array before it is full to save space for the null terminator.- you must allocate one extra byte for the null terminator: `malloc((length + 1) * sizeof(char))` or just `malloc(length + 1)` as `sizeof(char)` is `1` by definition.- you should test for `EOF` in addition to `'\n'` in the reading loops.
Here is a modified version:
```
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define BUFFER_SIZE 4096
int input(char *str, int n);
int main() {
int a, c, i, length = 0;
printf("How many questions do you want?\n");
if (scanf("%d", &a) != 1 || a <= 0) {
fprintf(stderr, "invalid input\n");
return 1;
}
char *strarr[a];
char buffer[BUFFER_SIZE]; //string holder
// flush the rest of the input line
while ((c = getchar()) != EOF && c != '\n')
continue;
for (i = 0; i < a; i++) {
printf("Question number #%d:\n", i + 1);
//input method returns number of chars we've entered
length = input(buffer, BUFFER_SIZE);
//allocating memory for each pointers to array of chars
strarr[i] = malloc((length + 1) * sizeof(char));
if (strarr[i] == NULL) {
fprintf(stderr, "allocation error\n");
a = i;
break;
}
//copy the string you've just created to an array of strings
strcpy(strarr[i], buffer);
}
//printing results
printf("_____________\n");
for (i = 0; i < a; i++) {
printf("%s\n", strarr[i]);
}
return 0;
}
int input(char *str, int n) {
int ch, i = 0;
while ((ch = getchar()) != EOF && ch != '\n') {
if (i + 1 < n)
str[i++] = ch;
}
if (i < n)
str[i] = '\0';
return i;
}
```
Also note that you can use `strdup()` to allocate and copy the string in a single call:
```
for (i = 0; i < a; i++) {
printf("Question number #%d:\n", i + 1);
input(buffer, BUFFER_SIZE);
/* allocate a copy of the string */
strarr[i] = strdup(buffer);
if (strarr[i] == NULL) {
fprintf(stderr, "allocation error\n");
a = i;
break;
}
}
```
| null | CC BY-SA 4.0 | null | 2022-09-26T07:52:24.653 | 2022-09-26T07:52:24.653 | null | null | 4,593,267 | null |
73,851,061 | 2 | null | 73,829,258 | 1 | null | Thanks to [@JindraLacko](https://stackoverflow.com/questions/73829258/plot-filled-areas-for-sea-ocean-and-land-mass-based-on-osmdata-using-ggplot2#comment130366544_73829258), I was able to make my reprex work. Basically, we create a rectangle/polygon which is the size of our bbox and then split it via the coastline.
```
library(lwgeom)
library(osmdata)
library(osmplotr)
library(sf)
library(tidyverse)
### define example bbox
lon_min <- 12.00 # xmin
lon_max <- 12.18 # xmax
lat_min <- 54.08 # ymin
lat_max <- 54.20 # ymax
bb <- get_bbox(c(lon_min, lat_min, lon_max, lat_max))
### get "water" that is not sea as polygons
water <- opq(bb) %>%
add_osm_feature(key = "natural", value = "water") %>%
osmdata_sf()
### get sea & land as polygons
# 1. get coastline (as line)
coast <- opq(bb) %>%
add_osm_feature(key = "natural", value = "coastline") %>%
osmdata_sf()
# 2. get overall rectangle for bbox
bb_rect <- data.frame(
lat = c(lat_min, lat_max),
lon = c(lon_min, lon_max)
) %>%
st_as_sf(coords = c("lon", "lat"), crs = 4326) %>%
st_bbox() %>%
st_as_sfc()
# 3. split overall rectangle for bbox via coastline
bb_rect_split <- bb_rect %>%
st_split(coast$osm_lines) %>%
st_collection_extract("POLYGON")
# 4. extract splitted rectangle parts
land <- bb_rect_split[1]
sea <- bb_rect_split[2]
### ggplot
ggplot() +
geom_sf(
data = land,
fill = "bisque",
color = NA
) +
geom_sf(
data = sea,
fill = "navy",
color = NA
) +
geom_sf(
data = water$osm_multipolygons,
fill = "navy",
color = NA
)
```

[reprex v2.0.2](https://reprex.tidyverse.org)
| null | CC BY-SA 4.0 | null | 2022-09-26T07:54:03.820 | 2022-09-26T08:07:00.343 | 2022-09-26T08:07:00.343 | 8,830,099 | 8,830,099 | null |
73,851,666 | 2 | null | 73,772,023 | 0 | null | finally find the solution with the SUM function :)
SUM(CAST(dbo.SalarieAnciennetePlus10(IdSalarie, 2021)as int))
Thx
| null | CC BY-SA 4.0 | null | 2022-09-26T08:49:03.517 | 2022-09-26T08:49:03.517 | null | null | 19,110,870 | null |
73,851,874 | 2 | null | 73,836,447 | 0 | null | You could use [Jquery selectors](https://www.w3schools.com/jquery/jquery_ref_selectors.asp) to identify UI elements. Use something like below in the Text editor of your UI element:
```
label:contains("Retailer Number")
```
[](https://i.stack.imgur.com/fuUsf.png)
Tomasz Poszytek also has a video about his:
[https://www.youtube.com/watch?v=Lpk35MeTgFA&t=1704s](https://www.youtube.com/watch?v=Lpk35MeTgFA&t=1704s)
| null | CC BY-SA 4.0 | null | 2022-09-26T09:06:52.483 | 2022-09-26T09:06:52.483 | null | null | 19,580,297 | null |
73,852,087 | 2 | null | 73,851,652 | 2 | null | Here's an approach using the `gridExtra` package.
```
library(tidyverse)
library(gridExtra)
text_data <- data.frame(
time = rnorm(5, 2, 0.2) ,
x = sample(100:130, 5),
y = sample(40:50, 5),
z = rnorm(5, -1, 0.3)
) %>%
mutate(
across(.f = ~ as.character(round(., 2))),
time = paste(time, "seconds")
)
grob_list <- map(1:nrow(text_data), ~ {
text_data[.x,] %>%
as_vector() %>%
as.matrix(ncol = 1) %>%
tableGrob(theme = ttheme_minimal())
})
grid.arrange(grobs = grob_list, ncol = 1)
```
[](https://i.stack.imgur.com/IVhtY.png)
| null | CC BY-SA 4.0 | null | 2022-09-26T09:25:08.323 | 2022-09-26T09:34:23.423 | 2022-09-26T09:34:23.423 | 3,834,139 | 3,834,139 | null |
73,852,138 | 2 | null | 73,849,730 | 1 | null | The Data Safety form is incorrect.
Possible fixes:
- - - - -
| null | CC BY-SA 4.0 | null | 2022-09-26T09:28:19.967 | 2022-09-26T09:28:19.967 | null | null | 6,852,845 | null |
73,852,167 | 2 | null | 73,851,652 | 2 | null | With `ggpp::geom_table`:
```
library(ggplot2)
library(ggpp)
library(dplyr)
library(tidyr)
library(tibble)
text_data <- data.frame(
rep = 1:5,
time = rnorm(5, 2, 0.2),
x = sample(100:130, 5),
y = sample(40:50, 5),
z = rnorm(5, -1, 0.3)
)
dat <- text_data %>%
pivot_longer(cols = -rep)
tbs <- lapply(split(dat, dat$rep), "[", -1L)
df <- tibble(x = rep(-Inf, length(tbs)),
y = rep(Inf, length(tbs)),
rep = levels(as.factor(dat$rep)),
tbl = tbs)
ggplot(text_data) +
geom_point(aes(x = x, y = y)) +
geom_table(data = df, aes(x = x, y = y, label = tbl),
hjust = 0, vjust = 1) +
facet_wrap(~ rep)
```
[](https://i.stack.imgur.com/saVEz.png)
| null | CC BY-SA 4.0 | null | 2022-09-26T09:30:03.110 | 2022-09-26T09:30:03.110 | null | null | 1,100,107 | null |
73,852,223 | 2 | null | 59,679,339 | 1 | null | I got the same problem too, here is what i did differently.
1. Install android studio.
2. Open Android studio > More Actions > Virtual Device Manager > Create device > Select Device > Select System Image "Orea version 27"
3. Make sure your hard disk have enough free space to run the emmulator.
4. On VS code, navigate to lib > main.dart.
5. Right click on main.dart > click on "Start Debugging"
| null | CC BY-SA 4.0 | null | 2022-09-26T09:36:09.480 | 2022-09-26T09:36:09.480 | null | null | 3,967,044 | null |
73,852,398 | 2 | null | 3,929,611 | 0 | null | [It's related to the answer from Julie B: above]
[https://stackoverflow.com/a/9215532/5885615](https://stackoverflow.com/a/9215532/5885615)
This is the old topic, but someone still can want to do something (I did it recently).
So I have found one issue showing a bit different results between R and Minitab: the QQ-plots are similar, but the end points are shifted more outside. After digging inside the code I have found the difference:
The function "ppoints" is used to distribute the sample by the range:
```
df<-data.frame(x=sort(x),y=qnorm(ppoints(length(x))))
```
In R it has the next source code:
```
function (n, a = if (n <= 10) 3/8 else 1/2) # function"ppoints"
{
if (length(n) > 1L)
n <- length(n)
if (n > 0)
(1L:n - a)/(n + 1 - 2 * a)
else numeric()
}
```
where the parameter "a", depending on "n", can be 3/8 or 1/2.
Minitab uses a = 0.3 for all "n".
The most visible effect is on the end points of the sample.
| null | CC BY-SA 4.0 | null | 2022-09-26T09:52:33.277 | 2022-09-26T12:55:51.970 | 2022-09-26T12:55:51.970 | 5,885,615 | 5,885,615 | null |
73,852,633 | 2 | null | 73,850,241 | 1 | null | As in the comments mentioned you put your data into the clipboard. I use the code below for that. Also have look at [1](https://stackoverflow.com/a/54978696) and [2](https://www.thespreadsheetguru.com/blog/2015/1/13/how-to-use-vba-code-to-copy-text-to-the-clipboard)
```
Option Explicit
' https://www.thespreadsheetguru.com/blog/2015/1/13/how-to-use-vba-code-to-copy-text-to-the-clipboard
' https://stackoverflow.com/a/54978696
#If VBA7 Then
Private Declare PtrSafe Function OpenClipboard Lib "User32" (ByVal hWnd As LongPtr) As LongPtr
Private Declare PtrSafe Function EmptyClipboard Lib "User32" () As LongPtr
Private Declare PtrSafe Function CloseClipboard Lib "User32" () As LongPtr
Private Declare PtrSafe Function IsClipboardFormatAvailable Lib "User32" (ByVal wFormat As LongPtr) As LongPtr
Private Declare PtrSafe Function GetClipboardData Lib "User32" (ByVal wFormat As LongPtr) As LongPtr
Private Declare PtrSafe Function SetClipboardData Lib "User32" (ByVal wFormat As LongPtr, ByVal hMem As LongPtr) As LongPtr
Private Declare PtrSafe Function GlobalAlloc Lib "kernel32.dll" (ByVal wFlags As Long, ByVal dwBytes As Long) As LongPtr
Private Declare PtrSafe Function GlobalLock Lib "kernel32.dll" (ByVal hMem As LongPtr) As LongPtr
Private Declare PtrSafe Function GlobalUnlock Lib "kernel32.dll" (ByVal hMem As LongPtr) As LongPtr
Private Declare PtrSafe Function GlobalSize Lib "kernel32" (ByVal hMem As LongPtr) As Long
Private Declare PtrSafe Function lstrcpy Lib "kernel32.dll" Alias "lstrcpyW" (ByVal lpString1 As Any, ByVal lpString2 As Any) As LongPtr
#Else
Private Declare Function OpenClipboard Lib "user32.dll" (ByVal hWnd As Long) As Long
Private Declare Function EmptyClipboard Lib "user32.dll" () As Long
Private Declare Function CloseClipboard Lib "user32.dll" () As Long
Private Declare Function IsClipboardFormatAvailable Lib "user32.dll" (ByVal wFormat As Long) As Long
Private Declare Function GetClipboardData Lib "user32.dll" (ByVal wFormat As Long) As Long
Private Declare Function SetClipboardData Lib "user32.dll" (ByVal wFormat As Long, ByVal hMem As Long) As Long
Private Declare Function GlobalAlloc Lib "kernel32.dll" (ByVal wFlags As Long, ByVal dwBytes As Long) As Long
Private Declare Function GlobalLock Lib "kernel32.dll" (ByVal hMem As Long) As Long
Private Declare Function GlobalUnlock Lib "kernel32.dll" (ByVal hMem As Long) As Long
Private Declare Function GlobalSize Lib "kernel32" (ByVal hMem As Long) As Long
Private Declare Function lstrcpy Lib "kernel32.dll" Alias "lstrcpyW" (ByVal lpString1 As Long, ByVal lpString2 As Long) As Long
#End If
Public Sub SetClipboard(ByVal sUniText As String)
#If VBA7 Then
Dim iStrPtr As LongPtr
Dim iLock As LongPtr
#Else
Dim iStrPtr As Long
Dim iLock As Long
#End If
Dim iLen As Long
Const GMEM_MOVEABLE As Long = &H2
Const GMEM_ZEROINIT As Long = &H40
Const CF_UNICODETEXT As Long = &HD
OpenClipboard 0&
EmptyClipboard
iLen = LenB(sUniText) + 2&
iStrPtr = GlobalAlloc(GMEM_MOVEABLE + GMEM_ZEROINIT, iLen)
iLock = GlobalLock(iStrPtr)
lstrcpy iLock, StrPtr(sUniText)
GlobalUnlock iStrPtr
SetClipboardData CF_UNICODETEXT, iStrPtr
CloseClipboard
End Sub
Public Function GetClipboard() As String
#If VBA7 Then
Dim iStrPtr As LongPtr
Dim iLock As LongPtr
#Else
Dim iStrPtr As Long
Dim iLock As Long
#End If
Dim iLen As Long
Dim sUniText As String
Const CF_UNICODETEXT As Long = 13&
OpenClipboard 0&
If IsClipboardFormatAvailable(CF_UNICODETEXT) Then
iStrPtr = GetClipboardData(CF_UNICODETEXT)
If iStrPtr Then
iLock = GlobalLock(iStrPtr)
iLen = GlobalSize(iStrPtr)
sUniText = String$(iLen \ 2& - 1&, vbNullChar)
lstrcpy StrPtr(sUniText), iLock
GlobalUnlock iStrPtr
End If
GetClipboard = sUniText
End If
CloseClipboard
End Function
```
The following [code](https://stackoverflow.com/a/73825129/6600940) will get the data from column A assuming there is no header
```
Function getColA(ws As Worksheet) As Range
Dim rng As Range
Dim lastRow As Long
lastRow = FindLastRow(ws.Columns(1))
With ws
Set rng = Range(.Cells(1, 1), .Cells(lastRow, 1))
End With
Set getColA = rng
End Function
Function FindLastRow(rg As Range) As Long
On Error GoTo EH
FindLastRow = rg.Find("*", , Lookat:=xlPart, LookIn:=xlFormulas _
, searchorder:=xlByRows, searchdirection:=xlPrevious).Row
Exit Function
EH:
FindLastRow = rg.Cells(1, 1).Row
End Function
```
This function will put the data into the clipboard assuming the data is in the active sheet. You have to adjust that accordingly
```
Function putDataIntoClibboard()
Dim vDat As Variant
vDat = Application.Transpose(getColA(ActiveSheet).Value)
vDat = Join(vDat, vbCrLf)
SetClipboard vDat
End Function
```
Your code would then look like that
```
session.FindById("wnd[0]").maximize
session.FindById("wnd[0]/tbar[0]/okcd").Text = "FBL3N"
session.FindById("wnd[0]").sendVKey 0
session.FindById("wnd[0]/usr/ctxtSD_BUKRS-LOW").Text = "1521"
session.FindById("wnd[0]/usr/btn%_SD_SAKNR_%_APP_%-VALU_PUSH").Press
putDataIntoClibboard
session.FindById("wnd[1]/tbar[0]/btn[24]").Press
```
| null | CC BY-SA 4.0 | null | 2022-09-26T10:11:26.857 | 2022-09-26T10:11:26.857 | null | null | 6,600,940 | null |
73,852,895 | 2 | null | 73,852,870 | 2 | null | Your type definition lacks some entries, especially for the offsets 0x24, 0x34 and 0x44. See the snippet:
[](https://i.stack.imgur.com/5jnpA.png)
Correct your definition by inserting "unused" entries:
```
_vo uint32_t CICR;
_vo uint32_t unused1;
_vo uint32_t AHB1RSTR;
```
Otherwise the compiler does not know that you want `AHB1RSTR` to be at offset 0x28.
| null | CC BY-SA 4.0 | null | 2022-09-26T10:33:39.820 | 2022-09-26T10:40:29.423 | 2022-09-26T10:40:29.423 | 11,294,831 | 11,294,831 | null |
73,853,304 | 2 | null | 66,584,781 | 1 | null | Like the OP (original poster), I had the same error with show3d() in a Jupyter notebook under SageMath 9.6. I was not using JMOL. In SageMath 9.7, compiled from source under Ubunto 20.10 in WSL2 on a Windows 10 system, an attempt to use show3d() in a Jupyter notebook, for example
```
# Franklin Graph
Frank = graphs.FranklinGraph()
Frank.show3d()
```
resulted in the following error.
```
$HOME/sage/sage-9.7/src/sage/repl/rich_output/display_manager.py:610:
RichReprWarning: Exception in _rich_repr_ while displaying object:
[Errno 2] No such file or directory:
'$HOME/sage/local/lib/sage/ext_data/threejs/threejs-version.txt'
warnings.warn(
```
(reformatted for typographical clarity.)
My workaround was to copy the source from $HOME/sage/sage-9.7/src/sage/ext_data/threejs to $HOME/sage/local/lib/sage/ext_data/threejs.
This is not entirely satisfactory as the directory naming suggests that the installation of threejs did not proceed as intended. I may take this up with the SageMath development list.
[](https://i.stack.imgur.com/QNHY0.png)
| null | CC BY-SA 4.0 | null | 2022-09-26T11:10:36.233 | 2022-09-26T11:15:50.127 | 2022-09-26T11:15:50.127 | 1,281,574 | 1,281,574 | null |
73,854,036 | 2 | null | 22,297,047 | 0 | null | Using Bootstrap 5 you can simple add `justify-content-end` to the `<ul>` class
```
<div class="container" >
<h1 align="center"><a href="#">My Site</a></h1>
<div class="container" >
<ul class="nav nav-tabs justify-content-end" >
<li class="active"><a href="#">tab1</a></li>
<li><a href="#">tab2</a></li>
<li><a href="#">tab3</a></li>
<li><a href="#">tab4</a></li>
</ul>
</div>
<br>
Hello
```
| null | CC BY-SA 4.0 | null | 2022-09-26T12:16:30.050 | 2022-09-26T12:16:30.050 | null | null | 8,051,588 | null |
73,854,246 | 2 | null | 68,351,794 | 0 | null | Not sure about premium functions though but this works for normal serverless functions.
```
{
"type": "Microsoft.Web/sites",
"apiVersion": "2020-06-01",
"name": "[parameters('functionAppName')]",
"location": "[resourceGroup().location]",
"kind": "functionapp",
"identity": {
"type": "SystemAssigned"
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', parameters('appPlanName'))]",
"[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]"
],
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('appPlanName'))]",
"httpsOnly": true,
"siteConfig": {
"ftpsState": "Disabled",
"functionAppScaleLimit": 2,
"appSettings": [ ... ]
}
}
}
```
I guess you need the following site properties for the other settings:
```
"preWarmedInstanceCount": null,
"minimumElasticInstanceCount": 0,
```
| null | CC BY-SA 4.0 | null | 2022-09-26T12:34:24.400 | 2022-09-26T12:34:24.400 | null | null | 3,419,216 | null |
73,854,496 | 2 | null | 29,345,650 | 1 | null | In some cases using
```
/* using those two for compatibility reasons with old browsers */
overflow-wrap: break-word;
word-wrap: break-word;
```
could be a valid solution. Beside its probably not a good solution for text content, I found it really useful to use e.g. in navigations or titles.
It breaks only single words if this particular word does not fit into the line. While it does not add "-" and does no real hyphenation, though.
| null | CC BY-SA 4.0 | null | 2022-09-26T12:56:01.867 | 2022-09-26T12:56:01.867 | null | null | 3,037,713 | null |
73,854,526 | 2 | null | 15,025,092 | 0 | null | Possible cheaper alternative
```
public class RoundedLabel extends JLabel {
private final Rectangle rv = new Rectangle();
@Override
public void updateUI() {
super.updateUI();
setBorder(new EmptyBorder(1, 3, 1, 3));
}
@Override
protected void paintComponent(Graphics g) {
getBounds(rv);
var g2 = (Graphics2D) g;
g2.setColor(getBackground());
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2.fillRoundRect(rv.x, rv.y, rv.width, rv.height, 8, 8);
super.paintComponent(g);
}
}
```
| null | CC BY-SA 4.0 | null | 2022-09-26T12:58:25.093 | 2022-09-26T12:58:25.093 | null | null | 48,136 | null |
73,854,603 | 2 | null | 73,853,934 | 1 | null | From [rfc8414.html](https://www.rfc-editor.org/rfc/rfc8414.html) , in `3.2. Authorization Server Metadata Response` section.
The JWKS_URI is in the `Authorization Server Metadata Response`
It is response of `3.1. Authorization Server Metadata Request`
and request example is
```
GET /.well-known/oauth-authorization-server HTTP/1.1
Host: example.com
```
example response
```
{
"issuer":
"https://server.example.com",
"authorization_endpoint":
"https://server.example.com/authorize",
"token_endpoint":
"https://server.example.com/token",
"token_endpoint_auth_methods_supported":
["client_secret_basic", "private_key_jwt"],
"token_endpoint_auth_signing_alg_values_supported":
["RS256", "ES256"],
"userinfo_endpoint":
"https://server.example.com/userinfo",
"jwks_uri":
"https://server.example.com/jwks.json",
"registration_endpoint":
"https://server.example.com/register",
"scopes_supported":
["openid", "profile", "email", "address",
"phone", "offline_access"],
"response_types_supported":
["code", "code token"],
"service_documentation":
"http://server.example.com/service_documentation.html",
"ui_locales_supported":
["en-US", "en-GB", "en-CA", "fr-FR", "fr-CA"]
}
```
In the Keycloak, provide this API
```
http://keycloakhost:keycloakport/auth/realms/{realm}/.well-known/openid-configuration
```
"jwks_uri" (Certificate endpoint) is it response as following JSON.
```
{
"issuer": "http://localhost:8080/auth/realms/my-realm",
"authorization_endpoint": "http://localhost:8080/auth/realms/my-realm/protocol/openid-connect/auth",
"token_endpoint": "http://localhost:8080/auth/realms/my-realm/protocol/openid-connect/token",
"introspection_endpoint": "http://localhost:8080/auth/realms/my-realm/protocol/openid-connect/token/introspect",
"userinfo_endpoint": "http://localhost:8080/auth/realms/my-realm/protocol/openid-connect/userinfo",
"end_session_endpoint": "http://localhost:8080/auth/realms/my-realm/protocol/openid-connect/logout",
"frontchannel_logout_session_supported": true,
"frontchannel_logout_supported": true,
"jwks_uri": "http://localhost:8080/auth/realms/my-realm/protocol/openid-connect/certs",
"check_session_iframe": "http://localhost:8080/auth/realms/my-realm/protocol/openid-connect/login-status-iframe.html",
"grant_types_supported": [
"authorization_code",
"implicit",
"refresh_token",
"password",
"client_credentials",
"urn:ietf:params:oauth:grant-type:device_code",
"urn:openid:params:grant-type:ciba"
],
"response_types_supported": [
"code",
"none",
"id_token",
"token",
"id_token token",
"code id_token",
"code token",
"code id_token token"
],
"subject_types_supported": [
"public",
"pairwise"
],
"id_token_signing_alg_values_supported": [
"PS384",
"ES384",
"RS384",
"HS256",
"HS512",
"ES256",
"RS256",
"HS384",
"ES512",
"PS256",
"PS512",
"RS512"
],
...
```
You shows header of JWT
In the specification JWT [RFC 7519](https://www.rfc-editor.org/rfc/rfc7519#section-3.1),
The example shows only "typ" and "alg" not "jwks_uri"
```
{"typ":"JWT",
"alg":"HS256"}
```
| null | CC BY-SA 4.0 | null | 2022-09-26T13:06:24.657 | 2022-09-26T13:06:24.657 | null | null | 8,054,998 | null |
73,854,777 | 2 | null | 31,529,446 | 0 | null | I was facing the same issue recently. The js path which I provided inside my HTML file was correct. Still, during the time of calling the js file, it was prompting me an uncaught exception in the console. Furthermore, my app is running fine on localhost but facing the issue on prod.
As the paths to js files are already correct, I just give it a try to change my calling .js file to another directly and change the root path and that worked.
Try changing the path of your .js file to another directory.
| null | CC BY-SA 4.0 | null | 2022-09-26T13:20:49.787 | 2022-09-26T13:20:49.787 | null | null | 13,519,244 | null |
73,855,136 | 2 | null | 73,828,475 | 1 | null | This is a more basic approach.
In this solution, we search the graph via a `depth-first search` and recursively compute the layers of each vertex.
```
require(igraph)
tree2 <- make_tree(10, 3) + make_tree(10, 2)
## Depth-first search.
## Mark node as visited.
## Calculate layers indexed by vertex.
## Layer of v is
## - equal to zero if there are no descendants and
## - otherwise the largest layer among the descendants plus 1.
layers <- rep(0L, vcount(tree2))
visit <- function(g, v){
if (length(visited)>0L && !visited[v]) {
visited[v] <<- 1L
max_layer_descendents <- -1L
outgoing <- V(g)[.outnei(v)]
for (w in outgoing) {
stopifnot(v != w)
visit(g, w)
max_layer_descendents <- max(max_layer_descendents, layers[w])
}
layers[v] <<- max_layer_descendents + 1L
}
}
## mark vertices as non-visited and calculate layers
visited <- rep(0L, vcount(tree2))
for (v in V(tree2)) visit(tree2, v)
layers
# [1] 2 1 1 0 0 0 0 0 0 0 3 2 1 1 1 0 0 0 0 0
plot(tree2, layout=layout_with_sugiyama(tree2, layers=max(layers)-layers))
```
| null | CC BY-SA 4.0 | null | 2022-09-26T13:47:49.597 | 2022-09-26T13:47:49.597 | null | null | 3,604,103 | null |
73,855,273 | 2 | null | 73,855,200 | 0 | null | Try to change your import from:
```
import HeaderTabs
```
to
```
import {HeaderTabs}
```
And/or try to change your declaration to:
```
const App = () => {
return (
);
};
export default App;
```
| null | CC BY-SA 4.0 | null | 2022-09-26T13:58:55.960 | 2022-09-26T14:08:10.727 | 2022-09-26T14:08:10.727 | 9,300,663 | 9,300,663 | null |
73,855,509 | 2 | null | 73,800,126 | 0 | null | I asked for this problem on flutter's Github repo and I got the answer.
Just need to use ListTileTheme widget instead of Material widget.
Github issue link:
[https://github.com/flutter/flutter/issues/112372](https://github.com/flutter/flutter/issues/112372)
| null | CC BY-SA 4.0 | null | 2022-09-26T14:18:59.583 | 2022-09-26T14:18:59.583 | null | null | 16,439,003 | null |
73,855,602 | 2 | null | 73,855,468 | 0 | null | You are probably looking for [Response.text()](https://developer.mozilla.org/en-US/docs/Web/API/Response/text):
```
fetch(url,...).then(response => response.text()).then(console.log)
```
| null | CC BY-SA 4.0 | null | 2022-09-26T14:25:43.803 | 2022-09-26T14:25:43.803 | null | null | 343,721 | null |
73,855,677 | 2 | null | 73,855,468 | 1 | null | [Promise.then](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) can be chained [Promise.then](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) parameter is object returned from previous [Promise.then](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) chain
[Response.text()](https://developer.mozilla.org/en-US/docs/Web/API/Response/text) return string body
[Response.json()](https://developer.mozilla.org/en-US/docs/Web/API/Response/json) return parsed json
```
fetch("url", {
headers: {
"Content-Type": "application/json",
'Authorization': 'Basic ' + btoa(globalUsername + ":" + globalPassword),
},
method: "POST",
body: moveBody
})
.then(response => console.log(response.status) || response) // output the status and return response
.then(response => response.text()) // send response body to next then chain
.then(body => console.log(body)) // you can use response body here
```
| null | CC BY-SA 4.0 | null | 2022-09-26T14:31:00.233 | 2022-09-26T14:31:00.233 | null | null | 14,813,577 | null |
73,855,942 | 2 | null | 73,855,699 | 0 | null | Your connection string specifies this: `Data Source=(LocalDB)\MSSQLLocalDB;`. If you have installed SQL Server Express, rather than just LocalDB, then that's not going to work. You need to change the data source to refer to the SQL Server Express instance on the local machine, e.g. `Data Source=.\SQLEXPRESS;`.
| null | CC BY-SA 4.0 | null | 2022-09-26T14:52:39.927 | 2022-09-26T14:52:39.927 | null | null | 18,877,258 | null |
73,856,279 | 2 | null | 73,856,089 | 1 | null | You are probably looking for `across()`
```
likemind %>%
mutate(across(everything(),
~list(count = count(.x),
percent = count/38*100)
)
)
```
It is hard to get an exact answer without a proper reproducible example.
| null | CC BY-SA 4.0 | null | 2022-09-26T15:15:44.567 | 2022-09-26T15:21:37.737 | 2022-09-26T15:21:37.737 | 13,972,333 | 13,972,333 | null |
73,856,286 | 2 | null | 56,328,534 | -1 | null | The issue is with NUMBER type definitions, try:
```
CREATE TABLE Shopper (
Shopperid NUMBER CONSTRAINT shpr_shprid_pk PRIMARY KEY,
ShopperName VARCHAR2(20) CONSTRAINT shpr_shprname_nn NOT NULL,
Gender CHAR(6) CONSTRAINT shpr_gdr_chk CHECK(Gender IN ('Male','Female')),
MobileNo NUMBER CONSTRAINT shpr_mobno_nn NOT NULL,
Address VARCHAR2(50)
);
```
| null | CC BY-SA 4.0 | null | 2022-09-26T15:16:36.090 | 2022-09-29T22:06:49.997 | 2022-09-29T22:06:49.997 | 1,237,595 | 20,091,726 | null |
73,856,284 | 2 | null | 73,856,089 | 1 | null | We may loop over the column names of interest, get the `count` and store it in a `list`
```
library(dplyr)
library(purrr)
nm1 <- names(likemind)[1:5] # for the first five columns in the dataset
lst1 <- map(nm1, ~
likemind %>%
select(all_of(.x)) %>%
count(across(1), name = "count") %>%
mutate((count/38)*100) %>%
rename("percent" = "(count/38) * 100")
)
```
| null | CC BY-SA 4.0 | null | 2022-09-26T15:16:26.260 | 2022-09-26T15:16:26.260 | null | null | 3,732,271 | null |
73,856,660 | 2 | null | 24,941,209 | 1 | null |
## Lambda Solution
Using the new [LAMBDA](https://support.google.com/docs/answer/12508718?hl=en-CA) and [MAP](https://support.google.com/docs/answer/12568985) functions, this is now doable without an `ArrayFormula` or having to drag anything.
```
=MAP(A2:A6, LAMBDA(value, TEXT(value, "00000")))
```
- `LAMBDA``value`- `MAP``LAMBDA`
| null | CC BY-SA 4.0 | null | 2022-09-26T15:47:50.917 | 2022-09-26T15:47:50.917 | null | null | 4,294,399 | null |
73,856,713 | 2 | null | 73,856,289 | 1 | null | Instead of `split`, you may use this simpler regex to get all the desired matches:
```
[$£]\w+[$£]?|[^\p{Punct}\h]+
```
[RegEx Demo](https://regex101.com/r/cNDbVz/1)
- `[$£]``$``£`- `\w+`- `[$£]?``$``£`- `|`- `[^\p{Punct}\h]+`
```
final String regex = "[$£]\\w+[$£]?|[^\\p{Punct}\\h]+";
final String string = "fff.fre def $fff$ £45112,662 $0.33445533 abc,def 12,34";
final Pattern pattern = Pattern.compile(regex);
final Matcher matcher = pattern.matcher(string);
while (matcher.find()) {
System.out.println("token==>" + matcher.group());
}
```
| null | CC BY-SA 4.0 | null | 2022-09-26T15:50:52.947 | 2022-09-26T22:02:47.210 | 2022-09-26T22:02:47.210 | 548,225 | 548,225 | null |
73,856,831 | 2 | null | 73,856,423 | 0 | null | As described in this [github issue](https://github.com/chartjs/Chart.js/issues/6197) brave blocks `3rd-party device recognition` by default since it can be used to fingerprint and thus track you. To solve your issue you either need to allow this, disable fingerprint blocking or use another browser
| null | CC BY-SA 4.0 | null | 2022-09-26T16:00:50.223 | 2022-09-26T16:00:50.223 | null | null | 8,682,983 | null |
73,856,914 | 2 | null | 73,856,233 | 0 | null | This regex finds the siring composed of anything but a comma and closing bracket enclosed with a comma (from left) and bracket followed by the end of the line (from right).
```
const text = 'process_cpu_usage[redactedinformat.ion,redacted.clusterstuff,REDACTED,also,this_is_what_i_want]'
const regex = /\,([^\,\]]+)\]$/;
let x = regex.exec(text);
console.log(x[1]);
```
| null | CC BY-SA 4.0 | null | 2022-09-26T16:07:46.633 | 2022-09-26T16:07:46.633 | null | null | 7,195,666 | null |
73,857,472 | 2 | null | 73,849,886 | 0 | null | Find solution! I posted here just in case someone need it:
Because cmd is a string, the correct Gop will be:
```
Start (cmd="0x00000004");
Stop (cmd="0x80000004");
```
This will did the trick.
| null | CC BY-SA 4.0 | null | 2022-09-26T16:58:13.530 | 2022-09-26T16:58:13.530 | null | null | 1,511,153 | null |
73,857,774 | 2 | null | 21,068,440 | 0 | null | the file is probably located in your project package but is not yet compiled so you are able to open it as a java file in your eclipse java project, here is what I did in my case: in eclipse, goto terminal window, cd to your project directory, then cd to your project package, then run javac yourFileName.java, finally right click your java project or project package in the project explorer and... you should see the file there, and it should now run for you as a java file... hope this helps!!!
| null | CC BY-SA 4.0 | null | 2022-09-26T17:26:20.660 | 2022-09-26T17:26:20.660 | null | null | 20,065,442 | null |
73,858,115 | 2 | null | 73,857,962 | 1 | null | Issue Fixed, Problem was that I had another class in the same level in same file.
I removed it and its working again.
| null | CC BY-SA 4.0 | null | 2022-09-26T17:56:51.527 | 2022-09-26T18:00:50.667 | 2022-09-26T18:00:50.667 | 13,107,942 | 13,107,942 | null |
73,858,385 | 2 | null | 10,318,316 | 1 | null | If you use deckgl along with deckgl, set the visible property to true or false.
and in updateTriggers, keep the variable that decides the visibility
eg:
```
new GeoJsonLayer({
...otherProps,
updateTriggers: {
visible: [decisionVariable],
}
visible: decisionVariable ? true : false,
})
```
| null | CC BY-SA 4.0 | null | 2022-09-26T18:24:13.123 | 2022-09-26T18:24:13.123 | null | null | 15,046,796 | null |
73,859,004 | 2 | null | 8,027,671 | 0 | null | [https://stackoverflow.com/a/13726054/14493760](https://stackoverflow.com/a/13726054/14493760)
In searching I came across this and it worked far better for me than the solution listed above
| null | CC BY-SA 4.0 | null | 2022-09-26T19:27:13.307 | 2022-09-26T19:27:26.097 | 2022-09-26T19:27:26.097 | 14,493,760 | 14,493,760 | null |
73,859,311 | 2 | null | 7,731,310 | 0 | null | From a practical perspective, I think PeterS has the best answer. It's also presented in a very clear, didactical style.
Just to save others a few minutes converting it into more production-style code, I've done the following. Basically, it's what you would think you need: One div box inside another, with the outer div box providing the border, the inner providing the title contents with a negative margin shifting it up. A third div then contains the actual content.
This is the CSS:
```
.outer-border-box {
border: 2px solid black; border-top:3px solid black;}
.label-source-box {
padding: 0 3px; height: 100px; margin-top: -0.8em; }
.box-title {
background: white none repeat scroll 0 0;
padding: 0 2px;
margin-left: 4em;
font-weight:700; font-size:18px;
font-family: 'Avenir Next',Helvetica, sans-serif; }
```
This is the html:
```
<div class="outer-border-box">
<div class="label-source-box">
<span class="box-title">Promotional </span>
<div class="box-contents">
<h2>this is the contents</h2>
</div> </div> </div>
```
| null | CC BY-SA 4.0 | null | 2022-09-26T19:55:18.457 | 2022-09-26T19:55:18.457 | null | null | 13,674,899 | null |
73,859,461 | 2 | null | 73,671,180 | -1 | null | Thank you for your numerous comments.
The answer is quite simple: CSS3 can't do what I tried to achieve. There was no trick at all to get this done, not even involving the `:target` pseudo-class, because CSS can't manipulate and reset the URL anchor, neither can it untick the checkbox. That caused the menu staying visible after selecting the content as mentioned above.
As a result, I have rewritten the whole website (well, not the content to be precise).
There is a theoretically simple solution: Using sibling radio buttons for all controls.
This means:
1. I have one radio button for the burger menu. It accesses the following (sibling) <div> element with the adjacent sibling combinator (+) and toggles the burger menu on and off. (Which results in a changed visibility property.)
2. I have multiple radio buttons for the content. Succeeded by their respective content div analogously to (1.).
3. I have multiple labels all over the place that address these radio buttons by using their for attribute. Fortunately, the for attribute has multiplicity 1:n, so that it was possible to address the content <div>s by both, the <nav>-bar, displayed for high resolution devices, as well as the burger menu, displayed on low resolution devices on click on the burger button which is not visible for high resolution displays.
So as a result, I don't do any menu transformations, but have just duplicated the `<label>`s for these toggles and display either the `<nav>` bar or the burger button.
Downsides:
1. I lost the ability to keep the style of the <label>s for the currently active content changed while this content is displayed, since these <label> elements are not siblings of their corresponding checkbox/radio anymore, but on :hover there is an effect.
2. It is not possible to have the burger menu displayed leaving the current content displayed as well in the background. Both are and need to be in the same radio button group, which means that the burger menu is displayed instead of other content until a label is clicked in the burger menu.
Why am I even doing this (Benefits):
1. From my perspective, running scripts on a visitors machine is like highjacking their compute power on their device in their sphere and by forcing them to activate JavaScript or other stuff, exposing them to serious risks that could be avoided. So as a result, I consider the unnecessary use of JavaScript as an unethical act.
2. With this hiding technique of the content I am able to transfer all the content to the visitor a single time and allow for a perfect experience once the content is loaded.
| null | CC BY-SA 4.0 | null | 2022-09-26T20:11:12.223 | 2022-09-26T20:11:12.223 | null | null | 19,964,066 | null |
73,859,507 | 2 | null | 73,858,959 | 0 | null | I don`t get your question but I think you want count of the retrieve data.
1st method:
```
$variabel = Model::all();
```
View
```
$variabel->count();
```
2nd method:
```
$users = DB::table('users')->count();
```
| null | CC BY-SA 4.0 | null | 2022-09-26T20:14:59.163 | 2022-09-26T20:14:59.163 | null | null | 8,934,627 | null |
73,859,586 | 2 | null | 62,201,747 | 1 | null | set tick to `false`
```
<XAxis tick={false} hide dataKey="name" />
```
| null | CC BY-SA 4.0 | null | 2022-09-26T20:24:09.367 | 2022-09-26T20:24:09.367 | null | null | 14,299,421 | null |
73,859,679 | 2 | null | 73,858,946 | 0 | null | I think you probably just want something like:
```
SELECT *
FROM (
SELECT nr.region, medal
FROM athlete_events ae INNER JOIN noc_regions nr
ON ae.noc = nr.noc
WHERE medal <> 'NA'
) t1
PIVOT(COUNT(medal) FOR medal in ([Gold], [Silver], [Bronze])) pt
ORDER BY gold+silver+bronze DESC
```
There doesn't appear to be any reason for your inner `group`ing and `count`ing. The `pivot` can handle the count and, since you don't want `total medal` in your output (except for the order), you can just sum the medal fields in the `ORDER BY`.
| null | CC BY-SA 4.0 | null | 2022-09-26T20:33:43.207 | 2022-09-26T20:33:43.207 | null | null | 5,504,922 | null |
73,859,660 | 2 | null | 73,858,624 | 1 | null | Not sure of all of your calculation steps, but loading a subset of data, I can get it to work with:
```
dat <- read.csv("202004-divvy-tripdata.csv")
dat[,3:4] <- lapply(dat[,3:4], function(z) as.POSIXct(paste("0001-01-01", substring(z, 12))))
head(dat)
# ride_id rideable_type started_at ended_at start_station_name start_station_id end_station_name end_station_id start_lat start_lng end_lat end_lng member_casual
# 1 A847FADBBC638E45 docked_bike 0001-01-01 17:45:14 0001-01-01 18:12:03 Eckhart Park 86 Lincoln Ave & Diversey Pkwy 152 41.8964 -87.6610 41.9322 -87.6586 member
# 2 5405B80E996FF60D docked_bike 0001-01-01 17:08:54 0001-01-01 17:17:03 Drake Ave & Fullerton Ave 503 Kosciuszko Park 499 41.9244 -87.7154 41.9306 -87.7238 member
# 3 5DD24A79A4E006F4 docked_bike 0001-01-01 17:54:13 0001-01-01 18:08:36 McClurg Ct & Erie St 142 Indiana Ave & Roosevelt Rd 255 41.8945 -87.6179 41.8679 -87.6230 member
# 4 2A59BBDF5CDBA725 docked_bike 0001-01-01 12:50:19 0001-01-01 13:02:31 California Ave & Division St 216 Wood St & Augusta Blvd 657 41.9030 -87.6975 41.8992 -87.6722 member
# 5 27AD306C119C6158 docked_bike 0001-01-01 10:22:59 0001-01-01 11:15:54 Rush St & Hubbard St 125 Sheridan Rd & Lawrence Ave 323 41.8902 -87.6262 41.9695 -87.6547 casual
# 6 356216E875132F61 docked_bike 0001-01-01 17:55:47 0001-01-01 18:01:11 Mies van der Rohe Way & Chicago Ave 173 Streeter Dr & Grand Ave 35 41.8969 -87.6217 41.8923 -87.6120 member
gg <- ggplot(dat, mapping = aes(x=started_at)) +
geom_histogram(bins = 24, color = "white", fill = "blue") +
labs(
title = "Usage by time of day",
subtitle = "Members vs Casual users",
x = "Ride start time",
y = "ride count") +
facet_wrap(~ member_casual) +
scale_y_continuous(labels = scales::label_comma())
```
Because of how closely things are spaced, I think you have two easy options for labelling the x-axis:
```
gg +
scale_x_datetime(
date_minor_breaks = "1 hour", date_breaks = "2 hours",
date_labels = "%H:%M",
guide = guide_axis(n.dodge = 3))
```
[](https://i.stack.imgur.com/jGVDf.png)
or
```
gg +
scale_x_datetime(
date_minor_breaks = "1 hour", date_breaks = "2 hours",
date_labels = "%H:%M") +
theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 0.5))
```
[](https://i.stack.imgur.com/UvXhv.png)
| null | CC BY-SA 4.0 | null | 2022-09-26T20:32:01.193 | 2022-09-26T20:32:01.193 | null | null | 3,358,272 | null |
73,859,970 | 2 | null | 6,754,207 | 0 | null | I was facing same issue. After banging my head for several hours, I finally noticed that although Maven was building the project successfully, the source file I was trying to step into had an incorrect package statement and that is why the 'Source Not Found' eclipse problem was happening. When I corrected the package statement and rebuilt the project, the debugger found source file and stopped on my breakpoint.
| null | CC BY-SA 4.0 | null | 2022-09-26T21:10:01.927 | 2022-09-26T21:10:01.927 | null | null | 20,094,442 | null |
73,860,149 | 2 | null | 73,859,916 | 1 | null | ```
select id_num
,object
,date_time
,previous_object
from (
select id_num
,object
,max(date_time) as date_time
,lag(object) over(order by max(date_time)) as previous_object
,row_number() over(partition by id_num order by max(date_time) desc) as rn
from t
group by id_num, object
) t
where rn = 1
```
| ID_NUM | OBJECT | DATE_TIME | PREVIOUS_OBJECT |
| ------ | ------ | --------- | --------------- |
| 1X | C | 27-JUL-22 14.43.00.000000 | B |
| 2X | G | 10-AUG-22 15.36.00.000000 | F |
[Fiddle](https://dbfiddle.uk/e30Hlwir?hide=48)
| null | CC BY-SA 4.0 | null | 2022-09-26T21:30:52.477 | 2022-09-26T21:37:19.580 | 2022-09-26T21:37:19.580 | 19,174,570 | 19,174,570 | null |
73,860,261 | 2 | null | 73,858,946 | 0 | null | So I kinda gave up on pivot myself. Caused me to many problems in the past (always my own mistakes ofcourse) and when I can I try a different approache.
So I'll show you a query that tells you how you can get the results you want, but it won't answer your pivot question. This method isn't the most efficient, but it's fine for a size of these records and I think it makes the query even more readable.
```
SELECT
region
, SUM(Gold) AS 'Gold'
, SUM(Silver) AS 'Silver'
, SUM(Bronze) AS 'Bronze'
FROM
noc_regions
LEFT JOIN (SELECT NOC, COUNT(*) AS 'Gold' FROM athlete_events WHERE Medal = 'Gold' GROUP BY NOC) gold_events ON noc_regions.NOC = gold_events.NOC
LEFT JOIN (SELECT NOC, COUNT(*) AS 'Silver' FROM athlete_events WHERE Medal = 'Silver' GROUP BY NOC) silver_events ON noc_regions.NOC = silver_events.NOC
LEFT JOIN (SELECT NOC, COUNT(*) AS 'Bronze' FROM athlete_events WHERE Medal = 'Bronze' GROUP BY NOC) bronze_events ON noc_regions.NOC = bronze_events.NOC
GROUP BY
region
ORDER BY
Gold DESC
, Silver DESC
, Bronze DESC
, region ASC;
```
[](https://i.stack.imgur.com/K9VFo.png)
| null | CC BY-SA 4.0 | null | 2022-09-26T21:45:27.320 | 2022-09-26T21:53:53.923 | 2022-09-26T21:53:53.923 | 17,907,084 | 17,907,084 | null |
73,860,355 | 2 | null | 65,469,312 | 0 | null | I was experiencing the same issue with the white space to the right of the screen and I was not able to fully fix the issue using the CSS overflow solution.
This (at first glance I thought it did):
```
html: {
over-flow: "hidden"}
```
What I noticed was that some of my code was packed with "rigid" "div" tags.
This is what I was experiencing (background red is to help me see what's happening to the <Container/Row/Col> when I resize):
[](https://i.stack.imgur.com/twsOR.png)
This was my code:
```
<Col className=" bg-danger">
<div className="d-flex justify-content-center my-4">
<div className="d-flex flex-column">
<label
className="fw-bold bg-dark bg-opacity-50"
for="start-date"
>
Start Date (YYYY-MM-DD)
</label>
<input
id="start-date"
className="input-box"
type="text"
placeholder="Start date (YYYY-MM-DD)"
value={startDate}
onChange={(event) => setStartDate(event.target.value)}
></input>
</div>
<div className="d-flex flex-column mx-2">
<label
className="fw-bold bg-dark bg-opacity-50"
for="end-date"
>
End Date (YYYY-MM-DD)
</label>
<input
id="end-date"
className="input-box"
type="text"
placeholder="End date (YYYY-MM-DD)"
value={endDate}
onChange={(event) => setEndDate(event.target.value)}
></input>
</div>
<div className="d-flex flex-column justify-content-center align-items-center mt-4">
<Button
type="button"
className="btn btn-light mx-2"
onClick={trigger}
>
Search
</Button>
</div>
</div>
</Col>
```
I restructured my code by adding <ROW/COL>, see more examples here ([https://react-bootstrap.netlify.app/layout/grid/#auto-layout-columns](https://react-bootstrap.netlify.app/layout/grid/#auto-layout-columns)):
```
<Row>
<h3>Space Image Gallery - Content from... </h3>
<Row className=" d-flex justify-content-center my-4 bg-danger">
<Col sm lg="4" className="d-flex flex-column mx-2 my-1">
<label
className="fw-bold bg-dark bg-opacity-50"
for="start-date"
>
Start Date (YYYY-MM-DD)
</label>
<input
id="start-date"
className="input-box"
type="text"
placeholder="Start date (YYYY-MM-DD)"
value={startDate}
onChange={(event) => setStartDate(event.target.value)}
></input>
</Col>
<Col sm lg="4" className="d-flex flex-column mx-2 my-1">
<label className="fw-bold bg-dark bg-opacity-50" for="end-date">
End Date (YYYY-MM-DD)
</label>
<input
id="end-date"
className="input-box"
type="text"
placeholder="End date (YYYY-MM-DD)"
value={endDate}
onChange={(event) => setEndDate(event.target.value)}
></input>
</Col>
<Col
lg="2"
className="d-flex flex-column justify-content-center align-items-center mt-4"
>
<Button
type="button"
className="btn btn-light mx-2"
onClick={trigger}
>
Search
</Button>
</Col>
</Row>
```
This is the result!:
[](https://i.stack.imgur.com/VuUb5.png)
| null | CC BY-SA 4.0 | null | 2022-09-26T21:58:03.690 | 2022-09-26T21:58:03.690 | null | null | 20,029,377 | null |
73,860,433 | 2 | null | 73,860,371 | 0 | null | > I found out that this appears only in my first ViewController (the blue screen) of my StoryBoard but I want the function to appear on the top right view controller Storyboard
You need to put the action in the view controller class where you want it to appear. If it's showing up somewhere else, it's in the wrong class.
| null | CC BY-SA 4.0 | null | 2022-09-26T22:09:26.177 | 2022-09-26T22:09:26.177 | null | null | 643,383 | null |
73,860,549 | 2 | null | 73,860,432 | 3 | null | If you want
```
0.00 C = 32.00 F
4.00 C = 39.20 F
8.00 C = 46.40 F
12.00 C = 53.60 F
16.00 C = 60.80 F
20.00 C = 68.00 F
24.00 C = 75.20 F
28.00 C = 82.40 F
32.00 C = 89.60 F
36.00 C = 96.80 F
40.00 C = 104.00 F
44.00 C = 111.20 F
48.00 C = 118.40 F
```
The use format specifies a column width inside an interpolated string. This is done with `$"{value,width:format}"`. See the example code below:
Since this is C# and object-oriented in makes sense to create a class to handle the math.
```
public class Temperature
{
public float Celsius { get; set; }
public float Fahrenheit
{
get
{
return 32f + (9f * Celsius) / 5f;
}
set
{
Celsius = 5f * (value - 32F) / 9F;
}
}
}
class Program
{
static void Main(string[] args)
{
Temperature temperature = new Temperature();
for (int i = 0; i <= 12; i++)
{
temperature.Celsius = 4f * i;
Console.WriteLine($"{temperature.Celsius,6:F2} C = {temperature.Fahrenheit,6:F2} F");
}
}
}
```
Here the value of `6` designates the total width the value will occupy (6 spaces) and is justified by default. To make the value be left justified use a negative value, like `-6`.
Also, the specifier `F2` means to show two decimal places to the right of the point. For floating point values, use specifiers like `g4` for general formatting, `f4` for fixed # decimals, and `e4` for scientific notation.
An improvement can be made to include the string formatting inside the class, as in the code below with identical results.
```
public class Temperature
{
public float Celsius { get; set; }
public float Farenheit
{
get
{
return 32f + (9f * Celsius) / 5f;
}
set
{
Celsius = 5f * (value - 32F) / 9F;
}
}
public override string ToString()
{
return $"{Celsius,6:F2} C = {Fahrenheit,6:F2} F";
}
}
class Program
{
static void Main(string[] args)
{
Temperature temperature = new Temperature();
for (int i = 0; i <= 12; i++)
{
temperature.Celsius = 4f * i;
Console.WriteLine(temperature);
}
}
}
```
The key here is to override the `ToString()` function that the system uses to convert an object to a string value. It is called automatically by the `Console.WriteLine()` function and the point is that all formatting can be handled internally from the class.
| null | CC BY-SA 4.0 | null | 2022-09-26T22:25:29.003 | 2022-09-27T12:30:16.517 | 2022-09-27T12:30:16.517 | 380,384 | 380,384 | null |
73,861,206 | 2 | null | 29,529,957 | 0 | null | I just re-started my Xcode and it worked. as everything was set-up the way it should be !!
| null | CC BY-SA 4.0 | null | 2022-09-27T00:33:17.707 | 2022-09-27T00:33:17.707 | null | null | 2,419,581 | null |
73,861,325 | 2 | null | 24,528,467 | 1 | null | In LibreOffice (and Microsoft Word), you can the Unicode code first then press to transform it into the actual character/glyph etc.
For example, writing `هٰذَا` would be writing ه then typing the superscript alef Unicode code `0670` then press and it will become هٰ then type the rest ذَا.
You can just google the unicode code for certain characters, search [here](https://www.compart.com/en/unicode/) or see the full Arabic characters chart from the [official PDF](https://www.unicode.org/charts/PDF/U0600.pdf).
Ref:
1. Unicode Input on Wikipedia
2. Unicode charts
| null | CC BY-SA 4.0 | null | 2022-09-27T00:58:37.967 | 2022-09-27T00:58:37.967 | null | null | 15,643,763 | null |
73,862,202 | 2 | null | 73,858,946 | 1 | null | Try This, you will get exact output
```
Select OH.Region,
Count(Case When O.Medal='Gold' Then 1 End) AS Gold,
Count(Case When O.Medal='Silver' Then 1 End) AS Silver,
Count(Case When O.Medal='Bronze' Then 1 End) AS Bronze
from athlete_events O
Join noc_regions OH On OH.NOC = O.NOC
Group by OH.Region
Order By Gold Desc,Silver Desc,Bronze Desc
```
| null | CC BY-SA 4.0 | null | 2022-09-27T03:57:48.797 | 2022-09-27T03:57:48.797 | null | null | 19,663,739 | null |
73,862,356 | 2 | null | 73,860,371 | 0 | null | For all viewControllers in story board you have to create separate swift class files, and create it's IBAction outlet in it's class file.
add viewController class here : [](https://i.stack.imgur.com/HgAPw.png)
after this you will be able to create IBOutlet and IBActions in that class.
| null | CC BY-SA 4.0 | null | 2022-09-27T04:21:38.340 | 2022-09-27T04:21:38.340 | null | null | 9,963,757 | null |
73,862,483 | 2 | null | 14,753,344 | 1 | null | Rename parameter cl.lim to col.lim in corrplot()
[https://cran.r-project.org/web/packages/corrplot/news/news.html](https://cran.r-project.org/web/packages/corrplot/news/news.html)
| null | CC BY-SA 4.0 | null | 2022-09-27T04:42:54.917 | 2022-09-27T04:42:54.917 | null | null | 14,994,875 | null |
73,862,556 | 2 | null | 73,862,437 | 2 | null | You want to ensure that both the static file middleware, and any services that inject your file provider, end up using the same instance.
```
var provider = new PhysicalFileProvider(
Path.Combine(Directory.GetCurrentDirectory(), "wwwroot")
);
builder.Services.AddSingleton<IFileProvider>(provider);
...
app.UseStaticFiles(
new StaticFileOptions{
FileProvider = provider
});
```
But if you don't really need a different file provider, you can instead inject `IWebHostEnvironment` into your controller and reuse the default `.WebRootFileProvider`.
| null | CC BY-SA 4.0 | null | 2022-09-27T04:55:15.217 | 2022-09-27T04:55:15.217 | null | null | 4,139,809 | null |
73,862,606 | 2 | null | 19,067,846 | 1 | null | Although not similar to the question above,
In my case,
The module is not visible in the android tab,
I saw it in the project tab.
After deleting the file, (I guess there is a problem because the unloadlist list remains here?)
When I reopened the project, it worked fine.
Additionally,
When (clear VCS Log caches and indexes),
It shows up for new modules, not for previously deleted modules (this only worked when deleting workspace.xml).
| null | CC BY-SA 4.0 | null | 2022-09-27T05:06:07.737 | 2022-09-27T05:06:07.737 | null | null | 12,728,552 | null |
73,862,815 | 2 | null | 73,862,437 | 2 | null | The error message is saying that your application is trying to create an instance of `FileUploadController` but it doesn't know how to create an instance of `IFileProvider` to pass into the constructor.
This is a typical dependency injection error, You can register it in this code:
```
builder.Services.AddSingleton<IFileProvider>(new PhysicalFileProvider
(
Path.Combine(Directory.GetCurrentDirectory(), "wwwroot")
));
```
You can follow this [Docs](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/?view=aspnetcore-6.0&tabs=windows) to learn about `Dependency injection` and other fundamentals in .Net 6.
If you are not comfortable with the new changes in `.Net6`, you can add the `Startup` class according to this [article](https://www.c-sharpcorner.com/article/how-to-add-startup-cs-class-in-asp-net-core-6-project/).
| null | CC BY-SA 4.0 | null | 2022-09-27T05:37:50.183 | 2022-09-27T05:37:50.183 | null | null | 17,438,579 | null |
73,862,838 | 2 | null | 73,862,538 | 1 | null | Those are flags accepted by the `all_fanout` and `all_fanin` commands; the `set` is just storing the results in variables. (Tcl uses `set` to do basic assignment; it doesn't have top level operators.)
At a guess, `-flat` means "give me the results as a flat list" (instead of something more complicated such as a list of lists?) and `-only_cells` (or `-only_leaf`) acts as a filter to say which information is to be returned. I'd need to read the documentation for those commands to say for sure; it is definitely application-specific and I don't use the Synopsis tools at all.
| null | CC BY-SA 4.0 | null | 2022-09-27T05:40:49.407 | 2022-09-27T05:40:49.407 | null | null | 301,832 | null |
73,862,873 | 2 | null | 73,797,737 | 0 | null | We’ve been analyzing this problem for 2 days. Finally we found the core of the problem. The issue is that Sep 30 1983 and Sep 30 1982 are dates of daylight-saving time (DTS).
For example, when the date 1 Oct 1983 00:00 is picked and saved into database (MS SQL Server), it will be converted to the Greenwich Mean Time +0 (GMT +0). In our case (GMT +3) the time must be 09/30/1983 21:00:00.
[DB_name]/Programmability/Scalar-valued functions/, because on switching to winter time the clock is put back an hour. As a result, the time 09/30/1983 20:00:00 is saved in DB, instead of 09/30/1983 21:00:00.
Therefore, when crm displays the time 09/30/1983 20:00:00 on a form, it converts it to local time (adds 3 hours). This is why we see 09/30/1983 23:00:00.
We added 1 hour in DB to solve this problem.
| null | CC BY-SA 4.0 | null | 2022-09-27T05:44:39.260 | 2022-09-27T05:44:39.260 | null | null | 13,744,197 | null |
73,862,911 | 2 | null | 60,907,340 | 0 | null | This worked on windows:
```
with open(r"pi_digits.txt") as file_object:
contents = file_object.read()
print(contents)
```
or
```
filename = "pi_digits.txt"
with open(filename) as file_object:
```
| null | CC BY-SA 4.0 | null | 2022-09-27T05:52:21.683 | 2022-09-27T05:58:57.630 | 2022-09-27T05:58:57.630 | 12,301,819 | 12,301,819 | null |
73,863,072 | 2 | null | 73,862,173 | 1 | null | Since the question is not clear i slightly modified your code, it compiles and runs BUT needs a lot of refactor.
Here is the working code.
```
using System;
namespace TvRemote
{
public class testRemote
{
public static bool PowerOn(bool powerStatus)
{
if (powerStatus == true)
{
testRemote.DisplayMessage("TV already on");
}
else
{
powerStatus = true;
testRemote.DisplayMessage("TV On, Your Channel is 3 and the Volume is 5");
}
return powerStatus;
}
public static bool PowerOff(bool powerStatus)
{
if (powerStatus == false)
{
testRemote.DisplayMessage("TV already off");
}
else
{
powerStatus = false;
testRemote.DisplayMessage("TV is now off");
}
return powerStatus;
}
public static int VolumeUp(bool powerStat, int vol)
{
if (powerStat == false)
{
testRemote.DisplayMessage("TV is off");
}
else
{
if (vol >= 10)
{
testRemote.DisplayMessage("TV is already on Maximum Volume.");
}
else
{
vol++;
if (vol == 10)
{
testRemote.DisplayMessage("Maximum Volume.");
}
}
}
return vol;
}
public static int VolumeDown(bool powerStat, int vol)
{
if (powerStat == false)
{
testRemote.DisplayMessage("TV is off");
}
else
{
if (vol <= 0)
{
testRemote.DisplayMessage("Sound Muted");
}
else
{
vol--;
if (vol == 0)
{
testRemote.DisplayMessage("Sound Muted");
}
}
}
return vol;
}
public static int ChannelUp(bool powerStat, int channelNo)
{
if (powerStat == false)
{
testRemote.DisplayMessage("TV is off");
}
else
{
if (channelNo < 99)
{
channelNo++;
}
else
{
channelNo = 2;
}
Console.WriteLine("Channel " + channelNo.ToString());
}
return channelNo;
}
public static int ChannelDown(bool powerStat, int channelNo)
{
if (powerStat == false)
{
testRemote.DisplayMessage("TV is off");
}
else
{
if (channelNo == 2)
{
channelNo = 99;
}
else
{
channelNo--;
}
Console.WriteLine("Channel " + channelNo.ToString());
}
return channelNo;
}
public static String SmartMenu(bool powerStat, String md)
{
if (powerStat == false)
{
testRemote.DisplayMessage("TV is off");
}
else
{
testRemote.DisplayMessage("Smart Menu On");
md = "TV";
}
return md;
}
public static String SetSettings(bool powerStat, String md)
{
if (powerStat == false)
{
testRemote.DisplayMessage("TV is off");
}
else
{
testRemote.DisplayMessage("Settings On");
md = "Settings";
}
return md;
}
public static void DisplayMessage(String msg)
{
Console.WriteLine(msg);
}
public static void Banner()
{
Console.WriteLine("Welcome to TV Remote Control");
Console.WriteLine("Please enter your selection");
Console.WriteLine("Power On - turns on your TV");
Console.WriteLine("Power Off - turns off your TV");
Console.WriteLine("Increase volume - turns up the volume");
Console.WriteLine("Decrease volume - turn down the volume");
Console.WriteLine("Channel Up - increments the channel");
Console.WriteLine("Channel Down - decrements the channel");
Console.WriteLine("Smart Menu");
Console.WriteLine("Settings");
Console.WriteLine();
Console.WriteLine("Please enter your selection");
}
public static void Main(String[] args)
{
bool powerOn = false;
int channel = 3;
int volume = 5;
string mode = "TV";
//string choice = "Turn On"; //THIS MUST BE Power On if you want to power on the tv as soon as the app is launched
Banner();
string choice = Console.ReadLine();
while (!choice.ToLower().Equals("Exit".ToLower()))
{
if (choice.ToLower().Equals("Power On".ToLower()) == true)
{
powerOn = testRemote.PowerOn(powerOn);
}
if (choice.ToLower().Equals("Power Off".ToLower()) == true)
{
powerOn = testRemote.PowerOff(powerOn);
}
if (choice.ToLower().Equals("Increase volume".ToLower()) == true)
{
volume = testRemote.VolumeUp(powerOn, volume);
}
if (choice.ToLower().Equals("Decrease volume".ToLower()) == true)
{
volume = testRemote.VolumeDown(powerOn, volume);
}
if (choice.ToLower().Equals("Channel Up".ToLower()) == true)
{
channel = testRemote.ChannelUp(powerOn, channel);
}
if (choice.ToLower().Equals("Channel Down".ToLower()) == true)
{
channel = testRemote.ChannelDown(powerOn, channel);
}
if (choice.ToLower().Equals("Mode TV".ToLower()) == true)
{
mode = testRemote.SmartMenu(powerOn, mode);
}
if (choice.ToLower().Equals("Mode DVD".ToLower()) == true)
{
mode = testRemote.SetSettings(powerOn, mode);
}
Console.WriteLine();
Console.WriteLine();
choice = Console.ReadLine();
}
Console.WriteLine("Thank you for the Remote Controller");
Console.ReadLine();
}
}
}
```
| null | CC BY-SA 4.0 | null | 2022-09-27T06:11:28.960 | 2022-09-27T06:11:28.960 | null | null | 13,579,714 | null |
73,863,183 | 2 | null | 73,861,987 | 0 | null | In order to hide bottom overflow while showing an overflow at the top, the trick is to:
1. Put both image and clipped container inside a single parent element.
2. Set a fixed height to the parent element
3. Position clipped element to be behind image using negative z-index
4. Add an extra clipped element with border and a transparent background so this would act as an overlay for the bottom of the overflowing element.
```
body{
background-color: #ffdfe9;
}
.main {
height: 26rem;
width: 30rem;
overflow: hidden;
}
div.avatar--container {
border-radius: 84% 38% 70% 43% / 55% 74% 59% 71%;
background-color: #ff5d8f;
border: 20px solid #a2d2ff;
height: 15rem;
width: 25rem;
overflow: hidden;
position: absolute;
top: 10rem;
z-index: -1;
}
div.avatar--container.c2 {
background-color: transparent;
background-color: transparent;
border-left: 20px solid #a2d2ff;
border-right: 20px solid #a2d2ff;
border-bottom: 20px solid #a2d2ff;
border-top: 20px solid transparent;
z-index: 1;
}
.avatar {
width: 30rem;
}
```
```
<div class="main">
<img class="avatar c2" src="https://www.freeiconspng.com/uploads/female-model-png-model-png4-by-icekitz-3.png" alt="Rachel Hall" />
<div class="avatar--container c2">
</div>
<div class="avatar--container">
</div>
</div>
```
| null | CC BY-SA 4.0 | null | 2022-09-27T06:25:39.113 | 2022-09-27T06:25:39.113 | null | null | 8,043,806 | null |
73,863,880 | 2 | null | 73,863,785 | 1 | null | I would recommend [GitLens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens) which provides:
- [annotation hover](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens#annotation-hovers)
[](https://i.stack.imgur.com/A9SaK.png)- [file History view](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens#file-history-view)
[](https://i.stack.imgur.com/RmBxj.png)
The free features also add extra information in the regular "Source Control" sidebar, more specifically:
- ["Commits"](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens#commits-view)["Branches"](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens#branches-view)-
[](https://i.stack.imgur.com/AycsL.png)
| null | CC BY-SA 4.0 | null | 2022-09-27T07:31:56.833 | 2022-09-27T11:09:09.373 | 2022-09-27T11:09:09.373 | 86,072 | 6,309 | null |
73,864,039 | 2 | null | 73,863,756 | 1 | null | If you have Excel 365 (current channel) you can use this formula:
`=TEXTJOIN(", ",TRUE,FILTER($A$1:$D$1,A2:D2=1))`
(assuming your table starts in A1)
The header row is filtered per value of the current row.
| null | CC BY-SA 4.0 | null | 2022-09-27T07:45:25.193 | 2022-09-27T07:45:25.193 | null | null | 16,578,424 | null |
73,864,116 | 2 | null | 70,458,881 | 0 | null | There are several errors in the code, and I will suggest code that fixes these, and lets the program yield the output you expect. That said, I will suggest a few changes to make your code more readable and reliable.
The purpose of these loops
```
for (int k = 0; k < strlen(name) - 8; k++)
{
for (int l = strlen(string); l >= 15; l--)
{
string[l + 1] = string[l];
}
}
```
is to shorten or lengthen the input string to accommodate for the name being shorter or longer than your keyword `{{name}}`. However, it handles only ONE case, lengthening. Your name `tushar` is shorter than the keyword, so the final string needs to be
Use this:
```
for (int k = 0; k < 8 - strlen(name); k++) // number chars to delete from 'string'
{
for (int l = 14; l <= strlen(string); l++) // also copy null-terminator
{
string[l-1] = string[l];
}
}
```
Use the debugger in VS Code to help you track variables as they change value, so you can see if your string and array accesses go "out-of-bounds". There are also online debuggers you can use, for example [onlinegdb](https://www.onlinegdb.com/online_c_compiler), which is what I used to verify the loop changes I added.
Your code is quite [brittle](https://en.wikipedia.org/wiki/Software_brittleness) meaning it will work for only very specific and well-behaved input data, and the code is difficult to change. For example, you're not actually testing for `{{name}}`, but only the first `{` and `n`. So if you want your input string to contain both `{{name}}` and `{{number}}` (and similar) you're in trouble. Also, there are a few places you traverse or check the string in such a way that you could end up beyond the This is not generally allowed in C. Many of these problems and risks can be avoided by using library functions instead.
Make use of standard , with functions that already do parts of what you want to achieve, for example `sprintf()` to print a string into a buffer, or `strchr()` to find a character in a string, or `strstr()` to find a string in a string.
| null | CC BY-SA 4.0 | null | 2022-09-27T07:52:09.873 | 2022-09-27T07:58:39.633 | 2022-09-27T07:58:39.633 | 2,115,408 | 2,115,408 | null |
73,864,145 | 2 | null | 73,861,671 | 0 | null | Run `flutter doctor` in your terminal.
Or go to location where flutter is downloaded .../flutter/flutter_console.bat and run the command `flutter doctor`.
It will fix most of the errors.
| null | CC BY-SA 4.0 | null | 2022-09-27T07:54:27.107 | 2022-09-27T07:54:27.107 | null | null | 15,145,842 | null |
73,865,229 | 2 | null | 15,680,497 | 0 | null | For anybody else stumbling upon this question and having the same problems:
- - -
I have downloaded clean eclipse zip, started it and downloaded the plugin that I wanted (Enhanced Class Decompiler), and then opened the targeted Eclipse installation (actually an IDE called Intershop Studio) and used File -> Import -> Installation -> From Existing Installation to import plugins.
So this solution is applicable if problems are not caused by system configuration or if you already have plugins installed on another Eclipse installation.
| null | CC BY-SA 4.0 | null | 2022-09-27T09:24:55.390 | 2022-09-27T09:24:55.390 | null | null | 9,725,841 | null |
73,865,330 | 2 | null | 73,863,424 | 1 | null | To revoke `admin_consent` granted for Azure AD application permissions, you can make use of below :
```
DELETE https://graph.microsoft.com/v1.0/oauth2PermissionGrants/<id>
```
To get the `<id>`, you can run this query by filtering it with .
```
GET https://graph.microsoft.com/v1.0/oauth2PermissionGrants/?$filter=clientId eq 'SP ObjectID'
```
I created one and granted same `API permissions` like this:

You can get `SP ObjectID` of the above application like below:

I ran the below query to get `<id>` by including like this:
```
GET https://graph.microsoft.com/v1.0/oauth2PermissionGrants/?$filter=clientId eq 'SP ObjectID'
```

I ran the `DELETE` query like below, I got the successfully:
```
DELETE https://graph.microsoft.com/v1.0/oauth2PermissionGrants/<id>
```

When I checked Azure Portal, admin consent got for that application like below:

To do the same from , try running below commands:
```
Connect-MgGraph
Import-Module Microsoft.Graph.Identity.SignIns
Remove-MgOauth2PermissionGrant -OAuth2PermissionGrantId $Id
```
Make sure to install `Microsoft.Graph` module before running those commands.
If not, try using below command to that module:
```
Install-Module Microsoft.Graph -Scope CurrentUser
```
| null | CC BY-SA 4.0 | null | 2022-09-27T09:34:05.760 | 2022-09-27T09:34:05.760 | null | null | 18,043,665 | null |
73,865,497 | 2 | null | 73,863,262 | 1 | null | A work around for your scenario is using work item rule. Set the below work item rule in Org Settings -> Process -> Your process -> Task work item -> Rules
[](https://i.stack.imgur.com/YbxsV.png)
Then you could check the query.
[](https://i.stack.imgur.com/yFzS6.png)
For more information, you could also refer to the doc: [Add a custom rule](https://learn.microsoft.com/en-us/azure/devops/organizations/settings/work/custom-rules?view=azure-devops#add-a-custom-rule).
| null | CC BY-SA 4.0 | null | 2022-09-27T09:44:35.663 | 2022-09-27T09:54:16.987 | 2022-09-27T09:54:16.987 | 18,359,635 | 18,359,635 | null |
73,865,545 | 2 | null | 73,860,806 | 0 | null | The idea is to have a nested loop, one for `x` and inside that another one for `y` using defined steps.
```
Option Explicit
Public Sub CreateValuePairs()
Dim x As Long
For x = 0 To 20 Step 5
Dim y As Long
For y = 0 To 20 Step 5
Debug.Print x, y ' output into immediate window
Next y
Next x
End Sub
```
The output in the immediate window then is
```
0 0
0 5
0 10
0 15
0 20
5 0
5 5
5 10
5 15
5 20
10 0
10 5
10 10
10 15
10 20
15 0
15 5
15 10
15 15
15 20
20 0
20 5
20 10
20 15
20 20
```
---
Alternatively you better write a generic function to generate value tables and then write them to your cells.
```
Public Sub Example()
' generate values
Dim ValTable As Variant
ValTable = GetValuePairs(FromValue:=0, ToValue:=20, Steps:=5)
' write to cells
Range("A1").Resize(UBound(ValTable, 1), UBound(ValTable, 2)).Value = ValTable
End Sub
Public Function GetValuePairs(ByVal FromValue As Long, ByVal ToValue As Long, ByVal Steps As Long) As Variant
Dim AmountOfPairs As Long ' amount of pairs we need to create
AmountOfPairs = ((ToValue - FromValue) / Steps + 1) ^ 2
' create 2 dimensional output array
Dim Output() As Long
ReDim Output(1 To AmountOfPairs, 1 To 2)
' create pairs
Dim iPair As Long
For iPair = 1 To AmountOfPairs
Dim x As Long
x = FromValue + ((iPair - 1) \ Sqr(AmountOfPairs)) * Steps
Dim y As Long
y = FromValue + ((iPair - 1) Mod Sqr(AmountOfPairs)) * Steps
Output(iPair, 1) = x
Output(iPair, 2) = y
Next iPair
' return array
GetValuePairs = Output
End Function
```
| null | CC BY-SA 4.0 | null | 2022-09-27T09:47:52.903 | 2022-09-27T11:38:50.743 | 2022-09-27T11:38:50.743 | 3,219,613 | 3,219,613 | null |
73,865,786 | 2 | null | 73,658,956 | 0 | null | This issue was fixed after updating Android Studio.
| null | CC BY-SA 4.0 | null | 2022-09-27T10:05:08.780 | 2022-09-27T10:05:08.780 | null | null | 19,449,667 | null |
73,865,996 | 2 | null | 30,112,645 | 1 | null | This is based on the previous answer in this post. The function here takes a vector (`sympy.Matrix`) as input and the corresponding coefficients also represented as a vector (`sympy.Matrix`) to factorize and extract the matrix A, such that `vec = A @ coeffs`.
```
import sympy as sp
def factorize_vec(vec:sp.Matrix, coeffs:sp.Matrix):
'''
Factorize a vector into the product of a matrix and its coefficients.
Parameters
----------
- `vec` : column vector of equations
- `coeffs` : column vector of coefficients to factorize
Return
------
- `A` : vec = A@coeffs
'''
A = sp.zeros(len(vec),len(coeffs))
for i,v in enumerate(vec):
expr = sp.collect(sp.expand(v), syms=coeffs[:])
for j,c in enumerate(coeffs):
A[i,j] = expr.coeff(coeffs[j])
return A
```
| null | CC BY-SA 4.0 | null | 2022-09-27T10:22:43.623 | 2022-09-27T10:22:43.623 | null | null | 11,175,221 | null |
73,866,582 | 2 | null | 73,866,581 | 1 | null | There are several psuedo classes available to date fields on webkit browsers. In Safari, to be able to see them, you can inspect the element and go into the shadow root. In the shadow root for the date field you will find div elements with a `psuedo` attribute hinting the available psuedo selectors:
```
::-webkit-datetime-edit
::-webkit-datetime-edit-fields-wrapper
::-webkit-datetime-edit-day-field
::-webkit-datetime-edit-month-field
::-webkit-datetime-edit-year-field
::-webkit-datetime-edit-text
```
This allows you to style each part of the date individually. You unfortunately cannot target the placeholder value with `:placeholder-shown`.
Currently, unless I am mistaken, this means it is impossible in Safari 16 on macOS to get rid of the placeholder without some javascript.
What you instead can do is keep track in Javascript using the `onchange` events whether the input has a value and apply a class. This will then let you select the individual elements of the date field using the above psuedo selectors when the class is applied.
For example (in regular html/js):
```
<style>
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-year-field {
opacity: var(--field-opacity, 0);
}
input[type="date"].has-value {
--field-opacity: 1;
}
</style>
<input type="date" id="my-date" />
<script>
const dateField = document.getElementById('my-date');
dateField.addEventListener('change', (ev) => {
if (ev.target.value) {
ev.target.classList.add('has-value');
} else {
ev.target.classList.remove('has-value');
}
});
</script>
```
Of course you will likely want to make this code reusable in your framework of choice.
Bear in mind this will also hide the placeholders on other browsers. While in most cases this consistency would not be an issue, you may want to do some browser detection to determine whether the hidden placeholders should apply or not.
| null | CC BY-SA 4.0 | null | 2022-09-27T11:05:30.697 | 2022-09-27T11:05:30.697 | null | null | 565,550 | null |
73,866,861 | 2 | null | 73,866,419 | 0 | null | This should work if you just swap out my placeholder df for your original one:
```
import pandas as pd
import numpy as np
df = pd.DataFrame({'Index': [31, 32, 33],
'Years In Office': ['1933-1945', '1945-1953', '1953-1961'],
'Party': ['d', 'd', 'r']})
print(df.head())
final = pd.DataFrame(columns=['Years In Office', 'Party'])
print(final.head())
for i, row in df.iterrows():
start_date = int(row['Years In Office'][0:4])
end_date = int(row['Years In Office'][-4:])
years = np.arange(start_date, end_date, 1)
party = [row['Party'] for x in range(len(years))]
to_add = pd.DataFrame({'Years In Office': years,
'Party': party})
final = final.append(to_add)
```
| null | CC BY-SA 4.0 | null | 2022-09-27T11:31:18.353 | 2022-09-27T11:31:18.353 | null | null | 19,135,021 | null |
73,866,872 | 2 | null | 73,866,419 | 0 | null | try:
```
df[['y1', 'y2']] = df['Years In Office'].str.split('-', expand=True)
df['y'] = df.apply(lambda x: [i.strftime('%Y') for i in pd.date_range(start=x['y1'], end=x['y2'], freq='y').tolist()], axis=1)
df = df.explode('y').drop(columns=['y1', 'y2', 'Years In Office'])
```
| null | CC BY-SA 4.0 | null | 2022-09-27T11:32:36.910 | 2022-09-27T11:32:36.910 | null | null | 14,241,968 | null |
73,866,876 | 2 | null | 3,977,566 | 2 | null | for others who have the same problem, you can use this library:
[https://github.com/homayoonahmadi/GroupBoxLayout](https://github.com/homayoonahmadi/GroupBoxLayout)
It doesn't use any white or other color backgrounds for hiding border under the label
| null | CC BY-SA 4.0 | null | 2022-09-27T11:32:49.287 | 2022-09-27T11:32:49.287 | null | null | 5,128,831 | null |
73,866,903 | 2 | null | 73,866,419 | 0 | null | One solution could be as follows:
```
import pandas as pd
data = {'Years In Office': ['1933-1945','1945-1953','1953-1961'],
'Party': ['Democratic', 'Democratic', 'Republican']}
df = pd.DataFrame(data)
df['Years In Office'] = df['Years In Office'].str.split('-').explode()\
.groupby(level=0).apply(lambda x: range(x.astype(int).min(),
x.astype(int).max()+1))
df = df.explode('Years In Office')
print(df)
Years In Office Party
0 1933 Democratic
1 1934 Democratic
2 1935 Democratic
3 1936 Democratic
4 1937 Democratic
5 1938 Democratic
6 1939 Democratic
7 1940 Democratic
8 1941 Democratic
9 1942 Democratic
10 1943 Democratic
11 1944 Democratic
12 1945 Democratic
13 1945 Democratic
14 1946 Democratic
15 1947 Democratic
16 1948 Democratic
17 1949 Democratic
18 1950 Democratic
19 1951 Democratic
20 1952 Democratic
21 1953 Democratic
22 1953 Republican
23 1954 Republican
24 1955 Republican
25 1956 Republican
26 1957 Republican
27 1958 Republican
28 1959 Republican
29 1960 Republican
30 1961 Republican
```
Notice that you will end up with duplicates:
```
print(df[df['Years In Office'].duplicated(keep=False)])
Years In Office Party
12 1945 Democratic
13 1945 Democratic
21 1953 Democratic
22 1953 Republican
```
This is because the periods overlap on end year & start year (e.g. `'1933-1945','1945-1953'`). If you don't want this, you could add:
```
df = df.groupby('Years In Office', as_index=False).agg({'Party':', '.join})
print(df.loc[df['Years In Office'].isin([1945, 1953])])
Years In Office Party
12 1945 Democratic, Democratic
20 1953 Democratic, Republican
```
Or you could drop only the years where the ruling party does not change. E.g.:
```
df = df[~df.duplicated()].reset_index(drop=True)
print(df.loc[df['Years In Office'].isin([1945, 1953])])
Years In Office Party
12 1945 Democratic
20 1953 Democratic
21 1953 Republican
```
| null | CC BY-SA 4.0 | null | 2022-09-27T11:35:32.937 | 2022-09-27T11:35:32.937 | null | null | 18,470,692 | null |
73,867,460 | 2 | null | 26,264,814 | 1 | null | I have solved it with a False like below
```
MyLLOQ = Application.InputBox("Type the LLOQ number...", Title:="LLOQ to be inserted in colored cells.", Type:=1)
If MyLLOQ = False Then Exit Sub
```
If user click cancel the sub will exit.
| null | CC BY-SA 4.0 | null | 2022-09-27T12:19:41.387 | 2022-09-27T12:19:41.387 | null | null | 13,432,646 | null |
73,867,988 | 2 | null | 30,684,613 | 0 | null | use this lib
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
and Do invalidating Caches and restarting.
| null | CC BY-SA 4.0 | null | 2022-09-27T12:57:05.060 | 2022-09-27T12:57:05.060 | null | null | 5,697,456 | null |
73,868,022 | 2 | null | 73,867,995 | 1 | null | HTML:
```
<div class="cylinder" data-v-5147e140="">
<div class="quantite-parent" data-v-5147e140="">
<h6 class="quantite" data-v-5147e140="">27.61 T</h6>
</div>
<div class="water" data-v-5147e140=""></div>
</div>
```
CSS:
```
.quantite-parent {
position: relative;
z-index: 1;
}
```
| null | CC BY-SA 4.0 | null | 2022-09-27T13:00:15.813 | 2022-09-27T13:02:35.583 | 2022-09-27T13:02:35.583 | 10,347,145 | 10,347,145 | null |
73,868,094 | 2 | null | 72,821,604 | 0 | null | You static file(styles.css) should be in a static directory created in the root level.
| null | CC BY-SA 4.0 | null | 2022-09-27T13:05:51.830 | 2022-09-27T13:05:51.830 | null | null | 18,291,745 | null |
73,868,299 | 2 | null | 73,868,203 | 1 | null | You're on the right track, but you have a few issues. Firstly you need to iterate `y` before `x`, since you process the columns for each row, not rows for each column. Secondly, you need to compute how many values you have output, which you can do with `(y*width+x)`. To output a single digit, take that value modulo 10. Finally `range(0, width, 1)` is just the same as `range(width)`. Putting it all together:
```
width = 5
height = 3
for y in range(height):
for x in range(width):
print((y*width+x)%10, end=' ')
print()
```
Output:
```
0 1 2 3 4
5 6 7 8 9
0 1 2 3 4
```
| null | CC BY-SA 4.0 | null | 2022-09-27T13:19:48.973 | 2022-09-27T13:19:48.973 | null | null | 9,473,764 | null |
73,868,547 | 2 | null | 73,867,995 | 0 | null | Main container needs to create a new [MDN: the stacking context](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context) to enable child elements to be positioned 'absolute' inside.
Once that has been done, the text content elements (`.content` in the snippet) can be positioned on top of the `.water` by settings its `z-index` higher than 0 (= html default).
I'm using [MDN: inset](https://developer.mozilla.org/en-US/docs/Web/CSS/inset) to stretch the child elements to fill the parent `.cylinder`.
Check the commented below:
```
.cylinder {
position: relative; /* new stacking context */
/* Will force 'absolute' child elements to be
positioned inside this element */
/* eye-candy */
height: 200px; width: 100px; background-color: Gainsboro;
}
.content {
inset: 0; /* stretch to fill parent */
position: absolute; /* position within parent */
z-index: 1; /* placed above .water */
/* Use CSS Grid to Vert/Hor center text */
display: grid; place-items: center;
}
.water {
inset: 40% 0 0 0; /* percent from top, fill from bottom */
/* modify the '40%' to your requirements. Any legal unit will do */
position: absolute; /* position within parent */
/* z-index will be default 0 */
/* eye-candy */
background-color: Orange; opacity: .6;
}
```
```
<div class="cylinder" data-v-5147e140="">
<div class="content" data-v-5147e140="">
<h6 class="quantite" data-v-5147e140="">27.61 T</h6>
</div>
<div class="water" data-v-5147e140=""></div>
</div>
```
| null | CC BY-SA 4.0 | null | 2022-09-27T13:35:58.740 | 2022-09-27T13:35:58.740 | null | null | 2,015,909 | null |
73,868,724 | 2 | null | 73,487,045 | 0 | null | (Forgot to post an answer, better late than never I hope)
I have managed to achieve what I needed in a hack-ish solution from my colleague of just using CustomScrollView with the nested TabBar and ListView inside of SliverFillRemaining:
```
import 'package:flutter/material.dart';
void main() async {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: OuterTabView(),
);
}
}
class OuterTabView extends StatefulWidget {
const OuterTabView({Key? key}) : super(key: key);
@override
State<OuterTabView> createState() => _OuterTabViewState();
}
class _OuterTabViewState extends State<OuterTabView> with TickerProviderStateMixin {
late TabController _tabControllerOut;
@override
void initState() {
super.initState();
_tabControllerOut = TabController(length: 3, vsync: this);
}
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
body: NestedScrollView(
headerSliverBuilder: (_, __) {
return <Widget>[
SliverToBoxAdapter(
child: TabBar(
tabs: const [
SizedBox(height: 40),
SizedBox(height: 40),
SizedBox(height: 40),
],
controller: _tabControllerOut,
),
),
];
},
body: TabBarView(
controller: _tabControllerOut,
children: const [
Tab1WithNestedTabView(),
Tab2(),
Tab3(),
],
),
),
),
);
}
}
class Tab1WithNestedTabView extends StatefulWidget {
const Tab1WithNestedTabView({Key? key}) : super(key: key);
@override
State<Tab1WithNestedTabView> createState() => _Tab1WithNestedTabViewState();
}
class _Tab1WithNestedTabViewState extends State<Tab1WithNestedTabView> with TickerProviderStateMixin {
late TabController _tabControllerIn;
@override
void initState() {
_tabControllerIn = TabController(length: 2, vsync: this);
super.initState();
}
@override
Widget build(BuildContext context) {
return CustomScrollView(
shrinkWrap: true,
physics: const ClampingScrollPhysics(),
controller: PrimaryScrollController.of(context),
slivers: [
SliverToBoxAdapter(
child: TabBar(
controller: _tabControllerIn,
tabs: const [
SizedBox(height: 40),
SizedBox(height: 40),
],
),
),
SliverFillRemaining(
child: TabBarView(
controller: _tabControllerIn,
children: const [
ItemList(
color1: Colors.green,
color2: Colors.yellow,
),
ItemList(
color1: Colors.tealAccent,
color2: Colors.black54,
),
],
),
),
],
);
}
}
class Tab2 extends StatelessWidget {
const Tab2({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return CustomScrollView(
shrinkWrap: true,
physics: const ClampingScrollPhysics(),
controller: PrimaryScrollController.of(context),
slivers: const [
SliverFillRemaining(
child: ItemList(
color1: Colors.blue,
color2: Colors.yellow,
),
),
],
);
}
}
class Tab3 extends StatelessWidget {
const Tab3({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return const ItemList(
color1: Colors.deepOrange,
color2: Colors.pinkAccent,
);
}
}
// Sample list
class ItemList extends StatelessWidget {
final Color color1;
final Color color2;
const ItemList({
required this.color1,
required this.color2,
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return ListView.builder(
physics: const ClampingScrollPhysics(),
itemBuilder: (context, index) {
return Container(
alignment: Alignment.center,
color: index.isOdd ? color1 : color2,
height: 200,
child: Text(index.toString()),
);
},
);
}
}
```
I admit it's not exactly the most graceful way, but worked fine enough for me. If anyone finds a better one - I'll be happy to mark that one as an accepted answer.
| null | CC BY-SA 4.0 | null | 2022-09-27T13:46:50.483 | 2022-09-27T13:46:50.483 | null | null | 14,065,735 | null |
73,868,943 | 2 | null | 73,862,538 | 0 | null | Flat vs leaf is related to cells and pins in a hierarchical design. You might have a timing path that starts at registerA and ends at registerB. If your cell hierarchy is this:
top_cell
--child_A
--registerA
--child_B
--registerB
then registerA and registerB are leaf cells. The driver and receiver pins are the leaf pins. The net connection from registerA to registerB must also exit child_A and enter child_B through hierarchical pins. A flat collection will include both the leaf pins and the hierarchical pins.
In Synopsys tools, you can quickly get command descriptions with `man`.
For example, `man all_fanin`
```
all_fanin
Creates a collection of pins, ports, or cells in the fanin of
the specified sinks.
. . .
-flat Includes objects throughout the design hierarchy in the result.
This means that the only non-leaf objects in the result are
hierarchical sink pins.
If you do not specify this option, the result includes only
objects within the same hierarchical level as the current sink.
. . .
-only_cells
Includes only cells in the timing fanin of the specified sinks
in the result and not pins or ports.
. . .
```
There is no `-only_leaf` option to `all_fanin` or `all_fanout`. Returning only leaf objects is the default condition.
| null | CC BY-SA 4.0 | null | 2022-09-27T14:01:31.420 | 2022-09-27T14:25:31.140 | 2022-09-27T14:25:31.140 | 16,350,882 | 16,350,882 | null |
73,868,977 | 2 | null | 73,866,852 | 1 | null | Sorry, I could not fully adhere to the original notation; I used the dot for both dot product and scalar multiplication. I hope it helps anyway.
Let us first obtain a formula for the distance of a point `P` to the axis of the cylindre, of vector equation `C + m.V`. We find the `m` such that `PC` is orthogonal to `V`, by
```
(PC + m.V).V = 0,
```
giving
```
m = - PC.V.
```
Now, the squared norm of PC is the squared radius and we obtain
```
r² = (PC - (PC.V).V)² = PC² - (PC.V)².
```
If we consider a ray of origin `A` and direction `D`, let `A + t.D`, we have the quadratic equation in `t`
```
r² = (AC + t.D)² - (AC.V + t.D.V)².
```
Remains to expand to obtain the coefficients of the quadratic trinomial.
| null | CC BY-SA 4.0 | null | 2022-09-27T14:04:15.497 | 2022-09-27T16:22:04.367 | 2022-09-27T16:22:04.367 | null | null | null |
73,869,057 | 2 | null | 73,828,475 | 1 | null | Another solution, but at the cost of inverting all edges:
```
require(igraph)
tree2 <- make_tree(10, 3) + make_tree(10, 2)
## Calculate x,y coordinates by Sugiyama,
## flip y coordinate, and plot.
lyt <- layout_with_sugiyama(reverse_edges(tree2))$layout
lyt[,2] <- (1L + max(lyt[,2])) - lyt[,2]
lyt[,2]
plot(tree2, layout=lyt)
```
which gives
```
[1] 3 2 2 1 1 1 1 1 1 1 4 3 2 2 2 1 1 1 1 1
```
| null | CC BY-SA 4.0 | null | 2022-09-27T14:10:43.810 | 2022-09-27T14:10:43.810 | null | null | 3,604,103 | null |
73,869,483 | 2 | null | 73,845,377 | 1 | null | Just a wild guess into the dark but you seem to be using the `TextMeshProUGUI` component of the input field (assuming this from the name `inputFieldText`).
So I assume this to be related to this [https://forum.unity.com/threads/float-parse-does-not-work-in-tmpro-input-field-which-basically-means-tmpro-is-useless.718268/#post-4804799](https://forum.unity.com/threads/float-parse-does-not-work-in-tmpro-input-field-which-basically-means-tmpro-is-useless.718268/#post-4804799)
> > Perhaps related...```
manager.networkAddress = IPField.GetComponent<TMPro.TextMeshProUGUI>().text.Trim();
```
...includes a Unicode Zero Width Space (U+200B) on the end that Trim() doesn't remove.That is correct in terms of why the float.Parse would fail. However, and more importantly, this is due to referencing the child text component instead of the parent `TMP_InputField` and its `.text` property.
=> change the type to
```
public TMP_Inputfield inputFieldText;
```
assign it again via the Inspector and try again with simply
```
...
}
else if(string.IsNullOrWhiteSpace(inputFieldText.text))
{
...
```
| null | CC BY-SA 4.0 | null | 2022-09-27T14:40:46.107 | 2022-09-27T14:40:46.107 | null | null | 7,111,561 | null |
73,869,778 | 2 | null | 56,099,856 | 0 | null | I had a similar issue using `highlightjs` and resolved it using:
```
code {
min-width: 100%;
width: 0px;
overflow: auto; /* Or scroll */
}
```
To the best of my knowledge, in order for child elements to cause overflow within a parent container, in this case, the parent container should have a fixed value for `width` or `min-width`. And `max-width: 100%` did not work for me.
So I gave a static value of `width: 0px` to cause overflowing to kick-in and `min-width: 100%`. The parent element obeys the `min-width` because `min-width` has higher precedence over `width`.
| null | CC BY-SA 4.0 | null | 2022-09-27T15:01:35.247 | 2022-09-27T15:01:35.247 | null | null | 12,653,918 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.