Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
sequence |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
74,222,020 | 2 | null | 27,238,564 | 2 | null | Running `PROMPT_EOL_MARK=''` into the command line fixes this.
| null | CC BY-SA 4.0 | null | 2022-10-27T12:26:37.157 | 2022-10-27T12:26:37.157 | null | null | 9,133,569 | null |
74,222,043 | 2 | null | 27,096,363 | 0 | null |
The excellent way to read a * file would be locally installing the h2 database and then running that database locally with the java command.
Then your path to the file will definitely show the data from your table until and unless any errors occur.
You can download the h2 database form:
[http://www.h2database.com/html/download-archive.html](http://www.h2database.com/html/download-archive.html)
choose the database version for H2 which supports your file.
You can install the H2 database by installing the downloaded .exe file would be around 7 MB.
then in the bin directory of H2 open a command prompt and run the command
java -jar in my case it is
java -jar h2-1.4.200.jar
It will show the console of the H2 database on the browser
Provide the database details:
Driver Class: org.h2.Driver JDBC
URL: jdbc:h2:~/h2 "file path"
User Name: "blank by default"
Password: "blank by default"
Refer SS below
[enter image description here](https://i.stack.imgur.com/4a7xv.png)
| null | CC BY-SA 4.0 | null | 2022-10-27T12:28:23.140 | 2022-10-27T12:33:49.233 | 2022-10-27T12:33:49.233 | 8,627,541 | 8,627,541 | null |
74,222,031 | 2 | null | 74,221,938 | 1 | null | the `ajv` package doesn't seem to provide an executable:
```
jessehouwing abrikoosje ~ $ npm install ajv -g 14:25:53
added 6 packages, and audited 7 packages in 469ms
1 package is looking for funding
run `npm fund` for details
found 0 vulnerabilities
jessehouwing abrikoosje ~ $ ajv 14:25:56
Command 'ajv' not found, did you mean:
command 'aj5' from deb aspectj (1.9.2-2)
command 'aj' from deb aspectj (1.9.2-2)
command 'ajc' from deb aspectj (1.9.2-2)
Try: sudo apt install <deb name>
jessehouwing abrikoosje ~ NOTFOUND $ npx ajx 14:25:58
npm ERR! could not determine executable to run
npm ERR! A complete log of this run can be found in:
npm ERR! /home/jessehouwing/.npm/_logs/2022-10-27T12_26_14_602Z-debug-0.log
```
It's meant to be used as a library, not as a cli.
Did you mean:
[https://www.npmjs.com/package/ajv-cli](https://www.npmjs.com/package/ajv-cli)
```
jessehouwing abrikoosje ~ $ npm install ajv-cli -g 14:29:27
added 27 packages, and audited 28 packages in 2s
3 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
jessehouwing abrikoosje ~ $ ajv 14:29:38
error: parameter -s is required
error: parameter -d is required
usage:
validate: ajv [validate] -s schema[.json] -d data[.json]
compile: ajv compile -s schema[.json]
migrate: ajv migrate -s schema[.json] -o migrated_schema.json
test: ajv test -s schema[.json] -d data[.json] --[in]valid
help: ajv help
ajv help <command>
jessehouwing abrikoosje ~ USAGE $
```
| null | CC BY-SA 4.0 | null | 2022-10-27T12:27:37.680 | 2022-10-27T12:27:37.680 | null | null | 736,079 | null |
74,222,056 | 2 | null | 71,671,078 | 0 | null | I also encounter when using my script with other scripts(it is a non V5 script), the solution is hide other scripts and then back to normal
| null | CC BY-SA 4.0 | null | 2022-10-27T12:29:20.347 | 2022-10-27T12:29:20.347 | null | null | 353,911 | null |
74,222,301 | 2 | null | 74,220,310 | 0 | null | You can just rename your files through PowerShell before publish them:
```
$projectName = 'WebApplication1'
$projectNewName = 'WebApplication1_$(Build.BuildNumber)'
Get-ChildItem -File -Recurse -Path $(build.artifactstagingdirectory) "$projectName.*" | Rename-Item -NewName { $_.Name -replace "$projectName","$projectNewName" }
```
The example:
[](https://i.stack.imgur.com/yl6yX.png)
The result:
[](https://i.stack.imgur.com/SEK9f.png)
| null | CC BY-SA 4.0 | null | 2022-10-27T12:47:13.460 | 2022-10-27T12:47:13.460 | null | null | 8,235,971 | null |
74,222,527 | 2 | null | 27,878,217 | 0 | null | This is rather complicated, but it gives a general and neat solution.
```
import numpy as np
value1 = 3
xvalues = [0, 1, 2, 3, 4]
line1 = [2.0, 3.0, 2.0, 5.0, 4.0]
stdev1 = [0.1, 0.2, 0.1, 0.4, 0.3]
line2 = [1.7, 3.1, 2.5, 4.8, 4.2]
stdev2 = [0.12, 0.18, 0.12, 0.3, 0.35]
max_times = [max(line1+stdev1),max(line2+stdev2)]
min_times = [min(line1+stdev1),min(line2+stdev2)]
font_size = 25
max_total = max(max_times)
min_total = min(min_times)
max_minus_min = max_total - min_total
step_size = max_minus_min/10
head_space = (step_size*3)
plt.figure(figsize=(15, 15))
plt.errorbar(xvalues, line1, yerr=stdev1, fmt='', color='b')
plt.errorbar(xvalues, line2, yerr=stdev2, fmt='', color='r')
plt.xlabel("xvalues", fontsize=font_size)
plt.ylabel("lines 1 and 2 Test "+str(value1), fontsize=font_size)
plt.title("Let's leave space for the legend Experiment"+ str(value1), fontsize=font_size)
plt.legend(("Line1", "Line2"), loc="upper left", fontsize=font_size)
plt.tick_params(labelsize=font_size)
plt.yticks(np.arange(min_total, max_total+head_space, step=step_size) )
plt.grid()
plt.tight_layout()
```
Result:
[](https://i.stack.imgur.com/MfBbl.png)
| null | CC BY-SA 4.0 | null | 2022-10-27T13:04:30.203 | 2022-10-27T13:04:30.203 | null | null | 6,434,975 | null |
74,222,609 | 2 | null | 69,858,216 | 0 | null | The triangles list missed one triangle below, plz add this : )
```
[255, 339, 448]
```
| null | CC BY-SA 4.0 | null | 2022-10-27T13:10:37.507 | 2022-10-27T13:10:37.507 | null | null | 11,507,814 | null |
74,223,363 | 2 | null | 67,574,809 | 1 | null | I made a skip-gram model demo in this [GitHub repo](https://github.com/study-ml/word2vec-demo). Hopefully, it can help people to understand how the skip-gram model works.
[](https://i.stack.imgur.com/4j7Ap.jpg)
| null | CC BY-SA 4.0 | null | 2022-10-27T14:01:11.090 | 2022-10-27T14:01:11.090 | null | null | 1,844,393 | null |
74,223,715 | 2 | null | 74,222,544 | 1 | null | Few things.
1. dont use list as a variable name. Thats a defined python method, so try to avoid using things like that (int, str, for, etc.)
2. use .strip() to remove that extra whitespace at the end of text instead of .replace()
3. Pandas is a great tool to use. Get familar with it. use it...it'll make life easier.
Lastly, this one is tough because not all that data is present, and there's no indicator to match up `"body"`, `"year"`, etc. So I made it slightly different, and if you want, you can split that `"Extra"` columns I created.
```
import requests
import pandas as pd
from bs4 import BeautifulSoup
url = 'https://www.autotrader.co.uk/car-search?postcode=CV23%208AJ&include-delivery-option=on&advertising-location=at_cars&page=1'
headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36'}
page = requests.get(url, headers=headers)
soup = BeautifulSoup(page.content, 'html.parser')
lists = soup.find_all('div', class_="product-card__inner")
data = []
for each in lists:
price = each.find('div', class_="product-card-pricing__price").text.strip()
title = each.find('h3', class_="product-card-details__title").text.strip()
subtitle = each.find('p', class_="product-card-details__subtitle").text.strip()
extra = each.find('ul', {'class':'listing-key-specs'})
extra_lists = extra.find_all('li')
row = {
'Price':price,
'Title':title,
'Subtitle':subtitle,
'Extra': '|'.join([x.text.strip() for x in extra_lists])
}
data.append(row)
df = pd.DataFrame(data)
df.to_csv('autotraderdata.csv', index=False)
```
```
print(df.to_string())
Price Title Subtitle Extra
0 £395 Nissan Micra 1.0 16v Tempest 3dr 2002 (02 reg)|Hatchback|103,565 miles|1.0L|60BHP|Manual|Petrol|5 owners
1 £900 Volkswagen Polo 1.6 TDI SE Hatchback 5dr Diesel Manual Euro 5 (75 ps) 2010 (10 reg)|Hatchback|120,287 miles|1.6L|75PS|Manual|Diesel|5 owners
2 £1,200 Vauxhall Corsa 1.6i 16v SRi Hatchback 3dr Petrol Manual (189 g/km, 148 bhp) 2008 (08 reg)|Hatchback|79,828 miles|1.6L|148BHP|Manual|Petrol|5 owners|ULEZ
3 £695 Volkswagen Golf Plus 1.9 TDI PD SE 5dr 2006 (06 reg)|Hatchback|149,000 miles|1.9L|103BHP|Manual|Diesel|3 owners
4 £995 Vauxhall Vectra 1.9 CDTi 16v SRi 5dr 2006 (06 reg)|Estate|115,000 miles|1.9L|148BHP|Manual|Diesel
5 £1,995 Smart Roadster 0.7 2dr 2004 (54 reg)|Convertible|136,000 miles|0.7L|80BHP|Automatic|Petrol|4 owners|ULEZ
6 £1,490 Ford Fiesta 1.25 Finesse 3dr 2004 (53 reg)|Hatchback|120,000 miles|1.25L|74BHP|Manual|Petrol|ULEZ
7 £849 MINI Hatch 1.6 Cooper Euro 4 3dr 2007 (56 reg)|Hatchback|73,600 miles|1.6L|120PS|Manual|Petrol|6 owners|ULEZ
8 £500 BMW 3 Series 2.0 320i SE Saloon 4dr Petrol Manual Euro 4 (150 ps) 2005 (55 reg)|Saloon|129,000 miles|2.0L|150PS|Manual|Petrol|10 owners|ULEZ
9 £1,350 Vauxhall Astra 1.6 16v Exclusiv 5dr 2010 (10 reg)|Hatchback|97,000 miles|1.6L|115PS|Manual|Petrol|3 owners|ULEZ
10 £26,900 KIA Sportage 1.6 T-GDi 2 Euro 6 (s/s) 5dr SUV|1.6L|150PS|Manual|Petrol|First year road tax included|Full manufacturer warranty|ULEZ
```
| null | CC BY-SA 4.0 | null | 2022-10-27T14:25:13.787 | 2022-10-27T14:25:13.787 | null | null | 7,752,296 | null |
74,224,564 | 2 | null | 74,224,377 | 1 | null | If there are at most two duplicate values, you can do `groupby.apply`
```
def set_value(g):
if len(g) > 1:
g.loc[g['value2'].ne('copy'), 'new_value2'] = g.loc[g['value2'].eq('copy'), 'value'].values
return g[g['value2'].ne('copy')]
else:
return g
out = df.groupby('key2').apply(set_value).reset_index(drop=True)
```
```
print(out)
key1 key2 key3 value value2 new_value2
0 g 1246 7 932 NaN NaN
1 f 3333 6 56767 NaN 2348.0
2 b 4565 2 345 NaN NaN
3 c 7777 3 234 NaN 556.0
4 d 9789 4 4 NaN NaN
5 a 23423 1 23453 NaN NaN
6 e 567567 5 5678 NaN NaN
```
| null | CC BY-SA 4.0 | null | 2022-10-27T15:27:16.190 | 2022-10-27T15:27:16.190 | null | null | 10,315,163 | null |
74,225,694 | 2 | null | 8,876,397 | 0 | null | I know I'm rather late to the party here - but I've just been looking into doing the same thing, for JPEG images downloaded over a network (that can sometimes include a satellite link, which is prone to drop-outs).
As per the page at: [https://www.file-recovery.com/jpg-signature-format.htm](https://www.file-recovery.com/jpg-signature-format.htm) - JPEG images always end with the last two bytes FF D9. So, for JPEG images, you can simply read the last two bytes, and if they don't match those values, then the image isn't complete. Of course, you may have enough of the image for it to render almost perfectly, and that test won't pick up corrupt data in the middle of the file - but as a quick and dirty test for an incomplete file, it works.
I notice that wp78de's solution from two years ago is doing just that (as well as testing for FF D9 FF FF, which I guess means some JPEG images have a four byte end marker?).
Hope that helps.
| null | CC BY-SA 4.0 | null | 2022-10-27T16:59:00.877 | 2022-10-27T17:05:52.103 | 2022-10-27T17:05:52.103 | 949,129 | 949,129 | null |
74,226,615 | 2 | null | 74,193,551 | 0 | null | Introduced to more advanced SQL concepts and guided through various steps of data extraction by @Akina I came to the following solution to the question:
```
WITH
cte1 AS (
SELECT *, incoming_msg_id AS user_id FROM chat
WHERE @user_id IN (incoming_msg_id, outgoing_msg_id)
UNION ALL
SELECT *, outgoing_msg_id FROM chat
WHERE @user_id IN (incoming_msg_id, outgoing_msg_id)
),
cte2 AS (
SELECT *, ROW_NUMBER() OVER (PARTITION BY user_id ORDER BY msg_id DESC) rn
FROM cte1
),
cte3 AS (
SELECT * FROM cte2 WHERE user_id <> @user_id AND rn = 1
)
SELECT *
FROM users
LEFT JOIN cte3 USING (user_id);
```
This solution selects the last chat messages if there is any but nevertheless displays all existing users.
| null | CC BY-SA 4.0 | null | 2022-10-27T18:18:08.650 | 2022-10-27T18:18:08.650 | null | null | 19,724,961 | null |
74,226,842 | 2 | null | 43,548,091 | 0 | null | Go to view, you can see Header and toolbar. If you can't see header, click view header and If you can't see toolbar, click view toolbar.
| null | CC BY-SA 4.0 | null | 2022-10-27T18:40:46.093 | 2022-10-27T18:40:46.093 | null | null | 20,332,294 | null |
74,227,350 | 2 | null | 54,564,341 | 3 | null | In [AWS](https://docs.aws.amazon.com/transfer/latest/userguide/requirements-dns.html#tag-custom-hostname-cdk),
> When you create a server using AWS Cloud Development Kit (AWS CDK) or through the CLI, you must add a tag if you want that server to have a custom hostname. When you create a Transfer Family server by using the console, the tagging is done automatically.
So, you will need to be able to add those tags using Terraform. In [v4.35.0](https://github.com/hashicorp/terraform-provider-aws/releases/tag/v4.35.0) they added support for a new resource: [aws_transfer_tag](https://github.com/hashicorp/terraform-provider-aws/issues/18077).
[An example supplied in the GitHub Issue](https://github.com/hashicorp/terraform-provider-aws/issues/18077#issuecomment-1273904488) (I haven't tested it personally yet.):
```
resource "aws_transfer_server" "with_custom_domain" {
# config here
}
resource "aws_transfer_tag" "with_custom_domain_route53_zone_id" {
resource_arn = aws_transfer_server.with_custom_domain.arn
key = "aws:transfer:route53HostedZoneId"
value = "/hostedzone/ABCDE1111222233334444"
}
resource "aws_transfer_tag" "with_custom_domain_name" {
resource_arn = aws_transfer_server.with_custom_domain.arn
key = "aws:transfer:customHostname"
value = "abc.example.com"
}
```
| null | CC BY-SA 4.0 | null | 2022-10-27T19:28:50.420 | 2022-10-27T19:28:50.420 | null | null | 18,714,817 | null |
74,227,605 | 2 | null | 21,712,419 | 0 | null | I ran into the same problem. Solution: I changed all the column names and it worked. Something about the column names MS Access didn't like. I named them f1, f2, f3...
| null | CC BY-SA 4.0 | null | 2022-10-27T19:53:48.580 | 2022-10-27T19:53:48.580 | null | null | 13,276,030 | null |
74,227,611 | 2 | null | 70,465,659 | 0 | null | The executable's name for local installations is actually `tailwind`, not `tailwindcss`:
```
"scripts": {
"build": "tailwind -i ./src/tailwind.css -o ./public/style.css -w",
^^--- replaced tailwindcss with tailwind
```
The code above assumes you have `tailwindcss` in your dependencies, e.g.:
```
"devDependencies": {
"tailwindcss": "^3.2.1"
```
and have installed them (`npm install`).
| null | CC BY-SA 4.0 | null | 2022-10-27T19:54:13.743 | 2022-10-27T20:01:57.437 | 2022-10-27T20:01:57.437 | 1,850,609 | 1,850,609 | null |
74,227,840 | 2 | null | 74,227,801 | 0 | null | You need to return the instance from `create` on
```
providers: [
ChangeNotifierProvider(
create: (context) {
return favorite(); //this one here
},
),
],
```
| null | CC BY-SA 4.0 | null | 2022-10-27T20:14:49.163 | 2022-10-27T20:14:49.163 | null | null | 10,157,127 | null |
74,227,867 | 2 | null | 69,665,263 | 2 | null | Instead of `.gesture(dragGesture)` try `.highPriorityGesture(dragGesture)`.
| null | CC BY-SA 4.0 | null | 2022-10-27T20:17:48.027 | 2022-10-27T20:17:48.027 | null | null | 26,625 | null |
74,228,031 | 2 | null | 30,008,721 | 0 | null | I know it's literally been 7 years, but I stumbled across the problem of clamping cameras in ThreeJS (for an fps-style camera), and came up with a solution of my own based on this [stackoveflow post](https://stackoverflow.com/questions/72421170/need-help-clamping-camera-rotation). Here is what I came up with:
```
// make sure to pointer lock for optimal camera feel
const UP_AXIS = new THREE.Vector3(0, 1, 0);
let initialRotation = 0;
this.canvas.addEventListener("mousemove", (e) => {
let newRotation = this.cameraRotation + e.movementY * -0.00001
// here is where the clamping takes place
newRotation = THREE.MathUtils.clamp(newRotation, -Math.PI / 2, Math.PI / 2);
// rotate the camera horizontally (no clamping)
this.camera.rotateOnWorldAxis(UP_AXIS, e.movementX * -0.0001 * settings.mouseSensitivity);
// rotate the camera with clamping
this.camera.rotateX(newRotation - initialRotation);
initialRotation = newRotation;
})
```
I hope people find this useful.
| null | CC BY-SA 4.0 | null | 2022-10-27T20:37:01.123 | 2022-10-27T20:37:01.123 | null | null | 8,254,348 | null |
74,228,216 | 2 | null | 27,965,662 | 0 | null | Here's a Kotlin version of the accepted answer from @trungdinhtrong:
```
val alert = builder.create()
if (button1Text == "Delete") {
alert.setOnShowListener { dialog ->
alert.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(Color.RED);
}
}
```
BTW, it seems like Android's idea of "positive" and "negative" buttons isn't compatible with the idea of "safe" and "destructive" buttons. In a dialog with Cancel and Delete buttons, I think Android would consider Delete the positive button because it performs an action, but I would consider it a destructive button because it leads to data loss. So instead of using the styles file to set positive and negative button colors, I'm using this code to make the Delete button red even though it's the "positive" button.
| null | CC BY-SA 4.0 | null | 2022-10-27T20:56:29.393 | 2022-10-27T20:56:29.393 | null | null | 462,162 | null |
74,228,261 | 2 | null | 74,221,293 | 0 | null | Consider below option
```
select id, sku
from your_table,
unnest(regexp_extract_all(data, r'\bsku:([^},]*)\b')) sku
```
if applied to dummy data similar to what you have in question - output is
[](https://i.stack.imgur.com/qUuwz.png)
| null | CC BY-SA 4.0 | null | 2022-10-27T21:00:48.890 | 2022-10-27T21:00:48.890 | null | null | 5,221,944 | null |
74,228,337 | 2 | null | 29,833,743 | 0 | null | If nothing helped, then you can try this scheme: Tools -> Vim Emulator (disable the check mark)
| null | CC BY-SA 4.0 | null | 2022-10-27T21:08:20.877 | 2022-10-27T21:08:20.877 | null | null | 19,411,152 | null |
74,228,666 | 2 | null | 74,228,563 | 3 | null | You can write the pdf and cdf as functions, using `ifelse` to specify the values within the ranges, then simply plot the functions over the desired range:
```
pdf <- function(x) {
ifelse(x >= 0 & x < 1, 0.5, ifelse(x < 1.5 & x >= 1, 1, 0))
}
cdf <- function(x) {
ifelse(x < 0, 0,
ifelse(x >= 0 & x < 1, 0.5 * x,
ifelse(x < 1.5 & x >= 1, x - 0.5, 1)))
}
plot(pdf, xlim = c(-1, 2), type = "s")
```

```
plot(cdf, xlim = c(-1, 2))
```

[reprex v2.0.2](https://reprex.tidyverse.org)
| null | CC BY-SA 4.0 | null | 2022-10-27T21:48:40.673 | 2022-10-27T21:48:40.673 | null | null | 12,500,315 | null |
74,229,009 | 2 | null | 23,044,218 | 0 | null | For SwiftUI, I use Introspect [Introspect](https://github.com/siteline/SwiftUI-Introspect)
Then in your TabView view modifier, increase the size of your view by adding to the height. Here I am adding 7 pts then another 2.5 pts for a custom divider line. And I added it differently for iPhone vs. iPad.
```
.introspectTabBarController { UITabBarController in
if sizeClass == .compact {
let barIncrease = UIView(frame: CGRect(x: 0, y: -7, width: UITabBarController.tabBar.frame.size.width, height: 9))
barIncrease.backgroundColor = UIColor(hex: "#508FD6FF")
UITabBarController.tabBar.addSubview(barIncrease)
let lineView = UIView(frame: CGRect(x: 0, y: -9.5, width: UITabBarController.tabBar.frame.size.width, height: 2.5))
lineView.backgroundColor = UIColor(hex: "#508FD6FF")
UITabBarController.tabBar.addSubview(lineView)
} else {
let lineView = UIView(frame: CGRect(x: 0, y: -2.5, width: UITabBarController.tabBar.frame.size.width, height: 2.5))
lineView.backgroundColor = UIColor(hex: "#508FD6FF")
UITabBarController.tabBar.addSubview(lineView)
}
}
```
| null | CC BY-SA 4.0 | null | 2022-10-27T22:44:12.853 | 2022-10-27T22:44:12.853 | null | null | 5,382,632 | null |
74,229,551 | 2 | null | 74,229,463 | 1 | null | Put `display: inline-block;` on the search div.
```
.test {
display: inline-block;
}
```
```
<div class="topnav">
<button>+</button>
<button>-</button>
<button>Adv</button>
<select id="select-items">
<option value="uid">Uid</option>
<option value="name">Name</option>
<option value="email">Email</option>
<option value="user_type">User type</option>
<option value="last_login">Last login</option>
</select>
<select id="select-filter">
<option>=</option>
<option>></option>
<option>>=</option>
<option><</option>
<option><=</option>
<option>Starts with</option>
<option>Contains</option>
<option>Ends with</option>
</select>
<div class=test>
<form onsubmit="search()" class="search-bar">
<input id="searchBar" class="input searchbar" type="text"
aria-autocomplete="list"
aria-expanded="false"
style="height: 28.5px; width: 12px"
>
<button><i class="fa fa-search">search</i>
</button>
</form>
</div>
</div>
```
| null | CC BY-SA 4.0 | null | 2022-10-28T00:35:57.093 | 2022-10-28T00:35:57.093 | null | null | 4,797,603 | null |
74,229,690 | 2 | null | 74,229,463 | 0 | null | because you didn't style anything. so since everything is in one `container`, then just set the container's `display to flex` with `row direction`. and your main `container` here is `topnav`
```
.topnav {
border: 1px solid;
display: flex;
flex-direction: row;
}
.topnav :nth-child(n){
margin: 0 2px;
}
```
```
<div class="topnav">
<button>Add</button>
<button>Delete</button>
<button>Advanced Filters</button>
<select id="select-items">
<option value="uid">Uid</option>
<option value="name">Name</option>
<option value="email">Email</option>
<option value="user_type">User type</option>
<option value="last_login">Last login</option>
</select>
<select id="select-filter">
<option>=</option>
<option>></option>
<option>>=</option>
<option><</option>
<option><=</option>
<option>Starts with</option>
<option>Contains</option>
<option>Ends with</option>
</select>
<div class>
<form onsubmit="search()" class="search-bar">
<input id="searchBar" class="input searchbar" type="text"
aria-autocomplete="list"
aria-expanded="false"
>
<button><i class="fa fa-search">search</i>
</button>
</form>
</div>
</div>
```
| null | CC BY-SA 4.0 | null | 2022-10-28T01:12:44.360 | 2022-10-28T01:18:04.323 | 2022-10-28T01:18:04.323 | 6,467,902 | 6,467,902 | null |
74,229,752 | 2 | null | 18,864,450 | 0 | null | Not sure how obsolete this issue is, but just in case if normal SendKeys approach don't work, use OpenDialogWindowHandler package which is available in NuGet Package Manager
```
using OpenDialogWindowHandler;
// Find "upload" or "browse files" button. Click on it.
var upload = _driver.FindElement(By.XPath("//*[text()='Browse files']"));
upload.Click();
// using "HandleOpenDialog" to locate and upload file
HandleOpenDialog hndOpen = new HandleOpenDialog();
hndOpen.fileOpenDialog(photoLocation, photoName);
```
| null | CC BY-SA 4.0 | null | 2022-10-28T01:25:10.937 | 2022-10-28T01:25:10.937 | null | null | 20,227,554 | null |
74,230,650 | 2 | null | 74,228,928 | 0 | null | It only sends the newUser claim when the value is true (after initial user sign up). Notice the Description column of the "User is new" row on the Application claims screen - .
Here are token claims after initial sign up:
```
"exp": 1666934066,
"nbf": 1666930466,
"ver": "1.0",
"iss": "https://circleboxb2c.b2clogin.com/6e16d329-4657-4f68-bbbe-e47f06bb97c3/v2.0/",
"sub": "c22da3c0-df8c-4d4e-9ca2-0f9004994b13",
"aud": "61d2758f-7210-4e72-a669-915583ace4f9",
"nonce": "638025272161383928.NTVhOWZjOTAtMGI5Yy00NGEyLTg3MzUtNjI2YzQxNjk4ZDdmMzMzNjZhOTItYmM3OC00NDFlLWEzMzItODVjNDVhZjk0Zjc4",
"iat": 1666930466,
"auth_time": 1666930466,
"newUser": true,
"tfp": "B2C_1_susi-so"
```
When I logout and sign in with that user, I get these claims (no newUser claim this time):
```
"exp": 1666933847,
"nbf": 1666930247,
"ver": "1.0",
"iss": "https://circleboxb2c.b2clogin.com/6e16d329-4657-4f68-bbbe-e47f06bb97c3/v2.0/",
"sub": "bd9abfd8-5d79-4231-ad48-5a7b8c700e0f",
"aud": "61d2758f-7210-4e72-a669-915583ace4f9",
"nonce": "638025270465287700.Y2FjZjZkMzgtMjBhMC00OWE2LWFjNzQtOGUzMzZkNmQ2NjZjNWFhM2NjMDMtZTNhYi00MWU4LThjYjItZWVjNmVmNmU4MDM2",
"iat": 1666930247,
"auth_time": 1666930247,
"tfp": "B2C_1_susi-so"
```
| null | CC BY-SA 4.0 | null | 2022-10-28T04:25:39.853 | 2022-10-28T04:25:39.853 | null | null | 3,786,517 | null |
74,230,681 | 2 | null | 74,228,928 | 1 | null | You need to use interactive method like and include scope to get `new user` token claim.
I have one Azure AD B2C application that has as below:

Now I created one `Sign up and sign in` user flow with same parameters as you and ran the user flow like below:

When I ran the user flow, I got the like below:

Now I selected `Sign up now` to sign in as a and got below screen where I filled like this:

When I selected , it took me to the redirect URI with `code` in address bar like below:

To generate access token, I used flow with parameters like below:
```
POST https://b2ctenant.b2clogin.com/b2ctenant.onmicrosoft.com/B2C_1_SUSI/oauth2/v2.0/token
grant_type:authorization_code
client_id:appid
client_secret:secret
scope:openid
code: use the code that you got in above step
redirect_uri:https://jwt.ms
```

When I decoded the above token, I got `newUser` claim as true as below:

| null | CC BY-SA 4.0 | null | 2022-10-28T04:31:58.407 | 2022-10-28T04:31:58.407 | null | null | 18,043,665 | null |
74,230,809 | 2 | null | 74,220,771 | 1 | null | Power BI Report Server supports [Branding the web portal](https://learn.microsoft.com/sql/reporting-services/branding-the-web-portal).
A brand package for Reporting Services consists of three items and is packaged as a zip file:
1. metadata.xml
2. colors.json
3. logo.png (optional)
To update the colors, you need to create a color.json file
which will look something like:
```
{
"name":"Multicolored example brand",
"version":"1.0",
"interface":{
"primary":"#b31e1e",
"primaryAlt":"#ca0806",
"primaryAlt2":"#621013",
"primaryAlt3":"#e40000",
"primaryAlt4":"#e14e50",
"primaryContrast":"#fff",
"secondary":"#042200",
"secondaryAlt":"#0f4400",
"secondaryAlt2":"#155500",
"secondaryAlt3":"#217700",
"secondaryContrast":"#49e63c",
"neutralPrimary":"#d8edff",
"neutralPrimaryAlt":"#c9e6ff",
"neutralPrimaryAlt2":"#aedaff",
"neutralPrimaryAlt3":"#88c8ff",
"neutralPrimaryContrast":"#0a2b4c",
"neutralSecondary":"#e9d8eb",
"neutralSecondaryAlt":"#d9badc",
"neutralSecondaryAlt2":"#b06cb5",
"neutralSecondaryAlt3":"#a75bac",
"neutralSecondaryContrast":"#250a26",
"neutralTertiary":"#f79220",
"neutralTertiaryAlt":"#f8a54b",
"neutralTertiaryAlt2":"#facc9b",
"neutralTertiaryAlt3":"#fce3c7",
"neutralTertiaryContrast":"#391d00",
"danger":"#ff0000",
"success":"#00ff00",
"warning":"#ff8800",
"info":"#00ff",
"dangerContrast":"#fff",
"successContrast":"#fff",
"warningContrast":"#fff",
"infoContrast":"#fff",
"itemTypeIconColor":"#ffffff",
"reportIconBackground":"#12239e",
"excelIconBackground":"#217346",
"folderIconBackground":"#4668c5",
"datasetIconBackground":"#c94f0f",
"otherIconBackground":"#000000"
},
"theme":{
"dataPoints":[
"#0072c6",
"#f68c1f",
"#269657",
"#dd5900",
"#5b3573",
"#22bdef",
"#b4009e",
"#008274",
"#fdc336",
"#ea3c00",
"#00188f",
"#9f9f9f"
],
"good":"#85ba00",
"bad":"#e90000",
"neutral":"#edb327",
"none":"#333",
"background":"#fff",
"foreground":"#222",
"mapBase":"#00aeef",
"panelBackground":"#f6f6f6",
"panelForeground":"#222",
"panelAccent":"#00aeef",
"tableAccent":"#00aeef",
"altBackground":"#f6f6f6",
"altForeground":"#000",
"altMapBase":"#f68c1f",
"altPanelBackground":"#235378",
"altPanelForeground":"#fff",
"altPanelAccent":"#fdc336",
"altTableAccent":"#fdc336"
}
}
```
Then add the color.json in metadata.xml:
```
<?xml version="1.0" encoding="utf-8"?>
<SystemResourcePackage xmlns="http://schemas.microsoft.com/sqlserver/reporting/2016/01/systemresourcepackagemetadata"
type="UniversalBrand"
version="2.0.2"
name="Multicolored example brand"
>
<Contents>
<Item key="colors" path="colors.json" />
<Item key="logo" path="logo.png" />
</Contents>
</SystemResourcePackage>
```
Package these files into a zip file, and upload it into the web portal by following the [steps mentioned in the link](https://learn.microsoft.com/sql/reporting-services/branding-the-web-portal?view=sql-server-ver16#applying-the-brand-package-to-the-web-portal)
1. https://learn.microsoft.com/sql/reporting-services/branding-the-web-portal
2. https://youtu.be/m08kLuofwFA
| null | CC BY-SA 4.0 | null | 2022-10-28T04:54:37.760 | 2022-10-28T04:54:37.760 | null | null | 18,577,747 | null |
74,230,924 | 2 | null | 20,815,211 | 0 | null | A bit late to the party, but here's a "semi-working" solution, which I've just implemented myself.
You need to change the internal item delegate of the completer, either by subclassing QCompleter or just calling the respective functions. This example uses subclassing.
```
MyCompleter::MyCompleter(QObject* parent) : QCompleter(parent)
{
QAbstractItemDelegate* delegate = popup()->itemDelegate();
popup()->setItemDelegate(new MyCompleterItemDelegate(popup()));
delete delegate;
}
```
`MyCompleterItemDelegate` can be implemented like this:
```
MyCompleterItemDelegate::MyCompleterItemDelegate(QAbstractItemView* view)
: QItemDelegate(view), m_view(view)
{
}
void MyCompleterItemDelegate::paint(QPainter* p, const QStyleOptionViewItem& option, const QModelIndex& index) const
{
if (index.data(Qt::UserRole).toInt() == SEPARATOR) // this is where you check if the current index is a separator
{
QRect rect = option.rect;
rect.setWidth(m_view->viewport()->width());
QStyleOption opt;
opt.rect = rect;
m_view->style()->drawPrimitive(QStyle::PE_IndicatorToolBarSeparator, &opt, p, m_view);
}
else
{
QStyleOptionViewItem optCopy = option;
optCopy.showDecorationSelected = true;
if (m_view->currentIndex() == index)
optCopy.state |= QStyle::State_HasFocus;
QItemDelegate::paint(p, optCopy, index);
}
}
```
Note, that this doesn't solve the issue with showing the filtered items with separators. For that you would need to somehow alter the completion (proxy) model as returned by `QCompleter::completionModel()`. I haven't figured that one out yet. Also, you need to somehow tell the completer/delegate what a separator is. In my case I have a custom model. With a `QStringList` perhaps a certain trigger word would do the trick?
Hope this helps someone.
| null | CC BY-SA 4.0 | null | 2022-10-28T05:15:22.537 | 2022-10-28T05:25:18.123 | 2022-10-28T05:25:18.123 | 4,915,140 | 4,915,140 | null |
74,230,985 | 2 | null | 74,229,759 | 1 | null | Since your output format is pdf, you can use command `\vspace` to increase the vertical space between the figures.
```
---
title: "Spaces"
format: pdf
---
## Quarto
{width=20%}
\vspace{2em}
{width=20%}
\vspace{2em}
{width=20%}
```
[](https://i.stack.imgur.com/da5SX.png)
---
If you need more space increase the value of `\vspace{}` from to or etc.
| null | CC BY-SA 4.0 | null | 2022-10-28T05:27:34.347 | 2022-10-28T05:34:48.437 | 2022-10-28T05:34:48.437 | 10,858,321 | 10,858,321 | null |
74,230,990 | 2 | null | 74,228,563 | 2 | null | `ifelse` can be very slow, we can fill an output vector instead. `numeric()` creates a vector of zeroes of a specified length, we then simply change everything that should not yield zero.
```
pdf_vec <- function(x) {
out <- numeric(length(x))
out[x >= 0 & x < 1] <- .5
out[x >= 1 & x < 1.5] <- 1
out
}
cdf_vec <- function(x) {
out <- numeric(length(x))
tmp <- x >= 0 & x < 1
out[tmp] <- .5*x[tmp]
tmp <- x >= 1 & x < 1.5
out[tmp] <- x[tmp] - .5
tmp <- x >= 1.5
out[tmp] <- 1
out
}
set.seed(42)
x <- rnorm(1e6)
stopifnot(all.equal(cdf(x), cdf1(x)))
stopifnot(all.equal(pdf(x), pdf1(x)))
```
[@Allan Camero](https://stackoverflow.com/a/74228666/6574038) already showed nicely how to plot it.
## Microbenchmark
It's about three times faster than the `ifelse` solution.
```
microbenchmark::microbenchmark(
cdf_ifelse=cdf(x), cdf_vec=cdf1(x), check='equal'
)
# Unit: milliseconds
# expr min lq mean median uq max neval cld
# cdf_ifelse 110.66285 121.25428 133.0789 133.86041 142.53296 167.64401 100 b
# cdf_vec 43.56277 45.08759 48.8924 46.83869 49.46047 74.95487 100 a
microbenchmark::microbenchmark(
pdf_ifelse=pdf(x), pdf_vec=pdf1(x), check='equal'
)
# Unit: milliseconds
# expr min lq mean median uq max neval cld
# pdf_ifelse 71.39501 76.71747 101.17738 81.43037 87.82162 192.3919 100 b
# pdf_vec 27.82642 30.02056 34.55301 30.38457 31.29751 133.2798 100 a
```
| null | CC BY-SA 4.0 | null | 2022-10-28T05:28:16.767 | 2022-10-28T05:33:45.380 | 2022-10-28T05:33:45.380 | 6,574,038 | 6,574,038 | null |
74,231,463 | 2 | null | 74,231,451 | 5 | null | Try changing
```
asets:
```
to
```
assets:
```
| null | CC BY-SA 4.0 | null | 2022-10-28T06:35:40.517 | 2022-10-28T06:35:40.517 | null | null | 16,124,033 | null |
74,231,491 | 2 | null | 31,227,844 | 0 | null | if you are sure that you aligned your scripts as described above, please make sure you DataTable word case is correct.
Before
```
$(document).ready(function() {
$('#myTable').Datatable();
});
```
After
```
$(document).ready(function() {
$('#myTable').DataTable();
});
```
small t is creating problem, when I changed this t to T it worked like a charm.
| null | CC BY-SA 4.0 | null | 2022-10-28T06:38:41.070 | 2022-10-28T06:38:41.070 | null | null | 14,109,825 | null |
74,231,801 | 2 | null | 74,231,626 | 1 | null | A `Flexbox` layout might be a good choice as it would simplify the overall layout for you?
```
.collage {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-around;
box-sizing: border-box;
margin: auto;
width: 70%;
}
.collage img {
padding: 20px;
width: 40%;
}
.collage,
.collage>img,
.collage>p {
border: 1.5px solid rgba(112, 128, 144, 0.5);
}
.collage>img,
.collage>p {
box-sizing: border-box;
margin: 0.1rem;
clear: none;
width: calc( 50% - 0.4rem);
height: 300px;
}
.collage>p {
display: inline-flex;
align-items: center;
align-content: center;
padding: 0.5rem;
}
```
```
<div class="collage">
<img src="bunk_room.jpg" alt="bunk">
<img src="cabin_view.jpg" alt="cabin">
<img src="hallway.jpg" alt='hallway'>
<p> The Kakapo Chalet is a great choice for a medium to large number of guests.</p>
</div>
```
| null | CC BY-SA 4.0 | null | 2022-10-28T07:13:39.897 | 2022-10-28T07:13:39.897 | null | null | 3,603,681 | null |
74,231,897 | 2 | null | 74,231,626 | 0 | null | Use `display: inline-block;`, with `word-break`, `vertical-align` to make `<p>` display the same as image and set `margin`, `padding` to have same space.
```
.collage {
display: block;
margin: auto;
width: 70%;
border: 1.5px solid rgba(112, 128, 144, 0.5);
}
.collage img {
padding: 20px;
border: 1.5px solid rgba(112, 128, 144, 0.5);
width: 40%;
height: 300px;
display: inline-block;
}
.collage p {
display: inline-block;
border: 1.5px solid rgba(112, 128, 144, 0.5);
height: 300px;
width: 40%;
word-break: break-all;
vertical-align: top;
margin: 0;
padding: 20px;
}
```
```
<div class="collage">
<img src="https://picsum.photos/id/1011/300/200" alt="picture">
<img src="https://picsum.photos/id/1015/300/200" alt="picture">
<img src="https://picsum.photos/id/1016/300/200">
<p> The Kakapo Chalet is a great choice for a medium to large number of guests.</p>
</div>
```
The code above look bad in very small screen, click on Full page to view in larger size.
### Flex box
You may use CSS [Flex box](https://css-tricks.com/snippets/css/a-guide-to-flexbox/).
```
.collage{
display: flex;
flex-wrap: wrap;
width:70%;
border:1.5px solid rgba(112, 128, 144, 0.5);
}
.collage p,
.collage img{
padding:20px;
border:1.5px solid rgba(112, 128, 144, 0.5);
width:50%;
}
.collage * {
box-sizing: border-box; /* I add this for use width: 50% WITH border so that it can be fit in outer div perfectly. */
}
```
```
<div class="collage">
<img src="https://picsum.photos/id/1011/300/200" alt="picture">
<img src="https://picsum.photos/id/1015/300/200" alt="picture">
<img src="https://picsum.photos/id/1016/300/200">
<p> The Kakapo Chalet is a great choice for a medium to large number of guests.</p>
</div>
```
### Grid
Or you may use CSS [grid](https://css-tricks.com/snippets/css/complete-guide-grid/).
```
.collage {
display: grid;
grid-template-columns: 1fr 1fr;
margin: auto;
width: 70%;
border: 1.5px solid rgba(112, 128, 144, 0.5);
}
.collage img {
box-sizing: border-box;
padding: 20px;
border: 1.5px solid rgba(112, 128, 144, 0.5);
display: inline-block;
max-width: 100%;
}
.collage p {
display: inline-block;
border: 1.5px solid rgba(112, 128, 144, 0.5);
word-break: break-all;
margin: 0;
padding: 20px;
}
```
```
<div class="collage">
<img src="https://picsum.photos/id/1011/300/200" alt="picture">
<img src="https://picsum.photos/id/1015/300/200" alt="picture">
<img src="https://picsum.photos/id/1016/300/200">
<p> The Kakapo Chalet is a great choice for a medium to large number of guests.</p>
</div>
```
| null | CC BY-SA 4.0 | null | 2022-10-28T07:25:25.063 | 2022-10-28T07:25:25.063 | null | null | 128,761 | null |
74,232,014 | 2 | null | 74,231,961 | 2 | null | ```
for j in [0,1,2,3]:
pathway=(list(set(genes.iloc[j]).intersection(genes.iloc[i+j+1])))
#do something with pathway
```
[Take a look here for more info on loops](https://www.w3schools.com/python/python_for_loops.asp)
| null | CC BY-SA 4.0 | null | 2022-10-28T07:35:41.777 | 2022-10-28T07:35:41.777 | null | null | 19,039,059 | null |
74,232,305 | 2 | null | 70,456,701 | 0 | null | I also had the same problem. I did the following thing & succeeded.
1. Enable JavaScript API from Google Cloud Console & install Google maps flutter web.
2. After installation remember to add the following code snippet on the web/index.html path of flutter project & enter your own API key in the place of "YOUR_API_KEY" text of the below code snippet.
```
<head>
<!-- // Other stuff -->
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY"></script>
</head>
```
| null | CC BY-SA 4.0 | null | 2022-10-28T08:04:42.273 | 2022-10-28T08:04:42.273 | null | null | 10,422,581 | null |
74,232,534 | 2 | null | 74,229,843 | 0 | null | IF TipoContribuyente is an object This will work
```
// Interface(dummy)
export class entities{
id:string;
name:string;
taxPayer:taxPayer
}
export class taxPayer{
id:string;
name:string;
}
```
```
// html
<table>
<tr>
<th>ID</th>
<th>Name</th>
<th>Tax Payer</th>
</tr>
<tr *ngfor let p of entities>
<td>{{p.id}}</td>
<td>{{p.name}}</td>
<td>{{p.taxPayer.name?true:false}}</td>
</tr>
</table>
```
If TipoContribuyente is an array , you need to add index
```
//Interface
export class entities{
id:string;
name:string;
taxPayer:taxPayer[];
}
```
```
// html
<table>
<tr>
<th>ID</th>
<th>Name</th>
<th>Tax Payer</th>
</tr>
<tr *ngfor let p of entities>
<td>{{p.id}}</td>
<td>{{p.name}}</td>
<td>{{p.taxPayer[0].name?true:false}}</td>
</tr>
</table>
```
| null | CC BY-SA 4.0 | null | 2022-10-28T08:25:48.393 | 2022-10-28T08:25:48.393 | null | null | 18,575,869 | null |
74,232,745 | 2 | null | 74,231,981 | 1 | null | I propose the following solution, you can edit the [colormap](https://matplotlib.org/stable/api/matplotlib_configuration_api.html?highlight=colormaps#matplotlib.colormaps) label if you prefer. By the way, I used the following [method](https://stackoverflow.com/questions/43971259/how-to-draw-polygons-with-python) to display triangles as it was simpler than yours.
```
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
a1=[0.90899658,1.10720062,1.47019958,0.90899658,1.47019958,3.14479828,0.90899658,3.14479828,3.17749786,0.90899658]
b1=[-0.38689995,0.22739983,0.69180012,-0.38689995,0.69180012,-0.34249973,-0.38689995,-0.34249973,-0.38329983,-0.38689995]
# The data as a third function c1 for 3 triangles
c1=[0.234,0.034,0.006]
cmap = mpl.cm.get_cmap('Spectral')
norm = mpl.colors.Normalize(vmin=min(c1), vmax=max(c1))
# ploting data
fig, ax = plt.subplots()
for i in range(0, 9, 3):
atest = np.append(a1[i:i+3], a1[i])
btest = np.append(b1[i:i+3], b1[i])
ax.fill(atest,btest,color=cmap(norm(c1[(int)(i/3)])))
cbar = plt.colorbar(mpl.cm.ScalarMappable(norm=norm, cmap=cmap))
plt.show()
```
[](https://i.stack.imgur.com/ihQ4v.png)
| null | CC BY-SA 4.0 | null | 2022-10-28T08:45:13.040 | 2022-10-28T08:50:55.183 | 2022-10-28T08:50:55.183 | 19,931,710 | 19,931,710 | null |
74,232,779 | 2 | null | 74,231,432 | 0 | null | If you are going to search more than one table, it makes more sense to do all of them in different stored procedures.
| null | CC BY-SA 4.0 | null | 2022-10-28T08:47:26.387 | 2022-10-28T08:47:26.387 | null | null | 19,830,333 | null |
74,232,857 | 2 | null | 48,209,965 | 0 | null | you can just do `model.summary()` to see all the Layer names (and also their type). It is the first column.
| null | CC BY-SA 4.0 | null | 2022-10-28T08:53:52.123 | 2022-10-28T08:53:52.123 | null | null | 20,350,181 | null |
74,233,012 | 2 | null | 71,743,752 | 0 | null | It's supposed to be like that (I think). I was a complete idiot.
| null | CC BY-SA 4.0 | null | 2022-10-28T09:06:46.320 | 2022-10-28T09:06:46.320 | null | null | 18,244,401 | null |
74,233,110 | 2 | null | 74,232,259 | 0 | null | `title` and `shorttitle` arguments of the `study()` are of type `string`. So you need quotation marks around them.
```
//@version=3
study("Relative Strength Comparison", shorttitle="Relative Strength Comparison")
a = tickerid
b = input("Nifty", type=symbol)
as = security(a, period, close)
bs = security(b, period, close)
plot((as/bs)*100, title="Relative Strength Comparison", color=blue)
len = input(52)
len1 = input(10)
plot(ema((as/bs)*100, len), color=red)
plot(ema((as/bs)*100, len1), color=green)
```
| null | CC BY-SA 4.0 | null | 2022-10-28T09:14:37.973 | 2022-10-28T09:14:37.973 | null | null | 7,209,631 | null |
74,233,121 | 2 | null | 74,232,192 | 2 | null | On the latest versions of XF that should be fairly easy to do (make sure you optimize this code for your usage):
Create a border-style:
```
<Style TargetType="Border">
<Setter Property="Padding" Value="10" />
<Setter Property="Stroke" Value="Black" />
<Setter Property="StrokeThickness" Value="2" />
<Setter Property="HorizontalOptions" Value="Fill"/>
<Setter Property="StrokeShape">
<Setter.Value>
<RoundRectangle CornerRadius="10" />
</Setter.Value>
</Setter>
</Style>
```
Once done use it as below:
```
<Border Stroke="Blue" StrokeThickness="5" Padding="8" BackgroundColor="White">
<Button BackgroundColor="Blue" Text="Submit"/>
</Border>
```
To add events to this whole view you might have to set the button's InputTransparent property to `True` and then add a Gesture to the whole View
Once done it would look like the image below:
[](https://i.stack.imgur.com/AWkD7.png)
| null | CC BY-SA 4.0 | null | 2022-10-28T09:15:27.680 | 2022-12-04T10:34:32.473 | 2022-12-04T10:34:32.473 | 472,495 | 7,462,031 | null |
74,233,289 | 2 | null | 74,233,084 | 1 | null | Mapping a single item will use the given destination instance and will not touch any unmapped properties (here the `Id` property).
Mapping a collection will create a destination item for each source item and there you have the given default value from the class definition for any unmapped property.
You may want to customize the mapping to set the `Id` property in this case.
| null | CC BY-SA 4.0 | null | 2022-10-28T09:29:05.593 | 2022-10-28T09:29:05.593 | null | null | 1,744,164 | null |
74,233,671 | 2 | null | 74,228,563 | 0 | null | We can try the code below
```
f <- function(x) 0.5 * (x >= 0) + 0.5 * (x >= 1) - (x >= 1.5)
F <- Vectorize(function(x) integrate(f, -Inf, x)$value)
plot(f, -2, 2, col = "red")
curve(F, -2, 2, add = TRUE, col = "blue")
legend(-1, 0.8,
legend = c("pdf", "cdf"),
col = c("red", "blue"),
lty = 1:2, cex = 2,
box.col = "white"
)
```
[](https://i.stack.imgur.com/BHhZ5.png)
| null | CC BY-SA 4.0 | null | 2022-10-28T09:57:10.647 | 2022-10-28T09:57:10.647 | null | null | 12,158,757 | null |
74,233,800 | 2 | null | 74,024,072 | 0 | null | In previous versions of the application, it could be created directly, but now you have to use yml, which I think is a step backwards
| null | CC BY-SA 4.0 | null | 2022-10-28T10:08:00.997 | 2022-10-28T10:08:00.997 | null | null | 15,280,931 | null |
74,234,231 | 2 | null | 28,255,822 | 2 | null | First, a skewed normal random point(x) will be created, then probability distribution function (PDF) of that point will be found.
The math used here depends on Ermak and Nasstrom's 1995 [study](https://inis.iaea.org/collection/NCLCollectionStore/_Public/26/055/26055147.pdf). If you like, take a look to sample fortran77 code exists in this publication (Most of the variable names used in the code do not fit C# naming conventions, simply because I wanted the reader to relate them to the original paper).
```
private static double GetSkewedRandomNumber(double standardDeviation=1, double skewness=0, int dbIteration = 10)
{
var random = new Random();
var variance = Math.Pow(standardDeviation, 2);
const double a = 2.236067977; // --> Square root of 5
const double b = 0.222222222;
const double c = 243 / 32;
double finalrun, sumdbran = 0;
double dbmom3, dbmean1, dbmean2, dbprob1, dbdelta1, dbdelta2, randomNumber1, randomNumber2, dbran, terma, termb;
dbmom3 = Math.Sqrt(dbIteration) * skewness * Math.Pow(variance, 1.5);
terma = b / variance;
termb = Math.Sqrt(Math.Pow(dbmom3, 2) + c * Math.Pow(variance, 3));
dbmean1 = terma * (dbmom3 - termb);
dbmean2 = terma * (dbmom3 + termb);
dbprob1 = dbmean2 / (2 * a * dbmean1 * (dbmean1 - dbmean2));
dbdelta1 = -a * dbmean1;
dbdelta2 = a * dbmean2;
//Loop for summation of double block random numbers in each final random number
for (int i = 0; i < dbIteration; i++)
{
randomNumber1 = random.NextDouble();
randomNumber2 = random.NextDouble();
if (randomNumber1 < (2 * dbdelta1 * dbprob1))
dbran = dbmean1 + (2 * dbdelta1 * (randomNumber2 - 0.5));
else
dbran = dbmean2 + (2 * dbdelta2 * (randomNumber2 - 0.5));
//sumdbran is the sum of double block random numbers created by the iteration
sumdbran = sumdbran + dbran;
}
//Calculate final skewed normal random number
finalrun = sumdbran / Math.Sqrt(dbIteration);
return finalrun;
}
```
and below code is for PDF:
```
public static double GetPDF(double mean, double standardDeviation, double skewness, double x)
{
var pdf = 0d;
var variable = skewness * x;
var normalPDF = NormalDistribution.GetPDF(0, 1, x);
var normalCDF = NormalDistribution.GetCDF(0, 1, variable);
pdf = 2 * normalPDF * normalCDF;
return pdf;
}
```
You can implement NormalDistribution.GetPDF and NormalDistribution.GetCDF methods yourself (mentioned in GetPDF method). They are simply calculating Probability Density Funciton and Cumulative Distribution Function of a normal distribution. To make it simple and focus on the question I prefered not to add the code. For those who also want to check CDF calculation of the skewed normal distribution please check [here](https://github.com/armaganderman/Dopamin)
Here is an example of a skewed distribution derived from above code and its relevant pdf-cdf graphs.
[pdf graph of positive (+0.75) skewed normal distribution](https://i.stack.imgur.com/Gj443.png)
[pdf graph of negative (-0.75) skewed normal distribution](https://i.stack.imgur.com/617XP.png)
[cdf graph of positive (0.75) skewed normal distribution](https://i.stack.imgur.com/OlNG6.png)
[cdf graph of negative (-0.75) skewed normal distribution](https://i.stack.imgur.com/cjc9W.png)
| null | CC BY-SA 4.0 | null | 2022-10-28T10:44:29.883 | 2022-10-29T13:42:35.703 | 2022-10-29T13:42:35.703 | 6,153,426 | 6,153,426 | null |
74,234,377 | 2 | null | 74,234,223 | 1 | null | It's because you have the height as a decimal. The height is in number of pixels. When you use decimals you can get rounding errors. That it rounds to 0 in some cases and 1 in other. Just give it a height of 1 like
```
height: 1,
```
You will see that it still looks the same, because they where actually rendered with height 1 for the places where you do see it. Using values that are not whole numbers doesn't make sense in most cases
| null | CC BY-SA 4.0 | null | 2022-10-28T10:58:22.690 | 2022-10-28T10:58:22.690 | null | null | 1,514,861 | null |
74,235,128 | 2 | null | 28,313,372 | 2 | null | I understand this is an old question.
However, what fixed it for me isn't in any of the answers above, which is why I decided to answer this in case new persons find this page and none of the above answer works for them...
All I had to do was run `nvm on` which creates the symlink (supposedly, `nvm use <version>` is supposed to work, but it wasn't), turning on nvm before using a version worked for me.
Steps:
1. nvm install <version> -> Installs a node and npm of <version>
2. nvm on -> Turns on nvm, and creates the nodejs symlink needed
3. nvm use <version> -> To use a specific version
4. node -v -> prints out version of node
5. npm -v -> prints out version of npm
Hopefully, it fixes your issue too.
| null | CC BY-SA 4.0 | null | 2022-10-28T12:03:13.467 | 2022-10-28T12:03:13.467 | null | null | 14,922,531 | null |
74,235,433 | 2 | null | 20,875,823 | 0 | null | What worked for me in XCode 14.0.1 was, apart from setting initial view controller, to update in Build Settings: "UIKIT Main Storyboard File Base Name" to new the name of new storyboard
| null | CC BY-SA 4.0 | null | 2022-10-28T12:28:45.873 | 2022-10-28T12:28:45.873 | null | null | 10,883,928 | null |
74,235,535 | 2 | null | 74,234,899 | 0 | null | Your functions need to accept a parameter for the selected currency or if the functions live in your Worker class you could use a global variable.
Function accepting parameter:
```
...
string selectedCurrency = "3"; // default value of USD input key
...
switch (input.Key)
{
...
case ConsoleKey.NumPad1:
case ConsoleKey.D1:
Console.WriteLine("Printing all products");
_productListVisualizer.OutputAllProduct(selectedCurrency);
break;
...
}
...
public static void OutputAllProduct(string selectedCurrency);
```
Global variable:
```
public class Worker : BackgroundService
{
private string SelectedCurrency;
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
...
// assign new value to selected currency (case ConsoleKey.NumPad4: or case ConsoleKey.D4:)
SelectedCurrecy = Console.ReadKey();
...
}
...
private static void OutputAllProduct()
{
// access to global variable SelectedCurrency here
}
}
```
| null | CC BY-SA 4.0 | null | 2022-10-28T12:37:03.737 | 2022-10-28T12:37:03.737 | null | null | 20,120,544 | null |
74,235,658 | 2 | null | 53,379,271 | 0 | null | Here is the solution it will work for me
```
php artisan key:generate
php artisan jwt:secret
php artisan cache:clear
php artisan config:clear
```
Before running the above commands make sure there is an install `jwt` package, then check its config file name jwt.php in the config folder
| null | CC BY-SA 4.0 | null | 2022-10-28T12:47:56.957 | 2022-10-28T12:49:05.930 | 2022-10-28T12:49:05.930 | 4,826,457 | 18,676,264 | null |
74,236,147 | 2 | null | 74,235,164 | 0 | null | I could not understand the relationship between the 2 lists, but I think that the better way you can do it is by using pattern matching.
You can make patterns and take an action per patter.
Example:
```
for sublist in listA:
match sublist:
case [_,1,1]:
# do something
...
case _:
```
it's awesome! Seach for it.
| null | CC BY-SA 4.0 | null | 2022-10-28T13:28:55.883 | 2022-10-28T13:28:55.883 | null | null | 15,010,155 | null |
74,236,237 | 2 | null | 57,324,634 | 0 | null | Adding to this, for me I had to select the following option from the Authentication options.
[Supported Account Types Option](https://i.stack.imgur.com/XgKOL.png)
| null | CC BY-SA 4.0 | null | 2022-10-28T13:36:22.677 | 2022-10-28T13:36:22.677 | null | null | 8,901,937 | null |
74,236,292 | 2 | null | 8,824,831 | 0 | null | I hit my footer with a margin-top: auto and it did the trick! Im commenting this here just in case it could help any future visitors.
| null | CC BY-SA 4.0 | null | 2022-10-28T13:41:13.713 | 2022-10-28T13:41:13.713 | null | null | 18,193,299 | null |
74,236,394 | 2 | null | 74,234,228 | 0 | null | You can get all `.nii` files in a directory using one of these:
```
files = dir( fullfile( 'myDirectory', '*.nii' ) ); % single directory
files = dir( fullfile( 'myDirectory', '**\*.nii' ) ); % recursive nested directories
```
I like to convert this struct to a table for slightly easier manipulation
```
files = struct2table( files, 'AsArray', true );
```
Then you can use regex to filter for this pattern:
> ‘ica__sub’ + 3 digits + 'component_ica_s' + 1 digit + '.nii'
`ica__sub`
The regular expression filtering uses `\d{n}` to match `n` digits, and is prefixed with `^` to assert the name with `ica_...` rather than just containing this string.
```
% Get the matches, will be empty for each unmatched name
matchedParts = regexp( files.name, '^ica__sub\d{3}component_ica_s\d{1}\.nii', 'match', 'once' );
% Get which rows are a match
idx = ~cellfun( @isempty, matchedParts );
% Filter the directory results
files = files( idx, : );
```
Now you can loop over these files and do whatever you want with them
```
for ii = 1:height(files)
filename = fullfile( files.folder{ii}, files.name{ii} );
% do something with filename...
% Maybe loop 1 to 20 for frames within each file
for kk = 1:20
file_frame = [filename, ',', num2str(kk)];
% something else...
end
end
```
| null | CC BY-SA 4.0 | null | 2022-10-28T13:52:01.420 | 2022-10-28T13:52:01.420 | null | null | 3,978,545 | null |
74,236,884 | 2 | null | 73,423,558 | 0 | null | Take the [basic example](https://github.com/heremaps/here-sdk-examples/blob/4ad3c5f37433cf4fdce6aacae0357799aa984ecc/examples/latest/navigate/android/MapItems/app/src/main/java/com/here/mapitems/MapItemsExample.java#L108) from the as a starting point.
Clustering of marker images works by distance. From the API Reference:
> The markers that
are close to each other are replaced by a single cluster marker.
Cluster groupings are generated based on geographical distance between
objects, not based on screen space collision. Hence it is possible,
that cluster markers can overlap.
What you want to achieve may be possible if you group the markers to a different cluster. You can have multiple cluster groups, but they can overlap.
If you zoom out, marker images that are close enough and belong to the same cluster will become clustered.
| null | CC BY-SA 4.0 | null | 2022-10-28T14:32:44.783 | 2022-10-28T14:38:08.890 | 2022-10-28T14:38:08.890 | 8,308,743 | 8,308,743 | null |
74,237,020 | 2 | null | 43,826,046 | 0 | null | i am aware of a 3rd way (short cut) which is using the flag `--tls-use-os-certs`
also as a side note, mosquitto_sub/pub also sends SNI within the tls connection request, which is great news if you are using SNI based routing on the broker side.
don't know if the MQTT standard actually prescribes this, but at least mosquitto client's implementation does support it
| null | CC BY-SA 4.0 | null | 2022-10-28T14:41:54.190 | 2022-10-28T14:41:54.190 | null | null | 15,124,650 | null |
74,237,385 | 2 | null | 9,361,990 | 2 | null | In bootstrap it's a class `text-nowrap`.
| null | CC BY-SA 4.0 | null | 2022-10-28T15:12:33.120 | 2022-12-16T01:59:40.333 | 2022-12-16T01:59:40.333 | 2,005,680 | 984,349 | null |
74,237,614 | 2 | null | 74,233,466 | 0 | null | Embedding a report in SharePoint doesn't remove the requirement for the user to have a Power BI Pro license or use a Premium capacity.
> LicensingTo view the embedded report, users need either a Power BI
Pro or Premium Per User (PPU) license or the content needs to be in a
workspace that's in a Power BI Premium capacity (EM or P SKU).
[Embed a report in a secure portal or website](https://learn.microsoft.com/en-us/power-bi/collaborate-share/service-embed-secure#licensing)
| null | CC BY-SA 4.0 | null | 2022-10-28T15:30:44.463 | 2022-10-28T15:30:44.463 | null | null | 7,297,700 | null |
74,238,455 | 2 | null | 74,238,409 | 0 | null | It is an issue of the `target` element being SVG, you can use `closest` method, but the easier way, you can pass the icon as a second parameter, and you will get the clicked `icon`.
```
{ iconName.map(icon => (
<button onClick={(e) => clickHandler(e, icon)} key={icon.id} className='nav__tab'>
<Tabs iconName={icon.name} iconUrl={icon.src}/>
</button>
))}
```
| null | CC BY-SA 4.0 | null | 2022-10-28T16:44:38.247 | 2022-10-28T16:44:38.247 | null | null | 11,887,902 | null |
74,238,500 | 2 | null | 74,238,409 | 0 | null | will need to pass the event to the function know wich is the target.
try:
```
{ iconName.map(icon => (
<button onClick={(e) => clickHandler(e)} key={icon.id} className='nav__tab'>
<Tabs iconName={icon.name} iconUrl={icon.src}/>
</button>
))}
```
You can pass the icon like second parameter to the function too.
| null | CC BY-SA 4.0 | null | 2022-10-28T16:49:54.320 | 2022-10-28T16:49:54.320 | null | null | 15,640,992 | null |
74,238,528 | 2 | null | 74,238,438 | 0 | null | I mistakenly set src as the main in my gradle and its now fixed.
```
sourceSets {
main {
java {
srcDirs = ["main"]
}
}
}
```
| null | CC BY-SA 4.0 | null | 2022-10-28T16:52:04.207 | 2022-10-28T16:52:04.207 | null | null | 20,360,109 | null |
74,238,582 | 2 | null | 74,238,502 | 0 | null | The solution is mostly there in the help message, though it can be a bit obscure if you're new to Python / argparse.
The help message is telling you that you need to use one of the subcommands in your command invocation: `fit`, `validate`, `test`, `predict`, `tune`.
So something like this:
```
python train.py train --config config.yaml
```
As such it seems like the README is incorrect and needs to be updated. You probably want the `train` subcommand given the comment in the README.
| null | CC BY-SA 4.0 | null | 2022-10-28T16:56:08.007 | 2022-10-28T16:56:08.007 | null | null | 3,846,032 | null |
74,238,626 | 2 | null | 74,229,280 | 0 | null | Defining a function and calling it after "success" part of my ajax request has resolved the problem for me. So in my previous code, in place of
```
myChart.update();
```
I'm calling this function now.
```
function updateLineChart(){
myChart.data.datasets[0].data = rdone_array;
myChart.data.datasets[1].data = rdtwo_array;
myChart.data.datasets[2].data = rdthree_array;
myChart.update();
}
```
| null | CC BY-SA 4.0 | null | 2022-10-28T17:00:32.970 | 2022-10-28T17:00:32.970 | null | null | 11,060,457 | null |
74,238,624 | 2 | null | 74,140,139 | 0 | null | I was faced the same issue when you populate your table cell with HTML tags, it creates issues for searching / sorting. A very simple TRICK to define your dataType as "JSON" will fix this issue. Below is my sample code for Datatable (Server-Side-Processing with pipelined) in my production server and working perfectly.
```
<script type="text/javascript" language="javascript" class="init">
$.fn.dataTable.pipeline = function ( opts ) {
// Configuration options
var conf = $.extend( {
pages: 5, // number of pages to cache
url: '', // script url
data: null, // function or object with parameters to send to the server
// matching how `ajax.data` works in DataTables
method: 'GET' // Ajax HTTP method
}, opts );
// Private variables for storing the cache
var cacheLower = -1;
var cacheUpper = null;
var cacheLastRequest = null;
var cacheLastJson = null;
return function ( request, drawCallback, settings ) {
var ajax = false;
var requestStart = request.start;
var drawStart = request.start;
var requestLength = request.length;
var requestEnd = requestStart + requestLength;
if ( settings.clearCache ) {
// API requested that the cache be cleared
ajax = true;
settings.clearCache = false;
}
else if ( cacheLower < 0 || requestStart < cacheLower || requestEnd > cacheUpper ) {
// outside cached data - need to make a request
ajax = true;
}
else if ( JSON.stringify( request.order ) !== JSON.stringify( cacheLastRequest.order ) ||
JSON.stringify( request.columns ) !== JSON.stringify( cacheLastRequest.columns ) ||
JSON.stringify( request.search ) !== JSON.stringify( cacheLastRequest.search )
) {
// properties changed (ordering, columns, searching)
ajax = true;
}
// Store the request for checking next time around
cacheLastRequest = $.extend( true, {}, request );
if ( ajax ) {
// Need data from the server
if ( requestStart < cacheLower ) {
requestStart = requestStart - (requestLength*(conf.pages-1));
if ( requestStart < 0 ) {
requestStart = 0;
}
}
cacheLower = requestStart;
cacheUpper = requestStart + (requestLength * conf.pages);
request.start = requestStart;
request.length = requestLength*conf.pages;
// Provide the same `data` options as DataTables.
if ( $.isFunction ( conf.data ) ) {
// As a function it is executed with the data object as an arg
// for manipulation. If an object is returned, it is used as the
// data object to submit
var d = conf.data( request );
if ( d ) {
$.extend( request, d );
}
}
else if ( $.isPlainObject( conf.data ) ) {
// As an object, the data given extends the default
$.extend( request, conf.data );
}
settings.jqXHR = $.ajax( {
"type": conf.method,
"url": conf.url,
"data": request,
"dataType": "json", // **IMPORTANT POINT**
"cache": false,
"success": function ( json ) {
cacheLastJson = $.extend(true, {}, json);
if ( cacheLower != drawStart ) {
json.data.splice( 0, drawStart-cacheLower );
}
if ( requestLength >= -1 ) {
json.data.splice( requestLength, json.data.length );
}
drawCallback( json );
}
} );
}
else {
json = $.extend( true, {}, cacheLastJson );
json.draw = request.draw; // Update the echo for each response
json.data.splice( 0, requestStart-cacheLower );
json.data.splice( requestLength, json.data.length );
drawCallback(json);
}
}
};
// Register an API method that will empty the pipelined data, forcing an Ajax
// fetch on the next draw (i.e. `table.clearPipeline().draw()`)
$.fn.dataTable.Api.register( 'clearPipeline()', function () {
return this.iterator( 'table', function ( settings ) {
settings.clearCache = true;
} );
} );
</script>
```
| null | CC BY-SA 4.0 | null | 2022-10-28T17:00:28.770 | 2022-10-28T17:00:28.770 | null | null | 3,935,906 | null |
74,238,981 | 2 | null | 74,232,823 | 0 | null | Strictly speaking and from DB's point of view
```
User.hasOne(Cart);
Cart.belongsTo(User);
```
are 1:N and N:1 relationships. You can only add unique index on `UserId` to prevent adding multiple records with the same `UserId` value but still if you call `createCart` several times you kinda tell Sequelize to actually create several records.
You need to rethink what you're trying to achieve by making two sequential `createCart` calls. What should happen? Some error on the second call? To ignore the second call? To update the existing record on the second call? What's your expectations?
| null | CC BY-SA 4.0 | null | 2022-10-28T17:33:40.303 | 2022-10-28T17:33:40.303 | null | null | 1,376,618 | null |
74,239,034 | 2 | null | 74,238,409 | 0 | null | You have minimum 2 options here to get what you want:
1. Instead of checking if the clicked event matches a specific selector, you can check if it occurred within a selector using the closest() method.
2. You can disable clicking on SVGs so that the event fires on the parent button instead of the SVG and it’s child elements. svg { pointer-events: none;}
For more information, you can refer: [Detecting click events on SVGs with vanilla JS event delegation](https://gomakethings.com/detecting-click-events-on-svgs-with-vanilla-js-event-delegation/).
| null | CC BY-SA 4.0 | null | 2022-10-28T17:39:18.090 | 2022-10-28T17:39:18.090 | null | null | 20,232,830 | null |
74,239,307 | 2 | null | 10,554,660 | 0 | null | I improved the answer of Holiday Mat a bit.
If you want to replace the text with other text dynamically (which is not too long), the scrolling will still keeps place. You have to reset the interval somehow.
Another problem you might run into is, too many intervals are set and the text scrolls faster and faster.
Here a snippet which shows how I handled this. (I used h5 instead of h1, which you probably use somewhere else.) :
```
$.fn.scrolltxt = function() {
var options = $.extend({
speed: 28
}, arguments[0] || {});
return this.each(function() {
var $h5 = $(this);
var containerWidth = $h5.parent().width();
var textWidth = $h5.find('span').width();
var refreshIntervalId;
if (textWidth > containerWidth) {
refreshIntervalId = setInterval(function() {
scrollText();
}, options.speed);
$h5.data('refreshIntervalId', refreshIntervalId);
} else {
refreshIntervalId = $h5.data('refreshIntervalId');
if (refreshIntervalId != undefined) {
window.clearInterval(refreshIntervalId);
$h5.removeData('refreshIntervalId');
}
}
var scrollText = function() {
var textWidth = $h5.find('span').width();
var left = $h5.position().left - 1;
left = -left > textWidth ? $h5.width() : left;
$h5.css({
left: left
});
};
});
};
$('h5.scroll').scrolltxt();
```
```
#player {
width: 500px;
background: #000;
border: 1px solid #1f1f1f;
border-radius: 10px;
margin: 10px;
padding: 10px 20px;
}
.current-track {
height: 100%;
background: #333;
color: #FFF;
margin-right: 5px;
width: 100%;
font-size: 150%;
border-radius: 5px;
line-height: 30px;
overflow: hidden;
position: relative;
}
.current-track h5 {
position: relative;
white-space: nowrap;
line-height: 1.5em;
font-size: 1.5em;
}
* {
margin: 0;
padding: 0;
}
body {
font-family: Arial, Helvetica, sans-serif;
}
```
```
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="player">
<div id="level1">
<div class="current-track">
<h5 class="scroll"><span><strong>KAFKA (The artist formerly known as Prince)</strong></span></h5>
</div>
<br /><br /><br />
<div class="current-track">
<h5 class="scroll"><span>The Most Beautiful Girl In The World (original 1995 version)</span></h5>
</div>
</div>
</div>
```
Or see the CodePen: [https://codepen.io/r-w-c/pen/dyKoKQX](https://codepen.io/r-w-c/pen/dyKoKQX)
| null | CC BY-SA 4.0 | null | 2022-10-28T18:04:58.120 | 2022-10-29T09:45:48.290 | 2022-10-29T09:45:48.290 | 760,777 | 760,777 | null |
74,239,536 | 2 | null | 74,236,936 | 0 | null | To get an DOM element by its id you should use `document.getElementById('title')`. To edit its text you should use its `textContent` property. The title of the docuemnt is stored in `document.title`.
Try the following markup:
```
document.getElementById('title').textContent = document.title
```
```
<h1 id="title">Dit is h1</h1>
```
| null | CC BY-SA 4.0 | null | 2022-10-28T18:28:10.500 | 2022-10-28T18:28:10.500 | null | null | 20,318,366 | null |
74,239,810 | 2 | null | 74,027,687 | 0 | null | ```
.firstSideBar{
background-color:black;
position:fixed;
left:0;
top:0;
z-index:10;
height:72px;
width:100%;
}
.secondSideBar{
background-color:blue;
position:fixed;
left:0;
top:0;
z-index:9;
height:200px;
width:100%;
}
```
| null | CC BY-SA 4.0 | null | 2022-10-28T18:58:57.807 | 2022-10-28T18:58:57.807 | null | null | 19,853,154 | null |
74,240,587 | 2 | null | 73,148,533 | 1 | null | Set 'disableMultipleColumnsFiltering' to true
```
<DataGridPro disableMultipleColumnsFiltering='true'> </DataGridPro>
```
Reference: [https://v4.mui.com/api/data-grid/data-grid-pro/](https://v4.mui.com/api/data-grid/data-grid-pro/)
| null | CC BY-SA 4.0 | null | 2022-10-28T20:30:07.880 | 2022-11-03T03:17:10.230 | 2022-11-03T03:17:10.230 | 15,872,349 | 15,872,349 | null |
74,240,721 | 2 | null | 29,450,844 | 0 | null | I know this is an old thread but no one has solved it satisfactorily.
And here is mine solution:
1. Create a new "CustomControl"
2. Change CustomControl to NumericUpDown
3. Add an OnResize overridee public partial class nNumeric : NumericUpDown
{
public nNumeric()
{
InitializeComponent();
}
protected override void OnResize(EventArgs e)
{
var buttons = this.Controls[0];
var edit = this.Controls[1];
buttons.Visible = false;
edit.MinimumSize = new Size( Width - edit.Left*2, 0);
edit.Width = this.Width;
}
}
4. done, simple and effective :)
I hope it will help someone :)
| null | CC BY-SA 4.0 | null | 2022-10-28T20:44:51.357 | 2022-10-28T20:44:51.357 | null | null | 7,377,983 | null |
74,240,738 | 2 | null | 74,240,683 | 0 | null | Project scope has line breaks within. I bet that is causing problems. Look at the actual csv file you are trying to load in a text editor.
| null | CC BY-SA 4.0 | null | 2022-10-28T20:46:17.920 | 2022-10-28T20:46:17.920 | null | null | 294,836 | null |
74,240,893 | 2 | null | 74,240,716 | 2 | null | Try:
```
out = []
for d, g in df.groupby("date"):
out.append(
{
"date": d,
}
)
for _, row in g.iterrows():
out[-1][str(int(row["aid"]))] = {
"mean": {
"x_axis": row["x_axis"],
"y_axis": row["y_axis"],
"z_axis": row["z_axis"],
}
}
print(out)
```
Prints:
```
[
{
"date": "2018-12-01",
"9": {"mean": {"x_axis": -0.71, "y_axis": 8.75, "z_axis": 5.23}},
},
{
"date": "2018-12-03",
"3": {"mean": {"x_axis": -0.55, "y_axis": 10.13, "z_axis": 1.15}},
"4": {"mean": {"x_axis": -1.84, "y_axis": 4.56, "z_axis": 5.74}},
"5": {"mean": {"x_axis": -1.49, "y_axis": 4.11, "z_axis": 7.03}},
"7": {"mean": {"x_axis": -0.4, "y_axis": 0.83, "z_axis": -8.29}},
},
{
"date": "2018-12-04",
"4": {"mean": {"x_axis": -9.04, "y_axis": -0.04, "z_axis": 0.55}},
},
{
"date": "2018-12-05",
"1": {"mean": {"x_axis": -3.03, "y_axis": 6.2, "z_axis": 7.16}},
"4": {"mean": {"x_axis": -3.93, "y_axis": 7.69, "z_axis": 3.82}},
"5": {"mean": {"x_axis": -4.0, "y_axis": 7.75, "z_axis": 1.01}},
},
{
"date": "2018-12-06",
"5": {"mean": {"x_axis": -4.47, "y_axis": 6.79, "z_axis": 4.12}},
},
]
```
| null | CC BY-SA 4.0 | null | 2022-10-28T21:03:54.643 | 2022-10-28T21:03:54.643 | null | null | 10,035,985 | null |
74,241,777 | 2 | null | 74,241,757 | 0 | null | Using Iframe is a bad option.
For HTML inside textarea you can use WYSIWYG editors i.e (Ckeditor: [https://ckeditor.com/](https://ckeditor.com/))
| null | CC BY-SA 4.0 | null | 2022-10-28T23:29:59.840 | 2022-10-28T23:29:59.840 | null | null | 12,845,748 | null |
74,241,872 | 2 | null | 19,233,415 | 0 | null | Try this options and give min and max
```
<input type="number"
pattern="\d+"
inputmode="numeric"
value="123"
autocomplete="off"
maxlength="5"
step="1"
min="0"
max="99999"
>
```
| null | CC BY-SA 4.0 | null | 2022-10-28T23:50:04.450 | 2022-10-29T18:59:48.473 | 2022-10-29T18:59:48.473 | 2,278,668 | 2,278,668 | null |
74,241,884 | 2 | null | 30,707,893 | 0 | null | I just had this problem. An easy solution is to add the text twice at the same position. First add text in the color you want the stroke to be, and add your stroke. Then, add the text again with the desired fill color and no stroke. Adjust the stroke width on the first text element until you achieve the desired effect.
| null | CC BY-SA 4.0 | null | 2022-10-28T23:51:23.527 | 2022-10-28T23:51:23.527 | null | null | 4,722,454 | null |
74,242,198 | 2 | null | 72,410,912 | 1 | null | I was having the exact same problem, and eventually found this [https://github.com/react-dnd/react-dnd/issues/3425#issuecomment-1214554950](https://github.com/react-dnd/react-dnd/issues/3425#issuecomment-1214554950).
I added `'process/browser': require.resolve('process/browser')` to the fallbacks object without changing anything else and it worked. Hopefully it fixes it for you too.
| null | CC BY-SA 4.0 | null | 2022-10-29T01:16:04.170 | 2022-10-29T01:16:04.170 | null | null | 20,362,635 | null |
74,242,369 | 2 | null | 74,230,860 | 0 | null | As commented by @Theodor Zoulias, since it's a hot observable, the solution becomes:
```
var Files = Observable.FromEventPattern<FileSystemEventHandler, FileSystemEventArgs>(
h => watcher.Created += h, h => watcher.Created -= h)
.Select(x => x.EventArgs.FullPath);
var emits = Files.Throttle(TimeSpan.FromMilliseconds(200));
var FinalFiles = Files.Window(() => emits).SelectMany(x => x.ToArray());
```
| null | CC BY-SA 4.0 | null | 2022-10-29T02:05:43.993 | 2022-10-29T02:05:43.993 | null | null | 13,309,929 | null |
74,242,468 | 2 | null | 74,231,432 | 0 | null | There are some articles talking about master-detail datagrid:
[http://www.codeproject.com/Articles/4094/A-Master-Detail-DataGrid](http://www.codeproject.com/Articles/4094/A-Master-Detail-DataGrid)
[http://www.codeproject.com/Articles/7941/How-to-create-a-simple-Master-Slave-DataGrid](http://www.codeproject.com/Articles/7941/How-to-create-a-simple-Master-Slave-DataGrid)
Also, check this out.
[https://www.codeproject.com/Questions/5309418/Filter-search-on-datagridview-in-VB-NET](https://www.codeproject.com/Questions/5309418/Filter-search-on-datagridview-in-VB-NET)
| null | CC BY-SA 4.0 | null | 2022-10-29T02:40:08.397 | 2022-10-29T02:40:08.397 | null | null | 5,212,614 | null |
74,242,597 | 2 | null | 8,895,273 | 0 | null | Here's an example using pseudo-elements and flexbox:
[](https://i.stack.imgur.com/ecge7.png)
```
.slant_tabs {
display:flex;
}
.slant_tab {
border-radius: 0px 0px 0px 0px;
position: relative;
line-height:1rem;
background-color: #FFF;
background:#DDD;
border: 2px solid blue;
border-bottom: none;
border-right:none;
margin-right:8px;
}
.slant_tab:after {
display: block;
content:" ";
position: absolute;
transform:skewX(45deg);
-ms-transform:skewX(45deg);
-webkit-transform:skewX(45deg);
z-index: -1;
background-color: #FFF;
background:#DDD;
height: 24px;
top: -2px;
border: 2px solid blue;
border-bottom: none;
border-left: none;
width: 28px;
right: -13px;
}
.slant_tab:hover {
background:blue;
color:white;
z-index:10;
}
.slant_tab:hover::after {
background:blue;
}
/* .slant_tab_inner element provides the full hoverable area for eachtab, including over slant area, because the slant part itself will not respond to hover. */
.slant_tab_inner {
border:none;
padding: 4px 20px 4px 8px;
margin-right:-20px;
cursor:pointer;
}
```
```
<div class="slant_tabs">
<div class="slant_tab"><div class="arrow"></div><div class="slant_tab_inner">Tab A</div></div>
<div class="slant_tab"><div class="arrow"></div><div class="slant_tab_inner">Tab B</div></div>
<div class="slant_tab"><div class="arrow"></div><div class="slant_tab_inner">Tab C</div></div>
</div>
```
[https://jsfiddle.net/p5tcons0/](https://jsfiddle.net/p5tcons0/)
(Modified from original answer [here](https://stackoverflow.com/a/16825346/165673))
| null | CC BY-SA 4.0 | null | 2022-10-29T03:24:19.907 | 2022-10-29T03:24:19.907 | null | null | 165,673 | null |
74,242,751 | 2 | null | 74,242,553 | 1 | null | The `bytes` type in Python represents a sequence of byte-valued integers (0-255), but by default as an immutable byte string. If you open your file in binary mode (`'rb'`) the data you read is a byte string that can be accessed as integers individually through indexing or iteration, or you can convert it explicitly to a list.
Opening in text mode (the default) uses an implicit encoding that varies by OS if the `encoding` parameters is not used and bytes to Unicode code points via that encoding.
If you want the individual bytes, read in binary to prevent any conversion:
```
with open('downloads\input.nodes', 'rb') as f:
data = f.read()
print(data[:20]) # displays first 20 bytes as a byte string
print(data[:20].hex(' ')) # hexadecimal dump separated by spaces
for b in data[20:40]: # prints next 20 bytes as integers
print(b)
print(list(data)) # convert to list
```
Output:
```
b'\x00\x00\x01N?\x80\x00\x00\xffp\x9bD\xff\x00\x00\x00\x00\x00\x00\x00'
00 00 01 4e 3f 80 00 00 ff 70 9b 44 ff 00 00
0
0
0
0
0
0
0
0
0
0
0
0
0
0
63
128
0
0
0
0
[0, 0, 1, 78, 63, 128, 0, 0, 255, 112, 155, 68, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 31, 31, 31, 255, 127, 127, 127, 255, 127, 127, 127, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 128, 0, 0, 0, 0, 0, 100, 0, 0, 0, 100, 0, 0, 0, 32, 0, 0, 0, 32, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 0, 0, 0, 45, 0, 0, 0, 45, 255, 112, 155, 68, 255, 112, 155, 68, 255, 112, 155, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
```
| null | CC BY-SA 4.0 | null | 2022-10-29T04:05:35.417 | 2022-10-29T04:24:14.213 | 2022-10-29T04:24:14.213 | 235,698 | 235,698 | null |
74,242,840 | 2 | null | 70,518,802 | 0 | null | The easiest way to target older versions of Net Framework in VS 2022 is downloading the reference assemblies from nuget.org open as zip and copy the content of build\.NETFramework\ to Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework
| null | CC BY-SA 4.0 | null | 2022-10-29T04:33:17.800 | 2022-10-29T04:33:17.800 | null | null | 7,760,471 | null |
74,243,004 | 2 | null | 10,697,995 | 2 | null | Here is a graphical representation of the problem, inspired from [How to visualize feasible region for linear programming (with arbitrary inequalities) in Numpy/MatplotLib?](https://stackoverflow.com/questions/57017444/how-to-visualize-feasible-region-for-linear-programming-with-arbitrary-inequali)
[](https://i.stack.imgur.com/3HP1A.png)
```
import numpy as np
import matplotlib.pyplot as plt
m = np.linspace(0,5,200)
x,y = np.meshgrid(m,m)
plt.imshow(((6*x+4*y<=24)&(x+2*y<=6)&(-x+y<=1)&(y<=2)&(x>=0)&(y>=0)).astype(int),
extent=(x.min(),x.max(),y.min(),y.max()),origin='lower',cmap='Greys',alpha=0.3);
# plot constraints
x = np.linspace(0, 5, 2000)
# 6*x+4*y<=24
y0 = 6-1.5*x
# x+2*y<=6
y1 = 3-0.5*x
# -x+y<=1
y2 = 1+x
# y <= 2
y3 = (x*0) + 2
# x >= 0
y4 = x*0
plt.plot(x, y0, label=r'$6x+4y\leq24$')
plt.plot(x, y1, label=r'$x+2y\leq6$')
plt.plot(x, y2, label=r'$-x+y\leq1$')
plt.plot(x, 2*np.ones_like(x), label=r'$y\leq2$')
plt.plot(x, y4, label=r'$x\geq0$')
plt.plot([0,0],[0,3], label=r'$y\geq0$')
xv = [0,0,1,2,3,4,0]; yv = [0,1,2,2,1.5,0,0]
plt.plot(xv,yv,'ko--',markersize=7,linewidth=2)
for i in range(len(xv)):
plt.text(xv[i]+0.1,yv[i]+0.1,f'({xv[i]},{yv[i]})')
plt.xlim(0,5); plt.ylim(0,3); plt.grid(); plt.tight_layout()
plt.legend(loc=1); plt.xlabel('x'); plt.ylabel('y')
plt.show()
```
The problem is missing an objective function so any of the shaded points satisfy the inequalities. If it did have an objective function (e.g. `Maximize x+y`) then many capable Python solvers can handle this problem. Here is a Linear Programming example in [GEKKO](https://gekko.readthedocs.io/en/latest/) that also supports mixed integer, nonlinear, and differential constraints.
```
from gekko import GEKKO
m = GEKKO(remote=False)
x,y = m.Array(m.Var,2,lb=0)
m.Equations([6*x+4*y<=24,x+2*y<=6,-x+y<=1,y<=2])
m.Maximize(x+y)
m.solve(disp=False)
```
Large scale LP problems are solved in matrix form or in sparse matrix form where only the non-zeros of the matrices are stored. There is a [tutorial on LP solutions](https://apmonitor.com/pdc/index.php/Main/LinearProgramming) with a few examples that I developed for a university course.
| null | CC BY-SA 4.0 | null | 2022-10-29T05:23:36.360 | 2022-10-29T06:05:43.063 | 2022-10-29T06:05:43.063 | 2,366,941 | 2,366,941 | null |
74,244,015 | 2 | null | 74,236,566 | 0 | null | You are getting the following error:
> ATAL EXCEPTION: main Process: com.example.movies4u, PID: 4783 java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.firebase.database.DatabaseReference com.google.firebase.database.DatabaseReference.child(java.lang.String)' on a null object reference
Because you are calling the `.child()` method on a `DatabaseReference` object that is null. So most likely you forgot to initialize it. To solve this, please add the following line of code:
```
DatabaseReference db = FirebaseDatabase.getInstance().getReference();
```
As a global variable inside the class where you're having the `addNewUser()` method.
| null | CC BY-SA 4.0 | null | 2022-10-29T08:58:27.880 | 2022-10-29T08:58:27.880 | null | null | 5,246,885 | null |
74,244,033 | 2 | null | 74,243,571 | 1 | null | Change this line to look like this:
```
ProfileUrl = snapshot.data()?['profileUrl'];
```
| null | CC BY-SA 4.0 | null | 2022-10-29T09:01:10.550 | 2022-10-29T14:11:54.077 | 2022-10-29T14:11:54.077 | 209,103 | 13,558,035 | null |
74,244,650 | 2 | null | 63,555,399 | 0 | null | 1 No such file or directory, when you this mistake, you can just add "C:/rtools40/usr/bin/mingw32/bin/gcc" to your path(environmental variable
2 Also try to run Rstudio as administrator in a windows laptor
| null | CC BY-SA 4.0 | null | 2022-10-29T10:48:49.490 | 2022-10-29T10:48:49.490 | null | null | 20,365,006 | null |
74,244,745 | 2 | null | 8,467,685 | 0 | null | I was just revisiting some of my questions here and it seems like the answer to this question was really simple all along. Assuming you have a 2D Perlin noise implementation that returns values in the range of `[-1, 1]`, you just convert this to an absolute value (using `abs`) and you get the turbulence noise as a result:
[](https://i.stack.imgur.com/IjZ3R.png)
Also see this [jsFiddle](http://jsfiddle.net/vqLc8w2e/1/) for an implementation in the browser.
| null | CC BY-SA 4.0 | null | 2022-10-29T11:06:30.850 | 2022-10-29T11:06:30.850 | null | null | 378,822 | null |
74,244,925 | 2 | null | 49,228,926 | 0 | null | Simple and clean answer:
```
select distinct city
from station
where city regexp '^[^aeiou].*[^aeiou]$'
```
| null | CC BY-SA 4.0 | null | 2022-10-29T11:39:10.327 | 2022-10-29T11:39:10.327 | null | null | 10,455,534 | null |
74,244,949 | 2 | null | 18,983,883 | 0 | null | ```
export const score = (test) => {
test = test.toUpperCase()
var s = 0
for (var i = 0; i < test.length; i++) {
if (['A', 'E', 'I', 'O', 'U', 'L', 'N', 'R', 'S', 'T'].some(function (v) { return test[i].indexOf(v) >= 0; })) {
s += 1
}
if (['D', 'G'].some(function (v) { return test[i].indexOf(v) >= 0; })) {
s += 2
}
if (['F', 'H', 'V', 'W', 'Y'].some(function (v) { return test[i].indexOf(v) >= 0; })) {
s += 4
}
if (['B', 'C', 'M', 'P'].some(function (v) { return test[i].indexOf(v) >= 0; })) {
s += 3
}
if (['K'].some(function (v) { return test[i].indexOf(v) >= 0; })) {
s += 5
}
if (['J', 'X'].some(function (v) { return test[i].indexOf(v) >= 0; })) {
s += 8
}
if (['Q', 'Z'].some(function (v) { return test[i].indexOf(v) >= 0; })) {
s += 10
}
}
return s
};
```
| null | CC BY-SA 4.0 | null | 2022-10-29T11:42:52.597 | 2022-10-29T11:42:52.597 | null | null | 12,846,479 | null |
74,245,019 | 2 | null | 44,842,168 | 0 | null | @NJENGAH's answer is correct.
Additionally, if you would like to have 2 drop-downs on the same page, i.e. header and footer, increment the `dropdown` array value for the subsequent calls by `1`.
```
<?php pll_the_languages( ['dropdown' => 2 ] ); ?>```
and so on...
```
| null | CC BY-SA 4.0 | null | 2022-10-29T11:52:28.460 | 2022-10-29T11:52:28.460 | null | null | 2,737,687 | null |
74,245,221 | 2 | null | 74,245,089 | 1 | null | Your issue is with your CSS. You can solve it by changing your height to auto in your container:
```
.form-content {
text-align: center;
border-radius: 20px;
width: 30vh;
height: auto;
border: 3px solid #001D4A;
padding: 20px;
background-color: #9DD1F1;
gap: 10px;
```
}
| null | CC BY-SA 4.0 | null | 2022-10-29T12:21:19.080 | 2022-10-29T12:21:19.080 | null | null | 14,333,874 | null |
74,245,384 | 2 | null | 50,236,128 | 1 | null | In Android Studio (Chipmunk), installing the Flutter plugin only adds the "New Flutter Project" button which when clicked will open this window
[](https://i.stack.imgur.com/vCVeK.png)
But the plugin doesn't install a Flutter SDK. You have to manually download the SDK from [https://flutter.dev](https://flutter.dev) (use search engine to find the file) then extract the SDK into a folder before specifying the path to this folder into the "Flutter SDK path" window.
| null | CC BY-SA 4.0 | null | 2022-10-29T12:44:56.837 | 2023-02-03T10:02:45.090 | 2023-02-03T10:02:45.090 | 10,344,135 | 10,344,135 | null |
74,245,452 | 2 | null | 74,245,422 | 1 | null | Be sure to have an `__init__.py` file in the parent directory. This is how python recognizes it as a package.
| null | CC BY-SA 4.0 | null | 2022-10-29T12:54:29.710 | 2022-10-29T12:54:29.710 | null | null | 20,295,394 | null |
74,245,539 | 2 | null | 74,234,750 | 0 | null | You can try
```
{#fig-over width='250px'}
```
or
```
{#fig-over width=250px}
```
: Be careful with whitespaces, e.g. `{#fig-over width= '250px'}` does not work.
| null | CC BY-SA 4.0 | null | 2022-10-29T13:08:27.337 | 2022-10-29T13:08:27.337 | null | null | 14,137,004 | null |
74,245,696 | 2 | null | 24,639,273 | 0 | null | If you use Bootstrap, you can put a breaking point depending on the screen size.
For example, to break line only on screens smaller than medium, you could put that in your html:
```
<br class="d-md-none">
```
More info on [https://getbootstrap.com/docs/5.2/utilities/display/#hiding-elements](https://getbootstrap.com/docs/5.2/utilities/display/#hiding-elements)
| null | CC BY-SA 4.0 | null | 2022-10-29T13:27:08.413 | 2022-10-29T13:37:00.197 | 2022-10-29T13:37:00.197 | 14,110,119 | 14,110,119 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.