Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
β | ParentId
int64 1.68k
75.6M
β | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
β | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
β | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
β | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
β | LastEditorUserId
int64 -1
21.3M
β | OwnerUserId
int64 1
21.3M
β | Tags
sequence |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
75,329,356 | 2 | null | 17,305,276 | 0 | null | I have been dealing with this myself. I decided to output the resized jpeg as a png and it worked wonders!
```
imagepng(...);
```
| null | CC BY-SA 4.0 | null | 2023-02-02T21:56:22.360 | 2023-02-02T21:56:22.360 | null | null | 21,136,552 | null |
75,329,437 | 2 | null | 12,287,523 | 0 | null | I finally figured out what was causing this for me. This had been a problem for years! None of the things listed here helped, and indeed, all of them were already set as suggested.
It turned out that I couldn't make a window smaller in width if control was anchored to the right edge, or smaller in height if control was anchored to the bottom edge.
| null | CC BY-SA 4.0 | null | 2023-02-02T22:06:06.260 | 2023-02-02T22:06:06.260 | null | null | 843,448 | null |
75,329,465 | 2 | null | 75,329,414 | 2 | null | This is due to typing. [document.querySelector](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector) is only guaranteed to return an element of type [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element), although, of course, it can return an object of a subtype of `Element`. But for the type definitions in `lib.dom.ts`, `Element` is only defined to have those two events (`fullscreenchange` and `fullscreenerror`) on them- probably because those are the only two events that are valid for all possible `Element` subtypes.
To solve your problem, add a type assertion to tell the TypeScript compiler or VS Code the exact type you expect that queried element to be.
In TypeScript, you can do a type assertion with the `as` keyword like this:
```
const titleElement = document.querySelector("#title") as HTMLHeadingElement;
// or whatever HTML type your `#title`-IDed element is.
```
In JavaScript, you can use JSDoc comments to make type hints that VS Code and other tools will recognize:
```
/** @type {HTMLHeadingElement} */
const titleElement = document.querySelector("#title");
```
Or, you can wrap your usage of the object returned from the query with a type check:
```
const titleElement = document.querySelector("#title");
if (titleElement instanceof HTMLHeadingElement) {
titleElement.addEventListever("click", (ev) => {
console.log("hello world!");
});
}
```
The TypeScript language server that powers IntelliSense in VS Code will know that inside that if-block, the type of `titleElement` must be at least `HTMLHeadingElement` (or whatever type you specify in the `instanceof` check) because of the `instanceof` check. You can read more about [the instanceof operator on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof).
To get a list of all existing HTML elements, one place to look is [MDN's HTML Element Reference page](https://developer.mozilla.org/en-US/docs/Web/HTML/Element), or you can just type `HTML` in your file in VS Code and trigger autocomplete suggestions.
| null | CC BY-SA 4.0 | null | 2023-02-02T22:10:03.957 | 2023-02-02T22:32:40.407 | 2023-02-02T22:32:40.407 | 11,107,541 | 11,107,541 | null |
75,329,754 | 2 | null | 75,328,224 | 1 | null | At the top of your screenshot you can see "Miscellaneous Files". This means that the file is not considered to be part of any project.
To see errors and IntelliSense, VS requires source files to exist within a project so that it knows:
- - -
So for some reason your file is not considered part of a project. We can't see your Solution Explorer, so it's not clear why that might be. Most likely you've opened the file via "File | Open". Make sure you create the file within a project, or add it to a project.
| null | CC BY-SA 4.0 | null | 2023-02-02T22:54:46.923 | 2023-02-02T22:54:46.923 | null | null | 24,874 | null |
75,329,881 | 2 | null | 63,980,881 | 0 | null | I'd like to propose another possible solution here. The prior solutions either require you to use an alpha scale or require you to hard code some values that are relative to the range of your data. The alpha scale is hard to get right if you really only want the low values to be transparent but not the mid/high. The hardcoding is problematic if you are making multiple graphs or using different inputs (e.g. a lower bound of .01 might look good on one dataset, but cut off important values on another).
The solution is to create a custom color map that begins with `'transparent'`. You can do this using existing color ramps like viridis.
Calling `viridis::viridis_pal()(n)` will give you a vector of colors from the viridis scale. You can also access others with something like `viridis::viridis_pal(option='magma')(10)` which will you give you 10 colors from the range of the magma palette .
To create your new color ramp, use `scale_fill_gradientn()` and concatenate `'transparent'` in front of a range of colors from your desired scale:
```
scale_fill_gradientn(colors = c('transparent',viridis::viridis_pal()(10)))
```
Now you have a scale that is transparent on the smallest end of the range but then proceeds through the viridis color ramp. You can also choose your own colors here as desired rather than relying on a built-in scale.
```
TEST <- data.frame(X = rnorm(10000, -700, 50),
Y = rnorm(10000, -450, 50))
ggplot(TEST, aes(x = X, y = Y)) +
stat_density_2d(geom = "raster", aes(fill = ..density..*10e04), contour = F,
h = c(5, 5),
n = 300) +
ggtitle("7387")+
theme(plot.title = element_text(lineheight=.8, face="bold"))+
scale_y_reverse()+
scale_fill_gradientn(colors = c('transparent',viridis::viridis_pal()(10)))
```

You can also attenuate this effect by adjusting how many colors you use to build your ramp. The effect is subtle, but more colors means more of the "background" is filled in, while fewer colors will allow more of the background to fade away. The below compares `viridis::viridis_pal()(5)` and `viridis::viridis_pal()(30)`:

This effect is independent of the scaling of your data--if you multiply density by 10, the result will be identical (which it would not be if you use the methods based on hard-coded limits).
| null | CC BY-SA 4.0 | null | 2023-02-02T23:13:44.420 | 2023-02-02T23:25:39.673 | 2023-02-02T23:25:39.673 | 675,727 | 675,727 | null |
75,329,942 | 2 | null | 75,328,959 | 0 | null | First off, it's important to remember that the `peer` functionality in tailwind doesn't target parents (which is what you currently have). You can only target elements that are next to one another.
Additionally, because of how the CSS `:peer` combinator works you can only target components, meaning the checkbox MUST come before the peer who's state you want to affect when the checkbox is checked.
```
<label
htmlFor="choose-me"
class=
'flex w-fit items-center justify-evely p-3 text-grey-8 relative'
>
<input type="checkbox" id="choose-me" class="peer mr-3 relative z-10" />
<div class="absolute inset-0 border-2 border-grey-4 peer-checked:bg-indigo-200 peer-checked:text-indigo-800 peer-checked:border-indigo-800 peer-checked:block z-0"></div>
<span class="relative z-10">Check me</span>
</label>
```
Here's an example that works using pure tailwind/css, assuming you don't want to handle the state in your react component, as per @Vikesir's comment (though that was my first thought as well and it's a good idea).
You'll notice I'm fudging in an empty div and using that to simulate the background and border changing. I also wrapped the label text in a span to make sure I could change it's z-index so that both the checkbox and the text were visible above the div that handles the state change.
Here is a version using a pseudo-element built off of the span holding the label text if you don't want the empty `div` in your code:
```
<label
htmlFor="choose-me"
class=
'flex w-fit items-center justify-evely text-grey-8 relative'
>
<input type="checkbox" id="choose-me" class="peer mr-3 absolute left-2.5 z-20" />
<span class="relative z-10 inset-0 py-3 pr-3 pl-8 before:-z-10 before:content-[''] before:absolute before:inset-0 before:h-full before:w-full before:border-2 before:border-grey-4 peer-checked:before:bg-indigo-200 peer-checked:before:text-indigo-800 peer-checked:before:border-indigo-800 peer-checked:before:block">Check me</span>
</label>
```
| null | CC BY-SA 4.0 | null | 2023-02-02T23:22:23.190 | 2023-02-02T23:44:24.107 | 2023-02-02T23:44:24.107 | 922,271 | 922,271 | null |
75,330,004 | 2 | null | 24,168,759 | 0 | null | If you are using Laravel Request method add your
> Accept:Application/json
to your postman header
[](https://i.stack.imgur.com/zYEt4.png)
| null | CC BY-SA 4.0 | null | 2023-02-02T23:30:56.977 | 2023-02-02T23:30:56.977 | null | null | 7,105,635 | null |
75,330,057 | 2 | null | 75,303,264 | 0 | null | As per the [screenshot](https://i.stack.imgur.com/TGpsj.png) you provided your line of code is:
```
WebElement email =driver.findElement(By.xpath("//*[@id=\"email\"]")).isDisplayed();
```
Though [findElement()](https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/WebElement.html#findElement(org.openqa.selenium.By)) returns the matched [WebElement](https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/WebElement.html) but you have invoked the [isDisplayed()](https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/WebElement.html#findElement(org.openqa.selenium.By)) method on the WebElement, which returns a `boolean`.
You can't assign the value to a variable of type WebElement. hence you see the unlined error.
---
## Solution
You have to follow either of the two (2) approaches:
- Return the WebElement:```
WebElement email = driver.findElement(By.xpath("//*[@id=\"email\"]"))
```
- Return the boolean result of `isDisplayed()`:```
Boolean bool = driver.findElement(By.xpath("//*[@id=\"email\"]")).isDisplayed();
```
| null | CC BY-SA 4.0 | null | 2023-02-02T23:40:06.757 | 2023-02-02T23:40:06.757 | null | null | 7,429,447 | null |
75,330,077 | 2 | null | 58,089,576 | 0 | null | I've had all this working years ago with my Spectrum and the ZX Interface 1's own rs232 port, but I wrote some C program using an old Windows 386 computer.
I still have the hardware and the cables. In fact, now that I remember I had to build my own "null modem" cable and connect it from the RS232 port on the computer to the ZX Interface 1 (I have an old Sony Vaio laptop with an RS232 port).
I was even able to download TAP files to play on the real spectrum. I'll dig up what I have and get back to you.
| null | CC BY-SA 4.0 | null | 2023-02-02T23:43:15.830 | 2023-02-02T23:43:15.830 | null | null | 2,181,188 | null |
75,330,230 | 2 | null | 28,396,970 | 0 | null | I had a similar problem and i solved it "nesting" the pedix:
```
x_{_{2}}
```
| null | CC BY-SA 4.0 | null | 2023-02-03T00:15:49.553 | 2023-02-03T00:15:49.553 | null | null | 5,915,940 | null |
75,330,647 | 2 | null | 75,330,580 | 0 | null | If you don't use the `ref` keyword, it won't change the variable in the other class.
[https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/ref](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/ref)
So if you want it to change the variable, your code should look like this:
```
using System;
TestClass stuff = new TestClass();
int test = 1;
Console.WriteLine("This is an integer: {0}\nAnd this is an amount it's added with: 2", test);
stuff.ChangeVariable(ref test);
Console.WriteLine("\nand it's {0} here! Why doesn't the change stick!?", test);
class TestClass
{
public void ChangeVariable(ref int item)
{
item += 2;
Console.WriteLine("\nFor some reason, 'item' here is {0},", item);
}
}
```
| null | CC BY-SA 4.0 | null | 2023-02-03T01:34:49.880 | 2023-02-03T01:34:49.880 | null | null | 10,536,404 | null |
75,330,644 | 2 | null | 75,330,580 | 0 | null | You are not understanding something fundamental.
Your code doesn't use inheritance. Your code has two classes but they don't inherit. You are using an implicit `Main` method that belongs to a class and you are defining a class named TestClass. These two classes have no relation to each other.
There are no global variables in C#. `int test` is a local variable in the implicit `Main` method.
`int` is a value type, not a reference type. When you pass `test` to the `ChangeVariable()` method, the value of `test` is passed but not a reference to the `test` variable. The changes made to `item` are limited to the `ChangeVariable()` method.
| null | CC BY-SA 4.0 | null | 2023-02-03T01:34:26.020 | 2023-02-03T01:34:26.020 | null | null | 4,208,174 | null |
75,330,684 | 2 | null | 75,328,959 | 1 | null | A CSS-only solution would be to use the `:has` pseudo-selector (note: not supported yet in Firefox). This would apply the classes only if the label wraps a checkbox which has been checked.
```
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer components {
.checkbox-label:has(input:checked) {
@apply border-blue-800 bg-blue-400 text-blue-800;
}
}
```
(with the unused classes stripped out)
```
<label className="checkbox-label justify-evely border-grey-4 text-grey-8 flex w-fit items-center gap-x-2 border-2 p-3">
<input type="checkbox" id="choose-me" />
Check me
</label>
```
You can test it here: [https://play.tailwindcss.com/zidP4zm2Pq](https://play.tailwindcss.com/zidP4zm2Pq)
The list of browsers supporting `:has`: [https://developer.mozilla.org/en-US/docs/Web/CSS/:has#browser_compatibility](https://developer.mozilla.org/en-US/docs/Web/CSS/:has#browser_compatibility)
| null | CC BY-SA 4.0 | null | 2023-02-03T01:42:15.113 | 2023-02-03T01:42:15.113 | null | null | 287,476 | null |
75,331,052 | 2 | null | 75,331,034 | 1 | null | Try this code
```
#fb-outer:hover #fb-rect {
fill: white;
}
#fb-outer:hover #fb-path {
stroke: black;
fill: black;
}
```
u can also add the position absolute:
`<div style="background-color: red; position: absolute;">`
| null | CC BY-SA 4.0 | null | 2023-02-03T02:58:14.853 | 2023-02-03T02:58:14.853 | null | null | 20,921,068 | null |
75,331,210 | 2 | null | 75,329,918 | 0 | null | Remove or comment `STATIC_ROOT` path and add `STATICFILES_DIRS` and need to correct `src` argument in img tag
### HTML
```
<script type = "text/javascript" src="{% static '/blog/js/blog_list.js' %}" ></script>
```
### Settings.py
```
STATIC_URL = '/static/'
# STATIC_ROOT = os.path.join(BASE_DIR,'static/') # active when DEBUG= False
STATICFILES_DIRS = [ # active when DEBUG= True
os.path.join(BASE_DIR, 'static'),
]
```
| null | CC BY-SA 4.0 | null | 2023-02-03T03:29:43.313 | 2023-02-03T04:34:03.817 | 2023-02-03T04:34:03.817 | 19,205,926 | 19,205,926 | null |
75,331,286 | 2 | null | 75,329,918 | 0 | null | I'm pretty sure granted the CSS is loading it's the leading slash if it's not substituting correctly. Even if it is, you'll want to omit the leading slash for consistency reasons.
As mentioned in another answer, you're also using the wrong attribute for loading the script - it should be `src` not `scr`. The mime type is [not compulsory](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type#value), and for standard JS discouraged.
I'd recommend that you only use it when using [JS modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) or if you need a data block.
Django concatenates the two paths together in the static tag.
It's effectively:
`STATIC_ROOT + [Your template parameter]`
So, from this:
```
<script type = "text/javascript" scr="{% static '/blog/js/blog_list.js' %}" ></script>
```
To this:
```
<script src="{% static 'blog/js/blog_list.js' %}"></script>
```
See the docs here for more info about the static tags (if you haven't already): [https://docs.djangoproject.com/en/4.1/ref/templates/builtins/#static](https://docs.djangoproject.com/en/4.1/ref/templates/builtins/#static)
If you want to see how static works under the hood, the source is here:
[https://github.com/django/django/blob/main/django/templatetags/static.py](https://github.com/django/django/blob/main/django/templatetags/static.py)
| null | CC BY-SA 4.0 | null | 2023-02-03T03:44:36.507 | 2023-02-03T07:20:34.493 | 2023-02-03T07:20:34.493 | 17,562,044 | 3,457,617 | null |
75,331,439 | 2 | null | 75,329,918 | 1 | null | In your you misspelled src as scr. change it to src then it may work.
```
<script type = "text/javascript" src="{% static '/blog/js/blog_list.js' %}" ></script>
```
Please check your browser console for errors sometimes javascript files are blocked due to some MIME mismatch. if so then remove the type attribute in script tag.
| null | CC BY-SA 4.0 | null | 2023-02-03T04:09:28.890 | 2023-02-03T04:09:28.890 | null | null | 7,440,016 | null |
75,331,420 | 2 | null | 75,330,295 | 1 | null | A minor correction might make this much clearer:
> when I open a Pull Request and merge it, GitHub is creating 2 merge commits...
Actually, made the first merge commit when you merged `master` into your branch to resolve the conflicts, and GitHub made the second merge commit when you completed the Pull request. This is a common occurrence, and nothing to worry about.
Note from the comments confirming you resolved conflicts in the GitHub UI:
> If you did it in the UI, I can see how it might feel like GitHub made that first merge, but actually did that merge, and GH just helped you do it. That's the same thing that would have happened if you had merged master into your branch locally on your machine and pushed it back out.
If it bothers you, you can probably avoid the first merge commit that you made. To resolve conflicts on your branch before completing a PR you can either merge in the target branch like you did, or you can rebase your branch onto the target branch. With rebase you rewrite your branch such that it appears as though you branched off of the latest `master` right now, and then made all of your commits on top of that. (Which, btw, is why we say you rebase "onto" `master` versus merging `master` "into" your branch.) With rebase your branch will be linear and won't have the initial merge commit.
As for the merge commit that GitHub creates when you complete the PR, this is because of the merge strategy selected, and "merge" is the default option (and perhaps the preferred option of most projects for merges into long-lived shared branches). GitHub offers [2 other options](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#rebase-and-merge-your-pull-request-commits) which are "squash, merge" which will squash all of the changes into a single linear commit, and also "rebase, merge" which will once again rebase your branch onto master like you potentially did to resolve the conflicts. Note if you choose this option, GitHub will rebase your commits again even if your branch is already up to date with `master` and doesn't need it. I assume they do this to avoid confusion caused by sometimes your commit IDs change and other times they don't. Here they always will change.
So to sum this all up:
1. You can avoid the first merge commit by rebasing instead of merging to resolve conflicts.
2. You can avoid the second merge commit by selecting either the squash-merge, or rebase-merge strategies when completing your PR.
My personal preference is rebase to avoid the first merge commit, but still use merge when completing PRs to have one merge commit into `master`.
---
IMHO, "rebase, merge" really ought to be called "rebase, fast-forward". Using the word merge there kind of implies a semi-linear merge which can be achieved by rebasing and then merging with `--no-ff` to force a merge commit. I suppose GH is using "merge" here in the default sense of fast-forward if possible, and in this case it will always be possible. This wording choice would probably be more obvious if GH offered both options, [like Bitbucket does](https://confluence.atlassian.com/bitbucketserver/pull-request-merge-strategies-844499235.html).
| null | CC BY-SA 4.0 | null | 2023-02-03T04:06:58.263 | 2023-02-03T16:54:08.073 | 2023-02-03T16:54:08.073 | 184,546 | 184,546 | null |
75,331,786 | 2 | null | 75,330,711 | 0 | null | ```
x_ticks = [0, 50, 100, 150, 200]
ax.set_xticks(x_ticks)
ax.set_xticklabels(labels=incra['Date'][x_ticks], rotation = 45)
```
| null | CC BY-SA 4.0 | null | 2023-02-03T05:15:57.023 | 2023-02-03T05:15:57.023 | null | null | 20,115,274 | null |
75,331,895 | 2 | null | 75,328,823 | 0 | null | You'll want to navigate to the root of your project and open the wp-config.php file. There you'll find the following:
```
define( 'WP_DEBUG', false );
```
If it is set to "false" you'll want to change it to "true" to allow WordPress to show error output on the page you are getting the white screen.
If you did not find the above script in the wp-config.php file you'll want to add the following.
```
define( 'WP_DEBUG', true );
```
When you do you'll likely see a "Fatal" error that is causing the site to crash and information on the file and line in the code where you can find the offending script.
| null | CC BY-SA 4.0 | null | 2023-02-03T05:38:00.200 | 2023-02-03T05:38:00.200 | null | null | 3,266,937 | null |
75,332,063 | 2 | null | 75,313,309 | 0 | null | If you want to change the of `back button`, you can set the property `Shell.ForegroundColor="Red"` to achieve it. Here's the code below for your reference:
```
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:viewModels="clr-namespace:Notes.ViewModels"
Shell.ForegroundColor="Red"
x:Class="Notes.Views.NotePage"
Title="Note">
```
If you want to change the Add icon `size` or `color`, you can set the `Color=Green` and `Size=200` like below. For the three dots, when clicking it, it will expand and show the `Add` word. It's there by default. I don't think we can remove it.
```
<ContentPage.ToolbarItems>
<ToolbarItem Text="Add" Command="{Binding NewCommand}" IconImageSource="{FontImage Glyph='+', Color=Green, Size=200}" />
</ContentPage.ToolbarItems>
```
| null | CC BY-SA 4.0 | null | 2023-02-03T06:04:45.743 | 2023-02-08T00:31:38.883 | 2023-02-08T00:31:38.883 | 9,644,964 | 9,644,964 | null |
75,332,119 | 2 | null | 75,321,441 | 4 | null | R (since version 3.4.0) will allocate a bit of extra memory for atomic vectors, so that 'growing' such vectors via sub-assignment may not require a reallocation if some spare capacity is still available. This is discussed a bit in the manual here; see the references to the 'truelength' of a vector:
[https://cran.r-project.org/doc/manuals/r-release/R-ints.html#The-_0027data_0027](https://cran.r-project.org/doc/manuals/r-release/R-ints.html#The-_0027data_0027)
[https://cran.r-project.org/doc/manuals/r-release/R-ints.html#FOOT3](https://cran.r-project.org/doc/manuals/r-release/R-ints.html#FOOT3)
Hence, in the past, the common wisdom was "always pre-allocate your vectors" and "avoid for loops", but nowadays if the final capacity of your vector is unknown, growing vectors via sub-assignment may be a reasonable solution.
This, together with byte-compilation of functions, means that some of the common wisdom around avoiding for loops is no longer as true as it once was. (However, the best-performing R code will typically still be of a functional style, or will require carefully pre-allocating memory / vectors and avoiding frequent allocations.)
| null | CC BY-SA 4.0 | null | 2023-02-03T06:13:48.077 | 2023-02-03T06:13:48.077 | null | null | 1,342,082 | null |
75,332,467 | 2 | null | 75,167,487 | 0 | null | Ok , so i fixed it. There is an option to Roll back version of VS. I rolled back from 17.4.4 to 17.4.1 and now everything works fine.
| null | CC BY-SA 4.0 | null | 2023-02-03T07:03:57.937 | 2023-02-03T07:03:57.937 | null | null | 21,040,635 | null |
75,332,538 | 2 | null | 75,332,248 | 0 | null | Try this steps.
Make sure that you open `xcworkspace` instead of `xcodeproj.` `xcworkspace` - contains information about pods.
1. flutter clean
2. flutter pub get
3. pod install inside ios folder
4. Try to build
| null | CC BY-SA 4.0 | null | 2023-02-03T07:10:57.267 | 2023-02-03T07:10:57.267 | null | null | 7,159,206 | null |
75,332,704 | 2 | null | 75,233,668 | 0 | null | > On Visual code, It takes to download python through the Microsoft store
If my understanding is correct, Windows comes with dummy python executables `python.exe` and `python3.exe` that take you to the microsoft store to install it- after which it is a real python executable instead of a dummy one. If you run `where python`, you'll get a list of all the python executables that are found via the `PATH` variable in the order that they are found in the `PATH`, where one of them will be the Windows one (instead of the one you installed from the Python website). Likely, the one you'll see listed first will be `C:\Users\you\AppDate\Local\Microsoft\WindowsApps\python.exe`.
What you probably need to do is update the order of entries in your `PATH` environment variable so that the directory containing the one you installed from the Python website is earlier in the `PATH` environment variable than the directory of the out-of-box Windows one.
Note: As indicated in this question: [why must python executable path be added to system PATH environment variables for python command to work in visual studio code](https://stackoverflow.com/q/74680976/11107541), you might need to add the directory containing your from-website Python to the `PATH` environment variable (before/above the path to the directory of the system one) (as opposed to the `PATH` environment variable).
| null | CC BY-SA 4.0 | null | 2023-02-03T07:30:35.310 | 2023-02-04T06:57:46.213 | 2023-02-04T06:57:46.213 | 11,107,541 | 11,107,541 | null |
75,332,771 | 2 | null | 8,640,635 | 0 | null | open devtools of the browser, then set a breakpoint of Mouse Click. Just Click the target of popover panel and U will see the opening popover. Just debug it like other normal DOM block
| null | CC BY-SA 4.0 | null | 2023-02-03T07:41:10.183 | 2023-02-03T07:41:10.183 | null | null | 21,138,770 | null |
75,332,875 | 2 | null | 17,083,925 | 0 | null | Use `BorderThickness="0,0,0,0"` same as Padding or Margin. My sample was `BorderThickness="2,2,0,2"` to remove the right border. Remember the order is 'Left', 'Top', 'Right', 'Bottom'.
| null | CC BY-SA 4.0 | null | 2023-02-03T07:53:09.743 | 2023-02-03T07:53:09.743 | null | null | 3,763,081 | null |
75,333,305 | 2 | null | 25,527,971 | 0 | null | Finally I found several solutions of the described problem.
First, you can remove all namespaces from all xml using [this](https://stackoverflow.com/a/25202177/17984837) answer.
Second, if you do not need to remove all namespaces in Xml, but only empty ones, they arise due to the fact that some namespace is written in the root elements, which is not in the child. For example:
```
<ΠΠΠΠ€Π xmlns="http://ΠΏΡ.ΡΡ/ΠΠ‘ΠΠ€/2018-04-03"
xmlns:ΠΠ€4="xx"...>
<ΠΠ‘ΠΠ€ xmlns="">
...
</ΠΠ‘ΠΠ€>
```
So you need to set the same namespace for all children of root elements. It can be done using this code (call `setTheSameNamespaceForChildren(rootElement)` for root element before saving):
```
private static final String namespaceKey = "xmlns";
private static String namespaceValue;
public static void setTheSameNamespaceForChildren(Element rootEl) {
namespaceValue = rootEl.getAttribute(namespaceKey);
NodeList list = rootEl.getChildNodes();
for (int i = 0; i < list.getLength(); i++) {
Node child = list.item(i);
setTheSameNamespaceRecursively(child);
}
}
private static void setTheSameNamespaceRecursively(Node node) {
if (node.getNodeType() == Node.ELEMENT_NODE) {
boolean isChanged = setTheSameNamespace((Element) node);
if (isChanged) {
NodeList list = node.getChildNodes();
for (int i = 0; i < list.getLength(); i++) {
Node child = list.item(i);
setTheSameNamespaceRecursively(child);
}
}
}
}
private static boolean setTheSameNamespace(Element node) {
String curValue = node.getAttribute(namespaceKey);
if (curValue.length() == 0) {
node.setAttribute(namespaceKey, namespaceValue);
return true;
}
return false;
}
```
| null | CC BY-SA 4.0 | null | 2023-02-03T08:41:03.443 | 2023-02-03T08:42:55.313 | 2023-02-03T08:42:55.313 | 17,984,837 | 17,984,837 | null |
75,333,901 | 2 | null | 26,801,124 | 0 | null | If you just want to have the possibility to view a single commit in landscape mode, you can select your commit in the main view and then press `d`, this will bring you to a full-screen diff view which is colored and scrollable.
| null | CC BY-SA 4.0 | null | 2023-02-03T09:40:10.713 | 2023-02-03T09:40:10.713 | null | null | 20,592,444 | null |
75,333,982 | 2 | null | 29,591,196 | 0 | null | First import the mixin sass file in your style.scss file. Be sure to import the file first before importing the globals and variables file.
For example like this,
`@import "_variables";`
`@import "_mixins";`
`@import "_globals";`
`@import "_header";`
| null | CC BY-SA 4.0 | null | 2023-02-03T09:47:46.453 | 2023-02-03T09:47:46.453 | null | null | 21,139,512 | null |
75,334,006 | 2 | null | 75,334,005 | 1 | null |
SiriKit needs a handler that conforms to the corresponding intent handling protocol.
`<IntentName>IntentHandling`
The protocol defines the methods that your handler implements to resolve any intent parameters and to let SiriKit know how your app handled the intent.
There are two way that you can let Sirikit know your handler that you conform to `<IntentName>IntentHandling` protocol.
## A. Provide a Handler in Your Intents App Extension - lightweight , so that is quick.
1. File -> New -> Target..
[](https://i.stack.imgur.com/NGsMu.png)
1. Make availabe intent for the extension.
[](https://i.stack.imgur.com/jAGN9.png)
1. Implement <IntentName>IntentHandling protocol
2. Return 3) implemented class in the handler method in the extension.
3. Make sure your intent is included in the plist file of the extension under IntentsSupported . (otherwise add <Name Of The Intent>Intent)
[](https://i.stack.imgur.com/mfItx.png)
---
## B. Provide a Handler in Your App - need to wakeup your whole app ( with all the import statements. so that it is slow)
1. Implement <IntentName>IntentHandling protocol
2. In an iOS app or an app built with Mac Catalyst, implement application(_:handlerFor:) on your UIApplicationDelegate.
[UIApplicationDelegateAdaptor](https://developer.apple.com/documentation/swiftui/uiapplicationdelegateadaptor)
1. Make sure your intent is included in the plist file of the App under Intents eligible for in-app handling . (otherwise add <Name Of The Intent>Intent)
[](https://i.stack.imgur.com/4G4sR.png)
| null | CC BY-SA 4.0 | null | 2023-02-03T09:49:41.087 | 2023-02-03T09:49:41.087 | null | null | 9,440,709 | null |
75,334,026 | 2 | null | 4,839,613 | 0 | null | If you can't add an extra div you can accomplish this with a background images in each corner.
[](https://i.stack.imgur.com/hCjP3.png)
```
#nice-corners {
border: 5px solid green;
border-radius: 5px;
background-image: url(top-left.svg), url(top-right.svg), url(bottom-left.svg), url(bottom-right.svg);
background-position: left top, right top, left bottom, right bottom;
background-repeat: no-repeat;
background-size: 16px
}
```
| null | CC BY-SA 4.0 | null | 2023-02-03T09:52:02.363 | 2023-02-03T09:52:02.363 | null | null | 1,695,062 | null |
75,334,226 | 2 | null | 75,333,009 | -1 | null | You need to put all your divs inside the same wrapper like this :
```
<div class="wrapper">
<div class="wrapper-item">a</div>
<div class="wrapper-item">b </div>
<div class="wrapper-item">c </div>
<div class="wrapper-item">d </div>
</div>
```
css :
```
.wrapper{
display: flex;
justify-content: center;
}
.wrapper-item{
border: 1px solid blue;
width: 200px;
height: 200px;
margin: 0 20px;
overflow-wrap: break-word;
word-wrap: break-word;
overflow-y:auto;
}
```
I've created a codpen, tell me if this is what you're looking for
[https://codepen.io/iheb-riahi-horizon-tech-tn/pen/ExpGqrb](https://codepen.io/iheb-riahi-horizon-tech-tn/pen/ExpGqrb)
| null | CC BY-SA 4.0 | null | 2023-02-03T10:12:34.053 | 2023-02-03T10:12:34.053 | null | null | 20,864,518 | null |
75,334,331 | 2 | null | 66,276,006 | 0 | null | Sometimes you just need to invalidate cashes and build the project again. Especially if errors have no logic and were not existed before. In my case, I face it when work with git's branches.
| null | CC BY-SA 4.0 | null | 2023-02-03T10:21:57.190 | 2023-02-03T10:21:57.190 | null | null | 15,969,176 | null |
75,334,342 | 2 | null | 75,322,281 | 0 | null | The client-side error you are seeing has nothing to do with chaincode. It is a failure to identify any peers (with the ledger query role) in your connection profile for the channel name you have specified, only if you are not using service discovery to locate network nodes. You probably need to check:
1. Which connection profile you are specifying when calling gateway.connect().
2. Exactly which channel name you are specifying in your client application when calling gateway.getNetwork().
3. That this channel name is defined in your connection profile.
4. There are peers defined for this channel in your connection profile.
5. The peer definitions don't explicitly disable the the ledger query role.
The error message you are seeing only exists in the v1.4 legacy Node client SDK, which is no longer supported. If at all possible, I would recommend using Fabric v2.4 (or later) and the newer [Fabric Gateway client API](https://hyperledger.github.io/fabric-gateway/).
| null | CC BY-SA 4.0 | null | 2023-02-03T10:22:54.510 | 2023-02-03T10:22:54.510 | null | null | 3,680,198 | null |
75,334,355 | 2 | null | 75,334,259 | 0 | null | `.d.ts` files don't need to be automatically generated from JSDoc or `.ts` files, they can be manually written.
It looks like the authors of this plugin decided to write the `.d.ts` file themselves and use vanilla JS for the actual code.
| null | CC BY-SA 4.0 | null | 2023-02-03T10:23:51.933 | 2023-02-03T10:23:51.933 | null | null | 12,101,554 | null |
75,334,401 | 2 | null | 75,319,171 | 0 | null | You can find this under audits->metrics->details->items->observedDomContentLoaded
It is not possible to get ONLY this from the PageSpeed Insights API. You need to download the full response and then parse the JSON and then extra that information you want.
| null | CC BY-SA 4.0 | null | 2023-02-03T10:29:20.137 | 2023-02-03T10:29:20.137 | null | null | 2,144,578 | null |
75,334,582 | 2 | null | 69,655,474 | 0 | null | After trying the solutions from this thread and finding they don't work in my case (the "clear text icon" from `com.google.android.material.textfield.TextInputLayout` wasn't always being displayed, not even with alpha 0), I ended up implementing the "clear text icon" from scratch, ie:
1. add an ImageView with my "clear text icon" to TextInputLayout's parent ViewGroup
2. attach an onClickListener to that ImageView and place the text-clearing logic there
3. attach onTextChanged and onFocusChange listeners to my EditText to trigger ImageView's visibility changes.
4. make the ImageView visible by animating its alpha from 0 to 1 and setting its visibility to View.VISIBLE at the end. To make it invisible, do the reverse, ie. animate its alpha from 1 to 0 and set its visibility to View.GONE at the end. Weirdly enough, when just toggling the visibility between GONE and VISIBLE, that ImageView wasn't always being displayed.
5. when the ImageView is shown, add endPadding to TextInputLayout, so that text in the EditText doesn't show under the ImageView
| null | CC BY-SA 4.0 | null | 2023-02-03T10:47:10.087 | 2023-02-03T10:47:10.087 | null | null | 3,008,360 | null |
75,334,775 | 2 | null | 75,255,360 | 0 | null | If you changed the report to a cross-tab, with those sections as groups, you could get close. You would need to move the model and quantity to the right though.
| null | CC BY-SA 4.0 | null | 2023-02-03T11:01:46.580 | 2023-02-03T11:01:46.580 | null | null | 4,255,595 | null |
75,334,874 | 2 | null | 75,324,342 | 0 | null | According to the doc you shoulder use the [setProp](https://fullcalendar.io/docs/Event-setProp) method to modifies any of the non-date-related properties of an [Event Object](https://fullcalendar.io/docs/event-object).
You could do it that way, and use a `switch` for a better readable code.
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<script src="https://cdn.jsdelivr.net/npm/[email protected]/index.global.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
const calendarEl = document.getElementById('calendar');
const buttonSwitch = document.getElementById('changeView');
let initialisation = false;
var calendar = new FullCalendar.Calendar(calendarEl, {
initialView: 'dayGridMonth',
events: [{
title: 'Normali',
start: '2023-02-12',
extendedProps: {
nomeUtente: 'USERNAME',
},
description: 'Lecture',
}, ],
eventDidMount: function(info) {
if (!initialisation) {
initialisation = true;
const eventTitle = info.event.title;
const extraPropsAuthor = info.event.extendedProps.nomeUtente;
const newTitle = `${eventTitle} - ${extraPropsAuthor}`;
let backgroundColor = null;
switch (eventTitle) {
case 'Normali':
backgroundColor = '#FB6B4C';
break;
case 'Straordinarie':
backgroundColor = '#C8FC0C';
break;
case 'Ferie':
backgroundColor = '#EC1C28';
break;
case 'Malattia':
backgroundColor = '#FFB404';
break;
case 'Permesso':
backgroundColor = '#A0ACDC';
break;
case 'Smart':
backgroundColor = '#08ACC4';
break;
case 'Trasferta':
backgroundColor = '#00897B';
break;
case 'Assenza':
backgroundColor = '#F8D2D7';
break;
case 'Altro':
backgroundColor = '#5E35B1';
break;
}
info.event.setProp('title', newTitle);
info.event.setProp('backgroundColor', backgroundColor);
}
},
});
calendar.render();
// Button event
buttonSwitch.addEventListener('click', e => {
calendar.view.type == 'dayGridMonth' ?
calendar.changeView('listMonth') :
calendar.changeView('dayGridMonth');
});
});
</script>
</head>
<body>
<button id="changeView">Switch</button>
<div id="calendar"></div>
</body>
</html>
```
| null | CC BY-SA 4.0 | null | 2023-02-03T11:10:53.710 | 2023-02-21T04:44:13.123 | 2023-02-21T04:44:13.123 | 19,694,359 | 19,694,359 | null |
75,334,948 | 2 | null | 75,330,295 | 1 | null | What you're seeing is correct and normal. Merging makes a merge commit; that's what a merge is. So:
1. You wanted GitHub to merge alteracoesPequenas into master, closing the pull request; but GitHub wouldn't do it, because of merge conflicts.
2. So you resolved the conflicts by doing a reverse merge of master into alteracoesPequenas. (Merge commit)
3. Then you were able to have GitHub merge alteracoesPequenas into master, which was your goal. (Merge commit)
All very right
and proper and completely standard. Don't worry, be happy.
Another psychological issue here may be GitHub's way of presenting what happened. This is not a topological diagram, it's just a flat list of commits reachable from `master`. The first merge commit you did isn't really "on" `master` in the sense you probably think of it; it's "on" `alteracoesPequenas`. Only one merge commit is "on" `master`, namely the merge commit that closed the pull request.
| null | CC BY-SA 4.0 | null | 2023-02-03T11:17:33.257 | 2023-02-03T11:40:43.840 | 2023-02-03T11:40:43.840 | 341,994 | 341,994 | null |
75,335,669 | 2 | null | 75,324,359 | 0 | null | Instead of adding to the start of a textbox insrt at the end use
```
field.insert (END, field text)
```
You are inserting the text at first place try inserting at the end
```
#Tk Stuff
window = tk.Tk()
window.geometry("1200x1200")
window.title("MSU RPG")
field = tk.Text(window, height = 15,width = 45,font=("Arial", 16))
field.grid(row=1,column=1,columnspan=11)
#Tk field text
field_text = ""
def atf(sth):
global field_text
field_text = field_text+str(sth)
field.delete("1.0", "end")
field.insert (END, field text)
def clear():
global field_text
field_text= ""
field.delete("1.0", "end")
```
I hope it would solve your problems.
| null | CC BY-SA 4.0 | null | 2023-02-03T12:20:17.853 | 2023-02-03T12:20:17.853 | null | null | 20,155,468 | null |
75,335,695 | 2 | null | 74,628,459 | 0 | null | Since your data's alrady in an Excel spreadsheet, you can use Excel to manipulate your data into a simple floating point number of degrees that Google Earth will read. The end result will look like this:
[](https://i.stack.imgur.com/RdKgu.png)
| Test coordinate | degrees | digits(minutes) | digits (whole seconds) | digits(fractional seconds) | decimal coordinate degrees |
| --------------- | ------- | --------------- | ---------------------- | -------------------------- | -------------------------- |
| 12 | =FLOOR(D6,1) | =FLOOR(D6,0.01)-E6 | =FLOOR(D6,0.0001)-SUM(E6+F6) | =D6-SUM(E6:G6) | =E6+((F6100)/60)+((G610000)/60/60)+((H6*10000)/60/60) |
| Check multipliers in I5 | | =F6*100 | =G6*10000 | =H6*10000 | |
Row 7 in the picture is just to check that the decimal points were setup correctly and can be removed. The forumlas are included in the table above. Make a set of these formulas for each of the coordinates (I'm guessing ther lat and lng) in each row. Google Earth will read coordinate degrees.
| null | CC BY-SA 4.0 | null | 2023-02-03T12:22:33.977 | 2023-02-03T12:22:33.977 | null | null | 1,429,266 | null |
75,335,937 | 2 | null | 75,335,207 | 0 | null | For two successive polynomials P and Q, I suggest simply solving the [assignment problem](https://en.wikipedia.org/wiki/Assignment_problem) to pair each root of P to the closest root of Q.
You can use scipy's `linear_sum_assignment` along with `distance_matrix` to find the best assignment of P's roots with Q's roots.
```
import numpy as np
from scipy.optimize import linear_sum_assignment
from scipy.spatial import distance_matrix
import matplotlib.pyplot as plt
def get_root_sequence(sequence_of_polynomials):
r0 = np.roots(sequence_of_polynomials[0])
roots = [r0]
for P in sequence_of_polynomials[1:]:
r1 = np.roots(P)
_, idx = linear_sum_assignment(distance_matrix(r0.reshape(3, 1), r1.reshape(3,1)))
r1 = r1[idx]
roots.append(r1)
r0 = r1
return np.array(roots)
sequence_of_polynomials = np.linspace((1,0,0,-1), (1,-7-2j,15+9j,-10-10j), 100)
roots = get_root_sequence(sequence_of_polynomials)
plt.axes().set_aspect('equal')
for i in range(3):
r = roots[:, i]
ordinal = ('first', 'second', 'third')[i]
plt.plot(r.real, r.imag, label=f'{ordinal} root')
for triangle, label in zip((roots[0], roots[-1]), ('xΒ³-1', '(x-2)(x-2-i)(x-3-i)')):
triangle = triangle[[0,1,2,0]]
plt.plot(triangle.real, triangle.imag, label=label)
plt.legend(loc='best')
plt.xlabel('Real part')
plt.ylabel('Imaginary part')
plt.show()
```
[](https://i.stack.imgur.com/GnTnP.png)
| null | CC BY-SA 4.0 | null | 2023-02-03T12:45:43.417 | 2023-02-03T13:01:51.530 | 2023-02-03T13:01:51.530 | 3,080,723 | 3,080,723 | null |
75,336,288 | 2 | null | 75,336,124 | 1 | null | try `document.getElementsByClassName('overallTable')[0].innerHTML`
| null | CC BY-SA 4.0 | null | 2023-02-03T13:18:14.200 | 2023-02-03T13:56:43.960 | 2023-02-03T13:56:43.960 | 2,181,514 | 21,118,830 | null |
75,336,361 | 2 | null | 75,334,288 | 0 | null | Usually, installing the previous version or slightly older version of the plugin works. Try installing the previous version of PHP Intelephense. Once encountered this on VS Code. All the best.
| null | CC BY-SA 4.0 | null | 2023-02-03T13:25:48.820 | 2023-02-03T13:25:48.820 | null | null | 954,797 | null |
75,336,487 | 2 | null | 75,336,124 | 2 | null | You can use `html()` function of jQuery.
`$('.overallTable').html();`
| null | CC BY-SA 4.0 | null | 2023-02-03T13:37:43.447 | 2023-02-03T13:37:43.447 | null | null | 16,533,364 | null |
75,336,675 | 2 | null | 75,331,194 | 0 | null | Try this
(edited to make more efficient with single pass process)
```
let Source = Excel.CurrentWorkbook(){[Name="Table15"]}[Content],
process = (zzz as list) => let x= List.Accumulate( zzz,{0},( state, current ) =>
if List.Last(state) =0 then List.Combine ({state,{6.4+current}}) else
if List.Last(state)+current >=12.8 then List.Combine ({state,{12.8}}) else
if List.Last(state)+current <=1.28 then List.Combine ({state,{1.28}}) else
List.Combine ({state,{List.Last(state)+current}})
) in x,
#"Grouped Rows" = Table.Group(Source, {"Category"}, {{"data", each
let a=process(_[Values])
in Table.AddColumn(_, "Custom Cumulative", each a{[Index]}), type table }}),
#"Expanded data" = Table.ExpandTableColumn(#"Grouped Rows", "data", {"Index", "Values", "Custom Cumulative"}, {"Index", "Values", "Custom Cumulative"})
in #"Expanded data"
```
[](https://i.stack.imgur.com/NWHCL.png)
| null | CC BY-SA 4.0 | null | 2023-02-03T13:53:59.650 | 2023-02-06T13:37:40.117 | 2023-02-06T13:37:40.117 | 9,264,230 | 9,264,230 | null |
75,336,849 | 2 | null | 75,325,732 | 0 | null | The problem was, that my keycloak (on a different port) rejected to load the working scripts. After handling this problems, the editor is working fine.
| null | CC BY-SA 4.0 | null | 2023-02-03T14:07:59.227 | 2023-02-03T14:07:59.227 | null | null | 21,134,340 | null |
75,337,002 | 2 | null | 75,334,847 | 0 | null | It is the error when copy from some document. The symbol `'` will become `β` or `β`
You need to change all the `β` `β` to `'`.
```
<script> (function(ss,ex){ window.ldfdr=window.ldfdr||function(){(ldfdr._q=ldfdr._q||[]).push([].slice.call(arguments));}; (function(d,s){ fs=d.getElementsByTagName(s)[0]; function ce(src){ var cs=d.createElement(s); cs.src=src; cs.async=1; fs.parentNode.insertBefore(cs,fs); }; ce('https://sc.lfeeder.com/lftracker_v1_'+ss+(ex?'_'+ex:'')+'.js'); })(document,'script'); })('kn9Eq4Ryyqj7RlvP'); </script>
```
| null | CC BY-SA 4.0 | null | 2023-02-03T14:20:23.560 | 2023-02-03T14:20:23.560 | null | null | 2,692,683 | null |
75,337,014 | 2 | null | 75,309,204 | 0 | null | Seems like it's a bottom border which comes from `.MuiDataGrid-cell`. Just set it to `none`.
| null | CC BY-SA 4.0 | null | 2023-02-03T14:21:18.127 | 2023-02-03T14:21:18.127 | null | null | 14,445,498 | null |
75,337,633 | 2 | null | 75,333,301 | 1 | null | Given the amount of transformation that needs to occur, it would be worth doing this in the DWH. Power BI does well with a star schema, so it would be good to break out dimensions like country, store and date into their own tables.
You might also work the measures into a single fact table - or maybe two if some of the facts are transactional and others are semi-additive snapshot facts. i.e. profit vs. number of staff. Designed right, the model could support all of the dashboards, so you would not need a report table for each.
| null | CC BY-SA 4.0 | null | 2023-02-03T15:12:43.577 | 2023-02-03T15:12:43.577 | null | null | 2,568,521 | null |
75,337,799 | 2 | null | 75,337,123 | 0 | null | The solution for us was to:
1. Locate the actual DLL file (Microsoft.Data.SqlClient.dll) on the developer's desktop filesystem (easy to find; once you're referenced it using NuGet it gets copied to multiple places)
2. Add it to the web project (we placed it right in the root)
3. Mark it (via Properties tool window) as Copy Always
Step 3 results in our .csproj file looks like this:
```
<ItemGroup>
<None Update="Microsoft.Data.SqlClient.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
```
| null | CC BY-SA 4.0 | null | 2023-02-03T15:25:47.633 | 2023-02-03T15:25:47.633 | null | null | 1,238,986 | null |
75,337,853 | 2 | null | 75,296,402 | 0 | null | This page in the documentation shows how to handle the processing response, including extracting the raw text from the document, which can be loaded into a TXT file. It also explains the structure of the Document.json output.
[https://cloud.google.com/document-ai/docs/handle-response#basic_text](https://cloud.google.com/document-ai/docs/handle-response#basic_text)
EDIT: New tool/sdk available
You can also use the [Document AI Toolbox](https://cloud.google.com/document-ai/docs/handle-response#toolbox) SDK for more utility/post processing functions to make some of this handling easier.
| null | CC BY-SA 4.0 | null | 2023-02-03T15:29:58.010 | 2023-02-21T19:10:33.493 | 2023-02-21T19:10:33.493 | 6,216,983 | 6,216,983 | null |
75,337,902 | 2 | null | 75,337,818 | 0 | null | Apparently, in your (which you didn't post here completely, but which is what produces the screenshot you added), your footer has a fixed position (or something similar) at the bottom. So simply move the `hr` tag inside the `.footer` div to make it part of that footer (i.e. at the bottom):
```
.footer {
position: fixed;
bottom: 0;
}
```
```
<div class="footer">
<hr style="width:50%; text-align:bottom" /> Gemacht mit <span class="herz">β€</span> von <a href="https://fastdropgaming.github.io"><span class="fl">FastDrop Gaming</span></a>
<div>
<small>© <script src="assets/js/year.js"></script> FastDrop Gaming. Alle Rechte vorbehalten.</small></div>
<div><small><a href="https://fastdropg.carrd.co/impressum"></span>Impressum</a> β <a href="https://fastdropg.carrd.co/contact">Kontakt</a> β <a href="https://fastdropg.carrd.co/privacy">>Datenschutz</a></div></small>
</div>
```
| null | CC BY-SA 4.0 | null | 2023-02-03T15:34:31.153 | 2023-02-03T15:34:31.153 | null | null | 5,641,669 | null |
75,337,923 | 2 | null | 75,337,410 | 0 | null | As Joachim Sauer and Tan Yu Hau Sean suggest, `%` does things you may not expect on negative numbers. If `a` is negative, `a%b` will be a number between `-b` and `0`.
If you add a method like this
```
public static int mod(int a, int b) {
return (a%b+b)%b;
}
```
and replace your instances of `%` with calls to it, e.g.:
```
int C = mod(a* val + b,26);
```
things will work a lot better.
| null | CC BY-SA 4.0 | null | 2023-02-03T15:36:01.863 | 2023-02-03T16:00:56.383 | 2023-02-03T16:00:56.383 | 21,105,992 | 21,105,992 | null |
75,338,159 | 2 | null | 71,595,777 | 0 | null | I would say that approaches using `dplyr`/`dbplyr` are better when working with the WRDS PostgreSQL database.
To do the equivalent of `(obs=10)`, do something like the following. The real payoff to `dbplyr`-based approaches comes when merging multiple large tables, which happens on the WRDS PostgreSQL server without needing to download data.
For many more examples like this one, see [here](https://iangow.github.io/far_book/intro.html).
```
library(dplyr, warn.conflicts = FALSE)
library(DBI)
pg <- dbConnect(RPostgres::Postgres())
djones.djdaily <- tbl(pg, sql("SELECT * FROM djones.djdaily"))
data <-
djones.djdaily %>%
select(date, dji) %>%
collect(n = 10)
data
#> # A tibble: 10 Γ 2
#> date dji
#> <date> <dbl>
#> 1 1896-05-26 40.9
#> 2 1896-05-27 40.6
#> 3 1896-05-28 40.2
#> 4 1896-05-29 40.6
#> 5 1896-06-01 40.6
#> 6 1896-06-02 40.0
#> 7 1896-06-03 39.8
#> 8 1896-06-04 39.9
#> 9 1896-06-05 40.3
#> 10 1896-06-08 39.8
```
[reprex v2.0.2](https://reprex.tidyverse.org)
| null | CC BY-SA 4.0 | null | 2023-02-03T15:57:08.167 | 2023-02-03T15:57:08.167 | null | null | 745,737 | null |
75,338,275 | 2 | null | 75,301,313 | 0 | null | If you run EmEditor as , please run EmEditor as . Please run `emeditor.exe` without a shortcut to see if macros run correctly.
| null | CC BY-SA 4.0 | null | 2023-02-03T16:08:23.060 | 2023-02-03T16:08:23.060 | null | null | 13,484,937 | null |
75,338,328 | 2 | null | 75,325,352 | 0 | null | How about this different take on the problem? Match one or more of the following: space OR a dash OR a percent sign OR a dollar sign OR an at sign OR a period (escaping the characters that have special regex meaning) and replace with an underscore. Note this takes care of the double underscore after "Technical".
```
with tbl(data) as (
select 'MSD 40001-ME-SPE-[XXXX] Technical%$Specification@REV9 (2021.05.27).xls' from dual
)
select regexp_replace(data, '( |\-|%|\$|@|\.)+', '_') fixed
from tbl;
FIXED
---------------------------------------------------------------------
MSD_40001_ME_SPE_[XXXX]_Technical_Specification_REV9_(2021_05_27)_xls
```
| null | CC BY-SA 4.0 | null | 2023-02-03T16:12:34.227 | 2023-02-03T16:12:34.227 | null | null | 2,543,416 | null |
75,338,413 | 2 | null | 75,337,846 | -3 | null | Solved as per the below:
```
#include <windows.h>
#include <string>
#include <iostream>
//lresult callback prototype
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
//window handles
HWND hMainWindow;
HINSTANCE hMainInstance;
HWND hLblOutput;
HWND hTxtInput;
HWND hButton;
CHAR s_text_1[]{ "Some text.." };
CHAR s_text_2[]{ 0 };
#define IDC_TEXTBOX 1000
#define IDC_BUTTON 1001
//call to winmain - equivalent of main for win32 environments
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
MSG msg = { 0 };
WNDCLASS wc = { 0 };
wc.lpfnWndProc = WndProc;
wc.hInstance = hInstance;
wc.hbrBackground = (HBRUSH)(COLOR_BACKGROUND);
wc.lpszClassName = TEXT("NiceWindowsApp");
if (!RegisterClass(&wc))
return 1;
hMainWindow = CreateWindow(wc.lpszClassName, TEXT("My Windows Application"), WS_OVERLAPPEDWINDOW | WS_VISIBLE,
0, 0, 640, 480, 0, 0, hInstance, NULL);
hMainInstance = wc.hInstance;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}
//callback definition
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int offset = 0;
switch (message) {
case WM_CREATE:
hMainWindow = hWnd;
hTxtInput = CreateWindowEx(WS_EX_CLIENTEDGE, TEXT("EDIT"), s_text_1,
WS_VISIBLE | WS_CHILD | ES_LEFT, 50, 50, 400, 25, hWnd,
(HMENU)IDC_TEXTBOX, hMainInstance, NULL);
hButton = CreateWindowEx(WS_EX_CLIENTEDGE, TEXT("BUTTON"), TEXT("Press Me!"), WS_VISIBLE | WS_CHILD | WM_COPY | ES_LEFT, 500, 30, 100, 60, hWnd,
(HMENU)IDC_BUTTON, hMainInstance, NULL);
break;
case WM_COMMAND:
if (LOWORD(wParam) == IDC_BUTTON)
{
//CANNOT HANDLE MORE THAN 20 CHARACTERS!!!
std::wstring input;
//GetWindowTextW(hTxtInput, reinterpret_cast<char*> ((char*)input.c_str()), 400);
int lgth = GetWindowTextLength(hTxtInput);
//GetWindowTextW(hTxtInput, reinterpret_cast<wchar_t*> ((wchar_t*)input.c_str()), lgth);
//GetWindowTextA(hTxtInput, char[], 400);
GetWindowText(hTxtInput, s_text_1, 255);
++offset;
hLblOutput = CreateWindowEx(WS_EX_STATICEDGE, TEXT("EDIT"), s_text_1, WS_VISIBLE | WS_CHILD | ES_READONLY | ES_LEFT, 50, 200 + offset * 26, 800, 25, hWnd,
(HMENU)IDC_TEXTBOX, hMainInstance, NULL);
SetWindowText(hLblOutput, s_text_1);
}
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
```
[](https://i.stack.imgur.com/KEldT.png)
Thanks for your hints everybody.
EDIT: I now realise that this solution is not technically perfect and can lead to undefined behaviour and/or memory leaks. I'll take the advice presented in the other answers and comments into account and adjust the code accordingly.
EDIT 2.0 (2023.02.04): My most recent code is below. Hopefully it's more robust.
```
#include <windows.h>
#include <string>
#include <iostream>
//last update - 04.02.2023 as per StackOverflow thread recommendations.
//lresult callback prototype
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
//window handles
HWND hMainWindow;
HINSTANCE hMainInstance;
HWND hLblOutput;
HWND hTxtInput;
HWND hButton;
CHAR s_text_1[]{ "Some text.." };
#define IDC_TEXTBOX 1000
#define IDC_BUTTON 1001
//call to winmain - equivalent of main for win32 environments
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
MSG msg = { 0 };
WNDCLASS wc = { 0 };
wc.lpfnWndProc = WndProc;
wc.hInstance = hInstance;
wc.hbrBackground = (HBRUSH)(COLOR_BACKGROUND);
wc.lpszClassName = TEXT("NiceWindowsApp");
if (!RegisterClass(&wc))
return 1;
hMainWindow = CreateWindow(wc.lpszClassName, TEXT("My Windows Application"), WS_OVERLAPPEDWINDOW | WS_VISIBLE,
0, 0, 640, 480, 0, 0, hInstance, NULL);
hMainInstance = wc.hInstance;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}
//callback definition
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int offset = 0;
switch (message) {
case WM_CREATE:
hMainWindow = hWnd;
hTxtInput = CreateWindowEx(WS_EX_CLIENTEDGE, TEXT("EDIT"), s_text_1,
WS_VISIBLE | WS_CHILD | ES_LEFT, 50, 50, 400, 25, hWnd,
(HMENU)IDC_TEXTBOX, hMainInstance, NULL);
hButton = CreateWindowEx(WS_EX_CLIENTEDGE, TEXT("BUTTON"), TEXT("Press Me!"), WS_VISIBLE | WS_CHILD | WM_COPY | ES_LEFT, 500, 30, 100, 60, hWnd,
(HMENU)IDC_BUTTON, hMainInstance, NULL);
break;
case WM_COMMAND:
if (LOWORD(wParam) == IDC_BUTTON)
{
std::wstring input;
//resize added as suggested
input.resize(GetWindowTextLengthW(hTxtInput));
GetWindowTextW(hTxtInput, input.data(), input.size() + 1);
++offset;
hLblOutput = CreateWindowEx(WS_EX_STATICEDGE, TEXT("EDIT"), s_text_1, WS_VISIBLE | WS_CHILD | ES_READONLY | ES_LEFT, 50, 200 + offset * 26, 800, 25, hWnd,
(HMENU)IDC_TEXTBOX, hMainInstance, NULL);
SetWindowTextW(hLblOutput, input.data());
}
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
```
| null | CC BY-SA 4.0 | null | 2023-02-03T16:19:48.603 | 2023-02-04T12:52:47.310 | 2023-02-04T12:52:47.310 | 12,045,504 | 12,045,504 | null |
75,338,430 | 2 | null | 75,338,139 | 0 | null | There is an [open bug](https://github.com/angular/components/issues/26349) about this on the repo.
| null | CC BY-SA 4.0 | null | 2023-02-03T16:21:54.340 | 2023-02-03T16:21:54.340 | null | null | 884,123 | null |
75,338,460 | 2 | null | 75,337,818 | 0 | null | you should put the hr inside the general div "footer" :
```
<div class="footer">
<hr style="width:50%; text-align:bottom" />
Gemacht mit <span class="herz">β€</span> von <a href="https://fastdropgaming.github.io"><span class="fl">FastDrop Gaming</span></a>
<div>
<small>© <script src="assets/js/year.js"></script> FastDrop Gaming. Alle Rechte vorbehalten.</small></div>
<div><small><a href="https://fastdropg.carrd.co/impressum"></span>Impressum</a> β <a href="https://fastdropg.carrd.co/contact">Kontakt</a> β <a href="https://fastdropg.carrd.co/privacy">>Datenschutz</a></div></small>
</div>
```
| null | CC BY-SA 4.0 | null | 2023-02-03T16:24:16.867 | 2023-02-03T16:24:16.867 | null | null | 11,772,682 | null |
75,338,485 | 2 | null | 64,686,116 | 0 | null | I tried on my side, you need to delete the `form3` before `ListBox1.Items`. I think that is why. I tried everything possible. Hope this helps.
| null | CC BY-SA 4.0 | null | 2023-02-03T16:26:16.343 | 2023-02-03T16:26:16.343 | null | null | 21,142,041 | null |
75,338,517 | 2 | null | 75,337,846 | 0 | null | One correct way to do this is:
```
std::wstring text;
text.resize(GetWindowTextLengthW(hTxtInput));
text.resize(GetWindowTextW(hTxtInput, text.data(), text.size() + 1));
```
| null | CC BY-SA 4.0 | null | 2023-02-03T16:29:14.773 | 2023-02-03T22:04:55.117 | 2023-02-03T22:04:55.117 | 758,345 | 758,345 | null |
75,338,494 | 2 | null | 75,236,709 | 1 | null | @MikeT
Sorry for the late response...(I am using an answer because It's to long for a comment and editing my question would be messy)
I was nearly able to get everything I wanted, using this way (example series categories):
I saved the fetched categories (using retrofit) in a new POJO, named SeriesCategory:
```
@Entity(
foreignKeys = [
ForeignKey(
entity = AccountData::class,
parentColumns = ["totalAccountData"],
childColumns = ["accountData"],
onDelete = ForeignKey.CASCADE,
onUpdate = ForeignKey.CASCADE,
)
]
)
@Parcelize
data class SeriesCategory(
@PrimaryKey(autoGenerate = false)
val id: String,
val title: String,
@ColumnInfo(index = true)
var accountData: String,
var favorite: Boolean,
val idByAccountData: String
) : Parcelable
```
using...
```
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun insertSeriesCategory(seriescategory: List<SeriesCategory>)
val mappedSeriesCategoryList = seriescatresponse.js.map { SeriesCategorybyAccount(it.id, it.title, totalAccountData, isFavorite, "${it.id}$totalAccountData") }
lifecycleScope.launch {
mappedSeriesCategoryList.forEach { dao.insertSeriesCategory(mappedSeriesCategoryList) }
}
```
In the Dao & SeriesCategoryFragment I use following code to get all categories from this specific account:
```
@Query("SELECT * FROM seriesCategory WHERE accountData=:totalAccountData")
fun getSeriesCategoriesPerAccount(totalAccountData: String): LiveData<List<SeriesCategory>>
viewModel.getSeriesCategoryByAccount(totalAccountData, [email protected]()).observe(viewLifecycleOwner) {
seriesCategoryAdapter.submitList(it)
}
```
As I am using a checkbox in the SeriesCategoryFragment-recyclerview I managed the checkbox in the adapter and used following code in the Dao & SelectedSeriesCategoryFragment:
```
@Query("SELECT * FROM seriesCategory WHERE accountData=:totalAccountData AND favorite = 1")
fun getSelectedSeriesCategoriesPerAccount(totalAccountData: String): LiveData<List<SeriesCategory>>
viewModel.getSelectedSeriesCategoryByAccount(totalAccountData, [email protected]()).observe(viewLifecycleOwner) {
selectedSeriesCategoryAdapter.submitList(it)
}
```
Thats working fine, when in the SeriesCategoryFragment a checkbox is checked(favorite = true), the category is "send" to the SelectedSeriesCategoryFragment, if it's unchecked (favorite = false) it's removed.
But at the moment I am not able to save this in my room database. So when I have for example following categories:
CategoryA, CategoryB, CategoryC, CategoryD
The user checks CategoryA and CategoryC using the checkbox, this two categories are then displayed in the SelectedSeriesCategoryFragment-recyclerview. When he unchecks the checkbox the category is removed. That's all ok.
In the same clicklistener I am using also @Update with (it = SeriesCategory):
```
viewModel.updateSeriesCategory(it, [email protected]())
```
Restarting the app the database shows me favorite = 1 (for true) on the categories that where checked before the restart. But the checkboxes are unchecked - an the @Query I use in the SelectedSeriesCategoryFragment (see above) doesn't seem to work anymore -> means, it is empty.
On a second restart the database shows all categories as favorite = 0 (for false) - probably because the checkbox was empty before the second restart. So as I understand, the idea I have should work - but only if the checked Checkboxes stay checked also after the restart. Can I handle this somehow with room?
Or is this a completely recyclerview-specific problem?
Eventually, my Viewholder in the Adapter looks like this:
```
inner class ViewHolder(val binding: RvItemSeriescategoryBinding) : RecyclerView.ViewHolder(binding.root) {
fun bind(category: SeriesCategory) {
binding.apply {
rvItemSeriescategory.text = category.title
checkboxSeriescategory.isChecked = category.favorite
checkboxSeriescategory.setOnClickListener {
if (checkboxSeriescategory.isChecked) {
category.favorite = true
onClickListener.onClick(category)
}
if (!checkboxSeriescategory.isChecked)
category.favorite = false
onClickListener.onClick(category)
}
if (category.favorite == true){
checkboxSeriescategory.isChecked = true
}
}
}
}
```
| null | CC BY-SA 4.0 | null | 2023-02-03T16:26:52.833 | 2023-02-03T16:26:52.833 | null | null | 17,931,443 | null |
75,338,620 | 2 | null | 75,337,558 | 0 | null | Assuming no Excel version constraint per tag listed in the question. You can try the following in cell `D2`:
```
=LET(A, A2:A8, B, B2:B8, cnts, COUNTIFS(A,A,B,B), ux, UNIQUE(A),
out, MAP(ux, LAMBDA(x, TEXTJOIN(",",,UNIQUE(FILTER(B, (A=x)
* (cnts = MAX(FILTER(cnts, A=x)))))))), HSTACK(ux, out))
```
The formula considers the scenario where one or more values have the maximum number of occurrences, like in the case of `C` value, both values `13`, and `14` are present in just once. We use `TEXTJOIN` to collect both values.
Here is the output:
[](https://i.stack.imgur.com/cTtHM.png)
: You cannot use inside `MAP` the `MAXIFS` function because it is a [RACON function](https://exceljet.net/articles/excels-racon-functions) and `cnts` is not a range. We use as a workaround `MAX` filtering by rows that match `A=x`. The approach of using: `MAX((A=x) * cnts)` also works, but under the assumption that all filtered values are not negative.
| null | CC BY-SA 4.0 | null | 2023-02-03T16:37:07.757 | 2023-02-03T17:35:15.563 | 2023-02-03T17:35:15.563 | 6,237,093 | 6,237,093 | null |
75,338,829 | 2 | null | 75,338,387 | 1 | null | The `peutJouer` property in the screenshot you shared is a numeric value. The code you use to read it however does:
```
snapshot.getValue(String.class)
```
Since the snapshot does not have a `String` value, you can't retrieve it like that.
Instead, you'll want to extract is with:
```
peutjouer = snapshot.getValue(Long.class);
```
| null | CC BY-SA 4.0 | null | 2023-02-03T16:55:42.163 | 2023-02-03T16:55:42.163 | null | null | 209,103 | null |
75,339,303 | 2 | null | 75,338,772 | 0 | null | The vectorizer actually works as expected. Spark stores vectors as [SparseVectors](https://spark.apache.org/docs/3.2.1/api/python/reference/api/pyspark.ml.linalg.SparseVector.html) when they contain many zeros and as [DenseVectors](https://spark.apache.org/docs/3.2.1/api/python/reference/api/pyspark.ml.linalg.DenseVector.html) otherwise.
```
df = spark.createDataFrame(
[(0.0, 0.0, 0.0, 0.0, 3.0, 3.35), (.1, .2, .3, .4, .5, .5)],
['a', 'b', 'c', 'd', 'e', 'f']
)
final_vect = VectorAssembler(inputCols=['a', 'b', 'c', 'd', 'e', 'f'], outputCol='X')
```
```
>>> final_vect.transform(df).show(truncate=False)
+---+---+---+---+---+----+-------------------------+
|a |b |c |d |e |f |X |
+---+---+---+---+---+----+-------------------------+
|0.0|0.0|0.0|0.0|3.0|3.35|(6,[4,5],[3.0,3.35]) |
|0.1|0.2|0.3|0.4|0.5|0.5 |[0.1,0.2,0.3,0.4,0.5,0.5]|
+---+---+---+---+---+----+-------------------------+
>>> final_vect.transform(df).collect()
[Row(a=0.0, b=0.0, c=0.0, d=0.0, e=3.0, f=3.35, X=SparseVector(6, {4: 3.0, 5: 3.35})), Row(a=0.1, b=0.2, c=0.3, d=0.4, e=0.5, f=0.5, X=DenseVector([0.1, 0.2, 0.3, 0.4, 0.5, 0.5]))]
```
Spark displays a sparse vector as a 3-tuple `(size, indices, values)` where `size` is the size of the vector, `indices` is the list of indices for the value is not zero and `values` contains the corresponding values.
The way it is displayed in python when you call `collect` is a bit clearer. You can see the name of the class and it displays a dictionary of non-zero values for sparse vectors.
| null | CC BY-SA 4.0 | null | 2023-02-03T17:44:00.633 | 2023-02-03T17:56:42.977 | 2023-02-03T17:56:42.977 | 8,893,686 | 8,893,686 | null |
75,339,438 | 2 | null | 13,188,049 | 0 | null |
### Nvidia Visual Profiler
-
```
# If you using conda:
conda activate env_name
# Run the Nvidia Visual Profiler:
nsight-sys
```
- - -
### Nvidia Nsight Compute
-
```
# If you using conda:
conda activate env_name
# To get the current python path:
which python3
# Run the Nvidia Nsight Compute:
nv-nsight-cu
```
- - - -
| null | CC BY-SA 4.0 | null | 2023-02-03T17:55:25.547 | 2023-02-03T17:55:25.547 | null | null | 4,982,017 | null |
75,339,800 | 2 | null | 49,234,311 | 1 | null |
When you have a request open in Postman, show the "Code" pane at the right by clicking the `</>` button seen in the right-hand toolbar.
[](https://i.stack.imgur.com/0WpTj.png)
Then in the dropdown header for code type, choose "HTTP".
[](https://i.stack.imgur.com/Yd8gh.png)
The line numbers in the HTTP snippet are significant -- in my screenshot, the last four displayed lines are concatenated into line 6 of the actual HTTP.
| null | CC BY-SA 4.0 | null | 2023-02-03T18:39:31.217 | 2023-02-03T18:47:25.057 | 2023-02-03T18:47:25.057 | 864,696 | 864,696 | null |
75,339,898 | 2 | null | 29,206,067 | 0 | null | I recently had an issue with a request stalling as well. This may be helpful if you have exhausted all other fixes mentioned in other answers.
If you are using the fetch API for requests, then you may want to also try removing the 'keep-alive' property in the request options.
This was an annoying bug for me and removing this got rid of the stalling issue.
| null | CC BY-SA 4.0 | null | 2023-02-03T18:50:21.830 | 2023-02-03T18:50:21.830 | null | null | 16,209,133 | null |
75,340,399 | 2 | null | 75,339,993 | 0 | null | First: remove the line `cam1.SetActive(true)` under `public GameObject cam3;`. Its missing a semicolon and it must be placed in a function scope anyway, not in class declaration scope.
Second: this statement (and the other two) `if (cam1.SetActive(true))` cant work because `SetActive` does not return a `bool` value. You probably wanted `if (cam1.activeSelf)`.
You may spend some time improving your knowledge [C# coding basics in Unity](https://unity.com/how-to/learning-c-sharp-unity-beginners)
| null | CC BY-SA 4.0 | null | 2023-02-03T19:47:47.720 | 2023-02-03T19:47:47.720 | null | null | 20,931,211 | null |
75,340,425 | 2 | null | 75,340,339 | 0 | null | I use pandastable to display dataframes in tkinter
> Install: pip install pandastable
Code:
```
import pandas as pd
from pandastable import Table
#Create DataFrame class
class DataFrameTable(Frame):
def __init__(self, parent=None, df=pd.DataFrame()):
super().__init__()
self.parent = parent
self.pack(fill=BOTH, expand=True)
self.table = Table(
self, dataframe=df,
showtoolbar=False,
showstatusbar=True,
editable=False)
self.table.show()
#Tkinter window
root = Tk()
#Show Table
DataFrameTable(root, your_dataframe)
root.mainloop()
```
| null | CC BY-SA 4.0 | null | 2023-02-03T19:50:36.343 | 2023-02-03T19:51:31.503 | 2023-02-03T19:51:31.503 | 17,749,677 | 17,749,677 | null |
75,340,467 | 2 | null | 75,338,395 | 0 | null | Perhaps you are looking for this
```
## Dependent reactive filter
observeEvent(input$test_category, {
if (is.null(input$test_category)) {
subcatToShow = cat_sub_name$sub.category
selected <- character(0)
}else {
subcatToShow = cat_sub_name %>%
filter(category %in% input$test_category) %>%
pull(sub.category)
selected <- subcatToShow[1]
}
#Update the actual input
updateSelectInput(session, "test_subcategory", choices = subcatToShow,
selected = selected)
},ignoreNULL = FALSE)
```
| null | CC BY-SA 4.0 | null | 2023-02-03T19:56:01.273 | 2023-02-03T20:10:11.480 | 2023-02-03T20:10:11.480 | 13,333,279 | 13,333,279 | null |
75,340,803 | 2 | null | 75,340,755 | 3 | null | You can use [numpy.power](https://numpy.org/doc/stable/reference/generated/numpy.power.html) :
```
import numpy as np
df["2^Value"] = np.power(2, df["Value"])
```
Or simply, `2 ** df["Value"]` as suggested by @.
Output :
```
print(df)
Value 2^Value
0 0 1
1 1 2
2 3 8
3 4 16
```
[](https://i.stack.imgur.com/XPRCE.png)
| null | CC BY-SA 4.0 | null | 2023-02-03T20:36:33.707 | 2023-02-03T20:59:22.060 | 2023-02-03T20:59:22.060 | 16,120,011 | 16,120,011 | null |
75,340,818 | 2 | null | 75,340,755 | 0 | null | You can use `.apply` with a lambda function
```
df["new_column"] = df["Value"].apply(lambda x: x**2)
```
In python the power operator is `**`
| null | CC BY-SA 4.0 | null | 2023-02-03T20:38:24.130 | 2023-02-03T20:39:08.100 | 2023-02-03T20:39:08.100 | 17,749,677 | 17,749,677 | null |
75,340,881 | 2 | null | 75,340,755 | 0 | null | You can apply a function to each row in a dataframe by using the df.apply method. See [this documentation](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.apply.html) to learn how the method is used. Here is some untested code to get you started.
```
# a simple function that takes a number and returns
# 2^n of that number
def calculate_2_n(n):
return 2**n
# use the df.apply method to apply that function to each of the
# cells in the 'Value' column of the DataFrame
df['2_n_value'] = df.apply(lambda row : calculate_2_n(row['Value']), axis = 1)
```
This code is a modified version of the code from [this G4G example](https://www.geeksforgeeks.org/apply-function-to-every-row-in-a-pandas-dataframe/)
| null | CC BY-SA 4.0 | null | 2023-02-03T20:44:27.063 | 2023-02-03T20:44:27.063 | null | null | 19,642,098 | null |
75,340,885 | 2 | null | 42,743,411 | 2 | null | A bubble in the pipeline (sometimes represented by a NOP) is the result of stalling for 1 cycle.
A bubble is something you see and talk about when looking at a pipeline diagram of how instructions go through the pipeline, and what stage they're in at any given cycle. A bubble propagates through the pipeline, so it appears in each stage once. (For a structural hazard like instruction fetch competing with data load/store, the bubble will start in IF, like your first example.)
A stall is something that a single stage decides to do, creating one or more bubbles depending on how long it stalls for.
---
### A row of bubbles vs. a bubble within the row for an instruction
Notice that they've . As if you'd written a NOP in your program to fill the load delay slot (necessary on MIPS I R2000 / R3000 if you can't schedule other instructions to fill it; on later MIPS the ISA guarantees that hardware will stall for you). Except a true `nop` in the machine code still gets fetched and decoded. MIPS doesn't have a special opcode for `nop`, you write one as `add $zero, $zero, $zero` or equivalent with no inputs to stall for and an output of `$zero` which ignores writes, always reads as zero.
Vertical rows are for instructions, not time. Stalls mean that later instructions (or stages of them) start farther to the right, not in the cycle after the current one reaches that stage.
The diagram could indicate the same timing by skipping a clock cycle (column) for the IF stage of the instruction after the load. You could maybe draw one bubble to the of that IF, in the spot where IF would normally fetch it in the cycle after fetching the `lw`.
---
You didn't include the captions in your question, which would probably have explained why they drew it that way. Perhaps showing that leaving a gap before even starting the instruction solve the problem.
A CPU running that code won't know whether or not the instruction after an `lw` depends on the result until it has fetched and decoded it. That's where it checks for hazards. The cycle `add $8, $7, $2` reaches ID is when IF would either be idle or re-fetch the instruction after the `add`.
Your example 2 is the more normal way to draw things, showing a load delay (on MIPS II or later), where the load result isn't available for forwarding until after stalling for a cycle, so ID does that and sets up the forwarding. The instruction not moving forward in the pipeline leaves a bubble that you can see in the next few instructions: note that EX didn't appear in cycle 4. And that MEM didn't appear in cycle 5. etc. That's the bubble moving through the pipeline over time.
The same instruction staying around in `reg reg` (decode) is the back pressure created by the stall to open up that bubble.
---
### A row of 5 bubbles due to a structural hazard on instruction fetch
but for a different reason than your example 1. It's talking about a machine without split L1i / L1d caches, or with no cache and single-ported memory, hence IM/DM (instruction memory / data memory stages). You omitted the caption, which is
> The structural hazard causes pipeline bubbles to be inserted. The effect is that no instruction will finish during clock cycle 8, when instruction 3 would normally have finished. (Instruction 1 is assumed to not be a load or store; otherwise, instruction 3 cannot start execution).
The "code" and pipeline diagram is figure 3.9: A pipeline stalled for a structural hazard - a load with one memory port.
```
load IF ID EX MEM WB
instruction 1 IF ID EX MEM WB
instruction 2 IF ID EX MEM WB
instruction 3 (stall) IF ID EX MEM WB ; (would be in IF at the same time the load is in MEM, structural hazard)
instruction 4 IF ID EX MEM WB
```
Figure 3.6 shows the conflict if you don't have a stall/bubble. In the 2nd edition of the book, they actually label both the first and fourth pipeline stages as MEM, instead of IF/MEM or IM/DM.
I don't know if my copy of the textbook has a diagram like yours at some later point when they're talking about data hazards. I didn't flip through it further. Perhaps they're showing how an idle cycle there would make the dependency work, and will go on to show what really happens, that the CPU has to fetch and decode to discover the hazard.
---
Another answer claims that a stall would let the control signals go down the pipeline unchanged instead of inserting a NOP, but that doesn't sound right or seem practical.
Letting `add $8, $7, $2` go through the pipeline with a wrong value for the `$7` input doesn't seem not directly harmful; a scalar in-order pipeline doesn't have WAW or WAR hazards so letting it reach the WB stage and write a wrong value into the register file isn't going to hurt correctness of other instructions; the right value will get written in the next cycle, when the instruction goes through the pipeline again with the right value this time... Unless an interrupt is taken in that cycle while the register file holds the wrong value!! Then there's an architecturally-visible wrong value.
It would also be a problem for memory operations to let them run in the MEM stage with potentially a bad pointer as part of the addressing mode. You could get a spurious TLB miss or page fault, or a store to the wrong place.
So very likely a stage that detects a stall would mux some of the control bits to send a NOP down the pipe, or there'd be a dedicated control line for NOP/bubble to deactivate stages.
| null | CC BY-SA 4.0 | null | 2023-02-03T20:45:14.470 | 2023-02-03T20:45:14.470 | null | null | 224,132 | null |
75,340,906 | 2 | null | 75,340,755 | 1 | null | Using [rpow](https://pandas.pydata.org/docs/reference/api/pandas.Series.rpow.html):
```
df['2^Value'] = df['Value'].rpow(2)
```
Output:
```
Value 2^Value
0 0 1
1 1 2
2 2 4
3 3 8
4 4 16
```
| null | CC BY-SA 4.0 | null | 2023-02-03T20:48:39.660 | 2023-02-03T20:48:39.660 | null | null | 16,343,464 | null |
75,340,918 | 2 | null | 75,340,021 | 1 | null | You can specify week systems in the `WEEKNUM` DAX function as an optional second argument.
The default for this optional parameter is system 1, where week 1 is the week that contains January 1st. System 2 sets week 1 as the week containing the first Thursday of the new year, which is ISO 8601 compliant.
Try this:
```
Week = WEEKNUM ( 'Date'[Date] , 2 )
```
If you are calculating this in Power Query, the calculation is much more complex, for some reason. See this link for a solution: [https://datacornering.com/how-to-calculate-iso-week-number-in-power-query/](https://datacornering.com/how-to-calculate-iso-week-number-in-power-query/)
| null | CC BY-SA 4.0 | null | 2023-02-03T20:50:35.130 | 2023-02-03T20:50:35.130 | null | null | 16,528,000 | null |
75,341,009 | 2 | null | 75,336,094 | 1 | null | What you're seeing in your screenshot (suggestions for `dba_<etc.>`) are not coming from any extension. One can verify that by running the command `Developer: Reload With Extensions Disabled` and trying triggering suggestions again. So this is just functionality that comes out-of-box with a standard VS Code installation. You don't even need to install any PHP extension to get this.
As for your custom snippets getting "overwritten", it's hard to tell without more detail why this is happening. If you're on version 1.75, it might just be due to a bug that will be fixed later (Ex. As was the case in this other recent Q&A: [Visual Studio Code's recent update is disrupting autocompletion](https://stackoverflow.com/q/75340072/11107541)).
As [@Mark](https://stackoverflow.com/users/836330/mark) showed in [their answer](https://stackoverflow.com/a/75341123/11107541), these are function suggestions. You can disable function suggestions with the following setting:
> ```
"[php]": {
"editor.suggest.showFunctions": false
}
```
| null | CC BY-SA 4.0 | null | 2023-02-03T21:03:03.813 | 2023-02-03T23:09:04.540 | 2023-02-03T23:09:04.540 | 11,107,541 | 11,107,541 | null |
75,341,123 | 2 | null | 75,336,094 | 1 | null | Those icons indicate that those are `Methods and Functions` (not Snippets). See [What do the Intellisense icons mean](https://stackoverflow.com/a/57679985/836330).
So you can try to disable two settings in your Settings UI:
```
Editor > Suggest: Show Methods
Editor > Suggest: Show Functions - this looks like the right one to disable
```
Of course, there might be situations where you want to see Function suggestions, so you will have to see if disabling the setting is acceptable.
You can disable those Function suggestions for `php` files only with this setting (in your `settings.json`):
```
"[php]": {
"editor.suggest.showFunctions": false
}
```
| null | CC BY-SA 4.0 | null | 2023-02-03T21:20:12.547 | 2023-02-03T21:20:12.547 | null | null | 836,330 | null |
75,342,095 | 2 | null | 57,753,240 | 0 | null | It could be because of .
If you see here in the Network tab that means everything is fine.
You can test on a private window if you want just to double check.
[](https://i.stack.imgur.com/pGBiu.png)
| null | CC BY-SA 4.0 | null | 2023-02-04T00:02:10.690 | 2023-02-04T00:02:10.690 | null | null | 5,032,071 | null |
75,342,318 | 2 | null | 75,317,524 | 0 | null | If you don't want a field required you can set the attribute blank=True in the model class. A question I have is why would you want to have a Foreignkey to just a city name. Or are you trying to use the a list of cities to populate the drop down? In that case the Foreign Key is definitely not the answer.
| null | CC BY-SA 4.0 | null | 2023-02-04T00:56:32.007 | 2023-02-04T00:56:32.007 | null | null | 19,063,121 | null |
75,342,390 | 2 | null | 75,340,339 | 0 | null | You need to use a fixed width (or monospaced) font, for example "Courier New", for the label:
```
def show_log(self):
self.label_show_log = tk.Label(self.master, text=fu.show_log(),
borderwidth=2, relief="groove",
font=("Courier New", 10))
self.label_show_log.pack()
```
Result:
[](https://i.stack.imgur.com/c5Kj1.png)
| null | CC BY-SA 4.0 | null | 2023-02-04T01:19:03.850 | 2023-02-04T01:19:03.850 | null | null | 5,317,403 | null |
75,342,406 | 2 | null | 75,342,176 | 0 | null | The problem is that you're setting the `x` coordinate to `i - 0.5` when you hit a multiple of 5. But you really just always want that `x` coordinate to be 4.5.
```
modulo <- 5
for (i in 1:25){
if (i %% modulo == 0){
text(modulo - 0.5, (i%/%5 - 1) + 0.5, labels = as.character(i))
# or just text(4.5 ...)
} else {
text(i%%5 - 0.5, i%/%5 + 0.5, labels = as.character(i))
}
}
```
[](https://i.stack.imgur.com/ngtgs.png)
| null | CC BY-SA 4.0 | null | 2023-02-04T01:24:53.757 | 2023-02-04T01:24:53.757 | null | null | 2,799,941 | null |
75,342,593 | 2 | null | 75,342,491 | 0 | null | Here is how I fixed this:
I exported all the data I could to Excel from the corrumpted database and then removed problematic data in Excel manually.
I exported same data of the most recent backup in Excel too.
I merged all the data into excel. Verified the data manually and with formulas comparing differences between sheets.
I then deleted all the entries in Access tables.
I imported the data from Excel sheets to Access tables.
The problem seems to be gone.
| null | CC BY-SA 4.0 | null | 2023-02-04T02:35:45.003 | 2023-02-08T15:32:42.147 | 2023-02-08T15:32:42.147 | 20,225,934 | 20,225,934 | null |
75,342,678 | 2 | null | 75,043,281 | 0 | null | The magic for that behavior lives over in [https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/key-bindings.zsh](https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/key-bindings.zsh)
It works just fine on its own outside of omz
Copy, paste, attribute :)
| null | CC BY-SA 4.0 | null | 2023-02-04T03:03:46.827 | 2023-02-04T03:03:46.827 | null | null | 1,201,033 | null |
75,342,750 | 2 | null | 75,342,176 | 0 | null | Here is a different approach without any loops or divisions:
```
mat <- matrix(1:25, 5, byrow=TRUE)
plot(NA, xlim=c(0, 5), ylim=c(0, 5), axes=FALSE, xlab="", ylab="")
segments(rep(0, 5), 0:5, rep(5, 5), 0:5)
segments(0:5, rep(0, 5), 0:5, rep(5, 5))
text(row(mat)-.5, col(mat)-.5 , t(mat))
```
[](https://i.stack.imgur.com/aqgSM.png)
| null | CC BY-SA 4.0 | null | 2023-02-04T03:28:37.140 | 2023-02-04T03:28:37.140 | null | null | 1,580,645 | null |
75,342,823 | 2 | null | 75,321,423 | 0 | null | check this out this can be accomplished by using box.
```
Box(modifier = Modifier.fillMaxWidth()) {
var size by remember { mutableStateOf(Size.Zero) }
val height: @Composable () -> Dp = { with(LocalDensity.current) { size.height.toDp() } }
Text(
text = longText,
modifier = Modifier
.padding(8.dp)
.fillMaxWidth(.45F)
// if second text is larger than first text call it on second text
.onGloballyPositioned { size = it.size.toSize() },
textAlign = TextAlign.Justify
)
Divider(
modifier = Modifier
.width(1.dp)
.height(height())
.align(Alignment.Center),
color = Color.Black
)
Text(
text = longText,
modifier = Modifier
.padding(8.dp)
.align(Alignment.TopEnd)
.fillMaxWidth(.45F),
textAlign = TextAlign.Justify
)
}
```
| null | CC BY-SA 4.0 | null | 2023-02-04T03:50:36.877 | 2023-02-04T03:50:36.877 | null | null | 12,741,503 | null |
75,342,944 | 2 | null | 74,954,421 | 0 | null | It appears that you've come across a typographical error in your `tsconfig.json` file.
1. The target attribute has been set to ES6, when it should have been assigned to ES2017.
2. The lib option requires a change: It should consist of an array of strings, featuring ES2017 among them.
Here is the revised `tsconfig.json` configuration :
```
{
"compilerOptions": {
"target": "ES2017",
"lib": [
"ES2017"
]
}
}
```
| null | CC BY-SA 4.0 | null | 2023-02-04T04:26:00.343 | 2023-02-04T04:26:00.343 | null | null | null | null |
75,343,073 | 2 | null | 75,343,031 | -1 | null | change the code to this format
```
<label class="btn btn-primary">
<input type="radio" name="skala" id="1" checked>1
</label>
```
change `input checked="checked"` to `input checked="true"` or `input checked`
the `checked` property's default value is `true`
| null | CC BY-SA 4.0 | null | 2023-02-04T05:01:14.160 | 2023-02-04T05:01:14.160 | null | null | 19,300,114 | null |
75,343,448 | 2 | null | 74,680,976 | 0 | null | Windows comes with dummy python executables `python.exe` and `python3.exe` that take you to the microsoft store to install it- after which it is a real python executable instead of a dummy one. If you run `where python`, you'll get a list of all the python executables that are found via the `PATH` variable in the order that they are found in the `PATH`, where one of them will be the Windows one (instead of the one you installed from the Python website). The one you'll see listed first will probably be `C:\Users\you\AppDate\Local\Microsoft\WindowsApps\python.exe` (or something like that). (see related question: [Why can't I run python in git bash and visual studio code?](https://stackoverflow.com/q/75233668/11107541))
The behaviour you're observing is due to the fact that Windows searches the `PATH` from left to right / first to last (see related question: [What's the relative order with which Windows search for executable files in PATH?](https://stackoverflow.com/q/1653472/11107541)), and the combined `PATH` formed from the system `PATH` and user `PATH` puts the system `PATH` the user `PATH` (see related question: [User vs. System Environment Variables: Do System Variables Override User Variables?](https://superuser.com/q/867728/1749748)).
| null | CC BY-SA 4.0 | null | 2023-02-04T06:44:30.713 | 2023-02-04T06:44:30.713 | null | null | 11,107,541 | null |
75,343,664 | 2 | null | 71,501,256 | 0 | null | TL;DR
Put your images in the static directory, just like below, use it in markdown like `` or `` if you don't want to build a post folder
---
If you search the hugo documentation, you can find [Image Processing | Hugo](https://gohugo.io/content-management/image-processing/#page-resources)
But! That's no a markdown way to insert an image. If you don't miss the , you will find the Directory, which says can store images, that's it!
```
[static](https://gohugo.io/content-management/static-files/)
Stores all the static content: **images**, CSS, JavaScript, etc. When Hugo builds your site, all assets inside your static directory are copied over as-is. A good example of using the static folder is for verifying site ownership on Google Search Console, where you want Hugo to copy over a complete HTML file without modifying its content.
```
Put your images in the static directory, just like below, use it in markdown like `` or `` if you don't want to build a post folder
```
static
βββ images
βββ my_post_folder
βΒ Β βββ my_image.png
βββ my_image2.jpg
```
| null | CC BY-SA 4.0 | null | 2023-02-04T07:39:50.827 | 2023-02-04T07:39:50.827 | null | null | 1,764,735 | null |
75,343,798 | 2 | null | 75,268,338 | 1 | null | These colours in the explorer view are called "git decorations". They are enabled by default in workspaces that have an associated git repository, and the colours indicate what has changed about the file.
- - -
> and I find the coloring annoying.
If you want to turn git decorations off, you can do so by putting the following in your user settings.json, or in your workspace's `.vscode/settings.json` file:
```
"git.decorations.enabled": false
```
| null | CC BY-SA 4.0 | null | 2023-02-04T08:14:50.413 | 2023-02-05T23:26:52.027 | 2023-02-05T23:26:52.027 | 11,107,541 | 11,107,541 | null |
75,344,037 | 2 | null | 36,862,308 | 0 | null | There's a specialized pandas function `pd.json_normalize()` that converts json data into a flat table. Since the data to be converted into a dataframe is nested under multiple keys, we can pass the path to it as a list as the `record_path=` kwarg. The path to `values` is `tags` -> `results` -> `values`, so we pass it as a list.
```
# first load the json file
import json
with open(file_path, 'r') as f:
data = json.load(f)
# convert `data` into a dataframe
df = pd.json_normalize(data, record_path=['tags', 'results', 'values']).set_axis(['time', 'temperature', 'quality'], axis=1)
```
[](https://i.stack.imgur.com/PPnoh.png)
| null | CC BY-SA 4.0 | null | 2023-02-04T09:08:45.487 | 2023-02-04T09:08:45.487 | null | null | 19,123,103 | null |
75,344,180 | 2 | null | 75,335,136 | 0 | null | The error is happening because the `index` gets out of range. The `xLabels` has a length of while the actual `data` has a length of .
You can either add extra labels for the x-axis or reduce the data back to 12.
The YAxis has the same issue. I see you want to "group" them with some labels. You can use the `numberOfTicks` prop with the `yLabels.length`. Then when formatting the label you can use the `index`.
```
<YAxis
style={{ marginRight: 10 }}
data={data}
contentInset={{ top: 20, bottom: 20 }}
numberOfTicks={yLabels.length}
formatLabel={(value, index) => yLabels[index]}
/>
```
I found something with the `min` and `max` of the `YAxis`. If they're provided the error is gone.
```
<YAxis
style={{ marginRight: 10 }}
data={data}
contentInset={{ top: 20, bottom: 20 }}
min={-60}
max={100}
numberOfTicks={yLabels.length}
formatLabel={(value, index) => yLabels[index]}
/>
```
For the layout:
```
<View style={{ height: 200, margin: 20, marginTop: 60, flexDirection: "row" }}>
<YAxis
style={{ marginRight: 10 }}
svg={{
fill: "grey",
fontSize: 10,
}}
contentInset={{ top: 20, bottom: 20 }}
/>
<View
style={{
flex: 1,
}}
>
<LineChart
style={{ flex: 1 }}
svg={{ stroke: "rgb(134, 65, 244)" }}
contentInset={{ top: 20, bottom: 20 }}
/>
<XAxis
contentInset={{ left: 10, right: 10 }}
svg={{
fill: "grey",
fontSize: 10,
}}
/>
</View>
</View>
```
| null | CC BY-SA 4.0 | null | 2023-02-04T09:37:10.213 | 2023-02-07T08:26:33.710 | 2023-02-07T08:26:33.710 | 20,088,324 | 20,088,324 | null |
75,344,346 | 2 | null | 75,343,774 | 0 | null | As stated in this [link](https://github.com/mdbootstrap/Tailwind-Elements/issues/1058), you should import tw-elements in a useEffect in the _app file, not in the same component that you use them in.
/_app.jsx/tsx
```
function MyApp({ Component, pageProps }: AppProps) {
useEffect(() => {
const use = async () => {
(await import('tw-elements')).default;
};
use();
}, []);
return <Component {...pageProps} />;
}
export default MyApp;
```
There is also another solution to use the _document.js file and Script element to use the script for tw_elements
```
import { Html, Head, Main, NextScript } from 'next/document'
import Script from 'next/script'
// import 'tw-elements';
export default function Document() {
return (
<Html>
<Head />
<body>
<Main />
<NextScript />
<Script src="./TW-ELEMENTS-PATH/dist/js/index.min.js"/>
</body>
</Html>
)
}
```
but I don't recommend it as _document.js will be replaced soon in the upcoming updates for NextJS
| null | CC BY-SA 4.0 | null | 2023-02-04T10:04:59.840 | 2023-02-04T10:04:59.840 | null | null | 15,428,767 | null |
75,344,782 | 2 | null | 73,133,515 | 0 | null | I'm searching fix for this issue too. For now I find, that trouble connected with colorscheme. Try :colorscheme . For me it fix this problem. But I doesn't found how to fix it without hand set.
| null | CC BY-SA 4.0 | null | 2023-02-04T11:29:37.500 | 2023-02-04T11:29:37.500 | null | null | 1,893,975 | null |
75,345,146 | 2 | null | 75,344,796 | 1 | null | You need to map `alpha` to the calculated `level` within `stat_density2d_filled`, using `alpha = after_stat(level)` inside `aes`. Just tweak the `breaks` argument to define where you want the contour cutoffs to be. I also found that adjusting the `h` argument to set a slightly wider bandwidth than the default worked better than the default setting with this particular data set. Additionally, a call to `scale_alpha_manual` will give you fine control over the opacity of each band - here I set a sequence of six values between 0 and 1, since only the first 5 will be used, meaning that the most dense bands still won't be fully opaque and "overpower" the points.
```
library(ggplot2)
ggplot(iris, aes(Petal.Length, Sepal.Length, fill = Species)) +
stat_density2d_filled(aes(alpha = after_stat(level)),
h = c(1, 1), breaks = c(0, 0.03, 0.1, 0.25, 0.5, 5)) +
geom_point(shape = 21, size = 3) +
scale_alpha_manual(values = seq(0, 1, length = 6)) +
theme_minimal(base_size = 20) +
coord_equal(expand = FALSE) +
theme(legend.position = "none",
panel.border = element_rect(color = "gray80", fill = NA))
```
[](https://i.stack.imgur.com/VpuB1.png)
| null | CC BY-SA 4.0 | null | 2023-02-04T12:39:54.160 | 2023-02-04T12:58:44.603 | 2023-02-04T12:58:44.603 | 12,500,315 | 12,500,315 | null |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.