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,511,939 | 2 | null | 75,511,847 | 1 | null | Wonderous is open source, you can just look at the original implementation and try to understand how it was implemented. In the code, swiping in all directions is handled by the EightWaySwipeDetector.
[https://github.com/gskinnerTeam/flutter-wonderous-app/blob/main/lib/ui/screens/photo_gallery/photo_gallery.dart](https://github.com/gskinnerTeam/flutter-wonderous-app/blob/main/lib/ui/screens/photo_gallery/photo_gallery.dart)
| null | CC BY-SA 4.0 | null | 2023-02-20T16:36:06.240 | 2023-02-20T16:36:06.240 | null | null | 5,812,524 | null |
75,512,239 | 2 | null | 74,745,255 | 0 | null | I had the same problem, it printed exactly 420 blank pages more. I just added this to my custom css file:
```
.chartjs-size-monitor-expand > div {
position: fixed !important;
}
```
| null | CC BY-SA 4.0 | null | 2023-02-20T17:05:30.923 | 2023-02-24T10:55:25.087 | 2023-02-24T10:55:25.087 | 14,267,427 | 21,252,075 | null |
75,512,634 | 2 | null | 75,478,657 | 1 | null | Looks like a bug that has now been identified: [https://github.com/microsoft/vscode-js-debug/issues/1561](https://github.com/microsoft/vscode-js-debug/issues/1561)
| null | CC BY-SA 4.0 | null | 2023-02-20T17:51:38.783 | 2023-02-20T17:51:38.783 | null | null | 12,121,864 | null |
75,512,874 | 2 | null | 26,941,135 | 0 | null | Even easier: you can get Plotly to show a 3d scatter trace in the legend by passing the keyword argument `showlegend=True` to the `Scatter3d` function.
| null | CC BY-SA 4.0 | null | 2023-02-20T18:24:29.157 | 2023-02-20T18:24:29.157 | null | null | 9,975,651 | null |
75,513,104 | 2 | null | 4,651,092 | 0 | null | With a one-liner:
```
perl -E '
say join "\n",
sort { -M $a <=> -M $b }
grep -f, @ARGV
' -- *
```
| null | CC BY-SA 4.0 | null | 2023-02-20T18:48:10.900 | 2023-02-21T17:21:32.773 | 2023-02-21T17:21:32.773 | 465,183 | 465,183 | null |
75,513,474 | 2 | null | 75,486,900 | 0 | null | Your calculus seems correct.
I check it with simple linear regression for LMSE (Least Mean Square Error). The result is :
[](https://i.stack.imgur.com/wyFUT.gif)
The fitting appears better for large values of y than for small values of y. This is what is expected with criteria of fitting LMSE. Probably this is the criteria of fitting implicitly implemented in your software.
But the result is different for each different criteria of fitting. For example if we specify LMSRE (Least Mean Square Relative Error) we obtain :
[](https://i.stack.imgur.com/pcrnF.gif)
The fitting appears better for small values of y than for large values of y. This is what is expected with LMSRE.
Of course one can specify other criteria of fitting (LMAE for example ) or many others depending on the context in practical application. For each specified criteria of fitting the fitting will be more or less different deppending on the scatter of the points.
| null | CC BY-SA 4.0 | null | 2023-02-20T19:36:35.000 | 2023-02-20T19:36:35.000 | null | null | 6,819,132 | null |
75,513,530 | 2 | null | 75,511,651 | -1 | null | So, as one of commenters pointed out, the classes for view controller in stroyboard were UIViewController, while the class I used were custom ViewController and SettingsViewController. All I had to do was to go in my stroyboard and set the module from which these controllers come to the current one
| null | CC BY-SA 4.0 | null | 2023-02-20T19:45:05.383 | 2023-02-20T19:45:05.383 | null | null | 16,607,154 | null |
75,514,015 | 2 | null | 8,067,448 | 0 | null | In Windows Server 2022, go to "Add roles and features"
Web Server (IIS) -> Web Server -> Security -> Windows Authentication
| null | CC BY-SA 4.0 | null | 2023-02-20T20:49:53.107 | 2023-02-27T11:22:32.350 | 2023-02-27T11:22:32.350 | 3,545,572 | 3,545,572 | null |
75,514,063 | 2 | null | 21,712,419 | 0 | null | I just ran into the same problem; I changed the encoding from 'Westeuropean (Windows)' to 'Unicode (UTF-8)' and that did the trick. The problem probably had to do with this invisible 'character' in one of the fieldnames: "observer".
| null | CC BY-SA 4.0 | null | 2023-02-20T20:56:28.590 | 2023-02-20T20:56:28.590 | null | null | 19,085,759 | null |
75,514,254 | 2 | null | 75,484,541 | 0 | null | Check how you are passing the PK value. It will likely need to be an integer and not a string value.
Also, as Hemal noted, it's best that you share your code: views.py, any serializer, and possibly even your models.py.
| null | CC BY-SA 4.0 | null | 2023-02-20T21:22:17.623 | 2023-02-20T21:22:17.623 | null | null | 19,545,589 | null |
75,514,279 | 2 | null | 75,514,234 | 1 | null | Every query you run on Firestore needs to have an index that matches its conditions and ordering statement. For that first query the index is auto-generated, but the other queries look like they'll all need a composite index that you need to explicitly tell Firestore to generate.
The easiest way to generate the required index is to:
1. Catch any error that your code may raise and log them.
2. Find the error message in the log output.
3. Find the URL link in there and click it.
4. This takes you to the Firestore console, on a page to generate the index, with all details for the index already filled out. So all you have to do it.
5. Click the button to start generating the index.
Wait for the index to be generated (this may take some time), and then try again.
Also see the Firestore documentation on its [index types](https://firebase.google.com/docs/firestore/query-data/index-overview).
| null | CC BY-SA 4.0 | null | 2023-02-20T21:24:25.513 | 2023-02-20T21:24:25.513 | null | null | 209,103 | null |
75,514,414 | 2 | null | 64,002,774 | 0 | null | I found the answer to this question here: [i used laravel pagination links, but i got big icos. < > call in tailwind css code](https://stackoverflow.com/questions/67210563/i-used-laravel-pagination-links-but-i-got-big-icos-call-in-tailwind-css-co)
You need to add this line to tailwind.config.js under content:
```
'./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
```
| null | CC BY-SA 4.0 | null | 2023-02-20T21:43:44.983 | 2023-02-20T21:43:44.983 | null | null | 395,224 | null |
75,514,528 | 2 | null | 70,366,949 | 0 | null | I'm a bit late but someone could have the same issue and maybe I'll help a poor soul.
Check [https://github.com/L3MON4D3/LuaSnip/issues/525](https://github.com/L3MON4D3/LuaSnip/issues/525)
In short, you can use
```
luasnip.setup({
region_check_events = "CursorHold,InsertLeave",
-- those are for removing deleted snippets, also a common problem
delete_check_events = "TextChanged,InsertEnter",
})
```
and that should solve your problem.
From L3MON4D3:
> This is just the default-behaviour of luasnip, placeholders are always
visited in order (including the $0, which is the one you're jumping
back into) (and that does not depend on cursor-movement), so if a
snippet is not jumped "through", you'll end up back in it, regardless
how the cursor moved.This can be adjusted by passing a few options to `luasnip.setup`:
`region_check_events` are the auto-events, on which a check if the
cursor is still inside the active snippet is performed. If it is not,
the snippet will be jumped "through"/completed/left, so you won't jump
back into it.
Hope this helps
| null | CC BY-SA 4.0 | null | 2023-02-20T21:58:20.440 | 2023-02-20T21:58:20.440 | null | null | 9,616,711 | null |
75,515,004 | 2 | null | 42,966,381 | 0 | null |
Here's an extension to provide a `textView.lineSpacing` getter & setter:
```
extension UITextView {
/// Gets & Sets line spacing via `typingAttributes`.
/// Preserves defined `style` and `textColor`.
var lineSpacing: CGFloat {
get {
if let style = typingAttributes[NSAttributedString.Key.paragraphStyle] {
return (style as! NSMutableParagraphStyle).lineSpacing
}
return 0
}
set {
let style = NSMutableParagraphStyle()
style.lineSpacing = newValue
let attributes = [
NSAttributedString.Key.paragraphStyle: style,
NSAttributedString.Key.foregroundColor: textColor,
NSAttributedString.Key.font: font
]
typingAttributes = attributes as [NSAttributedString.Key : Any]
}
}
}
```
It can be used when initialising the `UITextView` like so:
```
textView.font = UIFont.systemFont(ofSize: 18)
textView.textColor = UIColor.purple
textView.lineSpacing = 3.4
```
| null | CC BY-SA 4.0 | null | 2023-02-20T23:08:26.610 | 2023-02-20T23:08:26.610 | null | null | 5,970,728 | null |
75,515,481 | 2 | null | 75,515,392 | 4 | null | Using `tidyr::expand_grid()`, create a `place_facet` column with unique values of `place` and cross it with the initial data. This will give you an expanded dataframe that reproduces your original data once for each facet. Then plot two layers of bars: one in gray using all values, and another in color for just the values where `place` and `place_facet` match.
```
library(tidyr)
library(dplyr)
library(ggplot2)
library(ggthemes)
df1 %>%
tidyr::expand_grid(place_facet = unique(.$place)) %>%
mutate(values_facet = ifelse(place == place_facet, values, NA)) %>%
ggplot(aes(x = place)) +
geom_col(
aes(y = values, group = cost_other),
position = "dodge",
fill = "gray"
) +
geom_col(
aes(y = values_facet, fill = cost_other),
position = "dodge",
show.legend = FALSE
) +
facet_wrap(~place_facet) +
theme_calc() +
theme(axis.text.x = element_blank())
```
[](https://i.stack.imgur.com/edjrf.jpg)
| null | CC BY-SA 4.0 | null | 2023-02-21T01:05:16.350 | 2023-02-21T01:18:44.270 | 2023-02-21T01:18:44.270 | 17,303,805 | 17,303,805 | null |
75,515,765 | 2 | null | 75,515,620 | 0 | null | table_rows contains a list of all the divs found here:
```
table_rows = soup.find_all('div', class_='table-responsive-sm')
```
Use something like this:
```
tr_list = []
for div in table_rows:
for tr in div.find_all('tr'):
tr_list.append(tr)
```
With that, you are going through the list of `div's` inside `table_rows`, extracting a list of `tr's`, going through that new list and attributing each `tr` to the `tr_list`.
EDIT:
You can make the code above into a single line using list comprehension, just make sure all that is happening is clear to you.
| null | CC BY-SA 4.0 | null | 2023-02-21T02:21:48.083 | 2023-02-21T02:38:57.887 | 2023-02-21T02:38:57.887 | 21,237,368 | 21,237,368 | null |
75,515,828 | 2 | null | 75,513,502 | 0 | null | What was causing the duplicated image was the react strict mode, when in development React executes all useEffects twice, to help catch some bugs. You could disable it (by removing the strictmode tags) to prevent this, but it's not recommended.
```
<StrictMode>
<App />
</StrictMode>
```
So to stop this i added logic to the fetch, the param isFetchingMore, in the useEffect it's used with the default value (false)
Other thing that was necessary to make it work was to create refs for the loading and page, when you add a manual event listener, it doesn't get the updated state, it get's only the initial value. For that it's necessary to use refs.
Here are the changes:
[https://codesandbox.io/s/cocky-mopsa-5ho92v?file=/src/App.js](https://codesandbox.io/s/cocky-mopsa-5ho92v?file=/src/App.js)
| null | CC BY-SA 4.0 | null | 2023-02-21T02:37:25.453 | 2023-02-21T13:19:13.483 | 2023-02-21T13:19:13.483 | 19,223,586 | 19,223,586 | null |
75,515,963 | 2 | null | 75,515,620 | 0 | null | `find_all()` returns a ResultSet which contains all matching elements. ResultSet objects do not have a `.find_all()` method, as the error says.
What you actually wanted to do was iterate over each `<div>` element in the result, and then call `.find_all()` on each of elements:
```
for div in soup.find_all('div', class_='table-responsive-sm')
for tr in div.find_all('tr'):
# do stuff
```
| null | CC BY-SA 4.0 | null | 2023-02-21T03:10:44.827 | 2023-02-21T03:10:44.827 | null | null | 494,134 | null |
75,516,047 | 2 | null | 29,256,693 | 0 | null | "Show Solution Changes" will greyed out when your solution is in OFFLINE mode, make sure you turn it ONLINE by following below steps.
[](https://i.stack.imgur.com/BFUy8.png)
| null | CC BY-SA 4.0 | null | 2023-02-21T03:29:48.280 | 2023-02-21T03:29:48.280 | null | null | 1,021,753 | null |
75,516,095 | 2 | null | 75,510,153 | 0 | null | Yes, you can.
With Pentaho, It is easy and simple.
You use "Run SSH commands" in Transfomer.
1, Declare connection to ssh server in General tab:
[](https://i.stack.imgur.com/5zHpt.png)
2, Put your command in Setting tab:
[](https://i.stack.imgur.com/V4EwB.png)
| null | CC BY-SA 4.0 | null | 2023-02-21T03:40:17.377 | 2023-02-21T03:40:17.377 | null | null | 14,732,841 | null |
75,516,115 | 2 | null | 49,228,926 | 0 | null | If you are using :
```
SELECT DISTINCT CITY FROM STATION WHERE CITY NOT LIKE '[AEIOU]%' OR CITY NOT LIKE '%[aeiou]';
```
I noticed that most answers here uses "AND", but the question is to select cities that starts with a vowel or ends with a vowel. So you should be using .
| null | CC BY-SA 4.0 | null | 2023-02-21T03:44:13.087 | 2023-02-21T03:44:13.087 | null | null | 3,502,734 | null |
75,516,233 | 2 | null | 75,516,161 | -1 | null | As they are in the same directory, you don't need the absolute path. Enough:
```
from mul_two import mul_2
print(mul_2(4))
```
If your directory structure is:
```
- mult/
- mul_two.py
- main.py
```
add `mult/__init__.py`so that python can see this folder as a module
# EDIT
Python doesn't know what the root of your project is, nothing tells it that your `any_name` folder is the root.
What it gives is to inform that a folder is a , creating the file `__init__.py`.
When you run `python3 multiply/mult_test1.py` mult_test1 is your root
```
# example
from calc.mul_two import mul_2 #ERROR
from mul_two import mul_2 #SUCCESS
print(mul_2(4))
```
But, if you run `python3 main.py` that folder is your root:
```
# YOUR /MULT/MULT_TEST1.PY FILE
from mult.mul_two import mul_2
def mytest():
print(mul_2(4))
# YOUR MAIN.PY FILE
from calc.mul_test1 import mytest
mytest()
```
# REFERENCE
[https://realpython.com/absolute-vs-relative-python-imports/](https://realpython.com/absolute-vs-relative-python-imports/)
| null | CC BY-SA 4.0 | null | 2023-02-21T04:12:31.787 | 2023-02-22T00:58:33.337 | 2023-02-22T00:58:33.337 | 14,592,332 | 14,592,332 | null |
75,516,316 | 2 | null | 75,515,721 | 0 | null | I got your Point and I have cloned your code and configured and successfully able to run your application.
The exception you are getting "Error creating bean with name 'entityManagerFactory'" because you have not defined the speaker model as entity and if once you will define it as @entity annotation you have add primary key also.
I have corrected your code and pushed it on my git hub for your reference [corrected_code_url](https://github.com/amisham96/stack_overflow_answer)
attaching screenshots that I am successfully able to run and craeted tables also in mysql database.
[](https://i.stack.imgur.com/yERHI.png)
[](https://i.stack.imgur.com/VVRgu.png)
[](https://i.stack.imgur.com/6zVIi.png)
| null | CC BY-SA 4.0 | null | 2023-02-21T04:32:30.663 | 2023-02-21T06:58:27.970 | 2023-02-21T06:58:27.970 | 21,201,506 | 21,201,506 | null |
75,516,476 | 2 | null | 74,791,058 | 0 | null | try to run with sanity dev instead of sanity start. If it doesn't work create tailwind.config.js in sanity-folder and add the following code
```
module.exports = {
content:[
'./pages/**/*.{js,ts,jsx,tsx}','./components/**/*.{js,ts,jsx,tsx}','./app/**/*.{js,ts,jsx,tsx}',
],
theme: {
extend: {},
},
plugins: [],
}
```
| null | CC BY-SA 4.0 | null | 2023-02-21T05:05:24.920 | 2023-02-21T05:07:06.907 | 2023-02-21T05:07:06.907 | 4,826,457 | 17,899,078 | null |
75,516,708 | 2 | null | 75,515,986 | 1 | null | It is generally recommended to follow standard Java naming conventions when defining variable names, which typically use camelCase with the first letter of the first word in lowercase and the first letter of each subsequent word in uppercase.
In your case, the variable name "lAlarmTime" does not follow this convention, as it uses an uppercase "A" in the middle of the variable name. You may want to consider renaming the variable to "lastAlarmTime" to make it consistent with the naming convention.
In addition, the "private" keyword indicates that the variable is only accessible within the class in which it is defined. If you want other classes to be able to access this variable, you may want to consider using a getter and/or setter method or changing the access level to "public".
In your case you can use Something like in the below example!..
```
@Data
public class GetAlarmDto {
@JsonProperty("YourCustomName")
private String lAlarmTime;
}
```
| null | CC BY-SA 4.0 | null | 2023-02-21T05:47:50.850 | 2023-02-21T05:47:50.850 | null | null | 18,097,074 | null |
75,516,826 | 2 | null | 75,512,288 | 0 | null | The warning is pointing to the wrong line/file. [This bug will be fixed in the next release.](https://github.com/presidentbeef/brakeman/pull/1761)
However, the "message" in the warning should be clear:
```
Support for Ruby 2.7.6 ends on 2023-03-31
```
> I did try and update to Rails 3.0.0 but I'm getting issues with that so reverted back to 2.7.6.
I assume you meant "Ruby" in this sentence, and that matches with the warning.
> Has anyone come across this and any idea why this particular test could be failing?
There must be a reference to Ruby version 2.7.6 in the `.ruby-version`, `Gemfile`, and/or `Gemfile.lock`. [Ruby 2.7 is expected to be unsupported starting March 31st, 2023](https://www.ruby-lang.org/en/downloads/branches/). Relying on unsupported software means you may be running a version that no longer receives updates when security issues are found. The older the software, the more likely it is to accumulate unfixed security issues.
> I would appreciate if someone can also explain this error section, ie what is weak confidence
Brakeman's warnings about unmaintained/unsupported/end-of-life (EOL) libraries start at "weak" confidence 60 days before EOL date, then "medium" 30 days out, then "high" on/after the EOL date.
| null | CC BY-SA 4.0 | null | 2023-02-21T06:09:15.520 | 2023-02-21T06:09:15.520 | null | null | 194,084 | null |
75,516,877 | 2 | null | 75,516,670 | 0 | null | To hide UIView when a text or number is typed in a textfield, you must add target to your UITextfield like you would add a target to UIButton, But, for a UITextfield the UIControl.Event has to be changed (.editingChanged).
For example:
```
let textField = UITextFiled()
override func viewDidLoad() {
// Add all the required stuffs of UItextfield and add the following code
textField(self, action: #selector(txtValueChanged(_ :)), for: .editingChanged)
}
@objc func txtValueChanged(_ sender: UITextField) {
// You have to hide LeftView,RightView . So, add this code
leftView.isHidden = true
rightView.isHidden = true
}
```
This code will hide the views when a character is typed in UITextfield.
| null | CC BY-SA 4.0 | null | 2023-02-21T06:18:16.007 | 2023-02-21T06:18:16.007 | null | null | 17,152,808 | null |
75,517,004 | 2 | null | 75,516,743 | 3 | null |
1. I cannot reproduce the problem maybe it's the missing "b" on a platform that cares about that?
2. (not fixed) Don't use the suffix .txt for binary files.
3. (not fixed) Consider reworking your struct to proper types at least for leavefrom (date), reason and status (enums). char * instead of fixed strings so you don't write junk to your files.
4. (not fixed) Prefer constants to magic values (10, 15, 20, 20).
```
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct leavedetails {
char staffid[10];
char leavefrom[15];
int leavebalance;
char reason[20];
char status[20];
};
int main() {
struct leavedetails w;
FILE *fp=fopen("temp.txt", "wb");
if(!fp) {
printf("fopen failed when trying to create input file\n");
return 1;
}
fwrite(&(struct leavedetails) {"aa", "01/01/2023", 0, "Annual", "Pending"}, sizeof w, 1, fp);
fwrite(&(struct leavedetails) {"dd", "03/03/2023", 0, "Annual", "Cancelled"}, sizeof w, 1, fp);
fclose(fp);
fp=fopen("temp.txt", "rb");
if(!fp) {
printf("fopen failed when trying to read input file\n");
return 1;
}
FILE *fw=fopen("leavedetails.txt", "wb");
if(!fw) {
printf("fopen failed when trying to create output file\n");
fclose(fp);
return 1;
}
while(fread(&w, sizeof w, 1, fp))
fwrite(&w, sizeof w, 1, fw);
fclose(fw);
fclose(fp);
}
```
and the two files are identical:
```
$ cmp leavedetails.txt temp.txt
```
| null | CC BY-SA 4.0 | null | 2023-02-21T06:36:01.560 | 2023-02-24T21:35:24.450 | 2023-02-24T21:35:24.450 | 9,706 | 9,706 | null |
75,517,221 | 2 | null | 75,512,897 | 0 | null | A simple way is to use `routerLink` to using the `routerLinkActive` functionality. A way here is to bind the data like this:
```
const sections = [{name: "Home", link: ["/home", "other"]},{name: "Contact", link: ["/contact"]}]
```
```
<ul>
<li *ngFor="let link of sections" routerLinkActive="active" [routerLink]="link.link">link.name</li>
</ul>
```
This is a easy way. And if you don't wanna use `routerLink` you need to do it by yourself. One way is to use `ngClass`.
You check if the `activatedRoute` url is as example. Then you set a variable to "home" and check it with `ngClass` like this:
```
activeRoute: string = "";
constructor(
private activatedRoute: ActivatedRoute) {
if (activatedRoute.snapshot['_routerState'].url.indexOf("home") > -1) {
this.activeRoute = "home";
}
}
```
```
<ul>
<li *ngFor="let link of sections" [ngClass]="{ active: activeRoute === 'home'}">link.name</li>
</ul>
```
| null | CC BY-SA 4.0 | null | 2023-02-21T07:08:27.120 | 2023-02-21T07:08:27.120 | null | null | 4,472,932 | null |
75,517,273 | 2 | null | 75,513,989 | 0 | null | Fixed it by providing random ID inside of the for loop
```
for (let i = 0; i < image.length; i++) {
const file = image[i]
if (file !== null) {
let RandomID = ''
for (let i = 0; i < 19; i++) {
let randomId = Math.floor(Math.random() * randomData.length)
RandomID += randomData[randomId]
}
const imageRef = ref(storage, `product/${RandomID}`)
const storageRef = imageRef
console.log(image[i])
promises.push(
uploadBytesResumable(storageRef, file).then((uploadResult) => {
return getDownloadURL(uploadResult.ref)
}),
)
}
}
```
| null | CC BY-SA 4.0 | null | 2023-02-21T07:13:38.633 | 2023-02-21T07:13:38.633 | null | null | 21,098,812 | null |
75,517,370 | 2 | null | 74,816,516 | 0 | null |
I tried many options and above solution as well but got below error
```
----> 5 net = Network(notebook=True, height="750px", width="100%", bgcolor = '#222222', font_color = 'white', select_menu=True, cdn_resources='remote')
TypeError: __init__() got an unexpected keyword argument 'select_menu'
```
Note : same error appears for "filter_menu" as well.
| null | CC BY-SA 4.0 | null | 2023-02-21T07:24:10.340 | 2023-02-21T07:31:12.220 | 2023-02-21T07:31:12.220 | 12,137,316 | 12,137,316 | null |
75,517,531 | 2 | null | 75,103,915 | 0 | null | This seems to be a MacOS + MacOS Korean [IME](https://en.wikipedia.org/wiki/Input_method) + VS Code bug.
What you're seeing looks like a [unicode control picture character](https://en.wikipedia.org/wiki/Control_Pictures). VS Code renders control characters visually by default (the `editor.renderControlCharacters` setting), so either the combination of VS Code and that IME is literally inserting a control picture character, or it is inserting a control character (in which case it is likely the ascii "backspace character" (ascii: 8)) that VS Code is then rendering as a control picture character (U+2408). You can probably find out what character it is by copying from VS Code and pasting it into a tool like [https://onlineunicodetools.com/convert-unicode-to-code-points](https://onlineunicodetools.com/convert-unicode-to-code-points).
An extremely similar issue ticket was opened on VS Code's GitHub repo: [When typing Korean, a red box suddenly appears. #163106](https://github.com/microsoft/vscode/issues/163106) but it was closed due to not providing enough detail to reproduce the issue- specifically- what IME needs to be active, and what sequence of keys can be pressed to reproduce it. Since this is most likely a bug, I doubt anyone here can give you any more information than this- at least- given the amount of information that you have provided. I suggest that you find out how to reproduce the issue (what IME to use and what keypress sequence to input), and create a new issue ticket on the VS Code GitHub repo providing that information (so that it doesn't suffer the same fate of being closed). If you do, link to the previous issue ticket (`#163106`) in your new issue ticket, and post a comment here linking to your new issue ticket for posterity.
| null | CC BY-SA 4.0 | null | 2023-02-21T07:42:39.477 | 2023-02-21T07:47:58.373 | 2023-02-21T07:47:58.373 | 11,107,541 | 11,107,541 | null |
75,517,965 | 2 | null | 75,516,847 | 0 | null | Try using Animator Behaviour Tree and make a Default Status(animation) so that each animation is played, it goes back to Default State.
For choosing the animation you want to play, try adding conditions on your script(ex. when animation1 is done playing, set animation2 next so it can be played when the button is pressed.)
| null | CC BY-SA 4.0 | null | 2023-02-21T08:33:49.530 | 2023-02-21T08:33:49.530 | null | null | 21,256,356 | null |
75,517,983 | 2 | null | 75,517,530 | 0 | null | You pass only the `position` property to your backend, ie.
```
this.employeePositionService.addEmployeePosition({position: data.position} as
```
while returning the whole data object when closing your dialog, ie
```
this.modalRefAdd.close(data);
```
Which probably leads to the wrong object being added to the array here
```
this.modalRefAdd.onClose.subscribe(res => {
if(res != null) {
this.employeePositions = [...this.employeePositions, res];
} else {
close();
}
});
```
You don't seem to be updating your list after sending another `position` to your backend, just something to keep in mind.
| null | CC BY-SA 4.0 | null | 2023-02-21T08:36:01.713 | 2023-02-21T08:36:01.713 | null | null | 12,221,382 | null |
75,518,053 | 2 | null | 75,517,670 | 0 | null | According to the [documentation](https://learn.microsoft.com/en-us/graph/api/workbook-createsession?view=graph-rest-1.0&tabs=http) you need delegated permission `Files.ReadWrite`.
Application permissions are not supported. What I know application permissions are not supported for working with excel workbooks (`/workbook/xxx` endpoints).
| null | CC BY-SA 4.0 | null | 2023-02-21T08:43:04.293 | 2023-02-21T08:43:04.293 | null | null | 2,250,152 | null |
75,518,312 | 2 | null | 62,147,493 | 0 | null | If the problem persist even after you upgrade your gadle version. try restart AS.
| null | CC BY-SA 4.0 | null | 2023-02-21T09:08:39.457 | 2023-02-21T09:08:39.457 | null | null | 2,606,068 | null |
75,518,434 | 2 | null | 46,369,862 | 0 | null | Had to look at options for getting the favicon recently, and a more detailed answer would have helped me. So here we go:
#### How the browser does it
From what I gathered, favicons are provided in three ways:
- `href``<link rel="icon" type="image/x-icon" href="favicon.ico" sizes="72x72"/>`- `href``<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,..."/>`- `favicon.ico`
A long time ago, browsers could only use ICO files, which is a container for one or more bitmap images (BMP or PNG). Today, using `.png` files directly is as popular (it seems to be half and half). It is also possible to use SVG files.
Several sizes can be provided, either through an ICO containing multiple bitmaps of different sizes, or by giving multiple icon link tags with different [size](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-sizes) attribute values. The browsers then picks the one it finds most suitable.
If you want to do it like the browser, you have to look for icon link tags, possibly filtering by the size attribute, and if you find one, figure out if it is a URL or an inline image. If none is found, you should try the default icon at the root URL.
#### In background scripts with "tabs permission"
Apart from checking icon links and fallback, web extensions offer two additional ways to get the current favicon in background scripts, if the extension has the "tabs" permission:
- [tabs.Tab](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/Tab)`favIconUrl`
```
const tabs = await browser.tabs.query({ active: true, currentWindow: true })
const faviconUrl = tabs?.length > 0 ? tabs[0].favIconUrl : null
```
- [tabs.onUpdated](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/onUpdated)
```
browser.tabs.onUpdated.addListener(
(tabId, changeInfo, tab) => console.log('got favicon as ', changeInfo.favIconUrl),
{properties:['favIconUrl']}
)
```
(I found this particularly helpful when changing the favicon, as the initial icon will still be set when loaded, even if you have set a different one in the meantime, and the listener is the only way to detect that reliably)
The tabs API will provide you with the currently used favicon, but you might miss a size that works better for you.
#### Public APIs
Finally, there are several public APIs that provide a lookup service for favicons, which might be the most convenient option, at the cost of another fetch:
```
Google:
<img src="https://s2.googleusercontent.com/s2/favicons?domain=stackoverflow.com&sz=32"/>
DuckDuckGo:
<img src="https://icons.duckduckgo.com/ip3/stackoverflow.com.ico"/>
Icon Horse:
<img src="https://icon.horse/icon/stackoverflow.com"/>
```
(please don't think of the ones above as recommendations, you might find a better or more suitable one for you when searching the web)
And there you go, this is all I know about favicons. Hope it helps.
| null | CC BY-SA 4.0 | null | 2023-02-21T09:20:30.213 | 2023-02-21T09:47:49.533 | 2023-02-21T09:47:49.533 | 4,883,195 | 4,883,195 | null |
75,518,510 | 2 | null | 70,261,432 | 1 | null | In general, it is helpful to observe where the error shows a Nonetype. In this case,
```
rdkit.Chem.rdmolops.ReplaceSubstructs(Mol, NoneType, Mol)
```
The issue was caused because `Chem.MolFromSmiles` was provided with a SMARTS string, like this:
```
`Chem.MolFromSmiles('[NH2:34]')`
```
The solution is to use a `Chem.MolFromSmarts` instead, like this:
```
Chem.MolFromSmarts('[NH2:34]')
```
| null | CC BY-SA 4.0 | null | 2023-02-21T09:27:01.307 | 2023-02-21T09:27:01.307 | null | null | 7,207,930 | null |
75,518,647 | 2 | null | 75,518,360 | 0 | null | Courtesy of [this answer](https://askubuntu.com/a/25606/1624654) on askubuntu.com by [@StefanoPalazzo](https://askubuntu.com/users/1067/stefano-palazzo):
> First, create a new file called `.pythonstartup.py` in your home directory. Put the following script in it:```
try:
import readline
except ImportError:
print("Module readline not available.")
else:
import rlcompleter
readline.parse_and_bind("tab: complete")
```
The parentheses around the string ensure that it works with both Python 2 and Python 3.Every time the interactive interpreter is started, it executes a script defined in `$PYTHONSTARTUP`, if there is one. To set it to execute the above script, type```
export PYTHONSTARTUP="~/.pythonstartup.py"
```
You should write this line to your [.bashrc or .bash_profile](https://askubuntu.com/questions/1528/bashrc-or-bash-profile) file, so that it's automatically executed when a new shell is started.
Also related: [How to enable python repl autocomplete and still allow new line tabs](/q/25434997)
| null | CC BY-SA 4.0 | null | 2023-02-21T09:39:48.863 | 2023-02-21T09:39:48.863 | null | null | 11,107,541 | null |
75,518,940 | 2 | null | 37,218,702 | 0 | null | By now, a plugin is available that handles exactly this use case!
It's called chartjs-plugin-datalabels and documentation can be found here:
[https://chartjs-plugin-datalabels.netlify.app/guide/getting-started.html](https://chartjs-plugin-datalabels.netlify.app/guide/getting-started.html)
| null | CC BY-SA 4.0 | null | 2023-02-21T10:07:29.193 | 2023-02-21T10:07:29.193 | null | null | 21,257,028 | null |
75,518,958 | 2 | null | 55,867,116 | 0 | null |
# For Expo/RN
You're probably giving an array of malformed stylesheets this way:
```
<compo style={[foo, biz, bar]} />
```
What you need to do is flatten your stylesheets:
```
import * as Native from 'react-native';
<compo style={Native.StyleSheet.flatten([foo, biz, bar])} />
```
| null | CC BY-SA 4.0 | null | 2023-02-21T10:08:36.427 | 2023-02-21T10:08:36.427 | null | null | 6,331,372 | null |
75,519,214 | 2 | null | 3,472,980 | 0 | null | Found a simple way to assign the values to an existing vector without the need for `c=(`1`="first name",`2`="second name")` etc.
First create a labeller function
```
title_labeller_function <- function(nuisance_parameter) {
return(vector_of_labels)
}
```
,where `vector_of_labels` are your labels, eg. `c("first label", "second label")`
Then just assign this in your `facet_grid/facet_wrap`
```
facet_grid(.~ hospital,labeller=as_labeller(title_labeller_function))
```
For more info, see [as_labeller-documentation](https://ggplot2.tidyverse.org/reference/as_labeller.html).
| null | CC BY-SA 4.0 | null | 2023-02-21T10:32:26.657 | 2023-02-21T10:32:26.657 | null | null | 7,147,695 | null |
75,519,492 | 2 | null | 75,519,468 | 1 | null | Assuming `month` the column, use a simple list comprehension with [boolean indexing](http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#boolean-indexing), this will be the fastest:
```
out = df[[1 in l for l in df['month']]]
```
Output:
```
number month
0 100036364396 [10, 11, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9]
1 100077364447 [10, 11, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9]
```
Used input:
```
df = pd.DataFrame({'number': [100033364389, 100036364396, 100077364447],
'month': [[10, 11, 12, 2, 5, 7, 8, 9],
[10, 11, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9],
[10, 11, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9]]})
```
##### comparison of speed: list comprehension vs apply:
The list comprehension is faster (`apply` is just a wrapper around a python loop with some extra overhead).
[](https://i.stack.imgur.com/3zKKv.png)
| null | CC BY-SA 4.0 | null | 2023-02-21T10:54:03.417 | 2023-02-21T12:49:50.490 | 2023-02-21T12:49:50.490 | 16,343,464 | 16,343,464 | null |
75,519,495 | 2 | null | 75,519,468 | 0 | null | Use [boolean indexing](http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#boolean-indexing):
```
df1 = df[[1 in x for x in df['month']]]
```
Or:
```
df1 = df[df['month'].apply(lambda x: 1 in x)]
```
---
```
print (df1)
number month
1 100036364396 [10, 11, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9]
2 100077364447 [10, 11, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9]
```
in 300k rows from sample data:
```
#[300000 rows x 2 columns]
df = pd.concat([df] * 100000, ignore_index=True)
print (df)
%timeit df[[1 in x for x in df['month']]]
150 ms ± 9.81 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
%timeit df[df['month'].apply(lambda x: 1 in x)]
100 ms ± 9.46 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
```
| null | CC BY-SA 4.0 | null | 2023-02-21T10:54:12.303 | 2023-02-21T11:06:16.230 | 2023-02-21T11:06:16.230 | 2,901,002 | 2,901,002 | null |
75,519,747 | 2 | null | 75,519,396 | 0 | null | i think your problem is related to constant value for top constraint.
indeed, I see contraint is ALWAYS 198, and 198 both landscape and portrait.
try to set constraint with:
1. constant 0
2. multiplier as you want.
[](https://i.stack.imgur.com/Wy6lE.png)[](https://i.stack.imgur.com/Ed4Ar.png)
[](https://i.stack.imgur.com/AvLd8.png)
| null | CC BY-SA 4.0 | null | 2023-02-21T11:17:33.793 | 2023-02-21T11:17:33.793 | null | null | 8,445,079 | null |
75,520,044 | 2 | null | 75,519,750 | 1 | null | set `linear-gradient` in `border-image`.
Edit `linear-gradient` according to your need.
```
div {
height: 300px;
width: 200px;
border-image-source: linear-gradient(rgb(240, 240, 245), red);
border-image-slice: 1;
border-style: solid;
border-width: 2px;
}
```
```
<div></div>
```
| null | CC BY-SA 4.0 | null | 2023-02-21T11:42:31.510 | 2023-02-21T11:42:31.510 | null | null | 19,502,363 | null |
75,520,341 | 2 | null | 75,508,298 | 0 | null | You'll need to either start the debugging session from the IDE or attach he debugger to a running process. You might want to take a look at these article for more details:[Starting a new debug session](https://www.jetbrains.com/help/go/starting-the-debugger-session.html),[Attaching to running process](https://www.jetbrains.com/help/go/attach-to-running-go-processes-with-debugger.html)
| null | CC BY-SA 4.0 | null | 2023-02-21T12:10:34.020 | 2023-02-21T12:10:34.020 | null | null | 16,530,067 | null |
75,520,626 | 2 | null | 75,519,800 | 0 | null | You're essentially going to do a connected components algorithm. The input will be with you 9x9 truth table for .
```
static Map<Integer, List<int[]>> cluster( boolean[][] occupied )
```
This is a [2-pass connect component algorithm](https://en.wikipedia.org/wiki/Connected-component_labeling#Graphical_example_of_two-pass_algorithm). The first pass we go through and make preliminary labels, we also create a "touching" list that keeps track of regions adjacent to each other.
```
int n = occupied.length;
int[][] label = new int[n][n];
int last = 1;
List<int[]> touching = new ArrayList<>();
//first pass
for(int i = 0; i<n; i++){
for(int j = 0; j<n; j++){
if(occupied[i][j]){
//4 way connectivity.
int north = 0;
int west = 0;
int next = 0;
if( i > 0 && occupied[i-1][j]){
west = label[i-1][j];
}
if( j > 0 && occupied[i][j-1]){
north = label[i][j-1];
}
if(west != 0){
if(north != 0){
//two labelled regions.
if(north == west){
//they're the same, it's ok.
next = north;
} else if(north < west){
//label it with the minimum one
next = north;
touching.add( new int[]{west, north} );
} else{
next = west;
touching.add( new int[]{north, west} );
}
} else{
next = west;
}
} else if( north != 0 ){
next = north;
} else{
next = last++;
}
label[i][j] = next; //assign the label.
} else{
//not occupied.
continue;
}
}
}
```
That is the first pass, at the end of the first pass the regions are labelled, but there are touching regions that need to be merged. That can be done with the `touching` list, but it needs to be refined a bit.
This first step merges all of the touching labels in to associated clusters.
```
List<TreeSet<Integer>> clusters = new ArrayList<>();
for(int[] pair: touching){
TreeSet<Integer> pair0 = null;
TreeSet<Integer> pair1 = null;
for(TreeSet<Integer> cluster: clusters){
if(cluster.contains(pair[0])){
pair0 = cluster;
}
if(cluster.contains(pair[1])){
pair1 = cluster;
}
}
if( pair0 == null && pair1 == null){
//new cluster
TreeSet<Integer> newCluster = new TreeSet<>();
newCluster.add(pair[0]);
newCluster.add(pair[1]);
clusters.add(newCluster);
} else if( pair0 == null ){
pair1.add(pair[0]);
} else if( pair1 == null ){
pair0.add(pair[1]);
} else{
if(pair0 == pair1) continue;
//both labels are already in clusters but different clusters.
pair0.addAll(pair1);
clusters.remove(pair1);
}
}
```
This goes through and creates a mapping, so that all of the values in a cluster will map to the lowest value.
```
Map<Integer, Integer> fin = new HashMap<>();
for( TreeSet<Integer> cluster: clusters){
Integer low = cluster.first();
for(Integer i: cluster){
fin.put(i, low);
}
}
```
Second pass is just a matter of associating the labels to their keys.
```
Map<Integer, List<int[]>> result = new HashMap<>();
//second pass
for(int i = 0; i<n; i++){
for(int j = 0; j<n; j++){
if( occupied[i][j] ){
Integer f = fin.computeIfAbsent( label[i][j], k -> k );
result.computeIfAbsent( f, k -> new ArrayList<>() ).add( new int[]{i, j} );
label[i][j] = f;
}
}
}
```
Result will contain the label and a collection of int[] that represent all of the points. To use this.
```
Map<Integer, List<int[]>> whiteClusters = cluster(occupiedWhite);
Map<Integer, List<int[]>> redClusters = cluster(occupiedRed);
```
For completeness, here is a compilable working version.
```
import java.util.*;
public class ConnComp{
static void printArray(int[][] arr){
for(int[] row: arr){
for(int i: row){
System.out.printf("%3d",i);
}
System.out.println();
}
}
static void printArray(boolean[][] arr){
for(boolean[] row: arr){
for(boolean i: row){
System.out.print(i ? " t" : " f");
}
System.out.println();
}
}
static Map<Integer, List<int[]>> cluster( boolean[][] occupied ){
int n = occupied.length;
int[][] label = new int[n][n];
int last = 1;
List<int[]> touching = new ArrayList<>();
//first pass
for(int i = 0; i<n; i++){
for(int j = 0; j<n; j++){
if(occupied[i][j]){
//4 way connectivity.
int north = 0;
int west = 0;
int next = 0;
if( i > 0 && occupied[i-1][j]){
west = label[i-1][j];
}
if( j > 0 && occupied[i][j-1]){
north = label[i][j-1];
}
if(west != 0){
if(north != 0){
//two labelled regions.
if(north == west){
//they're the same, it's ok.
next = north;
} else if(north < west){
//label it with the minimum one
next = north;
touching.add( new int[]{west, north} );
} else{
next = west;
touching.add( new int[]{north, west} );
}
} else{
next = west;
}
} else if( north != 0 ){
next = north;
} else{
next = last++;
}
label[i][j] = next; //assign the label.
} else{
//not occupied.
continue;
}
}
}
//map reduce
Comparator<int[]> c = Comparator.comparingInt( arr -> arr[0] );
Comparator<int[]> c2 = Comparator.comparingInt( arr -> arr[1] );
c = c.thenComparing(c2);
touching.sort( c );
List<TreeSet<Integer>> clusters = new ArrayList<>();
for(int[] pair: touching){
TreeSet<Integer> pair0 = null;
TreeSet<Integer> pair1 = null;
for(TreeSet<Integer> cluster: clusters){
if(cluster.contains(pair[0])){
pair0 = cluster;
}
if(cluster.contains(pair[1])){
pair1 = cluster;
}
}
if( pair0 == null && pair1 == null){
//new cluster
TreeSet<Integer> newCluster = new TreeSet<>();
newCluster.add(pair[0]);
newCluster.add(pair[1]);
clusters.add(newCluster);
} else if( pair0 == null ){
pair1.add(pair[0]);
} else if( pair1 == null ){
pair0.add(pair[1]);
} else{
if(pair0 == pair1) continue;
//both labels are already in clusters but different clusters.
pair0.addAll(pair1);
clusters.remove(pair1);
}
}
Map<Integer, Integer> fin = new HashMap<>();
for( TreeSet<Integer> cluster: clusters){
Integer low = cluster.first();
for(Integer i: cluster){
fin.put(i, low);
}
}
System.out.println("occupied");
printArray(occupied);
System.out.println("labelled");
printArray(label);
Map<Integer, List<int[]>> result = new HashMap<>();
//second pass
for(int i = 0; i<n; i++){
for(int j = 0; j<n; j++){
if( occupied[i][j] ){
Integer f = fin.computeIfAbsent( label[i][j], k -> k );
result.computeIfAbsent( f, k -> new ArrayList<>() ).add( new int[]{i, j} );
label[i][j] = f;
}
}
}
System.out.println("after labelling");
printArray(label);
return result;
}
static Random r = new Random(42);
static boolean[][] getBoard(){
int n = 9;
boolean[][] board = new boolean[n][n];
for(int i = 0; i<50; i++){
int x = r.nextInt(n);
int y = r.nextInt(n);
board[x][y] = true;
}
return board;
}
public static void main(String[] args){
cluster(getBoard());
cluster(getBoard());
}
}
```
| null | CC BY-SA 4.0 | null | 2023-02-21T12:36:27.323 | 2023-02-22T09:20:23.757 | 2023-02-22T09:20:23.757 | 2,067,492 | 2,067,492 | null |
75,520,820 | 2 | null | 74,734,500 | 0 | null | Problem:
"the procedure entry point _zst28__throw_bad could not be located in the dynamic link library"
(with msys2 mingw64)
Solution:
Modify the system environment variables (requires admin rights)
Start the windows commandline (cmd.exe) as admin (right-click run as administrator).
Then enter this command:
```
"C:\Windows\system32\rundll32.exe" sysdm.cpl,EditEnvironmentVariables
```
Then edit the PATH at the bottom (under Systemvariables), and make sure that C:\msys64\mingw64\bin is .
Check as follows in cmd:
```
echo %PATH%
```
You can also non-persistenly edit the PATH from a cmd as follows (also does not require admin rights):
```
set PATH=C:\msys64\mingw64\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
```
| null | CC BY-SA 4.0 | null | 2023-02-21T12:54:45.713 | 2023-02-21T12:59:00.510 | 2023-02-21T12:59:00.510 | 21,258,176 | 21,258,176 | null |
75,520,836 | 2 | null | 70,771,174 | 1 | null | In the end I manually downloaded the runtime installer (e.g. MicrosoftServiceFabric.8.2.1571.9590.exe) fromdirect download link in the release notes and run it with MicrosoftServiceFabric.8.2.1571.9590.exe /accepteula /force
When you're running the installer you can copy MicrosoftServiceFabricAutoextractor.exe from C:\Windows\Temp\ before the installer deletes it. Create "C:\Program Files\Microsoft Service Fabric" if it doesn't exist already and then run MicrosoftServiceFabricAutoextractor.exe /E /Y from there to unpack the installation (this part is failing for me a lot though... if it fails, try using 7zip to unpack it instead).
After that, finish the install:
cd "C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code"
.".\InstallFabric.ps1" -FabricRootIsPreInstalled -AcceptEULA -LogPath 'C:\InstallFabric.log'
| null | CC BY-SA 4.0 | null | 2023-02-21T12:56:10.777 | 2023-02-21T12:56:10.777 | null | null | 20,974,675 | null |
75,520,853 | 2 | null | 14,054,364 | 0 | null | I don't know why people are adding shape to the layered-list but for me this works just fine.
```
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:top="10dp" android:height="2dp" android:drawable="@android:color/holo_blue_dark"/>
<item android:height="22dp" android:drawable="@android:color/transparent"/>
</layer-list>
```
1st item will be 10dp from the top and with a height of 2dp and a color of holo_blue_dark.
Now to give 10dp margin to bottom we need to create another transparent item with a height of 22dp (10dp (top margin) + 2dp (height of divider) + 10dp(bottom margin from divider)).
This is working fine for me. I hope this will work for you too.
| null | CC BY-SA 4.0 | null | 2023-02-21T12:57:25.363 | 2023-02-22T12:09:37.933 | 2023-02-22T12:09:37.933 | 14,276,207 | 14,276,207 | null |
75,520,926 | 2 | null | 75,519,363 | -2 | null | Ok I can just set array size to 513, and it will work perfectly.
| null | CC BY-SA 4.0 | null | 2023-02-21T13:05:25.350 | 2023-02-21T13:05:25.350 | null | null | 21,174,396 | null |
75,521,215 | 2 | null | 75,513,502 | 0 | null | I saw your code. In line 22, you add new photos to the old ones, that's why if it runs twice, your state will contains twice of each photo. I changed it to normal
```
setPhotos(data)
```
I understand that you did it, because you want to `lazyLoad` the photos, by each `fetch`, new photos will be added. I would do it differently.
First of all, you can easily use a native `html` attribute for images to lazy load:
`<img src="image.jpg" alt="..." loading="lazy" />`
check: [https://developer.mozilla.org/en-US/docs/Web/Performance/Lazy_loading#images_and_iframes`](https://developer.mozilla.org/en-US/docs/Web/Performance/Lazy_loading#images_and_iframes%60)
This way you won't have to deal with the problem inside your `React` logic. I saw that you have an `<img/>` tag inside your `Photos` component.
With all respect to the other answers, I wouldn't take my development environment out of `strictMode` only to solve an issue. In my opinion an app should work inside and outside `strictMode`, and that's why I appreciate you asking this question here.
| null | CC BY-SA 4.0 | null | 2023-02-21T13:31:59.727 | 2023-02-21T13:31:59.727 | null | null | 15,413,428 | null |
75,521,529 | 2 | null | 75,489,425 | 1 | null | You don't really need to give any width/height options to your Grid Table or Dialog as the sap.m.Dialog is responsive and the Grid Table's columns should grow/shrink to fit the parent container's size.
Giving a dialog 100% width and height will essentially "maximize" it to your screen.
Check this fiddle, the Grid Table has 2 Columns that adjust to the Dialog's width and the Dialog is set to 50% width.
[https://jsfiddle.net/abs1337/v9oqbj4z/](https://jsfiddle.net/abs1337/v9oqbj4z/)
```
var oTable = new sap.ui.table.Table({
title: "Table binding",
showNoData: true,
visibleRowCount: 5
});
oTable.addColumn(new sap.ui.table.Column({
label: new sap.ui.commons.Label({
text: "First Name"
}),
template: new sap.ui.commons.TextView({
text: "{model1>fname}"
})
}));
oTable.addColumn(new sap.ui.table.Column({
label: new sap.ui.commons.Label({
text: "Last Name"
}),
template: new sap.ui.commons.TextView({
text: "{model1>lname}"
})
}));
var oDialg = new sap.m.Dialog({
title: 'Responsive Dialog',
content: oTable,
contentWidth: "50%",
})
```
Set the Dialog to 100% width in the fiddle and see what happens.
Although, your best option would be to use sap.m.table which is the recommended table for responsiveness as you mentioned the columns might increase/decrease.
| null | CC BY-SA 4.0 | null | 2023-02-21T14:00:16.673 | 2023-02-21T14:00:16.673 | null | null | 1,345,890 | null |
75,521,876 | 2 | null | 75,520,412 | 0 | null | As suggested by CBroe, the solution was to set the and element instead.
To make spacing work on span you also need to give it "display:block"
In my use case using bootstrap 5 the final solution was
- `p-0``button`- `d-block p-2 px-3``span`
```
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css" rel="stylesheet" />
<div class="btn-group btn-group-lg" role="group">
<button class='btn btn-lg btn-outline-primary p-0' data-bs-toggle='modal' data-bs-target='#modalExport'>
<span class="mgc-export-popup d-block p-2 px-3" tabindex="0"
data-bs-toggle="tooltip" data-bs-placement="top" title="Export">
<i class="fa-solid fa-file-export fa-fw fa-lg"></i></span></button>
<button class='btn btn-lg btn-outline-primary p-0' data-bs-toggle='modal' data-bs-target='#modalImport'>
<span class="mgc-import-popup d-block p-2 px-3" tabindex="0"
data-bs-toggle="tooltip" data-bs-placement="top" title="Import">
<i class="fa-solid fa-file-import fa-fw fa-lg"></i></span></button>
</div>
```
| null | CC BY-SA 4.0 | null | 2023-02-21T14:29:12.033 | 2023-02-21T14:29:12.033 | null | null | 6,583,889 | null |
75,521,933 | 2 | null | 56,447,079 | 0 | null | You can simply use xlabel and ylabel functions to print string.
```
import matplotlib.pyplot as plt
time = [2001,2002, 2003, 2004, 2005, 2006]
population = ["100Lakh","200Lakh", "300Lakh", "400Lakh", "500Lakh", "600Lakh"]
# x = time, y = population
plt.plot(time, population)
plt.xlabel("time")
plt.ylabel("Popluation of city")
plt.show()
```
| null | CC BY-SA 4.0 | null | 2023-02-21T14:34:11.807 | 2023-02-21T14:41:27.920 | 2023-02-21T14:41:27.920 | 13,629,657 | 13,629,657 | null |
75,522,061 | 2 | null | 75,517,435 | 0 | null | I know why now!
This article describes the same question as mine. I accidentally selected the "beta". I don't even know when and why :).
[https://forums.developer.nvidia.com/t/error-msb3721-when-building-cuda-sample-and-programs-in-vs2019-widnows10-64bit/196483](https://forums.developer.nvidia.com/t/error-msb3721-when-building-cuda-sample-and-programs-in-vs2019-widnows10-64bit/196483)
Hope it helps!
(But I still don't know how it affects CUDA.)
| null | CC BY-SA 4.0 | null | 2023-02-21T14:44:34.430 | 2023-02-21T14:44:34.430 | null | null | 19,172,882 | null |
75,522,074 | 2 | null | 74,576,221 | 0 | null | Working daisyUI in dev & production [https://stackblitz.com/edit/github-gxjzue-1jzxtn](https://stackblitz.com/edit/github-gxjzue-1jzxtn)
[](https://i.stack.imgur.com/l5s1h.png)
---
Seems to be related to how UnoCSS + cssnano interact.
`normalizeWhitespace` and `@apply` don't play well toghether:
[https://github.com/unocss/unocss/discussions/2227#discussioncomment-5064858](https://github.com/unocss/unocss/discussions/2227#discussioncomment-5064858)
```
cssnano: {
preset: [
'default',
{
mergeRules: false,
normalizeWhitespace: false,
},
],
},
```
| null | CC BY-SA 4.0 | null | 2023-02-21T14:45:22.333 | 2023-02-21T14:45:22.333 | null | null | 64,466 | null |
75,522,126 | 2 | null | 75,521,608 | 1 | null | If you look at your own screenshot you see the query returns 21 rows. This is also what the exception/error is telling you (no unique result).
Your repository method returns a single `Order` whilst your query returns 21. That isn't going to fit. Instead you need to return a collection of orders, like `List<Order>`.
```
List<Order> getOrdersByCustomerId(Long customerId);
```
An `Order` represents a row in the database, so in your case you will get a list with 21 `Order` objects in it.
| null | CC BY-SA 4.0 | null | 2023-02-21T14:49:15.590 | 2023-02-21T14:49:15.590 | null | null | 2,696,260 | null |
75,522,422 | 2 | null | 72,577,122 | 1 | null | Unfortunately this isn't a supported feature, and likely never will be.
From Joe Germuska (Exec Director at Night Labs)
> "This is not a supported feature. Timeline's design reinforces the very strong assumption readers of left-to-right languages have that timelines should have the past on the left and the future on the right. Perhaps it should reverse this for right-to-left languages, but that is not a small task, and TimelineJS is not under active feature development at this time. Sorry."
| null | CC BY-SA 4.0 | null | 2023-02-21T15:16:44.903 | 2023-02-21T15:16:44.903 | null | null | 21,259,093 | null |
75,522,604 | 2 | null | 75,518,939 | 0 | null |
1. I recommend new project on visual stdio
2. when you make Source file
2-1) check intall visual C++
2-2) click C++file(cpp) //it is Compiled translation source files
2-3) make file name : ~~.c (extension called .c)
2-4) check your file path
2-5) add Source file
!!!A file name cannot contain any of the following characters
like \ / : * ? " < > |
| null | CC BY-SA 4.0 | null | 2023-02-21T15:31:38.317 | 2023-02-21T15:31:38.317 | null | null | 21,125,911 | null |
75,523,140 | 2 | null | 75,522,556 | 0 | null | Use FuncFormatter() instead.
```
from matplotlib.ticker import FuncFormatter
import math
```
Create a function outputting the desired label:
```
def my_format(val, pos):
n = 3
y = abs(val)
dec = max(0,
min(n,n-int(math.log10(y)))) if y else n
return f"{val:.{dec}f}"
```
*(dec adapted from the accepted answer in [Format float with fixed amount of digits python](https://stackoverflow.com/questions/55863996/format-float-with-fixed-amount-of-digits-python))
Apply the function to your axis, instead of the FormatStrFormatter():
```
ax.yaxis.set_major_formatter(FuncFormatter(my_format))
```
| null | CC BY-SA 4.0 | null | 2023-02-21T16:19:01.870 | 2023-02-21T16:19:01.870 | null | null | 5,785,250 | null |
75,523,450 | 2 | null | 75,521,729 | 0 | null | You just need to unbound the window function:
```
select *, MIN(avg_ttm) OVER (PARTITION BY ASIN order by CASE
WHEN ageband_on_cost_acquisition_date = 'Current' THEN 1
WHEN ageband_on_cost_acquisition_date = '[31-60]' THEN 2
WHEN ageband_on_cost_acquisition_date = '[61-90]' THEN 3
WHEN ageband_on_cost_acquisition_date = '[91-120]' THEN 4
WHEN ageband_on_cost_acquisition_date = '[121-150]' THEN 5
WHEN ageband_on_cost_acquisition_date = '[151-180]' THEN 6
WHEN ageband_on_cost_acquisition_date = '[181-270]' THEN 7
WHEN ageband_on_cost_acquisition_date = '[271-360]' THEN 8
WHEN ageband_on_cost_acquisition_date = 'Over 360' THEN 9
END
rows between unbounded preceding and current row ) AS proposed_rate from ccogs;
```
In Excel you are referencing the output of the previous row's calculation which is recursive (slow). By just finding the MIN() over all previous rows you do the same thing.
Also you don't need to have ASIM in the order by clause as it is the partition by value so it is constant within each partition.
| null | CC BY-SA 4.0 | null | 2023-02-21T16:44:34.000 | 2023-02-21T16:44:34.000 | null | null | 13,350,652 | null |
75,523,696 | 2 | null | 75,517,788 | 0 | null | As commonsware said, that's not possible. I think the best I can do is just handle when the user try some action in an file that no longer exists by showing a warn then also deleting the file reference from my app.
- [SAF - method checking folder Uri existence yields always true](https://stackoverflow.com/questions/58181316/saf-method-checking-folder-uri-existence-yields-always-true)
| null | CC BY-SA 4.0 | null | 2023-02-21T17:05:54.393 | 2023-02-21T17:05:54.393 | null | null | 11,793,117 | null |
75,523,741 | 2 | null | 70,486,926 | 0 | null | My solution: access to UserTasks then get checkbox in usercontrol by control index
```
For Each cc As UserTasks In FlowLayoutPanel3.Controls
If DirectCast(cc.Controls.Item(5), CheckBox).Checked = True then
MsgBox("Checkbox Selected.", MsgBoxStyle.OkOnly, "Yeyy!")
UpdateRecordDB(the id of the checkbox user control to update table)
Else
MsgBox("No Checkbox Selected.", MsgBoxStyle.OkOnly, "Error!")
End If
Next
```
`cc.Controls.Item(5)` is order of control in UserTasks
or you can test type of control by `If TypeOf cc.Controls.Item(5) Is CheckBox Then` then test checked state.
Demo: [](https://i.stack.imgur.com/AhHWB.png)
| null | CC BY-SA 4.0 | null | 2023-02-21T17:10:01.827 | 2023-02-21T17:10:01.827 | null | null | 1,289,476 | null |
75,524,175 | 2 | null | 75,523,589 | 0 | null | It looks like you are missing the ":".
```
import os
# This will create a text document "test.txt" in a folder called "temp" that is stored in the root directory of the C: drive.
with open(os.path.join("C:", os.sep, "temp", "tester.txt"), "w") as testdoc:
testdoc.write("This is a test.")
```
You need the extra `os.sep` or python will not recognize the file structure correctly. You could also just use "C:\\" instead.
Note you may need to be in an elevated terminal (open a command prompt in administrator mode) depending on where the files you are trying to access are located.
As @chepner points out, your example image shows the file structure pasted into a python interpreter. You will at least need quotes around it to treat it as a file path string. But it is unclear what you are trying to accomplish here so some more detail is needed to help.
If you are trying to open a file you can do this in python with...
```
import os
with open(os.path.join("C:", os.sep, "Users", "User", "Desktop", "py4e", "filename.txt"), 'r') as file:
# Do stuff with file, like file.readlines()
```
| null | CC BY-SA 4.0 | null | 2023-02-21T17:53:58.160 | 2023-02-21T18:10:49.427 | 2023-02-21T18:10:49.427 | 4,119,822 | 4,119,822 | null |
75,524,640 | 2 | null | 24,941,209 | 0 | null | Reading the answers here did not quite work for me, but a combination did. Here are my steps (Windows, Chrome):
- - -
Done!
Based on:
- [https://stackoverflow.com/a/61112723/3200858](https://stackoverflow.com/a/61112723/3200858)- [https://stackoverflow.com/a/51411774/3200858](https://stackoverflow.com/a/51411774/3200858)
| null | CC BY-SA 4.0 | null | 2023-02-21T18:41:20.413 | 2023-02-21T18:41:20.413 | null | null | 3,200,858 | null |
75,524,786 | 2 | null | 75,524,754 | 0 | null | Make sure you select the same version of python that you used `pip` with in vs code
[](https://i.stack.imgur.com/9GLa1.png)
[](https://i.stack.imgur.com/kSCGk.png)
| null | CC BY-SA 4.0 | null | 2023-02-21T18:56:36.590 | 2023-02-21T18:56:36.590 | null | null | 12,101,554 | null |
75,524,779 | 2 | null | 75,524,685 | 0 | null | Firstly assuming your HTML code is not having the errors as you've posted in the question. Use this if not:
```
<form id="request_quote" method="POST" action="quoterequest.php">
<input type="hidden" id="...." value="..." />
<button id="quoteButton" class="mt-4 qbutton btn btn-outline-primary" type="submit">Request Print
</button>
</form>
```
Secondly, I think your `preConfirm` function is the cause of this. Try changing it to this:
```
if (!grecaptcha.getResponse()) {
Swal.showValidationMessage(`Please verify that you're not a robot`);
}
```
`.then()`
```
$(document).ready(function() {
$("#request_quote").submit(function(e) {
e.preventDefault();
Swal.fire({
title: 'Please enter your email',
input: 'email',
inputAttributes: {
autocapitalize: 'off'
},
html: '<div id="recaptcha"></div>',
didOpen: () => {
grecaptcha.render('recaptcha', {
'sitekey': 'SITE_KEY'
});
}
}).then((result) => {
if (!result.isConfirmed) {
Swal.showValidationMessage(`Please verify that you're not a robot`);
} else {
// Rest of the code..
}
});
});
});
```
Implementation in `.then()` part, which worked for @couldnteverbeme. [JSFiddle link for the same](https://jsfiddle.net/mkd3auef/)
| null | CC BY-SA 4.0 | null | 2023-02-21T18:56:21.357 | 2023-02-22T19:39:49.717 | 2023-02-22T19:39:49.717 | 16,045,352 | 16,045,352 | null |
75,524,822 | 2 | null | 75,519,781 | 1 | null | That's the markdown preview feature. I can tell because of the way it renders the source file, and by the / icon in the editor tab handle. You get it when you run the `Markdown: Open Preview` command, which on Windows and Linux, is bound by default to ++.
I'm not sure why it randomly pops up for you, and I'm not sure why it closes all your other tabs when it opens. That sounds like a bug, which you can report as an issue ticket to the VS Code GitHub repo. If you do, please comment under this answer linking to it for posterity. I tried a cursory google to see if similar issues have been reported before and didn't see anything that looks the same by googling "`github vscode issues markdown preview closes all other tabs`", "`github vscode issues markdown preview unexpected`", but then again, it was just a cursory google looking at the top few results.
The fact that you're getting it for a supposed CSS file might mean that the language mode is wrong, which is surprising because VS Code tends to be pretty good at guessing the language mode based on the contents of the file, and your file isn't small either. Maybe you accidentally changed the language mode to markdown. You can change it to CSS following the docs here: [https://code.visualstudio.com/docs/languages/overview#_change-the-language-for-the-selected-file](https://code.visualstudio.com/docs/languages/overview#_change-the-language-for-the-selected-file).
> click on the language indicator - which is located on the right hand of the Status Bar. This will bring up the dropdown where you can select another language for the current file.Tip: You can get the same dropdown by running the command (`Ctrl+K M`).
| null | CC BY-SA 4.0 | null | 2023-02-21T19:01:06.450 | 2023-02-21T19:11:47.807 | 2023-02-21T19:11:47.807 | 11,107,541 | 11,107,541 | null |
75,524,890 | 2 | null | 75,521,639 | 0 | null | In your setup, this is how the overall flow works:
- Your app runs a code flow using OAuth and OpenID Connect standards - to connect to Auth0. It is your responsibility to code this securely.- Auth0 runs another code flow to connect to the upstream IDP. You can assume that this is done securely by Auth0.
Your app needs to first send a front channel request to Auth0, which occurs in the browser:
```
GET http://login.example.com/oauth/authorize
?client_id=my-client
&redirect_uri=http://www.example.com/callback
&response_type=code
&scope=openid profile
&code_challenge=WhmRaP18B9z2zkYcIlb4uVcZzjLqcZsaBQJf5akUxsA
&code_challenge_method=S256
&state=CfDJ8Nxa-YhPzjpBilDQz2C...
```
Your app then makes a direct HTTP POST to Auth0 to get tokens:
```
POST http://login.example.com/oauth/token
Content-Type: application/x-www-form-urlencoded
client_id=my-client
&client_secret=U2U9EnSKx31fUnvgGR3coOUszko5MiuCSI2Z_4ogjIiO5-UbBzIBWU6JQQaljEis
&code=I9xL9DY9jAYHPuHSiW2OpWUaNRW4otei
&grant_type=authorization_code
&redirect_uri=http://www.example.com/callback
&code_verifier=HlfffYlGy7SIX3pYHOMJfhnO5AhUW1eOIKfjR42ue28
```
The parameters you send are important for your app to be considered secure. A couple of best practices here:
- Use `response_type=code` to keep tokens out of the browser response, so that you receive all tokens in the second message's response- Use PKCE, as in the link you sent, which proves that the party that sent the first request is also sending the second request
Ensure that whatever libraries you are using in your tech stack, result in messages similar to the above.
| null | CC BY-SA 4.0 | null | 2023-02-21T19:08:31.577 | 2023-02-21T19:08:31.577 | null | null | 9,019,885 | null |
75,524,996 | 2 | null | 75,524,555 | 0 | null | The "process_titanic_data" is most likely pulling nothing from XCom because it is running concurrently with the "get_titanic_data" task. If you are not directly using the output of a task directly as an input for another (via [TaskFlow API](https://airflow.apache.org/docs/apache-airflow/2.5.1/tutorial/taskflow.html) or otherwise), you need to explicitly set the dependencies.
Adding `get_titanic_data >> process_titanic_data` add the end of the DAG file should do the trick.
Side note, one "gotcha" I also see is you're pulling the XComs. If the `task_ids` arg is an iterable of task IDs (e.g. a list, etc.), Airflow assumes you want to retrieve multiple XComs and the fetched XComs will be a list of those retrieved XComs. Presumably you don't want a list of a list of records from the 'titanic' table. Try using `titanic = ti.xcom_pull(task_ids='get_titanic_data')` instead.
| null | CC BY-SA 4.0 | null | 2023-02-21T19:21:36.060 | 2023-02-21T21:51:13.313 | 2023-02-21T21:51:13.313 | 15,772,377 | 15,772,377 | null |
75,525,529 | 2 | null | 75,522,946 | 0 | null | To get multiple headers you can use this boiler plate code and adapt to your needs:
note that this method is relatively easy as the headers are just a list of tuples.
```
import pandas as pd
import numpy as np
# Create a list of tuples representing the column headers
headers = [("Group A", "Feature 1"),
("Group A", "Feature 2"),
("Group B", "Feature 1"),
("Group B", "Feature 2")]
# Create a random 2D array of data
data = np.random.randn(5, 4)
# Create a DataFrame with multi-index column headers
df = pd.DataFrame(data, columns=pd.MultiIndex.from_tuples(headers))
# Print the DataFrame
print(df)
```
The output of the above looks like this:
```
Group A Group B
Feature 1 Feature 2 Feature 1 Feature 2
0 1.070639 0.032569 0.452355 0.044998
1 0.331957 0.055572 -0.643516 -0.257413
2 1.888934 -0.307388 1.742004 0.395956
3 1.448742 -0.807641 -0.116213 -0.884502
4 0.115313 1.002843 -0.017316 -1.136110
```
| null | CC BY-SA 4.0 | null | 2023-02-21T20:20:45.477 | 2023-02-21T20:20:45.477 | null | null | 7,318,120 | null |
75,525,659 | 2 | null | 49,095,692 | 0 | null | I had same error. I update and it start to works.
| null | CC BY-SA 4.0 | null | 2023-02-21T20:36:30.480 | 2023-02-21T20:36:30.480 | null | null | 21,260,940 | null |
75,525,672 | 2 | null | 75,522,637 | 1 | null | Process size and the heap size in the JVM are not the same, see
[How can I measure the actual memory usage of an application or process?](https://stackoverflow.com/questions/131303/how-can-i-measure-the-actual-memory-usage-of-an-application-or-process)
for a discussion of process size on Linux.
If your heap size stays constant and the process size is increasing all the time, there must be a native memory leak. JProfiler cannot detect such a leak because it is only concerned with Java memory usage. The "Non-heap memory" that is reported by JProfiler is derived from bookkeeping by the JVM. It would not include a memory leak from a native library that is used via JNI.
| null | CC BY-SA 4.0 | null | 2023-02-21T20:38:35.940 | 2023-02-21T20:38:35.940 | null | null | 936,832 | null |
75,526,136 | 2 | null | 75,525,311 | 0 | null | You could handle the check inside `completeTask`:
```
const completeTask = (taskNameToDelete: string): void => {
const newTodo = todo.filter((task) => task.id !== taskNameToDelete);
setTodo(newTodo);
if (newTodo.length > 10) {
// do something
};
};
```
You don't need to keep the todo count in state, since you can derived it:
```
const [todo, setTodo] = useState<ITask[]>([]);
const taskCount = todo.length;
```
| null | CC BY-SA 4.0 | null | 2023-02-21T21:36:37.600 | 2023-02-21T21:36:37.600 | null | null | 18,059,629 | null |
75,526,156 | 2 | null | 75,525,190 | 0 | null | U gotta do it manually, like
```
// um using anotherPackage, but condition is similar
void chooseDate(BuildContext context) async {
DateTime? newDateTime = await showRoundedDatePicker(
context: context,
height: 340,
borderRadius: 35,
initialDate: date,
firstDate: DateTime(date.year),
lastDate: DateTime(date.year + 1),
description: 'Chose your prefered date ..',
);
if (newDateTime != null) {
final monthDays = newDateTime.subtract(const Duration(days: 1));
final date = DateTime.now();
if (newDateTime.year > date.year ||
newDateTime.month > date.month ||
newDateTime.month == date.month && monthDays.day >= date.day - 1) {
...........
...........
} else {
showDialog(
context: context,
builder: (c) => CupertinoAlertDialog(
title: const Text(
"This date cannot be selected. This Day passed already !"),
actions: [
CupertinoDialogAction(
child: const Text("OK"),
onPressed: () {
Navigator.pop(context);
},
)
],
),
);
}
}
}
}
```
| null | CC BY-SA 4.0 | null | 2023-02-21T21:38:15.070 | 2023-02-21T21:38:15.070 | null | null | 12,519,864 | null |
75,526,706 | 2 | null | 75,526,584 | 1 | null | The margin on your paragraphs is separating the two sections. You can view this is the case by opening dev tools with and inspecting them. The coloured box that pops up shows your margins. A quick fix could be to add a class to the paragraphs in question:
```
.clear-margin {
margin: 0;
}
```
```
#ABC {
margin-top: 0;
padding: 0%;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: none;
}
body {
width: 50%;
margin: auto;
padding: zero;
font-family: Arial;
background-color: lightblue
}
nav {
padding: 5px;
color: mediumpurple;
}
header {
background-image: linear-gradient(lightgray, wheat);
}
.clear-margin {
margin: 0;
}
#Introduction {
background-image: linear-gradient(wheat, white);
padding: 0%;
}
#Numbers {
background-image: linear-gradient(white, lime);
padding: 0%;
}
```
```
<header>
<nav>
<a target="" href="cats/Menu.html"><i>Visit page 2</i></a>
<a target="" href="pagina3.html"><i>Visit page 3</i></a>
<a target="_blank" href="https://www.youtube.com"><i>Youtube's home page</i></a>
</nav>
<h1>
<a target="" href="index.html">
<img src="plant.png" height="50"></a> Vlad Seboiu</h1>
<hr/>
</header>
<main>
<article>
<section id="Introduction">
<p>
<h2 id="ABC"><big>Introduction</big></h2>
</p>
<p class="clear-margin">hello world</p>
</section>
<section id="Numbers">
<p class="clear-margin">10000<sup>2</sup></p>
<p> H<sub>2</sub>O</p>
<p>(-20)<sup>52</sup>(-40)<sup>95</sup></p>
</section>
</article>
</main>
<footer style="background-color:white">
<!--
test
-->
<hr/>
<h2>test</h2>
<p style="color:green;background-color:chartreuse;">
<big>
123
</big>
</p>
</footer>
```
| null | CC BY-SA 4.0 | null | 2023-02-21T22:56:17.940 | 2023-02-21T23:07:17.233 | 2023-02-21T23:07:17.233 | 14,190,543 | 14,190,543 | null |
75,526,831 | 2 | null | 75,431,069 | 0 | null | Like [Amadan](https://stackoverflow.com/users/240443/amadan) said in the comments of your post, you need to create a table inside of a table. This can be done just by inserting a `<table>` inside an already-existing `<table>` element. Utilizing the [rowspan](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td#attr-rowspan) and [colspan](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td#attr-rowspan) attributes, you can make code that creates #6's table with the following HTML code (CSS code solely for table visibility):
```
table,
td {
border: 1px solid black;
border-collapse: collapse;
text-align: center;
}
```
```
<table>
<tr>
<td>1</td>
<td colspan="3">2</td>
</tr>
<tr>
<td>3</td>
<td colspan="3">
<table>
<tr>
<td colspan="2">4</td>
</tr>
<tr>
<td>5</td>
<td>6</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3">
<table>
<tr>
<td rowspan="2">7</td>
<td>8</td>
</tr>
<tr>
<td>9</td>
</tr>
</table>
</td>
<td>10</td>
</tr>
</table>
```
| null | CC BY-SA 4.0 | null | 2023-02-21T23:16:15.390 | 2023-02-21T23:16:15.390 | null | null | 18,033,861 | null |
75,526,905 | 2 | null | 75,526,584 | 0 | null | `<p>` has default margin.
Add this to your css
```
p{
margin:0px;
}
```
| null | CC BY-SA 4.0 | null | 2023-02-21T23:29:12.737 | 2023-02-21T23:29:12.737 | null | null | 13,316,335 | null |
75,527,564 | 2 | null | 75,521,828 | 0 | null | If you use class_weight='balanced' in [DecisionTreeClassifier](https://scikit-learn.org/stable/modules/generated/sklearn.tree.DecisionTreeClassifier.html)(), the values will indeed appear weighted (see [here](https://github.com/scikit-learn/scikit-learn/issues/18943)).
What you can do is use proportion=True in [plot_tree](https://scikit-learn.org/stable/modules/generated/sklearn.tree.plot_tree.html), this will at least give you the unweighted proportion percentage.
| null | CC BY-SA 4.0 | null | 2023-02-22T01:48:53.060 | 2023-02-22T01:48:53.060 | null | null | 20,165,221 | null |
75,527,702 | 2 | null | 75,527,095 | 1 | null | Seems that your data is not simple arrays because you are showing absence of values and different positions of values - more like intervals.
In this case you can perform merging of two interval lists in order.
For example, interval from the first list started, then interval from the second list started, you compare values and make result for interval intersection. Then the first one ends while the second one continues - so additional value is detected and so on...
P.S. Perhaps physical sense of data might make things more clear.
| null | CC BY-SA 4.0 | null | 2023-02-22T02:22:54.633 | 2023-02-22T02:22:54.633 | null | null | 844,416 | null |
75,527,739 | 2 | null | 75,527,579 | 0 | null | It will be solved by using SQL `HAVING` clause. `HAVING COUNT(ordernum) = 1 AND itemnum = 123456` ensures that only ordernum with a single record has itemnum 123456 Try this:
```
SELECT ordernum
FROM table
GROUP BY ordernum
HAVING COUNT(ordernum) = 1 AND itemnum = 123456;
```
| null | CC BY-SA 4.0 | null | 2023-02-22T02:33:01.203 | 2023-02-22T03:12:40.210 | 2023-02-22T03:12:40.210 | 12,715,723 | 12,715,723 | null |
75,527,760 | 2 | null | 23,775,539 | 0 | null | ```
create table tblemployee(
EmpId int NOT NULL identity(1,1),
EmpName varchar(100),
PhoneNumber varchar(10),
Country int,
State int,
maritalstetus varchar(50),
isvoting varchar(50),
dob datetime,
doj datetime
primary key (EmpId)
)
create table tblCountry(
Id int NOT NULL identity(1,1),
Name varchar(100),
primary key (Id)
)
insert into tblCountry(Name) values ('India')
insert into tblCountry(Name) values ('US')
insert into tblCountry(Name) values ('UK')
create table tblstate(
Id int NOT NULL identity(1,1),
Name varchar(100),
countryId int,
primary key (Id)
)
insert into tblstate(Name ,countryId) values ('Delhi',1)
insert into tblstate(Name , countryId) values ('Bihar' ,1)
insert into tblstate(Name , countryId) values ('Up',1)
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Xml.Linq;
namespace webTest.Models
{
public class Employee
{
public int id { get; set; }
[Required]
public string Name { get; set; }
[Required]
public string PhoneNumber { get; set; }
[Required]
public int Country { get; set; }
[Required]
public int State { get; set; }
[Required]
public bool MarritalStatus { get; set; }
public bool IsVoting { get; set; }
[Required]
[DataType(DataType.Date)]
public DateTime DOB { get; set; }
[Required]
[DataType(DataType.Date)]
public DateTime DOJ { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using webTest.Models;
namespace webTest.Controllers
{
public class EmpController : Controller
{
// GET: Emp
public static string constr = "Data Source=DIVYANSHU;Initial Catalog=EmployeeData;Integrated Security=True";
SqlConnection conn = new SqlConnection(constr);
public ActionResult ViewList()
{
List<Employee> employees = new List<Employee>();
try
{
conn.Open();
string sqlquery = "select * from tblEmployee";
SqlCommand cmd = new SqlCommand(sqlquery, conn);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
Employee emp = new Employee()
{
id = Convert.ToInt32(dr["Empid"].ToString().Trim()),
Name = dr["EmpName"].ToString(),
PhoneNumber = dr["PhoneNumber"].ToString(),
Country = Convert.ToInt32(dr["Country"].ToString().Trim()),
State = Convert.ToInt32(dr["State"].ToString().Trim()),
MarritalStatus = Convert.ToBoolean(dr["maritalstetus"].ToString().Trim()),
IsVoting = Convert.ToBoolean(dr["isvoting"]),
DOB = Convert.ToDateTime(dr["dob"].ToString().Trim()),
DOJ = Convert.ToDateTime(dr["doj"].ToString().Trim()),
};
employees.Add(emp);
}
conn.Close();
}
catch (Exception ex)
{
}
return View(employees);
}
public ActionResult Create()
{
SqlDataAdapter _da = new SqlDataAdapter("Select * From tblCountry", constr);
DataTable _dt = new DataTable();
_da.Fill(_dt);
ViewBag.Country = ToSelectList(_dt, "Id", "Name");
_da.Dispose();
SqlDataAdapter _da1 = new SqlDataAdapter("Select * From tblState", constr);
DataTable _dt1 = new DataTable();
_da1.Fill(_dt1);
ViewBag.State = ToSelectList(_dt1, "Id", "Name");
_da1.Dispose();
Employee emp = new Employee();
return View(emp);
}
public SelectList ToSelectList(DataTable table, string valueField, string textField)
{
List<SelectListItem> list = new List<SelectListItem>();
foreach (DataRow row in table.Rows)
{
list.Add(new SelectListItem()
{
Text = row[textField].ToString(),
Value = row[valueField].ToString()
});
}
return new SelectList(list, "Value", "Text");
}
[HttpPost]
public ActionResult Create(Employee empmodel)
{
List<Employee> employees = new List<Employee>();
try
{
conn.Open();
string sqlquery = "insert into tblEmployee(EmpName,PhoneNumber,Country,State,maritalstetus,isvoting,dob,doj) values('" + empmodel.Name + "','" + empmodel.PhoneNumber + "'," + empmodel.Country + "," + empmodel.State + ",'" + empmodel.MarritalStatus + "','" + empmodel.IsVoting + "','" + empmodel.DOB + "','" + empmodel.DOJ + "')";
SqlCommand cmd = new SqlCommand(sqlquery, conn);
cmd.ExecuteNonQuery();
conn.Close();
employees = listEmployee();
}
catch (Exception ex)
{
}
return View("ViewList", employees);
}
public ActionResult Edit(int id)
{
Employee emp = new Employee();
try
{
SqlDataAdapter _da = new SqlDataAdapter("Select * From tblCountry", constr);
DataTable _dt = new DataTable();
_da.Fill(_dt);
ViewBag.Country = ToSelectList(_dt, "Id", "Name");
_da.Dispose();
SqlDataAdapter _da1 = new SqlDataAdapter("Select * From tblState", constr);
DataTable _dt1 = new DataTable();
_da1.Fill(_dt1);
ViewBag.State = ToSelectList(_dt1, "Id", "Name");
_da1.Dispose();
conn.Open();
string sqlquery = "select * from tblemployee where empid=" + id + "";
SqlCommand cmd = new SqlCommand(sqlquery, conn);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
emp = new Employee()
{
id = Convert.ToInt32(dr["Empid"].ToString().Trim()),
Name = dr["EmpName"].ToString(),
PhoneNumber = dr["PhoneNumber"].ToString(),
Country = Convert.ToInt32(dr["Country"].ToString().Trim()),
State = Convert.ToInt32(dr["State"].ToString().Trim()),
MarritalStatus = Convert.ToBoolean(dr["maritalstetus"].ToString().Trim()),
IsVoting = Convert.ToBoolean(dr["isvoting"]),
DOB = Convert.ToDateTime(dr["dob"].ToString().Trim()),
DOJ = Convert.ToDateTime(dr["doj"].ToString().Trim()),
};
}
conn.Close();
}
catch (Exception ex)
{
}
return View(emp);
}
[HttpPost]
public ActionResult Edit(Employee empmodel)
{
try
{
conn.Open();
string sqlquery = "update tblEmployee set EmpName='" + empmodel.Name + "',PhoneNumber='" + empmodel.PhoneNumber + "',Country=" + empmodel.Country + ",State=" + empmodel.State + ",maritalstetus='" + empmodel.MarritalStatus + "',isvoting='" + empmodel.IsVoting + "',dob='" + empmodel.DOB + "',doj='" + empmodel.DOJ + "' where empid=" + empmodel.id + "";
SqlCommand cmd = new SqlCommand(sqlquery, conn);
cmd.ExecuteNonQuery();
conn.Close();
}
catch (Exception ex)
{
}
List<Employee> list = listEmployee();
return View("ViewList", list);
}
public ActionResult Delete(int id)
{
try
{
conn.Open();
string sqlquery = "Delete from tblEmployee where empid=" + id + "";
SqlCommand cmd = new SqlCommand(sqlquery, conn);
cmd.ExecuteNonQuery();
conn.Close();
}
catch (Exception ex)
{
}
List<Employee> list = listEmployee();
return View("ViewList", list);
}
public List<Employee> listEmployee()
{
List<Employee> employees = new List<Employee>();
conn.Open();
string sqlquery = "select * from tblEmployee";
SqlCommand cmd = new SqlCommand(sqlquery, conn);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
Employee emp = new Employee()
{
id = Convert.ToInt32(dr["Empid"].ToString().Trim()),
Name = dr["EmpName"].ToString(),
PhoneNumber = dr["PhoneNumber"].ToString(),
Country = Convert.ToInt32(dr["Country"].ToString().Trim()),
State = Convert.ToInt32(dr["State"].ToString().Trim()),
MarritalStatus = Convert.ToBoolean(dr["maritalstetus"].ToString().Trim()),
IsVoting = Convert.ToBoolean(dr["isvoting"]),
DOB = Convert.ToDateTime(dr["dob"].ToString().Trim()),
DOJ = Convert.ToDateTime(dr["doj"].ToString().Trim()),
};
employees.Add(emp);
}
conn.Close();
return employees;
}
}
}
//in Edit view and in create view replace edit for to
@Html.DropDownListFor(model => model.Country, ViewBag.Country as SelectList, new { @class = "form-control" })
@Html.DropDownListFor(model => model.State, ViewBag.State as SelectList, new { @class = "form-control" })
```
| null | CC BY-SA 4.0 | null | 2023-02-22T02:38:39.650 | 2023-02-22T03:26:00.333 | 2023-02-22T03:26:00.333 | 21,262,196 | 21,262,196 | null |
75,527,868 | 2 | null | 75,527,579 | 0 | null | You can try a nested subquery like this:
```
SELECT
t1.ordernum
FROM
`test` AS t1,
(SELECT t2.ordernum, COUNT(t2.ordernum) AS cnt FROM `test` AS t2 GROUP BY t2.ordernum) AS t3
WHERE
t1.itemnum=123456
&& t1.ordernum=t3.ordernum
&& t3.cnt = 1;
```
| null | CC BY-SA 4.0 | null | 2023-02-22T03:02:06.957 | 2023-02-24T16:20:51.717 | 2023-02-24T16:20:51.717 | 2,966,583 | 21,176,506 | null |
75,528,067 | 2 | null | 75,491,474 | 0 | null | There is work in progress to make an option to disable/modify that Explorer tooltip, see [A option which can modify the path hover in vscode file explorer](https://github.com/microsoft/vscode/issues/173236) and a good discussion here: [Polish explorer tooltip rendering](https://github.com/microsoft/vscode/pull/174085). It quickly got enough votes to get on the Backlog but is being worked on.
There is this setting:
```
explorer.experimental.hover
```
which I believe will be released to Stable early March 2023. For some weird reason, my Insiders Build is not showing that option so that I could test it, so it is unclear to me exactly what it will change.
In any case, that setting should appear in Stable in early March 2023 so you can see what it changes.
| null | CC BY-SA 4.0 | null | 2023-02-22T03:46:49.010 | 2023-02-22T03:46:49.010 | null | null | 836,330 | null |
75,528,080 | 2 | null | 75,168,907 | 0 | null | Check you log file sizes. Unless you have them stored specifically somewhere else they eat up your allocated storage. Log files are usually retained for only 72 hours, again unless you specified otherwise. But if you are generating a lot of errors you can quickly eat up a lot of space.
| null | CC BY-SA 4.0 | null | 2023-02-22T03:48:56.773 | 2023-02-22T03:48:56.773 | null | null | 1,238,611 | null |
75,528,188 | 2 | null | 75,527,553 | 1 | null | Chaining json.normalize() and pivot():
```
meta_columns = ["first_name", "last_name", "email", "status", "create_time"]
df = pd.json_normalize(
data=apend,
meta=meta_columns,
record_path="custom_questions"
).pivot(
index=meta_columns,
columns="title",
values="value"
).reset_index().rename_axis(None, axis=1)
print(df)
```
Output:
```
first_name last_name email status create_time a b c e
0 Eliza Carbajal Leon milacanaleslora@gmail.com approved 2023-02-21T23:07:24Z no NaN NaN identiti
1 Milagritos Canales Lora milacanaleslora@gmail.com approved 2023-02-21T23:07:24Z no si NaN NaN
2 Raúl Pedro Moreno Zavaleta raulmoreno147@gmail.com approved 2023-02-18T17:25:30Z si no 001 NaN
```
| null | CC BY-SA 4.0 | null | 2023-02-22T04:08:55.193 | 2023-02-22T04:43:40.963 | 2023-02-22T04:43:40.963 | 3,249,641 | 3,249,641 | null |
75,528,299 | 2 | null | 75,526,584 | 0 | null | p tag has margin which is not merging two section
just do this:
```
p {margin:0px;}
```
[https://codepen.io/Aksshit/pen/dyqMWzd](https://codepen.io/Aksshit/pen/dyqMWzd)
check this for solution which I tried on codepen.
Tip: Always use Developer Tools to first know the problem.
| null | CC BY-SA 4.0 | null | 2023-02-22T04:32:55.450 | 2023-02-22T04:33:42.410 | 2023-02-22T04:33:42.410 | 11,241,538 | 11,241,538 | null |
75,528,435 | 2 | null | 75,293,149 | 0 | null | This will resolve your issues.
!pip install --pre -U pycaret
Please follow bellow thread.
[https://github.com/pycaret/pycaret/issues/3150#issuecomment-1336593199](https://github.com/pycaret/pycaret/issues/3150#issuecomment-1336593199)
| null | CC BY-SA 4.0 | null | 2023-02-22T05:00:23.957 | 2023-02-22T05:00:23.957 | null | null | 2,594,194 | null |
75,528,694 | 2 | null | 53,873,351 | 0 | null | To add axis on the chart, use the following code:
```
addAxis(xAxis,postion); addAxis(yAxis,postion);
```
and then attach `series` to it.
| null | CC BY-SA 4.0 | null | 2023-02-22T05:46:14.850 | 2023-02-28T17:00:39.763 | 2023-02-28T17:00:39.763 | 9,520,525 | 9,006,484 | null |
75,529,133 | 2 | null | 42,736,364 | 0 | null | For total alignment to center I use this code:
```
from docx.enum.text import WD_ALIGN_PARAGRAPH
from docx.enum.table import WD_ALIGN_VERTICAL
for row in table.rows:
for cell in row.cells:
cell.paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER
cell.vertical_alignment = WD_ALIGN_VERTICAL.CENTER
```
| null | CC BY-SA 4.0 | null | 2023-02-22T06:50:57.007 | 2023-02-22T06:50:57.007 | null | null | 16,935,772 | null |
75,529,656 | 2 | null | 64,523,972 | 0 | null | I've implemented a pure SwiftUI picker implementation
[MyPickerView](https://i.stack.imgur.com/GCarF.png)
```
struct MyPickerView<T: Equatable>: View {
let options: [T]
@Binding var selection: T
@SwiftUI.State private var drag: Double = 0
let cellAngles = 20.0
let presentation: (T) -> String
init(_ options: [T], _ selection: Binding<T>, _ presentation: @escaping (T) -> String = {"\($0)"}) {
self.options = options
self._selection = selection
self.presentation = presentation
}
var body: some View {
let selectedIndex = getSelectedIndex()
HStack {
ZStack {
ForEach(0..<options.count, id: \.self) { index in
let item: T = options[index]
MyPickerCell(title: presentation(item), angle: Double(index - selectedIndex) * cellAngles + drag)
}
Color.gray.opacity(0.1)
.frame(height: 1)
.offset(y: 15)
Color.gray.opacity(0.1)
.frame(height: 1)
.offset(y: -15)
}
.frame(width: 100, height: 200)
.gesture(
DragGesture()
.onChanged { gesture in
drag = gesture.translation.height
}
.onEnded { _ in
var newIndex = selectedIndex - Int(round(drag / cellAngles))
if newIndex < 0 {
newIndex = 0
}
if newIndex >= options.count - 1 {
newIndex = options.count - 1
}
selection = options[newIndex]
drag = 0
}
)
}
}
func getSelectedIndex() -> Int {
return options.firstIndex(of: selection) ?? 0
}
}
private struct MyPickerCell: View {
let title: String
let angle: Double
var body: some View {
if abs(angle) > 90 {
EmptyView()
}
else {
let sinValue = sin(rad(angle))
let cosValue = cos(rad(angle))
Text(title)
.foregroundColor(.primary)
.scaleEffect(y: cosValue)
.offset(y: sinValue * 85)
.opacity(abs(angle) < 5 ? 1.0 : cosValue/2)
}
}
func rad(_ number: Double) -> Double {
return number * .pi / 180
}
}
```
Usage example:
```
struct ContentView: View {
@State var selectedNumber: Int = 3
var body: some View {
MyPickerView(Array(0...20), $selectedNumber)
}
}
```
| null | CC BY-SA 4.0 | null | 2023-02-22T07:54:44.433 | 2023-02-22T08:40:51.793 | 2023-02-22T08:40:51.793 | 3,129,268 | 3,129,268 | null |
75,529,756 | 2 | null | 68,450,660 | 1 | null | You can resolve the path directly in markdown file
```
<MyComponent :src="require('./resources/myimg.png')" />
```
| null | CC BY-SA 4.0 | null | 2023-02-22T08:05:27.700 | 2023-02-22T08:05:27.700 | null | null | 2,838,364 | null |
75,529,971 | 2 | null | 75,528,484 | 0 | null | You can change the unit on the item prototype, but the item name is "Number of Bytes", so looks correct.
> Kilobits per second is shortened to kb/s, Kbps or kbps (as opposed to
KBps, which is Kilobytes per second
See: [https://www.zabbix.com/documentation/6.0/en/manual/config/items/itemtypes/simple_checks/vmware_keys?hl=vmware.vm.net.if.in](https://www.zabbix.com/documentation/6.0/en/manual/config/items/itemtypes/simple_checks/vmware_keys?hl=vmware.vm.net.if.in)
[](https://i.stack.imgur.com/LrKoO.png)
[](https://i.stack.imgur.com/elZDj.png)
| null | CC BY-SA 4.0 | null | 2023-02-22T08:30:14.913 | 2023-02-22T08:30:14.913 | null | null | 11,405,542 | null |
75,530,257 | 2 | null | 75,505,900 | 1 | null | In a comment you explained
> we fetch certificates and signedHash from some external provide (CSC). We don't have privateKey. So, after fetching signedHash from CSC, we are directly overriding the method getSignature of ContentSignature and returning that signedHash. ContentSigner cannot actually sign the bytes.
ContentSigner actually sign the bytes. You merely have to call CSC signing from within it.
Simplifying your code a bit you can do that as follows:
```
try (
OutputStream output = new FileOutputStream(outFile);
PDDocument document = PDDocument.load(resource)
) {
PDSignature signature = new PDSignature();
signature.setFilter(PDSignature.FILTER_ADOBE_PPKLITE);
signature.setSubFilter(PDSignature.SUBFILTER_ETSI_CADES_DETACHED);
signature.setName("Test Name");
signature.setSignDate(Calendar.getInstance());
SignatureOptions signatureOptions = new SignatureOptions();
signatureOptions.setPage(0);
document.addSignature(signature, signatureOptions);
ExternalSigningSupport externalSigning = document.saveIncrementalForExternalSigning(output);
// retrieve signer certificate and its chain
Certificate[] certificateChain = retrieveCertificates(requestId, providerId, credentialId, accessToken);
X509Certificate cert = (X509Certificate) certificateChain[0];
// build signed attribute table generator and SignerInfo generator builder
ESSCertIDv2 certid = new ESSCertIDv2(
new AlgorithmIdentifier(NISTObjectIdentifiers.id_sha256),
MessageDigest.getInstance("SHA-256").digest(cert.getEncoded())
);
SigningCertificateV2 sigcert = new SigningCertificateV2(certid);
Attribute attr = new Attribute(PKCSObjectIdentifiers.id_aa_signingCertificateV2, new DERSet(sigcert));
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(attr);
AttributeTable atttributeTable = new AttributeTable(v);
CMSAttributeTableGenerator attrGen = new DefaultSignedAttributeTableGenerator(atttributeTable);
org.bouncycastle.asn1.x509.Certificate cert2 = org.bouncycastle.asn1.x509.Certificate.getInstance(ASN1Primitive.fromByteArray(cert.getEncoded()));
JcaSignerInfoGeneratorBuilder sigb = new JcaSignerInfoGeneratorBuilder(new JcaDigestCalculatorProviderBuilder().build());
sigb.setSignedAttributeGenerator(attrGen);
// create ContentSigner that signs by calling the CSC endpoint
ContentSigner contentSigner = new ContentSigner() {
private MessageDigest digest = MessageDigest.getInstance("SHA-256");
private OutputStream stream = OutputStreamFactory.createStream(digest);
@Override
public byte[] getSignature() {
try {
byte[] hash = digest.digest();
byte[] signedHash = signHash(requestId, providerId, accessToken, hash);
return signedHash;
} catch (Exception e) {
throw new RuntimeException("Exception while signing", e);
}
}
@Override
public OutputStream getOutputStream() {
return stream;
}
@Override
public AlgorithmIdentifier getAlgorithmIdentifier() {
return new AlgorithmIdentifier(new ASN1ObjectIdentifier("1.2.840.113549.1.1.11"));
}
};
// create the SignedData generator and execute
CMSSignedDataGenerator gen = new CMSSignedDataGenerator();
gen.addCertificates(new JcaCertStore(Arrays.asList(certificateChain)));
gen.addSignerInfoGenerator(sigb.build(contentSigner, new X509CertificateHolder(cert2)));
CMSTypedData msg = new CMSTypedDataInputStream(externalSigning.getContent());
CMSSignedData signedData = gen.generate(msg, false);
byte[] cmsSignature = signedData.getEncoded();
externalSigning.setSignature(cmsSignature);
}
```
[RemoteSigning](https://github.com/mkl-public/testarea-pdfbox2/blob/master/src/test/java/mkl/testarea/pdfbox2/sign/RemoteSigning.java#L224)`testSignLikeSkdjksDfkslImproved`
| null | CC BY-SA 4.0 | null | 2023-02-22T08:58:13.497 | 2023-02-22T08:58:13.497 | null | null | 1,729,265 | null |
75,530,327 | 2 | null | 75,530,079 | 5 | null | > I have created group in IAR IDE and I have added the .h file, but still it is showing error like source file not found.
Adding header files to source tree is only for convenience. It won't help the compiler to find the header file. Also, the group name has no real correlation to any folder on disk.
> I also tried adding path in preprocessor as $PROJ_DIR$/hdr.
That won't work because IDE environment variables like `$PROJ_DIR$` are not recognized in the source code.
> How do I add header file in IAR?
Go to project options and add your path of your header folder in `C/C++ Compiler -> Preprocessor -> Additional include directories`. This will make sure that compiler scans the directory were your header is when including the file. You can use `$PROJ_DIR$` relative paths here.
| null | CC BY-SA 4.0 | null | 2023-02-22T09:04:07.790 | 2023-02-22T09:19:31.803 | 2023-02-22T09:19:31.803 | 694,733 | 694,733 | null |
75,530,520 | 2 | null | 43,658,276 | 0 | null | This is the simplest and shortest way:
```
'requires reference to Microsoft Scripting Runtime
sub createDir(ByVal pathFolder As String)
Dim fso As Object
Dim path As String
Application.ScreenUpdating = False
Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.FolderExists(pathFolder) Then
' doesn't exist, so create the folder
fso.CreateFolder pathFolder
End If
Set fso = Nothing
Application.ScreenUpdating = True
End Sub
```
| null | CC BY-SA 4.0 | null | 2023-02-22T09:19:30.500 | 2023-02-22T09:36:21.237 | 2023-02-22T09:36:21.237 | 10,721,675 | 10,721,675 | null |
75,530,549 | 2 | null | 75,525,281 | 0 | null | You need to create a chart with three y-axes and three series. You can use the below options as a base to start.
```
series: [{
...
}, {
...,
yAxis: 1
}, {
...,
yAxis: 2
}],
yAxis: [{
height: '33.33%',
showFirstLabel: false,
showLastLabel: false
}, {
height: '33.33%',
top: '33.33%',
offset: 0,
showFirstLabel: false,
showLastLabel: false
}, {
height: '33.33%',
top: '66.66%',
offset: 0,
showFirstLabel: false,
showLastLabel: false
}]
```
---
[http://jsfiddle.net/BlackLabel/vse07qwy/](http://jsfiddle.net/BlackLabel/vse07qwy/)
[https://api.highcharts.com/highcharts/yAxis](https://api.highcharts.com/highcharts/yAxis)
| null | CC BY-SA 4.0 | null | 2023-02-22T09:22:23.490 | 2023-02-22T09:22:23.490 | null | null | 8,951,377 | null |
75,530,667 | 2 | null | 75,530,038 | 0 | null | U can use a textarea on frontend, for example:
```
<textarea className='form-control' rows={16} value={code} onChange={(e) => setCode(e.target.value)} />
```
And longtext on laravel's migration:
```
$table->longText('code');
```
Then u can show the text exactly how it was written using the [pre](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/pre) tag
```
<pre>{db_response.code}</pre>
```
| null | CC BY-SA 4.0 | null | 2023-02-22T09:32:18.963 | 2023-02-22T09:32:18.963 | null | null | 20,983,056 | 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.