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,733,966
2
null
74,733,421
1
null
In pandas you typically wouldn't include this aggregate information as part of the same grouped DataFrame, you would get it with a separate command afterwards, for instance: `grand_total = df.sum()` Note that the data you supplied in your question doesn't quite produce what you have in your images. The numbers differ and some of the A/B labeling was inconsistent. Below I edited the code you provided reproduce something that matches your images, assuming each row of the example data you supplied is one "unit". ``` df = pd.DataFrame( { "Products": [ "Products A", "Products A", "Products A", "Products B", "Products B", "Products A", "Products B", "Products A", ], "Sub Products": [ "Phone A", "Phone A", "Laptop A", "Phone B", "Laptop B", "Phone A", "Phone B", "Laptop A", ], "Color": ["Green", "Blue", "Red", "Red", "Red", "Blue", "Green", "Blue"], } ) df['Count'] = 1 df = df.groupby(['Products','Sub Products','Color' ]).sum() # To view the totals at any particular level of the multi-index display(df.groupby(level=0)['Count'].sum()) display(df.groupby(level=1)['Count'].sum()) display(df.groupby(level=2)['Count'].sum()) ``` This will give you the information you want... However from your comment, it sounds like you just want a particular display format. This is possible with the code below, but it loses the actual organization of the multi-indexed Data Frame: ``` out = pd.DataFrame(columns=['Product','Count']) for n1, d1 in df.groupby(level=0): out = pd.concat([out,pd.DataFrame({"Product": n1, "Count": d1.sum().values})]) d1 = d1.droplevel(0) for n2, d2 in d1.groupby(level=0): out = pd.concat([out,pd.DataFrame({"Product": n2, "Count": d2.sum().values})]) d2 = d2.droplevel(0) for n3, d3 in d2.groupby(level=0): out = pd.concat([out,pd.DataFrame({"Product": n3, "Count": d3.sum().values})]) display(out) ``` yields: ##### ``` Product Count 0 Products A 5 0 Laptop A 2 0 Blue 1 0 Red 1 0 Phone A 3 0 Blue 2 0 Green 1 0 Products B 3 0 Laptop B 1 0 Red 1 0 Phone B 2 0 Green 1 0 Red 1 ``` even better, here is the recursive version of the above: ``` # recursive version for arbitrarily deep multi-index def traverse_multiindex(d, out): for n1, d1 in d.groupby(level=0): out = pd.concat([out,pd.DataFrame({"Product": n1, "Count": d1.sum().values})]) if (d1.index.nlevels>1): d2 = d1.droplevel(0) out = traverse_multiindex(d2, out) return out # initialize empty out = pd.DataFrame(columns=['Product','Count']) out = traverse_multiindex(df, out) display(out) ```
null
CC BY-SA 4.0
null
2022-12-08T17:13:53.490
2022-12-08T18:56:07.460
2022-12-08T18:56:07.460
20,521,021
20,521,021
null
74,734,238
2
null
74,733,711
0
null
The main issue here is the way you pass/accept arguments. `answers` is an object containing the key/value-pairs an example could be: ``` const answers = { title: "Hello World", description: "Hello World, this is a test description", // ... license: "GNU AGPL v3", }; ``` You then pass the `answers` object to `renderBadge`. ``` renderBadge(answers) ``` However in `renderBadge` you expect `license` as the sole argument. ``` function renderBadge(license) { // ... } ``` Since you passed the whole `answers` object, that is what you will receive. Meaning that the `licence` parameter will contain the `answers` object. To fix this you should pass just the license to `renderBadge`, not all the answers. So use `renderBadge(answers.license)` instead. Alternatively you could also use [object destructuring](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#object_destructuring) like you did in `generateREADME`, and define `renderBadge` as: ``` function renderBadge({ license }) { // ... } ``` If you choose to use object destructuring, you should still pass the full answers object to `renderBadge`, so `renderBadge(answers)`. --- The second, non-essential mistake is: ``` return badge; generateREADME(badge) // never executed ``` The line after the return is never executed. This doesn't really break anything, since you didn't need that line anyways, so it can just be removed. --- Lastly, and probably most importantly the order of the following lines are incorrect. ``` const readmePageContent = generateREADME(answers); renderBadge(answers.license) // after the first fix ``` The `renderBadge()` call should be made before you render the readme file, the resulting contents should then be passed as argument to `generateREADME()`. ``` const badge = renderBadge(answers.license); const readmePageContent = generateREADME({ ...answers, badge }); ``` This uses the [spread syntax in object literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax#spread_in_object_literals) combined with the [property definition shorthand](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer#property_definitions) to pass a single object, containing al the required arguments. --- So the final result might look like this (with minimum changes): ``` const inquirer = require("inquirer"); const fs = require("fs"); const generateREADME = ({title, description, installation, usage, contributions, tests, license, github, email, badge,}) => ( `# ${title} ${badge} ## Description ${description} (Rest of Readme Generation here) ` ); inquirer.prompt([ { (other prompts here) }, { type: "list", name: "license", message: "What license is your project?", choices: [ "Apache 2.0", "Boost", "GNU AGPL v3", "MIT", "Perl", "other", ], validate: (licenseInput) => { if (licenseInput) { return true; } else { console.log(`Please enter your project's license!`); return false; } }, } ]).then((answers) => { const badge = renderBadge(answers.license); // pass only the license, not all the anwers const readmePageContent = generateREADME({ ...answers, badge }); // pass the answers combined with the badge fs.writeFile('README.md', readmePageContent, (err) => { err ? console.log(err) : console.log('Successfully generated README!') }) }); function renderBadge(license) { let badge = '' if (license === 'Apache 2.0') { badge = `![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)]` } else if (license === 'Boost') { badge = `![License](https://img.shields.io/badge/License-Boost_1.0-lightblue.svg)]` } else if (license === 'GNU APGL v3') { badge = `![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)]` } else if (license === 'MIT') { badge = `![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)]` } else if (license === 'Perl') { badge = `![License: Artistic-2.0](https://img.shields.io/badge/License-Perl-0298c3.svg)]` } else { badge = '' } return badge; // removal of generateREADME } ```
null
CC BY-SA 4.0
null
2022-12-08T17:36:37.973
2022-12-08T18:07:19.907
2022-12-08T18:07:19.907
3,982,562
3,982,562
null
74,734,322
2
null
74,733,826
0
null
changing `ax.dist = 8` to `ax.dist = 9` actually works? This what you looking for? I guess it's issue with camera angle. ``` import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(projection='3d') x_data = range(0,6) y_Data = [10,10,10,10,10,10] for i in range(6): ax.bar(x_data, y_Data, zs=i, zdir='y', color="r", alpha=0.8) ax.set_box_aspect((1,6,1)) ax.dist = 9 ax.elev = 23 ax.azim = 31 plt.autoscale() plt.show() ``` Gives # [](https://i.stack.imgur.com/CMuSD.png)
null
CC BY-SA 4.0
null
2022-12-08T17:43:01.850
2022-12-08T17:43:01.850
null
null
15,358,800
null
74,735,089
2
null
74,734,889
0
null
1. Excel save to csv 2. read file w/ open('file.csv') 3. split the file content w/ str.split 4. use io and csv.reader ``` import csv import io content = 'aaaa,222\n22,33' f = io.StringIO(content) r = csv.reader(f) for row in r: print(row) # ['aaaa', '222'] # ['22', '33'] ```
null
CC BY-SA 4.0
null
2022-12-08T18:56:36.863
2022-12-08T18:56:36.863
null
null
14,516,752
null
74,735,436
2
null
74,727,435
0
null
- - [.bar_label](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.bar_label.html)[answer](https://stackoverflow.com/a/67561982/7758804)- `df``label=`- [answer](https://stackoverflow.com/a/73573812/7758804)- [answer](https://stackoverflow.com/a/4701285/7758804)- [answer](https://stackoverflow.com/a/36319915/7758804)- [pandas.DataFrame.plot](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.plot.html)- - `python 3.11``pandas 1.5.2``matplotlib 3.6.2` ``` import pandas as pd import matplotlib.ticker as tkr # sample data df = pd.DataFrame({'IL': ['Balıkesir', 'Bursa', 'Çanakkale', 'Edirne', 'İstanbul', 'Kırklareli', 'Kocaeli', 'Sakarya','Tekirdağ','Yalova'], 'ENGELLIUYGUN': [7, 13, 3, 1, 142, 1, 14, 1, 2, 2], 'ENGELLIUYGUNDEGIL': [1, 5, 0, 0, 55, 0, 3, 0, 1, 0]}) # set IL as the index df = df.set_index('IL') # calculate the percent per = df.div(df.sum(axis=1), axis=0).mul(100) # plot percent; adjust rot= for the rotation of the xtick labels ax = per.plot(kind='bar', stacked=True, figsize=(10, 8), rot=0, color=['#3a88e2', '#5c9e1e'], yticks=range(0, 101, 10), title='my title', ylabel='', xlabel='') # move the legend ax.legend(loc='upper center', bbox_to_anchor=(0.5, -0.05), ncol=2, frameon=False) # format the y-axis tick labels ax.yaxis.set_major_formatter(tkr.PercentFormatter()) # iterate through the containers for c in ax.containers: # get the current segment label (a string); corresponds to column / legend col = c.get_label() # use label to get the appropriate count values from df # customize the label to account for cases when there might not be a bar section labels = [v if v > 0 else '' for v in df[col]] # the following will also work # labels = df[col].replace(0, '') # add the annotation ax.bar_label(c, labels=labels, label_type='center', fontweight='bold') ``` [](https://i.stack.imgur.com/nj5NU.png) ### Alternate Annotation Implementation - `df``per``per` ``` # iterate through the containers and per column names for c, col in zip(ax.containers, per): # add the annotations with custom labels from df ax.bar_label(c, labels=df[col].replace(0, ''), label_type='center', fontweight='bold') ```
null
CC BY-SA 4.0
null
2022-12-08T19:32:30.307
2022-12-11T01:10:41.527
2022-12-11T01:10:41.527
7,758,804
7,758,804
null
74,736,338
2
null
23,408,910
0
null
Windows Command: set DEBUG=* & node ./app.js PowerShell: $env:DEBUG='*'; node app.js Terminal/WSL (Ubuntu): DEBUG=* node ./app.js
null
CC BY-SA 4.0
null
2022-12-08T21:07:33.120
2022-12-08T21:07:33.120
null
null
3,947,234
null
74,736,349
2
null
58,907,830
0
null
# Changing large NavigationTitle padding This can be set across your entire app in the `ApplicationDelegate` ``` UINavigationBar.appearance().layoutMargins.left = 80 ``` ![](https://i.stack.imgur.com/fYY9t.jpg) ## Full example code ``` class AppDelegate: NSObject, UIApplicationDelegate { func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil ) -> Bool { // Adjust left margin UINavigationBar.appearance().layoutMargins.left = 80 return true } } @main struct testApp: App { // Make sure you attach the AppDelegate @UIApplicationDelegateAdaptor(AppDelegate.self) var delegate var body: some Scene { WindowGroup { ContentView() } } } ```
null
CC BY-SA 4.0
null
2022-12-08T21:08:42.027
2022-12-08T21:08:42.027
null
null
4,975,772
null
74,736,455
2
null
74,634,880
0
null
Thanks for answering those questions Peter. I concluded that the issue had something to do with appending a dataflow. I switched to a new data source from SAP BW and its working now. What's interesting is that the dataflow is still being imported and refreshed daily so the issue had to do with just the append.
null
CC BY-SA 4.0
null
2022-12-08T21:20:19.327
2022-12-08T21:20:40.027
2022-12-08T21:20:40.027
9,683,609
9,683,609
null
74,736,464
2
null
47,573,936
0
null
This sequence is printed on the screen due to an ansi sequence ``` ESC[6n ``` or ``` ^[[6n ``` Per [https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797](https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797), this sequence is for the following purpose ``` request cursor position (reports as ESC[#;#R) ``` If you don't care about the text that's on this line, you could use `grep -v` to eliminate it: ``` ./runcmd.sh | grep -v "\[6n" ```
null
CC BY-SA 4.0
null
2022-12-08T21:21:18.223
2022-12-08T21:21:18.223
null
null
86,969
null
74,736,643
2
null
74,734,763
0
null
It's difficult to tell why Pyzbar fails, but we may guess that the issue is related to low quality scanning artifacts, and maybe compression artifacts. Here is a small ROI in native resolution: [](https://i.stack.imgur.com/aOEeV.png) As you can see there is a lot of noise and artifacts. For improving the quality I recommend using [cv2.medianBlur](https://docs.opencv.org/4.6.0/d4/d86/group__imgproc__filter.html#ga564869aa33e58769b4469101aac458f9) filter: ``` clean_im = cv2.medianBlur(im, 25) ``` - - Same ROI after filtering: [](https://i.stack.imgur.com/tGVAI.png) As you can see the noise is much lower, but the details are blurred. --- For improving the issue, we may downscale the image using `cv2.resize`: ``` small_clean_im = cv2.resize(clean_im, (512, 512), interpolation=cv2.INTER_AREA) ``` Downscaling the image with `cv2.INTER_AREA` interpolation is merging multiple pixels into one pixel (kind of concentrating the data), and also remove noise. The size 512x512 seems like a good tradeoff between keeping details and removing noise. Image after `medianBlur` and `resize`: [](https://i.stack.imgur.com/P7Zls.png) Same image with `resize` only (without `medianBlur`) for comparison: [](https://i.stack.imgur.com/XZXg1.png) --- I suppose it's better not to apply a threshold before using Pyzbar `decode` method. I assume the decode method uses an internal thresholding algorithm that may be better than our own thresholding. --- Complete code sample: ``` import cv2 from pyzbar.pyzbar import decode from pyzbar.pyzbar import ZBarSymbol im = cv2.imread('page1.png', cv2.IMREAD_GRAYSCALE) clean_im = cv2.medianBlur(im, 25) # Apply median blur for reducing noise small_clean_im = cv2.resize(clean_im, (512, 512), interpolation=cv2.INTER_AREA) # Downscale the image barcodes = decode(small_clean_im, symbols=[ZBarSymbol.QRCODE]) print(f'barcodes: {barcodes}') # Show image for testing cv2.imshow('small_clean_im', small_clean_im) cv2.waitKey() cv2.destroyAllWindows() ``` --- Output: `barcodes: [Decoded(data=b'P1693921.001', type='QRCODE', rect=Rect(left=137, top=112, width=175, height=175), polygon=[Point(x=137, y=280), Point(x=304, y=287), Point(x=312, y=119), Point(x=143, y=112)])]` --- Note: -
null
CC BY-SA 4.0
null
2022-12-08T21:42:46.613
2022-12-09T12:32:26.523
2022-12-09T12:32:26.523
2,602,877
4,926,757
null
74,737,681
2
null
74,737,360
0
null
You need `Id` as a factor to start because they are individuals, not actual numbers. Insert before plot `sleep_steps$Id <- as.factor(sleep_steps$Id)` Without the code for your data to check, I would also say that you need another fill colour for your second scale, but you are using `geom_line` which is not normally how you would plot individuals because they are not connected. You may need to reconsider that. Normally you would plot all your data with boxplots which would show the averages and the quartiles etc. If you are looking for an actual RELATIONSHIP, then you need to look into an `lm` plot [LINK HERE](https://www.statology.org/plot-lm-in-r/#:%7E:text=2022%20by%20Zach-,How%20to%20Plot%20lm()%20Results%20in%20R,line%20to%20scatterplot%20abline(fit))
null
CC BY-SA 4.0
null
2022-12-09T00:14:50.733
2022-12-09T00:28:41.860
2022-12-09T00:28:41.860
14,732,712
14,732,712
null
74,738,333
2
null
25,055,762
0
null
You can get it like this: ``` val intent = Intent(Intent.ACTION_MAIN) intent.addCategory(Intent.CATEGORY_HOME) val resolveInfo: ResolveInfo = context.packageManager.resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY)?: return null val currentLauncherPackageName: String = resolveInfo.activityInfo.packageName val currentLauncherClassName: String = resolveInfo.activityInfo.name ``` Two boundary cases: Result 1: android (This happens when the system has multiple launcher applications, but the user does not make the default selection) Result 2: The corresponding package name.
null
CC BY-SA 4.0
null
2022-12-09T02:26:16.793
2022-12-09T02:26:16.793
null
null
16,115,342
null
74,738,514
2
null
74,737,336
0
null
You were really close — just needed to put the `.frame(maxHeight:)` before `.background`. ``` struct ContentView: View { var body: some View { ScrollView(.vertical) { LazyVGrid( columns: [GridItem(.adaptive(minimum: 160))], alignment: .leading, spacing: 16 ) { ForEach([0, 1, 2, 5, 6, 3], id: \.self) { index in BoardCell(index: index) .padding() .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading) .background(Color(.secondarySystemGroupedBackground)) /// `background` goes after the frame! .cornerRadius(10) } } .padding(20) } .background(Color(.secondaryLabel)) } } /// I recreated your view for testing purposes struct BoardCell: View { var index: Int var body: some View { VStack(alignment: .leading) { Text("Powell (Westbound)") ForEach(0 ..< index) { _ in HStack { Circle() .fill(.green) .frame(width: 30, height: 30) Text("4") Text("19") Text("17") } } } } } ``` Result: ![2-column grid. In each row, cells share the height of the tallest cell. Inner content is aligned to the top-left edge.](https://i.stack.imgur.com/rVNW5.png)
null
CC BY-SA 4.0
null
2022-12-09T03:04:09.780
2022-12-09T03:04:09.780
null
null
14,351,818
null
74,738,654
2
null
74,737,905
0
null
The value `imageFilePath` could be null so that means: ``` final face = Face(name:faceName,imagePath:imageFilePath!); ``` You could make the field imageFile in your Face class : ``` class Face { final String name; final String? imagePath; Face({required this.name,required this.imagePath}); } ``` then you can easily do this: `final face = Face(name:faceName,imagePath:imageFilePath);` There is another option if you don't want to do the above two suggestions: ``` final face = Face(name:faceName,imagePath:imageFilePath ?? ''); ```
null
CC BY-SA 4.0
null
2022-12-09T03:31:38.460
2022-12-09T03:31:38.460
null
null
19,801,869
null
74,738,677
2
null
74,737,905
0
null
`imageFilePath` is a nullabe String, you can do null check and proceed the way did for `faceImagePath`. ``` if(imageFilePath!=null){ .... } ```
null
CC BY-SA 4.0
null
2022-12-09T03:36:28.097
2022-12-09T03:36:28.097
null
null
10,157,127
null
74,738,914
2
null
74,735,226
0
null
You have a circle centered at `(x, y)` with a radius of `r`. A point `(px, py)` is inside this circle if its [distance from the center of the circle](https://www.mathsisfun.com/algebra/distance-2-points.html) is less than the radius. ``` point_count = 0 for px, py in zip(headX, headY): if (px-x)**2 + (py-y)**2 <= r**2: point_count += 1 ``` Or, we could use the fact that `True` is considered as `1`, and `False` as `0` to condense this to a one-liner like so: ``` point_count = sum((px-x)**2 + (py-y)**2 <= r**2 for px, py in zip(headX, headY)) ```
null
CC BY-SA 4.0
null
2022-12-09T04:26:20.613
2022-12-09T04:26:20.613
null
null
843,953
null
74,738,956
2
null
73,443,778
0
null
This problem occurs with the newer versions of JDK since the look and feel tools are less frequently used. I currently use JDK v1.8 on NetBeans and this issue isn't there atleast for the jbuttons. Although it's not generally recommended, you can try with the previous version of JDK to see if the issue persists or not If you are using Apache NetBeans you can check which version of JDK NetBeans is using by selecting Tools ⇾ Java Platforms from the NetBeans menu Further I would recommend you to either use Smart Look & Feel instead of aluminium or use the JDK v1.8 for better compatibility. For more information you can read this article below : [https://www.geeksforgeeks.org/java-swing-jbutton-with-rounded-edges/](https://www.geeksforgeeks.org/java-swing-jbutton-with-rounded-edges/)
null
CC BY-SA 4.0
null
2022-12-09T04:36:18.787
2023-01-02T05:56:51.420
2023-01-02T05:56:51.420
12,802,843
12,802,843
null
74,739,275
2
null
17,745,834
0
null
For Windows Just open the (tomcat xx.x) folder once and check if you can see all other root folders while selecting folder. Sometimes windows wont give access to this folder
null
CC BY-SA 4.0
null
2022-12-09T05:37:24.197
2022-12-09T05:37:24.197
null
null
9,986,305
null
74,739,392
2
null
74,733,735
0
null
- the jupyter kernel.[](https://i.stack.imgur.com/DV2hh.png)- Add the path to the package above the `import` statement.``` import sys // path is the directory where the package is located, not the full path of the package sys.path.append("path/to/package") import dll_etl ```
null
CC BY-SA 4.0
null
2022-12-09T05:55:04.633
2022-12-09T05:55:04.633
null
null
19,133,920
null
74,739,677
2
null
73,712,893
0
null
I'm facing the same problem, and researched about it. I'm suspicious now that "GA4 Configuration" tag will be work only once and setting user_id field too no matter how many I trigger it. I think the only way is reloading the page to refresh GTM tag, but I'm not satisfied with this conclusion, so I'll be back when I find a better way.
null
CC BY-SA 4.0
null
2022-12-09T06:39:56.213
2022-12-09T06:39:56.213
null
null
7,203,546
null
74,739,718
2
null
74,739,564
2
null
Use only sep=";" to correctly split columns. Add quotechar='"' to tell pandas that " is a quote character and should not be part of value. ``` df = pd.read_csv(path2,sep=';', quotechar='"',engine='python') ```
null
CC BY-SA 4.0
null
2022-12-09T06:46:52.327
2022-12-09T06:46:52.327
null
null
20,700,631
null
74,739,798
2
null
74,738,965
1
null
Recently I had the same problem. Here's the solution: You need add react-native-gesture-handler ``` yarn add react-native-gesture-handler or npm install react-native-gesture-handler ``` and Add this in App.js ``` import 'react-native-gesture-handler'; ```
null
CC BY-SA 4.0
null
2022-12-09T06:56:29.110
2022-12-09T06:56:29.110
null
null
9,644,502
null
74,739,946
2
null
74,739,280
1
null
make in calender tag -> appendTo="body"
null
CC BY-SA 4.0
null
2022-12-09T07:17:14.247
2022-12-09T07:17:14.247
null
null
20,731,134
null
74,739,994
2
null
74,739,919
1
null
## Explanation The issue with opening an HTML file directly is that now your computer's own hard drive is the "server" serving the files. As such, the browser asks your computer for your CSS files at the directory `/css`, the `/` indicating the root directory of your whole file-system. For your computer, there's a couple of issues with that. Routes starting with `/` are usually used on UNIX-based systems (think of MacOS or Linux distros like Ubuntu), but since you're using Windows, that type of a directory or path won't resolve to anything. And even if you were using MacOS or Linux, you most likely would not have your CSS files in `/`, as that would be like having them right under `C:/` in Windows. This is the reason why when serving the HTML files over a proper server, the `/` path is correctly resolved, as there `/` indicates the root of your web server's directory, and not the root of your file system. ## Solution A - Local file server If you'd like to keep your code as-is and you have either Python or Node.js installed locally on your machine, you can use either of them to spin up a lightweight HTTP server to act as a static file server. ``` # Python 2.x python -m SimpleHTTPServer # Python 3.x python3 -m http.server ``` ``` # Node.js with npm npx serve ``` Now visiting http://localhost:8080 (or whatever port your terminal tells you), should serve up your HTML file correctly resolve the CSS asset paths. You can find a large list of other static servers for different languages here: [https://gist.github.com/willurd/5720255](https://gist.github.com/willurd/5720255) --- ## Solution B - Relative file paths Another solution is to remove the `/` prefix from your asset paths, making them relative paths to the `index.html` file. Note that this could lead to other unexpected scenarios in the future, for example if your index.html file is also served for an `/about` page, then the CSS asset paths would now resolve to `/about/css` instead of `/css` (as the `css/...` path is now to the current path and will be appended to it). So even though this is a cheap and quick fix locally, it's not considered the best practise.
null
CC BY-SA 4.0
null
2022-12-09T07:24:42.563
2022-12-09T07:24:42.563
null
null
2,803,743
null
74,740,053
2
null
74,722,649
0
null
The problem is in how your code tests for increasing sequences that end in a zero. It is not enough to test that the sequence has n-2 increments and the last digit is a zero, because that will give a false positive on numbers like 6780. It is required that the one-but-last digit is a 9. A similar issue exist for the sequence logic, however, there you would not need a special test for an ending zero at all. This condition is covered by counting n-1 decrements, where the ending could be a 1 followed by a zero. There is no special case to be handled here. To fix the first problem, I would suggest you not only check whether the last digit is a zero, but whether the last two digits are 9 and 0, or in other words, that the number modulo 100 is equal to 90. You could replace this: ``` boolean endsInZero = numbers[numbers.length - 1] == 0; ``` by this: ``` boolean endsInNinety = testNumber % 100 == 90; ``` and then replace: ``` if (incrementingCounter == numbers.length - 2 && endsInZero) return 2 - yellowOffset; ``` by: ``` if (incrementingCounter == numbers.length - 2 && endsInNinety) return 2 - yellowOffset; ``` and finally remove this test: ``` if (decrementingCounter == numbers.length - 2 && endsInZero) return 2 - yellowOffset; ``` This will fix it. Note that it can be helpful to have your function the input it gets, so that when a test fails, at least you can know for which input there was a problem: ``` System.out.println("input " + number); ```
null
CC BY-SA 4.0
null
2022-12-09T07:31:14.507
2022-12-09T10:37:36.047
2022-12-09T10:37:36.047
5,459,839
5,459,839
null
74,740,097
2
null
11,267,154
1
null
First, setting ``` td { max-width: 0; overflow: hidden; text-overflow: ellipsis; } ``` ensures that your your table cells will stretch. Now you only need ``` td.fit { width: 0; min-width: fit-content; } ``` on your fitting cells. Note that now the table will only overflow in width if content of all fitting cells is too much to fit into a table-width of `100%`. ``` table { white-space: nowrap; width: 100%; } td { border: 1px solid black; } td { max-width: 0; overflow: hidden; text-overflow: ellipsis; } td.fit { width: 0; min-width: fit-content; } ``` ``` <table> <tr> <td class="stretch">this should stretch</td> <td class="stretch">this should stretch</td> <td class="fit">this should be the content width</td> </tr> </table> ```
null
CC BY-SA 4.0
null
2022-12-09T07:36:27.403
2022-12-09T07:54:18.477
2022-12-09T07:54:18.477
5,351,381
5,351,381
null
74,740,136
2
null
74,723,951
0
null
Here is my solution! I am sorry if I kept you waiting too much! First, I need to say that your design is not so efficient! You need a full date table with full date values(not only month &year parts) Here is your calendar table: [](https://i.stack.imgur.com/2xAaR.png) [](https://i.stack.imgur.com/MkFqd.png) Here is the DAX Code you need to write to obtain correct value: ``` Total_Correct = CALCULATE ( SUM('Callable'[Balance]), FILTER ( ALL ( 'Callable'[Date] ), 'Callable'[Date] <= MAX('Callable'[Date])), ALL('Calendar') ) ``` [](https://i.stack.imgur.com/Cyffp.png)
null
CC BY-SA 4.0
null
2022-12-09T07:39:54.187
2022-12-09T07:39:54.187
null
null
19,469,088
null
74,740,260
2
null
74,737,879
0
null
JMeter's built-in test elements are not flexible enough to implement your criteria, you will need to go for [JSR223 PostProcessor](https://jmeter.apache.org/usermanual/component_reference.html#JSR223_PostProcessor) and some [Groovy](https://groovy-lang.org/) scripting. Example setup: 1. Change your While Controller's condition to the following __jexl3() function: ${__jexl3(${matches} < 5,)} 2. Put your request which is in the While Controller under the If Controller and use the following condition: ${__jexl3("${__V(MultitrackerId_${counter})}_skip" != "true",)} 3. Add JSR223 PostProcessor as a child of the request which might return SUCCESSFUL and put the following code there: def matches = vars.getObject('matches') ?: 0 if (prev.getResponseData().contains('SUCCESSFUL')) { vars.putObject('matches', matches + 1) def variable = 'multitrackerIdvalue_' + ((vars.get('__jm__While Controller__idx') as int) + 1) vars.put(variable + '_skip', 'true') }
null
CC BY-SA 4.0
null
2022-12-09T07:57:02.977
2022-12-09T07:57:02.977
null
null
2,897,748
null
74,740,654
2
null
74,732,423
0
null
I took a different approach to your solution. I created an `SVG` icon that has the wave effect applied. Then I stretch the `SVG` icon to fill the screen. Then I use `Image.Tile` to fill the wave repeatedly and then I use the `NumberAnimation` to shift the `SVG` icon `x`. Then, I apply an `OpacityMask` to cut out a circle: ``` import QtQuick import QtQuick.Controls import Qt5Compat.GraphicalEffects Page { id: window property real slide: 0.0 Item { id: waveEffect anchors.fill: parent Image { height: window.height width: window.width + 4 * window.height x: -window.height * 2 + slide source: `data:image/svg+xml;utf8,<svg width="32" height="32"> <rect width="32" height="32" fill="#0F325B"/> <path d="M ${wave()} 32 16 32 32 0 32" fill="#5294E2"/> </svg>` sourceSize: Qt.size(height, height) fillMode: Image.Tile } visible: false } Item { id: circleEffect anchors.fill: parent Rectangle { width: Math.min(window.height, window.width) height: width radius: width / 2 color: "red" } visible: false } NumberAnimation { target: window property: "slide" from: window.height to: 0 loops: Animation.Infinite running: true duration: 8000 } OpacityMask { anchors.fill: waveEffect source: waveEffect maskSource: circleEffect } function wave() { let str = [ ]; for (let j = 0; j<32; j++) { let a = j * 2 * Math.PI / 32; let i = Math.sin(a) * 2 + 16; str.push(`${j} ${i.toFixed(2)} `); } return str.join(" "); } } ``` You can [Try it Online!](https://stephenquan.github.io/qmlonline/?zcode=AAAF0niclVRtT9swEP7eX3HK+NBSFrIUEEsp0oZg6oduMPZtmlSTOO0Vx45sh5eh/vddnLRpoJ02q7J8uefenytmudIWbuxNgfF9B1uif6Gk1UqY5vvxhcpyZv0vmuVzjJm4TFMeW9O5ZjMOLx2gg0kEjygT9ehEd+Va5VzbZ9CcCTACEx5B4AcNYmx5VjtYO2EPvPK//sxkPFfa+CkKEUHONJeNcpw1SazOnONsblcJ+ZXYQjxiYudrgJOgD0ew/xebpwjet7SEDsnKFdZCGlXomGqdJsyyCMsMD83DrP+UiWFh09ODM5KqHEbeIPTqhN37vHOmqfgdWih7MPLeBVeD8Pizd0homswckpE3gb2Xsnnd3hIGIXw4KW/6BbBhdxx+PLoMnV2Z0fl0S963+Jtyv7G+oUe3Cn5QJ9Fr4UunE1VO1U3B/4GiacRy/XpAg3eCUCkTpgIsO7vmH6OOxX8x4DshmZyJ1yyoZzyh/vgZym5rdget2fd20IdULY1mCRam1sAhhC1trITSEXiaJ96/tqG83fW1yO64/iSJLRaV3KjFMj3jtrVe5VltFwV0DGxCplplu8hvFa3gWhJK5VTOOqo/lilKtM0UdSElylkEVhfN16TQDh/BaRAEmxP9lrMY7fOEmfuNEtrz27Liq43ZosrI1W2tfkOOOmpayNh1rVqAjciCWzBWwwh+wq9h0yKloVvqFqQJhrA4G4R09/u9VyQqMYwwC7fs+xWbrsc0ezJ4g0RCOoQhvrFe/Qfx4aSNpHz8vDDz7nTvZbGktUXfqit84kk3pOWd9oZb2KO5LbR0tgtF3j3watyys/wDCCqVPA==)
null
CC BY-SA 4.0
null
2022-12-09T08:42:18.117
2022-12-09T09:22:39.687
2022-12-09T09:22:39.687
881,441
881,441
null
74,740,793
2
null
54,617,432
0
null
In my case I was using a provider where I used a context as an argument to a function, the thing was that when I passed that page I did it with pushnamedAndRemove Until then on the next page I was trying to use a function where I required the above context, so the error was mine because it was trying to get a parameter that I destroyed earlier, for that reason it didn't work. So be careful if you are deleting old pages.
null
CC BY-SA 4.0
null
2022-12-09T08:57:00.720
2022-12-09T08:57:00.720
null
null
14,969,196
null
74,740,864
2
null
68,958,170
0
null
You can set a common version to be used across all your application development to be consistent with dependency and tools. ``` dotnet new globaljson --sdk-version <installed sdk versions of .NET> ``` It will create file. To check what versions are installed ( in case you are not aware ) use - ``` dotnet sdk check ``` [](https://i.stack.imgur.com/T2NWA.png) After getting version details you can set which one to use based on your requirements ``` dotnet new globaljson --sdk-version 6.0.306 ``` ``` "C:\Users\username\global.json" ```
null
CC BY-SA 4.0
null
2022-12-09T09:03:41.987
2022-12-15T17:54:24.413
2022-12-15T17:54:24.413
1,745,409
1,745,409
null
74,741,059
2
null
74,739,280
1
null
View file: ``` <div class="class-name"> <input datepicker-popup="..."> </div> ``` CSS: ``` .class-name{ position: relative; } .class-name.dropdown-menu { left: auto !important; right: 0px; } ```
null
CC BY-SA 4.0
null
2022-12-09T09:21:45.160
2022-12-09T09:21:45.160
null
null
9,798,013
null
74,741,226
2
null
74,740,636
0
null
Add an `items` array and required amount breakdown. The example from [the documentation](https://developer.paypal.com/docs/checkout/standard/integrate/#link-addandmodifythecode): ``` createOrder: (data, actions) => { return actions.order.create({ "purchase_units": [{ "amount": { "currency_code": "USD", "value": "100", "breakdown": { "item_total": { /* Required when including the items array */ "currency_code": "USD", "value": "100" } } }, "items": [ { "name": "First Product Name", /* Shows within upper-right dropdown during payment approval */ "description": "Optional descriptive text..", /* Item details will also be in the completed paypal.com transaction view */ "unit_amount": { "currency_code": "USD", "value": "50" }, "quantity": "2" }, ] }] }); }, ```
null
CC BY-SA 4.0
null
2022-12-09T09:35:12.127
2022-12-09T09:35:12.127
null
null
2,069,605
null
74,741,325
2
null
74,737,081
0
null
I think you should add `allow_nil: true` in your `validates_inclusion_of` validation. This way, your record will become "valid" on sign-up, where you are not sending this parameter: ``` validates_inclusion_of :old, in: OLD, allow_nil: true ```
null
CC BY-SA 4.0
null
2022-12-09T09:45:00.507
2022-12-09T09:45:00.507
null
null
3,033,649
null
74,741,432
2
null
74,727,932
0
null
- `ASP.NET CORE 6 MVC` ![enter image description here](https://i.imgur.com/FXh1CkS.png) Follow another workaround to Deploy the web Application to Azure App Service. - In `Azure Portal`, create an App Service. ![enter image description here](https://i.stack.imgur.com/IcBCV.png)- In Visual Studio, Right click on the project folder and follow the next steps.- Select the Azure App Service which we have already created in previous step. ![enter image description here](https://i.stack.imgur.com/HpSGu.png) ![enter image description here](https://i.stack.imgur.com/L64yK.png) - `Overview``Download publish profile` ![enter image description here](https://i.stack.imgur.com/oNPlY.png) - Select `Import Profile`![enter image description here](https://i.stack.imgur.com/CI4I5.png)- Select the Downloaded `publish profile` and continue with the next steps. ![enter image description here](https://i.stack.imgur.com/1pUB7.png) ``` <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net6.0</TargetFramework> <Nullable>enable</Nullable> <ImplicitUsings>enable</ImplicitUsings> </PropertyGroup> <ItemGroup> <PackageReference Include="FoolProof.Core" Version="1.1.10" /> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.10" /> <PackageReference Include="NLog" Version="5.0.1" /> <PackageReference Include="NLog.Database" Version="5.0.1" /> <PackageReference Include="NLog.Schema" Version="5.0.1" /> <PackageReference Include="NLog.Web.AspNetCore" Version="5.0.0" /> <PackageReference Include="System.Data.SqlClient" Version="4.8.3" /> <PackageReference Include="System.Management" Version="6.0.0" /> </ItemGroup> ```
null
CC BY-SA 4.0
null
2022-12-09T09:54:33.127
2022-12-09T09:54:33.127
null
null
19,648,279
null
74,741,503
2
null
59,426,609
0
null
I have another solution that would suggest to you. Just check for update and update your Android Studio. Then this problem will be solved. In this way, you don't need to reinstall the studio and your custom settings. However updating studio might cause some unexpected errors for you.
null
CC BY-SA 4.0
null
2022-12-09T10:00:24.427
2022-12-09T10:00:24.427
null
null
12,697,321
null
74,741,700
2
null
74,741,006
0
null
treats the `enter` as new line in result. As an alternative you can use `concat()` in dynamic content. ![enter image description here](https://i.imgur.com/KzMDOfr.png) ![enter image description here](https://i.imgur.com/OkWiLJJ.png)
null
CC BY-SA 4.0
null
2022-12-09T10:17:26.870
2022-12-09T10:17:26.870
null
null
18,836,744
null
74,742,023
2
null
41,903,398
3
null
There are two ways to do this: either remove all image attributes with a [Lua filter](https://pandoc.org/lua-filters) or choose an output format that doesn't support attributes on images. ### Output format The easiest (and most standard-compliant) method is to convert to `commonmark`. However, [CommonMark](https://commonmark.org) allows raw HTML snippets, so pandoc tries to be helpful and creates an HTML `<img>` element for images with attributes. We can prevent that by disabling the `raw_html` format extension: ``` pandoc --to=commonmark-raw_html ... ``` If you intend to publish the document on GitHub, then [GitHub Flavored Markdown](https://github.github.com/gfm) (gfm) is a good choice. ``` pandoc --to=gfm-raw_html ... ``` For pandoc's Markdown, we have to also disable the `link_attributes` extension: ``` pandoc --to=markdown-raw_html-link_attributes ... ``` This last method is the only one that works with older (pre 2.0) pandoc version; all other suggestions here require newer versions. ### Lua filter The filter is straight-forward, it simply removes all attributes from all images ``` function Image (img) img.attr = pandoc.Attr{} return img end ``` To apply the filter, we need to save the above into a file `no-img-attr.lua` and pass that file to pandoc with ``` pandoc --lua-filter=no-img-attr.lua ... ```
null
CC BY-SA 4.0
null
2022-12-09T10:45:46.380
2022-12-09T11:03:00.557
2022-12-09T11:03:00.557
2,425,163
2,425,163
null
74,742,299
2
null
61,883,819
-1
null
The answer is no you can't do that in angular 9, As the component adds the div `<div class="cdk-overlay-container">` right inside the `body` section, and every select drop down renders in this global space, so you can't only select a single drop down, Please upgate to newer angular versions. That's my suggestion
null
CC BY-SA 4.0
null
2022-12-09T11:11:46.740
2022-12-09T11:11:46.740
null
null
5,867,281
null
74,742,477
2
null
74,739,280
1
null
Well it turns out we can use the following code in your .ts file which have values `start` and `end` ``` @Input() xPosition: DatepickerDropdownPositionX; ``` And in the html file we can make changes as ``` <mat-datepicker #any_id [xPosition]= "xPosition"></mat-datepicker>. ```
null
CC BY-SA 4.0
null
2022-12-09T11:27:21.493
2022-12-15T23:11:17.930
2022-12-15T23:11:17.930
4,950,717
16,798,755
null
74,742,485
2
null
74,741,450
1
null
You could save it with `ggsave` and specify the width and height like this: ``` library(ggpubr) #> Loading required package: ggplot2 ds12 <- c("N of individuals", "Eff N after removing Ref", "N of matched sex individuals", "N of failing sex check") ds13 <- c(903, 893, 892, 1) ds14 <- cbind(ds12, ds13) colnames(ds14) <- NULL ggtexttable(ds14, rows = NULL, theme = ttheme("mBlue", base_size = 30)) + theme(plot.margin=grid::unit(c(0,0,0,0), "mm")) ggsave("table.png", width = 16, height = 9) ``` [](https://i.stack.imgur.com/MwCEN.png) [reprex v2.0.2](https://reprex.tidyverse.org) All whitespace is gone.
null
CC BY-SA 4.0
null
2022-12-09T11:27:44.943
2022-12-09T11:27:44.943
null
null
14,282,714
null
74,742,553
2
null
74,742,080
0
null
The compiler (at least that one) just cannot know that it is impossible for to ever get a valid instance. That is simply a limitation. If you had not written line 28 inside the constructor but another method, it would be perfectly valid that might be assigned outside at some point. The error checker is nice, but not an absolute guarantee that there are no runtime errors.
null
CC BY-SA 4.0
null
2022-12-09T11:33:42.880
2022-12-09T11:41:46.280
2022-12-09T11:41:46.280
12,251,738
12,251,738
null
74,743,246
2
null
74,740,618
0
null
You need to use [panda.Series.fillna](https://pandas.pydata.org/docs/reference/api/pandas.Series.fillna.html) before the concatenation. Try one of these two solutions : ``` Transactions["CountryAProvider"] = (Transactions["Country"].fillna("").astype(str) + " " + Transactions["Description"].fillna("").astype(str)).str.strip() ``` Or, ``` Transactions["CountryAProvider"] = Transactions[["col1", "col2"]].fillna("").astype(str).agg(" ".join).str.strip() ```
null
CC BY-SA 4.0
null
2022-12-09T12:35:56.520
2022-12-09T12:35:56.520
null
null
16,120,011
null
74,743,276
2
null
74,739,371
0
null
It looks like the room 'Walkway' is missing the 'Item' key.
null
CC BY-SA 4.0
null
2022-12-09T12:38:53.080
2022-12-09T12:38:53.080
null
null
20,586,552
null
74,743,351
2
null
74,596,693
2
null
Sorry for the long wait. After much trial and error, the following source code allows the program to run with administrative privilege (root) only when a specific button is pressed. Please forgive the somewhat lengthy post. # Main executable Main executable is GUI software that sends D-Bus messages by pressing a button. main.cpp: ``` main.cpp has the same source code as above. ``` mainwindow.cpp: ``` #include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); } MainWindow::~MainWindow() { delete ui; } void MainWindow::onAuthBtnClicked() { QDBusConnection bus = QDBusConnection::systemBus(); if (!bus.isConnected()) { QMessageBox(QMessageBox::Critical, tr("D-Bus error"), tr("Cannot connect to the D-Bus session bus."), QMessageBox::Close, this).exec(); } // this is our Special Action that after allowed will call the helper QDBusMessage message; message = QDBusMessage::createMethodCall("org.qt.policykit.examples", "/", "org.qt.policykit.examples", QLatin1String("write")); // If a method in a helper file has arguments, enter the arguments. //QList<QVariant> ArgsToHelper; //ArgsToHelper << QVariant::fromValue("foo") << QVariant::fromValue("bar"); //message.setArguments(ArgsToHelper); // Send a message to DBus. (Execute the helper file.) QDBusMessage reply = QDBusConnection::systemBus().call(message); // Receive the return value (including arguments) from the helper file. // The methods in the helper file have two arguments, so check them. if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().size() == 2) { // the reply can be anything, here we receive a bool if (reply.arguments().at(0).toInt() == 0) { // If the helper file method completes successfully after successful authentication QMessageBox(QMessageBox::NoIcon, tr("Successed"), tr("The file was written successfully."), QMessageBox::Close, this).exec(); } else if (reply.arguments().at(0).toInt() == -1) { // If the helper file method fails after successful authentication QString strErrMsg = reply.arguments().at(1).toString(); QMessageBox(QMessageBox::Critical, tr("Failed"), tr("Failed to write file.\n") + strErrMsg, QMessageBox::Close, this).exec(); } else { // If the authentication is canceled QMessageBox(QMessageBox::NoIcon, tr("Cancelled"), tr("Writing of the file was canceled."), QMessageBox::Close, this).exec(); } } else if (reply.type() == QDBusMessage::MethodCallMessage) { QMessageBox(QMessageBox::Warning, tr("Time out"), tr("Message did not receive a reply (timeout by message bus)."), QMessageBox::Close, this).exec(); } else if (reply.type() == QDBusMessage::ErrorMessage) { QMessageBox(QMessageBox::Critical, tr("D-Bus error"), tr("Could not send message to D-Bus."), QMessageBox::Close, this).exec(); } return; } ``` mainwindow.h: ``` #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <QtWidgets> #include <QtGui> #include <QDBusContext> #include <QDBusMessage> #include <QDBusConnection> QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } QT_END_NAMESPACE class MainWindow : public QMainWindow { Q_OBJECT public: // Public Functions MainWindow(QWidget *parent = nullptr); ~MainWindow(); private: // Private Variables Ui::MainWindow *ui; private Q_SLOTS: void onAuthBtnClicked(); }; #endif // MAINWINDOW_H ``` # Helper executable Helper executable is software that receives messages from D-Bus and creates files with root privileges. main.cpp: ``` #include <QCoreApplication> #include "SampleHelper.h" int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); SampleHelper sample(argc, argv); return a.exec(); } ``` SampleHelper.cpp: ``` #include <QTimer> #include <QFile> #include <QTextStream> #include <QDateTime> #include "SampleHelper.h" #include "SampleAdaptor.h" #define MINUTE 30000 SampleHelper::SampleHelper(int &argc, char **argv) : QCoreApplication(argc, argv) { (void) new SampleAdaptor(this); // Register the DBus service if (!QDBusConnection::systemBus().registerService("org.qt.policykit.examples")) { QTextStream ErrStream(stderr); ErrStream << QDBusConnection::systemBus().lastError().message(); QTimer::singleShot(0, this, SLOT(quit())); return; } if (!QDBusConnection::systemBus().registerObject("/", this)) { QTextStream ErrStream(stderr); ErrStream << "unable to register service interface to dbus"; QTimer::singleShot(0, this, SLOT(quit())); return; } // Normally you will set a timeout so your application can // free some resources of the poor client machine ;) QTimer::singleShot(MINUTE, this, SLOT(quit())); } SampleHelper::~SampleHelper() { } int SampleHelper::write(QString &strErrMsg) { // message().service() is the service name of the caller // We can check if the caller is authorized to the following action PolkitQt1::Authority::Result result; PolkitQt1::SystemBusNameSubject subject(message().service()); result = PolkitQt1::Authority::instance()->checkAuthorizationSync("org.qt.policykit.examples.write", subject , PolkitQt1::Authority::AllowUserInteraction); if (result == PolkitQt1::Authority::Yes) { // Caller is authorized so we can perform the action return writeValue(strErrMsg); } else { // Caller is not authorized so the action can't be performed return 1; } } int SampleHelper::writeValue(QString &strErrMsg) { // This action must be authorized first. It will set the implicit // authorization for the Shout action by editing the .policy file try { QFileInfo FileInfo("/opt/sample.txt"); QFile File("/opt/sample.txt"); if(!File.open(QIODevice::WriteOnly)) { strErrMsg = "File(" + FileInfo.fileName() + ") Open Error: " + File.errorString(); return -1; } QDateTime current_date_time =QDateTime::currentDateTime(); QString current_date = current_date_time.toString("yyyy.MM.dd hh:mm:ss.zzz ddd"); QTextStream OutStream(&File); OutStream << current_date; File.close(); } catch (QException &err) { strErrMsg = err.what(); } return 0; } ``` SampleHelper.h: ``` #ifndef SAMPLE_HELPER_H #define SAMPLE_HELPER_H #include <QDBusConnection> #include <QDBusContext> #include <QDBusMessage> #include <QCoreApplication> #include <polkit-qt5-1/polkitqt1-authority.h> class SampleHelper : public QCoreApplication, protected QDBusContext { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.qt.policykit.examples") private: int writeValue(QString &strErrMsg); public: SampleHelper(int &argc, char **argv); ~SampleHelper() override; public Q_SLOTS: int write(QString &strErrMsg); }; #endif ``` Execute the `qdbusxml2cpp` command (using the D-Bus interface file at this time) to generate the adapter source code file and header files for the helper. ``` qdbusxml2cpp -a SampleAdaptor -c SampleAdaptor -i SampleHelper.h -l SampleHelper org.qt.policykit.examples.xml ``` In this example, SampleAdaptor.cpp and SampleAdaptor.h are generated. Add this file to the helper executable's project. If this is done automatically : Qt .pro file, the following commands were written. ``` system(qdbusxml2cpp -a SampleAdaptor -c SampleAdaptor -i SampleHelper.h -l SampleHelper org.qt.policykit.examples.xml) ``` CMake file, the following commands were written. ``` qt_add_dbus_adaptor( SampleAdaptor_SRC org.qt.policykit.examples.xml SampleHelper.h SampleHelper SampleAdaptor SampleAdaptor ) ``` # Create Polkit policy file /usr/share/polkit-1/actions/org.qt.policykit.examples.policy: ``` <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE policyconfig PUBLIC '-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN' 'http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd'> <policyconfig> <vendor>presire</vendor> <vendor_url></vendor_url> <action id="org.qt.policykit.examples.write"> <description>Write</description> <message>Prevents PolKit-Qt-1 example from writing</message> <defaults> <allow_inactive>no</allow_inactive> <allow_active>auth_admin</allow_active> </defaults> </action> </policyconfig> ``` # Create D-Bus configuration files /usr/share/dbus-1/interfaces/org.qt.policykit.examples.xml: ``` <!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> <node> <interface name="org.qt.policykit.examples"> <method name="write" > <!-- OUT: whether the user gained the authorization --> <arg direction="out" type="i" name="code" /> <arg direction="out" type="s" name="msg" /> </method> </interface> </node> ``` /usr/share/dbus-1/system-services/org.qt.policykit.examples.service: ``` [D-BUS Service] Name=org.qt.policykit.examples Exec=/<Path>/<to>/<Helper executable file> User=root ``` /etc/dbus-1/system-local.conf: or /etc/dbus-1/system.d/org.qt.policykit.examples.conf: or /usr/share/dbus-1/system.d/org.qt.policykit.examples.conf: ``` <!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> <busconfig> <!-- This configuration file specifies the required security policies for the PolicyKit examples to work. --> <!-- Only user root can own the PackageKit service --> <policy user="root"> <allow own="org.qt.policykit.examples"/> </policy> <!-- Allow anyone to call into the service - we'll reject callers using PolicyKit --> <policy context="default"> <allow send_destination="org.qt.policykit.examples"/> </policy> </busconfig> ```
null
CC BY-SA 4.0
null
2022-12-09T12:44:48.647
2022-12-12T07:58:12.567
2022-12-12T07:58:12.567
20,619,892
20,619,892
null
74,743,579
2
null
74,743,506
0
null
You can locate the parent `div` block of the entire comment by the text content and then go to upvote button inside it as following: ``` "//div[contains(.,'The user name completes this')][contains(@class,'Comment')]//button[@aria-label='upvote']" ``` I'm not sure you really need that `i` icon element so I gave the locator of the upvote button. In case you really need the `i` element inside it - it can be located similarly as following ``` "//div[contains(.,'The user name completes this')][contains(@class,'Comment')]//i[contains(@class,'upvote')]" ```
null
CC BY-SA 4.0
null
2022-12-09T13:07:56.957
2022-12-09T13:07:56.957
null
null
3,485,434
null
74,743,592
2
null
74,740,819
0
null
If you want to change the data type of a column all you have to do is to use the code below: ``` df['name of the column'] = df['name of the column'].astype('float64') ``` However, the problem you are facing now is something else There are values in the columns that are strings such as '-' which you have to replace with missing values and later fill them. in order to do this, you can use the code below: ``` df['name of the column'] = df['name of the column'].replace('-',np.nan) ``` To avoid this sort of issue you can use df.describe() or df.info() to see the type of each column. In this case, if a column is all numbers but it says it is an object means there are values that you have to check such as this one.
null
CC BY-SA 4.0
null
2022-12-09T13:08:41.857
2022-12-09T13:08:41.857
null
null
17,682,471
null
74,743,668
2
null
74,743,506
0
null
Like this: ``` //div[contains(.,'The user name completes this')]//button[@data-click-id='upvote'] ```
null
CC BY-SA 4.0
null
2022-12-09T13:15:56.383
2022-12-09T14:16:15.250
2022-12-09T14:16:15.250
465,183
465,183
null
74,743,875
2
null
74,743,829
-1
null
its because you're in one folder trying to get to another folder without going a step back first. use ../ in the qry where you choose your folder.
null
CC BY-SA 4.0
null
2022-12-09T13:36:00.017
2022-12-09T13:36:00.017
null
null
13,724,628
null
74,743,918
2
null
74,743,887
0
null
That is not how routes work, please [read the docs](https://kit.svelte.dev/docs/routing). Every route has its own folder and its own `+page`, so you need `src/routes/next/+page.svelte` for the `/next` route.
null
CC BY-SA 4.0
null
2022-12-09T13:40:20.590
2022-12-09T13:40:20.590
null
null
546,730
null
74,744,139
2
null
64,715,502
0
null
To be able to use in PyCharm, you must have installed on your system. Otherwise, PyCharm will tell you that it could not find '/bin/python'. In Ubuntu, installing is as simple as `sudo apt install python3-virtualenv`
null
CC BY-SA 4.0
null
2022-12-09T14:00:10.320
2022-12-09T14:00:10.320
null
null
3,625,770
null
74,744,301
2
null
43,772,355
0
null
I found this post based on the problem, but the solutions did not work. For me, the AJAX call would NOT find the controller. The call previously worked and one day it just stopped working. I modified the controller to add new methods and renamed the AJAX call and still nothing. The ONLY solution that actually worked for me was to create a new controller, copy all of the methods over and rename the AJAX call. Somethin went awry in visual studio and the compiled version, but I do not know what. I just wanted to post this situation in case it helps someone avoid the hours it took me to debug this issue. Happy Coding! The referenced video is exactly what was happening to me: [https://www.youtube.com/watch?v=we1_aL1KYiE](https://www.youtube.com/watch?v=we1_aL1KYiE)
null
CC BY-SA 4.0
null
2022-12-09T14:14:13.050
2022-12-09T14:14:13.050
null
null
3,298,156
null
74,744,374
2
null
74,744,189
1
null
Find the commit ID of the last blue commit called `solve make_1`. Have you tried `git reset --head thecommitid`. Then do git push --force. If needed delete and recreate the repo and push just the blue branch.
null
CC BY-SA 4.0
null
2022-12-09T14:19:26.530
2022-12-09T14:19:26.530
null
null
736,079
null
74,744,370
2
null
74,740,528
0
null
You will need to build an interface using HTML or the XML-based prompt language. See these examples: [Build an HTML Input Form](https://go.documentation.sas.com/doc/en/pgmsascdc/v_033/jobexecug/n1ouf0rx7w615kn0z1thhmj4vcnj.htm#n1m61mjl56dl47n142co8gk6nhpo) and [Prompts](https://go.documentation.sas.com/doc/en/pgmsascdc/v_033/jobexecug/n1ouf0rx7w615kn0z1thhmj4vcnj.htm#p16ohya5s1urz7n105qcuvj1ihra). You can also read more about how to do this in the paper [Modernizing Scenario Analysis with SAS Viya and Visual Analytics](https://communities.sas.com/t5/SAS-Global-Forum-Proceedings/Modernizing-Scenario-Analysis-With-SAS-Viya-and-SAS-Visual/ta-p/726348). For example: ``` <head> <style type="text/css"> @font-face { font-family: AvenirNext; src: url("/SASJobExecution/images/AvenirNextforSAS.woff") format("woff"); } body { font-family: AvenirNext, Helvetica, Arial, sans-serif; text-rendering: optimizeLegibility; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); text-align: center } .wrapper { padding-bottom: 10px; } </style> </head> <body> <form action="/SASJobExecution/" enctype="multipart/form-data" method="post"> <input type="hidden" name="_program" value="$PROGRAM$"/> <input type="hidden" name="_action" value="execute,wait"/> <input type="hidden" name="_csrf" value="$CSRF$"/> <p><b>Enter a Pretzel Scenario</b></p> <div class="wrapper"> <label>Price (USD) <input type="text" name="price" placeholder="2.49"/></label> </div> <div class="wrapper"> <label>Cost (USD) <input type="text" name="cost" placeholder="0.25"/></label> </div> <input type="submit" id="submit" value="Submit"/> </form> </body> ``` This creates an input form that looks like this: [](https://i.stack.imgur.com/V7Btp.png)
null
CC BY-SA 4.0
null
2022-12-09T14:19:23.490
2022-12-09T14:19:23.490
null
null
5,342,700
null
74,744,536
2
null
5,732,836
0
null
One could try this, by using the Unicode [Enclosed Alphanumerics, Circled numbers](https://www.unicode.org/charts/nameslist/n_2460.html). They are limited up to the number 20 however. css: ``` /* circled numbers */ .circled li { list-style: none; } .circled li:nth-child(1)::before { content: ' ① '; } .circled li:nth-child(2)::before { content: ' ② '; } ... ``` html: ``` <ol class="circled"> <li>list item 1</li> <li>list item 2</li> ... ```
null
CC BY-SA 4.0
null
2022-12-09T14:34:04.877
2022-12-09T14:34:04.877
null
null
906,489
null
74,744,593
2
null
74,741,726
-1
null
Hi I finally found how to do it here is the code if someone is interested: ``` - ( nonnull UITableViewCell *)tableView:(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath { static NSString *MyIdentifier = @"customCell"; customCellSingersAlbumVC *cell = (customCellSingersAlbumVC*)[tableView dequeueReusableCellWithIdentifier:MyIdentifier]; if (cell == nil) { [tableView registerNib:[UINib nibWithNibName:@"customCellSingersAlbumView" bundle:nil] forCellReuseIdentifier:MyIdentifier]; } cell = (customCellSingersAlbumVC *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier]; // Create a new UIImage object UIImage *image = [UIImage imageNamed:@"pink.png"]; // Create a new image view UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; // Set the image view's frame to the desired size imageView.frame = CGRectMake(95, 10, 30, 30); // Create a new label object UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 20)]; // Set the label's text label.text = @" 6"; // imageView.tintColor = UIColor.blueColor; imageView.layer.cornerRadius = imageView.frame.size.width /2; imageView.layer.masksToBounds = YES; imageView.layer.borderWidth = 0; // Add the image view to your table view cell's content view [imageView addSubview:label]; [cell.contentView addSubview:imageView]; return cell; } ```
null
CC BY-SA 4.0
null
2022-12-09T14:39:06.970
2022-12-09T14:39:06.970
null
null
20,289,881
null
74,744,756
2
null
47,477,905
-1
null
For later reference, if you need a WYSIWYG label editor for TSC printers look for and ignore Bartender Designer. TSC Standalone Creator: is a barebone simple designer and can directly output labels to TSPL2.
null
CC BY-SA 4.0
null
2022-12-09T14:54:48.190
2022-12-09T14:54:48.190
null
null
1,809,169
null
74,744,770
2
null
74,744,735
2
null
Run `Thread.Sleep(60_000)` on the UI thread. That will effectively hang your application for a minute.
null
CC BY-SA 4.0
null
2022-12-09T14:56:19.397
2022-12-09T15:06:59.943
2022-12-09T15:06:59.943
1,043,380
12,342,238
null
74,745,094
2
null
51,424,578
0
null
In my case the video was playing fine on my localhost but was showing unavailable when played from the remote server. Turns out it was happening because of this HTTP header: `Referrer-Policy: no-referrer`. `Referrer-Policy: no-referrer` Almost took me 15 minutes to solve it!
null
CC BY-SA 4.0
null
2022-12-09T15:26:02.603
2022-12-09T15:26:02.603
null
null
12,045,813
null
74,745,216
2
null
31,506,426
0
null
What you are trying to do is charge a customer once you have created a payment method for her. However, you cannot use the `Charge` endpoint to do that if you have not set any subscriptions because this method is made for recurring payments linked to subscriptions. In order to be able to charge your client, set a subscription. This will activate the card. You'll then be able to debit the card.
null
CC BY-SA 4.0
null
2022-12-09T15:36:00.407
2022-12-17T21:44:13.737
2022-12-17T21:44:13.737
652,779
16,739,578
null
74,745,563
2
null
16,113,313
0
null
This question is almost 10 years old, but just in case someone is still looking for a solution (like I just did ;) ): I achieved a pretty close behaviour of your description using only a `Button` and a `Menu` using this approach: [http://eclipseo.blogspot.com/2012/07/show-context-menu-programmatically.html](http://eclipseo.blogspot.com/2012/07/show-context-menu-programmatically.html) ``` Button button = new Button(parent, SWT.PUSH); button.setText("Animals"); Menu menu = new Menu(button); MenuItem item = new MenuItem(menu, SWT.PUSH); item.setText("hare"); menu.addListener(SWT.Show, new Listener() { @Override public void handleEvent(Event event) { menu.setVisible(true); } }); button.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { menu.notifyListeners(SWT.Show, null); } }); ``` The result is that the menu is shown when you (left) click on the button. Bonus: to achieve the expand icon at the end, you can add a unicode character for a down triangle in the button text like so: ``` button.setText("Animals \u2BC6"); ``` HTH, Ben
null
CC BY-SA 4.0
null
2022-12-09T16:07:53.270
2022-12-09T16:07:53.270
null
null
1,694,840
null
74,745,683
2
null
74,740,780
0
null
I don't know if this is safe way but I separated them into two different sprites and combining them again in a custom sprite group. ``` class Tree(pygame.sprite.Group): def __init__(self, pos): super(Tree, self).__init__() self.tree_top = TreeTop(pos) self.tree_trunk = TreeTrunk((pos[0], pos[1] + (48 * 3))) self.add(self.tree_top) self.add(self.tree_trunk) class TreeTop(pygame.sprite.Sprite): def __init__(self, pos): super(TreeTop, self).__init__() self.image = pygame.Surface((48 * 3, 48 * 3), pygame.SRCALPHA) self.image_path = "objects.png" self.tree_top = pygame.Surface((16 * 3, 16 * 3), pygame.SRCALPHA) self.sprite_sheet = pygame.image.load(self.image_path).convert_alpha() self.tree_top.blit(self.sprite_sheet, (0, 0), (0, 80, 16 * 3, 16 * 3)) self.tree_top = pygame.transform.scale(self.tree_top, (48 * 3, 48 * 3)) self.image.blit(self.tree_top, (0, 0)) self.rect = self.image.get_rect() self.rect.topleft = pos self.hitbox = self.rect.copy() class TreeTrunk(pygame.sprite.Sprite): def __init__(self, pos): super(TreeTrunk, self).__init__() self.image = pygame.Surface((48 * 3, 48), pygame.SRCALPHA) self.image_path = "objects.png" self.sprite_sheet = pygame.image.load(self.image_path).convert_alpha() self.tree_trunk = pygame.Surface((48 * 3, 48), pygame.SRCALPHA) self.tree_trunk.blit(self.sprite_sheet, (0, 0), (0, 128, 16 * 3, 16)) self.tree_trunk = pygame.transform.scale(self.tree_trunk, (48 * 3 * 3, 48 * 3)) self.image.blit(self.tree_trunk, (0, 0)) self.rect = self.image.get_rect() self.rect.topleft = pos self.hitbox = self.rect.copy() ```
null
CC BY-SA 4.0
null
2022-12-09T16:17:50.927
2022-12-09T16:17:50.927
null
null
20,731,742
null
74,745,700
2
null
74,745,389
0
null
Check first if you marked the keyframes right if so check this tutorial on how to use cameras and keyframes in U5.1 [https://youtu.be/6fRc6PXw2Zs](https://youtu.be/6fRc6PXw2Zs) Note: if the problem still appers it could be a U5.1 Bug since its shortly released.
null
CC BY-SA 4.0
null
2022-12-09T16:20:02.097
2022-12-09T16:20:02.097
null
null
20,735,309
null
74,745,950
2
null
74,744,238
0
null
I solved it. The calculation for relative Coords: If the first bit of the concatinated bytes (of lat or lon) is 1 (negative value): ``` byteValueRel = bytevalue - 2^16 ``` In any case divide it by `10^5`: ``` byteValueRel = bytevalue/(10^5) ``` The resulting relative coordinate is the sum of the LRP value and the calculated relative value: ``` previousLrpValue + byteValueRel ```
null
CC BY-SA 4.0
null
2022-12-09T16:43:39.700
2022-12-11T11:27:45.513
2022-12-11T11:27:45.513
20,734,061
20,734,061
null
74,746,258
2
null
74,741,820
0
null
Settings that give the possibility to adjust xAxis are [xAxis.min](https://api.highcharts.com/highcharts/xAxis.min) and [xAxis.max](https://api.highcharts.com/highcharts/xAxis.max) then they will stick to the second axis and the extremes will not change depending on the series. ``` xAxis: [{ title: { text: 'Data' }, }, { title: { text: 'Histogram' }, alignTicks: false, opposite: true, min: 0, max: 11 }], ``` Demo: [https://jsfiddle.net/BlackLabel/hymjs0wL/](https://jsfiddle.net/BlackLabel/hymjs0wL/)
null
CC BY-SA 4.0
null
2022-12-09T17:11:17.017
2022-12-09T17:11:17.017
null
null
12,171,673
null
74,746,313
2
null
73,341,777
0
null
If you already using `latlong: ^0.6.1` or higher then you need to change your import from: ``` import "package:latlong/latlong.dart" as latLng; ``` to: ``` import 'package:latlong2/latlong.dart' as latLng; ``` and it will be fine.
null
CC BY-SA 4.0
null
2022-12-09T17:16:48.260
2022-12-09T17:16:48.260
null
null
15,285,664
null
74,746,414
2
null
74,744,189
0
null
You can squash the commit for double the commits to a single... or in case you want to specifically remove by commit id, look for the below another StackOverflow answer that might help you [Link to the thread](https://stackoverflow.com/a/21338314/13992417) just don't want to give the same, so shared the same
null
CC BY-SA 4.0
null
2022-12-09T17:27:05.930
2022-12-10T11:48:08.813
2022-12-10T11:48:08.813
13,992,417
13,992,417
null
74,746,493
2
null
74,731,471
0
null
Please check your code for typos: The correct namespace value is (not "w3.org/2000/svg") `document.createElementNS('http://www.w3.org/2000/svg','svg')` ``` createSvg(wrap) function createSvg(el) { const svgElements = ['up2', 'down3']; const ns ="http://www.w3.org/2000/svg"; svgElements.forEach(e => { const newSvg = document.createElementNS(ns, 'svg'); newSvg.classList.add('country-list__svg'); el.appendChild(newSvg); newSvg.insertAdjacentHTML( 'afterbegin', `<use width="18" height="18" xlink:href="#${e}"></use>` ); }); } ``` ``` <div id="wrap"></div> <!-- hidden svg asset --> <svg class="icon" style="width:0; height:0; position:absolute;" viewBox="0 0 34 48"> <path id="up2" d="M33.16,28.12h-5.2v13h-3.44v-16.72l-7.72-8.72l-7.72,8.72v16.72h-3.44v-13h-5.24l16.4-17.4Z"></path> </svg> ``` `<use>` ``` function createSvg(el) { const svgElements = ['up2', 'down3']; const ns ="http://www.w3.org/2000/svg"; svgElements.forEach(e => { const newSvg = document.createElementNS(ns, 'svg'); const newUse = document.createElementNS(ns, 'use'); newSvg.setAttribute('viewBox', '0 0 18 18'); newUse.setAttribute('width', 18); newUse.setAttribute('height', 18); newUse.setAttribute('href', `#${e}`); newSvg.appendChild(newUse); newSvg.classList.add('country-list__svg'); el.appendChild(newSvg); }); } ``` You might not need the deprecated `xlink:href` attribute – unless you need a backwards compatibility for very ancient browsers or a standalone svg that could be edited in graphic applications. `href` is supported by all modern browsers. However, `xlink:href` is still perfectly supported. If you still can't see any elements: check your Make sure your asset svg contains an element with the IDs your referenced. (e.g. "up2" , "down3")
null
CC BY-SA 4.0
null
2022-12-09T17:35:15.823
2022-12-09T17:35:15.823
null
null
15,015,675
null
74,746,575
2
null
74,746,284
0
null
Solved, I was just dumb I forgot that I tested if the list was empty before, if it is, I return something else.
null
CC BY-SA 4.0
null
2022-12-09T17:43:51.530
2022-12-09T17:43:51.530
null
null
16,600,459
null
74,746,945
2
null
74,746,755
1
null
First select all flats ``` flats = soup.find_all("div", {"class" : "ad-preview ad-preview--has-desc"} ``` Then select the href element from each flat ``` flatlinks = [flat["data-lnk-href"] for flat in flats] #['/alquilar/casa_pareada-ames_san_tome-29223728328_106900/', '/alquilar/piso-sada_centro_urbano-28401214803_101800/', '/alquilar/apartamento-concheiros_fontinas15703-29211123764_101800/', '/alquilar/piso-ensanche_sar15701-28400185769_101800/', '/alquilar/piso-ensanche_sar-28365533333_100500/', '/alquilar/casa-urbanizacion_costa_mino_golf-28397541675_990666/', '/alquilar/piso-ensanche15004-25921567538_100500/', '/alquilar/piso-cidade_vella_atochas_pescaderia15001-1672697006_100500/', '/alquilar/casa_pareada-campus_norte_san_caetano15704-27590604144_100500/', '/alquilar/piso-loios-29184165540_990666/', '/alquilar/piso-porta_nova15404-16734525644_106000/', '/alquilar/piso-ferrol_esteiro15403-77580144133_106000/', '/alquilar/duplex-perillo15172-29222505627_108900/', '/alquilar/piso-porto_do_son_centro_urbano-29238844842_106000/', '/alquilar/atico-ribeira_santa_uxia-25888982455_108500/', '/alquilar/piso-catro_caminos_a_gaiteira15009-30050053236_100500/', '/alquilar/piso-ensanche15004-29224222647_100500/', '/alquilar/piso-naron_a_gandara-30017787801_524615/', '/alquilar/piso-os_castros_castrillon_monelos-25860503904_524936/', '/alquilar/apartamento-catro_caminos_a_gaiteira15006-13337577273_100500/', '/alquilar/piso-cidade_vella_atochas_pescaderia-26676409070_524206/', '/alquilar/piso-ensanche15004-28405594045_109300/', '/alquilar/piso-naron_a_gandara15570-23389515305_106900/', '/alquilar/piso-cidade_vella_atochas_pescaderia15003-27564579054_101800/', '/alquilar/atico-escarabote-28430411775_524515/', '/alquilar/piso-cidade_vella_atochas_pescaderia15003-26669645871_100500/', '/alquilar/piso-ensanche_sar15701-26696435275_101800/', '/alquilar/piso-cidade_vella_atochas_pescaderia15001-30028901665_100500/', '/alquilar/piso-caranza-29226084718_106900/'] ```
null
CC BY-SA 4.0
null
2022-12-09T18:21:14.497
2022-12-09T18:21:14.497
null
null
14,877,544
null
74,747,215
2
null
74,741,281
1
null
It works fine with me (macOS 13.0, Xcode 14.1). I get this ... Could it be some password utility interfering? [](https://i.stack.imgur.com/4X7MV.png)
null
CC BY-SA 4.0
null
2022-12-09T18:52:56.297
2022-12-09T18:52:56.297
null
null
17,896,776
null
74,747,290
2
null
74,747,184
1
null
If you don't have NEXTAUTH_URL set in your .env file you will get this error. However vercel will work as next-auth automatically sets it when deployed to vercel. [https://next-auth.js.org/configuration/options#nextauth_url](https://next-auth.js.org/configuration/options#nextauth_url) If you do have NEXTAUTH_URL set then my best guess is the url is wrong in some way. Maybe missing http://?
null
CC BY-SA 4.0
null
2022-12-09T19:00:32.500
2022-12-09T19:00:32.500
null
null
17,666,744
null
74,747,711
2
null
74,747,453
0
null
library {forcats} has a convenient `fct_reorder` function: ``` library(forcats) sample_df |> mutate(Test = fct_reorder(Test, Score, median)) ## |> rest of pipeline ```
null
CC BY-SA 4.0
null
2022-12-09T19:51:35.450
2022-12-09T19:51:35.450
null
null
20,513,099
null
74,748,268
2
null
74,748,213
0
null
There are a few issues: 1. your function is within another function 2. you assign values to variables that you have never declared before. A variable needs to be declared with var/let and can only be assigned afterward or at the same instance: Issues to fix the game: 1. You declare a variable within the function of hole distance with 350. Every time you click the button you reset the variable to 350 and roll the dice on that 350. You need to move the variable outside of the function and subtract the randomize shooting distance from the hole distance: ``` let holeDistance = 350; function start() { let introText = "It is a beautiful sunny day on Golf Island. The cobalt waters are great. There is no wind. You stand at the tee and get ready to strike. There's only one hole to go.<br>" document.getElementById("textarea").innerHTML += introText; } function swing() { let swingValue = Math.floor(Math.random() * 100); holeDistance = holeDistance - swingValue; return document.getElementById("textarea").innerHTML += `Hole position: ${holeDistance}`; } ``` ``` <button id="start" onclick="start()">Start game</button> <div id="textarea"> <button onclick='swing()'>Swing</button> </div> ```
null
CC BY-SA 4.0
null
2022-12-09T20:58:02.933
2022-12-09T21:07:26.167
2022-12-09T21:07:26.167
14,072,420
14,072,420
null
74,748,494
2
null
74,677,937
0
null
I believe the issue may be that the broker is down. Your code looks like a modified version of the 'ESP8266_cloud.ino' code found in the ArduionIDE examples. I have an ESP8266 D1 and ran that example code with my own API plugin from aREST.io and get the same error message as you. Running example code 'mqtt_esp8266.ino' I see interaction with my board to the broker, so I don't have reason to believe there's a general hardware or connectivity issue outside of the aREST broker. Digging into aREST.h, the MQTT broker/server is 'mqtt.arest.io' Checking on [https://downforeveryoneorjustme.com/mqtt.arest.io](https://downforeveryoneorjustme.com/mqtt.arest.io), they say it's down. Sorry that's not more helpful :/ I tried contacting the developer/the aREST Instagram page and have yet to hear back. Will keep you posted - please update your findings as well!
null
CC BY-SA 4.0
null
2022-12-09T21:32:09.473
2022-12-09T21:32:09.473
null
null
20,602,547
null
74,748,784
2
null
74,748,161
0
null
From the log output it looks like your `items` is an that contains an `items` child array, so you need to unwrap that before passing it to Firestore: ``` await this.firestore.collection("users").doc(uid).update({ // wishlistedItems: admin.firestore.FieldValue.arrayUnion(items.items), }); ```
null
CC BY-SA 4.0
null
2022-12-09T22:19:21.883
2022-12-09T22:19:21.883
null
null
209,103
null
74,749,006
2
null
74,748,090
1
null
I would probably do this directly in ggplot. First we reshape your data for plotting: ``` library(tidyverse) library(geomtextpath) library(colorspace) plot_df <- df %>% mutate(bar_pos = as.numeric(factor(cd8_percent_bins))) %>% group_by(stroma_bins) %>% mutate(max_bar = max(bar_pos)) %>% ungroup() %>% nest(data = -c(stroma_bins, max_bar)) %>% mutate(max_bar = cumsum(lag(max_bar, default = 0))) %>% unnest(cols = everything()) %>% mutate(bar_pos = max_bar + bar_pos + as.numeric(factor(stroma_bins))) ``` And the plotting code could be something like: ``` ggplot(plot_df, aes(bar_pos, Freq, fill = stroma_bins, color = stroma_bins)) + geom_col(alpha = 0.6, color = NA) + geom_rect(data = . %>% group_by(stroma_bins) %>% summarize(xmin = min(bar_pos) - 1, ymin = -0.5 * max(df$Freq), xmax = max(bar_pos) + 1, ymax = -5, bar_pos = 1, Freq = 1), aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax, fill = after_scale(darken(color, 0.25)))) + geom_textpath(data = . %>% group_by(stroma_bins) %>% summarize(Freq = -0.25 * max(df$Freq) - 2.5, bar_pos = mean(bar_pos)), angle = 90, aes(label = sub("-", "\u2013", sub(" Stroma", "", stroma_bins)), group = stroma_bins), color = "white") + geom_textpath(aes(y = -2.5, label = sub("-", "\u2013", sub("% CD8\\+ Cells", "", cd8_percent_bins)), group = seq_along(cd8_percent_bins)), size = 2, color = "black") + annotate("text", x = 1, y = -max(df$Freq), label = "Stroma bin", size = 10, color = "gray30") + scale_fill_discrete(guide = "none") + scale_color_discrete(guide = "none") + scale_y_continuous(limits = c(-max(df$Freq), max(df$Freq) + 1)) + scale_x_continuous(expand = c(0, 0), lim = c(1, nrow(df) + length(unique(df$stroma_bins)) + 2))+ coord_polar() + theme_void() + theme(plot.margin = margin(-100, -100, -100, -100)) ``` [](https://i.stack.imgur.com/7fgyD.png)
null
CC BY-SA 4.0
null
2022-12-09T22:55:31.027
2022-12-10T14:04:20.243
2022-12-10T14:04:20.243
12,500,315
12,500,315
null
74,749,062
2
null
32,616,525
1
null
I had the same issue but I fixed mine with javascript since the CSS solution does not move the dropdown options when the parent has been scrolled horizontally. Here is how I did it using JavaScript: ``` <style> .outer-container { position: relative; } .container { display: flex; align-items: center; gap: 20px; width: 200px; background-color: gainsboro; height: 70px; padding: 10px 20px; overflow-x: scroll; margin: 0 auto; margin-top: 300px; } .content { cursor: pointer; display: block; } .content::after { content '&darr' display: block; } .content ul { position: absolute; background-color: black; color: white; } </style> <div class='outer-container'> <div class='container' id='scrollable'> <span>Home</span> <span>About</span> <span class='content' id='content'> Dropdown <ul id='dropdown'> <li>option1</li> <li>option2</li> <li>option3</li> <li>option4</li> </ul> </span> <span>Contact</span> </div> </div> <script> const scrollable = document.getElementById("scrollable") const content = document.getElementById("content") const dropdown = document.getElementById("dropdown") scrollable.addEventListener( 'scroll', () => { const contentRect = content.getBoundingClientRect() dropdown.style.left = contentRect.left + 'px' } ) </script> ``` You can check it out on [Codepen](https://codepen.io/tammibriggs/pen/gOKyWgG)
null
CC BY-SA 4.0
null
2022-12-09T23:07:59.450
2022-12-17T09:52:42.957
2022-12-17T09:52:42.957
15,485,047
15,485,047
null
74,749,226
2
null
74,748,751
0
null
That `selectAppointmentsResult` method you have there is created by `.select()`, which is equivalent to `.select(undefined)` - and that will always return the cache entry to `useGetAppointmentsQuery()` (== `useGetAppointmentsQuery(undefined)`. But you call `useGetAppointmentsQuery(id)` - so you would have to create a selector with `.select(id)`. In most cases, this is highly impractical. Generally, you should probably not create a selector for use with `useAppSelector`, but you should be using the `useGetAppointmentsQuery(id)` hook in all components that need that kind of state - and if you really just want to subscribe to a part of the return value, use the `selectFromResult` option.
null
CC BY-SA 4.0
null
2022-12-09T23:37:43.267
2022-12-10T12:50:45.327
2022-12-10T12:50:45.327
2,075,944
2,075,944
null
74,749,245
2
null
74,749,196
-1
null
try actually importing also ReactDOM which you are using to render you App component, so add ``` import {createRoot, ReactDOM} from 'react-dom/client'; ``` to the top of your App.tsx
null
CC BY-SA 4.0
null
2022-12-09T23:40:31.613
2022-12-09T23:40:31.613
null
null
20,184,923
null
74,749,530
2
null
74,749,459
0
null
Functions in C can use either global variables (but please ), local variables, or their arguments. A local variable in one function cannot be accessed in another. E.g. ``` void foo(void); int main(void) { int bar = 42; foo(); return 0; } void foo(void) { printf("%d\n", bar); } ``` That will not work. However, we can pass `bar` as an argument to `foo`. ``` void foo(int bar); int main(void) { int bar = 42; foo(bar); return 0; } void foo(int bar) { printf("%d\n", bar); } ``` The following will work, but you use it. ``` int bar; void foo(void); int main(void) { bar = 42; foo(); return 0; } void foo(void) { printf("%d\n", bar); } ```
null
CC BY-SA 4.0
null
2022-12-10T00:45:35.113
2022-12-10T00:45:35.113
null
null
15,261,315
null
74,749,710
2
null
74,748,276
4
null
This is a known bug in MSVC. [NRVO bug in MSVC](https://stackoverflow.com/questions/74422765/nrvo-bug-in-debugger-in-msvc-17-4) Solution is to add `/Zc:nrvo-` to the c++ compiler's additional options at Properties->Debug->C/C++->CommandLine ``` // recent versions of MSVC2022 #include <vector> using std::vector; auto foo() { std::vector<int> bar = { 1, 2, 3, 4, 5 }; return bar; // in debug mode, bar has size 0 unless /Fc:nrvo- flag is added } int main() { auto x = foo(); // x is shown properly } ```
null
CC BY-SA 4.0
null
2022-12-10T01:29:43.873
2022-12-10T02:52:05.523
2022-12-10T02:52:05.523
5,282,154
5,282,154
null
74,749,743
2
null
61,450,186
0
null
You can react to the selected item by using `onChange` on your selection variable. You can set the selection manually by simply setting the variable. This will also trigger `onChange`. Here's some example code that will run directly in Playgrounds: ``` import SwiftUI import PlaygroundSupport struct OtherView: View { @State var list: [String] = ["a", "b", "c"] @State var selection: String? var body: some View { NavigationView { VStack { List(list, id: \.self, selection: $selection) { item in Text(item) } .onChange(of: selection) {s in // React to changes here print(s) } Button("Select b") { // Example of setting selection programmatically selection = "b" } } } } } let view = OtherView() PlaygroundPage.current.setLiveView(view) ```
null
CC BY-SA 4.0
null
2022-12-10T01:37:03.230
2022-12-10T01:37:03.230
null
null
1,523,476
null
74,750,283
2
null
74,732,424
0
null
I don't know if you filed the github issue [selectNextCodeAction custom keybinding not working](https://github.com/microsoft/vscode/issues/168591) and [revert to old context key ID for code action widget](https://github.com/microsoft/vscode/pull/168622/commits/9bc23152c2e9b14ed9c3fc2b0eee55cd1edca906), but it has been resolved by reverting to the previous context key `codeActionMenuVisible` from the new `actionWidgetVisible` - which I assume was introduced because there are now code actions/quick fixes in the terminal (but should have at least been called out in the Release Notes). The fix is due to be released as part of the Recovery Build v.1.74.1 which may be out soon. [As a side note, this key started life as `CodeActionMenuVisible` (note the capitalization) before being switched to the typical camel case version later.]
null
CC BY-SA 4.0
null
2022-12-10T04:03:37.737
2022-12-10T04:03:37.737
null
null
836,330
null
74,750,346
2
null
74,750,306
0
null
Try clearing your browser cache and cookies. or use git cli to clone the repo to local machine
null
CC BY-SA 4.0
null
2022-12-10T04:19:51.777
2022-12-10T04:19:51.777
null
null
18,450,558
null
74,750,506
2
null
74,750,379
0
null
You should try this : ``` //@version=5 indicator("Yesterday Close", overlay=true) indexHighTF = barstate.isrealtime ? 1 : 0 indexCurrTF = barstate.isrealtime ? 0 : 1 yesterday_close = request.security(syminfo.tickerid, "1D", close[indexHighTF])[indexCurrTF] daily_line = line.new(bar_index, yesterday_close , bar_index-1, yesterday_close, extend= extend.both, color=color.yellow) line.delete(daily_line[1]) ``` It is based on the pinescript manual , see here : [https://www.tradingview.com/pine-script-reference/v5/#fun_request{dot}security](https://www.tradingview.com/pine-script-reference/v5/#fun_request%7Bdot%7Dsecurity)
null
CC BY-SA 4.0
null
2022-12-10T05:02:11.757
2022-12-10T05:02:11.757
null
null
7,206,632
null
74,750,765
2
null
74,749,196
0
null
I fixed it. I was missing tsconfig.json in root. Neat. ``` { "compilerOptions": { "target": "es5", "module": "es2015", "jsx": "react", "moduleResolution": "node", "lib": [ "dom", "es5", "es6" ], "allowSyntheticDefaultImports": true }, "include": [ "src/**/*" ] } ```
null
CC BY-SA 4.0
null
2022-12-10T06:04:30.583
2022-12-10T06:48:14.963
2022-12-10T06:48:14.963
20,737,585
20,737,585
null
74,750,773
2
null
74,750,469
0
null
Unfortunately I expect that this will heavily depend on the particular console you're using. Some less Unicode-friendly consoles will treat all characters as the same size (possibly cutting off the right half of larger characters), and some consoles will cause larger characters to push the rest of the line to the right (which is what I see in the linked image). The most reasonable consoles I've observed have a set of characters considered "double-wide" and reserve two monospace columns for those characters instead of one, so the rest of the line still fits into the grid. That said, you may want to experiment with different console programs. Can I assume you are on Windows? In that case, you might want to give [Windows Terminal](https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701?hl=en-us&gl=us) a try. If that doesn't work, there are other console programs available, such as msys's [Mintty](https://mintty.github.io/), or [ConEmu](https://conemu.github.io/).
null
CC BY-SA 4.0
null
2022-12-10T06:06:12.490
2022-12-10T06:06:12.490
null
null
20,738,382
null
74,750,946
2
null
74,749,196
1
null
###### Hi @doublespoiler, About your error. I think it's because of your file entry point. > index.js is the traditional and actual entry point for all node apps. Here in React it just has code of what to render and where to render. App.js on the other hand has the root component of the react app because every view and component are handled with hierarchy in React, where is the top most component in the hierarchy. Here is a simple example:- [codesandbox](https://codesandbox.io/s/nervous-elgamal-60hyc6?file=/src/App.js). So, add index.js file in your root folder and render data into that file.
null
CC BY-SA 4.0
null
2022-12-10T06:48:38.593
2022-12-10T06:48:38.593
null
null
16,517,581
null
74,751,046
2
null
74,741,449
0
null
finally figure out the reason by wget -d: delete the apostrophe around the header and it works fine for me. [enter image description here](https://i.stack.imgur.com/ATBwj.png) ``` read -p "Input the token: " token wget -d --header "Authorization: token ${token}" https://raw.githubusercontent.com/.../.../main/repo/packages/.../file.txt -P /opt/tomcat ``` [enter image description here](https://i.stack.imgur.com/DXczq.png)
null
CC BY-SA 4.0
null
2022-12-10T07:09:33.797
2022-12-10T07:13:22.927
2022-12-10T07:13:22.927
20,724,024
20,724,024
null
74,751,054
2
null
74,750,469
0
null
So, after some intense googling i found the solution. And solution is fight fire with fire. Unicode include character Thin Space, that is 1/5 of the normal space, so if i include two of them with one normal space after my problematic character, the output is diplaying how i want. If anybody runs into some simliar issue, unicode have lot of different sized spaces. I found [Website](https://jkorpela.fi/chars/spaces.html) that shows them all of them, with their propperties. [fixed output picture](https://i.stack.imgur.com/aYob6.png)
null
CC BY-SA 4.0
null
2022-12-10T07:10:39.117
2022-12-10T07:10:39.117
null
null
17,589,029
null
74,751,258
2
null
74,750,554
0
null
``` import matplotlib.pyplot as plt import numpy as np # just a dummy data x = np.linspace(0, 2700, 50) all_data = [np.sin(x), np.cos(x), x**0.3, x**0.4, x**0.5] n = len(all_data) n_rows = n n_cols = 1 fig, ax = plt.subplots(n_rows, n_cols) # each element in "ax" is a axes for i, y in enumerate(all_data): ax[i].plot(x, y, linewidth=2, linestyle=':') ax[i].set_ylabel('y-axis') # You can to use a list of y-labels. Example: # my_labels = ['y1', 'y2', 'y3', 'y4', 'y5'] # ax[i].set_ylabel(my_labels[i]) # The "my_labels" lenght must be "n" too plt.xlabel('x-axis') # add xlabel at last axes plt.tight_layout() ``` [](https://i.stack.imgur.com/eGB2h.png)
null
CC BY-SA 4.0
null
2022-12-10T07:54:13.393
2022-12-10T08:02:35.347
2022-12-10T08:02:35.347
20,262,902
20,262,902
null
74,751,620
2
null
74,751,178
0
null
You can use for loop: ``` let output = ""; for (let i=0; i <= 9; i++) { for (let j=0; j <= 9; j++) { output += i; output += j; output += '*'; } } console.log(output); ```
null
CC BY-SA 4.0
null
2022-12-10T09:07:32.407
2022-12-10T09:20:25.013
2022-12-10T09:20:25.013
14,664,708
14,664,708
null
74,751,637
2
null
38,821,432
2
null
if anybody faces this issue this worked for me: ``` input[type="color"] { border-radius: 5px; padding: 0; border: 5px solid #DDD; } input[type="color"]::-moz-color-swatch { border: none; } input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; border-radius: 0; } input[type="color"]::-webkit-color-swatch { border: none; } ``` ``` <input type="color"> ``` will be providing an pure css generator [here](https://antvil.github.io/css-sos/sos/color/index.html)
null
CC BY-SA 4.0
null
2022-12-10T09:10:21.587
2022-12-10T09:10:21.587
null
null
16,494,303
null
74,751,713
2
null
43,877,697
1
null
From the navbar: View>Appearance>Panel Position> Right
null
CC BY-SA 4.0
null
2022-12-10T09:21:20.513
2022-12-10T09:21:20.513
null
null
17,774,185
null
74,751,763
2
null
74,751,181
0
null
I found the problem myself. That is because I put the project folder under a lot of level of folder. Make the fungus package cannot catch the function.
null
CC BY-SA 4.0
null
2022-12-10T09:30:31.330
2022-12-10T09:30:31.330
null
null
10,212,379
null
74,753,611
2
null
30,069,830
0
null
The most straightforward way, as far as I know, is to use [Chocolatey](https://en.wikipedia.org/wiki/NuGet#Chocolatey) to install MinGW: ``` choco install mingw ``` Then check with the command `whereis gcc`. It is going to be installed in . one more thing, to get make working, just copie (or rename if you wish) with copy mingw32-make.exe make.exe in .
null
CC BY-SA 4.0
null
2022-12-10T14:06:31.897
2022-12-10T17:33:55.443
2022-12-10T17:33:55.443
9,354,250
9,354,250
null
74,753,823
2
null
74,585,740
0
null
These videos show how to set remote access to your RPi and a node-red server running on it, using cloudflare tunnels (which are free to use, just sign-up to cloudflare). With this method, you don't need to deploy a VPN as the traffic will be proxied by cloudflare. Just make sure you set the ingress rules correctly, - - Watch these videos with step-by-step guides: [https://youtu.be/Z6b3l1z0N7w](https://youtu.be/Z6b3l1z0N7w) and this: [https://youtu.be/cInnpVEW50k](https://youtu.be/cInnpVEW50k)
null
CC BY-SA 4.0
null
2022-12-10T14:33:17.603
2022-12-10T14:33:17.603
null
null
12,089,615
null
74,753,978
2
null
74,753,857
0
null
I was also facing the same problem but now I'm using following code and is working for me server.js ``` const express = require('express'); const app = express(); const mongoose = require('mongoose'); const app = require('./app'); const DB = 'mongodb://localhost:27017/Tour-project' mongoose.connect(DB, (err) => { if (err) { console.log(err.name, err.message); // display the cause of error for database conenction console.error('Error during mongoDB connection'); console.log('UNHANDLED REJECTION!! ‍♂️‍♂️ '); } else { // console.log(mongoose.connections); console.log('MongoDB connected successfully'); } }); const port = 3000; app.listen(port, 'localhost', () => { console.log(`Server is running using port number: ${port}`); console.log(`app listening on endpoint ${port}`); }); ```
null
CC BY-SA 4.0
null
2022-12-10T14:54:16.063
2022-12-10T14:54:16.063
null
null
20,621,380
null
74,754,045
2
null
74,748,201
0
null
I was using the `useEffect` hook wrong, I defined a function that will fire/execute upon `keydown` event, this fixed my code. ``` useEffect(() => { function pressKeySon (e) { e.preventDefault(); console.log(e.key); setList([<p key={Math.random()}>{e.key}</p>, ...list]) } window.addEventListener('keydown', pressKeySon) return () => window.removeEventListener('keydown', pressKeySon); }, [list]) ```
null
CC BY-SA 4.0
null
2022-12-10T15:03:27.597
2022-12-15T11:56:51.170
2022-12-15T11:56:51.170
17,195,992
20,427,110
null