Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
sequence |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
74,433,840 | 2 | null | 74,433,732 | 0 | null | You likely want
```
$('.member__designation').each(function() {
this.textContent = this.textContent.replace(/-/g,'<br>')
})
```
assuming $('.member__designation') only has text and not html
IF there is only SIMPLE HTML like `<b>` then do
```
$('.member__designation').each(function() {
this.innerHTML = this.innerHTML.replace(/-/g,'<br>')
})
```
| null | CC BY-SA 4.0 | null | 2022-11-14T15:10:56.040 | 2022-11-14T15:10:56.040 | null | null | 295,783 | null |
74,433,853 | 2 | null | 74,433,732 | 0 | null | It looks like you grab all elements with class `.member__designation` and you replace them with whatever your regex grabs. I think you must change your implementation
| null | CC BY-SA 4.0 | null | 2022-11-14T15:11:57.043 | 2022-11-14T15:11:57.043 | null | null | 14,048,001 | null |
74,434,686 | 2 | null | 74,432,080 | 0 | null | It looks like you have made the object transparent without chageing the opacity. Opacity has a range between 0 - 1 and will default to 1 if not changed. Try the following:
```
const spriteMaterial = new THREE.SpriteMaterial( {
map: canvasTexture,
depthTest: false,
depthWrite: false,
transparent: true,
opacity: 0.5,
color: 0xffffff,
} );
```
| null | CC BY-SA 4.0 | null | 2022-11-14T16:15:14.613 | 2022-11-14T16:15:14.613 | null | null | 12,810,070 | null |
74,434,750 | 2 | null | 74,434,592 | 0 | null | The best way to solve this is to imagine that the pyramids are in a "frame" and fill up all the characters. I.e. you either print a space or an asterisk in the frame. Currently you are not printing the spaces of the first pyramid, which means that each following pyramid will be increasingly lopsided.
The way I would write it is to have a double `for` loop for the X and a Y coordinates, and then have a function to tell me if the current X and Y fall within a specific pyramid (one call for each pyramid). This also allows for other patterns to be printed. See it as a simple form of ray tracing.
```
for (int y = 0; y < 22; y++) {
for (int x = 0; x < 7; x++) {
if (inPyramid(0, 0, x, y) || inPyramid(10, 0, x, y)) {
System.out.print("*");
else {
System.out.print(" ");
}
}
}
```
with the following method:
```
public boolean inPyramid(int pyramidOffsetX, int pyramidOffsetY, int x, int y) {
// TODO fill in the tricky part :)
}
```
This seems a bit harder, but it will easily allow overlap of shapes and such, and it is a much more structured approach.
| null | CC BY-SA 4.0 | null | 2022-11-14T16:20:41.097 | 2022-11-14T16:39:22.383 | 2022-11-14T16:39:22.383 | 589,259 | 589,259 | null |
74,434,874 | 2 | null | 74,434,592 | -1 | null | In order to draw upside-down pyramids next to each other, you will need to know the amount of pyramids and the size of the pyramid.
This is an O(n³) complexity algorithm (triple-nested loop).
```
public class Pyramids {
public static void main(String[] args) {
System.out.println(render(2, 9)); // 2 pyramids with a base of 9
System.out.println(render(4, 5)); // 4 pyramids with a base of 5
}
public static String render(int count, int size) {
StringBuffer buffer = new StringBuffer();
int rows = (int) Math.floor(size / 2) + 1;
for (int row = 0; row < rows; row++) {
for (int pyramid = 0; pyramid < count; pyramid++) {
int indentSize = pyramid == 0 ? row : row * 2;
for (int indent = 0; indent < indentSize; indent++) {
buffer.append(" "); // indent
}
int starCount = size - (row * 2);
for (int star = 0; star < starCount; star++) {
buffer.append("*"); // star
}
buffer.append(" ");; // separator
}
buffer.append(System.lineSeparator()); // new-line
}
return buffer.toString();
}
}
```
## Output
```
********* *********
******* *******
***** *****
*** ***
* *
***** ***** ***** *****
*** *** *** ***
* * * *
```
---
Here is a JavaScript version of the Java code above.
```
const renderPyramids = (count, size) => {
let str = '';
const rows = Math.floor(size / 2) + 1;
for (let row = 0; row < rows; row++) {
for (let pyramid = 0; pyramid < count; pyramid++) {
const indentSize = pyramid === 0 ? row : row * 2;
for (let indent = 0; indent < indentSize; indent++) {
str += ' '; // indent
}
const starCount = size - (row * 2);
for (let star = 0; star < starCount; star++) {
str += '*'; // star
}
str += ' '; // separator
}
str += '\n'; // new-line
}
return str;
};
console.log(renderPyramids(2, 9));
console.log(renderPyramids(4, 5));
```
| null | CC BY-SA 4.0 | null | 2022-11-14T16:30:04.363 | 2022-11-14T16:52:53.743 | 2022-11-14T16:52:53.743 | 1,762,224 | 1,762,224 | null |
74,435,019 | 2 | null | 74,434,906 | 1 | null | Modifying state is an asynchronous operation, so doing this in a tight loop (as you do) means that you're overwriting the previous value each time.
Instead, call `setFirebaseOrders` just once with all results:
```
setFirebaseOrders(
querySnapshot.docs.map((doc) => doc.data());
})
```
---
Also note that the `console.log(firebaseOrders)` may not show the correct value, as it likely runs before `setFirebaseOrders(...)` has run/completed.
If you want to see the orders from the state, show them in components in your UI. If you want to `console.log` what you get from the database, do so in the callback:
```
const orders = querySnapshot.docs.map((doc) => doc.data());
console.log(orders);
setFirebaseOrders(orders);
```
| null | CC BY-SA 4.0 | null | 2022-11-14T16:42:10.443 | 2022-11-14T16:55:35.703 | 2022-11-14T16:55:35.703 | 13,130,697 | 209,103 | null |
74,435,060 | 2 | null | 74,434,592 | 3 | null |
## String#repeat
You can do it using a single loop using [String#repeat](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html#repeat(int)).
:
```
public class Main {
public static void main(String[] args) {
final int ROWS = 5;
for (int i = 1; i <= ROWS; i++) {
String stars = "*".repeat((ROWS + 1) * 2 - 2 * i - 1);
System.out.println(" ".repeat(i - 1) + stars + " ".repeat(i * 2 - 1) + stars);
}
}
}
```
:
```
********* *********
******* *******
***** *****
*** ***
* *
```
| null | CC BY-SA 4.0 | null | 2022-11-14T16:45:40.203 | 2022-11-14T16:45:40.203 | null | null | 10,819,573 | null |
74,435,052 | 2 | null | 74,432,115 | 0 | null | There is a solution but it's a bit hacky (doesn't seem natively supported by Vuetify). First, you'll need to use the prop `interval-count`
> The number of intervals to display in the day view.
When you use this to show hours past midnight, the calendar will grow vertically to accommodate the additional hours, but will still not show the interval labels for those hours.
If we use another prop called `show-interval-label`, it takes a function that:
> Checks if a given day and time should be displayed in the interval gutter of the day view.
Using the props together:
```
first-interval="10"
interval-minutes="60"
interval-count="18"
:show-interval-label="showInterval"
```
Here I define a method `showInterval` and in showInterval if I console.log all the intervals it receives, the first interval that is displayed (1:00am) looks like this:
```
{
"date": "2022-11-14",
"time": "25:00",
"year": 2022,
"month": 11,
"day": 14,
"weekday": 1,
"hour": 26,
"minute": 0,
"hasDay": true,
"hasTime": true,
"past": false,
"present": false,
"future": true
}
```
Even if we `return true` for all intervals, the intervals after midnight still won't be displayed on the calendar. That is because the v-calendar template code after midnight it should only display intervals for the day, but the interval object itself still has properties defining it using the previous day (`date`, `day`, `weekday`, etc)
To get these intervals to display we have to modify the object to look like this instead:
```
{
"date": "2022-11-15",
"time": "1:00",
"year": 2022,
"month": 11,
"day": 15,
"weekday": 2,
"hour": 1,
"minute": 0,
"hasDay": true,
"hasTime": true,
"past": false,
"present": false,
"future": true
}
```
The full code for doing so is below which I also included in a [codepen](https://codepen.io/yoduh/pen/KKeqxBg?editors=1010)
```
showInterval(dateObj) {
console.log('dateObj', dateObj);
if (dateObj.hour > 24) {
const extraDays = Math.floor(dateObj.hour / 24);
const newHour = dateObj.hour === 24 ? 24 : dateObj.hour % 24;
const newDay = dateObj.weekday + extraDays === 7 ? 7 : (dateObj.weekday + extraDays) % 7;
dateObj.hour = newHour;
dateObj.weekday = newDay;
dateObj.day = dateObj.day + extraDays;
dateObj.date = this.addDays(dateObj.date, extraDays);
dateObj.time = this.subtractTime(dateObj.time, extraDays);
}
return true;
},
addDays(date, days) {
var result = new Date(date);
result.setDate(result.getDate() + days);
return result.toISOString().slice(0, 10);
},
subtractTime(time, days) {
const timeArr = time.split(':');
const newHour = Number(timeArr[0]) - 24 * days;
return newHour + ':' + timeArr.slice(1).join();
}
```
| null | CC BY-SA 4.0 | null | 2022-11-14T16:45:11.477 | 2022-11-14T16:45:11.477 | null | null | 6,225,326 | null |
74,435,093 | 2 | null | 74,429,137 | 0 | null | To go through your table like that, you'd need to work in two for loops, 1 for the rows and 1 for the columns.
```
Sub getAllOnes()
Dim lColumn As Long, lastrow As Long, lRowO As Long
Dim wsA As Worksheet, wsO As Worksheet
Dim sCopy As String
Set wsA = ActiveWorkbook.Worksheets("Allocation")
Set wsO = ActiveWorkbook.Worksheets("Output")
lRowO = 2 'start row of your Output
lastrow = wsA.Range("A" & Rows.Count).End(xlUp).Row
lColumn = wsA.Cells(1, Columns.Count).End(xlToLeft).Column
For j = 2 To lColumn 'looping through columns
For i = 2 To lastrow 'looping through your rows
If Cells(i, j).Value2 > 0 Then 'assuming you only have 1's in the table, this should suffice
wsO.Cells(lRowO, 1).Value2 = wsA.Cells(i, 1).Value2 'using values makes sure you get the value but don't need to keep switching between sheets or copying
wsO.Cells(lRowO, 2).Value2 = wsA.Cells(1, j).Value2
lRowO = lRowO + 1
End If
Next i
Next j
End Sub
```
This outta do it. If anything is unclear, let me know.
| null | CC BY-SA 4.0 | null | 2022-11-14T16:47:47.657 | 2022-11-14T16:47:47.657 | null | null | 19,353,309 | null |
74,435,416 | 2 | null | 19,718,550 | 0 | null | First after upgrade my machine from windows 10 to windows 11, the visual studio give me the same error from title of this post. I did the step from [Lee Grissom's repply](https://stackoverflow.com/a/19850440/13156642), and still not working.
So, I found a suggestion from the last current comment on [this msdn post](https://social.msdn.microsoft.com/Forums/vstudio/en-US/be7945ad-a53e-4c99-90e8-4d0140c1c01d/windows-upgrade-damage?forum=vbgeneral), from the user `Bedford Bob`, removing this reference
`Microsoft ActiveX Data Objects 2.8 Library` from the project and building again, and works.
I don't no how, but after adding the reference again (just for test), the project now works, without any problems, lol.
| null | CC BY-SA 4.0 | null | 2022-11-14T17:12:55.490 | 2022-11-14T17:12:55.490 | null | null | 13,156,642 | null |
74,435,474 | 2 | null | 29,692,288 | 0 | null | It looks like Victorp answered this in the comments of the original post. The ncol argument in the legend function works for me:
```
legend(locator(1), legend=c("name1","name2", "name3", "name4"), lty=2, col=c("black", "blue", "dark green", "orange"), ncol=2)
```
[enter image description here](https://i.stack.imgur.com/6W52o.png)
| null | CC BY-SA 4.0 | null | 2022-11-14T17:17:26.490 | 2022-11-14T17:17:26.490 | null | null | 4,958,659 | null |
74,435,583 | 2 | null | 37,512,079 | 0 | null |
Index 0 1 2 3 4 5
Values a b c d e f
Index -6 -5 -4 -3 -2 -1
l[:]--> a b c d e f
l[:-1]-->a b c d e
l[:]-->l[start : end]--> default value start=0 end=6
l[:-1]-->l[start : end]--> default value start=0 end=-1
Considering negative indexing you will get:
l[:-1]-->a b c d e
| null | CC BY-SA 4.0 | null | 2022-11-14T17:24:48.280 | 2022-11-14T17:24:48.280 | null | null | 16,332,166 | null |
74,436,151 | 2 | null | 74,436,040 | 0 | null | > If I try to map my response, an error is thrown:
and the whole app is down. How do i fix this?
You'll need to render something when the query is in a loading state. You can take advantage of the `loading` and `error` properties of `useQuery` hook. Here's a sample:
```
const RenderProducts = () => {
const { data, loading, error } = useQuery(GET_PRODUCTS);
if(loading) return <div>loading...</div>
if(error) return <div>cannot render products...something went wrong</div>
// if the query has finished loading products and there's no error,
// You can access data.products
// and write your logic
console.log(data.products.map(product => console.log(product)));
const products = data.products.map((product) => {
return (
<li className="productList__item">
<img className="productList__item-img" src={product.mainImage.url} alt={product.title} />
<div className="productList__item-descr">
<div className="productList__item-title">{product.title}</div>
<div className="productList__item-price">{product.price} $</div>
</div>
</li>
)
})
return <ul>{products}</ul>
}
```
| null | CC BY-SA 4.0 | null | 2022-11-14T18:18:10.727 | 2022-11-14T18:18:10.727 | null | null | 13,781,069 | null |
74,436,234 | 2 | null | 74,379,670 | 0 | null | This has been reported and got fixed in v0.2.53
[https://github.com/material-table-core/core/issues/660](https://github.com/material-table-core/core/issues/660)
| null | CC BY-SA 4.0 | null | 2022-11-14T18:25:49.937 | 2022-11-14T18:25:49.937 | null | null | 4,093,172 | null |
74,436,790 | 2 | null | 74,436,295 | 3 | null | Your main mistake is that you are not assigning the faceted plot. You need `p <- p + facet_wrap...` not just `p + facet_wrap...`.
The `vars()` function works well with `{{`. I also switched to using a `missing()` check instead of a `NULL` default. And I'd recommend not hardcoding `ncol = 2` and `nrow = 2` unless you're sure you will only ever use this with 4 unique values in `split_by`.
```
my_ggplot2_wrapper <- function(data, x = ds, y = y, split_by) {
p <- ggplot2::ggplot() +
ggplot2::geom_line(
data = data,
ggplot2::aes(x = {{ x }}, y = {{ y }})
)
if (!missing(split_by)) {
p = p + ggplot2::facet_wrap(ggplot2::vars({{split_by}}), ncol = 2, nrow = 2)
}
p
}
my_ggplot2_wrapper(data = ts_component, split_by = component)
```
[](https://i.stack.imgur.com/MZHNV.png)
| null | CC BY-SA 4.0 | null | 2022-11-14T19:22:00.617 | 2022-11-14T19:22:00.617 | null | null | 903,061 | null |
74,436,809 | 2 | null | 74,436,295 | 1 | null | Hope I understood your properly. If you need to pass a character value and use it as symbol for facetting you can do the following:
```
library(ggplot2)
library(magrittr)
gg <- function(coln = "carb"){
mtcars %>%
ggplot(aes(cyl, mpg))+
geom_bar(stat = "identity") +
facet_wrap(bquote(~ .(sym(coln))))
}
gg("carb")
```
Character vector with a single element `"carb"` is passed to ggplot wrapper function and is used by faceting layer.
The result is following:
[](https://i.stack.imgur.com/wiZwA.png)
| null | CC BY-SA 4.0 | null | 2022-11-14T19:23:17.350 | 2022-11-14T20:40:28.470 | 2022-11-14T20:40:28.470 | 5,043,424 | 5,043,424 | null |
74,436,971 | 2 | null | 53,337,299 | 2 | null | The solution from the [Darts installation guide](https://github.com/unit8co/darts/blob/master/INSTALL.md#macos-issues-with-lightgbm) worked for me. You need to downgrade the libomp library:
```
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb
brew unlink libomp
brew install libomp.rb
```
| null | CC BY-SA 4.0 | null | 2022-11-14T19:37:58.097 | 2022-11-14T19:37:58.097 | null | null | 8,760,385 | null |
74,437,188 | 2 | null | 69,573,547 | 1 | null | This can be done by setting `textHeightBehavior` property of `Text`.
```
Text(
'text',
style: TextStyle(
color: Colors.black,
height: 16 / 12,
),
textHeightBehavior: const TextHeightBehavior(
applyHeightToFirstAscent: true,
applyHeightToLastDescent: true,
leadingDistribution: TextLeadingDistribution.even,
),
),
```
Most important thing is to set `leadingDistribution` as `TextLeadingDistribution.even`.
| null | CC BY-SA 4.0 | null | 2022-11-14T20:00:14.800 | 2022-11-14T20:00:14.800 | null | null | 7,906,279 | null |
74,437,320 | 2 | null | 23,290,951 | 0 | null | ```
<?php
$requestUrl = 'https://example/sitemap.xml';
$response = file_get_contents($requestUrl);
$responseXml = simplexml_load_string($response);
foreach ($responseXml->Table1 as $Table1) {
echo $Table1->Title;
echo "<br>";
}
?>
```
| null | CC BY-SA 4.0 | null | 2022-11-14T20:13:27.080 | 2022-11-14T20:13:27.080 | null | null | 16,633,060 | null |
74,437,608 | 2 | null | 73,753,672 | 0 | null | I had this error when I created a new VS Code Dev Container using Ubuntu Jammy and selecting the "dotnet CLI" feature. I ended up switching my Dev Container to use Focal and the problem went away.
| null | CC BY-SA 4.0 | null | 2022-11-14T20:43:10.023 | 2022-11-14T20:43:10.023 | null | null | 250,094 | null |
74,437,710 | 2 | null | 74,427,753 | 0 | null | I've actually never used the Initial Page Name before but the Tablix Page Name should be working using the property that the pic shows. I usually don't use a function for static text but it should work.
You can try using the tablix Group to name the page. Highlight the table and then click on the main group in the Grouping window at the bottom.
[](https://i.stack.imgur.com/Wo88m.png)
Then, in the Properties window, click on the + for Group to expand and enter the Processing Quality_Source Data for the Page Name.
[](https://i.stack.imgur.com/1zxBl.png)
If it still doesn't work, then check for another table or rectangle that may be embedded in the table or the table is embedded in.
| null | CC BY-SA 4.0 | null | 2022-11-14T20:52:57.453 | 2022-11-14T20:52:57.453 | null | null | 4,459,617 | null |
74,437,729 | 2 | null | 74,403,761 | 0 | null | Well, if the popup is appearing on your webpage, then you didn't find the malicious code someone has placed (if it was even there, as I looked at your page and didn't find anything).
Remember that malicious code can also be placed in the header of your html file (If attacker got access to your server).
It can also be the result of an , which is a more likely behavior.
I couldn't replicate the bug on your website, so I can't give further info. I can only relay on your images.
| null | CC BY-SA 4.0 | null | 2022-11-14T20:54:12.423 | 2022-11-14T20:54:12.423 | null | null | 9,547,691 | null |
74,438,333 | 2 | null | 70,605,597 | 0 | null | I had the same problem and fixed by keeping the existing compiler options, and only overwriting the relevant properties. Like this:
```
const compilerOptions = monaco.languages.typescript.javascriptDefaults.getCompilerOptions();
monaco.languages.typescript.javascriptDefaults.setCompilerOptions({
...compilerOptions,
noLib: true,
});
```
| null | CC BY-SA 4.0 | null | 2022-11-14T21:58:43.973 | 2022-11-14T21:58:43.973 | null | null | 13,793,181 | null |
74,439,024 | 2 | null | 62,270,438 | 0 | null | You need to install `babel/core` and `babel/runtime` for it to work. Here is the code for that:
```
npm i @babel/core @babel/runtime typescript -d
```
| null | CC BY-SA 4.0 | null | 2022-11-14T23:26:14.903 | 2022-11-15T14:54:14.083 | 2022-11-15T14:54:14.083 | 2,570,277 | 5,509,892 | null |
74,439,349 | 2 | null | 74,439,260 | 1 | null | so I just answered my question it was simpler than I expected
I connected an iboutlet to height constraint of tableView and change it's value programmatically :
and just added this line of code
`heightConstraint.constant = CGFloat(myArray.count * 62) // 62 is the height of the each row in the tableView`
| null | CC BY-SA 4.0 | null | 2022-11-15T00:17:45.250 | 2022-11-15T03:19:37.467 | 2022-11-15T03:19:37.467 | 18,280,492 | 18,280,492 | null |
74,439,600 | 2 | null | 74,428,328 | 0 | null | You didn't provide enough information. how many columns and rows do you want in the grid? what is the size of each grid?
Anyway, I just added width and height using `vw` and `vh` and it works normally. so what exactly is the issue here?
```
* {
margin: 0;
padding: 0;
}
.grid_section .grid_container {
display: inline-grid;
width: 100vw;
height: 100vh;
background-color: black;
grid-template-columns: auto auto auto auto auto;
grid-template-rows: auto auto auto auto auto;
column-gap: 5px;
row-gap: 5px;
padding: 10px;
}
.grid_section .grid_container .grid_item {
background-color: rgb(29, 216, 29);
border: 1px solid rgb(0, 0, 0);
padding: 20px;
}
```
```
<div class="grid_section">
<div class="grid_container">
<div class="grid_item"></div>
<div class="grid_item"></div>
<div class="grid_item"></div>
<div class="grid_item"></div>
<div class="grid_item"></div>
<div class="grid_item"></div>
<div class="grid_item"></div>
<div class="grid_item"></div>
<div class="grid_item"></div>
<div class="grid_item"></div>
</div>
</div>
```
| null | CC BY-SA 4.0 | null | 2022-11-15T01:06:26.090 | 2022-11-15T01:06:26.090 | null | null | 6,467,902 | null |
74,439,912 | 2 | null | 63,636,178 | 0 | null | In Chrome, and in some other browsers, a standard black icon in the form of a calendar is added to the input type date field.
To remove it or change it, we use such a pseudo-selector:
1. to remove:
```
input[type="date"]::-webkit-calendar-picker-indicator {
display: none;
}
```
```
<input type="date" />
```
1. to make invisible:
```
input[type="date"]::-webkit-calendar-picker-indicator {
visibility: hidden;
}
```
```
<input type='date'/>
```
1. as you probably already guessed, with this pseudo-selector you can do a lot with this calendar icon, for example, even add a red background
```
input[type="date"]::-webkit-calendar-picker-indicator {
background-color: red;
}
```
```
<input type='date'/>
```
| null | CC BY-SA 4.0 | null | 2022-11-15T02:15:56.567 | 2022-11-15T02:15:56.567 | null | null | 15,190,092 | null |
74,440,087 | 2 | null | 73,665,446 | 0 | null | Execute the following query in the corresponding mysql shell script:
ALTER USER ''@'<host/Ip-address>' REQUIRE <tls_option>; [ tls_option: { SSL | X509 | CIPHER 'cipher' | ISSUER 'issuer' | SUBJECT 'subject' } ]
[https://pitstop.manageengine.com/portal/en/kb/articles/how-to-fix-connections-using-insecure-transport-are-prohibited-while-require-secure-transport-on-in-mysql](https://pitstop.manageengine.com/portal/en/kb/articles/how-to-fix-connections-using-insecure-transport-are-prohibited-while-require-secure-transport-on-in-mysql)
| null | CC BY-SA 4.0 | null | 2022-11-15T02:45:07.657 | 2022-11-15T02:45:07.657 | null | null | 10,909,359 | null |
74,440,254 | 2 | null | 74,432,742 | 1 | null | The results are reasonable when doing this, that is, compute area ignoring distortion from the coordinate reference system.
```
library(terra)
library(geodata)
w <- world(path=".")
w <- project(w, "+proj=moll") |> aggregate()
aw <- expanse(w, unit = "km", transform=F)
b <- buffer(w, width = -100000)
ab <- expanse(b, unit = "km", transform=F)
ab / aw
#[1] 0.7890138
```
But things go wrong when using `transform=TRUE`. In that case, the polygons are projected to lon/lat before computing the area. That should be more precise, but something is going wrong.
```
aw2 <- expanse(w, unit = "km", transform=T)
ab2 <- expanse(b, unit = "km", transform=T)
ab2 / aw2
#[1] 2.11017
```
Because `aw2` is much too small. This is related to the warnings you are getting. Illustrated here
```
d <- disagg(w)
afeuras <- d[24,]
expanse(afeuras)
#[1] 0
#Warning messages:
#1: Point outside of projection domain (GDAL error 1)
```
I need to investigate to see what can be done.
| null | CC BY-SA 4.0 | null | 2022-11-15T03:17:17.300 | 2022-11-15T03:27:36.733 | 2022-11-15T03:27:36.733 | 635,245 | 635,245 | null |
74,440,402 | 2 | null | 26,961,221 | 0 | null | ```
.oval {
background-color: #ff0000;
width: 200px;
height: 100px;
border-radius: 100px/50px;
border: 1px solid #000000;
position: absolute;
}
```
```
<div class="oval"></div>
```
| null | CC BY-SA 4.0 | null | 2022-11-15T03:51:03.710 | 2022-11-15T08:32:29.113 | 2022-11-15T08:32:29.113 | 16,846,346 | 20,506,404 | null |
74,440,483 | 2 | null | 9,230,727 | 0 | null | I had `height: 100%;` in code and every page breaks.
| null | CC BY-SA 4.0 | null | 2022-11-15T04:04:39.250 | 2022-11-15T04:04:39.250 | null | null | 12,852,111 | null |
74,440,699 | 2 | null | 74,438,234 | 0 | null | Click the image in Solution Explorer, press F4 and check that it is "Copied if Newer".
When you debug/run your application out of Visual Studio, the exe is running out of the bin/Debug folder. You want to make sure you delete the image from the bin/Debug not the project folder.
The error is straight forward, you're trying to delete a file that doesn't exist at that location.
Perhaps put a breakpoint on a line like this above the `File.Delete` operation:
```
if (File.Exists(filePath)) {
```
| null | CC BY-SA 4.0 | null | 2022-11-15T04:43:50.263 | 2022-11-15T05:36:08.727 | 2022-11-15T05:36:08.727 | 495,455 | 495,455 | null |
74,441,211 | 2 | null | 74,435,996 | 0 | null | Please try this line into your code..
address() convert your wallet string to a valid wallet address format.
`IERC20(tokenAddresses[i]).balanceOf(address(walletAddress));`
| null | CC BY-SA 4.0 | null | 2022-11-15T06:06:44.883 | 2022-11-15T06:06:44.883 | null | null | 8,328,981 | null |
74,441,446 | 2 | null | 74,441,024 | 1 | null | You have to iterate the second table and prepand all info from first on to the data - Choosed this solution, cause it is not clear if there can be multiple documents from same type, so it would not make sense to have something like link [typeA]1, link[typeA]2, ...:
`walrus operator`
```
data = []
for e in soup.select('table:last-of-type tr:has(td)'):
d = dict(zip(it:=iter(soup.table.stripped_strings),it))
d.update({
'link': e.a.get('href'),
'date': e.select('td')[-2].text,
'type': e.select('td')[-1].text
})
data.append(d)
```
or without `walrus operater`:
```
for e in soup.select('table:last-of-type tr:has(td)'):
it = iter(soup.table.stripped_strings)
d = dict(zip(it,it))
d.update({
'link': e.a.get('href'),
'date': e.select('td')[-2].text,
'type': e.select('td')[-1].text
})
data.append(d)
```
#### Example
```
import requests
import pandas as pd
from bs4 import BeautifulSoup
html = requests.get("https://www.tce.sp.gov.br/jurisprudencia/exibir?proc=18955/989/20&offset=0")
soup = BeautifulSoup(html.content)
data = []
for e in soup.select('table:last-of-type tr:has(td)'):
d = dict(zip(it:=iter(soup.table.stripped_strings),it))
d.update({
'link': e.a.get('href'),
'date': e.select('td')[-2].text,
'type': e.select('td')[-1].text
})
data.append(d)
pd.DataFrame(data)
```
#### Output
| | N° Processo: | Autuação: | Parte 1: | Parte 2: | Matéria: | Exercício: | Objeto: | Relator: | link | date | type |
| | ------------ | --------- | -------- | -------- | -------- | ---------- | ------- | -------- | ---- | ---- | ---- |
| 0 | 18955/989/20 | 31/07/2020 | ELVES SCIARRETTA CARREIRA | PREFEITURA MUNICIPAL DE BRODOWSKI | RECURSO ORDINARIO | 2020 | Recurso Ordinário Protocolado em anexo. | EDGARD CAMARGO RODRIGUES | https://www2.tce.sp.gov.br/arqs_juri/pdf/810443.pdf | 16/03/2021 | Despacho |
| 1 | 18955/989/20 | 31/07/2020 | ELVES SCIARRETTA CARREIRA | PREFEITURA MUNICIPAL DE BRODOWSKI | RECURSO ORDINARIO | 2020 | Recurso Ordinário Protocolado em anexo. | EDGARD CAMARGO RODRIGUES | https://www2.tce.sp.gov.br/arqs_juri/pdf/801385.pdf | 20/01/2021 | Relatório / Voto |
| 2 | 18955/989/20 | 31/07/2020 | ELVES SCIARRETTA CARREIRA | PREFEITURA MUNICIPAL DE BRODOWSKI | RECURSO ORDINARIO | 2020 | Recurso Ordinário Protocolado em anexo. | EDGARD CAMARGO RODRIGUES | https://www2.tce.sp.gov.br/arqs_juri/pdf/801414.pdf | 20/01/2021 | Acórdão |
| null | CC BY-SA 4.0 | null | 2022-11-15T06:35:44.727 | 2022-11-15T18:04:52.970 | 2022-11-15T18:04:52.970 | 14,460,824 | 14,460,824 | null |
74,442,090 | 2 | null | 74,441,902 | 0 | null | Since Laravel 5.x allows attribute casting so it's possible to cast attributes to another data type for converting on runtime.
In this case, just declare a protected $casts property for example:
```
protected $casts = [
'tour_id' => 'array', // Will converted to (Array)
];
```
then store your ids like this
[](https://i.stack.imgur.com/MfNrw.png)
and finally search like this :
```
->whereJsonContains('tour_id', 3)->update([...]);
```
read more :
[JSON Where Clauses](https://laravel.com/docs/9.x/queries#json-where-clauses)
| null | CC BY-SA 4.0 | null | 2022-11-15T07:40:49.967 | 2022-11-15T07:40:49.967 | null | null | 8,509,638 | null |
74,442,097 | 2 | null | 74,441,902 | 0 | null | Assuming that you have a model for this table as `Tour` what you have to do is this:
```
$tours = Tour::select('tour_id')
foreach($tours as $tour) {
$tour->update([
tour_id = $whatever_id_to_update
]);
}
```
| null | CC BY-SA 4.0 | null | 2022-11-15T07:41:30.840 | 2022-11-15T07:41:30.840 | null | null | 12,138,592 | null |
74,442,190 | 2 | null | 74,442,073 | 1 | null | By the way, I solved my problem with:
```
temp3 = temp2[0].values
```
But I don't have any idea why I'm getting this warning!
| null | CC BY-SA 4.0 | null | 2022-11-15T07:53:03.627 | 2022-11-19T04:50:56.003 | 2022-11-19T04:50:56.003 | 11,833,435 | 12,079,456 | null |
74,442,256 | 2 | null | 74,420,805 | 0 | null | Just as the error indicates,what you need is this [package](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/metapackage-app?view=aspnetcore-5.0)(Microsoft.AspNetCore.App)
but what you installed was for asp.net mvc projects(Microsoft.AspNet.Mvc)
Asp.net and Asp.net core are not the same
If you want to migrate your old project to .net core ,you could follow this [document](https://learn.microsoft.com/en-us/aspnet/core/migration/proper-to-2x/?view=aspnetcore-7.0)
| null | CC BY-SA 4.0 | null | 2022-11-15T07:59:55.970 | 2022-11-15T08:06:54.550 | 2022-11-15T08:06:54.550 | 18,177,989 | 18,177,989 | null |
74,442,411 | 2 | null | 74,442,195 | 1 | null | A file input can only select from the local filesystem, so you can't pre-populate it with something from the server.
Use an `<img` tag to display existing images from the server.
For example, in your HTML form:
```
File:-
<input type="file" name="image"><br><br>
<input type="hidden" name="old_image" value="<?php echo $row['images'] ?>">
<img src="<?php echo "files/images/".$row['images']; ?>">
```
| null | CC BY-SA 4.0 | null | 2022-11-15T08:14:12.137 | 2022-11-15T13:57:54.830 | 2022-11-15T13:57:54.830 | 5,947,043 | 5,947,043 | null |
74,442,757 | 2 | null | 74,438,873 | 1 | null | It's not super clear what you want to do, maybe update the question with more details.
Nonetheless you are probably looking for either Wagtail's ModelAdmin feature that allows arbitrary editing, viewing and management of any model within the Wagtail admin.
[https://docs.wagtail.org/en/stable/reference/contrib/modeladmin/index.html](https://docs.wagtail.org/en/stable/reference/contrib/modeladmin/index.html)
You may also want to understand the way that Wagtail works with Modelcluster to allow for editing and managing of foreign key related models. This works in ModelAdmin and other parts of the editing interface.
[https://docs.wagtail.org/en/stable/reference/pages/panels.html#inline-panels](https://docs.wagtail.org/en/stable/reference/pages/panels.html#inline-panels)
| null | CC BY-SA 4.0 | null | 2022-11-15T08:44:48.223 | 2022-11-15T08:44:48.223 | null | null | 8,070,948 | null |
74,443,695 | 2 | null | 74,442,193 | 0 | null | As it was kindly suggested by m4no I dug a bit in the Chrome Dev Tools and found the CSS that was causing the underlining:
```
a:where(:not(.wp-element-button)) {
text-decoration: underline;
}
```
And changed it to
```
a:where(:not(.wp-element-button)) {
text-decoration: none;
}
```
in the Additional CSS which solved the problem.
| null | CC BY-SA 4.0 | null | 2022-11-15T09:59:39.953 | 2022-11-15T09:59:39.953 | null | null | 14,594,459 | null |
74,443,709 | 2 | null | 74,443,572 | 1 | null | One option would be to use `ggtext::element_markdown` and a custom function for the `labels` argument of the scale:
```
library(ggplot2)
library(ggtext)
color_axis_tick_label <- function(df, xaxis, xaxistick) {
ggplot(df, aes(x = as.factor({{ xaxis }}))) +
scale_x_discrete(
labels = ~ ifelse(.x %in% xaxistick,
paste0("<span style='color: red'>", .x, "</span>"), .x
)
) +
geom_bar() +
theme(axis.text.x = ggtext::element_markdown())
}
color_axis_tick_label(mtcars, cyl, 6)
```

| null | CC BY-SA 4.0 | null | 2022-11-15T10:00:45.127 | 2022-11-15T10:00:45.127 | null | null | 12,993,861 | null |
74,444,057 | 2 | null | 67,726,236 | 1 | null | maybe try
```
flutter run --web-renderer html --release
```
| null | CC BY-SA 4.0 | null | 2022-11-15T10:26:04.260 | 2022-11-15T10:26:04.260 | null | null | 20,449,673 | null |
74,444,205 | 2 | null | 74,442,737 | 0 | null | Your Model is more complex that I thought after seeing your data model. I made a small change in the code: My aim is to move the filter context from [OMS]_JOB_INFO_FOR_POWER_BI_MASTER_COST --> to Combine Payroll + Payout, traversing the immediate table: Please test this and let me know :)
```
% Grandtotal =
VAR TblSummary =
ADDCOLUMNS (
SUMMARIZE (
'Combine Payroll + Payout',
'[OMS]_JOB_INFO_FOR_POWER_BI_MASTER_COST'[Division]
),
"Total", CALCULATE ( SUM ( 'Combine Payroll + Payout'[SBS] ) ),
"%Percent",
DIVIDE (
CALCULATE ( SUM ( 'Combine Payroll + Payout'[SBS] ) ),
CALCULATE (
SUM ( 'Combine Payroll + Payout'[SBS] ),
ALL ( 'Combine Payroll + Payout' )
)
)
)
RETURN
SUMX ( TblSummary, [%Percent] )
```
| null | CC BY-SA 4.0 | null | 2022-11-15T10:38:19.457 | 2022-11-16T10:12:12.630 | 2022-11-16T10:12:12.630 | 19,469,088 | 19,469,088 | null |
74,444,345 | 2 | null | 74,390,064 | 0 | null | I think you what to add "?" on s
to be like this:
```
if ((s?.Contains(flag) == true))
{
//..
```
| null | CC BY-SA 4.0 | null | 2022-11-15T10:49:41.170 | 2022-11-15T10:49:41.170 | null | null | 1,609,232 | null |
74,444,464 | 2 | null | 74,444,352 | 2 | null | Looks like a `RPAD` function, e.g.
```
SQL> select
2 rpad(ename, 10, '.') name,
3 sal,
4 rpad('$', (sal/100), '$') money
5 from emp
6 where deptno = 30;
NAME SAL MONEY
---------- ---------- ------------------------------
ALLEN..... 1600 $$$$$$$$$$$$$$$$
WARD...... 1250 $$$$$$$$$$$$
MARTIN.... 1250 $$$$$$$$$$$$
BLAKE..... 2850 $$$$$$$$$$$$$$$$$$$$$$$$$$$$
TURNER.... 1500 $$$$$$$$$$$$$$$
JAMES..... 950 $$$$$$$$$
6 rows selected.
SQL>
```
| null | CC BY-SA 4.0 | null | 2022-11-15T10:58:31.757 | 2022-11-15T10:58:31.757 | null | null | 9,097,906 | null |
74,444,603 | 2 | null | 74,444,184 | 0 | null | What you need to do is to create or import a list of strings with the elements that you want to display:
```
List<String> cities = [London, Paris, Madrid];
```
And then provide the list[index] to Text Widget:
```
Padding(
padding: EdgeInsets.only(top: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: \[
Text(
cities[index], //add this
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600),
),
```
| null | CC BY-SA 4.0 | null | 2022-11-15T11:08:47.107 | 2022-11-15T11:08:47.107 | null | null | 16,973,338 | null |
74,444,719 | 2 | null | 74,442,681 | 1 | null | Your code is indeed not very nice.
Try this one
```
Sub convertSpilledRangeToTable(c As Range)
If c.HasSpill Then
Dim rg As Range
Set rg = c.cells(1,1).SpillParent.SpillingToRange
rg.Value = rg.Value 'this turns the formula into values
Dim ws As Worksheet: Set ws = rg.Parent
ws.ListObjects.Add xlSrcRange, rg, , xlYes
End If
End Sub
```
You can test it e.g. like this `convertSpilledRangeToTable Range("Sample_range")` where I assume "Sample_Range" to be G1 from the screenshot.
Or - if you already create the sub-tables via code - include it there.
| null | CC BY-SA 4.0 | null | 2022-11-15T11:16:04.307 | 2022-11-15T11:21:41.713 | 2022-11-15T11:21:41.713 | 16,578,424 | 16,578,424 | null |
74,444,851 | 2 | null | 65,564,876 | 0 | null | adding a batch normed output with another output which has not been passed via batch norm layer is not the right way to do things. It will defeat the whole purpose of using batch norm layer in the network. So yes, you need to add batch norm layer in the residual connection also
| null | CC BY-SA 4.0 | null | 2022-11-15T11:27:02.933 | 2022-11-15T11:27:02.933 | null | null | null | null |
74,445,122 | 2 | null | 74,444,184 | 0 | null | I had already made demo for such view,
It might help u...
here is a code
```
List<Map<String,dynamic>> maplist=[
{
'country':'America',
'imageurl':'lib/images/usa.jpg',
},
{
'country':'India',
'imageurl':'lib/images/india.jpg',
},
{
'country':'China',
'imageurl':'lib/images/china.jpg',
},
];
class _Stack2State extends State<Stack2> {
@override
Widget build(BuildContext context) {
return Container(
color: Colors.red,
height: 100,
child: ListView.builder(
scrollDirection: Axis.horizontal,
itemCount:maplist.length ,
itemBuilder: (context,index){
return MyCard(map: maplist[index],
);
}),
);
}
}
```
custom widget card
```
class MyCard extends StatelessWidget {
final Map<String, dynamic> map;
const MyCard({Key? key, required this.map}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
width: 160,
padding: EdgeInsets.only(left: 15),
margin: EdgeInsets.only(left: 15),
decoration: BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.circular(15),
image: DecorationImage(
image: AssetImage(map['imageurl']),
fit: BoxFit.cover,
opacity: 0.7,
),
),
child: Padding(
padding: EdgeInsets.only(top: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
map['country'],
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight
.
w600
),),],
),),);
}
}
```
| null | CC BY-SA 4.0 | null | 2022-11-15T11:48:26.103 | 2022-11-15T11:48:26.103 | null | null | 18,817,235 | null |
74,445,481 | 2 | null | 65,770,908 | 1 | null | I needed to change both texts so this method helped
```
$('#review-image').change(function(e) {
let fileName = (e.target.files.length > 0) ? e.target.files[0].name : 'choose_file_not';
$('#review-image-label').text(fileName);
});
```
```
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<div class="container mt-3">
<div class="input-group custom-file-button">
<label class="input-group-text" for="review-image" role="button">choose_file</label>
<label for="review-image" class="form-control" id="review-image-label" role="button">choose_file_not</label>
<input type="file" class="d-none" id="review-image" name="images[]" multiple accept="image/*">
</div>
</div>
```
| null | CC BY-SA 4.0 | null | 2022-11-15T12:16:43.443 | 2022-11-15T12:16:43.443 | null | null | 13,779,574 | null |
74,446,018 | 2 | null | 74,425,921 | 0 | null | I have created an Azure App Service with runtime stack `NODE`.
I am able to create and use the `User Scope` credentials.
In your `Azure App Service` => `Deployment Center` => `Local Git/FTPS credentials`.
Under `User scope` add the Username, Password and click on Save.


- Only username is visible.
- I have tried to connect by using this credential from local git.

In the `local terminal/ command prompt` run the below commands to push the local code.
```
git add .
git commit -m "First Commit"
git remote add azure https://YourSiteName.scm.azurewebsites.net:443/YourSiteName.git
git push azure master
```
Git Credential Manager will be prompted.

Provided the credentials which I have created in Azure App Service, able to login successfully.

| null | CC BY-SA 4.0 | null | 2022-11-15T12:58:01.017 | 2022-11-15T12:58:01.017 | null | null | 19,648,279 | null |
74,446,192 | 2 | null | 73,727,517 | -1 | null | Periodically, Apple will release a new developer license agreement that you need to sign before you can build new apps. [https://developer.apple.com/account](https://developer.apple.com/account) You will get a build failure/warnings if there is a pending license agreement to sign. Login to your Apple developer account to check if there's a new license agreement.
| null | CC BY-SA 4.0 | null | 2022-11-15T13:09:36.277 | 2022-11-15T13:09:36.277 | null | null | 14,476,890 | null |
74,446,549 | 2 | null | 7,491,603 | 0 | null | ```
button.setStyleSheet("QPushButton { border: none; }")
```
As said @RajaRaviVarma
| null | CC BY-SA 4.0 | null | 2022-11-15T13:33:26.357 | 2022-11-15T13:33:26.357 | null | null | 13,235,421 | null |
74,446,610 | 2 | null | 74,446,536 | 2 | null | After `)` in you need to open braces `{ }` since the content of the scaffold will be created right there. Inside the braces you can add `Text()` , `Button()` and your UI, the first parameters you defined is the `Scaffold` are the configurations of the `bottomBar`, `topBarand` `backgroundColor`.
If you Ctrl + click on the Scaffold composable you will see its definition:
```
@Composable
fun Scaffold(
modifier: Modifier = Modifier,
scaffoldState: ScaffoldState = rememberScaffoldState(),
topBar: @Composable () -> Unit = {},
bottomBar: @Composable () -> Unit = {},
snackbarHost: @Composable (SnackbarHostState) -> Unit = { SnackbarHost(it) },
floatingActionButton: @Composable () -> Unit = {},
floatingActionButtonPosition: FabPosition = FabPosition.End,
isFloatingActionButtonDocked: Boolean = false,
drawerContent: @Composable (ColumnScope.() -> Unit)? = null,
drawerGesturesEnabled: Boolean = true,
drawerShape: Shape = MaterialTheme.shapes.large,
drawerElevation: Dp = DrawerDefaults.Elevation,
drawerBackgroundColor: Color = MaterialTheme.colors.surface,
drawerContentColor: Color = contentColorFor(drawerBackgroundColor),
drawerScrimColor: Color = DrawerDefaults.scrimColor,
backgroundColor: Color = MaterialTheme.colors.background,
contentColor: Color = contentColorFor(backgroundColor),
content: @Composable (PaddingValues) -> Unit ...
```
As you can see, all the parameters are optional except for the content. The content should be created, that's why you need to add the braces at the end of the composable.
| null | CC BY-SA 4.0 | null | 2022-11-15T13:37:13.483 | 2022-11-24T00:26:15.453 | 2022-11-24T00:26:15.453 | 472,495 | 9,164,141 | null |
74,447,190 | 2 | null | 74,447,004 | 0 | null | I'd suggest using putting the checkbox and paragraph in a shared div and setting that to `display: flex;`
i.e:
```
<div class="class">
<fieldset>
<p>
</div>
```
---
```
.class {
display: flex;
justify-content: center;
align-items: center;
}
```
| null | CC BY-SA 4.0 | null | 2022-11-15T14:21:27.920 | 2022-11-15T14:32:50.750 | 2022-11-15T14:32:50.750 | 19,743,717 | 19,743,717 | null |
74,447,310 | 2 | null | 74,447,004 | 1 | null |
1. Input label text shouldn't be in a separate paragraph. I've added it to the actual label.
2. Override block display and 100% width on checkboxes (set by the external stylesheet).
Other protips:
- - -
```
@font-face {
font-family: museo-sans;
src: url(/fonts/museosans_300.otf) format("opentype");
font-display: auto;
font-style: normal;
font-weight: 300;
font-stretch: normal
}
@font-face {
font-family: museo-sans-bold;
src: url(/fonts/museosans_700.otf) format("opentype");
font-display: auto;
font-style: normal;
font-weight: 700;
font-stretch: normal
}
@font-face {
font-family: bwstretch;
src: url(/fonts/BWSTRETCH-BLACK.OTF) format("opentype");
font-display: auto;
font-style: normal;
font-weight: 800;
font-stretch: normal
}
h2 {
font-family: bwstretch;
text-align: center;
text-transform: uppercase;
font-size: 2em !important;
}
* {
margin: 0;
padding: 0;
border: none;
font-family: museo-sans;
color: #ffc860;
}
body {
font-size: 1em;
background-color: #191f43;
font-family: museo-sans;
}
#wrapper {
width: 80% overflow: auto;
/* will contain if #first is longer than #second */
background-color: #191f43;
}
#first {
width: 40%;
float: left;
/* add this */
padding-left: 5%;
background-color: #191f43;
}
#mc_embed_signup {
width: 60% float:left;
/* add this */
overflow: hidden;
/* if you don't want #second to wrap below #first */
background-color: #191f43;
color: #ffc860;
font-family: museo-sans;
}
#mc_embed_signup .mc-field-group input[type=checkbox] {
width: auto;
display: inline-block;
}
#mergeRow-gdpr {
margin-top: 20px;
}
#mergeRow-gdpr fieldset label {
font-weight: normal;
}
#mc-embedded-subscribe-form .mc_fieldset {
border: none;
min-height: 0px;
padding-bottom: 0px;
}
```
```
<body>
<!-- Start MailChimp stuff -->
<!-- Begin Mailchimp Signup Form -->
<link href="//cdn-images.mailchimp.com/embedcode/classic-071822.css" rel="stylesheet" type="text/css">
<div id="wrapper">
<div id="first"><img src="https://via.placeholder.com/100"></div>
<div id="mc_embed_signup">
<form action="https://opipets.us17.list-manage.com/subscribe/post?u=3fa8d83aedc08e2a8814c787c&id=27f9c81072&v_id=4140&f_id=00bb56e0f0" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank"
novalidate>
<div id="mc_embed_signup_scroll">
<h2>Join our Whitelist</h2>
<div class="indicates-required"><span class="asterisk">*</span> indicates required</div>
<div class="mc-field-group">
<label for="mce-EMAIL">Email Address <span class="asterisk">*</span>
</label>
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL" required>
</div>
<div id="mergeRow-gdpr" class="mergeRow gdpr-mergeRow content__gdprBlock mc-field-group">
<div class="content__gdpr">
<fieldset class="mc_fieldset gdprRequired mc-field-group" name="interestgroup_field">
<label class="checkbox subfield" for="gdpr_90860"><input type="checkbox" id="gdpr_90860" name="gdpr[90860]" value="Y" class="av-checkbox gdpr"> I agree to receive email communications from Opis Group Ltd</label>
</fieldset>
<p>Your privacy is our policy. Occasionally, we'll contact you about our products and services, and other content that may be of interest. You can unsubscribe at any time.</p>
</div>
<div class="content__gdprLegal">
<p>We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. <a href="https://mailchimp.com/legal/terms" target="_blank">Learn more about Mailchimp's privacy practices here.</a></p>
</div>
</div>
<div hidden="true"><input type="hidden" name="tags" value="6456416,6456520"></div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div>
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_3fa8d83aedc08e2a8814c787c_27f9c81072" tabindex="-1" value=""></div>
<div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
</div>
</form>
</div>
</div>
<script type='text/javascript' src='//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js'></script>
<script type='text/javascript'>
(function($) {
window.fnames = new Array();
window.ftypes = new Array();
fnames[0] = 'EMAIL';
ftypes[0] = 'email';
}(jQuery));
var $mcj = jQuery.noConflict(true);
</script>
<!--End mc_embed_signup-->
<!-- End MailChimp stuff -->
</body>
```
| null | CC BY-SA 4.0 | null | 2022-11-15T14:30:49.513 | 2022-11-15T14:30:49.513 | null | null | 1,264,804 | null |
74,447,398 | 2 | null | 74,447,004 | 1 | null | So all i did was wrap it in a span and then flex'ed it. Hope this helped!
```
@font-face {
font-family: museo-sans;
src: url(/fonts/museosans_300.otf) format("opentype");
font-display: auto;
font-style: normal;
font-weight: 300;
font-stretch: normal
}
@font-face {
font-family: museo-sans-bold;
src: url(/fonts/museosans_700.otf) format("opentype");
font-display: auto;
font-style: normal;
font-weight: 700;
font-stretch: normal
}
@font-face {
font-family: bwstretch;
src: url(/fonts/BWSTRETCH-BLACK.OTF) format("opentype");
font-display: auto;
font-style: normal;
font-weight: 800;
font-stretch: normal
}
h2 {
font-family: bwstretch;
text-align: center;
text-transform: uppercase;
font-size: 2em !important;
}
* {
margin: 0;
padding: 0;
border: none;
font-family: museo-sans;
color: #ffc860;
}
body {
font-size: 1em;
background-color: #191f43;
font-family: museo-sans;
}
#wrapper {
width: 80%;
overflow: auto; /* will contain if #first is longer than #second */
background-color: #191f43;
}
#first {
width: 40%;
float:left; /* add this */
padding-left: 5%;
background-color: #191f43;
}
#mc_embed_signup {
width: 60%;
float:left; /* add this */
overflow: hidden; /* if you don't want #second to wrap below #first */
background-color: #191f43;
color: #ffc860;
font-family: museo-sans;
}
#mc-embedded-subscribe-form input[type=checkbox]{
display: flex;
width: auto;
}
#mergeRow-gdpr {
margin-top: 20px;
}
#mergeRow-gdpr fieldset label {
font-weight: normal;
}
#mc-embedded-subscribe-form .mc_fieldset{
border:none;
min-height: 0px;
padding-bottom:0px;}
span{
display: flex;
align-items: center;
}
```
```
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/assets/signup.css">
</head>
<body>
<!-- Start MailChimp stuff -->
<!-- Begin Mailchimp Signup Form -->
<link href="//cdn-images.mailchimp.com/embedcode/classic-071822.css" rel="stylesheet" type="text/css">
<div id="wrapper">
<div id="first"><img src="images/genesis.gif"></div>
<div id="mc_embed_signup">
<form
action="https://opipets.us17.list-manage.com/subscribe/post?u=3fa8d83aedc08e2a8814c787c&id=27f9c81072&v_id=4140&f_id=00bb56e0f0"
method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate"
target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<h2>Join our Whitelist</h2>
<div class="indicates-required"><span class="asterisk">*</span> indicates required</div>
<div class="mc-field-group">
<label for="mce-EMAIL">Email Address <span class="asterisk">*</span>
</label>
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL" required>
</div>
<div id="mergeRow-gdpr" class="mergeRow gdpr-mergeRow content__gdprBlock mc-field-group">
<div class="content__gdpr">
<--! Span opening -->
<span>
<label class="checkbox subfield" for="gdpr_90860"><input type="checkbox"
id="gdpr_90860" name="gdpr[90860]" value="Y"
class="av-checkbox gdpr"></label>
<p>I agree to receive email communications from Opis Group Ltd</p>
</span>
<--! Span closing -->
<br>
<fieldset class="mc_fieldset gdprRequired mc-field-group" name="interestgroup_field">
</fieldset>
<p>Your privacy is our policy. Occasionally, we'll contact you about our products and
services, and other content that may be of interest. You can unsubscribe at any time.
</p>
</div>
<div class="content__gdprLegal">
<p>We use Mailchimp as our marketing platform. By clicking below to subscribe, you
acknowledge that your information will be transferred to Mailchimp for processing. <a
href="https://mailchimp.com/legal/terms" target="_blank">Learn more about
Mailchimp's privacy practices here.</a></p>
</div>
</div>
<div hidden="true"><input type="hidden" name="tags" value="6456416,6456520"></div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div>
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text"
name="b_3fa8d83aedc08e2a8814c787c_27f9c81072" tabindex="-1" value=""></div>
<div class="clear"><input type="submit" value="Subscribe" name="subscribe"
id="mc-embedded-subscribe" class="button"></div>
</div>
</form>
</div>
</div>
<script type='text/javascript' src='//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js'></script>
<script type='text/javascript'>
(function ($) {
window.fnames = new Array();
window.ftypes = new Array();
fnames[0] = 'EMAIL';
ftypes[0] = 'email';
}(jQuery));
var $mcj = jQuery.noConflict(true);
</script>
<!--End mc_embed_signup-->
<!-- End MailChimp stuff -->
</body>
</html>
```
| null | CC BY-SA 4.0 | null | 2022-11-15T14:36:52.867 | 2022-11-15T14:40:03.953 | 2022-11-15T14:40:03.953 | 19,295,912 | 19,295,912 | null |
74,447,627 | 2 | null | 74,447,371 | 0 | null | If I understand your question correctly, you can simply do the following:
```
import pandas as pd
orders = pd.read_csv('orderparameters.csv')
responses = pd.DataFrame(Client.new_order(...) for _ in range(len(orders)))
```
| null | CC BY-SA 4.0 | null | 2022-11-15T14:50:38.927 | 2022-11-15T14:50:38.927 | null | null | 10,258,933 | null |
74,447,684 | 2 | null | 74,447,400 | 1 | null | You have DataBinding/ViewBinding enabled but you are not actually using it.
```
buildFeatures {
dataBinding true
viewBinding true
}
```
You are "normally" inflating the view:
```
LayoutInflater.from(context).inflate(R.layout.row_items, parent, false)
```
If you wish to use ViewBinding for this you need to inflate it with it.
```
RowItemBinding.inflate(LayoutInflater.from(context), parent, false)
```
and pass that instance to the ViewHolder so it can see it as ViewBinding
```
class ViewHolder(itemView: RowItemsBinding) : RecyclerView.ViewHolder(itemView.root)
```
| null | CC BY-SA 4.0 | null | 2022-11-15T14:53:56.573 | 2022-11-15T15:25:45.957 | 2022-11-15T15:25:45.957 | 3,434,763 | 3,434,763 | null |
74,447,686 | 2 | null | 74,447,400 | 1 | null | You are not using viewbinding in this class.
`itemView` is just a `View` like any, it doesn't have fields called `userId` or `title`
You can probably do this for example to fix the error.
```
init {
userId = itemView.findViewById<TextView>(R.id.userId)
title = itemView.findViewById<TextView>(R.id.title)
}
```
Or to use viewbinding instead, change the `onCreateViewHolder` to
```
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
var itemView = RowItemsBinding.inflate(LayoutInflater.from(parent.context), parent, false)
return ViewHolder(itemView)
}
```
And change the `ViewHolder` to
```
class ViewHolder(itemView: RowItemsBinding): RecyclerView.ViewHolder(itemView.root) {
var userId: TextView
var title: TextView
init {
userId = itemView.userId
title = itemView.title
}
}
```
| null | CC BY-SA 4.0 | null | 2022-11-15T14:53:56.767 | 2022-11-15T14:53:56.767 | null | null | 1,514,861 | null |
74,447,871 | 2 | null | 74,447,373 | 0 | null | This doesn't exactly match what you are looking for, but further data analysis might be easier formatted this way
```
library(tidyverse)
df = read_csv("Downloads/test.csv")
df = df %>% group_by(Transaction, Item) %>% summarize(count_value = n())
result = df %>% pivot_wider(names_from = "Item", values_from = "count_value", values_fill = 0)
```
| null | CC BY-SA 4.0 | null | 2022-11-15T15:06:27.540 | 2022-11-15T15:06:27.540 | null | null | 20,511,302 | null |
74,447,928 | 2 | null | 74,447,004 | 0 | null | Wrap your & one container apply flex
```
<div style="display:flex">
<input type="checkbox">
<p>I agree to receive email communications from Opis Group Ltd</p>
</div>
```
| null | CC BY-SA 4.0 | null | 2022-11-15T15:09:49.680 | 2022-11-15T15:09:49.680 | null | null | 20,321,054 | null |
74,447,933 | 2 | null | 74,447,761 | 3 | null | This particular error happens because you cannot take the square root of a vector, since it does not make sense mathematically.
But you take the square root of each element separately. To do that add a dot to the `sqrt` function call:
```
sqrt.(1 .- 4*t^2*g .^2)
```
But you should really add more dots on that line to save some temporary allocations. You can do that with the `@.` macro instead of dotting everything by hand, like this:
```
Gsemi = @. (1 / (g*2*t^2) * (1 - sqrt(1 - 4*t^2*g^2)))
```
Now, all operations will be element-wise.
Also, make sure to put your code inside a function.
| null | CC BY-SA 4.0 | null | 2022-11-15T15:10:03.037 | 2022-11-15T15:10:03.037 | null | null | 2,749,865 | null |
74,447,958 | 2 | null | 74,447,519 | 1 | null | This does not look like a data frame, but rather a 3D array. That being the case, we can get the lower triangle of each slice, bind the resulting vectors together and transpose:
```
lapply(asplit(df, 3), \(x) setNames(x[lower.tri(x)], c('AB', 'AC', 'BC'))) |>
as.data.frame(check.names = FALSE) |> t()
#> AB AC BC
#> 2020-10-03 0.95727700 3.361026 8.420407
#> 2020-10-04 0.21065290 5.875128 8.678178
#> 2020-10-05 0.02922629 5.234718 5.109506
```
[reprex v2.0.2](https://reprex.tidyverse.org)
---
```
df <- structure(c(0, 0.957277, 3.361026, 0.957277, 0, 8.420407, 3.361026,
8.420407, 0, 0, 0.2106529, 5.8751284, 0.2106529, 0, 8.6781781,
5.875128, 8.678178, 0, 0, 0.02922629, 5.23471797, 0.02922629,
0, 5.10950603, 5.234718, 5.109506, 0), .Dim = c(3L, 3L, 3L), .Dimnames = list(
c("A", "B", "C"), c("A", "B", "C"), c("2020-10-03", "2020-10-04",
"2020-10-05")))
df
#> , , 2020-10-03
#>
#> A B C
#> A 0.000000 0.957277 3.361026
#> B 0.957277 0.000000 8.420407
#> C 3.361026 8.420407 0.000000
#>
#> , , 2020-10-04
#>
#> A B C
#> A 0.0000000 0.2106529 5.875128
#> B 0.2106529 0.0000000 8.678178
#> C 5.8751284 8.6781781 0.000000
#>
#> , , 2020-10-05
#>
#> A B C
#> A 0.00000000 0.02922629 5.234718
#> B 0.02922629 0.00000000 5.109506
#> C 5.23471797 5.10950603 0.000000
```
| null | CC BY-SA 4.0 | null | 2022-11-15T15:11:10.367 | 2022-11-15T15:11:10.367 | null | null | 12,500,315 | null |
74,448,020 | 2 | null | 74,447,092 | 0 | null | The records in you file should really represent object so your class name shouldn't be a plural, but if your ctor is right, you can just do:
```
List<ListClasses> data = Files.lines(Paths.get(pathToDataFile)).map(ListClasses::new).collect(Collectors.toList());
```
| null | CC BY-SA 4.0 | null | 2022-11-15T15:15:25.577 | 2022-11-15T15:15:25.577 | null | null | 16,376,827 | null |
74,448,069 | 2 | null | 74,447,373 | 0 | null | I pivot data this way:
```
library(tidyverse)
df <- data.frame(Transaction=c(1,2,2),
Item=c("Apple", "Banana", "Coconut"))
df
df <- df %>%
group_by(Transaction) %>%
mutate(ItemNumber=paste0("Item", row_number()))
df
df <- df %>%
pivot_wider(names_from = ItemNumber,
values_from = Item)
df
# Transaction Item1 Item2
#1 1 Apple NA
#2 2 Banana Coconut
```
| null | CC BY-SA 4.0 | null | 2022-11-15T15:18:49.817 | 2022-11-15T15:18:49.817 | null | null | 10,276,092 | null |
74,448,512 | 2 | null | 74,448,326 | 0 | null | Trial 1: Try downgrading your vs-code version and check if problem still persists.
Trial 2: Assuming you don't have code runner, Try installing code runner extension in vs-code and use that for running your program
| null | CC BY-SA 4.0 | null | 2022-11-15T15:49:48.063 | 2022-11-15T15:49:48.063 | null | null | 17,074,626 | null |
74,448,899 | 2 | null | 74,448,326 | 1 | null | If you can't run any code inside VSCode it's most likely the lack of needed extensions causing the problem, you can download extensions by going to the extension menu with `ctrl + shift + x` and if you are connected to the internet, VSCode will show recommended extensions for you.
About the problem that you can't run a python file outside of the C: drive, I think that the anonymity of your python executor to the CMD is causing this problem.
The easiest way to fix it is to uninstall your python executable with its own installer (the setup.exe file which you installed python with, it can uninstall python too) and installing it again , then you may be able to run the python executable everywhere with this command:
```
python example.py
```
After installing c/c++ extension you might want to go to the extension you downloaded and look under the extension name for other c/c++ extensions you want to install too.
To make intellisense and built-in c/c++ code execution work, download Microsoft's c/c++ extension for the best experience.
May this help you!
| null | CC BY-SA 4.0 | null | 2022-11-15T16:17:05.717 | 2022-11-20T12:28:18.633 | 2022-11-20T12:28:18.633 | 442,760 | 20,510,770 | null |
74,449,565 | 2 | null | 30,709,211 | 0 | null | I was also getting the same error. I installed git from [here](https://git-scm.com/downloads). And then tried to install tortoisegit, it worked.
| null | CC BY-SA 4.0 | null | 2022-11-15T17:03:56.663 | 2022-11-15T17:03:56.663 | null | null | 6,527,049 | null |
74,449,570 | 2 | null | 74,448,926 | 0 | null | I would much rather have a minimally reproducible sample code to use. I'm blindly going by your code sample above, and your description. I added a `CASE` expression to your CTE. Then in the main `SELECT`, I order by the `CASE` expression and add `TOP 1` to make sure we only get one row. The only issue I'm not completely knowledgeable on is weather calling `GETDATE()` twice will always produce the same result as I used it.:
```
WITH CTE AS (
SELECT
ROW_NUMBER () over (partition by ST_ID, STJ_JOUR order by A.STJH_DATE_ACTION DESC) as RN
, *
, CASE
WHEN [STJH_DATE_ACTION] = GETDATE() THEN 1
WHEN [STJH_DATE_ACTION] < GETDATE() THEN 0
END as isCurrent
FROM bloc.W_TMD_JOUR_HISTORIQUE A
)
SELECT TOP 1
CTE.*
FROM CTE
WHERE
CTE.ST_ID = 268
AND CTE.STJ_JOUR = 1
ORDER BY CTE.isCurrent DESC
```
Update: `CASE` "expressions" not statements.
| null | CC BY-SA 4.0 | null | 2022-11-15T17:04:14.447 | 2022-11-16T14:24:14.553 | 2022-11-16T14:24:14.553 | 2,452,207 | 2,452,207 | null |
74,449,618 | 2 | null | 74,449,046 | 1 | null | You can use package to save the token on local storage.
- [https://pub.dev/packages/shared_preferences](https://pub.dev/packages/shared_preferences)- [https://pub.dev/packages/flutter_secure_storage](https://pub.dev/packages/flutter_secure_storage)
Example using flutter secure storage
```
await storage.write(key: token, value: tokenValue);
```
| null | CC BY-SA 4.0 | null | 2022-11-15T17:08:43.950 | 2022-11-15T17:08:43.950 | null | null | 15,649,348 | null |
74,450,054 | 2 | null | 12,417,009 | 0 | null | You can set the sliceVisibilityThreshold: equal to 0 to disable it. You should pass it through a options var. 0.00001 > 0
```
var options = {
title: 'Popularity of Types of Pizza',
sliceVisibilityThreshold: 0
};
var chart = new
google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, options);
```
| null | CC BY-SA 4.0 | null | 2022-11-15T17:44:50.840 | 2022-11-15T17:44:50.840 | null | null | 20,512,768 | null |
74,450,239 | 2 | null | 74,450,189 | 1 | null | Disable the real-time antivirus monitoring. It's a [known issue](https://github.com/microsoft/WSL/issues/8995).
| null | CC BY-SA 4.0 | null | 2022-11-15T18:00:49.717 | 2022-11-15T18:00:49.717 | null | null | 104,891 | null |
74,450,427 | 2 | null | 74,442,985 | 1 | null | As it is explained in [this askubuntu.com question](https://askubuntu.com/q/1115564) the reason is that you are accessing an NTFS partition from WSL. NTFS does not support the `chmod` call. However, if you were working on Ubuntu, this is hidden and the call succeeds even if it does not do anything. On WSL on the other hand the call results in an error, which is what you see.
The solutions outlined on the above mentioned page are:
-
```
sudo umount /mnt/c
sudo mount -t drvfs C: /mnt/c -o metadata
```
(modify according to your partition and drive letter)
- `/etc/wsl.conf`
```
[automount]
options = "metadata"
```
(reboot to see the effects)
-
| null | CC BY-SA 4.0 | null | 2022-11-15T18:14:56.417 | 2022-11-15T18:14:56.417 | null | null | 10,171,966 | null |
74,450,489 | 2 | null | 74,447,435 | 0 | null | The root of the error is in your delete method, specifically in the scenario when you are deleting the element at `pos` 0.
Let’s look at what your list structure is after all of your inserts:
```
null <- 12 -> 67
12 <- 67 -> 55
67 <- 55 -> 23
55 <- 23 -> 6
23 <- 6 -> null
Head -> 12
Tail -> 6
```
Now, let’s go through the steps in removing the element at position 0:
1. Node node = this.head. So we store the 12 node in head.
2. this.head = node.next. We are now setting the head node to the next of node which will be 67
3. this.tail = node.next. This is where it starts going wrong. node is still the 12 node. We are thus setting the tail node to the node that follows 12 which is again 67.
4. node.next = null. Finally, we are setting the next of the 12 node to null
Now if we look at the data structure again, we see:
```
null <- 12 -> null
12 <- 67 -> 55
67 <- 55 -> 23
55 <- 23 -> 6
23 <- 6 -> null
Head -> 67
Tail -> 67
```
And when you call the insert function, it sets the next of the tail node to the new node. Thus we end up with:
```
null <- 12 -> null
12 <- 67 -> -999
67 <- 55 -> 23
55 <- 23 -> 6
23 <- 6 -> null
67 <- -999 -> null
Head -> 67
Tail -> -999
```
And when you call `printAll`, you find that it prints the `head`, `67`, followed by it’s `next` which is now `-999` and then halts (`-999`’s `next` is `null`)
| null | CC BY-SA 4.0 | null | 2022-11-15T18:20:17.517 | 2022-11-15T18:20:42.543 | 2022-11-15T18:20:42.543 | 7,362,694 | 7,362,694 | null |
74,450,890 | 2 | null | 74,422,975 | 0 | null | I have done small changes in `docker-compose.yml` file, please use this one. It is working fine.
```
version: "3.8"
services:
mysqldb:
image: mysql:5.7
container_name: MYSQL_DB
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=baskartest
ports:
- 3307:3306
app:
build: ./bezkoder-app
restart: on-failure
ports:
- 8084:8080
environment:
- SPRING_DATASOURCE_URL=jdbc:mysql://MYSQL_DB:3306/baskartest
- SPRING_DATASOURCE_USERNAME=root
- SPRING_DATASOURCE_PASSWORD=root
- SPRING_JPA_HIBERNATE_DDL_AUTO=update
depends_on:
- mysqldb
```
| null | CC BY-SA 4.0 | null | 2022-11-15T18:59:16.047 | 2022-11-15T18:59:16.047 | null | null | 7,871,511 | null |
74,451,074 | 2 | null | 65,503,305 | 1 | null | For the main content put all the different view into a and put it into `PageView`. And create a custom navigator and put these two widget into a Row:
## Controller:
```
class SettingsController extends GetxController {
final PageController pageController =
PageController(initialPage: 1, keepPage: true);
}
```
## Sidebar:
```
class MySideNavigation extends StatefulWidget {
MySideNavigation({Key? key}) : super(key: key);
@override
State<MySideNavigation> createState() => _MySideNavigationState();
}
class _MySideNavigationState extends State<MySideNavigation> {
@override
Widget build(BuildContext context) {
final SettingsController c = Get.find();
return NavigationRail(
selectedIndex: c.selectedViewIndex.value,
onDestinationSelected: (value) async {
setState(() {
c.selectedViewIndex(value);
c.pageController.jumpToPage(
value,
// duration: Duration(milliseconds: 500), curve: Curves.decelerate
);
});
},
labelType: NavigationRailLabelType.selected,
destinations: const <NavigationRailDestination>[
NavigationRailDestination(
icon: Icon(Icons.map_outlined),
selectedIcon: Icon(Icons.map_rounded),
label: Text(
'نقشه ها',
style: TextStyle(fontSize: 14, fontFamily: 'Vazir'),
),
),
NavigationRailDestination(
icon: Icon(Icons.map_outlined),
selectedIcon: Icon(Icons.map_rounded),
label: Text(
'نقشه ها',
style: TextStyle(fontSize: 14, fontFamily: 'Vazir'),
),
),
NavigationRailDestination(
icon: Icon(Icons.person_outline),
selectedIcon: Icon(Icons.person),
label: Text(
'پروفایل',
style: TextStyle(fontSize: 14, fontFamily: 'Vazir'),
),
),
],
);
}
}
```
## GotFatherView:
```
class GodFatherView extends StatelessWidget {
GodFatherView({Key? key}) : super(key: key);
final PageStorageBucket bucket = PageStorageBucket();
final SettingsController c = Get.find();
List<Widget> pages = [
const KeepAlivePage(Page1()),
KeepAlivePage(Page2()),
const KeepAlivePage(Page3()),
];
@override
Widget build(BuildContext context) {
return Scaffold(
body: Row(
children: [
MySideNavigation(),
Expanded(
child: PageView(
controller: c.pageController,
children: pages,
),
)
],
));
}
}
```
tap on below link to open screenshot: I don't have enough reputation to post image :))))))
[Screeshot](https://i.stack.imgur.com/pkDbE.png)
```
NavigationRail(
selectedIndex: c.selectedViewIndex.value,
onDestinationSelected: (value) async {
setState(() {
c.pageController.jumpToPage(value);
});
},
```
When user tap on each `NavigationRailDestination` ,`onDestinationSelected` function will be called with an index. The index are representing the index of the destination view. Example: When user on `[Page1() -> index:0]` tab on the second `NavigationRailDestination` the index inside of function is `1`, so you can use the PageController to navigate into `[Page2() -> index:1]`.
# Attention, Attention, More Attention:
If you don't like to lose the state(I mean when u navigate to another view and back to previous view don't rebuild it again). Sometimes we need to keep the state of widget, we change something, write something into a text field and etc. If you don't wrap it with this widget all the data will be loosed(or you can save it through another way).
Wrap your widget with this Widget see the `GodFather` View I wrap all pages with `KeepAlivePage`, In this widget I extend State of the widget with 'AutomaticKeepAliveClientMixin' and override its value `bool get wantKeepAlive => true;` .
```
import 'package:flutter/material.dart';
class KeepAlivePage extends StatefulWidget {
const KeepAlivePage(this.child, {Key? key}) : super(key: key);
final child;
@override
State<KeepAlivePage> createState() => _KeepAlivePageState();
}
class _KeepAlivePageState extends State<KeepAlivePage>
with AutomaticKeepAliveClientMixin {
@override
Widget build(BuildContext context) {
super.build(context);
return widget.child;
}
@override
// TODO: implement wantKeepAlive
bool get wantKeepAlive => true;
}
```
| null | CC BY-SA 4.0 | null | 2022-11-15T19:19:06.557 | 2022-11-15T20:58:36.333 | 2022-11-15T20:58:36.333 | 13,251,344 | 13,251,344 | null |
74,451,281 | 2 | null | 74,450,642 | 0 | null | You could do this a couple of different ways:
## Filter inside ggplot call
```
ggplot(pumpkin_data %>% filter(country %in% c("United States", "United Kingdom")),aes(weight_lbs,country)) +
geom_boxplot()
```
## Filter before ggplot call
```
pumpkin_data_subset <- pumpkin_data %>% filter(country %in% c("United States", "United Kingdom"))
ggplot(pumpkin_data_subset,aes(weight_lbs,country)) +
geom_boxplot()
```
| null | CC BY-SA 4.0 | null | 2022-11-15T19:40:44.880 | 2022-11-15T19:40:44.880 | null | null | 20,511,302 | null |
74,451,297 | 2 | null | 74,451,156 | 0 | null | [I've blogged about the process on how to do this](https://jessehouwing.net/azure-devops-git-setting-default-repository-permissions/), not on the REST API perse, but using the `az devops` CLI.
The process is quite complex, since the permission model of Azure DevOps uses GUIDs and tokens for the permissions, users and access control list items.
`az devops` calls the REST API under the hood, you could use fiddler to have a peek at the REST calls that are made to achieve the same thing.
The general process looks like this:
```
$subject = az devops security group list `
--org "https://dev.azure.com/$org/" `
--scope organization `
--subject-types vssgp `
--query "graphGroups[[email protected] == '[$org]\Project Collection Administrators'].descriptor | [0]"
$namespaceId = az devops security permission namespace list `
--org "https://dev.azure.com/$org/" `
--query "[[email protected] == 'Git Repositories'].namespaceId | [0]"
$bit = az devops security permission namespace show `
--namespace-id $namespaceId `
--org "https://dev.azure.com/$org/" `
--query "[0].actions[[email protected] == 'PullRequestBypassPolicy'].bit | [0]"
az devops security permission update `
--id $namespaceId `
--subject $subject `
--token "repoV2/" `
--allow-bit $bit `
--merge true `
--org https://dev.azure.com/$org/
```
The token is made up of a number of identifiers:
```
repoV2/daec401a-49b6-4758-adb5-3f65fd3264e3/f59f38e0-e8c4-45d5-8dee-0d20e7ada1b7/refs/heads/6600650061007400750072006500/6d0069006e006500
^ ^ ^ ^
| | | |
| | | -- The branch
| | -- The Git Repository
| -- The Team Project Guid
|
-- The root object (Repositories)
```
This sets the permissions for all git repos, the blog contains the code to generate a `--token` for a specific branch:
```
function hexify($string) {
return ($string | Format-Hex -Encoding Unicode | Select-Object -Expand Bytes | ForEach-Object { '{0:x2}' -f $_ }) -join ''
}
$branch = "feature/mine"
$split = $branch.Split("/")
$hexBranch = ($split | ForEach-Object { hexify -string $_ }) -join "/"
$token = "refs/heads/$hexBranch"
refs/heads/6600650061007400750072006500/6d0069006e006500
```
| null | CC BY-SA 4.0 | null | 2022-11-15T19:42:26.863 | 2022-11-15T19:49:26.533 | 2022-11-15T19:49:26.533 | 736,079 | 736,079 | null |
74,451,305 | 2 | null | 74,450,712 | 3 | null | For Mondays we can create a list of Mondays between the dates in the dataframe, join it with the data in long format, count number of the Mondays for each variable in each month, divide the values by the number of Mondays, and revert back the format to wide;
```
library(dplyr)
library(tidyr)
library(lubridate)
```
```
all_dates <- as.Date(names(df1)[-1])
MON <- seq(min(floor_date(all_dates, "month")),
max(ceiling_date(all_dates, "month")),
by="1 day") %>%
.[wday(.,label = TRUE) == "Mon"] %>%
data.frame("Mondays" = .) %>%
mutate(mmm = format(Mondays, "%Y-%m"))
df1 %>%
pivot_longer(cols = -`Row Labels`, names_to = "dates") %>%
mutate(dates = as.Date(dates),
mmm = format(dates, "%Y-%m")) %>%
right_join(MON, by = "mmm") %>%
arrange(mmm) %>%
group_by(`Row Labels`, dates) %>%
mutate(value = value / n()) %>%
ungroup() %>%
select(`Row Labels`, Mondays, value) %>%
pivot_wider(`Row Labels`, names_from = "Mondays", values_from = "value")
```
```
#> # A tibble: 4 x 14
#> `Row Labels` `2022-11-07` `2022-11-14` `2022-11-21` `2022-11-28` `2022-12-05`
#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 X6 25 25 25 25 40
#> 2 X7 50 50 50 50 50
#> 3 X8 75 75 75 75 75
#> 4 X9 100 100 100 100 100
#> # ... with 8 more variables: 2022-12-12 <dbl>, 2022-12-19 <dbl>,
#> # 2022-12-26 <dbl>, 2023-01-02 <dbl>, 2023-01-09 <dbl>, 2023-01-16 <dbl>,
#> # 2023-01-23 <dbl>, 2023-01-30 <dbl>
```
Same principal goes to doing it weekly:
```
WKLY <- seq(min(floor_date(all_dates, "month")),
max(ceiling_date(all_dates, "month")),
by="week") %>%
data.frame("Weekly" = .) %>%
mutate(mmm = format(Weekly, "%Y-%m"))
df1 %>%
pivot_longer(cols = -`Row Labels`, names_to = "dates") %>%
mutate(dates = as.Date(dates),
mmm = format(dates, "%Y-%m")) %>%
right_join(WKLY, by = "mmm") %>%
arrange(mmm) %>%
group_by(`Row Labels`, dates) %>%
mutate(value = value / n()) %>%
ungroup() %>%
select(`Row Labels`, Weekly, value) %>%
pivot_wider(`Row Labels`, names_from = "Weekly", values_from = "value")
```
```
#> # A tibble: 4 x 15
#> `Row Labels` `2022-11-01` `2022-11-08` `2022-11-15` `2022-11-22` `2022-11-29`
#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 X6 20 20 20 20 20
#> 2 X7 40 40 40 40 40
#> 3 X8 60 60 60 60 60
#> 4 X9 80 80 80 80 80
#> # ... with 9 more variables: 2022-12-06 <dbl>, 2022-12-13 <dbl>,
#> # 2022-12-20 <dbl>, 2022-12-27 <dbl>, 2023-01-03 <dbl>, 2023-01-10 <dbl>,
#> # 2023-01-17 <dbl>, 2023-01-24 <dbl>, 2023-01-31 <dbl>
```
#### Data:
```
df1 <- structure(list(`Row Labels` = c("X6", "X7", "X8", "X9"),
`2022-11-01` = c(100, 200, 300, 400),
`2022-12-01` = c(160, 200, 300, 400),
`2023-01-01` = c(500, 550, 600, 650)),
class = c("tbl_df", "tbl", "data.frame"),
row.names = c(NA, -4L))
```
| null | CC BY-SA 4.0 | null | 2022-11-15T19:43:18.997 | 2022-11-15T19:50:08.467 | 2022-11-15T19:50:08.467 | 6,461,462 | 6,461,462 | null |
74,451,464 | 2 | null | 74,451,395 | 0 | null | After opening the dropdown, use the text of the option to select it
```
cy.get(selector-for-dropdown).click() // open dropdown
cy.contains('[role="option"]', 'Supervisor').click() // select an option by text
```
| null | CC BY-SA 4.0 | null | 2022-11-15T19:58:07.977 | 2022-11-15T19:58:07.977 | null | null | 18,366,749 | null |
74,451,566 | 2 | null | 74,451,373 | 0 | null | The issue, as I see it, is that you've made a mistake with your overall structure. The first 8 unit column and the 4 unit column which contains the image should be in the same row. I've added one of the missing closing div tags ahead of the latter to achieve that.
I'm not sure this is what you want since your specifications are a bit ambiguous. My advice, though, is to start any layout from the outside, establishing your primary structure first, then add interior structure. It's easy to see what went wrong if you work a step at a time.
```
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
<div class='container'>
<hr />
<!-- begin template -->
<div class='row'>
<div class='col-8'>
<div class='container-fluid p-0'>
<div class='row'>
<div class='col'>
<h3>Project Name</h3>
</div>
<div class='col text-end'>
<p>Project Status</p>
</div>
</div>
<div class='row'>
<div class='col'>
<p><i class='fa fa-arrow-right'></i> Tech 1, Tech 2, Tech 3</p>
</div>
<div class='row'>
<div class='col'>
<p>This is a description of the project, its goals, its challenges, the technologies it uses.</p>
</div>
</div>
</div>
</div>
</div>
<div class='col-4'>
<img src='https://via.placeholder.com/100' class='img-fluid' alt='placeholder image'>
</div>
</div>
</div>
```
| null | CC BY-SA 4.0 | null | 2022-11-15T20:07:44.040 | 2022-11-15T20:29:38.357 | 2022-11-15T20:29:38.357 | 1,264,804 | 1,264,804 | null |
74,451,684 | 2 | null | 74,450,968 | 1 | null | Here's one way to solve this problem using KD trees. A KD tree is a data structure for doing fast nearest-neighbor searches.
```
import scipy.spatial
tree = scipy.spatial.KDTree(df[['x', 'y']].values)
elevations = df['z'].values
long, elevation_data = [], []
for i in range(steps):
lon, lat = Longitude[i], Latitude[i]
dist, idx = tree.query([lon, lat])
elevation = elevations[idx]
if elevation < 0:
elevation = 0
elevation_data.append(elevation)
long.append(30 * i)
```
Note: if you can make assumptions about the data, like "all of the points in the CSV are equally spaced," faster algorithms are possible.
| null | CC BY-SA 4.0 | null | 2022-11-15T20:18:51.863 | 2022-11-15T20:30:29.980 | 2022-11-15T20:30:29.980 | 530,160 | 530,160 | null |
74,451,686 | 2 | null | 74,451,373 | 0 | null | ```
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
<div class='container'>
<hr />
<!-- begin template -->
<div class='row'>
<div class='col-8'>
<div class='container-fluid p-0'>
<div class='row'>
<div class='col'>
<h3>Project Name</h3>
</div>
<div class='col text-end'>
<p>Project Status</p>
</div>
</div>
<div class='row'>
<div class='col'>
<p><i class='fa fa-arrow-right'></i> Tech 1, Tech 2, Tech 3</p>
</div>
</div>
<div class='row'>
<div class='col-8'>
<p>This is a description of the project, its goals, its challenges, the technologies it uses.</p>
</div>
<div class='col-4'>
<img src='https://via.placeholder.com/100' class='img-fluid' alt='placeholder image'>
</div>
</div>
</div>
</div>
```
| null | CC BY-SA 4.0 | null | 2022-11-15T20:19:18.143 | 2022-11-15T20:24:35.323 | 2022-11-15T20:24:35.323 | 9,842,075 | 9,842,075 | null |
74,451,723 | 2 | null | 30,009,858 | 0 | null | Possible [duplicate](https://stackoverflow.com/questions/17281027/dodge-not-working-when-using-ggplot2)
In the linked post, the right answer states that one must use `position_jitter()` instead of `position_dodge()`. It has worked for me.
| null | CC BY-SA 4.0 | null | 2022-11-15T20:23:00.630 | 2022-11-15T20:23:19.420 | 2022-11-15T20:23:19.420 | 15,122,834 | 15,122,834 | null |
74,451,844 | 2 | null | 74,450,968 | 1 | null | It looks like your data might be on a regular grid. If (and only if) every combination of x and y exist in your data, then it probably makes sense to turn this into a labeled 2D array of points, after which querying the correct position will be very fast.
For this, I'll use [xarray](https://xarray.pydata.org/), which is essentially pandas for N-dimensional data, and integrates well with dask:
```
# bring the dataframe into memory
df = dk.read('n46_e032_1arc_v3_parquet').compute()
da = df.set_index(["y", "x"]).z.to_xarray()
# now you can query the nearest points:
desired_lats = xr.DataArray([46.6276, 46.6451], dims=["point"])
desired_lons = xr.DataArray([32.5942, 32.6781], dims=["point"])
subset = da.sel(y=desired_lats, x=desired_lons, method="nearest")
# if you'd like, you can return to pandas:
subset_s = subset.to_series()
# you could do this only once, and save the reshaped array as a zarr store:
ds = da.to_dataset(name="elevation")
ds.to_zarr("n46_e032_1arc_v3.zarr")
```
| null | CC BY-SA 4.0 | null | 2022-11-15T20:33:01.180 | 2022-11-15T20:33:01.180 | null | null | 3,888,719 | null |
74,452,008 | 2 | null | 74,451,760 | 0 | null | I am not a PowerShell guru, but the Outlook object model is common for all programming languages, so you may understand the required sequence or property and method calls in the following VBA macro:
```
Sub ListAllSharedCalendars()
Dim olPane As NavigationPane
Dim olMod As CalendarModule
Dim olGrp As NavigationGroup
Dim olNavFld As NavigationFolder
Dim olCalFld As Folder
Set Application.ActiveExplorer.CurrentFolder = Session.GetDefaultFolder(olFolderCalendar)
Set olCalFld = Session.GetDefaultFolder(olFolderCalendar)
Set olPane = Application.ActiveExplorer.NavigationPane
Set olMod = olPane.Modules.GetNavigationModule(olModuleCalendar)
Set olGrp = olMod.NavigationGroups.Item("Shared Calendars")
For i = 1 To olGrp.NavigationFolders.Count
Set olNavFld = olGrp.NavigationFolders.Item(i)
Debug.Print olNavFld.DisplayName
Next
End Sub
```
The [NavigationPane object](https://learn.microsoft.com/en-us/office/vba/api/outlook.navigationpane) represents the navigation pane displayed by the active `Explorer` object. Use the `Modules` property to return a `NavigationModules` object that represents the collection of navigation modules contained by the navigation pane. Use the `DisplayedModuleCount` to return the count of `NavigationModule` objects currently displayed in the navigation pane and the `CurrentModule` property to return or set the currently selected `NavigationModule` object.
You may also find the [NameSpace.GetSharedDefaultFolder](https://learn.microsoft.com/en-us/office/vba/api/outlook.namespace.getshareddefaultfolder) method helpful, it returns a `Folder` object that represents the specified default folder for the specified user.
| null | CC BY-SA 4.0 | null | 2022-11-15T20:50:29.867 | 2022-11-15T20:50:29.867 | null | null | 1,603,351 | null |
74,452,208 | 2 | null | 18,470,323 | 1 | null | One option is with [select_columns](https://pyjanitor-devs.github.io/pyjanitor/api/functions/#janitor.functions.select.select_columns) from [pyjanitor](https://pyjanitor-devs.github.io/pyjanitor/), where you can use a dictionary to select - the key of the dictionary is the level (either a number or label), and the value is the label(s) to be selected:
```
# pip install pyjanitor
import pandas as pd
import janitor
data.select_columns({1:['a','c']})
one two
a c a c
0 -0.089182 -0.523464 -0.494476 0.281698
1 0.968430 -1.900191 -0.207842 -0.623020
2 0.087030 -0.093328 -0.861414 -0.021726
3 -0.952484 -1.149399 0.035582 0.922857
```
| null | CC BY-SA 4.0 | null | 2022-11-15T21:11:49.117 | 2023-01-29T02:03:47.613 | 2023-01-29T02:03:47.613 | 7,175,713 | 7,175,713 | null |
74,452,288 | 2 | null | 74,452,088 | 0 | null | There are multiple issues with your code. The main issue is you are using the same `id`, `num`, for multiple elements, which is invalid. Change those `id`'s to `class` instead, like this:
```
<ul>
<li><button class="btn"><p class="num">1</p></button></li>
<li><button class="btn"><p class="num">2</p></button></li>
<li><button class="btn"><p class="num">3</p></button></li>
<li><button class="btn"><p class="num">4</p></button></li>
<li><button class="btn"><p class="num">5</p></button></li>
</ul>
```
After doing that, one way to acquire the most recently selected button is to find the nested `.num` within your button click eventListeners, such as `var rating = parseInt(btn.querySelector(".num").textContent)`
Here is how you might do that with minimal changes to your current code:
```
const allBtns = document.querySelectorAll('.btn');
var currentRating = null;
allBtns.forEach(btn => {
btn.addEventListener('click', function onClick() {
btn.style.backgroundColor = 'orange';
currentRating = parseInt(btn.querySelector(".num").textContent)
})
});
function ShowAndHide() {
if (currentRating){
alert(currentRating);
}
let y = document.querySelector('.ratingbox');
let x = document.querySelector('.thankyou');
if (x.style.display == 'none') {
y.style.display = 'none';
x.style.display = 'block';
} else {
x.style.display = 'none';
}
}
```
Here is a JsFiddle that does just this and alerts the selected rating:
[https://jsfiddle.net/eg4Ly0nd/](https://jsfiddle.net/eg4Ly0nd/)
Note: I would recommend using hidden checkbox inputs within each of the `li` buttons and adding to code your event listener to check the selected input associated with a button and uncheck the others. Then you don't need the global `currentRating` variable that is included in my solution; you can just find the input that is checked. I only wrote it this way to make minimal changes to the code you provided while still giving a solution.
| null | CC BY-SA 4.0 | null | 2022-11-15T21:18:27.373 | 2022-11-15T21:30:26.137 | 2022-11-15T21:30:26.137 | 5,199,418 | 5,199,418 | null |
74,452,474 | 2 | null | 74,452,462 | 1 | null | Run the application using `pythonw` instead of `python`. `pythonw` is the exact same Python interpreter, but it's marked as a Windows GUI application, so it doesn't require a connection to a console.
| null | CC BY-SA 4.0 | null | 2022-11-15T21:37:39.443 | 2022-11-15T21:37:39.443 | null | null | 1,883,316 | null |
74,452,516 | 2 | null | 24,663,333 | 0 | null | @francis answer is good, however I would also recommend using compile_definitions instead of add_definitions as well as specifying target for modern cmake modularity:
```
cmake_minimum_required (VERSION 2.6)
project (HELLO)
option(WITH_DEBUG "Use debug" OFF)
add_executable (main main.c)
if (WITH_DEBUG)
MESSAGE(STATUS "WITH_DEBUG")
target_compile_definitions(main PRIVATE USE_DEBUG)
endif()
```
| null | CC BY-SA 4.0 | null | 2022-11-15T21:42:25.470 | 2022-11-15T21:42:25.470 | null | null | 10,107,667 | null |
74,452,514 | 2 | null | 59,257,753 | 0 | null | Here is more Typescript eslint friendly way(no usage of `any`)
Array chunk method in `ArrayUtils.ts`
```
export function chunk<M>(array: Array<M>, chunkSize: number) {
const ans: Array<Array<M>> = [];
for (let i = 0; i < array.length; i += chunkSize) {
ans[Math.floor(i / chunkSize)] = array.slice(i, i + chunkSize);
}
return ans;
}
```
now in `FirebaseUtils.kt`, you can write
```
import { chunk } from "./ArrayUtils";
export async function inQuery<M>(
docRef: FirebaseFirestore.CollectionReference,
field: string | FirebaseFirestore.FieldPath,
values: Array<string>
) {
const querySnapshots = await Promise.all(
chunk(values, 10).map((chunkedArray) => {
return docRef.where(field, "in", chunkedArray).get();
})
);
return querySnapshots
.flatMap((querySnapshot) => querySnapshot.docs)
.map((documentData) => documentData.data() as M);
}
```
Few advantages over [this](https://stackoverflow.com/a/73959725/5028085) answer
1. Refactored as proper utility methods for reusability
2. Used Promise.all which is parallel and more recommended than for await as later is used when we don't have all the promises upfront. See this
| null | CC BY-SA 4.0 | null | 2022-11-15T21:41:51.467 | 2022-11-15T22:57:52.413 | 2022-11-15T22:57:52.413 | 5,028,085 | 5,028,085 | null |
74,452,652 | 2 | null | 74,452,619 | 2 | null | the [errorLens](https://marketplace.visualstudio.com/items?itemName=usernamehw.errorlens) extension causes this, you can delete it and it will disappear simply.
| null | CC BY-SA 4.0 | null | 2022-11-15T21:56:48.790 | 2022-11-15T21:56:48.790 | null | null | 18,670,641 | null |
74,452,737 | 2 | null | 74,451,861 | 1 | null | Since `-0.0 == 0.0` is true, what you have is mathematically correct. If you find the output unaesthetic, the fix is simple. Don't multiply by `-1`. Take the absolute value instead:
```
from collections import Counter
import math
def entropy(string):
counts = Counter(string)
rel_freq = ((i/len(string)) for i in counts.values())
return abs(sum(f*math.log2(f) for f in rel_freq))
```
Then `entropy('aaaaa')` evaluates to `0.0`.
| null | CC BY-SA 4.0 | null | 2022-11-15T22:06:56.113 | 2022-11-15T22:13:51.890 | 2022-11-15T22:13:51.890 | 4,996,248 | 4,996,248 | null |
74,452,971 | 2 | null | 74,452,943 | 1 | null | you use an `f String`. Thus, `{d["A"]}` is evaluated putting the string into eval resulting into `eval("print(bruh)")`.
Try this:
```
d = {"A": "bruh"}
eval('print(d["A"])')
```
| null | CC BY-SA 4.0 | null | 2022-11-15T22:31:50.250 | 2022-11-15T22:31:50.250 | null | null | 20,473,701 | null |
74,453,122 | 2 | null | 74,452,088 | 0 | null | Just an alternative solution, you can set the `rating` value for each button by Javascript only, and with minimal change to existing code.
This way, it is independent to any content in `p`. It also saves the trouble of reading the `p` tag, since you might need to replace it with something else according to design.
The below Javascript snippet can be used with your posted HTML without changes.
Full example (run it with the button below for demo):
```
const allBtns = document.querySelectorAll('.btn');
const resultSpan = document.querySelector(".selected span")
allBtns.forEach((btn, i) => {
btn.addEventListener('click', function onClick() {
btn.style.backgroundColor = 'orange';
// Customize the output text here
// It displays in Success screen
resultSpan.innerText = `You have rated ${i + 1}`;
})
});
function ShowAndHide() {
let y = document.querySelector('.ratingbox');
let x = document.querySelector('.thankyou');
if (x.style.display == 'none') {
y.style.display = 'none';
x.style.display = 'block';
} else {
x.style.display = 'none';
}
}
```
```
<div class="ratingbox">
<div class="backgroundstar">
<img src="images/icon-star.svg" alt="" class="star">
</div>
<div class="writing">
<h1>How did we do?</h1>
<p>Please let us know how we did with your support request. All feedback is appreciated to help us improve our offering! </p>
</div>
<div class="flexbox">
<ul>
<li><button class="btn"><p>1</p></button></li>
<li><button class="btn"><p>2</p></button></li>
<li><button class="btn"><p>3</p></button></li>
<li><button class="btn"><p>4</p></button></li>
<li><button class="btn"><p>5</p></button></li>
</ul>
<button class="submit" onclick="ShowAndHide()">SUBMIT</button>
</div>
</div>
<div class="thankyou " style="display: none; ">
<div class="message ">
<img src="https://via.placeholder.com/50" alt=" " class="img ">
<div class="selected ">
<span id="rating "></span>
</div>
<div class="greeting ">
<h2>Thank you!</h2>
<p id="appreciate ">We appreciate you taking the thime to give a rating.<br> If you ever need more support, don't hesitate to <br> get in touch!
</p>
</div>
</div>
</div>
```
But as other comments mentioned, it is recommended that you assign a different `id` for each `p`, or no `id` at all since no need to read these tags in code anyway.
| null | CC BY-SA 4.0 | null | 2022-11-15T22:50:02.330 | 2022-11-16T00:19:32.367 | 2022-11-16T00:19:32.367 | 20,436,957 | 20,436,957 | null |
74,453,298 | 2 | null | 74,453,290 | 1 | null | Initialize related model `dobYear` to `1960`
| null | CC BY-SA 4.0 | null | 2022-11-15T23:16:03.937 | 2022-11-15T23:16:03.937 | null | null | 3,914,396 | null |
74,453,382 | 2 | null | 74,453,242 | 1 | null | [ctrl z + Enter](https://www.devdungeon.com/content/windows-eof-ctrl-d-equivalent)
verified the solution myself
it's called an
| null | CC BY-SA 4.0 | null | 2022-11-15T23:27:29.123 | 2022-11-15T23:27:29.123 | null | null | 4,935,162 | null |
74,453,400 | 2 | null | 74,452,088 | 2 | null | Use the right tool for the job.
Use radio buttons to manage your rating and style the labels how you'd like. Then use CSS to handle hiding and showing. Leave JavaScript to manipulating the DOM.
Keep in mind IDs to be unique. Once they are no longer unique, they are no longer ids. Things like `document.getElementById` will break if ID is not unique.
```
/*Get out radio buttons based on the name attribue*/
const allBtns = document.querySelectorAll('[name=rating]');
/*Add the event listener*/
allBtns.forEach(btn => {
btn.addEventListener('click', function onClick() {
/*Update the text using the value of the radio button*/
document.querySelector("#rating").innerHTML = `Thanks for rating us ${this.value}!`;
})
});
function ShowAndHide() {
/*Toggle the hide class on the appropriate boxes*/
document.querySelector('.ratingbox').classList.toggle("hide");
document.querySelector('.thankyou').classList.toggle("hide");;
}
```
```
/*Hide the radion buttons*/
.flexbox input {display:none;}
/*Give some buttonish styling to the check boxes */
.flexbox label {
display:block;
border: 1px blue solid;
border-radius: 50%;
font-size: 1.2em;
font-weight:bold;
text-align:center;
line-height:30px;
height: 30px;
width:30px;
margin-bottom: 1em;
}
/*Change the styling of the checked label*/
/*Note the use of the adjacent sibling cominator + */
.flexbox :checked + label {
background-color: orange;
}
/*Generic class to handle showing and hiding*/
.hide {
display:none;
}
```
```
<div class="ratingbox">
<div class="backgroundstar">
<img src="images/icon-star.svg" alt="" class="star">
</div>
<div class="writing">
<h1>How did we do?</h1>
<p>Please let us know how we did with your support request. All feedback is appreciated to help us improve our offering! </p>
</div>
<div class="flexbox">
<ul>
<!-- Using radio buttons , that will be hidden with associated labels -->
<li><input type="radio" name="rating" id="rtr1" value="1"><label for="rtr1">1</label></li>
<li><input type="radio" name="rating" id="rtr2" value="2"><label for="rtr2">2</label></li>
<li><input type="radio" name="rating" id="rtr3" value="3"><label for="rtr3">3</label></li>
<li><input type="radio" name="rating" id="rtr4" value="4"><label for="rtr4">4</label></li>
<li><input type="radio" name="rating" id="rtr5" value="5"><label for="rtr5">5</label></li>
</ul>
<button class="submit" onclick="ShowAndHide()">SUBMIT</button>
</div>
</div>
<div class="thankyou hide">
<div class="message ">
<img src="https://via.placeholder.com/50" alt=" " class="img ">
<div class="selected ">
<span id="rating"></span>
</div>
<div class="greeting ">
<h2>Thank you!</h2>
<p id="appreciate ">We appreciate you taking the thime to give a rating.<br> If you ever need more support, don't hesitate to <br> get in touch!
</p>
</div>
</div>
</div>
```
| null | CC BY-SA 4.0 | null | 2022-11-15T23:30:00.017 | 2022-11-16T22:37:02.100 | 2022-11-16T22:37:02.100 | 4,665 | 4,665 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.