Id
int64
1.68k
75.6M
PostTypeId
int64
1
2
AcceptedAnswerId
int64
1.7k
75.6M
ParentId
int64
1.68k
75.6M
Score
int64
-60
3.16k
ViewCount
int64
8
2.68M
Body
stringlengths
1
41.1k
Title
stringlengths
14
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
1
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
1
21.3M
Tags
sequence
75,313,932
2
null
75,313,644
1
null
{ margin-top : "5px" } or { padding-top : "5px" }
null
CC BY-SA 4.0
null
2023-02-01T17:23:19.253
2023-02-01T17:25:37.910
2023-02-01T17:25:37.910
21,079,539
21,079,539
null
75,314,348
2
null
75,314,222
0
null
There is no Firebase Client SDK for Java. However, if your Java Application is based on a three tiers architecture with an Application server (I guess this is the case since you use Spring Boot) you can use the [Admin SDK for Java](https://firebase.google.com/docs/admin/setup) to interact with the Authentication service (and if necessary the other Firebase services) from this server.
null
CC BY-SA 4.0
null
2023-02-01T18:02:40.257
2023-02-01T19:43:42.483
2023-02-01T19:43:42.483
3,371,862
3,371,862
null
75,314,524
2
null
75,312,580
0
null
In tag add ``` <Preference android:title="Exit" android:key="exit"/> ``` Then in class add this code: ``` Preference button = (Preference)getPreferenceManager().findPreference("exit"); button.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference arg0) { finish(); return true; } }); ```
null
CC BY-SA 4.0
null
2023-02-01T18:20:00.337
2023-02-01T18:20:00.337
null
null
12,377,924
null
75,314,738
2
null
75,308,947
0
null
As I suggested in my comment adding `guides(fill = guide_legend(nrow = ...))` to one of your plots would be one option to split the legend into multiple rows. As you provided no example data I created my own. ``` library(ggplot2) library(ggpubr) dat <- data.frame( book <- c( "Lorem ipsum dolor sit amet", "sem in libero class", "et posuere vehicula imperdiet dapibus", "et ipsum id ac", "Eleifend torquent sed egestas" ), books_sold = 1:5 ) ``` First, to reproduce your issue let's create some simple charts and use `ggarrange` to glue them together, which as you can see results in a legend clipped off at the plot margins because of the long legend text. ``` p1 <- p2 <- p3 <- p4 <- ggplot(dat, aes(as.numeric(factor(book)), books_sold, fill = book)) + geom_col() + theme(legend.position = "none") final_plot <- ggarrange(p1, p2, p3, p4, ncol = 2, nrow = 2, common.legend = TRUE ) final_plot ``` ![](https://i.imgur.com/QTxTzGL.png) Now, adding `guides(fill = guide_legend(nrow = 3))` to just one of your plots will split the legend into three rows: ``` p1 <- p1 + guides(fill = guide_legend(nrow = 3)) final_plot <- ggarrange(p1, p2, p3, p4, ncol = 2, nrow = 2, common.legend = TRUE ) final_plot ``` ![](https://i.imgur.com/DlenKT5.png)
null
CC BY-SA 4.0
null
2023-02-01T18:40:26.187
2023-02-01T18:40:26.187
null
null
12,993,861
null
75,314,765
2
null
75,313,572
1
null
Issue was solved by converting .py file to .exe with auto-py-to-exe and specifiying paramiko module in advanced settings.
null
CC BY-SA 4.0
null
2023-02-01T18:43:00.863
2023-02-01T18:43:00.863
null
null
16,572,955
null
75,314,801
2
null
75,312,551
0
null
Port 8884 is for MQTT over Secure WebSockets You'll need to change the URL to start with `wss://` not `ws://`
null
CC BY-SA 4.0
null
2023-02-01T18:45:17.077
2023-02-01T18:45:17.077
null
null
504,554
null
75,314,831
2
null
62,980,801
0
null
It may occur due to the flutter version. In my case after changing (downgrade) the flutter version it's working fine Thanks.
null
CC BY-SA 4.0
null
2023-02-01T18:48:10.763
2023-02-01T18:48:50.463
2023-02-01T18:48:50.463
21,127,885
21,127,885
null
75,315,153
2
null
75,308,322
0
null
Thanks for the update and the data. With the data that you have given you can achieve this with a scatter plot. here is an example: ``` import pandas as pd import matplotlib.pyplot as plt # create the dataframe data = {'Index': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 'Running Total': [0, 1, 2, 1, 2, 3, 4, 3, 2, 1], 'Score type': ['Forced error', 'Winner', 'Ace', 'Double fault', 'Forced error', 'Ace', 'Forced error', 'Forced error', 'Winner', 'Double fault']} df = pd.DataFrame(data) # plot the line chart plt.plot(df['Index'], df['Running Total'], '-') # plot the scatter chart categories = df['Score type'].astype("category").cat.categories for i, category in enumerate(categories): plt.scatter(df[df['Score type'] == category]['Index'], df[df['Score type'] == category]['Running Total'], label=category, c=f"C{i}") plt.xlabel('Index') plt.ylabel('Running Total') plt.legend() plt.show() ``` and this is the result: [](https://i.stack.imgur.com/rK7mL.png) You can see that i plotted the chart in two parts. 1. line chart 2. scatter plot
null
CC BY-SA 4.0
null
2023-02-01T19:18:46.510
2023-02-01T19:32:57.430
2023-02-01T19:32:57.430
7,318,120
7,318,120
null
75,315,211
2
null
75,313,068
0
null
As far as I can tell, these are all the class variables you have (that are important to a "game"): - `game_id`- `players_in_game`- `deck`- `player_hand`- `dealer_hand`- `outcome` Now, let's run through some players playing your game. comes along and does `blackjack`. This initialises all those above variables with values for them. If they were to keep playing by themselves - it would work just fine. However, before can do anything, comes along and runs the `blackjack` command. This overwrites all the values you had for stored in those variables. If now calls one of your other commands, they'll be using game state from 's game. There's a fundamental flaw in your logic and saving of game state that'll always fail when more than one player tries to play at the same time. What you need to do, is create some sort of `game state` object that can be used for that. This can be as simple as a `dict`, a custom class, DB entry, etc. But it needs to be something. Using the `dict` idea: ``` # when a user uses the `blackjack` command player_game_state = {"game_id": game_id, "user_id": user_id, "player_hand": player_hand, "dealer_hand": dealer_hand, "bet": bet} # etc, etc, etc ``` Then, we use your `self.players_in_game` class variable to keep track of all these game states. ``` # still in the blackjack command - once you setup everything self.players_in_game[user_id] = game_state ``` Now, when they call one of the other commands, like `hit`: ``` # at the start of the command player_game_state = self.players_in_game[user_id] # instead of doing self.player_hand player_game_state["player_hand"].append(self.draw_card()) ``` Though, maybe your `draw_card` method, and `reset_deck` methods need to take the game state as a parameter and modify them. As I'd wager they're currently resetting your class variables as well. Does that make sense? Hopefully enough that you can try to apply some of it. TLDR; stop using class variables for storing individual parts of your game state.
null
CC BY-SA 4.0
null
2023-02-01T19:24:46.410
2023-02-01T19:24:46.410
null
null
4,680,300
null
75,315,350
2
null
75,298,274
0
null
If you go to New Counter->Edit Counter->Increase and it goes to 1, then go back, back and again go to New Counter you'll see its back at zero. The state is lost when you exit back out of the New Counter screen (`CounterView`). If you want to maintain state across screens you need to move it up to a common parent. It's probably not a good idea to use a navigation value as a counter usually it's an ID that doesn't change. If you say what you are trying to achieve perhaps we could come up with a better data model.
null
CC BY-SA 4.0
null
2023-02-01T19:39:15.267
2023-02-01T19:39:15.267
null
null
259,521
null
75,315,359
2
null
75,315,286
1
null
You will get better performance from the current code by changing it like this: ``` DECLARE @Month DateTime = DatefromParts(@AÑO, @MES, 1) SET @TOTALMESACTUAL = (SELECT SUM(MONTODEBITO) - SUM(MONTOCREDITO) FROM PRUEBAOPEX WHERE @Month <= FECHA and FECHA < Dateadd(month, 1, @Month) ) ``` The improved performance is because the `FECHA` column now remains unaltered for the query, and will therefore work better (at all) with any indexes you have. More importantly, this is also very easy to convert to get the previous month: ``` DECLARE @Month DateTime = DatefromParts(@AÑO, @MES, 1) Set @Month = DATEADD(month, -1, @Month) SET @TOTALMESACTUAL = (SELECT SUM(MONTODEBITO) - SUM(MONTOCREDITO) FROM PRUEBAOPEX WHERE @Month <= FECHA and FECHA < Dateadd(month, 1, @Month) ) ```
null
CC BY-SA 4.0
null
2023-02-01T19:39:59.933
2023-02-01T19:51:15.857
2023-02-01T19:51:15.857
3,043
3,043
null
75,315,368
2
null
75,315,286
1
null
You should be using date boundaries, using syntax like `WHERE MONTH(SomeDate) = @SomeMonthNumber`. This means you can make a SARGable query, you can easily apply better logic to the date boundary you want. An easy way to get a date from a month and year value is to use `DATEFROMPARTS`. As you want the whole of a specific month, you can use `1` for the day of the month. After making some other changes, as there are some odd choices in your procedure (variables that are declared and not used, a lack of the procedure returning anything), I suspect you want something like this: ``` --I have dropped the prefix as I recommend in the comments of your prior question. CREATE PROCEDURE dbo.VALORS @NIVEL varchar(15), @MES int, @AÑO int, @TOTALMESACTUAL float = NULL OUTPUT AS BEGIN SELECT @TOTALMESACTUAL = SUM(MONTODEBITO - MONTOCREDITO) --There's no need for a subquery here FROM dbo.PRUEBAOPEX WHERE FECHA >= DATEFROMPARTS(@AÑO, @MES, 1) AND FECHA < DATEADD(DAY, 1, DATEFROMPARTS(@AÑO, @MES, 1)); END; ``` If you wanted to get the month, you can easily apply a further `DATEADD` to subtract a month from the expression (`DATEADD(MONTH, -1, <Expression>)`). `float``SUM(MONTODEBITO - MONTOCREDITO)`
null
CC BY-SA 4.0
null
2023-02-01T19:40:56.403
2023-02-01T19:40:56.403
null
null
2,029,983
null
75,315,438
2
null
75,315,387
0
null
I can see two possibilities: you're building classes dynamically in Javascript (hard to say without seeing your code), or you did not recompile your Tailwind classes.
null
CC BY-SA 4.0
null
2023-02-01T19:48:25.307
2023-02-01T19:48:25.307
null
null
521,624
null
75,315,641
2
null
47,199,300
0
null
Another reason for this problem is that there are multiple hidden files that are not .docx format which is why this error is coming. These files could be starting with ("~$") if these are open files or (".DS") files if you are using macOS. My error was resolved when I added the following exceptions to my code: ``` for file in os.listdir(folder_path): if file.endswith(".docx") and not file.startswith('~$') and not file.startswith('.DS_'): <enter rest of the code here ```
null
CC BY-SA 4.0
null
2023-02-01T20:08:05.983
2023-02-04T23:42:10.157
2023-02-04T23:42:10.157
13,376,511
21,128,340
null
75,316,303
2
null
75,273,987
1
null
Okay so after a long time of troubleshooting, I finally managed to make it work correctly ()... The problem was this part: ``` GeometryReader { geometry in ZStack { ForEach(detection.objects, id: \.uuid) { object in let rect = detection.deNormalize(object.boundingBox, geometry) Rectangle() .stroke(lineWidth: 2) .foregroundColor(.red) .frame(width: rect.width, height: rect.height) .offset(x: rect.origin.x, y: rect.origin.y) } } } ``` I assumed because many `Rectangle()`s will overlap, I need a `ZStack()` to put them over each other, this turned out to be wrong, apparently when using `.offset()` they can overlap without any issue, so removing the `ZStack()` completely solved the problem: ``` GeometryReader { geometry in ForEach(detection.objects, id: \.uuid) { object in let rect = detection.deNormalize(object.boundingBox, geometry) Rectangle() .stroke(lineWidth: 2) .foregroundColor(.red) .frame(width: rect.width, height: rect.height) .offset(x: rect.origin.x, y: rect.origin.y) } } ``` `ZStack()``GeometryReader()` ``` ZStack { GeometryReader { geometry in ForEach(detection.objects, id: \.uuid) { object in let rect = detection.deNormalize(object.boundingBox, geometry) Rectangle() .stroke(lineWidth: 2) .foregroundColor(.red) .frame(width: rect.width, height: rect.height) .offset(x: rect.origin.x, y: rect.origin.y) } } } ```
null
CC BY-SA 4.0
null
2023-02-01T21:20:14.410
2023-02-01T21:20:14.410
null
null
21,103,481
null
75,316,380
2
null
71,080,988
0
null
Had this issue and to fix it I had to configure the provider in the DbContext class itself (which was not part of the main api entrypoint csproj) ``` protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { // needed for local scafolding of razor views if (!optionsBuilder.IsConfigured) { optionsBuilder.UseNpgsql("mongodb://localhost:27017/ssl=false"); // or other provider... like optionsBuilder.UseSqlServer("...."); } } ``` There are probably other ways around it but this worked for me. The downside is that you need to install the provider package on the csproj where the DbContext lives.
null
CC BY-SA 4.0
null
2023-02-01T21:27:59.523
2023-02-01T21:27:59.523
null
null
2,826,794
null
75,316,392
2
null
75,301,825
1
null
Your test classes are not adhering to Pytest's [naming conventions](https://docs.pytest.org/en/7.2.x/explanation/goodpractices.html#conventions-for-python-test-discovery) and therefore the discovery fails. Test classes must be named using `Test` prefix, that is with uppercase `T`.
null
CC BY-SA 4.0
null
2023-02-01T21:29:25.200
2023-02-02T09:09:01.233
2023-02-02T09:09:01.233
772,810
772,810
null
75,316,497
2
null
75,114,815
1
null
## CDP With the availablity of [Selenium](https://stackoverflow.com/a/54482491/7429447) [v4.0.0.0-alpha-1](https://github.com/SeleniumHQ/selenium/blob/trunk/java/CHANGELOG#L647) the basic support for landed via the "DevTools" interface. Moving ahead, from [v4.0.0-alpha-4](https://github.com/SeleniumHQ/selenium/blob/trunk/java/CHANGELOG#L582) onwards Chrome Debugging Protocol commands now mirror latest CDP spec. --- ## This usecase As you were using [ChromeDriver](https://stackoverflow.com/a/59927747/7429447)/GoogleChrome combo v, support for it was added recently in [Selenium v4.8.0](https://github.com/SeleniumHQ/selenium/blob/trunk/java/CHANGELOG#L1): ``` v4.8.0 ====== * Supported CDP versions: 85, 107, 108, 109 ``` So incase someone tries to use [ChromeDriver](https://stackoverflow.com/a/53744026/7429447)/GoogleChrome combo v with or earlier, Selenium won't be able to find an exact match for CDP version 109 and would return the closest version found i.e. `108` Hence the warning: > WARNING: Unable to find an exact match for CDP version 109, so returning the closest version found
null
CC BY-SA 4.0
null
2023-02-01T21:41:35.343
2023-02-01T21:41:35.343
null
null
7,429,447
null
75,316,895
2
null
75,316,644
0
null
Qt basic layouts always try to divide the available space in its "cells", and each widget will have that space reserved (even if it doesn't use all of it). Note that different widget types have also different [size policies](https://doc.qt.io/qt-5/qsizepolicy.html#details) that tell the layout how it should allocate the available space and eventually set the geometry of those widgets. For instance, QLineEdit has a `Fixed` , meaning that its size hint will always be considered as the only valid height (which is similar to calling `setFixedHeight()` or `setFixedSize()` as you did). QLabel, instead, has a `Preferred` size policy, meaning that if there's space left in the layout, it can take advantage of it. When you only have the line edit, the layout only has that widget, so it will place it in the center (because you didn't specify an alignment). But when you add the label, the layout finds that the line edit needs a very small space, so it will leave the remaining to the label, hence your result. For a simple case like this, you can just specify a proper alignment when adding the widgets: when the alignment is provided, the item will not try to occupy the whole cell and the layout will align it to the available space of that layout cell. ``` layout.addWidget(self.text, 0, 0, alignment=Qt.AlignBottom) layout.addWidget(self.input, 1, 0, alignment=Qt.AlignTop) ``` Note that I changed the column to 0, as there is no point in placing widgets in the column if there's nothing in the first, you want to get advantage of `setColumnStretch()` or `setColumnMinimumWidth()`. Also consider that for this kind of "wide" layouts with lots of empty spaces it's usually better to use nested layouts, or use container widgets. For instance: ``` layout = QGridLayout(self) centerLayout = QVBoxLayout() layout.addLayout(centerLayout, 0, 0, alignment=Qt.AlignCenter) # ... centerLayout.addWidget(self.text) centerLayout.addWidget(self.input) ``` Or, alternatively: ``` layout = QGridLayout(self) centerWidget = QWidget() layout.addWidget(centerWidget, 0, 0, alignment=Qt.AlignCenter) centerLayout = QVBoxLayout(centerWidget) # ... as above ``` Try to remove the `alignment` argument in the two examples above and you'll see the difference. I suggest you to do some experiments using [layouts in Qt Designer](https://doc.qt.io/qt-5/designer-layouts.html), which makes it easier to immediately understand how layout work and behave with different widget types.
null
CC BY-SA 4.0
null
2023-02-01T22:32:02.337
2023-02-01T22:32:02.337
null
null
2,001,654
null
75,316,939
2
null
75,273,987
3
null
`GeometryReader` makes everything inside shrink to its smallest size. Add `.border(Color.orange)` to the `ZStack` and you will see something like what I have below. [](https://i.stack.imgur.com/ZuZYH.png) You can use `.frame(maxWidth: .infinity, maxHeight: .infinity)` to make the `ZStack` stretch to take all the available space. `position` vs `offset`. `offset` usually starts at the center then you `offset` by the specified amount. `position` is more like `origin`. > Positions the center of this view at the specified coordinates in its parent’s coordinate space. Adjusting for that center positioning vs top left (0, 0) that is used by origin. The `ZStack` needs to be flipped on the X axis. Below is the full code ``` import SwiftUI import Vision import CoreML @MainActor class Detection: ObservableObject { //Moved file to assets //let imgURL = URL(string: "https://i.imgur.com/EqsxxTc.jpg")! // Xcode preview generates this: https://i.imgur.com/6IPNQ8b.png let imageName: String = "EqsxxTc" @Published var objects: [VNRecognizedObjectObservation] = [] func getModel() throws -> VNCoreMLModel { //Used model directly instead of loading from URL let model = try YOLOv3Tiny(configuration: .init()).model let mlModel = try VNCoreMLModel(for: model) return mlModel } func detect() async throws { let model = try getModel() guard let tiff = NSImage(named: imageName)?.tiffRepresentation else { // YOLOv3Tiny: https://ml-assets.apple.com/coreml/models/Image/ObjectDetection/YOLOv3Tiny/YOLOv3Tiny.mlmodel //fatalError("Either YOLOv3Tiny.mlmodel is not in project bundle, or image failed to load.") throw AppError.unableToLoadImage } //Completion handlers are not compatible with async/await you have to convert to a continuation. self.objects = try await withCheckedThrowingContinuation { (cont: CheckedContinuation<[VNRecognizedObjectObservation], Error>) in let request = VNCoreMLRequest(model: model) { (request, error) in if let error = error{ cont.resume(throwing: error) }else{ cont.resume(returning: (request.results as? [VNRecognizedObjectObservation]) ?? []) } } do{ try VNImageRequestHandler(data: tiff).perform([request]) }catch{ cont.resume(throwing: error) } } } func deNormalize(_ rect: CGRect, _ geometry: GeometryProxy) -> CGRect { return VNImageRectForNormalizedRect(rect, Int(geometry.size.width), Int(geometry.size.height)) } } struct ContentView: View { @StateObject var detection = Detection() var body: some View { Image(detection.imageName) .resizable() .scaledToFit() .overlay { GeometryReader { geometry in ZStack { ForEach(detection.objects, id: \.uuid) { object in let rect = detection.deNormalize(object.boundingBox, geometry) Rectangle() .stroke(lineWidth: 2) .foregroundColor(.red) .frame(width: rect.width, height: rect.height) //Changed to position //Adjusting for center vs leading origin .position(x: rect.origin.x + rect.width/2, y: rect.origin.y + rect.height/2) } } //Geometry reader makes the view shrink to its smallest size .frame(maxWidth: .infinity, maxHeight: .infinity) //Flip upside down .rotation3DEffect(.degrees(180), axis: (x: 1, y: 0, z: 0)) }.border(Color.orange) } .task { do{ try await self.detection.detect() }catch{ //Always throw errors to the View so you can tell the user somehow. You don't want crashes or to leave the user waiting for something that has failed. print(error) } } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } enum AppError: LocalizedError{ case cannotFindFile case unableToLoadImage } ``` [](https://i.stack.imgur.com/3N3ae.png) I also changed some other things as you can notice, there are comments in the code.
null
CC BY-SA 4.0
null
2023-02-01T22:37:23.320
2023-02-01T22:54:03.197
2023-02-01T22:54:03.197
12,738,750
12,738,750
null
75,317,112
2
null
51,940,157
0
null
I have seen all the solutions. But here is the simplest I believe :-): ``` <Typography><LinkIcon sx={{verticalAlign:"middle"}}/> RESOLVE</Topography> ``` It also works with inline image when you want the image align with the text.
null
CC BY-SA 4.0
null
2023-02-01T23:04:49.247
2023-02-01T23:04:49.247
null
null
2,841,538
null
75,317,134
2
null
75,317,083
0
null
As per the [snapshot](https://i.stack.imgur.com/X9lox.png) provided to click on the desired element you can use the `aria-label` attribute of the `<a>` element and inducing [WebDriverWait](https://stackoverflow.com/questions/57554298/webdriverwait-is-not-waiting-for-the-element-i-specify/57554488#57554488) for the desired [ElementToBeClickable()](https://stackoverflow.com/questions/62451267/how-to-click-on-the-radio-button-through-the-element-id-attribute-using-selenium/62451578#62451578) you can use either of the following [Locator Strategies](https://stackoverflow.com/questions/48369043/official-locator-strategies-for-the-webdriver/48376890#48376890): - Using :``` IWebElement element = new WebDriverWait(driver, TimeSpan.FromSeconds(20)).Until(ExpectedConditions.ElementToBeClickable(By.CssSelector("a[aria-label^='APPLE Airpods Pro 2ª Geração']"))); ``` - Using :``` IWebElement element = new WebDriverWait(driver, TimeSpan.FromSeconds(20)).Until(ExpectedConditions.ElementToBeClickable(By.XPath("//a[starts-with(@aria-label, 'APPLE Airpods Pro 2ª Geração')]"))); ```
null
CC BY-SA 4.0
null
2023-02-01T23:09:08.723
2023-02-01T23:09:08.723
null
null
7,429,447
null
75,317,364
2
null
75,314,732
0
null
You should put the sleep back into the publisher (and you should not be creating a new client for each loop). Your subscriber is failing because you are missing a `global temp` from the `getSensorData()` function. Also remove the `time.sleep(2)` from `onMessage()`
null
CC BY-SA 4.0
null
2023-02-01T23:46:08.287
2023-02-01T23:46:08.287
null
null
504,554
null
75,317,351
2
null
57,800,119
0
null
If you are trying to set this up for development, the key file is no longer necessary in Mongo 5. See here for an example: [https://github.com/UpSync-Dev/docker-compose-mongo-replica-set](https://github.com/UpSync-Dev/docker-compose-mongo-replica-set) Note this turns off authentication so don't derp your derpy-derp. up.sh ``` #!/bin/bash docker compose up --remove-orphans ``` docker-compose.yaml ``` version: "3.8" services: mongo1: image: mongo:5 container_name: mongo1 command: ["--replSet", "my-replica-set", "--bind_ip_all", "--port", "30001"] volumes: - mongodb_data1:/data/db # only run this on one server #- ./initDb.js:/docker-entrypoint-initdb.d/initDb.js:ro ports: - 30001:30001 healthcheck: test: test $$(echo "rs.initiate({_id:'my-replica-set',members:[{_id:0,host:\"mongo1:30001\"},{_id:1,host:\"mongo2:30002\"},{_id:2,host:\"mongo3:30003\"}]}).ok || rs.status().ok" | mongo --port 30001 --quiet) -eq 1 interval: 10s start_period: 30s mongo2: image: mongo:5 container_name: mongo2 command: ["--replSet", "my-replica-set", "--bind_ip_all", "--port", "30002"] volumes: - mongodb_data2:/data/db ports: - 30002:30002 mongo3: image: mongo:5 container_name: mongo3 command: ["--replSet", "my-replica-set", "--bind_ip_all", "--port", "30003"] volumes: - mongodb_data3:/data/db ports: - 30003:30003 mongo_express: image: mongo-express:latest environment: - ME_CONFIG_MONGODB_URL=mongodb://mongo1:30001,mongo2:30002,mongo3:30003/?replicaSet=my-replica-set - ME_CONFIG_OPTIONS_EDITORTHEME=pastel-on-dark ports: - "8081:8081" restart: always depends_on: - mongo1 - mongo2 - mongo3 volumes: mongodb_data1: mongodb_data2: mongodb_data3: ``` Note the connection string doesn't have auth in it: ``` mongodb://mongo1:30001,mongo2:30002,mongo3:30003/?replicaSet=my-replica-set ```
null
CC BY-SA 4.0
null
2023-02-01T23:44:32.217
2023-02-02T00:00:18.930
2023-02-02T00:00:18.930
1,483,977
1,483,977
null
75,317,418
2
null
75,317,223
0
null
According to the Unity Scripting Reference, you can directly access and set the height property on the CharacterController class. Start by gaining a reference to your CharacterController in your script This can be done in two ways: Start by defining a CharacterController variable in your script. You can either expose the variable in the Unity editor by using [SerializeField] or you can find the component by using GetComponent. ``` [SerializeField] private CharacterController controller; ``` or ``` private CharacterController controller; void Start(){ controller = GetComponent<CharacterController>(); } ``` Once you have access to your CharacterController component, you can access the height property on it in your code. Here is an example on how you could do this to make a simple crouch mechanic ``` using UnityEngine; public class Example : MonoBehaviour { private CharacterController controller; void Start() { controller = GetComponent<CharacterController>(); //Set height to 2 at the start of the game controller.height = 2.0f; } void Update() { if(Input.GetKeyDown(KeyCode.LeftShift)){ //Set the height to 1.5 if the left shift key is pressed controller.height = 1.5f; } else if(Input.GetKeyUp(KeyCode.LeftShift)){ //Set the height to 2.0 when the user releases shift controller.height = 2.0f; } } } ``` For future reference, the Unity Documentation is a great resource for figuring out what properties and functions are available on components. You can find the Unity scripting documentation [HERE](https://docs.unity3d.com/ScriptReference/index.html).
null
CC BY-SA 4.0
null
2023-02-01T23:56:51.213
2023-02-02T04:07:30.873
2023-02-02T04:07:30.873
11,107,541
21,128,602
null
75,317,748
2
null
75,317,661
2
null
You first need only get a use `std::cin >>`. Then you need to get the of input: use `getline()`. ``` #include <iostream> #include <string> int main() { char c; std::string s; std::cin >> std::ws >> c; // get the character to count getline( std::cin, s ); // get the rest of the text } ``` That `std::ws` there skips any leading whitespace. That may not be correct for your assignment. (Is it possible that the character to search is a space or tab?) I personally like getting prompted, so I would put something like ``` std::cout << "c text? "; ``` at the top of the program, but it is not necessary. Now all you need is to count the `c`s: ``` int count = 0; for (size_t n = 0; n < s.size(); n++) if (s[n] == c) ... ``` --- Also, here is a short lecture on : Things like “input value” and “output value” are not very specific. You should prefer more specific names. In some cases, however, non-specific names are more correct. For these, use common names, like I did for `c` (character) and `s` (string). (Other common meta-syntactic names are `ch` (character) and `str` (string).) These names instantly signal that the name of the object is not important, but also lets the user know what kind of object it is. We care less that the output variable is to be output, but what it . In this case it is a . Hence its new name: `count`. When we `std::cout` the `count` it is pretty clear that it is part of the output. Finally, right at the start you should get used to the idea of just typing `std::` right at the front of Standard Library objects and using `using namespace std`. It seem a little overboard to do all that typing at first, but soon enough those five characters will just appear on your screen when you think them. Doing so will save you a lot of grief later when you inadvertently name something that also exists in the Standard Library. --- #### Bonus: reading error messages The compiler is when complaining, barfing sometimes for more scrollback buffer than available in your terminal. Whenever you get an error, pay close attention to the one, fix it, and recompile. Take errors one at a time like that. Your first error is: ``` main.cpp:16:20: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 16 | for (int i=0; i <= inputWord.size(); ++i){ | ~~^~~~~~~~~~~~~~~~~~~ ``` Reading it we see that it is complaining that `int` and `long unsigned int` have different “signedness” and you are comparing them. This is an obnoxiousness that you need to deal with when using `for` loops (because the problem it is complaining about is a valid issue). The easy fix is to just use `size_t` as your index type, as I did in the example above. The next error you get is: ``` main.cpp:17:25: error: no match for ‘operator==’ (operand types are ‘__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type’ {aka ‘char’} and ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’}) 17 | if (inputWord.at(i) == inputVal) { | ~~~~~~~~~~~~~~~ ^~ ~~~~~~~~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char} ``` Here the compiler is saying it do an `==` comparison that has a `char` on the left-hand side and a `std::string` on the right-hand side. It even draws you a little picture showing the code and what each item is. You can look back and see that `inputVal` is indeed a `std::string`, and a character `.at(i)` is not a string. This is a hint that you might need to revisit what type of thing `inputVal` is. In the code I presented above we changed `inputVal` to `c`, complete with the new type of `char`. This makes more sense for the algorithm, since `c` only needs to be a single character anyway. It get easier. I promise!
null
CC BY-SA 4.0
null
2023-02-02T01:13:17.270
2023-02-02T01:34:49.050
2023-02-02T01:34:49.050
2,706,707
2,706,707
null
75,317,850
2
null
75,307,685
0
null
The [same problem](https://github.com/microsoft/pylance-release/issues/241) exists on github and has been closed. Beautiful soup needs to add type stubs for this to work. You could suggest developer updating the package on [bs4](https://bugs.launchpad.net/beautifulsoup/).
null
CC BY-SA 4.0
null
2023-02-02T01:36:54.553
2023-02-02T01:36:54.553
null
null
18,359,438
null
75,317,920
2
null
30,690,135
0
null
Sublime Text has a setting called "HTML/XML Attributes" that can be customized to handle this scenario. You can add the following setting to your Sublime Text user settings file to ignore the double quotes: Json ``` "auto_complete_html_attributes": false ``` This setting will turn off auto-completion for HTML/XML attributes in Sublime Text and allow the display of tag colors correctly. To access the user settings file, go to Preferences > Settings.
null
CC BY-SA 4.0
null
2023-02-02T01:52:41.807
2023-02-10T19:40:49.053
2023-02-10T19:40:49.053
14,267,427
14,642,265
null
75,318,027
2
null
75,316,399
1
null
is something you should be looking at addressing as a side project. Services over SID became recommended in Oracle 8i (yeah you read that right...20 years ago) But every database has an implicit service name equivalent to the SID so just entering the SID value should still get you connected without issue. Of course, now that we're in the world of pluggable databases, this will pretty much force your organisation to move to services, because the SID is typically going to point to the root container whereas you will want to connect to the pluggable(s) that sit underneath it.
null
CC BY-SA 4.0
null
2023-02-02T02:15:47.547
2023-02-02T02:15:47.547
null
null
7,367,293
null
75,318,135
2
null
10,792,052
0
null
``` def start(): message = input() ## collect user input maxGoodness = 0 ## stablish a benchmark maxGoodnessMessage = message ## use current message as baseline for i in range(0,26): ## for each range of 1-26 the range of the alphabet and goodness currentMessage = decodeMesssage(message, i) ## decode the message for the current i currentGoodness = calculateGoodness(currentMessage) ## calculate the goodness for decoded message if currentGoodness > maxGoodness: ## compare goodness to last iteration, if greater maxGoodness = currentGoodness ## update maxGoodness maxGoodnessMessage = currentMessage ## store decipher message with current max goodness print(maxGoodnessMessage) def decodeMesssage(message, S): ## decode message newMessage = '' ## start with an empty message for letter in message: ## for each letter in the message if ord(letter) == 32: ## if we get an empty character just add it to the message and continue to next iteration newMessage = newMessage + letter continue currentAscii = ord(letter) + S ## calculate the value of the current letter and add the S= value if currentAscii > 90: ## if the value of current letter + S is 90 meaning letter Z currentAscii = currentAscii-26 ## find next letter starting from A newMessage += str(chr(currentAscii)) ## transform back to a letter and add to message return newMessage def calculateGoodness(message): total = 0 for char in message: ## for each character in the message if char == ' ': ## ignore empty characters continue i = ord(char) total += letterGoodness[i-65] ## calculate the value of the character and add it to total return total start() ```
null
CC BY-SA 4.0
null
2023-02-02T02:38:47.090
2023-02-02T02:38:47.090
null
null
6,143,075
null
75,318,177
2
null
75,318,137
1
null
An easy way to import data to Rstudio is to use the Import Dataset tab on the Environment tab in the upper right window of RStudio or simply you can use `read.csv` function to do it: ``` df <- read.csv("path/to/Sparrows.csv") ```
null
CC BY-SA 4.0
null
2023-02-02T02:48:24.697
2023-02-02T02:48:24.697
null
null
6,147,721
null
75,318,275
2
null
75,318,247
3
null
As you perform the step `z = z - b` before the check `z < 0` a `do`-`while` loop would map most naturally: ``` #include <stdio.h> int main() { int a; int b; if(scanf("%d%d", &a, &b) != 2) { printf("scanf() failed\n"); return 1; } if(b == 0) { printf("b cannot be 0\n"); return 0; } int i = 0; int z = a; do { z -= b; i++; } while(z >= 0); int E = i - 1; int R = z + b; printf("E = %d, R = %d\n", E, R); } ``` As @Fe2O3 points out the E and R assignments undos the last step, so I would rework into a `for`-loop that tests if we need to take the next step before doing it. This would be a different flow chart though. ``` #include <stdio.h> int main() { int a; int b; if(scanf("%d%d", &a, &b) != 2) { printf("scanf() failed\n"); return 1; } if(!b) { printf("b cannot be 0\n"); return 0; } size_t i = 0; for(; a - b >= 0; a -= b, i++); printf("E = %d, R = %d\n", i, a); } ``` Or simply realizing what the algorithm does and implement it directly: ``` #include <stdio.h> int main() { int a; int b; if(scanf("%d%d", &a, &b) != 2) { printf("scanf() failed\n"); return 1; } if(!b) { printf("b cannot be 0\n"); return 0; } printf("%d %d\n", a/b, a%b ); } ```
null
CC BY-SA 4.0
null
2023-02-02T03:07:36.187
2023-02-02T04:06:34.280
2023-02-02T04:06:34.280
9,706
9,706
null
75,318,829
2
null
75,318,448
0
null
Actually I couldn't understand your question, what do yo want. If you could show a sample dataframe you want it would be great. But generally you can do it like that. For example in this data latitude longitude is in same column and you can separate them to two columns with split function. Don't forget to add headers. ``` import requests from bs4 import BeautifulSoup as bs from datetime import datetime base_url = 'https://www.booking.com' urlss = 'https://www.booking.com/searchresults.html?req_children=0&label=gen173nr-1FCAEoggI46AdIM1gEaGyIAQGYATG4ARfIAQzYAQHoAQH4AQKIAgGoAgO4AuS4sJ4GwAIB0gIkYWJlYmZiMWItNWJjMi00M2Y2LTk3MGUtMzI2ZGZmMmIyNzMz2AIF4AIB&group_children=0&dest_type=city&rows=15&aid=304142&dest_id=-2092174&nflt=ht_id%3D204&req_adults=2&no_rooms=1&group_adults=2' data = [] def pars(url): r = requests.get(url) soup = bs(r.text, 'html.parser') foor = {} try: foor['description'] = soup.find('div', id = 'property_description_content').text foor['Title'] = soup.find('h2', class_ = 'd2fee87262 pp-header__title').text x = soup.find_all('div', class_ = 'a815ec762e ab06168e66') div_map = soup.select_one('#hotel_sidebar_static_map') if div_map: foor['x_lnge'] = div_map['data-atlas-latlng'] for f in range(0, len(x)): foor[f'feature{f}'] =(x[f].text) data.append(foor) except: None def general(): r = requests.get(urlss) soup = bs(r.text, 'html.parser') x = soup.select('header > a') for f in x: urls = base_url + f['href'] obj = {} obj['urls'] = urls print(urls) pars(urls) f = [] def export_data(data): f = pd.DataFrame(data) f = f.drop_duplicates() presentday = datetime.now() pese = str(presentday) a = str(presentday)[0:10].replace('-', '_') f.to_excel(f'{a}booking.xlsx', index=False) if __name__ == '__main__': general() export_data(data) ```
null
CC BY-SA 4.0
null
2023-02-02T04:55:42.333
2023-02-02T04:55:42.333
null
null
20,837,323
null
75,319,556
2
null
75,319,313
1
null
The error message is actually quite helpful this time - you really are missing the `@fullcalendar/angular` package. Run this in the command line: ``` npm install @fullcalendar/core @fullcalendar/list @fullcalendar/timegrid @fullcalendar/interaction @fullcalendar/angular ``` I simply added `@fullcalendar/angular` at the end.
null
CC BY-SA 4.0
null
2023-02-02T06:48:27.950
2023-02-02T06:48:27.950
null
null
6,441,048
null
75,319,742
2
null
72,876,897
0
null
The 2nd screenshot has a tab "Table Design" on the right whereas the 1st screenshot doesn't have that (only filter is applied). As the comments mentioned, remove the filter and convert to a Table (Ctrl + T). It is also worth mentioning that you can select any range to convert to a table whereas applying a filter may not work if you have empty cells in your data.
null
CC BY-SA 4.0
null
2023-02-02T07:09:46.093
2023-02-15T23:01:08.643
2023-02-15T23:01:08.643
100,297
21,130,992
null
75,319,787
2
null
75,305,180
0
null
Personally I use [Azure Cost Management connector in Power BI Desktop](https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-connect-azure-cost-management) to retrieve the data. I scheduled a daily refresh and I never had problems. I know for sure that there are problems with calculation in the early days of the month and I have a colleague that withdraw the last month after the first week. I suggest you to open a ticket with the Azure Billing support.
null
CC BY-SA 4.0
null
2023-02-02T07:15:40.757
2023-02-02T07:15:40.757
null
null
4,652,358
null
75,319,821
2
null
75,275,370
0
null
Please review the document I mentioned below. This datalabels plugin will help you labeling chartjs chart. I linked Doughnut chart page. [https://chartjs-plugin-datalabels.netlify.app/samples/charts/doughnut.html](https://chartjs-plugin-datalabels.netlify.app/samples/charts/doughnut.html)
null
CC BY-SA 4.0
null
2023-02-02T07:20:20.740
2023-02-02T07:20:20.740
null
null
19,986,887
null
75,319,999
2
null
66,638,142
1
null
My favorite way to do this is to encapsulate the logic in a static method of the form. Static methods have access to the form's private members so you don't have to worry about exposing anything in public properties. ``` class DataEntryForm : Form { /* The rest of your class goes here */ public static string Execute() { using (var form = new DataEntryForm()) { var result = form.ShowDialog(); return (result == DialogResult.OK) ? form.MyTextBox.Text : null; } } } ``` Then in form1, all you have to do is this: ``` var enteredText = DataEntryForm.Execute(); ```
null
CC BY-SA 4.0
null
2023-02-02T07:43:05.440
2023-02-02T18:47:53.387
2023-02-02T18:47:53.387
2,791,540
2,791,540
null
75,320,388
2
null
75,266,086
1
null
After you load the dataset you should add: ``` device = 'cuda' if torch.cuda.is_available() else 'cpu' train_dataset = train_dataset.to(device) ```
null
CC BY-SA 4.0
null
2023-02-02T08:27:50.743
2023-02-03T07:42:17.613
2023-02-03T07:42:17.613
6,729,591
6,729,591
null
75,320,656
2
null
75,319,421
1
null
There are several relatively simple approaches you could try. --- You could use `cv2.findContours()` to locate the two big black titles and and scale off their position to deduce where the signature is. Your intermediate image might be like this: [](https://i.stack.imgur.com/363Ye.jpg) --- You could use matching to locate the 4 corners of the box . --- You could do flood-fills in say, red, starting from white pixels near the centre of the image till you get a red box filled around the right size for the box . Then scale from that. [](https://i.stack.imgur.com/vhi6L.jpg) --- You could do a flood-fill in black, starting 2/3 of the way down the image and half way across, then find the remaining white area which would be the box . [](https://i.stack.imgur.com/tPhPd.jpg) --- You could look for the large, empty white area below the signature (using summation across the rows) and scale off that. I am showing the summation across the rows to the right of the original image. You could invert first and look for black. Do the summation with: ``` rowTotals = np.sum(img, axis=1) ``` [](https://i.stack.imgur.com/flxvZ.png)
null
CC BY-SA 4.0
null
2023-02-02T08:53:51.193
2023-02-02T17:00:40.117
2023-02-02T17:00:40.117
2,836,621
2,836,621
null
75,320,913
2
null
75,320,722
1
null
It looks like you want to turn soft wrap on, which you can do with +, or by using the `View: Toggle Word Wrap` command.
null
CC BY-SA 4.0
null
2023-02-02T09:14:59.857
2023-02-02T09:14:59.857
null
null
11,107,541
null
75,320,960
2
null
75,301,271
0
null
``` "details": [ { "code": "Conflict", "message": "{\r\n \"status\": \"Failed\",\r\n \"error\": {\r\n \"code\": \"ResourceDeploymentFailure\",\r\n \"message\": \"![The resource operation completed with terminal provisioning state 'Failed](https://i.imgur.com/eipLRgp.png)'.\"\r\n }\r\n}" } ] ``` This issue generally occurs, when an unsupported route typically a 0.0.0.0/0 route to a firewall being advertised via BGP is affecting the Application Gateway Subnet. Try to deploy with a default vnet and manage subnet configuration like below: ![enter image description here](https://i.imgur.com/87BTaJq.png) When I tried to deploy, Azure Application gateway deployment succeeded successfully like below: ![enter image description here](https://i.imgur.com/eipLRgp.png) ![enter image description here](https://i.imgur.com/wXeXq1r.png) If your deployment fails after 30 mins you can make use of to check error messages in any logs pertaining to the unsuccessful procedure. ![enter image description here](https://i.imgur.com/aZBiS5O.png) Once you determine the cause of the issue diagnosis will guide you to take the necessary steps and fix the issue. Resolving network issues, depending on the cause of the failure.
null
CC BY-SA 4.0
null
2023-02-02T09:20:31.433
2023-02-02T09:20:31.433
null
null
18,229,970
null
75,320,981
2
null
75,320,066
1
null
You could do something like this: ``` export class MyComponent { originalValue = ''; inputValue = ''; ngOnInit() { this.originalValue = this.inputValue; } isButtonDisabled() { return this.inputValue !== this.originalValue; } } ``` ``` <form> <input [(ngModel)]="inputValue"> <button [disabled]="isButtonDisabled()">Submit</button> </form> ```
null
CC BY-SA 4.0
null
2023-02-02T09:22:29.633
2023-02-02T09:22:29.633
null
null
18,297,338
null
75,320,991
2
null
75,070,960
0
null
- ``` df1 = df.withColumn("EventData",from_json(df.EventData,MapType(StringType(),StringType()))) df1 = df1 .select(df1.eventID,df1.AppID, explode_outer(df1.EventData)) #df1.show() df2 = df1.filter(df1.key == 'orders') user_schema = ArrayType( StructType([ StructField("id", StringType(), True), StructField("type", StringType(), True) ]) ) df3 = df2.withColumn("value", from_json("value", user_schema)).selectExpr( "eventID", "AppID", "key","inline(value)") df3 = df3.melt(['eventID','AppID','key'],['id','type'],'sub_order','val') req = df3.withColumn('key',concat(df3.key,lit('.'),df3.sub_order)) final_df = df1.filter(df1.key != 'orders').union(req.select('eventID','AppID','key','val')) final_df.show() ``` ![enter image description here](https://i.imgur.com/XO07Zrt.png) -
null
CC BY-SA 4.0
null
2023-02-02T09:23:43.997
2023-02-02T09:23:43.997
null
null
18,844,585
null
75,321,008
2
null
75,320,983
1
null
your wrong in file: ``` class SignUpForm(UserCreationForm): class Meta: fields = ('user_type','account_type','email', 'password1', 'password2') model = CustomUser() ``` Fix to ``` class SignUpForm(forms.ModelForm): class Meta: fields = ('user_type','account_type','email', 'password1', 'password2') model = CustomUser ``` Because `model` required one `MODEL`, you write `CustomUser()` mean callable object. Model `CustomUser` can't do it and raise exception
null
CC BY-SA 4.0
null
2023-02-02T09:25:08.600
2023-02-02T09:47:21.687
2023-02-02T09:47:21.687
5,978,735
5,978,735
null
75,321,145
2
null
75,312,934
0
null
I found a solution in an old feed: [https://tex.stackexchange.com/questions/823/remove-ugly-borders-around-clickable-cross-references-and-hyperlinks](https://tex.stackexchange.com/questions/823/remove-ugly-borders-around-clickable-cross-references-and-hyperlinks) The following didn't work for me: `\usepackage[hidelinks]{hyperref}` What did work was: ``` \hypersetup{ colorlinks, linkcolor={black!50!black}, citecolor={blue!50!black}, urlcolor={blue!80!black} } ```
null
CC BY-SA 4.0
null
2023-02-02T09:37:36.653
2023-02-02T09:37:46.417
2023-02-02T09:37:46.417
19,285,887
19,285,887
null
75,321,252
2
null
75,320,066
0
null
Maybe something like this: ``` interface FormModel { // (1) formText: string; list: number; } private originalFormValue: FormModel; // (2) form?: FormGroup<FormModel>; submitDisabled$: Observable<boolean>; // (3) constructor() { this.form = this.formBuilder.group({ formText: ['hello', Validators.required], list: [10, Validators.required] }); this.originalFormValue = this.form.value; // (4) this.submitDisabled$ = this.form.valueChanges.pipe( // (5) map(value => this.objectsAreEquals(value, this.originalFormValue) || this.form.inalid) ); } private objectsAreEquals(model1: FormModel, model2: FormModel): boolean { ... do the comparison here (you could use a library like lodash, e.g. https://www.geeksforgeeks.org/lodash-_-isequal-method/) } ``` and in the template: ``` ... <button [disabled]="submitDisabled$ | async">Submit</button> ... ``` (1) the datamodel for the form (since angular 14 forms are typed) (2) contains the original form-value to compare with (3) an observable, which emits boolean-values (true, if the submit-button should ebe disabled) (4) save the original value (such that you can compare it, when the form-value changes) (5) this is the tricky part for beginners: - -
null
CC BY-SA 4.0
null
2023-02-02T09:45:56.910
2023-02-02T09:45:56.910
null
null
514,457
null
75,321,253
2
null
16,480,910
0
null
Here's a good example: ``` $(document).ready(function() { var $jobSelect = $('...'); var $specificAccreditationTarget = $('..'); $jobSelect.on('change', function() { $.ajax({ url: url, data: { 'job.id': $jobSelect.val() }, dataType : 'json', success: function (jsonArray) { if (!jsonArray) { $specificAccreditationTarget.find('select').remove(); $specificAccreditationTarget.addClass('d-none'); return; } $specificAccreditationTarget.empty(); $.each(jsonArray, function(index,jsonObject) { var option = new Option(jsonObject.name, jsonObject.id, true, true); $specificAccreditationTarget.append(option); }); } }); }); }); ```
null
CC BY-SA 4.0
null
2023-02-02T09:46:12.683
2023-02-02T09:46:12.683
null
null
6,876,422
null
75,321,385
2
null
46,596,945
0
null
If you fit your model with probabilities, with the package pdp you can plot partial dependence plots and specify the parameter "prob" to `TRUE`, then the partial dependence will be returned on the probability scale instead of centred logit ([red pdp documentaion](https://cran.r-project.org/web/packages/pdp/vignettes/pdp-intro.pdf)). Maybe this helps you interpret the plot. Example: ``` pdp::partial(fit, "Dist_Water, type = "classification", which.class = "presence", prob = TRUE, rug = T, plot = T) ``` Or extracting the data and using ggplot2 to plot (for both classes) ``` pdp::partial(fit, "Dist_Water", type = "classification", which.class = "presence", prob = TRUE) %>% dplyr::mutate(class = "presence") %>% dplyr::bind_rows(., pdp::partial(fit, "Dist_Water", type = "classification", which.class = "absence", prob = TRUE) %>% dplyr::mutate(class = "absence")) %>% ggplot(., aes(x= Dist_Water, y = yhat, col = class)) + geom_line() + cowplot::theme_cowplot() ```
null
CC BY-SA 4.0
null
2023-02-02T09:57:44.773
2023-02-02T09:57:44.773
null
null
1,798,057
null
75,321,448
2
null
75,313,119
1
null
``` <input type="hidden" name="Solucionado[]" value="0"> <input type="checkbox" name="Solucionado[]" value="1"> ``` Even if the name of the hidden field was fixed so that it matches that of the checkbox - you can not use this solution, when you have multiple checkboxes with the same name. If you had ``` <input type="hidden" name="Foobar" value="0"> <input type="checkbox" name="Foobar" value="1"> ``` then this solution works - because PHP overwrites parameters with the same name, so `$_POST['Foobar']` would contain the `0` the hidden field submits, if the checkbox was not checked, and `1` if it was (because then both `0` and `1` get submitted under the same name, and the later `1` overwrites the earlier `0`.) But if you have fields with `[]` in the name, PHP will not overwrite, but create an array with all the submitted values. That is the behavior that you for your text fields of course - but it prevents this checkbox workaround from working. Because, if you had the above hidden input plus checkbox say, three times, but you check only one of the checkboxes - then that still results in values being submitted: The three hidden inputs all submit their `0`, and the one checked checkbox submits its `1`. So once again, you will not be able to correlate that to your text field values. The only viable solution here is that you explicitly specify the index the value should get in the resulting array, upfront. Your first text input would be named `name="Prob[0]"`, and the checkbox `name="Solucionado[0]"`. And with `[1]` on the next set of fields, and so on. The hidden field gets completely removed. Since you are dynamically appending the form fields using JavaScript, you will need to modify that part to keep a counter, and modify the output in the relevant places accordingly. Then you can loop over `$_POST['Prob']`, and then for each entry check if one with the same index exists in `$_POST['Solucionado']`. But since you need to make modifications in how you create the form to begin with, it might make more sense to change the field names to something like `name="data[0][Prob]"` and `name="data[0][Solucionado]"`. Then you get all the data in `$_POST['data']` organized by numeric index first, and then you have `Prob`, `Solucionado`, etc. below that - with the `Solucionado` still only existing if the respective checkbox was checked. But the data is grouped more logical to begin with.
null
CC BY-SA 4.0
null
2023-02-02T10:02:24.937
2023-02-02T10:02:24.937
null
null
1,427,878
null
75,321,473
2
null
75,321,423
0
null
use weight ``` Column() { Row( Modifier.weight(1f).background(Blue) ){ Text(text = "Weight = 1", color = Color.White) } Row( Modifier.weight(1f).background(Yellow) ) { Text(text = "Weight = 1") } } ```
null
CC BY-SA 4.0
null
2023-02-02T10:04:12.263
2023-02-02T10:04:12.263
null
null
12,916,990
null
75,321,522
2
null
23,955,114
0
null
I have improved the function to remove the appearance of the space when clicking on the last tab :) ``` private static void resetAutomaticScrollingOfTabPaneHeaders(TabPane tabPane) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, NoSuchFieldException { Skin<?> skin = tabPane.getSkin(); TabPaneSkin tabPaneSkin = (TabPaneSkin) skin; // TabePaneSkin.TabHeaderArea Node tabHeaderArea = tabPaneSkin.getChildren().get(tabPaneSkin.getChildren().size() - 1); // The TabHeaderArea seems to be the last child // TabePaneSkin.TabHeaderArea.scrollOffsetDirty Field scrollOffsetDirty = tabHeaderArea.getClass().getDeclaredField("scrollOffsetDirty"); scrollOffsetDirty.setAccessible(true); scrollOffsetDirty.setBoolean(tabHeaderArea, false); // TabePaneSkin.TabHeaderArea.setScrollOffset() Method setScrollOffset = tabHeaderArea.getClass().getDeclaredMethod("setScrollOffset", double.class); setScrollOffset.setAccessible(true); setScrollOffset.invoke(tabHeaderArea, 0); } ```
null
CC BY-SA 4.0
null
2023-02-02T10:09:08.793
2023-02-02T10:09:08.793
null
null
18,119,798
null
75,321,571
2
null
75,299,964
0
null
Your problem can be solved with a "conception" change. I would say I do not try to make a single api url with different behaviors based on the user. To make this work, I advise you to do something like this : Be careful; my answer is on Symfony 6.2, Php 8, and Api Platform 3 ``` #[ApiResource( operations: [ new GetCollection(), new GetCollection( uriTemplate: "/gardens/my-gardens" security: "is_granted('ROLE_USER')" controller: MyGardenController.php ) ], security: "is_granted('ROLE_ADMIN')" )] class Garden {} ``` And inside ``` class MyGardenController extends AbstractController { public function __construct( private Security $security, private GardenRepository $gardenRepository, ) {} public function __invoke() { return $this->gardenRepository->findBy(['user' => $this->security->getUser()); } } ``` So ! What does it do? By default, the Garden entity is only accessible to ADMIN. So by default, `/api/gardens` cant be accessed by a non admin user. But, `/api/gardens/my-gardens` as a custom controller returns only a garden linked to the currently connected user. Just call a different endpoint based on the user role on your front end. But if you want to keep one endpoint, you could do this inside the custom controller : ``` public function __invoke() { if($this->isGranted('ROLE_ADMIN')){ return $this->gardenRepository->findAll(); } return $this->gardenRepository->findBy(['user' => $this->security->getUser()); } ```
null
CC BY-SA 4.0
null
2023-02-02T10:12:55.593
2023-02-16T13:11:56.830
2023-02-16T13:11:56.830
5,164,070
5,164,070
null
75,321,707
2
null
23,615,812
0
null
For me, it was because my WordPress 6.1 had a warning from PHP 8.1 `Return type of Requests_Cookie_Jar::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool` Downgraded to PHP 7.4 and worked properly. you can also check the file for any issues.
null
CC BY-SA 4.0
null
2023-02-02T10:23:03.270
2023-02-02T10:23:03.270
null
null
4,246,792
null
75,321,842
2
null
75,274,836
0
null
What I can suggest is a solution to apply a background color to whole rows of the `DataGrid` using events and the code behind file. Unfortunately I do not know any way to access `DataGridCell` instances using code. In my app, I set an event handler for the `LoadingRow` event: ``` <controls:DataGrid AutoGenerateColumns="False" ItemsSource="{x:Bind ViewModel.Items}" SelectedItem="{x:Bind ViewModel.SelectedItem, Mode=TwoWay}" LoadingRow="OnLoadingRow"> ``` In the code behind file the event handling code sets the background color of the rows depending on some value of the viewmodel that is related to the row: ``` private void OnLoadingRow(object sender, DataGridRowEventArgs e) { DataGrid dataGrid = (DataGrid) sender; ViewModelOfRow viewModelOfRow = (ViewModelOfRow)e.Row.DataContext; if (dataGrid is null) { return; } switch (viewModelOfRow.SomeProperty) { case A: e.Row.Background = new SolidColorBrush(Colors.Green); break; case B: e.Row.Background = new SolidColorBrush(Colors.Yellow); break; default: break; } } ```
null
CC BY-SA 4.0
null
2023-02-02T10:33:43.087
2023-02-02T10:33:43.087
null
null
4,424,024
null
75,322,011
2
null
31,482,237
0
null
I had the same issue. It happened when I've done multiple changes in and clicked sync. As you might guess due to the amount of changes gradle sync was expected to take some time but I've clicked build icon. The build failed with some weird error that I didn't have before and Android Studio stucked the same way as in your case. For me cleaning the project and restarting the Android Studio was enough to get rid of this problem but I was no longer getting gradle popups, so reboot was necessary to fully get rid of this problem.
null
CC BY-SA 4.0
null
2023-02-02T10:46:37.177
2023-02-02T10:46:37.177
null
null
7,624,937
null
75,322,337
2
null
72,063,990
0
null
You need to upgrade Jenkins to the latest version. This will solve the problem.
null
CC BY-SA 4.0
null
2023-02-02T11:14:56.607
2023-02-02T11:14:56.607
null
null
6,548,331
null
75,322,361
2
null
75,321,160
1
null
Your observation is correct. You need to upgrade to MySQL 8 if you want to use `DENSE_RANK()`
null
CC BY-SA 4.0
null
2023-02-02T11:16:58.377
2023-02-02T11:16:58.377
null
null
1,839,439
null
75,322,436
2
null
75,321,345
0
null
Would you try below ? ``` SELECT (SELECT value.string_value FROM t.event_params WHERE key = 'traffic_type') traffic_type FROM `coolclever-1148.analytic_xxxxxx.events_20230130` t WHERE event_name = 'view_item' AND 'page_referrer' IN UNNEST(event_params.key); ``` #### Example Query To show you working example with public dataset: ``` SELECT (SELECT value.string_value FROM t.event_params WHERE key = 'page_location') page_location FROM `bigquery-public-data.ga4_obfuscated_sample_ecommerce.events_*` t WHERE event_name = 'page_view' AND 'page_title' IN UNNEST(event_params.key); ``` [](https://i.stack.imgur.com/VpFw5m.png)
null
CC BY-SA 4.0
null
2023-02-02T11:22:31.323
2023-02-02T11:31:56.763
2023-02-02T11:31:56.763
19,039,920
19,039,920
null
75,322,459
2
null
75,322,327
1
null
Don't use for loops, use [range](https://docs.python.org/3/library/stdtypes.html#range) instead range will return an generator that generates values from an `initial_value` to a `final_value` increasing by a `step_value` on demand. You can then convert this generator into a list which will execute the generation of the elements and give a list with the desired elements as a result. ``` first_elem = sys.argv[1] n_elems = 5 print(list(range(first_elem, first_elem + n_elems))) ``` If you want the number of elements to also be a parameter do ``` first_elem = sys.argv[1] n_elems = sys.argv[2] print(list(range(first_elem, first_elem + n_elems))) ``` and then call your script as ``` $ python3 print_list5.py 2 5 ``` where in this case 2 is the first element and 5 the number of elements
null
CC BY-SA 4.0
null
2023-02-02T11:24:25.640
2023-02-02T11:34:54.087
2023-02-02T11:34:54.087
20,396,240
20,396,240
null
75,322,663
2
null
75,322,327
0
null
A simple way to achieve it using for loops is: ``` import sys my_list = [int(sys.argv[1])] list_length = 5 for x in range(list_length-1): my_list.append(my_list[-1] + 1) print(my_list) ``` - - Here is the result: [](https://i.stack.imgur.com/NVESX.png)
null
CC BY-SA 4.0
null
2023-02-02T11:42:48.147
2023-02-02T11:42:48.147
null
null
18,016,764
null
75,322,683
2
null
74,820,227
0
null
Check if the `npm` folder lies under `%AppData%`. If so then copy/move the `npm` folder to a path which has no space in it (`C:\npm` e.g.). Then change the `npm` path within your `PATH` environment variables to the path you chose before. Close all command-line windows (if any open), open a new window and try your command. If you still run into issues type `path` in the command line und check whether your changes had been saved.
null
CC BY-SA 4.0
null
2023-02-02T11:44:23.897
2023-02-02T11:44:23.897
null
null
21,127,886
null
75,322,791
2
null
75,322,327
0
null
This is the optimized solution, I use list comprehension works like a charm. List comprehension creates a new list based on existing ones. ``` import sys input_sys = int(sys.argv[1]) print([input_sys if i == input_sys else i for i in range(input_sys, input_sys + 5)]) ```
null
CC BY-SA 4.0
null
2023-02-02T11:54:01.113
2023-02-02T11:54:01.113
null
null
20,595,559
null
75,323,150
2
null
75,322,955
0
null
After setting response in setValorCusto ; you can loop over you state variable and get the desired value
null
CC BY-SA 4.0
null
2023-02-02T12:25:17.423
2023-02-02T12:25:17.423
null
null
21,079,539
null
75,323,339
2
null
75,322,955
0
null
Like the other answers state. What you are returning from your API is an array of objects. Currently in your code, that array lives inside the response object. So in this snippet below: ``` axios.get('MY API LINK').then((res) => { let valor = res.detalhe.valor_custo_fornecedor; ``` You need to specify from which item in the array you would like to get the object from (like res[0].detalhe). One way you could do if you like to use everything from the array, is to store the entire array in your useState. Afterwards, you could loop over the array and do something with the objects inside of it. PS. If you're not entirely sure what the state holds. You could log it to the page by doing something like `<div>{JSON.stringify(valorCusto)}</div>` ``` export default function App() { const [valorCusto, setValorCusto] = useState(null); useEffect(() => { const getData = async () => { const res = await axios.get("API"); const data = await res.data; setValorCusto(data); }; getData(); }, []); return ( <main> <div> {valorCusto.map((item) => { <div>{item.id}</div>; })} </div> </main> ); } ```
null
CC BY-SA 4.0
null
2023-02-02T12:39:50.373
2023-02-02T12:39:50.373
null
null
10,475,553
null
75,323,518
2
null
75,322,955
0
null
You can convert json like this: ``` useEffect(() => { axios.get('MY API LINK').then((res) => { let obj = JSON.parse(res.detalhe.valor_custo_fornecedor) }); }); ```
null
CC BY-SA 4.0
null
2023-02-02T12:55:41.093
2023-02-02T12:55:41.093
null
null
12,716,453
null
75,323,515
2
null
28,239,635
0
null
You are able to see processing UI if you use next `PKPaymentAuthorizationViewControllerDelegate` method calling `completion` ``` func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod, handler completion: @escaping (PKPaymentRequestPaymentMethodUpdate) -> Void) ``` To fix it just call `completion`: ``` extension SomeViewController: PKPaymentAuthorizationViewControllerDelegate { public func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod, handler completion: @escaping (PKPaymentRequestPaymentMethodUpdate) -> Void) { //as an example let paymentMethodUpdate = PKPaymentRequestPaymentMethodUpdate(paymentSummaryItems: [ PKPaymentSummaryItem(label: "someLabel", amount: 0.01) ]) completion(paymentMethodUpdate) } } ``` As you can see here you have `PKPaymentMethod` which actually provides you `PKPaymentMethodType` (Credit, Debit...) all others variable will be `nil` at this moment. They are will be filled when you authorize(`didAuthorizePayment`) - `PKPayment.PKPaymentToken.PKPaymentMethod` Please note that it is a place for extra logic that is why use it when you need it for reaching your goals. It means if you don't need this extra logic just remove this method
null
CC BY-SA 4.0
null
2023-02-02T12:55:16.927
2023-02-04T15:04:10.937
2023-02-04T15:04:10.937
4,770,877
4,770,877
null
75,323,581
2
null
75,322,955
0
null
It is hard to tell without seeing the complete json what key/value pairs exist in the data, but from what I can see you are passing a value that does not seem to exist in the data to `setValorCusto`, namely: `res.valorCusto.valor_custo_fornecedor` I am guessing what you want to pass to `setValorCusto` is the `valor` variable that you have defined above? However the `res.data.detalhe`is as others have replied an array, which you would either have to iterate through or specify an index for. Another detail, not relating to the question in itself, is that I would add a dependency array to the effect, so that this api request is not called on every component re-render. So the end result would look something like this: ``` const [valorCusto, setValorCusto] = useState([]); useEffect(() => { axios.get('MY API LINK').then((res) => { const valor = res.data.detalhe.map((detalheItem) => { return detalheItem.valor_custo_fornecedor; }); setValorCusto(valor); }); }, []); ``` Notice the empty array as the second parameter in the `useEffect` call. This means that the effect will only be run on the initial rendering of the component. Then you can access the value by simply using `valorCusto` wherever you need it in the component.
null
CC BY-SA 4.0
null
2023-02-02T13:01:22.140
2023-02-02T19:53:23.213
2023-02-02T19:53:23.213
19,616,766
19,616,766
null
75,323,799
2
null
75,322,892
0
null
dont see event handler in your code so textchanged nether triggered. change sub declaration as : ``` Private Sub TxtBox_IPAdress_TextChanged(sender As Object, e As EventArgs) Handles TxtBox_IPAdress.TextChanged ``` you can use debugger to fix this kind of problem by stopping on sub call.
null
CC BY-SA 4.0
null
2023-02-02T13:20:14.290
2023-02-02T13:20:14.290
null
null
21,072,673
null
75,323,939
2
null
53,406,548
0
null
For me it was the `path` package. ``` // import 'package:path/path.dart'; This line source of the error import 'package:path/path.dart' as Path; ``` ``` // join() Path.join() ```
null
CC BY-SA 4.0
null
2023-02-02T13:32:48.990
2023-02-02T13:32:48.990
null
null
12,042,898
null
75,324,125
2
null
75,323,763
0
null
See [here](https://stackoverflow.com/questions/44069065/how-do-i-make-my-function-to-run-every-second-in-python#44069427) (How do I make my function run every second) how to use tkinter `after()` to achieve what you want. `time.sleep` won't work for your purpose because it is blocking the execution of the entire code. From the [link](https://stackoverflow.com/questions/2400262/how-can-i-schedule-updates-f-e-to-update-a-clock-in-tkinter) given in the comment to your question by : > Tkinter root windows have a method called `after()` which can be used to schedule a function to be called after a given period of time. If that function itself calls `after()` you've set up an automatically recurring event.
null
CC BY-SA 4.0
null
2023-02-02T13:50:03.053
2023-02-02T13:58:12.917
2023-02-02T13:58:12.917
7,711,283
7,711,283
null
75,324,277
2
null
75,324,154
1
null
Try this: ``` New Table = SUMMARIZE( 'Table', 'Table'[Column2], "Column1", CONCATENATEX('Table','Table'[Column1], "|") ) ``` [](https://i.stack.imgur.com/Ibj0G.png)
null
CC BY-SA 4.0
null
2023-02-02T14:01:51.400
2023-02-02T14:01:51.400
null
null
7,108,589
null
75,324,283
2
null
75,323,916
4
null
I agree wholly with @tjebo's comment, sometimes adding so much text is not the best way. But sometimes it is mandated (out of our control), so I suggest addressing one of your complaints: > `geom_text_repel()` is moving labels that don't need to be moved We can use `geom_text` on most (filtering by percentage sales) and `geom_text_repel` on the few. Normally, I'd use `data = ~ filter(., pct_of_year_sales <= 0.015))` (and `>` for the main), but the stacking is disrupted when the number and values of columns are disrupted. Instead, we can create two sets of labels where some are empty (`""` or `NA`) depending on their `pct_of_year_sales` value. This way, `geom_text_repel` gets to see all columns/values and will place them appropriately. ``` dat <- sales %>% group_by(year, product) %>% summarise(sales=sum(sales), .groups="drop") %>% mutate(pct_of_year_sales = sales/sum(sales), label = paste( scales::label_dollar(scale=1/1E6, suffix="M", accuracy=0.1)(sales), scales::label_percent(accuracy=0.1)(pct_of_year_sales), sep=", ")) %>% mutate( label1 = if_else(pct_of_year_sales > 0.015, label, NA_character_), label2 = if_else(pct_of_year_sales <= 0.015, label, NA_character_) ) p <- ggplot(dat, aes(x=year, y=sales, fill=product, label=label1)) + geom_col() + scale_y_continuous(labels = scales::label_dollar(scale=1/1E6, suffix="M"), expand = expansion(mult = c(0, .05))) + geom_text(position=position_stack(vjust=0.5), na.rm = TRUE) + labs(title="geom_text()", subtitle="overlapping labels") p ``` [](https://i.stack.imgur.com/IGEi7.png) ``` p + ggrepel::geom_text_repel( min.segment.length = 0, force = 10, aes(label = label2), position=position_stack(vjust = 0.5), hjust = 0.25, direction="y", na.rm=TRUE) ``` [](https://i.stack.imgur.com/juLBh.png) I added `hjust=` to shift them a little, also helping to clarify the segment lines (without `hjust`, they tend to connect with the commas, which is a visually-distracting artifact). You may want to play with `force=` or other segment-line aesthetics to break them out more clearly. (It would be feasible, for instance, to define `hjust` within the frame itself and assign that aesthetic within `aes(..)` instead, in order to control the horizontal justification per-year, for instance. Just a thought.)
null
CC BY-SA 4.0
null
2023-02-02T14:02:16.197
2023-02-02T14:02:16.197
null
null
3,358,272
null
75,324,403
2
null
75,324,154
0
null
You can create a measure like this: ``` MyMeasure = CONCATENATEX(MyTable, MyTable[Column1], "|") ```
null
CC BY-SA 4.0
null
2023-02-02T14:12:58.630
2023-02-02T14:12:58.630
null
null
2,568,521
null
75,324,433
2
null
75,323,048
0
null
Assuming that your `userId` is the `dUD7M...` value in the screenshot you shared, the data snapshot you get will contain the data for both child nodes in that screenshot. You can loop over those children with: ``` const userId = await AsyncStorage.getItem('uid') database() .ref(`Products/${userId}`) .on('value', snapshot => { snapshot.forEach((data) => { // console.log(data.val()) }); }); ```
null
CC BY-SA 4.0
null
2023-02-02T14:15:00.003
2023-02-02T14:15:00.003
null
null
209,103
null
75,324,469
2
null
54,513,641
1
null
Use it : ``` Column( children: const <Widget>[ Align( alignment: Alignment.centerLeft, child: Text('Text 1') ), Align( alignment: Alignment.centerLeft, child: Text('Text 2') ), ], ) ```
null
CC BY-SA 4.0
null
2023-02-02T14:18:03.343
2023-02-02T14:18:03.343
null
null
20,511,465
null
75,324,515
2
null
75,316,953
0
null
You can do it with [Sphere Mask node](https://docs.unity3d.com/Packages/[email protected]/manual/Sphere-Mask-Node.html) : [](https://i.stack.imgur.com/IRdBT.png) And link `Out` to the Alpha property (if your `Surface Type` is set to `Opaque` then, check the `Alpha Clipping` in your Graph settings).
null
CC BY-SA 4.0
null
2023-02-02T14:21:40.697
2023-02-02T14:54:58.307
2023-02-02T14:54:58.307
12,933,771
12,933,771
null
75,324,715
2
null
75,323,916
4
null
I think I like @r2evans answer better, as it utilizes the tools as they're meant to be used. I went a different route. It's really never too early to start learning about the grid... This uses the libraries `grid` and `gridExtra`. First, I saved the plot to an object, and investigated where the labels were and what settings were applied (using `geom_text`, not `...repel`). In `grid`, you can set the justification for each label. So I made the vertical justification of those values in `C` to 0 and in `D` to 1. This was enough in my plot pane... however, depending on the size of your graph, you may have to go to values that are further apart. Just remember that .5 is the middle, not 0. See my code comments for a more in-depth explanation. ``` library(grid) library(gridExtra) pp <- p + geom_text(position=position_stack(vjust=0.5)) + labs(title="geom_text()", subtitle="overlapping labels") pg <- ggplotGrob(pp) # create grid (gtable) of graph # the labels in geom_text pg$grobs[[6]]$children$GRID.text.246$label # use this to see the label order # lbls top to btm then left to right # get vjust to modify gimme <- pg$grobs[[6]]$children$GRID.text.246$vjust # which indices need to change (C and D labels) ttxt <- seq(from = 3, by = 5, length.out = 4) # 5 labels in column btxt <- seq(from = 4, by = 5, length.out = 4) # 4 columns gimme[ttxt] <- 0 # set C to top of vspace gimme[btxt] <- 1 # set D to bottom of vspace # replace existing vjust pg$grobs[[6]]$children$GRID.text.246$vjust <- gimme ``` You can view the plot with grid or change it back to a `ggplot` object. To change it back to a ggplot object you can either use `ggplotify::as.ggplot` or `ggpubr::as_ggplot`, they do the same thing. ``` plot.new() grid.draw(pg) # back to ggplot obj ggpubr::as_ggplot(pg) ``` [](https://i.stack.imgur.com/xedQh.png)
null
CC BY-SA 4.0
null
2023-02-02T14:36:52.487
2023-02-02T14:36:52.487
null
null
5,329,073
null
75,324,865
2
null
53,062,386
0
null
``` //Swift 5 Solution within a function with a bit different approach in case negative numbers in test-cases func sumDiagonally(arr:[[Int]])-> Int{ var subn = 0 var sum1st = 0 var sum2nd = 0 for i in 0..<arr.count{ sum1st += arr[i][i] sum2nd += arr[i][arr.count-i-1] subn = sum1st - sum2nd if sum1st < sum2nd{ subn = subn * -1 } } return subn } sumDiagonally(arr: [[1,2,3], [4,5,6], [9,8,9]]) ```
null
CC BY-SA 4.0
null
2023-02-02T14:47:24.103
2023-02-02T14:47:54.943
2023-02-02T14:47:54.943
21,134,047
21,134,047
null
75,324,969
2
null
71,702,448
0
null
I was facing similar issue with Windows 10 and Docker Desktop 4.16.3 (96739) I had disabled WSL2 based engine. Just executed below command using Power shell( admin): ``` wsl --unregister docker-desktop-data wsl --unregister docker-desktop ``` And my issue got solved like snap of finger. Thanks
null
CC BY-SA 4.0
null
2023-02-02T14:54:43.233
2023-02-02T17:05:20.603
2023-02-02T17:05:20.603
1,030,169
21,134,145
null
75,325,114
2
null
75,321,423
0
null
You can use a `row` and set modifier `weight: 1f`: ``` Row { TextField( value = "Test Test Test Test Test Test Test Test Test Test Test Test" + " Test Test Test Test Test Test Test Test ", onValueChange = {}, modifier = Modifier.weight(1f) ) TextField( value = "Test Test Test Test Test Test TesTest Test Test Test " + "Test Test Test Test Test Test Test Test Test ", onValueChange = {}, modifier = Modifier.weight(1f) ) } ``` and if you want to have the second TextField in the next line if it's breaking line, you can use FlowRow [https://google.github.io/accompanist/flowlayout](https://google.github.io/accompanist/flowlayout)
null
CC BY-SA 4.0
null
2023-02-02T15:06:00.537
2023-02-02T15:06:00.537
null
null
5,131,801
null
75,325,604
2
null
15,472,158
1
null
Way overdue but should someone be looking for an answer like I was, a colleague showed me to make a group aesthetic with an interaction like so: ``` dat <- structure(list(Treatment = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("A", "B"), class = "factor"), Temp = structure(c(1L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L), .Label = c("10", "20"), class = "factor"), Rep = c(1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L), Meas = c(3L, 2L, 2L, 2L, 6L, 4L, 4L, 3L, 5L, 1L, 2L, 3L), SD = c(2L, 3L, 2L, 2L, 2L, 3L, 2L, 3L, 3L, 3L, 2L, 1L)), .Names = c("Treatment", "Temp", "Rep", "Meas", "SD"), row.names = c(NA, -12L), class = "data.frame") ggplot(dat, aes(x = Treatment, y = Meas, ymin = Meas - SD/2, ymax = Meas + SD/2)) + geom_linerange(aes(color = Temp, group = interaction(Rep, Temp)), position=position_dodge(width=c(0.6)), size = 1, alpha = 0.5) + geom_point(aes(color = Temp, shape = Temp, group = interaction(Rep, Temp)), position=position_dodge(width=c(0.6)), size = 3) + theme_bw() ```
null
CC BY-SA 4.0
null
2023-02-02T15:45:09.457
2023-02-02T15:45:43.650
2023-02-02T15:45:43.650
21,134,538
21,134,538
null
75,325,722
2
null
75,325,352
1
null
You could try this regex pattern: `[^][a-z_A-Z0-9()]` ``` SELECT REGEXP_REPLACE('MSD_40001_ME_SPE_[XXXX]_Technical_%Specification_REV@9_(2021_05_27)_xls', '[^][a-z_A-Z0-9()]', '_') FROM DUAL ``` To specify a right bracket (]) in the bracket expression, place it first in the list (after the initial circumflex (^), if any). See demo [here](https://dbfiddle.uk/-ZrXEhri)
null
CC BY-SA 4.0
null
2023-02-02T15:54:11.840
2023-02-02T15:54:11.840
null
null
7,430,869
null
75,325,829
2
null
74,857,935
0
null
Try this. ``` def split_column(df,col,sep="|"): l = df[col].str.split(sep) for col_name, values in zip(l[::2],l[1::2]): df[col_name] = values df = df.drop(columns=col) return df split_column(df,"Orignal") ``` [Test](https://i.stack.imgur.com/CFlZo.png)
null
CC BY-SA 4.0
null
2023-02-02T16:02:09.433
2023-02-02T19:34:18.580
2023-02-02T19:34:18.580
17,749,677
17,749,677
null
75,325,837
2
null
75,322,437
0
null
In this case I usually use when() and whereHas() (assuming you have model StudentSubject and have the relationship). It will look like this: ``` $student = Student::select('*') ->when(!empty($request->location), function ($query) use($request) { $query->whereIn('location', $request->location); }) ->when(!empty($request->gender), function ($query) use($request) { $query->whereIn('gender', $request->gender); }) ->when(!empty($request->subjects), function ($query) use($request){ $query->whereHas('StudentSubject',function($sub) use($request) { return $sub->whereIn('subject_id',$request->subjects); }); }) ->get(); ``` I don't know your $request->subjects format so I assuming it's just the usual array like [1,2,3].
null
CC BY-SA 4.0
null
2023-02-02T16:02:37.853
2023-02-02T16:02:37.853
null
null
9,365,470
null
75,325,848
2
null
75,325,352
0
null
From Regexp.Info, > One key syntactic difference is that the backslash is NOT a metacharacter in a POSIX bracket expression. So in POSIX, the regular expression [\d] matches a \ or a d. To match a ], put it as the first character after the opening [ or the negating ^. To match a -, put it right before the closing ]. To match a ^, put it before the final literal - or the closing ]. Put together, []\d^-] matches ], , d, ^ or -.
null
CC BY-SA 4.0
null
2023-02-02T16:03:13.203
2023-02-02T16:03:13.203
null
null
5,440,883
null
75,325,971
2
null
75,325,885
1
null
You can use `GROUP_CONCAT` for this purpose: ``` SELECT ID, GROUP_CONCAT(TitleUid) As TitleUid, GROUP_CONCAT(Title) AS Title, GROUP_CONCAT(types) AS types FROM my_table GROUP BY ID; -- ID TitleUid Title types -- 1 asd,dsa,ssd title1,title2,title3 typeA,typeB,typeC -- 2 asd,ssf title1,title2 typeB,typeC -- 3 ssf,xcv,zxc title1,title2,title3 typeA,typeB,typeC ```
null
CC BY-SA 4.0
null
2023-02-02T16:12:54.617
2023-02-02T16:12:54.617
null
null
1,238,019
null
75,326,473
2
null
75,326,403
0
null
Fixed! Image needed to be placed within a container that includes `flex-wrap: wrap`. ``` <div className="flex-wrap flex-1"> <img src={`/desktop-mockup.png`} className="max-w-100 rounded-lg flex-1"/> </div> ```
null
CC BY-SA 4.0
null
2023-02-02T16:55:02.197
2023-02-04T20:15:30.847
2023-02-04T20:15:30.847
14,945,696
3,713,090
null
75,326,848
2
null
73,272,301
0
null
Fundamentally, Whatsapp webhook servers won't accept links which are exposed by Ngrok as a Callback url. Because these kind of urls have been identified as malicious and/or abusive. You need to go with your script on a server and use as the webhook a valid domain with certified ssl like [https://example.com/webhook](https://example.com/webhook) [https://listener.example.com/webhook](https://listener.example.com/webhook)
null
CC BY-SA 4.0
null
2023-02-02T17:29:26.587
2023-02-02T17:29:26.587
null
null
1,238,917
null
75,326,965
2
null
75,307,960
0
null
We have analyzed your code snippet, we suspect that the classes that contain the AllSeries and AllSeriesVisibility properties are the same. The remaining binding properties for the series should be in the AllSeries value object when you specify BindingContext as the AllSeries Key object, not in the AllSeries parent class. Based on your code snippet, we created a simple sample that functions properly when given the right class structure as shown below. Additionally, VisibilityonLegend will function flawlessly. ``` <chart:SfChart x:Name="Chart" Margin="10"> <chart:SfChart.Resources> <local:VisibilityConverter x:Key="BoolToVisiblity"/> </chart:SfChart.Resources> . . . <chart:FastLineBitmapSeries DataContext="{Binding AllSeries[Series1]}" ItemsSource="{Binding ChartData}" Label="series1" VisibilityOnLegend="{Binding AllSeriesVisibility[Series1], Converter={StaticResource BoolToVisiblity}}" XBindingPath="XValue" YBindingPath="YValue1" /> <chart:FastLineBitmapSeries DataContext="{Binding AllSeries[Series2]}" ItemsSource="{Binding ChartData}" Label="series2" VisibilityOnLegend="{Binding AllSeriesVisibility[Series2], Converter={StaticResource BoolToVisiblity }}" XBindingPath="XValue" YBindingPath="YValue2" /> . . . </chart:SfChart> public class ViewModel { public Dictionary<string, ViewModel1> AllSeries { get; set; } = new Dictionary<string, ViewModel1>(); public string Series1Name { get; set; } = "Series1"; public string Series2Name { get; set; } = "Series2"; public ViewModel() { AllSeries["Series1"] = new ViewModel1(false); AllSeries["Series2"] = new ViewModel1(true); } } public class ViewModel1 { private ObservableCollection<DataPoint> _chartData; public ObservableCollection<DataPoint> ChartData { get { return _chartData; } set { _chartData = value; } } public Dictionary<string, bool> AllSeriesVisibility { get; set; } = new Dictionary<string, bool>(); public ViewModel1(bool value) { AllSeriesVisibility["Series1"] = value; AllSeriesVisibility["Series2"] = value; var vTemp = new ObservableCollection<DataPoint>(); var random = new Random(); for (var i = 1; i < 15; i++) { vTemp.Add(new DataPoint { XValue = i, YValue1 = random.NextDouble(), YValue2=random.NextDouble() }); } ChartData = vTemp; } } ``` Please check this and let us know if you need any further assistance. Regards, Muneesh Kumar G
null
CC BY-SA 4.0
null
2023-02-02T17:38:09.843
2023-02-02T17:38:09.843
null
null
2,068,221
null
75,327,661
2
null
65,395,153
0
null
Another way is: 1. Click on "Settings", 2. Click on "Compiler", 3. Click on "Linker settings" tab, 4. Click on "Add", 5. Type "libm.a" and "OK", 6. Click on "OK" and that's all. You're ready lo link against math library on linux using gcc (Don't forget "#include <math.h>" in your source code).
null
CC BY-SA 4.0
null
2023-02-02T18:44:38.737
2023-02-02T18:44:38.737
null
null
13,159,736
null
75,327,688
2
null
13,600,705
0
null
In oracle this works for me! :D ``` select amt||'-'||endamt as amount from mstcatrule ```
null
CC BY-SA 4.0
null
2023-02-02T18:47:59.687
2023-02-02T18:47:59.687
null
null
9,535,290
null
75,328,149
2
null
19,675,894
1
null
Step 1: Create an ENUM (for horizontal and vertical selection) Step 2: Create an extension of UIView and apply it in any uiView. Example: ``` enum GradientColorDirection { case vertical case horizontal } ``` ``` extension UIView { func createGradient(opacity: Float = 1, direction: GradientColorDirection = .vertical) { let colors: [UIColor] = [UIColor.red, UIColor.yellow, UIColor.green, UIColor.systemBlue, UIColor.blue, UIColor.systemPink, UIColor.red] let gradientLayer = CAGradientLayer() gradientLayer.opacity = opacity gradientLayer.colors = colors.map { $0.cgColor } if case .horizontal = direction { gradientLayer.startPoint = CGPoint(x: 0.0, y: 0.0) gradientLayer.endPoint = CGPoint(x: 1.0, y: 0.0) } gradientLayer.bounds = self.bounds gradientLayer.anchorPoint = CGPoint.zero self.layer.addSublayer(gradientLayer) } } ``` Usage: ``` let gradientView: UIView gradientView.createGradient() ``` [](https://i.stack.imgur.com/IAz2F.jpg)
null
CC BY-SA 4.0
null
2023-02-02T19:35:48.800
2023-02-02T19:35:48.800
null
null
4,829,205
null
75,328,255
2
null
75,328,224
0
null
One of the endless joys of working with Visual Studio are random inexplicable times it stops working the way it should. Usually these steps work: 1. Close VS completely 2. Ensure all bin and obj directories of all projects are cleared 3. In the same directory as your solution should be a hidden .vs directory. Delete this. Reopen VS and your solution. You should be back to a normal state within a few moments. Sometimes a "Rebuild All" can accelerate its return to normality too.
null
CC BY-SA 4.0
null
2023-02-02T19:48:14.300
2023-02-02T19:48:14.300
null
null
4,467,670
null
75,328,455
2
null
75,327,108
0
null
If you see a git credential message, it means the remote URL is an HTTPS one. SSH is not involved. For GitHub, the "login" keychain password is your [PAT (Personal Access Token)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).
null
CC BY-SA 4.0
null
2023-02-02T20:10:42.877
2023-02-02T20:10:42.877
null
null
6,309
null
75,328,704
2
null
43,707,620
0
null
One common issue is that `Date` column looks like `datetime64` but is actually `object`. So changing the dtype fixes that issue. N.B. Passing the datetime `format=` makes the conversion run much, much faster (see [this answer](https://stackoverflow.com/a/75277434/19123103) for more info). ``` df['Date'] = pd.to_datetime(df['Date'], format='%Y-%m-%d') df.plot(x='Date', y='Result', kind='scatter', rot=90) ```
null
CC BY-SA 4.0
null
2023-02-02T20:41:18.530
2023-02-02T20:41:18.530
null
null
19,123,103
null
75,329,096
2
null
75,328,835
0
null
To resolve this issue, i notice that i had the box selected for "My Data has Headers". Once i unselected the box, i was able to achieve the results of the sentiment analysis. [enter image description here](https://i.stack.imgur.com/kJXbw.png)
null
CC BY-SA 4.0
null
2023-02-02T21:23:22.023
2023-02-02T21:23:22.023
null
null
20,826,220
null
75,329,177
2
null
75,328,959
0
null
use useState for handle active state: ``` const [isactive,setActive] = useState(false) ``` in JSX: ``` <label onClick={()=>setActive(isactive?false:true)} className= {`${isactive?'active-style':'normal-style'} extra-style-classes`} > <input type="checkbox" id="choose-me" className= {`${isactive?'active-style':'normal-style'} extra-style-classes`} /> Check me </label> ```
null
CC BY-SA 4.0
null
2023-02-02T21:33:27.990
2023-02-02T21:33:27.990
null
null
17,707,830
null
75,329,275
2
null
75,329,085
2
null
There are penalties for EAV. I'm not saying EAV is evil, but should be deployed carefully and with great forethought. Here are two examples. The first is a `PIVOT`, and the second is a `conditional aggregation`. I tend to lean towards the `conditional aggregation`, it offers more flexibility and often a performance bump Untested for you did not supply sample data and desired results as text ``` Select * From ( Select A.product_id ,A.product_name ,B.product_property ,B.product_property_value From Product A Join ProductProperties B on A.product_id=B.product_di ) src Pivot (max( product_property_value ) for product_property in ([Price],[Category],[Status] ) ) pvt ``` --- ``` Select A.product_id ,A.product_name ,Price = max( case when product_propery='Price' then product_propery_value end) ,Category = max( case when product_propery='Category' then product_propery_value end) ,Status = max( case when product_propery='Status' then product_propery_value end) From Product A Join ProductProperties B on A.product_id=B.product_di Group By A.product_id,A.product_name ```
null
CC BY-SA 4.0
null
2023-02-02T21:45:22.767
2023-02-02T22:19:38.110
2023-02-02T22:19:38.110
1,570,000
1,570,000
null
75,329,325
2
null
75,329,085
1
null
``` SELECT b.product_id ,b.product_name ,Price = MAX(IIF(p.product_property = 'Price',p.product_property_value,NULL)) ,Category = MAX(IIF(p.product_property = 'Category',p.product_property_value,NULL)) ,Status = MAX(IIF(p.product_property = 'Status',p.product_property_value,NULL)) FROM books b (nolock) JOIN prodprop p (nolock) ON b.product_id = p.product_id GROUP BY b.product_id,b.product_name ```
null
CC BY-SA 4.0
null
2023-02-02T21:52:43.877
2023-02-02T21:52:43.877
null
null
8,792,491
null